@aku11i/phantom 6.3.0-1 → 6.3.0-3

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,52 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((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.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function ee(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function j(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(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 te(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,te(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ee(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),te(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ee(a,u),c+=te(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ee(a,u++),c+=te(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return te(j(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 M(e,t,n){if(e==null)return e;var r=[],i=0;return te(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ne(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var N=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)},P={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=P,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},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=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.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 E(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)T.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 E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ne}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,N)}catch(e){N(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.5`})),u=o(((e,t)=>{t.exports=l()})),d=o((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&&ee(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&&ee(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 ee(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,ee(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}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();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`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(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.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 o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.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=c(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=c(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})}}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=c(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=c(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})}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 s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.5`})),m=o(((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=p()})),h=o((e=>{var t=f(),n=u(),r=m();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){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n: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 d(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 p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),ee=Symbol.iterator;function j(e){return typeof e!=`object`||!e?null:(e=ee&&e[ee]||e[`@@iterator`],typeof e==`function`?e:null)}var te=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var ne=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},ie=[],ae=-1;function oe(e){return{current:e}}function F(e){0>ae||(e.current=ie[ae],ie[ae]=null,ae--)}function I(e,t){ae++,ie[ae]=e.current,e.current=t}var se=oe(null),ce=oe(null),le=oe(null),ue=oe(null);function de(e,t){switch(I(le,t),I(ce,e),I(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}F(se),I(se,e)}function fe(){F(se),F(ce),F(le)}function pe(e){e.memoizedState!==null&&I(ue,e);var t=se.current,n=Hd(t,e.type);t!==n&&(I(ce,e),I(se,n))}function me(e){ce.current===e&&(F(se),F(ce)),ue.current===e&&(F(ue),Qf._currentValue=re)}var he,ge;function _e(e){if(he===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);he=t&&t[1]||``,ge=-1<e.stack.indexOf(`
2
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
- `+he+e+ge}var ve=!1;function ye(e,t){if(!e||ve)return``;ve=!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}e.call(n.prototype)}}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(`
4
- `),l=s.split(`
5
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
- `+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{ve=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?_e(n):``}function be(e,t){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e(`Lazy`);case 13:return e.child!==t&&t!==null?_e(`Suspense Fallback`):_e(`Suspense`);case 19:return _e(`SuspenseList`);case 0:case 15:return ye(e.type,!1);case 11:return ye(e.type.render,!1);case 1:return ye(e.type,!0);case 31:return _e(`Activity`);default:return``}}function xe(e){try{var t=``,n=null;do t+=be(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
- Error generating stack: `+e.message+`
8
- `+e.stack}}var Se=Object.prototype.hasOwnProperty,Ce=t.unstable_scheduleCallback,we=t.unstable_cancelCallback,Te=t.unstable_shouldYield,Ee=t.unstable_requestPaint,De=t.unstable_now,Oe=t.unstable_getCurrentPriorityLevel,ke=t.unstable_ImmediatePriority,Ae=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,Pe=t.log,Fe=t.unstable_setDisableYieldValue,Ie=null,Le=null;function L(e){if(typeof Pe==`function`&&Fe(e),Le&&typeof Le.setStrictMode==`function`)try{Le.setStrictMode(Ie,e)}catch{}}var R=Math.clz32?Math.clz32:Be,Re=Math.log,ze=Math.LN2;function Be(e){return e>>>=0,e===0?32:31-(Re(e)/ze|0)|0}var Ve=256,He=262144,Ue=4194304;function We(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&261888;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 Ge(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=We(n))):i=We(o):i=We(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=We(n))):i=We(o)):i=We(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 Ke(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function qe(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 Je(){var e=Ue;return Ue<<=1,!(Ue&62914560)&&(Ue=4194304),e}function Ye(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ze(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-R(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&&Qe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Qe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-R(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function $e(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-R(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function z(e,t){var n=t&-t;return n=n&42?1:et(n),(n&(e.suspendedLanes|t))===0?n:0}function et(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 tt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function nt(){var e=P.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function rt(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var it=Math.random().toString(36).slice(2),at=`__reactFiber$`+it,ot=`__reactProps$`+it,st=`__reactContainer$`+it,ct=`__reactEvents$`+it,lt=`__reactListeners$`+it,ut=`__reactHandles$`+it,dt=`__reactResources$`+it,ft=`__reactMarker$`+it;function pt(e){delete e[at],delete e[ot],delete e[ct],delete e[lt],delete e[ut]}function mt(e){var t=e[at];if(t)return t;for(var n=e.parentNode;n;){if(t=n[st]||n[at]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[at])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function ht(e){if(e=e[at]||e[st]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function gt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function _t(e){var t=e[dt];return t||=e[dt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function vt(e){e[ft]=!0}var yt=new Set,bt={};function xt(e,t){St(e,t),St(e+`Capture`,t)}function St(e,t){for(bt[e]=t,e=0;e<t.length;e++)yt.add(t[e])}var Ct=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]*$`),wt={},Tt={};function Et(e){return Se.call(Tt,e)?!0:Se.call(wt,e)?!1:Ct.test(e)?Tt[e]=!0:(wt[e]=!0,!1)}function Dt(e,t,n){if(Et(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 Ot(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 kt(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 B(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function At(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 Mt(e){if(!e._valueTracker){var t=At(e)?`checked`:`value`;e._valueTracker=jt(e,t,``+e[t])}}function Nt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=At(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Pt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Ft=/[\n"\\]/g;function It(e){return e.replace(Ft,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Lt(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=``+B(t)):e.value!==``+B(t)&&(e.value=``+B(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):zt(e,o,B(n)):zt(e,o,B(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=``+B(s):e.removeAttribute(`name`)}function Rt(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)){Mt(e);return}n=n==null?``:``+B(n),t=t==null?n:``+B(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),Mt(e)}function zt(e,t,n){t===`number`&&Pt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Bt(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=``+B(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 Vt(e,t,n){if(t!=null&&(t=``+B(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+B(n)}function Ht(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ne(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=B(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Mt(e)}function Ut(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Wt=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 Gt(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||Wt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Kt(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]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Gt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Gt(e,o,t[o])}function V(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 qt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Jt=/^[\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 Yt(e){return Jt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Xt(){}var Zt=null;function Qt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $t=null,en=null;function tn(e){var t=ht(e);if(t&&(e=t.stateNode)){var n=e[ot]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Lt(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="`+It(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ot]||null;if(!a)throw Error(i(90));Lt(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&&Nt(r)}break a;case`textarea`:Vt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Bt(e,!!n.multiple,t,!1)}}}var nn=!1;function rn(e,t,n){if(nn)return e(t,n);nn=!0;try{return e(t)}finally{if(nn=!1,($t!==null||en!==null)&&(vu(),$t&&(t=$t,e=en,en=$t=null,tn(t),e)))for(t=0;t<e.length;t++)tn(e[t])}}function an(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ot]||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 on=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),sn=!1;if(on)try{var cn={};Object.defineProperty(cn,`passive`,{get:function(){sn=!0}}),window.addEventListener(`test`,cn,cn),window.removeEventListener(`test`,cn,cn)}catch{sn=!1}var ln=null,un=null,dn=null;function fn(){if(dn)return dn;var e,t=un,n=t.length,r,i=`value`in ln?ln.value:ln.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 pn(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 mn(){return!0}function hn(){return!1}function gn(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)?mn:hn,this.isPropagationStopped=hn,this}return h(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=mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=mn)},persist:function(){},isPersistent:mn}),t}var _n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},H=gn(_n),vn=h({},_n,{view:0,detail:0}),yn=gn(vn),bn,U,xn,Sn=h({},vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nn,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!==xn&&(xn&&e.type===`mousemove`?(bn=e.screenX-xn.screenX,U=e.screenY-xn.screenY):U=bn=0,xn=e),bn)},movementY:function(e){return`movementY`in e?e.movementY:U}}),Cn=gn(Sn),wn=gn(h({},Sn,{dataTransfer:0})),Tn=gn(h({},vn,{relatedTarget:0})),En=gn(h({},_n,{animationName:0,elapsedTime:0,pseudoElement:0})),Dn=gn(h({},_n,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),On=gn(h({},_n,{data:0})),kn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},An={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`},jn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Mn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jn[e])?!!t[e]:!1}function Nn(){return Mn}var Pn=gn(h({},vn,{key:function(e){if(e.key){var t=kn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=pn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?An[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nn,charCode:function(e){return e.type===`keypress`?pn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?pn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Fn=gn(h({},Sn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),In=gn(h({},vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nn})),Ln=gn(h({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0})),Rn=gn(h({},Sn,{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})),zn=gn(h({},_n,{newState:0,oldState:0})),Bn=[9,13,27,32],Vn=on&&`CompositionEvent`in window,Hn=null;on&&`documentMode`in document&&(Hn=document.documentMode);var Un=on&&`TextEvent`in window&&!Hn,Wn=on&&(!Vn||Hn&&8<Hn&&11>=Hn),Gn=` `,Kn=!1;function qn(e,t){switch(e){case`keyup`:return Bn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Jn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Yn=!1;function Xn(e,t){switch(e){case`compositionend`:return Jn(t);case`keypress`:return t.which===32?(Kn=!0,Gn):null;case`textInput`:return e=t.data,e===Gn&&Kn?null:e;default:return null}}function Zn(e,t){if(Yn)return e===`compositionend`||!Vn&&qn(e,t)?(e=fn(),dn=un=ln=null,Yn=!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 Wn&&t.locale!==`ko`?null:t.data;default:return null}}var Qn={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 $n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Qn[e.type]:t===`textarea`}function er(e,t,n,r){$t?en?en.push(r):en=[r]:$t=r,t=Td(t,`onChange`),0<t.length&&(n=new H(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var tr=null,nr=null;function rr(e){vd(e,0)}function ir(e){if(Nt(gt(e)))return e}function ar(e,t){if(e===`change`)return t}var or=!1;if(on){var sr;if(on){var cr=`oninput`in document;if(!cr){var lr=document.createElement(`div`);lr.setAttribute(`oninput`,`return;`),cr=typeof lr.oninput==`function`}sr=cr}else sr=!1;or=sr&&(!document.documentMode||9<document.documentMode)}function ur(){tr&&(tr.detachEvent(`onpropertychange`,dr),nr=tr=null)}function dr(e){if(e.propertyName===`value`&&ir(nr)){var t=[];er(t,nr,e,Qt(e)),rn(rr,t)}}function fr(e,t,n){e===`focusin`?(ur(),tr=t,nr=n,tr.attachEvent(`onpropertychange`,dr)):e===`focusout`&&ur()}function pr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ir(nr)}function mr(e,t){if(e===`click`)return ir(t)}function hr(e,t){if(e===`input`||e===`change`)return ir(t)}function gr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var _r=typeof Object.is==`function`?Object.is:gr;function vr(e,t){if(_r(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(!Se.call(t,i)||!_r(e[i],t[i]))return!1}return!0}function yr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function br(e,t){var n=yr(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=yr(n)}}function xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Pt(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=Pt(e.document)}return t}function Cr(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=on&&`documentMode`in document&&11>=document.documentMode,Tr=null,Er=null,Dr=null,Or=!1;function kr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Or||Tr==null||Tr!==Pt(r)||(r=Tr,`selectionStart`in r&&Cr(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}),Dr&&vr(Dr,r)||(Dr=r,r=Td(Er,`onSelect`),0<r.length&&(t=new H(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function Ar(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var jr={animationend:Ar(`Animation`,`AnimationEnd`),animationiteration:Ar(`Animation`,`AnimationIteration`),animationstart:Ar(`Animation`,`AnimationStart`),transitionrun:Ar(`Transition`,`TransitionRun`),transitionstart:Ar(`Transition`,`TransitionStart`),transitioncancel:Ar(`Transition`,`TransitionCancel`),transitionend:Ar(`Transition`,`TransitionEnd`)},Mr={},Nr={};on&&(Nr=document.createElement(`div`).style,`AnimationEvent`in window||(delete jr.animationend.animation,delete jr.animationiteration.animation,delete jr.animationstart.animation),`TransitionEvent`in window||delete jr.transitionend.transition);function Pr(e){if(Mr[e])return Mr[e];if(!jr[e])return e;var t=jr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Nr)return Mr[e]=t[n];return e}var Fr=Pr(`animationend`),Ir=Pr(`animationiteration`),Lr=Pr(`animationstart`),Rr=Pr(`transitionrun`),zr=Pr(`transitionstart`),Br=Pr(`transitioncancel`),Vr=Pr(`transitionend`),Hr=new Map,Ur=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Ur.push(`scrollEnd`);function Wr(e,t){Hr.set(e,t),xt(t,[e])}var Gr=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)},Kr=[],qr=0,Jr=0;function Yr(){for(var e=qr,t=Jr=qr=0;t<e;){var n=Kr[t];Kr[t++]=null;var r=Kr[t];Kr[t++]=null;var i=Kr[t];Kr[t++]=null;var a=Kr[t];if(Kr[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&&$r(n,i,a)}}function Xr(e,t,n,r){Kr[qr++]=e,Kr[qr++]=t,Kr[qr++]=n,Kr[qr++]=r,Jr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Zr(e,t,n,r){return Xr(e,t,n,r),ei(e)}function Qr(e,t){return Xr(e,null,null,t),ei(e)}function $r(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-R(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ei(e){if(50<lu)throw lu=0,uu=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 ni(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 ri(e,t,n,r){return new ni(e,t,n,r)}function ii(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ai(e,t){var n=e.alternate;return n===null?(n=ri(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&65011712,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 oi(e,t){e.flags&=65011714;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 si(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ii(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ri(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return ci(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ri(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ri(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ri(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ri(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ci(e,t,n,r){return e=ri(7,e,r,t),e.lanes=n,e}function li(e,t,n){return e=ri(6,e,null,t),e.lanes=n,e}function ui(e){var t=ri(18,null,null,0);return t.stateNode=e,t}function di(e,t,n){return t=ri(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var fi=new WeakMap;function pi(e,t){if(typeof e==`object`&&e){var n=fi.get(e);return n===void 0?(t={value:e,source:t,stack:xe(t)},fi.set(e,t),t):n}return{value:e,source:t,stack:xe(t)}}var mi=[],hi=0,gi=null,_i=0,vi=[],yi=0,bi=null,xi=1,Si=``;function Ci(e,t){mi[hi++]=_i,mi[hi++]=gi,gi=e,_i=t}function wi(e,t,n){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,bi=e;var r=xi;e=Si;var i=32-R(r)-1;r&=~(1<<i),n+=1;var a=32-R(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,xi=1<<32-R(t)+i|n<<i|r,Si=a+e}else xi=1<<a|n<<i|r,Si=e}function Ti(e){e.return!==null&&(Ci(e,1),wi(e,1,0))}function Ei(e){for(;e===gi;)gi=mi[--hi],mi[hi]=null,_i=mi[--hi],mi[hi]=null;for(;e===bi;)bi=vi[--yi],vi[yi]=null,Si=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null}function Di(e,t){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,xi=t.id,Si=t.overflow,bi=e}var Oi=null,ki=null,W=!1,Ai=null,ji=!1,Mi=Error(i(519));function Ni(e){throw zi(pi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Mi}function Pi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[at]=e,t[ot]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<gd.length;n++)$(gd[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),Rt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),Ht(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||jd(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=Xt),t=!0):t=!1,t||Ni(e,!0)}function Fi(e){for(Oi=e.return;Oi;)switch(Oi.tag){case 5:case 31:case 13:ji=!1;return;case 27:case 3:ji=!0;return;default:Oi=Oi.return}}function Ii(e){if(e!==Oi)return!1;if(!W)return Fi(e),W=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&ki&&Ni(e),Fi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ki=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ki=uf(e)}else t===27?(t=ki,Zd(e.type)?(e=lf,lf=null,ki=e):ki=t):ki=Oi?cf(e.stateNode.nextSibling):null;return!0}function Li(){ki=Oi=null,W=!1}function Ri(){var e=Ai;return e!==null&&(Yl===null?Yl=e:Yl.push.apply(Yl,e),Ai=null),e}function zi(e){Ai===null?Ai=[e]:Ai.push(e)}var Bi=oe(null),Vi=null,Hi=null;function Ui(e,t,n){I(Bi,t._currentValue),t._currentValue=n}function Wi(e){e._currentValue=Bi.current,F(Bi)}function Gi(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 Ki(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),Gi(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),Gi(s,n,e),s=null}else 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 qi(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;_r(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ue.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&Ki(t,e,n,r),t.flags|=262144}function Ji(e){for(e=e.firstContext;e!==null;){if(!_r(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Yi(e){Vi=e,Hi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Xi(e){return Qi(Vi,e)}function Zi(e,t){return Vi===null&&Yi(e),Qi(e,t)}function Qi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Hi===null){if(e===null)throw Error(i(308));Hi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Hi=Hi.next=t;return n}var $i=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()})}},ea=t.unstable_scheduleCallback,ta=t.unstable_NormalPriority,na={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ra(){return{controller:new $i,data:new Map,refCount:0}}function ia(e){e.refCount--,e.refCount===0&&ea(ta,function(){e.controller.abort()})}var aa=null,oa=0,sa=0,ca=null;function la(e,t){if(aa===null){var n=aa=[];oa=0,sa=ud(),ca={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return oa++,t.then(ua,ua),t}function ua(){if(--oa===0&&aa!==null){ca!==null&&(ca.status=`fulfilled`);var e=aa;aa=null,sa=0,ca=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function da(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 fa=N.S;N.S=function(e,t){Ql=De(),typeof t==`object`&&t&&typeof t.then==`function`&&la(e,t),fa!==null&&fa(e,t)};var pa=oe(null);function ma(){var e=pa.current;return e===null?Fl.pooledCache:e}function ha(e,t){t===null?I(pa,pa.current):I(pa,t.pool)}function ga(){var e=ma();return e===null?null:{parent:na._currentValue,pool:e}}var _a=Error(i(460)),va=Error(i(474)),ya=Error(i(542)),ba={then:function(){}};function xa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Sa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Xt,Xt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ea(e),e;default:if(typeof t.status==`string`)t.then(Xt,Xt);else{if(e=Fl,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,Ea(e),e}throw wa=t,_a}}function Ca(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(wa=e,_a):e}}var wa=null;function Ta(){if(wa===null)throw Error(i(459));var e=wa;return wa=null,e}function Ea(e){if(e===_a||e===ya)throw Error(i(483))}var Da=null,Oa=0;function ka(e){var t=Oa;return Oa+=1,Da===null&&(Da=[]),Sa(Da,e,t)}function Aa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ja(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ma(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=ai(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|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=li(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===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&Ca(i)===t.type)?(t=a(t,n.props),Aa(t,n),t.return=e,t):(t=si(n.type,n.key,n.props,null,e.mode,r),Aa(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=di(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=ci(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=li(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=si(t.type,t.key,t.props,null,e.mode,n),Aa(n,t),n.return=e,n;case v:return t=di(t,e.mode,n),t.return=e,t;case O:return t=Ca(t),f(e,t,n)}if(ne(t)||j(t))return t=ci(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ka(t),n);if(t.$$typeof===C)return f(e,Zi(e,t),n);ja(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 _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Ca(n),p(e,t,n,r)}if(ne(n)||j(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ka(n),r);if(n.$$typeof===C)return p(e,t,Zi(e,n),r);ja(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 _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Ca(r),m(e,t,n,r,i)}if(ne(r)||j(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ka(r),i);if(r.$$typeof===C)return m(e,t,n,Zi(t,r),i);ja(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),W&&Ci(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 W&&Ci(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(g.key===null?h:g.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)}),W&&Ci(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),W&&Ci(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 W&&Ci(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(v.key===null?g:v.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)}),W&&Ci(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Ca(l)===r.type){n(e,r.sibling),c=a(r,o.props),Aa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=ci(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=si(o.type,o.key,o.props,null,e.mode,c),Aa(c,o),c.return=e,e=c)}return s(e);case v: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}else{n(e,r);break}else t(e,r);r=r.sibling}c=di(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Ca(o),b(e,r,o,c)}if(ne(o))return h(e,r,o,c);if(j(o)){if(l=j(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,ka(o),c);if(o.$$typeof===C)return b(e,r,Zi(e,o),c);ja(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=li(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Oa=0;var i=b(e,t,n,r);return Da=null,i}catch(t){if(t===_a||t===ya)throw t;var a=ri(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Na=Ma(!0),Pa=Ma(!1),Fa=!1;function Ia(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function La(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 Ra(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function za(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,X&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ei(e),$r(e,null,n),t}return Xr(e,r,t,n),ei(e)}function Ba(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,$e(e,n)}}function Va(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;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ha=!1;function Ua(){if(Ha){var e=ca;if(e!==null)throw e}}function Wa(e,t,n,r){Ha=!1;var i=e.updateQueue;Fa=!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?(Q&f)===f:(r&f)===f){f!==0&&f===sa&&(Ha=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Fa=!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),Ul|=o,e.lanes=o,e.memoizedState=d}}function Ga(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ka(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ga(n[e],t)}var qa=oe(null),Ja=oe(0);function Ya(e,t){e=Vl,I(Ja,e),I(qa,t),Vl=e|t.baseLanes}function Xa(){I(Ja,Vl),I(qa,qa.current)}function Za(){Vl=Ja.current,F(qa),F(Ja)}var Qa=oe(null),$a=null;function eo(e){var t=e.alternate;I(ao,ao.current&1),I(Qa,e),$a===null&&(t===null||qa.current!==null||t.memoizedState!==null)&&($a=e)}function to(e){I(ao,ao.current),I(Qa,e),$a===null&&($a=e)}function no(e){e.tag===22?(I(ao,ao.current),I(Qa,e),$a===null&&($a=e)):ro(e)}function ro(){I(ao,ao.current),I(Qa,Qa.current)}function io(e){F(Qa),$a===e&&($a=null),F(ao)}var ao=oe(0);function oo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){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 so=0,G=null,co=null,lo=null,uo=!1,fo=!1,po=!1,mo=0,ho=0,go=null,_o=0;function vo(){throw Error(i(321))}function yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_r(e[n],t[n]))return!1;return!0}function bo(e,t,n,r,i,a){return so=a,G=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Fs:Is,po=!1,a=n(r,i),po=!1,fo&&(a=So(t,n,r,i)),xo(e),a}function xo(e){N.H=Ps;var t=co!==null&&co.next!==null;if(so=0,lo=co=G=null,uo=!1,ho=0,go=null,t)throw Error(i(300));e===null||$s||(e=e.dependencies,e!==null&&Ji(e)&&($s=!0))}function So(e,t,n,r){G=e;var a=0;do{if(fo&&(go=null),ho=0,fo=!1,25<=a)throw Error(i(301));if(a+=1,lo=co=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=Ls,o=t(n,r)}while(fo);return o}function Co(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?Ao(t):t,e=e.useState()[0],(co===null?null:co.memoizedState)!==e&&(G.flags|=1024),t}function wo(){var e=mo!==0;return mo=0,e}function To(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Eo(e){if(uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}uo=!1}so=0,lo=co=G=null,fo=!1,ho=mo=0,go=null}function Do(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lo===null?G.memoizedState=lo=e:lo=lo.next=e,lo}function Oo(){if(co===null){var e=G.alternate;e=e===null?null:e.memoizedState}else e=co.next;var t=lo===null?G.memoizedState:lo.next;if(t!==null)lo=t,co=e;else{if(e===null)throw G.alternate===null?Error(i(467)):Error(i(310));co=e,e={memoizedState:co.memoizedState,baseState:co.baseState,baseQueue:co.baseQueue,queue:co.queue,next:null},lo===null?G.memoizedState=lo=e:lo=lo.next=e}return lo}function ko(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ao(e){var t=ho;return ho+=1,go===null&&(go=[]),e=Sa(go,e,t),t=G,(lo===null?t.memoizedState:lo.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Fs:Is),e}function jo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ao(e);if(e.$$typeof===C)return Xi(e)}throw Error(i(438,String(e)))}function Mo(e){var t=null,n=G.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=G.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=ko(),G.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]=A;return t.index++,n}function No(e,t){return typeof t==`function`?t(e):t}function Po(e){return Fo(Oo(),co,e)}function Fo(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?(so&f)===f:(Q&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===sa&&(d=!0);else if((so&p)===p){u=u.next,p===sa&&(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,G.lanes|=p,Ul|=p;f=u.action,po&&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,G.lanes|=f,Ul|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!_r(o,e.memoizedState)&&($s=!0,d&&(n=ca,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 Io(e){var t=Oo(),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);_r(o,t.memoizedState)||($s=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Lo(e,t,n){var r=G,a=Oo(),o=W;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!_r((co||a).memoizedState,n);if(s&&(a.memoizedState=n,$s=!0),a=a.queue,ss(Bo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||lo!==null&&lo.memoizedState.tag&1){if(r.flags|=2048,ns(9,{destroy:void 0},zo.bind(null,r,a,n,t),null),Fl===null)throw Error(i(349));o||so&127||Ro(r,t,n)}return n}function Ro(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=G.updateQueue,t===null?(t=ko(),G.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zo(e,t,n,r){t.value=n,t.getSnapshot=r,Vo(t)&&Ho(e)}function Bo(e,t,n){return n(function(){Vo(t)&&Ho(e)})}function Vo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_r(e,n)}catch{return!0}}function Ho(e){var t=Qr(e,2);t!==null&&pu(t,e,2)}function Uo(e){var t=Do();if(typeof e==`function`){var n=e;if(e=n(),po){L(!0);try{n()}finally{L(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:e},t}function Wo(e,t,n,r){return e.baseState=n,Fo(e,co,typeof r==`function`?r:No)}function K(e,t,n,r,a){if(js(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)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Go(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Go(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),Ko(e,t,s)}catch(n){Jo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),Ko(e,t,a)}catch(n){Jo(e,t,n)}}function Ko(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){qo(e,t,n)},function(n){return Jo(e,t,n)}):qo(e,t,n)}function qo(e,t,n){t.status=`fulfilled`,t.value=n,Yo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Go(e,n)))}function Jo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Yo(t),t=t.next;while(t!==r)}e.action=null}function Yo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xo(e,t){return t}function Zo(e,t){if(W){var n=Fl.formState;if(n!==null){a:{var r=G;if(W){if(ki){b:{for(var i=ki,a=ji;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ki=cf(i.nextSibling),r=i.data===`F!`;break a}}Ni(r)}r=!1}r&&(t=n[0])}}return n=Do(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xo,lastRenderedState:t},n.queue=r,n=ks.bind(null,G,r),r.dispatch=n,r=Uo(!1),a=q.bind(null,G,!1,r.queue),r=Do(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=K.bind(null,G,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Qo(e){return $o(Oo(),co,e)}function $o(e,t,n){if(t=Fo(e,t,Xo)[0],e=Po(No)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ao(t)}catch(e){throw e===_a?ya:e}else r=t;t=Oo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(G.flags|=2048,ns(9,{destroy:void 0},es.bind(null,i,n),null)),[r,a,e]}function es(e,t){e.action=t}function ts(e){var t=Oo(),n=co;if(n!==null)return $o(t,n,e);Oo(),t=t.memoizedState,n=Oo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=G.updateQueue,t===null&&(t=ko(),G.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 rs(){return Oo().memoizedState}function is(e,t,n,r){var i=Do();G.flags|=e,i.memoizedState=ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function as(e,t,n,r){var i=Oo();r=r===void 0?null:r;var a=i.memoizedState.inst;co!==null&&r!==null&&yo(r,co.memoizedState.deps)?i.memoizedState=ns(t,a,n,r):(G.flags|=e,i.memoizedState=ns(1|t,a,n,r))}function os(e,t){is(8390656,8,e,t)}function ss(e,t){as(2048,8,e,t)}function cs(e){G.flags|=4;var t=G.updateQueue;if(t===null)t=ko(),G.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ls(e){var t=Oo().memoizedState;return cs({ref:t,nextImpl:e}),function(){if(X&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function us(e,t){return as(4,2,e,t)}function ds(e,t){return as(4,4,e,t)}function fs(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 ps(e,t,n){n=n==null?null:n.concat([e]),as(4,4,fs.bind(null,t,e),n)}function ms(){}function hs(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function gs(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&yo(t,r[1]))return r[0];if(r=e(),po){L(!0);try{e()}finally{L(!1)}}return n.memoizedState=[r,t],r}function _s(e,t,n){return n===void 0||so&1073741824&&!(Q&261930)?e.memoizedState=t:(e.memoizedState=n,e=fu(),G.lanes|=e,Ul|=e,n)}function vs(e,t,n,r){return _r(n,t)?n:qa.current===null?!(so&42)||so&1073741824&&!(Q&261930)?($s=!0,e.memoizedState=n):(e=fu(),G.lanes|=e,Ul|=e,t):(e=_s(e,n,r),_r(e,t)||($s=!0),e)}function ys(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,q(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?As(e,t,da(c,r),du(e)):As(e,t,r,du(e))}catch(n){As(e,t,{then:function(){},status:`rejected`,reason:n},du())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function bs(){}function xs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ss(e).queue;ys(e,a,t,re,n===null?bs:function(){return Cs(e),n(r)})}function Ss(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Cs(e){var t=Ss(e);t.next===null&&(t=e.alternate.memoizedState),As(e,t.next.queue,{},du())}function ws(){return Xi(Qf)}function Ts(){return Oo().memoizedState}function Es(){return Oo().memoizedState}function Ds(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=du();e=Ra(n);var r=za(t,e,n);r!==null&&(pu(r,t,n),Ba(r,t,n)),t={cache:ra()},e.payload=t;return}t=t.return}}function Os(e,t,n){var r=du();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},js(e)?Ms(t,n):(n=Zr(e,t,n,r),n!==null&&(pu(n,e,r),Ns(n,t,r)))}function ks(e,t,n){As(e,t,n,du())}function As(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(js(e))Ms(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,_r(s,o))return Xr(e,t,i,0),Fl===null&&Yr(),!1}catch{}if(n=Zr(e,t,i,r),n!==null)return pu(n,e,r),Ns(n,t,r),!0}return!1}function q(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},js(e)){if(t)throw Error(i(479))}else t=Zr(e,n,r,2),t!==null&&pu(t,e,2)}function js(e){var t=e.alternate;return e===G||t!==null&&t===G}function Ms(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ns(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}var Ps={readContext:Xi,use:jo,useCallback:vo,useContext:vo,useEffect:vo,useImperativeHandle:vo,useLayoutEffect:vo,useInsertionEffect:vo,useMemo:vo,useReducer:vo,useRef:vo,useState:vo,useDebugValue:vo,useDeferredValue:vo,useTransition:vo,useSyncExternalStore:vo,useId:vo,useHostTransitionStatus:vo,useFormState:vo,useActionState:vo,useOptimistic:vo,useMemoCache:vo,useCacheRefresh:vo};Ps.useEffectEvent=vo;var Fs={readContext:Xi,use:jo,useCallback:function(e,t){return Do().memoizedState=[e,t===void 0?null:t],e},useContext:Xi,useEffect:os,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),is(4194308,4,fs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return is(4194308,4,e,t)},useInsertionEffect:function(e,t){is(4,2,e,t)},useMemo:function(e,t){var n=Do();t=t===void 0?null:t;var r=e();if(po){L(!0);try{e()}finally{L(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Do();if(n!==void 0){var i=n(t);if(po){L(!0);try{n(t)}finally{L(!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=Os.bind(null,G,e),[r.memoizedState,e]},useRef:function(e){var t=Do();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=ks.bind(null,G,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ms,useDeferredValue:function(e,t){return _s(Do(),e,t)},useTransition:function(){var e=Uo(!1);return e=ys.bind(null,G,e.queue,!0,!1),Do().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=G,a=Do();if(W){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Fl===null)throw Error(i(349));Q&127||Ro(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,os(Bo.bind(null,r,o,e),[e]),r.flags|=2048,ns(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Do(),t=Fl.identifierPrefix;if(W){var n=Si,r=xi;n=(r&~(1<<32-R(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=_o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ws,useFormState:Zo,useActionState:Zo,useOptimistic:function(e){var t=Do();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=q.bind(null,G,!0,n),n.dispatch=t,[e,t]},useMemoCache:Mo,useCacheRefresh:function(){return Do().memoizedState=Ds.bind(null,G)},useEffectEvent:function(e){var t=Do(),n={impl:e};return t.memoizedState=n,function(){if(X&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Is={readContext:Xi,use:jo,useCallback:hs,useContext:Xi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:Po,useRef:rs,useState:function(){return Po(No)},useDebugValue:ms,useDeferredValue:function(e,t){return vs(Oo(),co.memoizedState,e,t)},useTransition:function(){var e=Po(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Ts,useHostTransitionStatus:ws,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){return Wo(Oo(),co,e,t)},useMemoCache:Mo,useCacheRefresh:Es};Is.useEffectEvent=ls;var Ls={readContext:Xi,use:jo,useCallback:hs,useContext:Xi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:Io,useRef:rs,useState:function(){return Io(No)},useDebugValue:ms,useDeferredValue:function(e,t){var n=Oo();return co===null?_s(n,e,t):vs(n,co.memoizedState,e,t)},useTransition:function(){var e=Io(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Ts,useHostTransitionStatus:ws,useFormState:ts,useActionState:ts,useOptimistic:function(e,t){var n=Oo();return co===null?(n.baseState=e,[e,n.queue.dispatch]):Wo(n,co,e,t)},useMemoCache:Mo,useCacheRefresh:Es};Ls.useEffectEvent=ls;function Rs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var zs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=du(),i=Ra(r);i.payload=t,n!=null&&(i.callback=n),t=za(e,i,r),t!==null&&(pu(t,e,r),Ba(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=du(),i=Ra(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=za(e,i,r),t!==null&&(pu(t,e,r),Ba(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=du(),r=Ra(n);r.tag=2,t!=null&&(r.callback=t),t=za(e,r,n),t!==null&&(pu(t,e,n),Ba(t,e,n))}};function Bs(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?!vr(n,r)||!vr(i,a):!0}function Vs(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&&zs.enqueueReplaceState(t,t.state,null)}function Hs(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=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Us(e){Gr(e)}function Ws(e){console.error(e)}function Gs(e){Gr(e)}function Ks(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function qs(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 Js(e,t,n){return n=Ra(n),n.tag=3,n.payload={element:null},n.callback=function(){Ks(e,t)},n}function Ys(e){return e=Ra(e),e.tag=3,e}function Xs(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(){qs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){qs(t,n,r),typeof i!=`function`&&(tu===null?tu=new Set([this]):tu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Zs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&qi(t,n,a,!0),n=Qa.current,n!==null){switch(n.tag){case 31:case 13:return $a===null?Tu():n.alternate===null&&Hl===0&&(Hl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ba?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Wu(e,r,a)),!1;case 22:return n.flags|=65536,r===ba?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)),Wu(e,r,a)),!1}throw Error(i(435,n.tag))}return Wu(e,r,a),Tu(),!1}if(W)return t=Qa.current,t===null?(r!==Mi&&(t=Error(i(423),{cause:r}),zi(pi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=pi(r,n),a=Js(e.stateNode,r,a),Va(e,a),Hl!==4&&(Hl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Mi&&(e=Error(i(422),{cause:r}),zi(pi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=pi(o,n),Jl===null?Jl=[o]:Jl.push(o),Hl!==4&&(Hl=2),t===null)return!0;r=pi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Js(n.stateNode,r,e),Va(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`&&(tu===null||!tu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ys(a),Xs(a,e,n,r),Va(n,a),!1}n=n.return}while(n!==null);return!1}var Qs=Error(i(461)),$s=!1;function J(e,t,n,r){t.child=e===null?Pa(t,null,n,r):Na(t,e.child,n,r)}function ec(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 Yi(t),r=bo(e,t,n,o,a,i),s=wo(),e!==null&&!$s?(To(e,t,i),Cc(e,t,i)):(W&&s&&Ti(t),t.flags|=1,J(e,t,r,i),t.child)}function tc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ii(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,nc(e,t,a,r,i)):(e=si(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!wc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?vr:n,n(o,r)&&e.ref===t.ref)return Cc(e,t,i)}return t.flags|=1,e=ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function nc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(vr(a,r)&&e.ref===t.ref)if($s=!1,t.pendingProps=r=a,wc(e,i))e.flags&131072&&($s=!0);else return t.lanes=e.lanes,Cc(e,t,i)}return uc(e,t,n,r,i)}function rc(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 ac(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?Xa():Ya(t,a),no(t);else return r=t.lanes=536870912,ac(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ha(t,null),Xa(),ro(t)):(ha(t,a.cachePool),Ya(t,a),ro(t),t.memoizedState=null);return J(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 ac(e,t,n,r,i){var a=ma();return a=a===null?null:{parent:na._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ha(t,null),Xa(),no(t),e!==null&&qi(e,t,r,!0),t.childLanes=i,null}function oc(e,t){return t=vc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function sc(e,t,n){return Na(t,e.child,null,n),e=oc(t,t.pendingProps),e.flags|=2,io(t),t.memoizedState=null,e}function cc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(W){if(r.mode===`hidden`)return e=oc(t,r),t.lanes=536870912,ic(null,e);if(to(t),(e=ki)?(e=rf(e,ji),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Ni(t);return t.lanes=536870912,null}return oc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(to(t),a)if(t.flags&256)t.flags&=-257,t=sc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if($s||qi(e,t,n,!1),a=(n&e.childLanes)!==0,$s||a){if(r=Fl,r!==null&&(s=z(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Qr(e,s),pu(r,e,s),Qs;Tu(),t=sc(e,t,n)}else e=o.treeContext,ki=cf(s.nextSibling),Oi=t,W=!0,Ai=null,ji=!1,e!==null&&Di(t,e),t=oc(t,r),t.flags|=4096;return t}return e=ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function lc(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 uc(e,t,n,r,i){return Yi(t),n=bo(e,t,n,r,void 0,i),r=wo(),e!==null&&!$s?(To(e,t,i),Cc(e,t,i)):(W&&r&&Ti(t),t.flags|=1,J(e,t,n,i),t.child)}function dc(e,t,n,r,i,a){return Yi(t),t.updateQueue=null,n=So(t,r,n,i),xo(e),r=wo(),e!==null&&!$s?(To(e,t,a),Cc(e,t,a)):(W&&r&&Ti(t),t.flags|=1,J(e,t,n,a),t.child)}function fc(e,t,n,r,i){if(Yi(t),t.stateNode===null){var a=ti,o=n.contextType;typeof o==`object`&&o&&(a=Xi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=zs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ia(t),o=n.contextType,a.context=typeof o==`object`&&o?Xi(o):ti,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Rs(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&&zs.enqueueReplaceState(a,a.state,null),Wa(t,r,a,i),Ua(),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=Hs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ti,typeof u==`object`&&u&&(o=Xi(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)&&Vs(t,a,r,o),Fa=!1;var f=t.memoizedState;a.state=f,Wa(t,r,a,i),Ua(),l=t.memoizedState,s||f!==l||Fa?(typeof d==`function`&&(Rs(t,n,d,r),l=t.memoizedState),(c=Fa||Bs(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,La(e,t),o=t.memoizedProps,u=Hs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ti,typeof l==`object`&&l&&(c=Xi(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)&&Vs(t,a,r,c),Fa=!1,f=t.memoizedState,a.state=f,Wa(t,r,a,i),Ua();var p=t.memoizedState;o!==d||f!==p||Fa||e!==null&&e.dependencies!==null&&Ji(e.dependencies)?(typeof s==`function`&&(Rs(t,n,s,r),p=t.memoizedState),(u=Fa||Bs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ji(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,lc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Na(t,e.child,null,i),t.child=Na(t,null,n,i)):J(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Cc(e,t,i),e}function pc(e,t,n,r){return Li(),t.flags|=256,J(e,t,n,r),t.child}var mc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hc(e){return{baseLanes:e,cachePool:ga()}}function gc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Kl),e}function _c(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(ao.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(W){if(a?eo(t):ro(t),(e=ki)?(e=rf(e,ji),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Ni(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(ro(t),a=t.mode,c=vc({mode:`hidden`,children:c},a),r=ci(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=hc(n),r.childLanes=gc(e,s,n),t.memoizedState=mc,ic(null,r)):(eo(t),Y(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(eo(t),t.flags&=-257,t=yc(e,t,n)):t.memoizedState===null?(ro(t),c=r.fallback,a=t.mode,r=vc({mode:`visible`,children:r.children},a),c=ci(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Na(t,e.child,null,n),r=t.child,r.memoizedState=hc(n),r.childLanes=gc(e,s,n),t.memoizedState=mc,t=ic(null,r)):(ro(t),t.child=e.child,t.flags|=128,t=null);else if(eo(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,zi({value:r,source:null,stack:null}),t=yc(e,t,n)}else if($s||qi(e,t,n,!1),s=(n&e.childLanes)!==0,$s||s){if(s=Fl,s!==null&&(r=z(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Qr(e,r),pu(s,e,r),Qs;af(c)||Tu(),t=yc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ki=cf(c.nextSibling),Oi=t,W=!0,Ai=null,ji=!1,e!==null&&Di(t,e),t=Y(t,r.children),t.flags|=4096);return t}return a?(ro(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ai(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ci(c,a,n,null),c.flags|=2):c=ai(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,ic(null,r),r=t.child,c=e.child.memoizedState,c===null?c=hc(n):(a=c.cachePool,a===null?a=ga():(l=na._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=gc(e,s,n),t.memoizedState=mc,ic(e.child,r)):(eo(t),n=e.child,e=n.sibling,n=ai(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Y(e,t){return t=vc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function vc(e,t){return e=ri(22,e,null,t),e.lanes=0,e}function yc(e,t,n){return Na(t,e.child,null,n),e=Y(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Gi(e.return,t,n)}function xc(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 Sc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=ao.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,I(ao,o),J(e,t,r,n),r=W?_i:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&bc(e,n,t);else if(e.tag===19)bc(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`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&oo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),xc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&oo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}xc(t,!0,n,null,a,r);break;case`together`:xc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Cc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ul|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(qi(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=ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function wc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Ji(e))):!0}function Tc(e,t,n){switch(t.tag){case 3:de(t,t.stateNode.containerInfo),Ui(t,na,e.memoizedState.cache),Li();break;case 27:case 5:pe(t);break;case 4:de(t,t.stateNode.containerInfo);break;case 10:Ui(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,to(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(eo(t),e=Cc(e,t,n),e===null?null:e.sibling):_c(e,t,n):(eo(t),t.flags|=128,null);eo(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(qi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Sc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),I(ao,ao.current),r)break;return null;case 22:return t.lanes=0,rc(e,t,n,t.pendingProps);case 24:Ui(t,na,e.memoizedState.cache)}return Cc(e,t,n)}function Ec(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)$s=!0;else{if(!wc(e,n)&&!(t.flags&128))return $s=!1,Tc(e,t,n);$s=!!(e.flags&131072)}else $s=!1,W&&t.flags&1048576&&wi(t,_i,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ca(t.elementType),t.type=e,typeof e==`function`)ii(e)?(r=Hs(e,r),t.tag=1,t=fc(null,t,e,r,n)):(t.tag=0,t=uc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=ec(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=tc(null,t,e,r,n);break a}}throw t=M(e)||e,Error(i(306,t,``))}}return t;case 0:return uc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Hs(r,t.pendingProps),fc(e,t,r,a,n);case 3:a:{if(de(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,La(e,t),Wa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ui(t,na,r),r!==o.cache&&Ki(t,[na],n,!0),Ua(),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=pc(e,t,r,n);break a}else if(r!==a){a=pi(Error(i(424)),t),zi(a),t=pc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ki=cf(e.firstChild),Oi=t,W=!0,Ai=null,ji=!0,n=Pa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Li(),r===a){t=Cc(e,t,n);break a}J(e,t,r,n)}t=t.child}return t;case 26:return lc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:W||(n=t.type,e=t.pendingProps,r=Bd(le.current).createElement(n),r[at]=t,r[ot]=e,Pd(r,n,e),vt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return pe(t),e===null&&W&&(r=t.stateNode=ff(t.type,t.pendingProps,le.current),Oi=t,ji=!0,a=ki,Zd(t.type)?(lf=a,ki=cf(r.firstChild)):ki=a),J(e,t,t.pendingProps.children,n),lc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&W&&((a=r=ki)&&(r=tf(r,t.type,t.pendingProps,ji),r===null?a=!1:(t.stateNode=r,Oi=t,ki=cf(r.firstChild),ji=!1,a=!0)),a||Ni(t)),pe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=bo(e,t,Co,null,null,n),Qf._currentValue=a),lc(e,t),J(e,t,r,n),t.child;case 6:return e===null&&W&&((e=n=ki)&&(n=nf(n,t.pendingProps,ji),n===null?e=!1:(t.stateNode=n,Oi=t,ki=null,e=!0)),e||Ni(t)),null;case 13:return _c(e,t,n);case 4:return de(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Na(t,null,r,n):J(e,t,r,n),t.child;case 11:return ec(e,t,t.type,t.pendingProps,n);case 7:return J(e,t,t.pendingProps,n),t.child;case 8:return J(e,t,t.pendingProps.children,n),t.child;case 12:return J(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ui(t,t.type,r.value),J(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Yi(t),a=Xi(a),r=r(a),t.flags|=1,J(e,t,r,n),t.child;case 14:return tc(e,t,t.type,t.pendingProps,n);case 15:return nc(e,t,t.type,t.pendingProps,n);case 19:return Sc(e,t,n);case 31:return cc(e,t,n);case 22:return rc(e,t,n,t.pendingProps);case 24:return Yi(t),r=Xi(na),e===null?(a=ma(),a===null&&(a=Fl,o=ra(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ia(t),Ui(t,na,a)):((e.lanes&n)!==0&&(La(e,t),Wa(t,null,null,n),Ua()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ui(t,na,r),r!==a.cache&&Ki(t,[na],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ui(t,na,r))),J(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Dc(e){e.flags|=4}function Oc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Su())e.flags|=8192;else throw wa=ba,va}else e.flags&=-16777217}function kc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(Su())e.flags|=8192;else throw wa=ba,va}function Ac(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Je(),e.lanes|=t,ql|=t)}function jc(e,t){if(!W)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var 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}}function Mc(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&65011712,r|=i.flags&65011712,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 Nc(e,t,n){var r=t.pendingProps;switch(Ei(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mc(t),null;case 1:return Mc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Wi(na),fe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ii(t)?Dc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ri())),Mc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Dc(t),o===null?(Mc(t),Oc(t,a,null,r,n)):(Mc(t),kc(t,o))):o?o===e.memoizedState?(Mc(t),t.flags&=-16777217):(Dc(t),Mc(t),kc(t,o)):(e=e.memoizedProps,e!==r&&Dc(t),Mc(t),Oc(t,a,e,r,n)),null;case 27:if(me(t),n=le.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}e=se.current,Ii(t)?Pi(t,e):(e=ff(a,r,n),t.stateNode=e,Dc(t))}return Mc(t),null;case 5:if(me(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Mc(t),null}if(o=se.current,Ii(t))Pi(t,o);else{var s=Bd(le.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[at]=t,o[ot]=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(Pd(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&&Dc(t)}}return Mc(t),Oc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Dc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=le.current,Ii(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Oi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[at]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Ni(t,!0)}else e=Bd(e).createTextNode(r),e[at]=t,t.stateNode=e}return Mc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ii(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[at]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),e=!1}else n=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(io(t),t):(io(t),null);if(t.flags&128)throw Error(i(558))}return Mc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ii(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[at]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mc(t),a=!1}else a=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(io(t),t):(io(t),null)}return io(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),Ac(t,t.updateQueue),Mc(t),null);case 4:return fe(),e===null&&xd(t.stateNode.containerInfo),Mc(t),null;case 10:return Wi(t.type),Mc(t),null;case 19:if(F(ao),r=t.memoizedState,r===null)return Mc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)jc(r,!1);else{if(Hl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=oo(e),o!==null){for(t.flags|=128,jc(r,!1),e=o.updateQueue,t.updateQueue=e,Ac(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)oi(n,e),n=n.sibling;return I(ao,ao.current&1|2),W&&Ci(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&De()>$l&&(t.flags|=128,a=!0,jc(r,!1),t.lanes=4194304)}else{if(!a)if(e=oo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ac(t,e),jc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!W)return Mc(t),null}else 2*De()-r.renderingStartTime>$l&&n!==536870912&&(t.flags|=128,a=!0,jc(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)}return r.tail===null?(Mc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=De(),e.sibling=null,n=ao.current,I(ao,a?n&1|2:n&1),W&&Ci(t,r.treeForkCount),e);case 22:case 23:return io(t),Za(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Mc(t),t.subtreeFlags&6&&(t.flags|=8192)):Mc(t),n=t.updateQueue,n!==null&&Ac(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&&F(pa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Wi(na),Mc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Pc(e,t){switch(Ei(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wi(na),fe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return me(t),null;case 31:if(t.memoizedState!==null){if(io(t),t.alternate===null)throw Error(i(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(io(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return F(ao),null;case 4:return fe(),null;case 10:return Wi(t.type),null;case 22:case 23:return io(t),Za(),e!==null&&F(pa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Wi(na),null;case 25:return null;default:return null}}function Fc(e,t){switch(Ei(t),t.tag){case 3:Wi(na),fe();break;case 26:case 27:case 5:me(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&io(t);break;case 13:io(t);break;case 19:F(ao);break;case 10:Wi(t.type);break;case 22:case 23:io(t),Za(),e!==null&&F(pa);break;case 24:Wi(na)}}function Ic(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){Uu(t,t.return,e)}}function Lc(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){Uu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Uu(t,t.return,e)}}function Rc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ka(t,n)}catch(t){Uu(e,e.return,t)}}}function zc(e,t,n){n.props=Hs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Uu(e,t,n)}}function Bc(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:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Uu(e,t,n)}}function Vc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Uu(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){Uu(e,t,n)}else n.current=null}function Hc(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){Uu(e,e.return,t)}}function Uc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[ot]=t}catch(t){Uu(e,e.return,t)}}function Wc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Gc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Wc(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&&Zd(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 Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Xt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(qc(e,t,n),e=e.sibling;e!==null;)qc(e,t,n),e=e.sibling}function Jc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[at]=e,t[ot]=n}catch(t){Uu(e,e.return,t)}}var Yc=!1,Xc=!1,Zc=!1,Qc=typeof WeakSet==`function`?WeakSet:Set,$c=null;function el(e,t){if(e=e.containerInfo,Rd=sp,e=Sr(e),Cr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,$c=t;$c!==null;)if(t=$c,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,$c=e;else for(;$c!==null;){switch(t=$c,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Hs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Uu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,$c=e;break}$c=t.return}}function tl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:gl(e,n),r&4&&Ic(5,n);break;case 1:if(gl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Uu(n,n.return,e)}else{var i=Hs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Uu(n,n.return,e)}}r&64&&Rc(n),r&512&&Bc(n,n.return);break;case 3:if(gl(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{Ka(e,t)}catch(e){Uu(n,n.return,e)}}break;case 27:t===null&&r&4&&Jc(n);case 26:case 5:gl(e,n),t===null&&r&4&&Hc(n),r&512&&Bc(n,n.return);break;case 12:gl(e,n);break;case 31:gl(e,n),r&4&&sl(e,n);break;case 13:gl(e,n),r&4&&cl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=qu.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||Yc,!r){t=t!==null&&t.memoizedState!==null||Xc,i=Yc;var a=Xc;Yc=r,(Xc=t)&&!a?vl(e,n,(n.subtreeFlags&8772)!=0):gl(e,n),Yc=i,Xc=a}break;case 30:break;default:gl(e,n)}}function nl(e){var t=e.alternate;t!==null&&(e.alternate=null,nl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&pt(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 rl=null,il=!1;function al(e,t,n){for(n=n.child;n!==null;)ol(e,t,n),n=n.sibling}function ol(e,t,n){if(Le&&typeof Le.onCommitFiberUnmount==`function`)try{Le.onCommitFiberUnmount(Ie,n)}catch{}switch(n.tag){case 26:Xc||Vc(n,t),al(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Xc||Vc(n,t);var r=rl,i=il;Zd(n.type)&&(rl=n.stateNode,il=!1),al(e,t,n),pf(n.stateNode),rl=r,il=i;break;case 5:Xc||Vc(n,t);case 6:if(r=rl,i=il,rl=null,al(e,t,n),rl=r,il=i,rl!==null)if(il)try{(rl.nodeType===9?rl.body:rl.nodeName===`HTML`?rl.ownerDocument.body:rl).removeChild(n.stateNode)}catch(e){Uu(n,t,e)}else try{rl.removeChild(n.stateNode)}catch(e){Uu(n,t,e)}break;case 18:rl!==null&&(il?(e=rl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(rl,n.stateNode));break;case 4:r=rl,i=il,rl=n.stateNode.containerInfo,il=!0,al(e,t,n),rl=r,il=i;break;case 0:case 11:case 14:case 15:Lc(2,n,t),Xc||Lc(4,n,t),al(e,t,n);break;case 1:Xc||(Vc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&zc(n,t,r)),al(e,t,n);break;case 21:al(e,t,n);break;case 22:Xc=(r=Xc)||n.memoizedState!==null,al(e,t,n),Xc=r;break;default:al(e,t,n)}}function sl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Uu(t,t.return,e)}}}function cl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Uu(t,t.return,e)}}function ll(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Qc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Qc),t;default:throw Error(i(435,e.tag))}}function ul(e,t){var n=ll(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function dl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){rl=c.stateNode,il=!1;break a}break;case 5:rl=c.stateNode,il=!1;break a;case 3:case 4:rl=c.stateNode.containerInfo,il=!0;break a}c=c.return}if(rl===null)throw Error(i(160));ol(o,s,a),rl=null,il=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)pl(t,e),t=t.sibling}var fl=null;function pl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dl(t,e),ml(e),r&4&&(Lc(3,e,e.return),Ic(3,e),Lc(5,e,e.return));break;case 1:dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),r&64&&Yc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=fl;if(dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ft]||o[at]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[at]=e,vt(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[at]=e,vt(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=If(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Uc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),n!==null&&r&4&&Uc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(dl(t,e),ml(e),r&512&&(Xc||n===null||Vc(n,n.return)),e.flags&32){a=e.stateNode;try{Ut(a,``)}catch(t){Uu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Uc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Zc=!0);break;case 6:if(dl(t,e),ml(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Uu(e,e.return,t)}}break;case 3:if(Bf=null,a=fl,fl=gf(t.containerInfo),dl(t,e),fl=a,ml(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Uu(e,e.return,t)}Zc&&(Zc=!1,hl(e));break;case 4:r=fl,fl=gf(e.stateNode.containerInfo),dl(t,e),ml(e),fl=r;break;case 12:dl(t,e),ml(e);break;case 31:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 13:dl(t,e),ml(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Zl=De()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Yc,d=Xc;if(Yc=u||a,Xc=d||l,dl(t,e),Xc=d,Yc=u,ml(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Yc||Xc||_l(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Uu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Uu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Uu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ul(e,n))));break;case 19:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 30:break;case 21:break;default:dl(t,e),ml(e)}}function ml(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Wc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;qc(e,Gc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Ut(o,``),n.flags&=-33),qc(e,Gc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Kc(e,Gc(e),s);break;default:throw Error(i(161))}}catch(t){Uu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function hl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;hl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function gl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)tl(e,t.alternate,t),t=t.sibling}function _l(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Lc(4,t,t.return),_l(t);break;case 1:Vc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&zc(t,t.return,n),_l(t);break;case 27:pf(t.stateNode);case 26:case 5:Vc(t,t.return),_l(t);break;case 22:t.memoizedState===null&&_l(t);break;case 30:_l(t);break;default:_l(t)}e=e.sibling}}function vl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:vl(i,a,n),Ic(4,a);break;case 1:if(vl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Uu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ga(c[i],s)}catch(e){Uu(r,r.return,e)}}n&&o&64&&Rc(a),Bc(a,a.return);break;case 27:Jc(a);case 26:case 5:vl(i,a,n),n&&r===null&&o&4&&Hc(a),Bc(a,a.return);break;case 12:vl(i,a,n);break;case 31:vl(i,a,n),n&&o&4&&sl(i,a);break;case 13:vl(i,a,n),n&&o&4&&cl(i,a);break;case 22:a.memoizedState===null&&vl(i,a,n),Bc(a,a.return);break;case 30:break;default:vl(i,a,n)}t=t.sibling}}function yl(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&&ia(n))}function bl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ia(e))}function xl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sl(e,t,n,r),t=t.sibling}function Sl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:xl(e,t,n,r),i&2048&&Ic(9,t);break;case 1:xl(e,t,n,r);break;case 3:xl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ia(e)));break;case 12:if(i&2048){xl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Uu(t,t.return,e)}}else xl(e,t,n,r);break;case 31:xl(e,t,n,r);break;case 13:xl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?xl(e,t,n,r):(a._visibility|=2,Cl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?xl(e,t,n,r):wl(e,t),i&2048&&yl(o,t);break;case 24:xl(e,t,n,r),i&2048&&bl(t.alternate,t);break;default:xl(e,t,n,r)}}function Cl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!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:Cl(a,o,s,c,i),Ic(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Cl(a,o,s,c,i)):u._visibility&2?Cl(a,o,s,c,i):wl(a,o),i&&l&2048&&yl(o.alternate,o);break;case 24:Cl(a,o,s,c,i),i&&l&2048&&bl(o.alternate,o);break;default:Cl(a,o,s,c,i)}t=t.sibling}}function wl(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:wl(n,r),i&2048&&yl(r.alternate,r);break;case 24:wl(n,r),i&2048&&bl(r.alternate,r);break;default:wl(n,r)}t=t.sibling}}var Tl=8192;function El(e,t,n){if(e.subtreeFlags&Tl)for(e=e.child;e!==null;)Dl(e,t,n),e=e.sibling}function Dl(e,t,n){switch(e.tag){case 26:El(e,t,n),e.flags&Tl&&e.memoizedState!==null&&Gf(n,fl,e.memoizedState,e.memoizedProps);break;case 5:El(e,t,n);break;case 3:case 4:var r=fl;fl=gf(e.stateNode.containerInfo),El(e,t,n),fl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Tl,Tl=16777216,El(e,t,n),Tl=r):El(e,t,n));break;default:El(e,t,n)}}function Ol(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 kl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Al(e),e=e.sibling}function Al(e){switch(e.tag){case 0:case 11:case 15:kl(e),e.flags&2048&&Lc(9,e,e.return);break;case 3:kl(e);break;case 12:kl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,jl(e)):kl(e);break;default:kl(e)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Lc(8,t,t.return),jl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,jl(t));break;default:jl(t)}e=e.sibling}}function Ml(e,t){for(;$c!==null;){var n=$c;switch(n.tag){case 0:case 11:case 15:Lc(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:ia(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,$c=r;else a:for(n=e;$c!==null;){r=$c;var i=r.sibling,a=r.return;if(nl(r),r===n){$c=null;break a}if(i!==null){i.return=a,$c=i;break a}$c=a}}}var Nl={getCacheForType:function(e){var t=Xi(na),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Xi(na).controller.signal}},Pl=typeof WeakMap==`function`?WeakMap:Map,X=0,Fl=null,Z=null,Q=0,Il=0,Ll=null,Rl=!1,zl=!1,Bl=!1,Vl=0,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=null,Yl=null,Xl=!1,Zl=0,Ql=0,$l=1/0,eu=null,tu=null,nu=0,ru=null,iu=null,au=0,ou=0,su=null,cu=null,lu=0,uu=null;function du(){return X&2&&Q!==0?Q&-Q:N.T===null?nt():ud()}function fu(){if(Kl===0)if(!(Q&536870912)||W){var e=He;He<<=1,!(He&3932160)&&(He=262144),Kl=e}else Kl=536870912;return e=Qa.current,e!==null&&(e.flags|=32),Kl}function pu(e,t,n){(e===Fl&&(Il===2||Il===9)||e.cancelPendingCommit!==null)&&(bu(e,0),_u(e,Q,Kl,!1)),Xe(e,n),(!(X&2)||e!==Fl)&&(e===Fl&&(!(X&2)&&(Wl|=n),Hl===4&&_u(e,Q,Kl,!1)),nd(e))}function mu(e,t,n){if(X&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ke(e,t),a=r?Ou(e,t):Eu(e,t,!0),o=r;do{if(a===0){zl&&!r&&_u(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!gu(n)){a=Eu(e,t,!1),o=!1;continue}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=Jl;var l=c.current.memoizedState.isDehydrated;if(l&&(bu(c,s).flags|=256),s=Eu(c,s,!1),s!==2){if(Bl&&!l){c.errorRecoveryDisabledLanes|=o,Wl|=o,a=4;break a}o=Yl,Yl=a,o!==null&&(Yl===null?Yl=o:Yl.push.apply(Yl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){bu(e,0),_u(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)break;case 6:_u(r,t,Kl,!Rl);break a;case 2:Yl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Zl+300-De(),10<a)){if(_u(r,t,Kl,!Rl),Ge(r,0,!0)!==0)break a;au=t,r.timeoutHandle=Kd(hu.bind(null,r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,`Throttled`,-0,0),a);break a}hu(r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,null,-0,0)}}break}while(1);nd(e)}function hu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xt},Dl(t,a,d);var m=(a&62914560)===a?Zl-De():(a&4194048)===a?Ql-De():0;if(m=qf(d,m),m!==null){au=a,e.cancelPendingCommit=m(Fu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),_u(e,a,o,!l);return}}Fu(e,t,a,n,r,i,o,s,c)}function gu(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(!_r(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 _u(e,t,n,r){t&=~Gl,t&=~Wl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-R(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Qe(e,n,t)}function vu(){return X&6?!0:(rd(0,!1),!1)}function yu(){if(Z!==null){if(Il===0)var e=Z.return;else e=Z,Hi=Vi=null,Eo(e),Da=null,Oa=0,e=Z;for(;e!==null;)Fc(e.alternate,e),e=e.return;Z=null}}function bu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),au=0,yu(),Fl=e,Z=n=ai(e.current,null),Q=t,Il=0,Ll=null,Rl=!1,zl=Ke(e,t),Bl=!1,ql=Kl=Gl=Wl=Ul=Hl=0,Yl=Jl=null,Xl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-R(r),a=1<<i;t|=e[i],r&=~a}return Vl=t,Yr(),n}function xu(e,t){G=null,N.H=Ps,t===_a||t===ya?(t=Ta(),Il=3):t===va?(t=Ta(),Il=4):Il=t===Qs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ll=t,Z===null&&(Hl=1,Ks(e,pi(t,e.current)))}function Su(){var e=Qa.current;return e===null?!0:(Q&4194048)===Q?$a===null:(Q&62914560)===Q||Q&536870912?e===$a:!1}function Cu(){var e=N.H;return N.H=Ps,e===null?Ps:e}function wu(){var e=N.A;return N.A=Nl,e}function Tu(){Hl=4,Rl||(Q&4194048)!==Q&&Qa.current!==null||(zl=!0),!(Ul&134217727)&&!(Wl&134217727)||Fl===null||_u(Fl,Q,Kl,!1)}function Eu(e,t,n){var r=X;X|=2;var i=Cu(),a=wu();(Fl!==e||Q!==t)&&(eu=null,bu(e,t)),t=!1;var o=Hl;a:do try{if(Il!==0&&Z!==null){var s=Z,c=Ll;switch(Il){case 8:yu(),o=6;break a;case 3:case 2:case 9:case 6:Qa.current===null&&(t=!0);var l=Il;if(Il=0,Ll=null,Mu(e,s,c,l),n&&zl){o=0;break a}break;default:l=Il,Il=0,Ll=null,Mu(e,s,c,l)}}Du(),o=Hl;break}catch(t){xu(e,t)}while(1);return t&&e.shellSuspendCounter++,Hi=Vi=null,X=r,N.H=i,N.A=a,Z===null&&(Fl=null,Q=0,Yr()),o}function Du(){for(;Z!==null;)Au(Z)}function Ou(e,t){var n=X;X|=2;var r=Cu(),a=wu();Fl!==e||Q!==t?(eu=null,$l=De()+500,bu(e,t)):zl=Ke(e,t);a:do try{if(Il!==0&&Z!==null){t=Z;var o=Ll;b:switch(Il){case 1:Il=0,Ll=null,Mu(e,t,o,1);break;case 2:case 9:if(xa(o)){Il=0,Ll=null,ju(t);break}t=function(){Il!==2&&Il!==9||Fl!==e||(Il=7),nd(e)},o.then(t,t);break a;case 3:Il=7;break a;case 4:Il=5;break a;case 7:xa(o)?(Il=0,Ll=null,ju(t)):(Il=0,Ll=null,Mu(e,t,o,7));break;case 5:var s=null;switch(Z.tag){case 26:s=Z.memoizedState;case 5:case 27:var c=Z;if(s?Wf(s):c.stateNode.complete){Il=0,Ll=null;var l=c.sibling;if(l!==null)Z=l;else{var u=c.return;u===null?Z=null:(Z=u,Nu(u))}break b}}Il=0,Ll=null,Mu(e,t,o,5);break;case 6:Il=0,Ll=null,Mu(e,t,o,6);break;case 8:yu(),Hl=6;break a;default:throw Error(i(462))}}ku();break}catch(t){xu(e,t)}while(1);return Hi=Vi=null,N.H=r,N.A=a,X=n,Z===null?(Fl=null,Q=0,Yr(),Hl):0}function ku(){for(;Z!==null&&!Te();)Au(Z)}function Au(e){var t=Ec(e.alternate,e,Vl);e.memoizedProps=e.pendingProps,t===null?Nu(e):Z=t}function ju(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=dc(n,t,t.pendingProps,t.type,void 0,Q);break;case 11:t=dc(n,t,t.pendingProps,t.type.render,t.ref,Q);break;case 5:Eo(t);default:Fc(n,t),t=Z=oi(t,Vl),t=Ec(n,t,Vl)}e.memoizedProps=e.pendingProps,t===null?Nu(e):Z=t}function Mu(e,t,n,r){Hi=Vi=null,Eo(t),Da=null,Oa=0;var i=t.return;try{if(Zs(e,i,t,n,Q)){Hl=1,Ks(e,pi(n,e.current)),Z=null;return}}catch(t){if(i!==null)throw Z=i,t;Hl=1,Ks(e,pi(n,e.current)),Z=null;return}t.flags&32768?(W||r===1?e=!0:zl||Q&536870912?e=!1:(Rl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Qa.current,r!==null&&r.tag===13&&(r.flags|=16384))),Pu(t,e)):Nu(t)}function Nu(e){var t=e;do{if(t.flags&32768){Pu(t,Rl);return}e=t.return;var n=Nc(t.alternate,t,Vl);if(n!==null){Z=n;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);Hl===0&&(Hl=5)}function Pu(e,t){do{var n=Pc(e.alternate,e);if(n!==null){n.flags&=32767,Z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Z=e;return}Z=e=n}while(e!==null);Hl=6,Z=null}function Fu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Bu();while(nu!==0);if(X&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Jr,Ze(e,n,o,s,c,l),e===Fl&&(Z=Fl=null,Q=0),iu=t,ru=e,au=n,ou=o,su=a,cu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Yu(je,function(){return Vu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=X,X|=4;try{el(e,t,n)}finally{X=s,P.p=a,N.T=r}}nu=1,Iu(),Lu(),Ru()}}function Iu(){if(nu===1){nu=0;var e=ru,t=iu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=X;X|=4;try{pl(t,e);var a=zd,o=Sr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&xr(s.ownerDocument.documentElement,s)){if(c!==null&&Cr(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}}sp=!!Rd,zd=Rd=null}finally{X=i,P.p=r,N.T=n}}e.current=t,nu=2}}function Lu(){if(nu===2){nu=0;var e=ru,t=iu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=X;X|=4;try{tl(e,t.alternate,t)}finally{X=i,P.p=r,N.T=n}}nu=3}}function Ru(){if(nu===4||nu===3){nu=0,Ee();var e=ru,t=iu,n=au,r=cu;t.subtreeFlags&10256||t.flags&10256?nu=5:(nu=0,iu=ru=null,zu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(tu=null),tt(n),t=t.stateNode,Le&&typeof Le.onCommitFiberRoot==`function`)try{Le.onCommitFiberRoot(Ie,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{N.T=t,P.p=i}}au&3&&Bu(),nd(e),i=e.pendingLanes,n&261930&&i&42?e===uu?lu++:(lu=0,uu=e):lu=0,rd(0,!1)}}function zu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ia(t)))}function Bu(){return Iu(),Lu(),Ru(),Vu()}function Vu(){if(nu!==5)return!1;var e=ru,t=ou;ou=0;var n=tt(au),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=su,su=null;var o=ru,s=au;if(nu=0,iu=ru=null,au=0,X&6)throw Error(i(331));var c=X;if(X|=4,Al(o.current),Sl(o,o.current,s,n),X=c,rd(0,!1),Le&&typeof Le.onPostCommitFiberRoot==`function`)try{Le.onPostCommitFiberRoot(Ie,o)}catch{}return!0}finally{P.p=a,N.T=r,zu(e,t)}}function Hu(e,t,n){t=pi(n,t),t=Js(e.stateNode,t,2),e=za(e,t,2),e!==null&&(Xe(e,2),nd(e))}function Uu(e,t,n){if(e.tag===3)Hu(e,e,n);else for(;t!==null;){if(t.tag===3){Hu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(tu===null||!tu.has(r))){e=pi(n,e),n=Ys(2),r=za(t,n,2),r!==null&&(Xs(n,r,t,e),Xe(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Pl;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)||(Bl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Fl===e&&(Q&n)===n&&(Hl===4||Hl===3&&(Q&62914560)===Q&&300>De()-Zl?!(X&2)&&bu(e,0):Gl|=n,ql===Q&&(ql=0)),nd(e)}function Ku(e,t){t===0&&(t=Je()),e=Qr(e,t),e!==null&&(Xe(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(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),Ku(e,n)}function Yu(e,t){return Ce(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;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-R(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=Q,a=Ge(r,r===Fl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ke(r,a)||(n=!0,cd(r,a));r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Gd()&&(e=td);for(var t=De(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}nu!==0&&nu!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-R(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=qe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Fl,n=Q,n=Ge(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Il===2||Il===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&we(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ke(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&we(r),tt(n)){case 2:case 8:n=Ae;break;case 32:n=je;break;case 268435456:n=Ne;break;default:n=je}return r=sd.bind(null,e),n=Ce(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&we(r),e.callbackPriority=2,e.callbackNode=null,2}function sd(e,t){if(nu!==0&&nu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Bu()&&e.callbackNode!==n)return null;var r=Q;return r=Ge(e,e===Fl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(mu(e,r,t),od(e,De()),e.callbackNode!=null&&e.callbackNode===n?sd.bind(null,e):null)}function cd(e,t){if(Bu())return null;mu(e,t,!0)}function ld(){Yd(function(){X&6?Ce(ke,id):ad()})}function ud(){if(td===0){var e=sa;e===0&&(e=Ve,Ve<<=1,!(Ve&261888)&&(Ve=256)),td=e}return td}function dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Yt(``+e)}function fd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function pd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=dd((i[ot]||null).action),o=r.submitter;o&&(t=(t=o[ot]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new H(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(td!==0){var e=o?fd(i,o):new FormData(i);xs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?fd(i,o):new FormData(i),xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var md=0;md<Ur.length;md++){var hd=Ur[md];Wr(hd.toLowerCase(),`on`+(hd[0].toUpperCase()+hd.slice(1)))}Wr(Fr,`onAnimationEnd`),Wr(Ir,`onAnimationIteration`),Wr(Lr,`onAnimationStart`),Wr(`dblclick`,`onDoubleClick`),Wr(`focusin`,`onFocus`),Wr(`focusout`,`onBlur`),Wr(Rr,`onTransitionRun`),Wr(zr,`onTransitionStart`),Wr(Br,`onTransitionCancel`),Wr(Vr,`onTransitionEnd`),St(`onMouseEnter`,[`mouseout`,`mouseover`]),St(`onMouseLeave`,[`mouseout`,`mouseover`]),St(`onPointerEnter`,[`pointerout`,`pointerover`]),St(`onPointerLeave`,[`pointerout`,`pointerover`]),xt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),xt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),xt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),xt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),xt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),xt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var gd=`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(` `),_d=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(gd));function vd(e,t){t=(t&4)!=0;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){Gr(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){Gr(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[ct];n===void 0&&(n=t[ct]=new Set);var r=e+`__bubble`;n.has(r)||(Sd(t,e,2,!1),n.add(r))}function yd(e,t,n){var r=0;t&&(r|=4),Sd(n,e,r,t)}var bd=`_reactListening`+Math.random().toString(36).slice(2);function xd(e){if(!e[bd]){e[bd]=!0,yt.forEach(function(t){t!==`selectionchange`&&(_d.has(t)||yd(t,!1,e),yd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bd]||(t[bd]=!0,yd(`selectionchange`,!1,t))}}function Sd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!sn||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 Cd(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=mt(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}rn(function(){var r=a,i=Qt(n),s=[];a:{var c=Hr.get(e);if(c!==void 0){var l=H,u=e;switch(e){case`keypress`:if(pn(n)===0)break a;case`keydown`:case`keyup`:l=Pn;break;case`focusin`:u=`focus`,l=Tn;break;case`focusout`:u=`blur`,l=Tn;break;case`beforeblur`:case`afterblur`:l=Tn;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=Cn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=wn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=In;break;case Fr:case Ir:case Lr:l=En;break;case Vr:l=Ln;break;case`scroll`:case`scrollend`:l=yn;break;case`wheel`:l=Rn;break;case`copy`:case`cut`:case`paste`:l=Dn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Fn;break;case`toggle`:case`beforetoggle`:l=zn}var d=(t&4)!=0,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=an(m,p),g!=null&&d.push(wd(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(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Zt&&(u=n.relatedTarget||n.fromElement)&&(mt(u)||u[st]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?mt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Cn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Fn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:gt(l),h=u==null?c:gt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,mt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ed,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Dd(s,c,l,d,!1),u!==null&&f!==null&&Dd(s,f,u,d,!0)}}a:{if(c=r?gt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ar;else if($n(c))if(or)v=hr;else{v=pr;var y=fr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&V(r.elementType)&&(v=ar):v=mr;if(v&&=v(e,r)){er(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&zt(c,`number`,c.value)}switch(y=r?gt(r):window,e){case`focusin`:($n(y)||y.contentEditable===`true`)&&(Tr=y,Er=r,Dr=null);break;case`focusout`:Dr=Er=Tr=null;break;case`mousedown`:Or=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Or=!1,kr(s,n,i);break;case`selectionchange`:if(wr)break;case`keydown`:case`keyup`:kr(s,n,i)}var b;if(Vn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Yn?qn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Wn&&n.locale!==`ko`&&(Yn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Yn&&(b=fn()):(ln=i,un=`value`in ln?ln.value:ln.textContent,Yn=!0)),y=Td(r,x),0<y.length&&(x=new On(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Jn(n),b!==null&&(x.data=b)))),(b=Un?Xn(e,n):Zn(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new On(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),pd(s,e,r,n,i)}vd(s,t)})}function wd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Td(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=an(e,n),i!=null&&r.unshift(wd(e,i,a)),i=an(e,t),i!=null&&r.push(wd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ed(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dd(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=an(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=an(n,a),l!=null&&o.push(wd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Od=/\r\n?/g,kd=/\u0000|\uFFFD/g;function Ad(e){return(typeof e==`string`?e:``+e).replace(Od,`
9
- `).replace(kd,``)}function jd(e,t){return t=Ad(t),Ad(e)===t}function Md(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Ut(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Ut(e,``+r);break;case`className`:Ot(e,`class`,r);break;case`tabIndex`:Ot(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ot(e,n,r);break;case`style`:Kt(e,r,o);break;case`data`:if(t!==`object`){Ot(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Yt(``+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}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Md(e,t,`name`,a.name,a,null),Md(e,t,`formEncType`,a.formEncType,a,null),Md(e,t,`formMethod`,a.formMethod,a,null),Md(e,t,`formTarget`,a.formTarget,a,null)):(Md(e,t,`encType`,a.encType,a,null),Md(e,t,`method`,a.method,a,null),Md(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Yt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;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));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=Yt(``+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`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`:$(`beforetoggle`,e),$(`toggle`,e),Dt(e,`popover`,r);break;case`xlinkActuate`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Dt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=qt.get(n)||n,Dt(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:Kt(e,r,o);break;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));e.innerHTML=n}}break;case`children`:typeof r==`string`?Ut(e,r):(typeof r==`number`||typeof r==`bigint`)&&Ut(e,``+r);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!bt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ot]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Dt(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`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:Md(e,t,o,s,n,null)}}a&&Md(e,t,`srcSet`,n.srcSet,n,null),r&&Md(e,t,`src`,n.src,n,null);return;case`input`:$(`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:Md(e,t,r,d,n,null)}}Rt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in $(`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:Md(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Bt(e,!!r,n,!0):Bt(e,!!r,t,!1);return;case`textarea`:for(s in $(`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:Md(e,t,s,c,n,null)}Ht(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:Md(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<gd.length;r++)$(gd[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`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:Md(e,t,u,r,n,null)}return;default:if(V(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Md(e,t,c,r,n,null))}function Fd(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)||Md(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`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Md(e,t,p,m,r,f)}}Lt(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)||Md(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`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Md(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Bt(e,!!n,n?[]:``,!1):Bt(e,!!n,t,!0)):Bt(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:Md(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`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Md(e,t,s,a,r,o)}Vt(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:Md(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`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Md(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)&&Md(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:Md(e,t,u,p,r,m)}return;default:if(V(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(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||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Md(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||Md(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){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&&Id(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&&Id(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 Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(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 Hd(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 Ud(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 Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(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),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ft]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(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 ef(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`:ef(n),pt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(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[ft])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=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(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 cf(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 lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(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 ff(e,t,n){switch(t=Bd(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 pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);pt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=P.d;P.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=vu();return e||t}function yf(e){var t=ht(e);t!==null&&t.tag===5&&t.type===`form`?Cs(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=It(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),vt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+It(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+It(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+It(n.imageSizes)+`"]`)):i+=`[href="`+It(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),vt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+It(r)+`"][href="`+It(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),vt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=_t(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);vt(c),Pd(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,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=_t(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),vt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=_t(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),vt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=le.current)?gf(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`?(t=Af(n.href),n=_t(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,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=Af(n.href);var o=_t(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(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,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`?(t=Pf(n),n=_t(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+It(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),vt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+It(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+It(n.href)+`"]`);if(r)return t.instance=r,vt(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),vt(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,vt(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),vt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,vt(a),a):(r=n,(a=mf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),vt(a),Pd(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,Lf(r,n.precedence,e));return t.instance}function Lf(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 Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,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[ft]||a[at]||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 Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(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 Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(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=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,vt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),vt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(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=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.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=Jf.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 Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function $f(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=Ye(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ye(0),this.hiddenUpdates=Ye(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ri(3,null,null,t),e.current=a,a.stateNode=e,t=ra(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ia(a),e}function tp(e){return e?(e=ti,e):ti}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ra(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=za(e,r,t),n!==null&&(pu(n,e,t),Ba(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=Qr(e,67108864);t!==null&&pu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=du();t=et(t);var n=Qr(e,t);n!==null&&pu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,up(e,t,n,r)}finally{P.p=a,N.T=i}}function lp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,up(e,t,n,r)}finally{P.p=a,N.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Cd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=ht(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=We(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-R(o);s.entanglements[1]|=c,o&=~c}nd(a),!(X&6)&&($l=De()+500,rd(0,!1))}}break;case 31:case 13:s=Qr(a,2),s!==null&&pu(s,a,2),vu(),ip(a,2)}if(a=dp(r),a===null&&Cd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Cd(e,t,r,null,n)}}function dp(e){return e=Qt(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=mt(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 fp=e,null}function mp(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`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Oe()){case ke:return 2;case Ae:return 8;case je:case Me:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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 Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(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=ht(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=mt(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,rt(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,rt(e.priority,function(){op(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 Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Zt=r,n.target.dispatchEvent(r),Zt=null}else return t=ht(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=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(pp(r||n)===null)continue;break}var a=ht(n);a!==null&&(e.splice(t,3),t-=3,xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.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[ot]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ot]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){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 Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,du(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),vu(),t[st]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=nt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.5`)throw Error(i(527,Lp,`19.2.5`));P.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=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Ie=zp.inject(Rp),Le=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Us,s=Ws,c=Gs;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=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[st]=t.current,xd(e),new Fp(t)}})),g=o(((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=h()})),_=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(){}},v=new class extends _{#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`}},y={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},b=new class{#e=y;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 x(e){setTimeout(e,0)}var S=typeof window>`u`||`Deno`in globalThis;function C(){}function w(e,t){return typeof e==`function`?e(t):e}function T(e){return typeof e==`number`&&e>=0&&e!==1/0}function E(e,t){return Math.max(e+(t||0)-Date.now(),0)}function D(e,t){return typeof e==`function`?e(t):e}function O(e,t){return typeof e==`function`?e(t):e}function k(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ee(o,t.options))return!1}else if(!te(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 A(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(j(t.options.mutationKey)!==j(a))return!1}else if(!te(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ee(e,t){return(t?.queryKeyHashFn||j)(e)}function j(e){return JSON.stringify(e,(e,t)=>re(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function te(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>te(e[n],t[n])):!1}var M=Object.prototype.hasOwnProperty;function ne(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=P(e)&&P(t);if(!r&&!(re(e)&&re(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:M.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ne(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function N(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 P(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function re(e){if(!ie(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ie(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ie(e){return Object.prototype.toString.call(e)===`[object Object]`}function ae(e){return new Promise(t=>{b.setTimeout(t,e)})}function oe(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ne(e,t)}function F(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function I(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var se=Symbol();function ce(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===se?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function le(e,t){return typeof e==`function`?e(...t):!!e}function ue(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var de=(()=>{let e=()=>S;return{isServer(){return e()},setIsServer(t){e=t}}})();function fe(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var pe=x;function me(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=pe,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 he=me(),ge=new class extends _{#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 _e(e){return Math.min(1e3*2**e,3e4)}function ve(e){return(e??`online`)===`online`?ge.isOnline():!0}var ye=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function be(e){let t=!1,n=0,r,i=fe(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new ye(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>v.isFocused()&&(e.networkMode===`always`||ge.isOnline())&&e.canRun(),u=()=>ve(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())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(d).catch(r=>{if(a())return;let i=e.retry??(de.isServer()?0:3),o=e.retryDelay??_e,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),ae(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var xe=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),T(this.gcTime)&&(this.#e=b.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(de.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(b.clearTimeout(this.#e),this.#e=void 0)}},Se=class extends xe{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Te(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Te(this.options);e.data!==void 0&&(this.setState(we(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=oe(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(C).catch(C):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>O(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===se||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>D(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!E(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.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.#o=!0,n.signal)})},i=()=>{let e=ce(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!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.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=be({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ye&&e.revert&&this.setState({...this.#t,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 this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ye){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(e){this.state=(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,...Ce(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...we(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=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),he.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function Ce(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ve(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function we(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Te(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`}}function Ee(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=>{ue(e,()=>t.signal,()=>n=!0)},u=ce(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?I:F;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Oe:De,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:De(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function De(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 Oe(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var ke=class extends xe{#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||Ae(),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.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=be({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)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),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:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}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.#n.runNext(this)}}#i(e){this.state=(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),he.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ae(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var je=class extends _{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new ke({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=Me(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=Me(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=Me(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Me(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){he.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=>A(t,e))}findAll(e={}){return this.getAll().filter(t=>A(e,t))}notify(e){he.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return he.batch(()=>Promise.all(e.map(e=>e.continue().catch(C))))}};function Me(e){return e.options.scope?.id}var Ne=class extends _{#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),N(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&j(t.mutationKey)!==j(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}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??Ae();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){he.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)})})}},Pe=class extends _{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??ee(r,t),a=this.get(i);return a||(a=new Se({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(){he.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=>k(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>k(e,t)):t}notify(e){he.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){he.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){he.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Fe=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Pe,this.#t=e.mutationCache||new je,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=v.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ge.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(D(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=w(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return he.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;he.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return he.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=he.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(C).catch(C)}invalidateQueries(e,t={}){return he.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=he.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(C)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(C)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(D(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(C).catch(C)}fetchInfiniteQuery(e){return e.behavior=Ee(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(C).catch(C)}ensureInfiniteQueryData(e){return e.behavior=Ee(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ge.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(j(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{te(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(j(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{te(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||=ee(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===se&&(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()}},Ie=o((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})),Le=o(((e,t)=>{t.exports=Ie()})),L=c(u(),1),R=Le(),Re=L.createContext(void 0),ze=e=>{let t=L.useContext(Re);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Be=({client:e,children:t})=>(L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,R.jsx)(Re.Provider,{value:e,children:t}));function Ve(e){return e}function He(e,t){let n=ze(t),[r]=L.useState(()=>new Ne(n,e));L.useEffect(()=>{r.setOptions(e)},[r,e]);let i=L.useSyncExternalStore(L.useCallback(e=>r.subscribe(he.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=L.useCallback((e,t)=>{r.mutate(e,t).catch(C)},[r]);if(i.error&&le(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Ue=`modulepreload`,We=function(e){return`/`+e},Ge={},Ke=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=We(t,n),t in Ge)return;Ge[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Ue,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},qe=e=>{throw TypeError(e)},Je=(e,t,n)=>t.has(e)||qe(`Cannot `+n),Ye=(e,t,n)=>(Je(e,t,`read from private field`),n?n.call(e):t.get(e)),Xe=(e,t,n)=>t.has(e)?qe(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Ze=`popstate`;function Qe(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function $e(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return rt(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:it(t)}return ot(t,n,null,e)}function z(e,t){if(e===!1||e==null)throw Error(t)}function et(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function tt(){return Math.random().toString(36).substring(2,10)}function nt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function rt(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?at(t):t,state:n,key:t&&t.key||r||tt(),unstable_mask:i}}function it({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function at(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function ot(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=Qe(e)?e:rt(h.location,e,t);n&&n(r,e),l=u()+1;let d=nt(r,l),f=h.createHref(r.unstable_mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=Qe(e)?e:rt(h.location,e,t);n&&n(r,e),l=u();let i=nt(r,l),d=h.createHref(r.unstable_mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return st(e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Ze,d),c=e,()=>{i.removeEventListener(Ze,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function st(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),z(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:it(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}var ct,lt=class{constructor(e){if(Xe(this,ct,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(Ye(this,ct).has(e))return Ye(this,ct).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){Ye(this,ct).set(e,t)}};ct=new WeakMap;var ut=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function dt(e){return ut.has(e)}var ft=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function pt(e){return ft.has(e)}function mt(e){return e.index===!0}function ht(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(z(e.index!==!0||!e.children,`Cannot specify children on an index route`),z(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),mt(e)){let n={...e,id:s};return r[s]=gt(n,t(n)),n}else{let n={...e,id:s,children:void 0};return r[s]=gt(n,t(n)),e.children&&(n.children=ht(e.children,t,o,r,i)),n}})}function gt(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function _t(e,t,n=`/`){return vt(e,t,n,!1)}function vt(e,t,n,r){let i=Ft((typeof t==`string`?at(t):t).pathname||`/`,n);if(i==null)return null;let a=bt(e);St(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=Pt(i);o=jt(a[e],t,r)}return o}function yt(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function bt(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;z(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Kt([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(z(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),bt(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:B(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of xt(e.path))a(e,t,!0,n)}),t}function xt(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=xt(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function St(e){e.sort((e,t)=>e.score===t.score?At(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Ct=/^:[\w-]+$/,wt=3,Tt=2,Et=1,Dt=10,Ot=-2,kt=e=>e===`*`;function B(e,t){let n=e.split(`/`),r=n.length;return n.some(kt)&&(r+=Ot),t&&(r+=Tt),n.filter(e=>!kt(e)).reduce((e,t)=>e+(Ct.test(t)?wt:t===``?Et:Dt),r)}function At(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function jt(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=Mt({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=Mt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:Kt([a,u.pathname]),pathnameBase:qt(Kt([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=Kt([a,u.pathnameBase]))}return o}function Mt(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Nt(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Nt(e,t=!1,n=!0){et(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Pt(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return et(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ft(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function It({basename:e,pathname:t}){return t===`/`?e:Kt([e,t])}var Lt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Rt=e=>Lt.test(e);function zt(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?at(e):e,a;return n?(n=Gt(n),a=n.startsWith(`/`)?Bt(n.substring(1),`/`):Bt(n,t)):a=t,{pathname:a,search:Jt(r),hash:Yt(i)}}function Bt(e,t){let n=V(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Vt(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Ht(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Ut(e){let t=Ht(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Wt(e,t,n,r=!1){let i;typeof e==`string`?i=at(e):(i={...e},z(!i.pathname||!i.pathname.includes(`?`),Vt(`?`,`pathname`,`search`,i)),z(!i.pathname||!i.pathname.includes(`#`),Vt(`#`,`pathname`,`hash`,i)),z(!i.search||!i.search.includes(`#`),Vt(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=zt(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Gt=e=>e.replace(/\/\/+/g,`/`),Kt=e=>Gt(e.join(`/`)),V=e=>e.replace(/\/+$/,``),qt=e=>V(e).replace(/^\/*/,`/`),Jt=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Yt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Xt=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Zt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Qt(e){return Kt(e.map(e=>e.route.path).filter(Boolean))||`/`}var $t=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function en(e,t){let n=e;if(typeof n!=`string`||!Lt.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if($t)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=Ft(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{et(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var tn=Symbol(`Uninstrumented`);function nn(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=an(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=an(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[tn]??i,a=an(n[e],t,(...e)=>sn(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[tn]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[tn]??e,r=an(n.middleware,t,(...e)=>sn(e[0]));return r?(r[tn]=t,r):e})),r}function rn(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[tn]??e.navigate,r=an(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?it(n):`.`,...cn(e,r??{})}});r&&(r[tn]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[tn]??e.fetch,r=an(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...cn(e,i??{})}});r&&(r[tn]=t,e.fetch=r)}return e}function an(e,t,n){return e.length===0?null:async(...r)=>{let i=await on(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function on(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=on(e,t,n,r-1),a=await o,z(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function sn(e){let{request:t,context:n,params:r,unstable_pattern:i}=e;return{request:ln(t),params:{...r},unstable_pattern:i,context:un(n)}}function cn(e,t){return{currentUrl:it(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function ln(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function un(e){if(fn(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var dn=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function fn(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===dn}var pn=[`POST`,`PUT`,`PATCH`,`DELETE`],mn=new Set(pn),hn=[`GET`,...pn],gn=new Set(hn),_n=new Set([301,302,303,307,308]),H=new Set([307,308]),vn={state:`idle`,location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},yn={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},bn={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},U=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),xn=`remix-router-transitions`,Sn=Symbol(`ResetLoaderData`);function Cn(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;z(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||U,a=i;if(e.unstable_instrumentations){let t=e.unstable_instrumentations;a=e=>({...i(e),...nn(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=ht(e.routes,a,void 0,o),c,l=e.basename||`/`;l.startsWith(`/`)||(l=`/${l}`);let u=e.dataStrategy||Bn,d={unstable_passThroughRequests:!1,...e.future},f=null,p=new Set,m=null,h=null,g=null,_=e.hydrationData!=null,v=_t(s,e.history.location,l),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=ur(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=lr(s);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&Ge(v,s,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=Ge(null,s,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}else if(v.some(e=>e.route.lazy))x=!1,S=!x;else if(!v.some(e=>On(e.route)))x=!0,S=!x;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=v;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}S=!1,x=!0,r.forEach(e=>{let r=kn(e.route,t,n);S||=r.renderFallback,x&&=!r.shouldLoad})}let C,w={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,renderFallback:S,navigation:vn,restoreScrollPosition:e.hydrationData==null?null:!1,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},T=`POP`,E=null,D=!1,O,k=!1,A=new Map,ee=null,j=!1,te=!1,M=new Set,ne=new Map,N=0,P=-1,re=new Map,ie=new Set,ae=new Map,oe=new Map,F=new Set,I=new Map,se,ce=null;function le(){if(f=e.history.listen(({action:t,location:n,delta:r})=>{if(se){se(),se=void 0;return}et(I.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=ze({currentLocation:w.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{se=e});e.history.go(r*-1),Re(i,{state:`blocked`,location:n,proceed(){Re(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(w.blockers);e.set(i,bn),fe({blockers:e})}}),E?.resolve(),E=null;return}return ge(t,n)}),n){Pr(t,A);let e=()=>Fr(t,A);t.addEventListener(`pagehide`,e),ee=()=>t.removeEventListener(`pagehide`,e)}return w.initialized||ge(`POP`,w.location,{initialHydration:!0}),C}function ue(){f&&f(),ee&&ee(),p.clear(),O&&O.abort(),w.fetchers.forEach((e,t)=>Me(t)),w.blockers.forEach((e,t)=>R(t))}function de(e){return p.add(e),()=>p.delete(e)}function fe(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),w={...w,...e};let n=[],r=[];w.fetchers.forEach((e,t)=>{e.state===`idle`&&(F.has(t)?n.push(t):r.push(t))}),F.forEach(e=>{!w.fetchers.has(e)&&!ne.has(e)&&n.push(e)}),[...p].forEach(r=>r(w,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Me(e)),r.forEach(e=>w.fetchers.delete(e))}function pe(t,n,{flushSync:r}={}){let i=w.actionData!=null&&w.navigation.formMethod!=null&&Tr(w.navigation.formMethod)&&w.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?w.actionData:null;let o=n.loaderData?or(w.loaderData,n.loaderData,n.matches||[],n.errors):w.loaderData,l=w.blockers;l.size>0&&(l=new Map(l),l.forEach((e,t)=>l.set(t,bn)));let u=j?!1:We(t,n.matches||w.matches),d=D===!0||w.navigation.formMethod!=null&&Tr(w.navigation.formMethod)&&t.state?._isRedirect!==!0;c&&=(s=c,void 0),j||T===`POP`||(T===`PUSH`?e.history.push(t,t.state):T===`REPLACE`&&e.history.replace(t,t.state));let f;if(T===`POP`){let e=A.get(w.location.pathname);e&&e.has(t.pathname)?f={currentLocation:w.location,nextLocation:t}:A.has(t.pathname)&&(f={currentLocation:t,nextLocation:w.location})}else if(k){let e=A.get(w.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),A.set(w.location.pathname,e)),f={currentLocation:w.location,nextLocation:t}}fe({...n,actionData:a,loaderData:o,historyAction:T,location:t,initialized:!0,renderFallback:!1,navigation:vn,revalidation:`idle`,restoreScrollPosition:u,preventScrollReset:d,blockers:l},{viewTransitionOpts:f,flushSync:r===!0}),T=`POP`,D=!1,k=!1,j=!1,te=!1,E?.resolve(),E=null,ce?.resolve(),ce=null}async function me(t,n){if(E?.resolve(),E=null,typeof t==`number`){E||=Ir();let n=E.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=En(!1,Tn(w.location,w.matches,l,t,n?.fromRouteId,n?.relative),n),o;n?.unstable_mask&&(o={pathname:``,search:``,hash:``,...typeof n.unstable_mask==`string`?at(n.unstable_mask):{...w.location.unstable_mask,...n.unstable_mask}});let s=w.location,c=rt(s,r,n&&n.state,void 0,o);c={...c,...e.history.encodeLocation(c)};let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&Tr(i.formMethod)&&i.formAction===w.location.pathname+w.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=ze({currentLocation:s,nextLocation:c,historyAction:d});if(m){Re(m,{state:`blocked`,location:c,proceed(){Re(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:c}),me(t,n)},reset(){let e=new Map(w.blockers);e.set(m,bn),fe({blockers:e})}});return}await ge(d,c,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.unstable_defaultShouldRevalidate})}function he(){ce||=Ir(),De(),fe({revalidation:`loading`});let e=ce.promise;return w.navigation.state===`submitting`?e:w.navigation.state===`idle`?(ge(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),e):(ge(T||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:k===!0}),e)}async function ge(t,n,r){O&&O.abort(),O=null,T=t,j=(r&&r.startUninterruptedRevalidation)===!0,Ue(w.location,w.matches),D=(r&&r.preventScrollReset)===!0,k=(r&&r.enableViewTransition)===!0;let i=c||s,a=r&&r.overrideNavigation,o=r?.initialHydration&&w.matches&&w.matches.length>0&&!y?w.matches:_t(i,n,l),u=(r&&r.flushSync)===!0;if(o&&w.initialized&&!te&&pr(w.location,n)&&!(r&&r.submission&&Tr(r.submission.formMethod))){pe(n,{matches:o},{flushSync:u});return}let d=Ge(o,i,n.pathname);if(d.active&&d.matches&&(o=d.matches),!o){let{error:e,notFoundMatches:t,route:r}=Be(n.pathname);pe(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:u});return}O=new AbortController;let f=er(e.history,n,O.signal,r&&r.submission),p=e.getContext?await e.getContext():new lt,m;if(r&&r.pendingError)m=[cr(o).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Tr(r.submission.formMethod)){let t=await _e(f,n,r.submission,o,p,d.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:u});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(vr(r)&&Zt(r.error)&&r.error.status===404){O=null,pe(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}});return}}o=t.matches||o,m=t.pendingActionResult,a=kr(n,r.submission),u=!1,d.active=!1,f=er(e.history,f.url,f.signal)}let{shortCircuited:h,matches:g,loaderData:_,errors:v}=await ve(f,n,o,p,d.active,a,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,u,m,r&&r.callSiteDefaultShouldRevalidate);h||(O=null,pe(n,{matches:g||o,...sr(m),loaderData:_,errors:v}))}async function _e(t,n,i,c,u,d,f,p={}){if(De(),fe({navigation:Ar(n,i)},{flushSync:p.flushSync===!0}),d){let e=await Ke(c,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=lr(s);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=cr(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}else if(e.matches)c=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Be(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let m,h=Dr(c,n);if(!h.route.action&&!h.route.lazy)m={type:`error`,error:ur(405,{method:t.method,pathname:n.pathname,routeId:h.route.id})};else{let e=await Te(t,n,Kn(a,o,t,n,c,h,f?[]:r,u),u,null);if(m=e[h.route.id],!m){for(let t of c)if(e[t.route.id]){m=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(yr(m)){let n;return n=p&&p.replace!=null?p.replace:$n(m.response.headers.get(`Location`),new URL(t.url),l,e.history)===w.location.pathname+w.location.search,await we(t,m,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(vr(m)){let e=cr(c,h.route.id);return(p&&p.replace)!==!0&&(T=`PUSH`),{matches:c,pendingActionResult:[e.route.id,m,h.route.id]}}return{matches:c,pendingActionResult:[h.route.id,m]}}async function ve(t,n,i,u,d,f,p,m,h,g,_,v,y){let b=f||kr(n,p),x=p||m||Or(b),S=!j&&!g;if(d){if(S){let e=ye(v);fe({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await Ke(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=lr(s);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=cr(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}else if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=Be(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=c||s,{dsMatches:T,revalidatingFetchers:E}=Dn(t,u,a,o,e.history,w,i,x,n,g?[]:r,g===!0,te,M,F,ae,ie,C,l,e.patchRoutesOnNavigation!=null,v,y);if(P=++N,!e.dataStrategy&&!T.some(e=>e.shouldLoad)&&!T.some(e=>e.route.middleware&&e.route.middleware.length>0)&&E.length===0){let e=Ie();return pe(n,{matches:i,loaderData:{},errors:v&&vr(v[1])?{[v[0]]:v[1].error}:null,...sr(v),...e?{fetchers:new Map(w.fetchers)}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=ye(v);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=be(E)),fe(e,{flushSync:_})}E.forEach(e=>{Pe(e.key),e.controller&&ne.set(e.key,e.controller)});let D=()=>E.forEach(e=>Pe(e.key));O&&O.signal.addEventListener(`abort`,D);let{loaderResults:k,fetcherResults:A}=await Ee(T,E,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener(`abort`,D),E.forEach(e=>ne.delete(e.key));let ee=dr(k);if(ee)return await we(t,ee.result,!0,{replace:h}),{shortCircuited:!0};if(ee=dr(A),ee)return ie.add(ee.key),await we(t,ee.result,!0,{replace:h}),{shortCircuited:!0};let{loaderData:re,errors:oe}=ar(w,i,k,v,E,A);g&&w.errors&&(oe={...w.errors,...oe});let I=Ie(),se=Le(P),ce=I||se||E.length>0;return{matches:i,loaderData:re,errors:oe,...ce?{fetchers:new Map(w.fetchers)}:{}}}function ye(e){if(e&&!vr(e[1]))return{[e[0]]:e[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function be(e){return e.forEach(e=>{let t=w.fetchers.get(e.key),n=jr(void 0,t?t.data:void 0);w.fetchers.set(e.key,n)}),new Map(w.fetchers)}async function xe(t,n,r,i){Pe(t);let a=(i&&i.flushSync)===!0,o=c||s,u=Tn(w.location,w.matches,l,r,n,i?.relative),d=_t(o,u,l),f=Ge(d,o,u);if(f.active&&f.matches&&(d=f.matches),!d){ke(t,n,ur(404,{pathname:u}),{flushSync:a});return}let{path:p,submission:m,error:h}=En(!0,u,i);if(h){ke(t,n,h,{flushSync:a});return}let g=e.getContext?await e.getContext():new lt,_=(i&&i.preventScrollReset)===!0;if(m&&Tr(m.formMethod)){await Se(t,n,p,d,g,f.active,a,_,m,i&&i.unstable_defaultShouldRevalidate);return}ae.set(t,{routeId:n,path:p}),await Ce(t,n,p,d,g,f.active,a,_,m)}async function Se(t,n,i,u,d,f,p,m,h,g){De(),ae.delete(t),Oe(t,Mr(h,w.fetchers.get(t)),{flushSync:p});let _=new AbortController,v=er(e.history,i,_.signal,h);if(f){let e=await Ke(u,new URL(v.url).pathname,v.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){ke(t,n,e.error,{flushSync:p});return}else if(e.matches)u=e.matches;else{ke(t,n,ur(404,{pathname:i}),{flushSync:p});return}}let y=Dr(u,i);if(!y.route.action&&!y.route.lazy){ke(t,n,ur(405,{method:h.formMethod,pathname:i,routeId:n}),{flushSync:p});return}ne.set(t,_);let b=N,x=Kn(a,o,v,i,u,y,r,d),S=await Te(v,i,x,d,t),C=S[y.route.id];if(!C){for(let e of x)if(S[e.route.id]){C=S[e.route.id];break}}if(v.signal.aborted){ne.get(t)===_&&ne.delete(t);return}if(F.has(t)){if(yr(C)||vr(C)){Oe(t,Nr(void 0));return}}else{if(yr(C))if(ne.delete(t),P>b){Oe(t,Nr(void 0));return}else return ie.add(t),Oe(t,jr(h)),we(v,C,!1,{fetcherSubmission:h,preventScrollReset:m});if(vr(C)){ke(t,n,C.error);return}}let E=w.navigation.location||w.location,D=er(e.history,E,_.signal),k=c||s,A=w.navigation.state===`idle`?w.matches:_t(k,w.navigation.location,l);z(A,`Didn't find any matches after fetcher action`);let ee=++N;re.set(t,ee);let j=jr(h,C.data);w.fetchers.set(t,j);let{dsMatches:oe,revalidatingFetchers:I}=Dn(D,d,a,o,e.history,w,A,h,E,r,!1,te,M,F,ae,ie,k,l,e.patchRoutesOnNavigation!=null,[y.route.id,C],g);I.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=w.fetchers.get(t),r=jr(void 0,n?n.data:void 0);w.fetchers.set(t,r),Pe(t),e.controller&&ne.set(t,e.controller)}),fe({fetchers:new Map(w.fetchers)});let se=()=>I.forEach(e=>Pe(e.key));_.signal.addEventListener(`abort`,se);let{loaderResults:ce,fetcherResults:le}=await Ee(oe,I,D,E,d);if(_.signal.aborted)return;if(_.signal.removeEventListener(`abort`,se),re.delete(t),ne.delete(t),I.forEach(e=>ne.delete(e.key)),w.fetchers.has(t)){let e=Nr(C.data);w.fetchers.set(t,e)}let ue=dr(ce);if(ue)return we(D,ue.result,!1,{preventScrollReset:m});if(ue=dr(le),ue)return ie.add(ue.key),we(D,ue.result,!1,{preventScrollReset:m});let{loaderData:de,errors:me}=ar(w,A,ce,void 0,I,le);Le(ee),w.navigation.state===`loading`&&ee>P?(z(T,`Expected pending action`),O&&O.abort(),pe(w.navigation.location,{matches:A,loaderData:de,errors:me,fetchers:new Map(w.fetchers)})):(fe({errors:me,loaderData:or(w.loaderData,de,A,me),fetchers:new Map(w.fetchers)}),te=!1)}async function Ce(t,n,i,s,c,l,u,d,f){let p=w.fetchers.get(t);Oe(t,jr(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=er(e.history,i,m.signal);if(l){let e=await Ke(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){ke(t,n,e.error,{flushSync:u});return}else if(e.matches)s=e.matches;else{ke(t,n,ur(404,{pathname:i}),{flushSync:u});return}}let g=Dr(s,i);ne.set(t,m);let _=N,v=await Te(h,i,Kn(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(ne.get(t)===m&&ne.delete(t),!h.signal.aborted){if(F.has(t)){Oe(t,Nr(void 0));return}if(yr(y))if(P>_){Oe(t,Nr(void 0));return}else{ie.add(t),await we(h,y,!1,{preventScrollReset:d});return}if(vr(y)){ke(t,n,y.error);return}Oe(t,Nr(y.data))}}async function we(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:c,replace:u}={}){a||(E?.resolve(),E=null),i.response.headers.has(`X-Remix-Revalidate`)&&(te=!0);let d=i.response.headers.get(`Location`);z(d,`Expected a Location header on the redirect Response`),d=$n(d,new URL(r.url),l,e.history);let f=rt(w.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(Rt(d)){let n=st(d,!0);e=n.origin!==t.location.origin||Ft(n.pathname,l)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}O=null;let p=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:m,formAction:h,formEncType:g}=w.navigation;!o&&!s&&m&&h&&g&&(o=Or(w.navigation));let _=o||s;H.has(i.response.status)&&_&&Tr(_.formMethod)?await ge(p,f,{submission:{..._,formAction:d},preventScrollReset:c||D,enableViewTransition:a?k:void 0}):await ge(p,f,{overrideNavigation:kr(f,o),fetcherSubmission:s,preventScrollReset:c||D,enableViewTransition:a?k:void 0})}async function Te(e,t,n,r,i){let a,o={};try{a=await qn(u,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!Tr(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!w.loaderData.hasOwnProperty(e.route.id)&&(!w.errors||!w.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(_r(r)){let i=r.result;o[t]={type:`redirect`,response:Zn(i,e,t,n,l)}}else o[t]=await Xn(r);return o}async function Ee(e,t,n,r,i){let a=Te(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Te(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}else return Promise.resolve({[e.key]:{type:`error`,error:ur(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function De(){te=!0,ae.forEach((e,t)=>{ne.has(t)&&M.add(t),Pe(t)})}function Oe(e,t,n={}){w.fetchers.set(e,t),fe({fetchers:new Map(w.fetchers)},{flushSync:(n&&n.flushSync)===!0})}function ke(e,t,n,r={}){let i=cr(w.matches,t);Me(e),fe({errors:{[i.route.id]:n},fetchers:new Map(w.fetchers)},{flushSync:(r&&r.flushSync)===!0})}function Ae(e){return oe.set(e,(oe.get(e)||0)+1),F.has(e)&&F.delete(e),w.fetchers.get(e)||yn}function je(e,t){Pe(e,t?.reason),Oe(e,Nr(null))}function Me(e){let t=w.fetchers.get(e);ne.has(e)&&!(t&&t.state===`loading`&&re.has(e))&&Pe(e),ae.delete(e),re.delete(e),ie.delete(e),F.delete(e),M.delete(e),w.fetchers.delete(e)}function Ne(e){let t=(oe.get(e)||0)-1;t<=0?(oe.delete(e),F.add(e)):oe.set(e,t),fe({fetchers:new Map(w.fetchers)})}function Pe(e,t){let n=ne.get(e);n&&(n.abort(t),ne.delete(e))}function Fe(e){for(let t of e){let e=Nr(Ae(t).data);w.fetchers.set(t,e)}}function Ie(){let e=[],t=!1;for(let n of ie){let r=w.fetchers.get(n);z(r,`Expected fetcher: ${n}`),r.state===`loading`&&(ie.delete(n),e.push(n),t=!0)}return Fe(e),t}function Le(e){let t=[];for(let[n,r]of re)if(r<e){let e=w.fetchers.get(n);z(e,`Expected fetcher: ${n}`),e.state===`loading`&&(Pe(n),re.delete(n),t.push(n))}return Fe(t),t.length>0}function L(e,t){let n=w.blockers.get(e)||bn;return I.get(e)!==t&&I.set(e,t),n}function R(e){w.blockers.delete(e),I.delete(e)}function Re(e,t){let n=w.blockers.get(e)||bn;z(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(w.blockers);r.set(e,t),fe({blockers:r})}function ze({currentLocation:e,nextLocation:t,historyAction:n}){if(I.size===0)return;I.size>1&&et(!1,`A router only supports one blocker at a time`);let r=Array.from(I.entries()),[i,a]=r[r.length-1],o=w.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function Be(e){let t=ur(404,{pathname:e}),{matches:n,route:r}=lr(c||s);return{notFoundMatches:n,route:r,error:t}}function Ve(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===vn){_=!0;let e=We(w.location,w.matches);e!=null&&fe({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function He(e,t){return h&&h(e,t.map(e=>yt(e,w.loaderData)))||e.key}function Ue(e,t){if(m&&g){let n=He(e,t);m[n]=g()}}function We(e,t){if(m){let n=He(e,t),r=m[n];if(typeof r==`number`)return r}return null}function Ge(t,n,r){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:vt(n,r,l,!0)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:vt(n,r,l,!0)}}return{active:!1,matches:null}}async function Ke(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let u=t;for(;;){let t=c==null,d=c||s,f=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:u,fetcherKey:i,patch:(e,t)=>{r.aborted||Nn(e,t,d,f,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:u}}finally{t&&!r.aborted&&(s=[...s])}if(r.aborted)return{type:`aborted`};let p=_t(d,n,l),m=null;if(p&&(Object.keys(p[0].params).length===0||(m=vt(d,n,l,!0),!(m&&u.length<m.length&&qe(u,m.slice(0,u.length))))))return{type:`success`,matches:p};if(m||=vt(d,n,l,!0),!m||qe(u,m))return{type:`success`,matches:null};u=m}}function qe(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function Je(e){o={},c=ht(e,a,void 0,o)}function Ye(e,t,n=!1){let r=c==null;Nn(e,t,c||s,o,a,n),r&&(s=[...s],fe({}))}return C={get basename(){return l},get future(){return d},get state(){return w},get routes(){return s},get window(){return t},initialize:le,subscribe:de,enableScrollRestoration:Ve,navigate:me,fetch:xe,revalidate:he,createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Ae,resetFetcher:je,deleteFetcher:Ne,dispose:ue,getBlocker:L,deleteBlocker:R,patchRoutes:Ye,_internalFetchControllers:ne,_internalSetRoutes:Je,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){fe(e)}},e.unstable_instrumentations&&(C=rn(C,e.unstable_instrumentations.map(e=>e.router).filter(Boolean))),C}function wn(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function Tn(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=Wt(r||`.`,Ut(o),Ft(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=Er(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=It({basename:n,pathname:c.pathname})),it(c)}function En(e,t,n){if(!n||!wn(n))return{path:t};if(n.formMethod&&!wr(n.formMethod))return{path:t,error:ur(405,{method:n.formMethod})};let r=()=>({path:t,error:ur(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=fr(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Tr(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}
10
- `,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}else if(n.formEncType===`application/json`){if(!Tr(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}z(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=nr(n.formData),s=n.formData;else if(n.body instanceof FormData)o=nr(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=rr(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=rr(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(Tr(c.formMethod))return{path:t,submission:c};let l=at(t);return e&&l.search&&Er(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:it(l),submission:c}}function Dn(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b){let x=y?vr(y[1])?y[1].error:y[1].data:void 0,S=i.createURL(a.location),C=i.createURL(c),w;if(u&&a.errors){let e=Object.keys(a.errors)[0];w=o.findIndex(t=>t.route.id===e)}else if(y&&vr(y[1])){let e=y[0];w=o.findIndex(t=>t.route.id===e)-1}let T=y?y[1].statusCode:void 0,E=T&&T>=400,D={currentUrl:S,currentParams:a.matches[0]?.params||{},nextUrl:C,nextParams:o[0].params,...s,actionResult:x,actionStatus:T},O=Qt(o),k=o.map((i,o)=>{let{route:s}=i,f=null;if(w!=null&&o>w)f=!1;else if(s.lazy)f=!0;else if(!On(s))f=!1;else if(u){let{shouldLoad:e}=kn(s,a.loaderData,a.errors);f=e}else An(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Gn(n,r,e,c,O,i,l,t,f);let p=!1;typeof b==`boolean`?p=b:E?p=!1:d||S.pathname+S.search===C.pathname+C.search?p=!0:S.search===C.search?jn(a.matches[o],i)&&(p=!0):p=!0;let m={...D,defaultShouldRevalidate:p};return Gn(n,r,e,c,O,i,l,t,Mn(i,m),m,b)}),A=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,y=_t(g,e.path,_);if(!y){if(v&&m)return;A.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let x=Dr(y,e.path),S=new AbortController,C=er(i,e.path,S.signal),w=null;if(f.has(s))f.delete(s),w=Kn(n,r,C,e.path,y,x,l,t);else if(m)d&&(w=Kn(n,r,C,e.path,y,x,l,t));else{let i;i=typeof b==`boolean`?b:E?!1:d;let a={...D,defaultShouldRevalidate:i};Mn(x,a)&&(w=Kn(n,r,C,e.path,y,x,l,t,a))}w&&A.push({key:s,routeId:e.routeId,path:e.path,matches:w,match:x,request:C,controller:S})}),{dsMatches:k,revalidatingFetchers:A}}function On(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function kn(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!On(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function An(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function jn(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function Mn(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Nn(e,t,n,r,i,a){let o;if(e){let t=r[e];z(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>Pn(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=ht(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=ht([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}}function Pn(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>Pn(e,t)))??!1:!1}var Fn=new WeakMap,In=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(z(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=Fn.get(i);o||(o={},Fn.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=dt(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)et(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)et(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},Ln=new WeakMap;function Rn(e,t,n,r,i){let a=n[e.id];if(z(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=Ln.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{z(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=pt(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?et(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?et(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return Ln.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=In({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function zn(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Bn(e){return e.matches.some(e=>e.route.middleware)?Vn(e,()=>zn(e)):zn(e)}function Vn(e,t){return Hn(e,t,e=>{if(Cr(e))throw e;return e},hr,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=cr(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function Hn(e,t,n,r,i){let{matches:a,...o}=e;return await Un(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Un(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await Un(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function Wn(e,t,n,r,i){let a=In({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Rn(r.route,Tr(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Gn(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Wn(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?Mn(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?Mn(a,{...l,defaultShouldRevalidate:e}):Mn(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Tr(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Tr(n.method)||!p)?Jn({request:n,path:r,unstable_pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function Kn(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Gn(e,t,n,r,Qt(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Wn(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function qn(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,unstable_url:tr(t,n),unstable_pattern:Qt(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return Vn(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function Jn({request:e,path:t,unstable_pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Tr(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,unstable_url:tr(e,t),unstable_pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a)if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw ur(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}else if(t)c=await f(t);else{let t=new URL(e.url);throw ur(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function Yn(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Xn(e){let{result:t,type:n}=e;if(xr(t)){let e;try{e=await Yn(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new Xt(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?br(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:mr(t),statusCode:Zt(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Zt(t)?t.status:void 0}:br(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function Zn(e,t,n,r,i){let a=e.headers.get(`Location`);if(z(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!Rt(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=Tn(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Qn=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function $n(e,t,n,r){if(Rt(e)){let r=e,i=r.startsWith(`//`)?new URL(t.protocol+r):new URL(r);if(Qn.includes(i.protocol))throw Error(`Invalid redirect location`);let a=Ft(i.pathname,n)!=null;if(i.origin===t.origin&&a)return Gt(i.pathname)+i.search+i.hash}try{let t=r.createURL(e);if(Qn.includes(t.protocol))throw Error(`Invalid redirect location`)}catch{}return e}function er(e,t,n,r){let i=e.createURL(fr(t)).toString(),a={signal:n};if(r&&Tr(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):t===`text/plain`?a.body=r.text:t===`application/x-www-form-urlencoded`&&r.formData?a.body=nr(r.formData):a.body=r.formData}return new Request(i,a)}function tr(e,t){let n=new URL(e.url),r=typeof t==`string`?at(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function nr(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function rr(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function ir(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&vr(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(z(!yr(f),`Cannot handle redirect results in processLoaderData`),vr(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=cr(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=Sn),c||(c=!0,s=Zt(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function ar(e,t,n,r,i,a){let{loaderData:o,errors:s}=ir(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let o=a[n];if(z(o,`Did not find corresponding fetcher result`),vr(o)){let t=cr(e.matches,r?.route.id);s&&s[t.route.id]||(s={...s,[t.route.id]:o.error}),e.fetchers.delete(n)}else if(yr(o))z(!1,`Unhandled fetcher revalidation redirect`);else{let t=Nr(o.data);e.fetchers.set(n,t)}}),{loaderData:o,errors:s}}function or(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==Sn).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function sr(e){return e?vr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function cr(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function lr(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function ur(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new Xt(e||500,o,Error(s),!0)}function dr(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(yr(r))return{key:n,result:r}}}function fr(e){return it({...typeof e==`string`?at(e):e,hash:``})}function pr(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash?!0:t.hash!==``}function mr(e){return new Xt(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function hr(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&gr(t))}function gr(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function _r(e){return xr(e.result)&&_n.has(e.result.status)}function vr(e){return e.type===`error`}function yr(e){return(e&&e.type)===`redirect`}function br(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function xr(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Sr(e){return _n.has(e)}function Cr(e){return xr(e)&&Sr(e.status)&&e.headers.has(`Location`)}function wr(e){return gn.has(e.toUpperCase())}function Tr(e){return mn.has(e.toUpperCase())}function Er(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function Dr(e,t){let n=typeof t==`string`?at(t).search:t.search;if(e[e.length-1].route.index&&Er(n||``))return e[e.length-1];let r=Ht(e);return r[r.length-1]}function Or(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function kr(e,t){return t?{state:`loading`,location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:`loading`,location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Ar(e,t){return{state:`submitting`,location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function jr(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Mr(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Nr(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Pr(e,t){try{let n=e.sessionStorage.getItem(xn);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function Fr(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(xn,JSON.stringify(n))}catch(e){et(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Ir(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Lr=L.createContext(null);Lr.displayName=`DataRouter`;var Rr=L.createContext(null);Rr.displayName=`DataRouterState`;var zr=L.createContext(!1);function Br(){return L.useContext(zr)}var Vr=L.createContext({isTransitioning:!1});Vr.displayName=`ViewTransition`;var Hr=L.createContext(new Map);Hr.displayName=`Fetchers`;var Ur=L.createContext(null);Ur.displayName=`Await`;var Wr=L.createContext(null);Wr.displayName=`Navigation`;var Gr=L.createContext(null);Gr.displayName=`Location`;var Kr=L.createContext({outlet:null,matches:[],isDataRoute:!1});Kr.displayName=`Route`;var qr=L.createContext(null);qr.displayName=`RouteError`;var Jr=`REACT_ROUTER_ERROR`,Yr=`REDIRECT`,Xr=`ROUTE_ERROR_RESPONSE`;function Zr(e){if(e.startsWith(`${Jr}:${Yr}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Qr(e){if(e.startsWith(`${Jr}:${Xr}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Xt(t.status,t.statusText,t.data)}catch{}}function $r(e,{relative:t}={}){z(ei(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=L.useContext(Wr),{hash:i,pathname:a,search:o}=ci(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Kt([n,a])),r.createHref({pathname:s,search:o,hash:i})}function ei(){return L.useContext(Gr)!=null}function ti(){return z(ei(),`useLocation() may be used only in the context of a <Router> component.`),L.useContext(Gr).location}var ni=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function ri(e){L.useContext(Wr).static||L.useLayoutEffect(e)}function ii(){let{isDataRoute:e}=L.useContext(Kr);return e?Ei():ai()}function ai(){z(ei(),`useNavigate() may be used only in the context of a <Router> component.`);let e=L.useContext(Lr),{basename:t,navigator:n}=L.useContext(Wr),{matches:r}=L.useContext(Kr),{pathname:i}=ti(),a=JSON.stringify(Ut(r)),o=L.useRef(!1);return ri(()=>{o.current=!0}),L.useCallback((r,s={})=>{if(et(o.current,ni),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Wt(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Kt([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var oi=L.createContext(null);function si(e){let t=L.useContext(Kr).outlet;return L.useMemo(()=>t&&L.createElement(oi.Provider,{value:e},t),[t,e])}function ci(e,{relative:t}={}){let{matches:n}=L.useContext(Kr),{pathname:r}=ti(),i=JSON.stringify(Ut(n));return L.useMemo(()=>Wt(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function li(e,t,n){z(ei(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=L.useContext(Wr),{matches:i}=L.useContext(Kr),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Oi(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
11
-
12
- Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=ti(),d;if(t){let e=typeof t==`string`?at(t):t;z(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=_t(e,{pathname:p});et(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),et(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=gi(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Kt([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Kt([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?L.createElement(Gr.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,unstable_mask:void 0,...d},navigationType:`POP`}},h):h}function ui(){let e=Ti(),t=Zt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=L.createElement(L.Fragment,null,L.createElement(`p`,null,`💿 Hey developer 👋`),L.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,L.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,L.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),L.createElement(L.Fragment,null,L.createElement(`h2`,null,`Unexpected Application Error!`),L.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?L.createElement(`pre`,{style:i},n):null,o)}var di=L.createElement(ui,null),fi=class extends L.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Qr(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:L.createElement(Kr.Provider,{value:this.props.routeContext},L.createElement(qr.Provider,{value:e,children:this.props.component}));return this.context?L.createElement(mi,{error:e},t):t}};fi.contextType=zr;var pi=new WeakMap;function mi({children:e,error:t}){let{basename:n}=L.useContext(Wr);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Zr(t.digest);if(e){let r=pi.get(t);if(r)throw r;let i=en(e.location,n);if($t&&!pi.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw pi.set(t,n),n}return L.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function hi({routeContext:e,match:t,children:n}){let r=L.useContext(Lr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),L.createElement(Kr.Provider,{value:e},n)}function gi(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);z(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:Qt(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||di,o&&(s<0&&c===0?(Oi(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?L.createElement(n.route.Component,null):n.route.element?n.route.element:e,L.createElement(hi,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?L.createElement(fi,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function _i(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function vi(e){let t=L.useContext(Lr);return z(t,_i(e)),t}function yi(e){let t=L.useContext(Rr);return z(t,_i(e)),t}function bi(e){let t=L.useContext(Kr);return z(t,_i(e)),t}function xi(e){let t=bi(e),n=t.matches[t.matches.length-1];return z(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Si(){return xi(`useRouteId`)}function Ci(){return yi(`useNavigation`).navigation}function wi(){let{matches:e,loaderData:t}=yi(`useMatches`);return L.useMemo(()=>e.map(e=>yt(e,t)),[e,t])}function Ti(){let e=L.useContext(qr),t=yi(`useRouteError`),n=xi(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Ei(){let{router:e}=vi(`useNavigate`),t=xi(`useNavigate`),n=L.useRef(!1);return ri(()=>{n.current=!0}),L.useCallback(async(r,i={})=>{et(n.current,ni),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Di={};function Oi(e,t,n){!t&&!Di[e]&&(Di[e]=!0,et(!1,n))}var ki={};function W(e,t){!e&&!ki[t]&&(ki[t]=!0,console.warn(t))}var Ai=L.useOptimistic,ji=()=>void 0;function Mi(e){return Ai?Ai(e):[e,ji]}function Ni(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&et(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:L.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&et(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:L.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&et(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:L.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Pi=[`HydrateFallback`,`hydrateFallbackElement`],Fi=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function Ii({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=Br()||r;let[i,a]=L.useState(e.state),[o,s]=Mi(i),[c,l]=L.useState(),[u,d]=L.useState({isTransitioning:!1}),[f,p]=L.useState(),[m,h]=L.useState(),[g,_]=L.useState(),v=L.useRef(new Map),y=L.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:g})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},unstable_pattern:Qt(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&v.current.set(t,e.data)}),o.forEach(e=>v.current.delete(e)),W(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let y=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(W(g==null||y,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!g||!y){t&&u?t(()=>a(i)):r===!1?a(i):L.startTransition(()=>{r===!0&&s(e=>Li(e,i)),a(i)});return}if(t&&u){t(()=>{m&&(f?.resolve(),m.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:g.currentLocation,nextLocation:g.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>h(n));return}m?(f?.resolve(),m.skipTransition(),_({state:i,currentLocation:g.currentLocation,nextLocation:g.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}))},[e.window,t,m,f,r,s,n]);L.useLayoutEffect(()=>e.subscribe(y),[e,y]);let b=o.initialized;L.useLayoutEffect(()=>{!b&&e.state.initialized&&y(e.state,{deletedFetchers:[],flushSync:!1,newErrors:null})},[b,y,e.state]),L.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new Fi)},[u]),L.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):L.startTransition(()=>{r===!0&&s(e=>Li(e,t)),a(t)}),await n});i.finished.finally(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})}),h(i)}},[c,f,e.window,r,s]),L.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,m,o.location,c]),L.useEffect(()=>{!u.isTransitioning&&g&&(l(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),_(void 0))},[u.isTransitioning,g]);let x=L.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=L.useMemo(()=>({router:e,navigator:x,static:!1,basename:S,onError:n}),[e,x,S,n]);return L.createElement(L.Fragment,null,L.createElement(Lr.Provider,{value:C},L.createElement(Rr.Provider,{value:o},L.createElement(Hr.Provider,{value:v.current},L.createElement(Vr.Provider,{value:u},L.createElement(Vi,{basename:S,location:o.location,navigationType:o.historyAction,navigator:x,unstable_useTransitions:r},L.createElement(Ri,{routes:e.routes,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function Li(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var Ri=L.memo(zi);function zi({routes:e,future:t,state:n,isStatic:r,onError:i}){return li(e,void 0,{state:n,isStatic:r,onError:i,future:t})}function Bi(e){return si(e.context)}function Vi({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:o}){z(!ei(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=L.useMemo(()=>({basename:s,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=at(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,unstable_mask:m}=n,h=L.useMemo(()=>{let e=Ft(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,unstable_mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return et(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:L.createElement(Wr.Provider,{value:c},L.createElement(Gr.Provider,{children:t,value:h}))}L.Component;var Hi=`get`,Ui=`application/x-www-form-urlencoded`;function Wi(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Gi(e){return Wi(e)&&e.tagName.toLowerCase()===`button`}function Ki(e){return Wi(e)&&e.tagName.toLowerCase()===`form`}function qi(e){return Wi(e)&&e.tagName.toLowerCase()===`input`}function Ji(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Yi(e,t){return e.button===0&&(!t||t===`_self`)&&!Ji(e)}function Xi(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Zi(e,t){let n=Xi(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Qi=null;function $i(){if(Qi===null)try{new FormData(document.createElement(`form`),0),Qi=!1}catch{Qi=!0}return Qi}var ea=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function ta(e){return e!=null&&!ea.has(e)?(et(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ui}"`),null):e}function na(e,t){let n,r,i,a,o;if(Ki(e)){let o=e.getAttribute(`action`);r=o?Ft(o,t):null,n=e.getAttribute(`method`)||Hi,i=ta(e.getAttribute(`enctype`))||Ui,a=new FormData(e)}else if(Gi(e)||qi(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Ft(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Hi,i=ta(e.getAttribute(`formenctype`))||ta(o.getAttribute(`enctype`))||Ui,a=new FormData(o,e),!$i()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Wi(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Hi,r=null,i=Ui,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var ra={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},ia=/[&><\u2028\u2029]/g;function aa(e){return e.replace(ia,e=>ra[e])}function oa(e,t){if(e===!1||e==null)throw Error(t)}function sa(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&Ft(i.pathname,t)===`/`?i.pathname=`${V(t)}/_root.${r}`:i.pathname=`${V(i.pathname)}.${r}`,i}async function ca(e,t){if(e.id in t)return t[e.id];try{let n=await Ke(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function la(e){return e!=null&&typeof e.page==`string`}function ua(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function da(e,t,n){return ga((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await ca(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(ua).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function fa(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function pa(e,t,{includeHydrateFallback:n}={}){return ma(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function ma(e){return[...new Set(e)]}function ha(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function ga(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!la(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(ha(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function _a(){let e=L.useContext(Lr);return oa(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function va(){let e=L.useContext(Rr);return oa(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var ya=L.createContext(void 0);ya.displayName=`FrameworkContext`;function ba(){let e=L.useContext(ya);return oa(e,`You must render this element inside a <HydratedRouter> element`),e}function xa(e,t){let n=L.useContext(ya),[r,i]=L.useState(!1),[a,o]=L.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=L.useRef(null);L.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),L.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Sa(s,p),onBlur:Sa(c,m),onMouseEnter:Sa(l,p),onMouseLeave:Sa(u,m),onTouchStart:Sa(d,p)}]:[a,f,{}]:[!1,f,{}]}function Sa(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Ca({page:e,...t}){let n=Br(),{router:r}=_a(),i=L.useMemo(()=>_t(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?L.createElement(Ta,{page:e,matches:i,...t}):L.createElement(Ea,{page:e,matches:i,...t}):null}function wa(e){let{manifest:t,routeModules:n}=ba(),[r,i]=L.useState([]);return L.useEffect(()=>{let r=!1;return da(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Ta({page:e,matches:t,...n}){let r=ti(),{future:i}=ba(),{basename:a}=_a(),o=L.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=sa(e,a,i.unstable_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.unstable_trailingSlashAwareDataRequests,e,r,t]);return L.createElement(L.Fragment,null,o.map(e=>L.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Ea({page:e,matches:t,...n}){let r=ti(),{future:i,manifest:a,routeModules:o}=ba(),{basename:s}=_a(),{loaderData:c,matches:l}=va(),u=L.useMemo(()=>fa(e,t,l,a,r,`data`),[e,t,l,a,r]),d=L.useMemo(()=>fa(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=L.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=sa(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=L.useMemo(()=>pa(d,a),[d,a]),m=wa(d);return L.createElement(L.Fragment,null,f.map(e=>L.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>L.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>L.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Da(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}L.Component;var Oa=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Oa&&(window.__reactRouterVersion=`7.14.2`)}catch{}function ka(e,t){return Cn({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:$e({window:t?.window}),hydrationData:t?.hydrationData||Aa(),routes:e,mapRouteProperties:Ni,hydrationRouteProperties:Pi,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function Aa(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:ja(e.errors)}),e}function ja(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new Xt(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(r.__subType){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}function Ma({basename:e,children:t,history:n,unstable_useTransitions:r}){let[i,a]=L.useState({action:n.action,location:n.location}),o=L.useCallback(e=>{r===!1?a(e):L.startTransition(()=>a(e))},[r]);return L.useLayoutEffect(()=>n.listen(o),[n,o]),L.createElement(Vi,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}Ma.displayName=`unstable_HistoryRouter`;var Na=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pa=L.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,unstable_mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,unstable_useTransitions:_}=L.useContext(Wr),v=typeof l==`string`&&Na.test(l),y=en(l,h);l=y.to;let b=$r(l,{relative:r}),x=ti(),S=null;if(o){let e=Wt(o,[],x.unstable_mask?x.unstable_mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:Kt([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=xa(n,p),E=Va(l,{replace:a,unstable_mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||E(t)}let O=!(y.isExternal||i),k=L.createElement(`a`,{...p,...T,href:(O?S:void 0)||y.absoluteURL||b,onClick:O?D:e,ref:Da(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?L.createElement(L.Fragment,null,k,L.createElement(Ca,{page:b})):k});Pa.displayName=`Link`;var Fa=L.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=ci(a,{relative:c.relative}),d=ti(),f=L.useContext(Rr),{navigator:p,basename:m}=L.useContext(Wr),h=f!=null&&Qa(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=Ft(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return L.createElement(Pa,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});Fa.displayName=`NavLink`;var Ia=L.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Hi,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m)=>{let{unstable_useTransitions:h}=L.useContext(Wr),g=Ga(),_=Ka(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&Na.test(s);return L.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f});h&&n!==!1?L.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Ia.displayName=`Form`;function La({getKey:e,storageKey:t,...n}){let r=L.useContext(ya),{basename:i}=L.useContext(Wr),a=ti(),o=wi();Xa({getKey:e,storageKey:t});let s=L.useMemo(()=>{if(!r||!e)return null;let t=Ya(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return L.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${aa(JSON.stringify(t||qa))}, ${aa(JSON.stringify(s))})`}})}La.displayName=`ScrollRestoration`;function Ra(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function za(e){let t=L.useContext(Lr);return z(t,Ra(e)),t}function Ba(e){let t=L.useContext(Rr);return z(t,Ra(e)),t}function Va(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c,unstable_useTransitions:l}={}){let u=ii(),d=ti(),f=ci(e,{relative:o});return L.useCallback(p=>{if(Yi(p,t)){p.preventDefault();let t=n===void 0?it(d)===it(f):n,m=()=>u(e,{replace:t,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c});l?L.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Ha(e){et(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=L.useRef(Xi(e)),n=L.useRef(!1),r=ti(),i=L.useMemo(()=>Zi(r.search,n.current?null:t.current),[r.search]),a=ii();return[i,L.useCallback((e,t)=>{let r=Xi(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Ua=0,Wa=()=>`__${String(++Ua)}__`;function Ga(){let{router:e}=za(`useSubmit`),{basename:t}=L.useContext(Wr),n=Si(),r=e.fetch,i=e.navigate;return L.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=na(e,t);a.navigate===!1?await r(a.fetcherKey||Wa(),n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Ka(e,{relative:t}={}){let{basename:n}=L.useContext(Wr),r=L.useContext(Kr);z(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...ci(e||`.`,{relative:t})},o=ti();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Kt([n,a.pathname])),it(a)}var qa=`react-router-scroll-positions`,Ja={};function Ya(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:Ft(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Xa({getKey:e,storageKey:t}={}){let{router:n}=za(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Ba(`useScrollRestoration`),{basename:a}=L.useContext(Wr),o=ti(),s=wi(),c=Ci();L.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Za(L.useCallback(()=>{if(c.state===`idle`){let t=Ya(o,s,a,e);Ja[t]=window.scrollY}try{sessionStorage.setItem(t||qa,JSON.stringify(Ja))}catch(e){et(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(L.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||qa);e&&(Ja=JSON.parse(e))}catch{}},[t]),L.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Ja,()=>window.scrollY,e?(t,n)=>Ya(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),L.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{et(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Za(e,t){let{capture:n}=t||{};L.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Qa(e,{relative:t}={}){let n=L.useContext(Vr);z(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=za(`useViewTransitionState`),i=ci(e,{relative:t});if(!n.isTransitioning)return!1;let a=Ft(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ft(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Mt(i.pathname,o)!=null||Mt(i.pathname,a)!=null}var $a=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),eo=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),to=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),no=e=>{let t=to(e);return t.charAt(0).toUpperCase()+t.slice(1)},ro={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},io=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ao=(0,L.createContext)({}),oo=()=>(0,L.useContext)(ao),so=(0,L.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=oo()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,L.createElement)(`svg`,{ref:c,...ro,width:t??l??ro.width,height:t??l??ro.height,stroke:e??f,strokeWidth:m,className:$a(`lucide`,p,i),...!a&&!io(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,L.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),G=(e,t)=>{let n=(0,L.forwardRef)(({className:n,...r},i)=>(0,L.createElement)(so,{ref:i,iconNode:t,className:$a(`lucide-${eo(no(e))}`,`lucide-${e}`,n),...r}));return n.displayName=no(e),n},co=G(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),lo=G(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),uo=G(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),fo=G(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),po=G(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),mo=G(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),ho=G(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),go=G(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),_o=G(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),vo=G(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),yo=G(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),bo=G(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),xo=G(`file-diff`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),So=G(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Co=G(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),wo=G(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),To=G(`git-pull-request`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]),Eo=G(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),Do=G(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),Oo=G(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ko=G(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),Ao=G(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),jo=G(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Mo=G(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),No=G(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Po=G(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Fo=G(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Io=G(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),Lo=G(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Ro=G(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),zo=G(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Bo=G(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Vo=G(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Ho=G(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Uo=G(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),Wo=g();function K(...e){return e.filter(Boolean).join(` `)}function Go({className:e}){return(0,R.jsx)(Oo,{"aria-hidden":`true`,className:K(`size-4 animate-spin`,e)})}function Ko({className:e}){return(0,R.jsx)(`span`,{"aria-hidden":`true`,className:K(`block animate-pulse rounded-[var(--radius-sm)] bg-[var(--skeleton-bg)]`,e)})}function qo({className:e,label:t}){return(0,R.jsxs)(`div`,{className:K(`inline-flex items-center gap-2 text-[length:var(--font-size-xs)] text-[var(--text-tertiary)]`,e),role:`status`,children:[(0,R.jsx)(Go,{className:`size-3.5`}),(0,R.jsx)(`span`,{children:t})]})}function Jo(){return(0,R.jsxs)(`div`,{className:`flex h-screen min-h-0 bg-[var(--surface-window)] text-[var(--text-primary)]`,role:`status`,children:[(0,R.jsxs)(`aside`,{className:`hidden w-[var(--layout-sidebar-width)] shrink-0 border-r border-sidebar-border bg-sidebar p-3 md:block`,children:[(0,R.jsxs)(`div`,{className:`mb-5 flex min-h-[calc(var(--layout-topbar-height)-24px)] items-center gap-2`,children:[(0,R.jsx)(Ko,{className:`size-8`}),(0,R.jsx)(Ko,{className:`h-4 w-28`})]}),(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsx)(Ko,{className:`h-3 w-20`}),(0,R.jsx)(Yo,{})]})]}),(0,R.jsxs)(`main`,{className:`flex min-w-0 flex-1 flex-col bg-[var(--surface-panel)]`,children:[(0,R.jsxs)(`header`,{className:`flex min-h-[var(--layout-topbar-height)] items-center gap-3 border-b border-border px-4`,children:[(0,R.jsx)(Ko,{className:`size-8`}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,R.jsx)(Ko,{className:`h-4 w-40 max-w-full`}),(0,R.jsx)(Ko,{className:`h-3 w-64 max-w-full`})]})]}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 px-4 py-4`,children:(0,R.jsx)(Zo,{})})]})]})}function Yo(){return(0,R.jsx)(`div`,{className:`space-y-2`,"aria-hidden":`true`,children:Array.from({length:4},(e,t)=>(0,R.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,R.jsxs)(`div`,{className:`flex h-8 items-center gap-2 px-2`,children:[(0,R.jsx)(Ko,{className:`size-4 shrink-0`}),(0,R.jsx)(Ko,{className:`h-3.5 w-32`})]}),t<2&&(0,R.jsx)(Xo,{})]},t))})}function Xo(){return(0,R.jsx)(`div`,{className:`ml-4 space-y-1 border-l border-sidebar-border pl-4`,children:Array.from({length:2},(e,t)=>(0,R.jsxs)(`div`,{className:`flex h-7 items-center gap-2`,children:[(0,R.jsx)(Ko,{className:`size-3.5 shrink-0`}),(0,R.jsx)(Ko,{className:`h-3 w-28`})]},t))})}function Zo(){return(0,R.jsxs)(`div`,{className:`mx-auto flex max-w-[var(--layout-max-content-width)] flex-col gap-3`,children:[(0,R.jsx)(Qo,{align:`right`}),(0,R.jsx)(Qo,{align:`left`,lines:4}),(0,R.jsx)(Qo,{align:`right`,lines:2}),(0,R.jsx)(Qo,{align:`left`,lines:3})]})}function Qo({align:e,lines:t=3}){return(0,R.jsx)(`div`,{className:K(`rounded-[var(--radius-lg)] border px-4 py-3 shadow-[var(--shadow-xs)]`,e===`right`?`ml-auto w-[min(78%,34rem)] border-transparent bg-[var(--chat-user-skeleton-bg)]`:`mr-auto w-[min(82%,42rem)] border-border bg-card`),children:(0,R.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:t},(e,n)=>(0,R.jsx)(Ko,{className:K(`h-3`,n===t-1?`w-2/3`:`w-full`)},n))})})}var $o=/^[\w!#$%&'*.^`|~+-]+$/,es=(e,t,n={})=>{if(!$o.test(e))throw Error(`Invalid cookie name`);let r=`${e}=${t}`;if(e.startsWith(`__Secure-`)&&!n.secure)throw Error(`__Secure- Cookie must have Secure attributes`);if(e.startsWith(`__Host-`)){if(!n.secure)throw Error(`__Host- Cookie must have Secure attributes`);if(n.path!==`/`)throw Error(`__Host- Cookie must have Path attributes with "/"`);if(n.domain)throw Error(`__Host- Cookie must not have Domain attributes`)}for(let e of[`domain`,`path`])if(n[e]&&/[;\r\n]/.test(n[e]))throw Error(`${e} must not contain ";", "\\r", or "\\n"`);if(n&&typeof n.maxAge==`number`&&n.maxAge>=0){if(n.maxAge>3456e4)throw Error(`Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.`);r+=`; Max-Age=${n.maxAge|0}`}if(n.domain&&n.prefix!==`host`&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw Error(`Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.`);r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+=`; HttpOnly`),n.secure&&(r+=`; Secure`),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.priority&&(r+=`; Priority=${n.priority.charAt(0).toUpperCase()+n.priority.slice(1)}`),n.partitioned){if(!n.secure)throw Error(`Partitioned Cookie must have Secure attributes`);r+=`; Partitioned`}return r},ts=(e,t,n)=>(t=encodeURIComponent(t),es(e,t,n)),ns=(e,t)=>(e=e.replace(/\/+$/,``),e+=`/`,t=t.replace(/^\/+/,``),e+t),rs=(e,t)=>{for(let[n,r]of Object.entries(t)){let t=RegExp(`/:`+n+`(?:{[^/]+})?\\??`);e=e.replace(t,r?`/${r}`:``)}return e},is=e=>{let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.set(n,r);return t},as=(e,t)=>{switch(t){case`ws`:return e.replace(/^http/,`ws`);case`http`:return e.replace(/^ws/,`http`)}},os=e=>/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e)?e.replace(/\/index(?=\?|$)/,`/`):e.replace(/\/index(?=\?|$)/,``);function ss(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function cs(e,t){if(!ss(e)&&!ss(t))return t;let n={...e};for(let e in t){let r=t[e];ss(n[e])&&ss(r)?n[e]=cs(n[e],r):n[e]=r}return n}var ls=(e,t)=>new Proxy(()=>{},{get(n,r){if(!(typeof r!=`string`||r===`then`))return ls(e,[...t,r])},apply(n,r,i){return e({path:t,args:i})}}),us=class{url;method;buildSearchParams;queryParams=void 0;pathParams={};rBody;cType=void 0;constructor(e,t,n){this.url=e,this.method=t,this.buildSearchParams=n.buildSearchParams}fetch=async(e,t)=>{if(e){if(e.query&&(this.queryParams=this.buildSearchParams(e.query)),e.form){let t=new FormData;for(let[n,r]of Object.entries(e.form))if(r!==void 0)if(Array.isArray(r))for(let e of r)t.append(n,e);else t.append(n,r);this.rBody=t}e.json&&(this.rBody=JSON.stringify(e.json),this.cType=`application/json`),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase(),r={...e?.header,...typeof t?.headers==`function`?await t.headers():t?.headers};if(e?.cookie){let t=[];for(let[n,r]of Object.entries(e.cookie))t.push(ts(n,r,{path:`/`}));r.Cookie=t.join(`,`)}this.cType&&(r[`Content-Type`]=this.cType);let i=new Headers(r??void 0),a=this.url;a=os(a),a=rs(a,this.pathParams),this.queryParams&&(a=a+`?`+this.queryParams.toString()),n=this.method.toUpperCase();let o=!(n===`GET`||n===`HEAD`);return(t?.fetch||fetch)(a,{body:o?this.rBody:void 0,method:n,headers:i,...t?.init})}},ds=(e,t)=>ls(function n(r){let i=t?.buildSearchParams??is,a=[...r.path],o=a.slice(-3).reverse();if(o[0]===`toString`)return o[1]===`name`?o[2]||``:n.toString();if(o[0]===`valueOf`)return o[1]===`name`?o[2]||``:n;let s=``;if(/^\$/.test(o[0])){let e=a.pop();e&&(s=e.replace(/^\$/,``))}let c=ns(e,a.join(`/`));if(s===`url`||s===`path`){let t=c;return r.args[0]&&(r.args[0].param&&(t=rs(c,r.args[0].param)),r.args[0].query&&(t=t+`?`+i(r.args[0].query).toString())),t=os(t),s===`url`?new URL(t):t.slice(e.replace(/\/+$/,``).length).replace(/^\/?/,`/`)}if(s===`ws`){let e=as(r.args[0]&&r.args[0].param?rs(c,r.args[0].param):c,`ws`),n=new URL(e),i=r.args[0]?.query;return i&&Object.entries(i).forEach(([e,t])=>{Array.isArray(t)?t.forEach(t=>n.searchParams.append(e,t)):n.searchParams.set(e,t)}),((...e)=>t?.webSocket!==void 0&&typeof t.webSocket==`function`?t.webSocket(...e):new WebSocket(...e))(n.toString())}let l=new us(c,s,{buildSearchParams:i});if(s){t??={};let e=cs(t,{...r.args[1]});return l.fetch(r.args[0],e)}return l},[]),fs=`/api`,ps=ds(fs);function ms(e,t){return`${e.endsWith(`/`)?e.slice(0,-1):e}${t.startsWith(`/`)?t:`/${t}`}`}function hs(e){return encodeURIComponent(e)}function gs(e){return ms(fs,e)}async function _s(e){let t=await e.json().catch(()=>({}));if(!e.ok){let n=t,r=n.error?.message?n.error.message:`Request failed with status ${e.status}`;throw Error(r)}return t}async function vs(e){return _s(await ps.projects.$post({json:{path:e}}))}async function ys(e){return _s(await ps.projects[`:projectId`].$delete({param:{projectId:hs(e)}}))}async function bs(e,t={}){return _s(await ps.projects[`:projectId`].chats.$post({param:{projectId:hs(e)},json:t}))}async function xs(e,t){return _s(await ps.chats[`:chatId`].archive.$post({param:{chatId:hs(e)},json:{archived:t}}))}async function Ss(e,t){return _s(await ps.projects[`:projectId`].worktrees.$delete({param:{projectId:hs(e)},json:t}))}async function Cs(e,t){return _s(await ps.projects[`:projectId`].worktrees.sync.$post({param:{projectId:hs(e)},json:t}))}async function ws(e,t){return _s(await ps.chats[`:chatId`].messages.$post({param:{chatId:hs(e)},json:t}))}async function Ts(e,t){return _s(await ps.chats[`:chatId`].messages[`:messageId`].$delete({param:{chatId:hs(e),messageId:hs(t)}}))}async function Es(e,t){return _s(await ps.chats[`:chatId`].messages[`:messageId`].restore.$post({param:{chatId:hs(e),messageId:hs(t.message.id)},json:t}))}async function Ds(e,t){return _s(await ps.chats[`:chatId`].steer.$post({param:{chatId:hs(e)},json:t}))}async function Os(e,t){return _s(await ps.chats[`:chatId`].queue.$post({param:{chatId:hs(e)},json:t}))}async function ks(e){return _s(await ps.chats[`:chatId`].interrupt.$post({param:{chatId:hs(e)}}))}async function As(e,t,n){return _s(await ps.chats[`:chatId`].approvals[`:requestId`].$post({param:{chatId:hs(e),requestId:hs(t)},json:{decision:n}}))}var q={auth:[`auth`],models:[`models`],projects:[`projects`],projectChats:e=>[`projects`,e,`chats`],projectGitHubCheckoutTargets:e=>[`projects`,e,`github`,`checkout-targets`],projectWorktrees:e=>[`projects`,e,`worktrees`],chat:e=>[`chats`,e],chatApproval:e=>[`chats`,e,`approval`],messages:e=>[`chats`,e,`messages`],chatSkills:e=>[`chats`,e,`skills`],fileSearch:(e,t)=>[`chats`,e,`files`,t]};function js(){return Ve({queryKey:q.auth,queryFn:async()=>_s(await ps.auth.$get())})}function Ms(){return Ve({queryKey:q.projects,queryFn:async()=>_s(await ps.projects.$get())})}function Ns(){return Ve({queryKey:q.models,queryFn:async()=>_s(await ps.models.$get())})}function Ps(e){return Ve({queryKey:q.projectWorktrees(e),queryFn:async()=>_s(await ps.projects[`:projectId`].worktrees.$get({param:{projectId:hs(e)}}))})}function Fs(e){return Ve({queryKey:q.projectChats(e),queryFn:async()=>_s(await ps.projects[`:projectId`].chats.$get({param:{projectId:hs(e)}}))})}function Is(e){return Ve({queryKey:q.projectGitHubCheckoutTargets(e),queryFn:async()=>_s(await ps.projects[`:projectId`].github[`checkout-targets`].$get({param:{projectId:hs(e)}}))})}function Ls(e){return Ve({queryKey:q.chat(e),queryFn:async()=>_s(await ps.chats[`:chatId`].$get({param:{chatId:hs(e)},query:{}}))})}function Rs(e,t){return Ve({queryKey:q.chatApproval(e),queryFn:async()=>_s(await ps.chats[`:chatId`].$get({param:{chatId:hs(e)},query:{context:`approval`}},{init:{signal:t}}))})}function zs(e){return Ve({queryKey:q.messages(e),queryFn:async()=>({messages:Hs((await _s(await ps.chats[`:chatId`].messages.$get({param:{chatId:hs(e)}}))).messages)})})}function Bs(e,t){return Ve({queryKey:q.chatSkills(e),queryFn:async()=>_s(await ps.chats[`:chatId`].$get({param:{chatId:hs(e)},query:{context:`skills`}},{init:{signal:t}}))})}function Vs(e,t,n){return Ve({queryKey:q.fileSearch(e,t),queryFn:async()=>_s(await ps.chats[`:chatId`].$get({param:{chatId:hs(e)},query:{fileQuery:t}},{init:{signal:n}}))})}function Hs(e){return e.map(Us)}function Us(e){if(e.role!==`event`)return e;if(e.eventType===`item/commandExecution/outputDelta`||e.eventType===`command/exec/outputDelta`||e.eventType===`item/fileChange/outputDelta`){let t=Gs(e);return{...e,eventData:Ks(Ws(e.eventData,`text`),t),text:``,textHtml:``}}return e.eventType===`turn/diff/updated`?{...e,eventData:qs(e.eventData)}:e.eventType===`item/fileChange/patchUpdated`?{...e,eventData:Js(e.eventData)}:e}function Ws(e,t){if(!Ys(e))return e;let n={...e};return delete n[t],n}function Gs(e){return Ys(e.eventData)&&typeof e.eventData.text==`string`?e.eventData.text:e.text}function Ks(e,t){return t?Ys(e)?typeof e.hiddenContentDeltaCount==`number`||typeof e.hiddenContentLength==`number`?e:{...e,hiddenContentLength:t.length}:{hiddenContentLength:t.length}:e}function qs(e){if(!Ys(e))return e;let t=typeof e.diff==`string`?e.diff:``,n={...e};return delete n.diff,t&&typeof n.hasDiff!=`boolean`&&(n.hasDiff=!0),n}function Js(e){if(!Ys(e))return e;let t=e.changes;return Array.isArray(t)?{...e,changes:t.map(e=>Ws(e,`diff`))}:e}function Ys(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Xs={default:`border-transparent bg-primary text-primary-foreground`,danger:`border-[var(--semantic-danger-border)] bg-[var(--semantic-danger-bg)] text-[var(--semantic-danger-fg)]`,info:`border-[var(--semantic-info-border)] bg-[var(--semantic-info-bg)] text-[var(--semantic-info-fg)]`,outline:`border-border bg-transparent text-foreground`,secondary:`border-transparent bg-secondary text-secondary-foreground`,success:`border-[var(--semantic-success-border)] bg-[var(--semantic-success-bg)] text-[var(--semantic-success-fg)]`,warning:`border-[var(--semantic-warning-border)] bg-[var(--semantic-warning-bg)] text-[var(--semantic-warning-fg)]`};function Zs({className:e,variant:t=`default`,...n}){return(0,R.jsx)(`span`,{className:K(`inline-flex items-center gap-1 rounded-[var(--radius-xs)] border px-2 py-0.5 text-[length:var(--font-size-xs)] font-medium whitespace-nowrap transition-colors`,Xs[t],e),...n})}var Qs={default:`bg-primary text-primary-foreground shadow-[var(--shadow-xs)] hover:bg-[var(--button-primary-hover-bg)]`,destructive:`bg-destructive text-destructive-foreground shadow-[var(--shadow-xs)] hover:bg-[var(--button-destructive-hover-bg)] focus-visible:ring-[var(--semantic-danger-border)]/40`,ghost:`hover:bg-accent hover:text-accent-foreground`,outline:`border border-input bg-[var(--surface-card)] shadow-[var(--shadow-xs)] hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground shadow-[var(--shadow-xs)] hover:bg-[var(--button-secondary-hover-bg)]`},$s={default:`h-9 px-4 py-2`,icon:`size-8`,sm:`h-8 gap-1.5 px-3`};function J({className:e,size:t=`default`,variant:n=`default`,...r}){return(0,R.jsx)(`button`,{className:K(`inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-[var(--radius-sm)] text-[length:var(--font-size-sm)] font-medium outline-none transition-colors duration-[var(--motion-duration-fast)] ease-[var(--motion-ease-standard)] focus-visible:border-ring focus-visible:shadow-[var(--state-focus-ring)] disabled:pointer-events-none disabled:opacity-[var(--opacity-disabled)] [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,Qs[n],$s[t],e),...r})}var ec=c(m(),1);function tc({className:e,...t}){return(0,R.jsx)(`input`,{className:K(`flex h-9 w-full min-w-0 rounded-[var(--radius-sm)] border border-input bg-[var(--surface-input)] px-3 py-1 text-[length:var(--font-size-md)] shadow-[var(--shadow-xs)] outline-none transition-[border-color,box-shadow] duration-[var(--motion-duration-fast)] placeholder:text-[var(--text-tertiary)] focus-visible:border-ring focus-visible:shadow-[var(--state-focus-ring)] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-[var(--opacity-disabled)]`,e),...t})}var nc=4,rc=16,ic=320,ac=256;function oc({"aria-label":e,align:t=`start`,className:n,disabled:r=!1,emptyMessage:i=`No results`,icon:a,isLoading:o=!1,onQueryChange:s,onValueChange:c,options:l,placeholder:u,query:d,searchPlaceholder:f=`Search`,shouldFilter:p=!0,side:m=`bottom`,triggerClassName:h,value:g}){let[_,v]=(0,L.useState)(!1),[y,b]=(0,L.useState)(-1),[x,S]=(0,L.useState)(``),[C,w]=(0,L.useState)({}),T=(0,L.useRef)(null),E=(0,L.useRef)(null),D=(0,L.useRef)(null),O=(0,L.useRef)(null),k=(0,L.useId)(),A=d??x,ee=l.find(e=>e.value===g),j=(0,L.useMemo)(()=>{if(!p||!A.trim())return l;let e=A.trim().toLowerCase();return l.filter(t=>[t.label,t.description,...t.keywords??[]].filter(Boolean).join(` `).toLowerCase().includes(e))},[l,A,p]);(0,L.useEffect)(()=>{if(!_)return;let e=e=>{let t=e.target;!T.current?.contains(t)&&!O.current?.contains(t)&&v(!1)},t=e=>{e.key===`Escape`&&v(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[_]),(0,L.useEffect)(()=>{!_&&d===void 0&&S(``)},[_,d]),(0,L.useLayoutEffect)(()=>{if(!_)return;let e=()=>{let e=T.current,n=O.current;if(!e||!n)return;let r=window.visualViewport,i=r?.offsetLeft??0,a=r?.offsetTop??0,o=r?.width??window.innerWidth,s=r?.height??window.innerHeight,c=e.getBoundingClientRect(),l=Math.max(0,o-rc*2),u=Math.max(0,s-rc*2),d=Math.min(ic,l),f=u,p=E.current?.getBoundingClientRect().height??0,h=D.current?Math.min(D.current.scrollHeight,ac):0,g=Math.min(p+h,f),_=i+rc,v=i+o-rc-d,y=a+rc,b=a+s-rc-g,x=t===`end`?c.right-d:c.left,S=m===`top`?c.top-nc-g:c.bottom+nc,C={left:cc(x,_,Math.max(_,v)),maxHeight:f,top:cc(S,y,Math.max(y,b)),width:d};w(e=>lc(e,C)?e:C)};e();let n=typeof ResizeObserver>`u`?null:new ResizeObserver(e),r=O.current;return r&&n?.observe(r),E.current&&n?.observe(E.current),D.current&&n?.observe(D.current),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),window.visualViewport?.addEventListener(`resize`,e),window.visualViewport?.addEventListener(`scroll`,e),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0),window.visualViewport?.removeEventListener(`resize`,e),window.visualViewport?.removeEventListener(`scroll`,e),n?.disconnect()}},[t,i,j,o,_,m]),(0,L.useEffect)(()=>{if(!_){b(-1);return}b(sc(j,-1,1))},[j,_]);function te(e){s?s(e):S(e)}function M(e){e.disabled||(c(e.value),v(!1),te(``))}function ne(e){if(e.key===`ArrowDown`){e.preventDefault(),b(e=>sc(j,e,1));return}if(e.key===`ArrowUp`){e.preventDefault(),b(e=>sc(j,e,-1));return}if(e.key===`Home`){e.preventDefault(),b(sc(j,-1,1));return}if(e.key===`End`){e.preventDefault(),b(sc(j,j.length,-1));return}if(e.key===`Enter`&&(e.preventDefault(),y>=0)){let e=j[y];if(!e)return;M(e)}}let N=_&&typeof document<`u`?(0,ec.createPortal)((0,R.jsx)(`div`,{className:`fixed z-50 flex overflow-hidden rounded-[var(--radius-md)] border border-border bg-popover text-popover-foreground shadow-[var(--shadow-md)]`,ref:O,style:C,children:(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-divider)] px-2 py-2`,ref:E,children:[(0,R.jsx)(Fo,{className:`size-3.5 shrink-0 text-[var(--icon-color-muted)]`}),(0,R.jsx)(tc,{"aria-activedescendant":y>=0?`${k}-option-${y}`:void 0,"aria-autocomplete":`list`,"aria-controls":k,autoFocus:!0,className:`h-7 border-0 bg-transparent px-0 py-0 shadow-none focus-visible:shadow-none`,placeholder:f,value:A,onChange:e=>te(e.target.value),onKeyDown:ne}),o&&(0,R.jsx)(Oo,{"aria-hidden":`true`,className:`size-3.5 shrink-0 animate-spin text-[var(--icon-color-muted)]`})]}),(0,R.jsx)(`div`,{className:`min-h-0 max-h-64 flex-1 overflow-y-auto p-1`,id:k,ref:D,role:`listbox`,children:j.length===0?(0,R.jsx)(`div`,{className:`px-2 py-3 text-[length:var(--font-size-sm)] text-[var(--text-tertiary)]`,children:i}):j.map((e,t)=>{let n=e.value===g;return(0,R.jsxs)(`button`,{"aria-selected":n,className:K(`flex w-full min-w-0 items-start gap-2 rounded-[var(--radius-sm)] px-2 py-2 text-left outline-none transition-colors hover:bg-accent focus-visible:shadow-[var(--state-focus-ring)] disabled:pointer-events-none disabled:opacity-[var(--opacity-disabled)]`,(t===y||n)&&`bg-[var(--state-selected-bg)]`),disabled:e.disabled,id:`${k}-option-${t}`,onClick:()=>M(e),onMouseEnter:()=>b(t),role:`option`,type:`button`,children:[(0,R.jsx)(po,{className:K(`mt-0.5 size-3.5 shrink-0 text-[var(--icon-color-active)]`,!n&&`opacity-0`)}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`block truncate text-[length:var(--font-size-sm)] font-medium text-[var(--text-primary)]`,children:e.label}),e.description&&(0,R.jsx)(`span`,{className:`mt-0.5 block truncate text-[length:var(--font-size-xs)] text-[var(--text-tertiary)]`,children:e.description})]})]},e.value)})})]})}),document.body):null;return(0,R.jsxs)(`div`,{className:K(`relative min-w-0`,n),ref:T,children:[(0,R.jsxs)(`button`,{"aria-controls":k,"aria-expanded":_,"aria-label":e,className:K(`inline-flex h-8 max-w-full items-center gap-1.5 rounded-[var(--radius-sm)] border border-input bg-[var(--surface-card)] px-2.5 text-[length:var(--font-size-sm)] font-medium text-[var(--text-secondary)] shadow-[var(--shadow-xs)] outline-none transition-colors hover:bg-accent focus-visible:border-ring focus-visible:shadow-[var(--state-focus-ring)] disabled:pointer-events-none disabled:opacity-[var(--opacity-disabled)]`,h),disabled:r,onClick:()=>v(e=>!e),role:`combobox`,type:`button`,children:[o?(0,R.jsx)(Oo,{"aria-hidden":`true`,className:`size-3.5 shrink-0 animate-spin text-[var(--icon-color-muted)]`}):a,(0,R.jsx)(`span`,{className:`min-w-0 truncate`,children:ee?.label??u}),(0,R.jsx)(ho,{className:`size-3.5 shrink-0 text-[var(--icon-color-muted)]`})]}),N]})}function sc(e,t,n){if(e.length===0)return-1;let r=t;for(let t=0;t<e.length;t+=1)if(r=(r+n+e.length)%e.length,!e[r]?.disabled)return r;return-1}function cc(e,t,n){return Math.min(Math.max(e,t),n)}function lc(e,t){return e.left===t.left&&e.maxHeight===t.maxHeight&&e.top===t.top&&e.width===t.width}var uc=[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex='-1'])`].join(`,`);function dc({children:e,onOpenChange:t,open:n}){let r=(0,L.useRef)(null);(0,L.useEffect)(()=>{if(!n)return;let e=document.activeElement;return _c(r.current)[0]?.focus(),()=>{e instanceof HTMLElement&&e.focus()}},[n]);function i(e){if(e.key===`Escape`){e.preventDefault(),t(!1);return}if(e.key!==`Tab`)return;let n=_c(r.current);if(n.length===0){e.preventDefault();return}let i=n[0],a=n[n.length-1];!i||!a||(e.shiftKey&&document.activeElement===i&&(e.preventDefault(),a.focus()),!e.shiftKey&&document.activeElement===a&&(e.preventDefault(),i.focus()))}return n?(0,R.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,onKeyDown:i,children:[(0,R.jsx)(`button`,{"aria-label":`Close dialog`,className:`absolute inset-0 bg-[var(--surface-overlay)]`,onClick:()=>t(!1),tabIndex:-1,type:`button`}),(0,R.jsx)(`div`,{ref:r,className:`contents`,children:e})]}):null}function fc({className:e,...t}){return(0,R.jsx)(`div`,{className:K(`relative z-10 grid w-full max-w-md gap-4 rounded-[var(--radius-lg)] border border-border bg-card p-5 text-card-foreground shadow-[var(--shadow-lg)]`,e),"aria-modal":`true`,role:`dialog`,...t})}function pc({className:e,...t}){return(0,R.jsx)(`div`,{className:K(`grid gap-1.5`,e),...t})}function mc({className:e,...t}){return(0,R.jsx)(`h2`,{className:K(`text-[length:var(--font-size-xl)] font-semibold leading-none`,e),...t})}function hc({className:e,...t}){return(0,R.jsx)(`p`,{className:K(`text-[length:var(--font-size-md)] text-muted-foreground`,e),...t})}function gc({className:e,...t}){return(0,R.jsx)(`div`,{className:K(`flex justify-end gap-2`,e),...t})}function _c(e){return e?Array.from(e.querySelectorAll(uc)).filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-hidden`)!==`true`):[]}typeof window<`u`&&window.document&&window.document.createElement;function Y(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function vc(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function yc(...e){return t=>{let n=!1,r=e.map(e=>{let r=vc(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():vc(e[t],null)}}}}function bc(...e){return L.useCallback(yc(...e),e)}function xc(e,t=[]){let n=[];function r(t,r){let i=L.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=L.useMemo(()=>o,Object.values(o));return(0,R.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=L.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>L.createContext(e));return function(n){let r=n?.[e]||t;return L.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Sc(i,...t)]}function Sc(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return L.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Cc=globalThis?.document?L.useLayoutEffect:()=>{},wc=L.useInsertionEffect||Cc;function Tc({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Ec({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=L.useRef(e!==void 0);L.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,L.useCallback(t=>{if(s){let n=Dc(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Ec({defaultProp:e,onChange:t}){let[n,r]=L.useState(e),i=L.useRef(n),a=L.useRef(t);return wc(()=>{a.current=t},[t]),L.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Dc(e){return typeof e==`function`}function Oc(e){let t=kc(e),n=L.forwardRef((e,n)=>{let{children:r,...i}=e,a=L.Children.toArray(r),o=a.find(jc);if(o){let e=o.props.children,r=a.map(t=>t===o?L.Children.count(e)>1?L.Children.only(null):L.isValidElement(e)?e.props.children:null:t);return(0,R.jsx)(t,{...i,ref:n,children:L.isValidElement(e)?L.cloneElement(e,void 0,r):null})}return(0,R.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function kc(e){let t=L.forwardRef((e,t)=>{let{children:n,...r}=e;if(L.isValidElement(n)){let e=Nc(n),i=Mc(r,n.props);return n.type!==L.Fragment&&(i.ref=t?yc(t,e):e),L.cloneElement(n,i)}return L.Children.count(n)>1?L.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ac=Symbol(`radix.slottable`);function jc(e){return L.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ac}function Mc(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Nc(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Pc=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Oc(`Primitive.${t}`),r=L.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,R.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Fc(e,t){e&&ec.flushSync(()=>e.dispatchEvent(t))}function Ic(e){let t=e+`CollectionProvider`,[n,r]=xc(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=L.useRef(null),a=L.useRef(new Map).current;return(0,R.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Oc(s),l=L.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,R.jsx)(c,{ref:bc(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Oc(u),p=L.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=L.useRef(null),s=bc(t,o),c=a(u,n);return L.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,R.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return L.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var Lc=L.createContext(void 0);function Rc(e){let t=L.useContext(Lc);return e||t||`ltr`}function zc(e){let t=L.useRef(e);return L.useEffect(()=>{t.current=e}),L.useMemo(()=>(...e)=>t.current?.(...e),[])}function Bc(e,t=globalThis?.document){let n=zc(e);L.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Vc=`DismissableLayer`,Hc=`dismissableLayer.update`,Uc=`dismissableLayer.pointerDownOutside`,Wc=`dismissableLayer.focusOutside`,Gc,Kc=L.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qc=L.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=L.useContext(Kc),[u,d]=L.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=L.useState({}),m=bc(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=Xc(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=Zc(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return Bc(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),L.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Gc=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Qc(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Gc)}},[u,f,n,l]),L.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Qc())},[u,l]),L.useEffect(()=>{let e=()=>p({});return document.addEventListener(Hc,e),()=>document.removeEventListener(Hc,e)},[]),(0,R.jsx)(Pc.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:Y(e.onFocusCapture,S.onFocusCapture),onBlurCapture:Y(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Y(e.onPointerDownCapture,x.onPointerDownCapture)})});qc.displayName=Vc;var Jc=`DismissableLayerBranch`,Yc=L.forwardRef((e,t)=>{let n=L.useContext(Kc),r=L.useRef(null),i=bc(t,r);return L.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,R.jsx)(Pc.div,{...e,ref:i})});Yc.displayName=Jc;function Xc(e,t=globalThis?.document){let n=zc(e),r=L.useRef(!1),i=L.useRef(()=>{});return L.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){$c(Uc,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Zc(e,t=globalThis?.document){let n=zc(e),r=L.useRef(!1);return L.useEffect(()=>{let e=e=>{e.target&&!r.current&&$c(Wc,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Qc(){let e=new CustomEvent(Hc);document.dispatchEvent(e)}function $c(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Fc(i,a):i.dispatchEvent(a)}var el=0;function tl(){L.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??nl()),document.body.insertAdjacentElement(`beforeend`,e[1]??nl()),el++,()=>{el===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),el--}},[])}function nl(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var rl=`focusScope.autoFocusOnMount`,il=`focusScope.autoFocusOnUnmount`,al={bubbles:!1,cancelable:!0},ol=`FocusScope`,sl=L.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=L.useState(null),l=zc(i),u=zc(a),d=L.useRef(null),f=bc(t,e=>c(e)),p=L.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;L.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:ml(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||ml(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ml(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),L.useEffect(()=>{if(s){hl.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(rl,al);s.addEventListener(rl,l),s.dispatchEvent(t),t.defaultPrevented||(cl(vl(ul(s)),{select:!0}),document.activeElement===e&&ml(s))}return()=>{s.removeEventListener(rl,l),setTimeout(()=>{let t=new CustomEvent(il,al);s.addEventListener(il,u),s.dispatchEvent(t),t.defaultPrevented||ml(e??document.body,{select:!0}),s.removeEventListener(il,u),hl.remove(p)},0)}}},[s,l,u,p]);let m=L.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ll(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ml(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ml(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,R.jsx)(Pc.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});sl.displayName=ol;function cl(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ml(r,{select:t}),document.activeElement!==n)return}function ll(e){let t=ul(e);return[dl(t,e),dl(t.reverse(),e)]}function ul(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function dl(e,t){for(let n of e)if(!fl(n,{upTo:t}))return n}function fl(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function pl(e){return e instanceof HTMLInputElement&&`select`in e}function ml(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&pl(e)&&t&&e.select()}}var hl=gl();function gl(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=_l(e,t),e.unshift(t)},remove(t){e=_l(e,t),e[0]?.resume()}}}function _l(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function vl(e){return e.filter(e=>e.tagName!==`A`)}var yl=L.useId||(()=>void 0),bl=0;function xl(e){let[t,n]=L.useState(yl());return Cc(()=>{e||n(e=>e??String(bl++))},[e]),e||(t?`radix-${t}`:``)}var Sl=[`top`,`right`,`bottom`,`left`],Cl=Math.min,wl=Math.max,Tl=Math.round,El=Math.floor,Dl=e=>({x:e,y:e}),Ol={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function kl(e,t,n){return wl(e,Cl(t,n))}function Al(e,t){return typeof e==`function`?e(t):e}function jl(e){return e.split(`-`)[0]}function Ml(e){return e.split(`-`)[1]}function Nl(e){return e===`x`?`y`:`x`}function Pl(e){return e===`y`?`height`:`width`}function X(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Fl(e){return Nl(X(e))}function Z(e,t,n){n===void 0&&(n=!1);let r=Ml(e),i=Fl(e),a=Pl(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ul(o)),[o,Ul(o)]}function Q(e){let t=Ul(e);return[Il(e),t,Il(t)]}function Il(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ll=[`left`,`right`],Rl=[`right`,`left`],zl=[`top`,`bottom`],Bl=[`bottom`,`top`];function Vl(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Rl:Ll:t?Ll:Rl;case`left`:case`right`:return t?zl:Bl;default:return[]}}function Hl(e,t,n,r){let i=Ml(e),a=Vl(jl(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Il)))),a}function Ul(e){let t=jl(e);return Ol[t]+e.slice(t.length)}function Wl(e){return{top:0,right:0,bottom:0,left:0,...e}}function Gl(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Wl(e)}function Kl(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 ql(e,t,n){let{reference:r,floating:i}=e,a=X(t),o=Fl(t),s=Pl(o),c=jl(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}}switch(Ml(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Jl(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}=Al(t,e),p=Gl(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Kl(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=Kl(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 Yl=50,Xl=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Jl},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ql(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<Yl&&(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}=ql(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Zl=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}=Al(e,t)||{};if(l==null)return{};let d=Gl(u),f={x:n,y:r},p=Fl(i),m=Pl(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Cl(d[_],T),D=Cl(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,ee=kl(O,A,k),j=!c.arrow&&Ml(i)!=null&&A!==ee&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,te=j?A<O?A-O:A-k:0;return{[p]:f[p]+te,data:{[p]:ee,centerOffset:A-ee-te,...j&&{alignmentOffset:te}},reset:j}}}),Ql=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}=Al(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=jl(r),_=X(o),v=jl(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Ul(o)]:Q(o)),x=p!==`none`;!d&&x&&b.push(...Hl(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=Z(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`&&_!==X(t))||T.every(e=>X(e.placement)===_?e.overflows[0]>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=X(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;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function $l(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function eu(e){return Sl.some(t=>e[t]>=0)}var tu=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Al(e,t);switch(i){case`referenceHidden`:{let e=$l(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:eu(e)}}}case`escaped`:{let e=$l(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:eu(e)}}}default:return{}}}}},nu=new Set([`left`,`top`]);async function ru(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=jl(n),s=Ml(n),c=X(n)===`y`,l=nu.has(o)?-1:1,u=a&&c?-1:1,d=Al(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 iu=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 ru(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}}}}},au=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}=Al(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=X(jl(i)),p=Nl(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=kl(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=kl(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},ou=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}=Al(e,t),u={x:n,y:r},d=X(i),f=Nl(d),p=u[f],m=u[d],h=Al(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};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=nu.has(jl(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}}}},su=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Al(e,t),u=await o.detectOverflow(t,l),d=jl(i),f=Ml(i),p=X(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Cl(h-u[g],v),x=Cl(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=wl(u.left,0),t=wl(u.right,0),n=wl(u.top,0),r=wl(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:wl(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:wl(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function cu(){return typeof window<`u`}function lu(e){return fu(e)?(e.nodeName||``).toLowerCase():`#document`}function uu(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function du(e){return((fu(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function fu(e){return cu()?e instanceof Node||e instanceof uu(e).Node:!1}function pu(e){return cu()?e instanceof Element||e instanceof uu(e).Element:!1}function mu(e){return cu()?e instanceof HTMLElement||e instanceof uu(e).HTMLElement:!1}function hu(e){return!cu()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof uu(e).ShadowRoot}function gu(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Du(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function _u(e){return/^(table|td|th)$/.test(lu(e))}function vu(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var yu=/transform|translate|scale|rotate|perspective|filter/,bu=/paint|layout|strict|content/,xu=e=>!!e&&e!==`none`,Su;function Cu(e){let t=pu(e)?Du(e):e;return xu(t.transform)||xu(t.translate)||xu(t.scale)||xu(t.rotate)||xu(t.perspective)||!Tu()&&(xu(t.backdropFilter)||xu(t.filter))||yu.test(t.willChange||``)||bu.test(t.contain||``)}function wu(e){let t=ku(e);for(;mu(t)&&!Eu(t);){if(Cu(t))return t;if(vu(t))return null;t=ku(t)}return null}function Tu(){return Su??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Su}function Eu(e){return/^(html|body|#document)$/.test(lu(e))}function Du(e){return uu(e).getComputedStyle(e)}function Ou(e){return pu(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ku(e){if(lu(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||hu(e)&&e.host||du(e);return hu(t)?t.host:t}function Au(e){let t=ku(e);return Eu(t)?e.ownerDocument?e.ownerDocument.body:e.body:mu(t)&&gu(t)?t:Au(t)}function ju(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Au(e),i=r===e.ownerDocument?.body,a=uu(r);if(i){let e=Mu(a);return t.concat(a,a.visualViewport||[],gu(r)?r:[],e&&n?ju(e):[])}else return t.concat(r,ju(r,[],n))}function Mu(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Nu(e){let t=Du(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=mu(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Tl(n)!==a||Tl(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Pu(e){return pu(e)?e:e.contextElement}function Fu(e){let t=Pu(e);if(!mu(t))return Dl(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Nu(t),o=(a?Tl(n.width):n.width)/r,s=(a?Tl(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Iu=Dl(0);function Lu(e){let t=uu(e);return!Tu()||!t.visualViewport?Iu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ru(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==uu(e)?!1:t}function zu(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Pu(e),o=Dl(1);t&&(r?pu(r)&&(o=Fu(r)):o=Fu(e));let s=Ru(a,n,r)?Lu(a):Dl(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){let e=uu(a),t=r&&pu(r)?uu(r):r,n=e,i=Mu(n);for(;i&&r&&t!==n;){let e=Fu(i),t=i.getBoundingClientRect(),r=Du(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=uu(i),i=Mu(n)}}return Kl({width:u,height:d,x:c,y:l})}function Bu(e,t){let n=Ou(e).scrollLeft;return t?t.left+n:zu(du(e)).left+n}function Vu(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Bu(e,n),y:n.top+t.scrollTop}}function Hu(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=du(r),s=t?vu(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Dl(1),u=Dl(0),d=mu(r);if((d||!d&&!a)&&((lu(r)!==`body`||gu(o))&&(c=Ou(r)),d)){let e=zu(r);l=Fu(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Vu(o,c):Dl(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 Uu(e){return Array.from(e.getClientRects())}function Wu(e){let t=du(e),n=Ou(e),r=e.ownerDocument.body,i=wl(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=wl(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Bu(e),s=-n.scrollTop;return Du(r).direction===`rtl`&&(o+=wl(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Gu=25;function Ku(e,t){let n=uu(e),r=du(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Tu();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Bu(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Gu&&(a-=o)}else l<=Gu&&(a+=l);return{width:a,height:o,x:s,y:c}}function qu(e,t){let n=zu(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=mu(e)?Fu(e):Dl(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ju(e,t,n){let r;if(t===`viewport`)r=Ku(e,n);else if(t===`document`)r=Wu(du(e));else if(pu(t))r=qu(t,n);else{let n=Lu(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Kl(r)}function Yu(e,t){let n=ku(e);return n===t||!pu(n)||Eu(n)?!1:Du(n).position===`fixed`||Yu(n,t)}function Xu(e,t){let n=t.get(e);if(n)return n;let r=ju(e,[],!1).filter(e=>pu(e)&&lu(e)!==`body`),i=null,a=Du(e).position===`fixed`,o=a?ku(e):e;for(;pu(o)&&!Eu(o);){let t=Du(o),n=Cu(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||gu(o)&&!n&&Yu(e,o))?r=r.filter(e=>e!==o):i=t,o=ku(o)}return t.set(e,r),r}function Zu(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?vu(t)?[]:Xu(t,this._c):[].concat(n),r],o=Ju(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=Ju(t,a[e],i);s=wl(n.top,s),c=Cl(n.right,c),l=Cl(n.bottom,l),u=wl(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Qu(e){let{width:t,height:n}=Nu(e);return{width:t,height:n}}function $u(e,t,n){let r=mu(t),i=du(t),a=n===`fixed`,o=zu(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Dl(0);function l(){c.x=Bu(i)}if(r||!r&&!a)if((lu(t)!==`body`||gu(i))&&(s=Ou(t)),r){let e=zu(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Vu(i,s):Dl(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function ed(e){return Du(e).position===`static`}function td(e,t){if(!mu(e)||Du(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return du(e)===n&&(n=n.ownerDocument.body),n}function nd(e,t){let n=uu(e);if(vu(e))return n;if(!mu(e)){let t=ku(e);for(;t&&!Eu(t);){if(pu(t)&&!ed(t))return t;t=ku(t)}return n}let r=td(e,t);for(;r&&_u(r)&&ed(r);)r=td(r,t);return r&&Eu(r)&&ed(r)&&!Cu(r)?n:r||wu(e)||n}var rd=async function(e){let t=this.getOffsetParent||nd,n=this.getDimensions,r=await n(e.floating);return{reference:$u(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function id(e){return Du(e).direction===`rtl`}var ad={convertOffsetParentRelativeRectToViewportRelativeRect:Hu,getDocumentElement:du,getClippingRect:Zu,getOffsetParent:nd,getElementRects:rd,getClientRects:Uu,getDimensions:Qu,getScale:Fu,isElement:pu,isRTL:id};function od(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sd(e,t){let n=null,r,i=du(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=El(d),h=El(i.clientWidth-(u+f)),g=El(i.clientHeight-(d+p)),_=El(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:wl(0,Cl(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!od(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function cd(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=Pu(e),u=i||a?[...l?ju(l):[],...t?ju(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?sd(l,n):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?zu(e):null;c&&g();function g(){let t=zu(e);h&&!od(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 ld=iu,ud=au,dd=Ql,fd=su,pd=tu,md=Zl,hd=ou,gd=(e,t,n)=>{let r=new Map,i={platform:ad,...n},a={...i.platform,_c:r};return Xl(e,t,{...i,platform:a})},_d=typeof document<`u`?L.useLayoutEffect:function(){};function vd(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(!vd(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)&&!vd(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function $(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function yd(e,t){let n=$(e);return Math.round(t*n)/n}function bd(e){let t=L.useRef(e);return _d(()=>{t.current=e}),t}function xd(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]=L.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=L.useState(r);vd(f,r)||p(r);let[m,h]=L.useState(null),[g,_]=L.useState(null),v=L.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=L.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=L.useRef(null),C=L.useRef(null),w=L.useRef(u),T=c!=null,E=bd(c),D=bd(i),O=bd(l),k=L.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),gd(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!vd(w.current,t)&&(w.current=t,ec.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);_d(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=L.useRef(!1);_d(()=>(A.current=!0,()=>{A.current=!1}),[]),_d(()=>{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 ee=L.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),j=L.useMemo(()=>({reference:b,floating:x}),[b,x]),te=L.useMemo(()=>{let e={position:n,left:0,top:0};if(!j.floating)return e;let t=yd(j.floating,u.x),r=yd(j.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...$(j.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,j.floating,u.x,u.y]);return L.useMemo(()=>({...u,update:k,refs:ee,elements:j,floatingStyles:te}),[u,k,ee,j,te])}var Sd=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:md({element:r.current,padding:i}).fn(n):r?md({element:r,padding:i}).fn(n):{}}}},Cd=(e,t)=>{let n=ld(e);return{name:n.name,fn:n.fn,options:[e,t]}},wd=(e,t)=>{let n=ud(e);return{name:n.name,fn:n.fn,options:[e,t]}},Td=(e,t)=>({fn:hd(e).fn,options:[e,t]}),Ed=(e,t)=>{let n=dd(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dd=(e,t)=>{let n=fd(e);return{name:n.name,fn:n.fn,options:[e,t]}},Od=(e,t)=>{let n=pd(e);return{name:n.name,fn:n.fn,options:[e,t]}},kd=(e,t)=>{let n=Sd(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ad=`Arrow`,jd=L.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,R.jsx)(Pc.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,R.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});jd.displayName=Ad;var Md=jd;function Nd(e){let[t,n]=L.useState(void 0);return Cc(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var Pd=`Popper`,[Fd,Id]=xc(Pd),[Ld,Rd]=Fd(Pd),zd=e=>{let{__scopePopper:t,children:n}=e,[r,i]=L.useState(null);return(0,R.jsx)(Ld,{scope:t,anchor:r,onAnchorChange:i,children:n})};zd.displayName=Pd;var Bd=`PopperAnchor`,Vd=L.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Rd(Bd,n),o=L.useRef(null),s=bc(t,o),c=L.useRef(null);return L.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,R.jsx)(Pc.div,{...i,ref:s})});Vd.displayName=Bd;var Hd=`PopperContent`,[Ud,Wd]=Fd(Hd),Gd=L.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Rd(Hd,n),[_,v]=L.useState(null),y=bc(t,e=>v(e)),[b,x]=L.useState(null),S=Nd(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(Yd),altBoundary:O},{refs:A,floatingStyles:ee,placement:j,isPositioned:te,middlewareData:M}=xd({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>cd(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[Cd({mainAxis:i+w,alignmentAxis:o}),c&&wd({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Td():void 0,...k}),c&&Ed({...k}),Dd({...k,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&kd({element:b,padding:s}),Xd({arrowWidth:C,arrowHeight:w}),f&&Od({strategy:`referenceHidden`,...k})]}),[ne,N]=Zd(j),P=zc(m);Cc(()=>{te&&P?.()},[te,P]);let re=M.arrow?.x,ie=M.arrow?.y,ae=M.arrow?.centerOffset!==0,[oe,F]=L.useState();return Cc(()=>{_&&F(window.getComputedStyle(_).zIndex)},[_]),(0,R.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...ee,transform:te?ee.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[M.transformOrigin?.x,M.transformOrigin?.y].join(` `),...M.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,R.jsx)(Ud,{scope:n,placedSide:ne,onArrowChange:x,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,R.jsx)(Pc.div,{"data-side":ne,"data-align":N,...h,ref:y,style:{...h.style,animation:te?void 0:`none`}})})})});Gd.displayName=Hd;var Kd=`PopperArrow`,qd={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Jd=L.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Wd(Kd,n),a=qd[i.placedSide];return(0,R.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,R.jsx)(Md,{...r,ref:t,style:{...r.style,display:`block`}})})});Jd.displayName=Kd;function Yd(e){return e!==null}var Xd=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Zd(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Zd(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Qd=zd,$d=Vd,ef=Gd,tf=Jd,nf=`Portal`,rf=L.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=L.useState(!1);Cc(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?ec.createPortal((0,R.jsx)(Pc.div,{...r,ref:t}),o):null});rf.displayName=nf;function af(e,t){return L.useReducer((e,n)=>t[e][n]??e,e)}var of=e=>{let{present:t,children:n}=e,r=sf(t),i=typeof n==`function`?n({present:r.isPresent}):L.Children.only(n),a=bc(r.ref,lf(i));return typeof n==`function`||r.isPresent?L.cloneElement(i,{ref:a}):null};of.displayName=`Presence`;function sf(e){let[t,n]=L.useState(),r=L.useRef(null),i=L.useRef(e),a=L.useRef(`none`),[o,s]=af(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return L.useEffect(()=>{let e=cf(r.current);a.current=o===`mounted`?e:`none`},[o]),Cc(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=cf(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Cc(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=cf(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=cf(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:L.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function cf(e){return e?.animationName||`none`}function lf(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var uf=`rovingFocusGroup.onEntryFocus`,df={bubbles:!1,cancelable:!0},ff=`RovingFocusGroup`,[pf,mf,hf]=Ic(ff),[gf,_f]=xc(ff,[hf]),[vf,yf]=gf(ff),bf=L.forwardRef((e,t)=>(0,R.jsx)(pf.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(pf.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(xf,{...e,ref:t})})}));bf.displayName=ff;var xf=L.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=L.useRef(null),p=bc(t,f),m=Rc(a),[h,g]=Tc({prop:o,defaultProp:s??null,onChange:c,caller:ff}),[_,v]=L.useState(!1),y=zc(l),b=mf(n),x=L.useRef(!1),[S,C]=L.useState(0);return L.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(uf,y),()=>e.removeEventListener(uf,y)},[y]),(0,R.jsx)(vf,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:L.useCallback(e=>g(e),[g]),onItemShiftTab:L.useCallback(()=>v(!0),[]),onFocusableItemAdd:L.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:L.useCallback(()=>C(e=>e-1),[]),children:(0,R.jsx)(Pc.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:Y(e.onMouseDown,()=>{x.current=!0}),onFocus:Y(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(uf,df);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);Df([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:Y(e.onBlur,()=>v(!1))})})}),Sf=`RovingFocusGroupItem`,Cf=L.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=xl(),l=a||c,u=yf(Sf,n),d=u.currentTabStopId===l,f=mf(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return L.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,R.jsx)(pf.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,R.jsx)(Pc.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:Y(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:Y(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Y(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Ef(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Of(n,r+1):n.slice(r+1)}setTimeout(()=>Df(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});Cf.displayName=Sf;var wf={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Tf(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Ef(e,t,n){let r=Tf(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return wf[r]}function Df(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Of(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var kf=bf,Af=Cf,jf=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Mf=new WeakMap,Nf=new WeakMap,Pf={},Ff=0,If=function(e){return e&&(e.host||If(e.parentNode))},Lf=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=If(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Rf=function(e,t,n,r){var i=Lf(t,Array.isArray(e)?e:[e]);Pf[n]||(Pf[n]=new WeakMap);var a=Pf[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Mf.get(e)||0)+1,l=(a.get(e)||0)+1;Mf.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Nf.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Ff++,function(){o.forEach(function(e){var t=Mf.get(e)-1,i=a.get(e)-1;Mf.set(e,t),a.set(e,i),t||(Nf.has(e)||e.removeAttribute(r),Nf.delete(e)),i||e.removeAttribute(n)}),Ff--,Ff||(Mf=new WeakMap,Mf=new WeakMap,Nf=new WeakMap,Pf={})}},zf=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||jf(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Rf(r,i,n,`aria-hidden`)):function(){return null}},Bf=function(){return Bf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Bf.apply(this,arguments)};function Vf(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Hf(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Uf=`right-scroll-bar-position`,Wf=`width-before-scroll-bar`,Gf=`with-scroll-bars-hidden`,Kf=`--removed-body-scroll-bar-size`;function qf(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Jf(e,t){var n=(0,L.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Yf=typeof window<`u`?L.useLayoutEffect:L.useEffect,Xf=new WeakMap;function Zf(e,t){var n=Jf(t||null,function(t){return e.forEach(function(e){return qf(e,t)})});return Yf(function(){var t=Xf.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||qf(e,null)}),i.forEach(function(e){r.has(e)||qf(e,a)})}Xf.set(n,e)},[e]),n}function Qf(e){return e}function $f(e,t){t===void 0&&(t=Qf);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function ep(e){e===void 0&&(e={});var t=$f(null);return t.options=Bf({async:!0,ssr:!1},e),t}var tp=function(e){var t=e.sideCar,n=Vf(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return L.createElement(r,Bf({},n))};tp.isSideCarExport=!0;function np(e,t){return e.useMedium(t),tp}var rp=ep(),ip=function(){},ap=L.forwardRef(function(e,t){var n=L.useRef(null),r=L.useState({onScrollCapture:ip,onWheelCapture:ip,onTouchMoveCapture:ip}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Vf(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Zf([n,t]),C=Bf(Bf({},b),i);return L.createElement(L.Fragment,null,u&&L.createElement(x,{sideCar:rp,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?L.cloneElement(L.Children.only(s),Bf(Bf({},C),{ref:S})):L.createElement(v,Bf({},C,{className:c,ref:S}),s))});ap.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ap.classNames={fullWidth:Wf,zeroRight:Uf};var op,sp=function(){if(op)return op;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function cp(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=sp();return t&&e.setAttribute(`nonce`,t),e}function lp(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function up(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var dp=function(){var e=0,t=null;return{add:function(n){e==0&&(t=cp())&&(lp(t,n),up(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},fp=function(){var e=dp();return function(t,n){L.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},pp=function(){var e=fp();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},mp={left:0,top:0,right:0,gap:0},hp=function(e){return parseInt(e||``,10)||0},gp=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[hp(n),hp(r),hp(i)]},_p=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return mp;var t=gp(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},vp=pp(),yp=`data-scroll-locked`,bp=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
13
- .${Gf} {
14
- overflow: hidden ${r};
15
- padding-right: ${s}px ${r};
16
- }
17
- body[${yp}] {
18
- overflow: hidden ${r};
19
- overscroll-behavior: contain;
20
- ${[t&&`position: relative ${r};`,n===`margin`&&`
21
- padding-left: ${i}px;
22
- padding-top: ${a}px;
23
- padding-right: ${o}px;
24
- margin-left:0;
25
- margin-top:0;
26
- margin-right: ${s}px ${r};
27
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
28
- }
29
-
30
- .${Uf} {
31
- right: ${s}px ${r};
32
- }
33
-
34
- .${Wf} {
35
- margin-right: ${s}px ${r};
36
- }
37
-
38
- .${Uf} .${Uf} {
39
- right: 0 ${r};
40
- }
41
-
42
- .${Wf} .${Wf} {
43
- margin-right: 0 ${r};
44
- }
45
-
46
- body[${yp}] {
47
- ${Kf}: ${s}px;
48
- }
49
- `},xp=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Sp=function(){L.useEffect(function(){return document.body.setAttribute(yp,(xp()+1).toString()),function(){var e=xp()-1;e<=0?document.body.removeAttribute(yp):document.body.setAttribute(yp,e.toString())}},[])},Cp=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Sp();var a=L.useMemo(function(){return _p(i)},[i]);return L.createElement(vp,{styles:bp(a,!t,i,n?``:`!important`)})},wp=!1;if(typeof window<`u`)try{var Tp=Object.defineProperty({},`passive`,{get:function(){return wp=!0,!0}});window.addEventListener(`test`,Tp,Tp),window.removeEventListener(`test`,Tp,Tp)}catch{wp=!1}var Ep=wp?{passive:!1}:!1,Dp=function(e){return e.tagName===`TEXTAREA`},Op=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Dp(e)&&n[t]===`visible`)},kp=function(e){return Op(e,`overflowY`)},Ap=function(e){return Op(e,`overflowX`)},jp=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Pp(e,r)){var i=Fp(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Mp=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Np=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Pp=function(e,t){return e===`v`?kp(t):Ap(t)},Fp=function(e,t){return e===`v`?Mp(t):Np(t)},Ip=function(e,t){return e===`h`&&t===`rtl`?-1:1},Lp=function(e,t,n,r,i){var a=Ip(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Fp(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Pp(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Rp=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},zp=function(e){return[e.deltaX,e.deltaY]},Bp=function(e){return e&&`current`in e?e.current:e},Vp=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Hp=function(e){return`
50
- .block-interactivity-${e} {pointer-events: none;}
51
- .allow-interactivity-${e} {pointer-events: all;}
52
- `},Up=0,Wp=[];function Gp(e){var t=L.useRef([]),n=L.useRef([0,0]),r=L.useRef(),i=L.useState(Up++)[0],a=L.useState(pp)[0],o=L.useRef(e);L.useEffect(function(){o.current=e},[e]),L.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Hf([e.lockRef.current],(e.shards||[]).map(Bp),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=L.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Rp(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=jp(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=jp(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Lp(h,t,e,h===`h`?s:c,!0)},[]),c=L.useCallback(function(e){var n=e;if(!(!Wp.length||Wp[Wp.length-1]!==a)){var r=`deltaY`in n?zp(n):Rp(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Vp(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Bp).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=L.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Kp(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=L.useCallback(function(e){n.current=Rp(e),r.current=void 0},[]),d=L.useCallback(function(t){l(t.type,zp(t),t.target,s(t,e.lockRef.current))},[]),f=L.useCallback(function(t){l(t.type,Rp(t),t.target,s(t,e.lockRef.current))},[]);L.useEffect(function(){return Wp.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Ep),document.addEventListener(`touchmove`,c,Ep),document.addEventListener(`touchstart`,u,Ep),function(){Wp=Wp.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Ep),document.removeEventListener(`touchmove`,c,Ep),document.removeEventListener(`touchstart`,u,Ep)}},[]);var p=e.removeScrollBar,m=e.inert;return L.createElement(L.Fragment,null,m?L.createElement(a,{styles:Hp(i)}):null,p?L.createElement(Cp,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Kp(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var qp=np(rp,Gp),Jp=L.forwardRef(function(e,t){return L.createElement(ap,Bf({},e,{ref:t,sideCar:qp}))});Jp.classNames=ap.classNames;var Yp=[`Enter`,` `],Xp=[`ArrowDown`,`PageUp`,`Home`],Zp=[`ArrowUp`,`PageDown`,`End`],Qp=[...Xp,...Zp],$p={ltr:[...Yp,`ArrowRight`],rtl:[...Yp,`ArrowLeft`]},em={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},tm=`Menu`,[nm,rm,im]=Ic(tm),[am,om]=xc(tm,[im,Id,_f]),sm=Id(),cm=_f(),[lm,um]=am(tm),[dm,fm]=am(tm),pm=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=sm(t),[c,l]=L.useState(null),u=L.useRef(!1),d=zc(a),f=Rc(i);return L.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,R.jsx)(Qd,{...s,children:(0,R.jsx)(lm,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,R.jsx)(dm,{scope:t,onClose:L.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};pm.displayName=tm;var mm=`MenuAnchor`,hm=L.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=sm(n);return(0,R.jsx)($d,{...i,...r,ref:t})});hm.displayName=mm;var gm=`MenuPortal`,[_m,vm]=am(gm,{forceMount:void 0}),ym=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=um(gm,t);return(0,R.jsx)(_m,{scope:t,forceMount:n,children:(0,R.jsx)(of,{present:n||a.open,children:(0,R.jsx)(rf,{asChild:!0,container:i,children:r})})})};ym.displayName=gm;var bm=`MenuContent`,[xm,Sm]=am(bm),Cm=L.forwardRef((e,t)=>{let n=vm(bm,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=um(bm,e.__scopeMenu),o=fm(bm,e.__scopeMenu);return(0,R.jsx)(nm.Provider,{scope:e.__scopeMenu,children:(0,R.jsx)(of,{present:r||a.open,children:(0,R.jsx)(nm.Slot,{scope:e.__scopeMenu,children:o.modal?(0,R.jsx)(wm,{...i,ref:t}):(0,R.jsx)(Tm,{...i,ref:t})})})})}),wm=L.forwardRef((e,t)=>{let n=um(bm,e.__scopeMenu),r=L.useRef(null),i=bc(t,r);return L.useEffect(()=>{let e=r.current;if(e)return zf(e)},[]),(0,R.jsx)(Dm,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Y(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Tm=L.forwardRef((e,t)=>{let n=um(bm,e.__scopeMenu);return(0,R.jsx)(Dm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Em=Oc(`MenuContent.ScrollLock`),Dm=L.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=um(bm,n),_=fm(bm,n),v=sm(n),y=cm(n),b=rm(n),[x,S]=L.useState(null),C=L.useRef(null),w=bc(t,C,g.onContentChange),T=L.useRef(0),E=L.useRef(``),D=L.useRef(0),O=L.useRef(null),k=L.useRef(`right`),A=L.useRef(0),ee=m?Jp:L.Fragment,j=m?{as:Em,allowPinchZoom:!0}:void 0,te=e=>{let t=E.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=dh(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(T.current),t!==``&&(T.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};L.useEffect(()=>()=>window.clearTimeout(T.current),[]),tl();let M=L.useCallback(e=>k.current===O.current?.side&&ph(e,O.current?.area),[]);return(0,R.jsx)(xm,{scope:n,searchRef:E,onItemEnter:L.useCallback(e=>{M(e)&&e.preventDefault()},[M]),onItemLeave:L.useCallback(e=>{M(e)||(C.current?.focus(),S(null))},[M]),onTriggerLeave:L.useCallback(e=>{M(e)&&e.preventDefault()},[M]),pointerGraceTimerRef:D,onPointerGraceIntentChange:L.useCallback(e=>{O.current=e},[]),children:(0,R.jsx)(ee,{...j,children:(0,R.jsx)(sl,{asChild:!0,trapped:i,onMountAutoFocus:Y(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,R.jsx)(qc,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,R.jsx)(kf,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:Y(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,R.jsx)(ef,{role:`menu`,"aria-orientation":`vertical`,"data-state":oh(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:Y(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&te(e.key));let i=C.current;if(e.target!==i||!Qp.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);Zp.includes(e.key)&&a.reverse(),lh(a)}),onBlur:Y(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:Y(e.onPointerMove,mh(e=>{let t=e.target,n=A.current!==e.clientX;e.currentTarget.contains(t)&&n&&(k.current=e.clientX>A.current?`right`:`left`,A.current=e.clientX)}))})})})})})})});Cm.displayName=bm;var Om=`MenuGroup`,km=L.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,R.jsx)(Pc.div,{role:`group`,...r,ref:t})});km.displayName=Om;var Am=`MenuLabel`,jm=L.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,R.jsx)(Pc.div,{...r,ref:t})});jm.displayName=Am;var Mm=`MenuItem`,Nm=`menu.itemSelect`,Pm=L.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=L.useRef(null),o=fm(Mm,e.__scopeMenu),s=Sm(Mm,e.__scopeMenu),c=bc(t,a),l=L.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Nm,{bubbles:!0,cancelable:!0});e.addEventListener(Nm,e=>r?.(e),{once:!0}),Fc(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,R.jsx)(Fm,{...i,ref:c,disabled:n,onClick:Y(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:Y(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:Y(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||Yp.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Pm.displayName=Mm;var Fm=L.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Sm(Mm,n),s=cm(n),c=L.useRef(null),l=bc(t,c),[u,d]=L.useState(!1),[f,p]=L.useState(``);return L.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,R.jsx)(nm.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,R.jsx)(Af,{asChild:!0,...s,focusable:!r,children:(0,R.jsx)(Pc.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:Y(e.onPointerMove,mh(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Y(e.onPointerLeave,mh(e=>o.onItemLeave(e))),onFocus:Y(e.onFocus,()=>d(!0)),onBlur:Y(e.onBlur,()=>d(!1))})})})}),Im=`MenuCheckboxItem`,Lm=L.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,R.jsx)(Gm,{scope:e.__scopeMenu,checked:n,children:(0,R.jsx)(Pm,{role:`menuitemcheckbox`,"aria-checked":sh(n)?`mixed`:n,...i,ref:t,"data-state":ch(n),onSelect:Y(i.onSelect,()=>r?.(sh(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Lm.displayName=Im;var Rm=`MenuRadioGroup`,[zm,Bm]=am(Rm,{value:void 0,onValueChange:()=>{}}),Vm=L.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=zc(r);return(0,R.jsx)(zm,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,R.jsx)(km,{...i,ref:t})})});Vm.displayName=Rm;var Hm=`MenuRadioItem`,Um=L.forwardRef((e,t)=>{let{value:n,...r}=e,i=Bm(Hm,e.__scopeMenu),a=n===i.value;return(0,R.jsx)(Gm,{scope:e.__scopeMenu,checked:a,children:(0,R.jsx)(Pm,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":ch(a),onSelect:Y(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Um.displayName=Hm;var Wm=`MenuItemIndicator`,[Gm,Km]=am(Wm,{checked:!1}),qm=L.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=Km(Wm,n);return(0,R.jsx)(of,{present:r||sh(a.checked)||a.checked===!0,children:(0,R.jsx)(Pc.span,{...i,ref:t,"data-state":ch(a.checked)})})});qm.displayName=Wm;var Jm=`MenuSeparator`,Ym=L.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,R.jsx)(Pc.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Ym.displayName=Jm;var Xm=`MenuArrow`,Zm=L.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=sm(n);return(0,R.jsx)(tf,{...i,...r,ref:t})});Zm.displayName=Xm;var Qm=`MenuSub`,[$m,eh]=am(Qm),th=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=um(Qm,t),o=sm(t),[s,c]=L.useState(null),[l,u]=L.useState(null),d=zc(i);return L.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,R.jsx)(Qd,{...o,children:(0,R.jsx)(lm,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,R.jsx)($m,{scope:t,contentId:xl(),triggerId:xl(),trigger:s,onTriggerChange:c,children:n})})})};th.displayName=Qm;var nh=`MenuSubTrigger`,rh=L.forwardRef((e,t)=>{let n=um(nh,e.__scopeMenu),r=fm(nh,e.__scopeMenu),i=eh(nh,e.__scopeMenu),a=Sm(nh,e.__scopeMenu),o=L.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=L.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return L.useEffect(()=>u,[u]),L.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,R.jsx)(hm,{asChild:!0,...l,children:(0,R.jsx)(Fm,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":oh(n.open),...e,ref:yc(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Y(e.onPointerMove,mh(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Y(e.onPointerLeave,mh(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Y(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||$p[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});rh.displayName=nh;var ih=`MenuSubContent`,ah=L.forwardRef((e,t)=>{let n=vm(bm,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=um(bm,e.__scopeMenu),o=fm(bm,e.__scopeMenu),s=eh(ih,e.__scopeMenu),c=L.useRef(null),l=bc(t,c);return(0,R.jsx)(nm.Provider,{scope:e.__scopeMenu,children:(0,R.jsx)(of,{present:r||a.open,children:(0,R.jsx)(nm.Slot,{scope:e.__scopeMenu,children:(0,R.jsx)(Dm,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Y(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Y(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:Y(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=em[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});ah.displayName=ih;function oh(e){return e?`open`:`closed`}function sh(e){return e===`indeterminate`}function ch(e){return sh(e)?`indeterminate`:e?`checked`:`unchecked`}function lh(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function uh(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function dh(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=uh(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function fh(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function ph(e,t){return t?fh({x:e.clientX,y:e.clientY},t):!1}function mh(e){return t=>t.pointerType===`mouse`?e(t):void 0}var hh=pm,gh=hm,_h=ym,vh=Cm,yh=km,bh=jm,xh=Pm,Sh=Lm,Ch=Vm,wh=Um,Th=qm,Eh=Ym,Dh=Zm,Oh=rh,kh=ah,Ah=`DropdownMenu`,[jh,Mh]=xc(Ah,[om]),Nh=om(),[Ph,Fh]=jh(Ah),Ih=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Nh(t),l=L.useRef(null),[u,d]=Tc({prop:i,defaultProp:a??!1,onChange:o,caller:Ah});return(0,R.jsx)(Ph,{scope:t,triggerId:xl(),triggerRef:l,contentId:xl(),open:u,onOpenChange:d,onOpenToggle:L.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,R.jsx)(hh,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Ih.displayName=Ah;var Lh=`DropdownMenuTrigger`,Rh=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Fh(Lh,n),o=Nh(n);return(0,R.jsx)(gh,{asChild:!0,...o,children:(0,R.jsx)(Pc.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:yc(t,a.triggerRef),onPointerDown:Y(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:Y(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Rh.displayName=Lh;var zh=`DropdownMenuPortal`,Bh=e=>{let{__scopeDropdownMenu:t,...n}=e,r=Nh(t);return(0,R.jsx)(_h,{...r,...n})};Bh.displayName=zh;var Vh=`DropdownMenuContent`,Hh=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Fh(Vh,n),a=Nh(n),o=L.useRef(!1);return(0,R.jsx)(vh,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Y(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:Y(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Hh.displayName=Vh;var Uh=`DropdownMenuGroup`,Wh=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Nh(n);return(0,R.jsx)(yh,{...i,...r,ref:t})});Wh.displayName=Uh;var Gh=`DropdownMenuLabel`,Kh=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Nh(n);return(0,R.jsx)(bh,{...i,...r,ref:t})});Kh.displayName=Gh;var qh=`DropdownMenuItem`,Jh=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Nh(n);return(0,R.jsx)(xh,{...i,...r,ref:t})});Jh.displayName=qh;var Yh=`DropdownMenuCheckboxItem`,Xh=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Nh(n);return(0,R.jsx)(Sh,{...i,...r,ref:t})});Xh.displayName=Yh;var Zh=`DropdownMenuRadioGroup`,Qh=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Nh(n);return(0,R.jsx)(Ch,{...i,...r,ref:t})});Qh.displayName=Zh;var $h=`DropdownMenuRadioItem`,eg=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Nh(n);return(0,R.jsx)(wh,{...i,...r,ref:t})});eg.displayName=$h;var tg=`DropdownMenuItemIndicator`,ng=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Nh(n);return(0,R.jsx)(Th,{...i,...r,ref:t})});ng.displayName=tg;var rg=`DropdownMenuSeparator`,ig=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Nh(n);return(0,R.jsx)(Eh,{...i,...r,ref:t})});ig.displayName=rg;var ag=`DropdownMenuArrow`,og=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Nh(n);return(0,R.jsx)(Dh,{...i,...r,ref:t})});og.displayName=ag;var sg=`DropdownMenuSubTrigger`,cg=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Nh(n);return(0,R.jsx)(Oh,{...i,...r,ref:t})});cg.displayName=sg;var lg=`DropdownMenuSubContent`,ug=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Nh(n);return(0,R.jsx)(kh,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});ug.displayName=lg;var dg=Ih,fg=Rh,pg=Bh,mg=Hh,hg=Jh,gg=dg,_g=fg;function vg({align:e=`end`,className:t,sideOffset:n=4,...r}){return(0,R.jsx)(pg,{children:(0,R.jsx)(mg,{align:e,className:K(`z-50 min-w-40 overflow-hidden rounded-[var(--radius-md)] border border-border bg-popover p-1 text-popover-foreground shadow-[var(--shadow-md)] outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,t),sideOffset:n,...r})})}function yg({className:e,variant:t,...n}){return(0,R.jsx)(hg,{className:K(`relative flex cursor-default select-none items-center gap-2 rounded-[var(--radius-sm)] px-2 py-1.5 text-[length:var(--font-size-sm)] outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-[var(--opacity-disabled)] [&_svg]:size-4 [&_svg]:shrink-0`,t===`destructive`&&`text-[var(--semantic-danger-fg)] focus:bg-[var(--semantic-danger-bg)] focus:text-[var(--semantic-danger-fg)]`,e),...n})}function bg({className:e,...t}){return(0,R.jsx)(`label`,{className:K(`text-[length:var(--font-size-sm)] font-medium leading-none text-foreground`,e),...t})}var xg=`b`,Sg=(0,L.createContext)(null);function Cg(){let e=(0,L.useContext)(Sg);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function wg({children:e,className:t,defaultOpen:n=!0,open:r,onOpenChange:i,style:a,...o}){let[s,c]=(0,L.useState)(n),l=r??s,u=(0,L.useCallback)(e=>{let t=typeof e==`function`?e(l):e;i?.(t),r===void 0&&c(t)},[i,l,r]),d=(0,L.useCallback)(()=>{u(e=>!e)},[u]);(0,L.useEffect)(()=>{let e=e=>{e.key.toLowerCase()===xg&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),d())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[d]);let f=(0,L.useMemo)(()=>({open:l,setOpen:u,state:l?`expanded`:`collapsed`,toggleSidebar:d}),[l,u,d]);return(0,R.jsx)(Sg.Provider,{value:f,children:(0,R.jsx)(`div`,{className:K(`group/sidebar-wrapper flex min-h-svh w-full bg-background text-foreground has-[[data-variant=inset]]:bg-background`,t),style:{"--sidebar-width":`var(--layout-sidebar-width)`,...a},...o,children:e})})}function Tg({children:e,className:t,collapsible:n=`offcanvas`,variant:r=`sidebar`,...i}){let{setOpen:a,state:o}=Cg(),s=o===`collapsed`&&n===`offcanvas`;return(0,R.jsxs)(R.Fragment,{children:[!s&&n===`offcanvas`&&(0,R.jsx)(`button`,{"aria-label":`Close sidebar`,className:`fixed inset-0 z-30 bg-[var(--surface-overlay)] md:hidden`,onClick:()=>a(!1),type:`button`}),(0,R.jsx)(`aside`,{"data-collapsible":o===`collapsed`?n:``,"data-state":o,"data-variant":r,className:K(`group/sidebar fixed inset-y-0 left-0 z-40 flex h-svh w-[var(--sidebar-width)] shrink-0 flex-col overflow-hidden text-sidebar-foreground transition-transform duration-[var(--motion-duration-normal)] ease-[var(--motion-ease-standard)] md:relative md:z-auto`,s&&`hidden`,!s&&`translate-x-0`,!s&&r===`sidebar`&&`border-r border-sidebar-border bg-sidebar`,!s&&r===`inset`&&`border-r border-sidebar-border bg-sidebar`,t),...i,children:!s&&(0,R.jsx)(`div`,{className:`flex h-full min-h-0 flex-col bg-sidebar`,children:e})})]})}function Eg({className:e,...t}){return(0,R.jsx)(`div`,{className:K(`flex min-h-[var(--layout-topbar-height)] items-center gap-2 border-b border-sidebar-border px-3 group-data-[state=collapsed]/sidebar:justify-center group-data-[state=collapsed]/sidebar:px-2`,e),...t})}function Dg({className:e,...t}){return(0,R.jsx)(`main`,{className:K(`relative flex min-w-0 flex-1 flex-col bg-[var(--surface-panel)]`,e),...t})}function Og({className:e,...t}){let{toggleSidebar:n}=Cg();return(0,R.jsxs)(`button`,{className:K(`inline-flex size-8 shrink-0 items-center justify-center rounded-[var(--radius-sm)] text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:shadow-[var(--state-focus-ring)] disabled:pointer-events-none disabled:opacity-[var(--opacity-disabled)]`,e),onClick:n,title:`Toggle sidebar`,type:`button`,...t,children:[(0,R.jsx)(jo,{className:`size-4`}),(0,R.jsx)(`span`,{className:`sr-only`,children:`Toggle sidebar`})]})}function kg({className:e,...t}){let{toggleSidebar:n}=Cg();return(0,R.jsx)(`button`,{"aria-label":`Toggle sidebar`,className:K(`absolute inset-y-0 -right-3 z-20 hidden w-6 -translate-x-px transition-colors after:absolute after:inset-y-0 after:left-1/2 after:w-px hover:after:bg-sidebar-border sm:flex`,e),onClick:n,tabIndex:-1,type:`button`,...t})}function Ag({className:e,...t}){return(0,R.jsx)(`div`,{className:K(`min-h-0 flex-1 overflow-y-auto p-2 group-data-[state=collapsed]/sidebar:px-2`,e),...t})}function jg({className:e,...t}){return(0,R.jsx)(`section`,{className:K(`relative space-y-1 group-data-[state=collapsed]/sidebar:space-y-2`,e),...t})}function Mg({className:e,...t}){return(0,R.jsx)(`div`,{className:K(`flex items-center gap-2 group-data-[state=collapsed]/sidebar:hidden`,e),...t})}function Ng({className:e,...t}){return(0,R.jsx)(`div`,{className:K(`min-w-0 flex-1 px-2 py-1 text-[length:var(--font-size-xs)] font-medium text-[var(--text-secondary)]`,e),...t})}function Pg({className:e,...t}){return(0,R.jsx)(`button`,{className:K(`inline-flex size-7 shrink-0 items-center justify-center rounded-[var(--radius-sm)] text-[var(--icon-color-default)] outline-none transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:shadow-[var(--state-focus-ring)]`,e),type:`button`,...t})}function Fg({className:e,...t}){return(0,R.jsx)(`div`,{className:K(`w-full`,e),...t})}function Ig({className:e,...t}){return(0,R.jsx)(`ul`,{className:K(`space-y-1`,e),...t})}function Lg({className:e,...t}){return(0,R.jsx)(`li`,{className:K(`min-w-0`,e),...t})}function Rg({className:e,isActive:t,...n}){return(0,R.jsx)(`button`,{className:K(`flex min-h-8 w-full min-w-0 items-center gap-2 rounded-[var(--radius-sm)] px-2 py-1.5 text-left text-[length:var(--font-size-sm)] outline-none transition-colors duration-[var(--motion-duration-fast)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:shadow-[var(--state-focus-ring)] group-data-[state=collapsed]/sidebar:justify-center group-data-[state=collapsed]/sidebar:px-0`,t&&`bg-sidebar-accent text-sidebar-accent-foreground`,e),...n})}function zg({className:e,...t}){return(0,R.jsx)(`ul`,{className:K(`ml-4 mt-1 space-y-1 border-l border-sidebar-border pl-2 group-data-[state=collapsed]/sidebar:hidden`,e),...t})}function Bg({className:e,...t}){return(0,R.jsx)(`li`,{className:K(`min-w-0`,e),...t})}function Vg({className:e,isActive:t,...n}){return(0,R.jsx)(`button`,{className:K(`flex min-h-7 w-full min-w-0 items-center gap-2 rounded-[var(--radius-sm)] px-2 py-1 text-left text-[length:var(--font-size-sm)] outline-none transition-colors duration-[var(--motion-duration-fast)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:shadow-[var(--state-focus-ring)]`,t&&`bg-sidebar-accent text-sidebar-accent-foreground`,e),...n})}function Hg({className:e,...t}){return(0,R.jsx)(`textarea`,{className:K(`flex min-h-16 w-full min-w-0 resize-none rounded-[var(--radius-sm)] border border-input bg-[var(--surface-input)] px-3 py-2 text-[length:var(--font-size-md)] shadow-[var(--shadow-xs)] outline-none transition-[border-color,box-shadow] duration-[var(--motion-duration-fast)] placeholder:text-[var(--text-tertiary)] focus-visible:border-ring focus-visible:shadow-[var(--state-focus-ring)] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-[var(--opacity-disabled)]`,e),...t})}function Ug(e,t=globalThis){let n=e.isComposing||e.keyCode===229;return e.key!==`Enter`||e.shiftKey||e.altKey||n||!Gg(e)||Kg(t)?null:e.metaKey||e.ctrlKey?`modifiedSubmit`:`submit`}function Wg(e,t){return e===`modifiedSubmit`?`queue`:t?.activeTurnId?t.status===`running`?`steer`:null:`send`}function Gg(e){return e.code===`Enter`||e.code===`NumpadEnter`}function Kg(e){if((e.navigator?.virtualKeyboard?.boundingRect?.height??0)>0||e.navigator?.userAgentData?.mobile)return!0;let t=e.navigator?.userAgent??``;if(/(Android|iPhone|iPad|iPod|Mobile|Windows Phone)/i.test(t))return!0;if((e.navigator?.maxTouchPoints??0)===0||!e.matchMedia)return!1;let n=e.matchMedia(`(pointer: coarse)`).matches,r=e.matchMedia(`(any-pointer: fine)`).matches,i=e.matchMedia(`(hover: hover)`).matches;return n&&!r&&!i}var qg=[`low`,`medium`,`high`,`xhigh`],Jg=/%(?:2f|3a|5c|7e)/i,Yg=/^[A-Za-z]:/;function Xg(e){let t=e.trim();if(!t)return!1;for(let e=0;e<8;e+=1){if(Jg.test(t)||t.includes(`/`)||t.includes(`\\`)||t.startsWith(`~`)||Yg.test(t))return!1;try{let e=decodeURIComponent(t);if(e===t)return!0;t=e}catch{return!1}}return!1}function Zg(e,t,n){if(!t)return null;let r=e.find(e=>e.id===t)??null;return r&&(!n||r.projectId===n)?r:null}function Qg(e,t,n,r){let i=new Set(t.map(e=>e.id));return Zg(Object.values(e).flat().filter(e=>i.has(e.projectId)),n,r)}function $g(e,t){return Object.fromEntries(Object.entries(e).filter(([e])=>t.has(e)))}function e_(e,t){let n=new Map;for(let e of t){if(e.status===`archived`)continue;let t=n.get(e.worktreePath);(!t||e.updatedAt.localeCompare(t.updatedAt)>0)&&n.set(e.worktreePath,e)}return e.map(e=>{let t=n.get(e.path);return t?{...e,chatId:t.id,chatStatus:t.status,chatTitle:t.title}:{...e,chatId:null,chatStatus:null,chatTitle:e.name}})}function t_(e){let t=e.filter(e=>e.codexThreadId),n=t.length>0?t:e,r=new Map;for(let e of n){let t=e.codexThreadId??e.id,n=r.get(t);(!n||n.status===`archived`&&e.status!==`archived`||n.status===e.status&&e.updatedAt.localeCompare(n.updatedAt)>0||n.status!==`archived`&&e.status!==`archived`&&e.updatedAt.localeCompare(n.updatedAt)>0)&&r.set(t,e)}return[...r.values()].sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt))}function n_(e,t){return!!(t&&e.some(e=>e.chatId===t))}function r_(e,t,n,r){return n?!e||e.some(e=>e.id===n)||n_(t,n)?n:r??n:null}function i_(e){return e?e.supportedReasoningEfforts:qg}function a_(e){return!!e?.additionalSpeedTiers.includes(`fast`)}function o_(e,t,n){return e?t===`fast`&&a_(e)?`fast`:null:n===`fast`?`fast`:null}function s_(e,t){return e.filter(e=>e.enabled&&t.has(e.path)).map(e=>({name:e.name,path:e.path}))}function c_(e){return e.role===`event`?e.eventType===`turn/plan/updated`||e.eventType===`item/plan/delta`?`plan`:e.eventType===`turn/diff/updated`?`diff`:e.eventType===`item/commandExecution/outputDelta`||e.eventType===`command/exec/outputDelta`?`command`:e.eventType===`item/fileChange/patchUpdated`||e.eventType===`item/fileChange/outputDelta`?`file`:e.eventType?.startsWith(`item/reasoning/`)&&e.eventType!==`item/reasoning/summaryPartAdded`?`reasoning`:e.eventType===`warning`||e.eventType===`guardianWarning`||e.eventType===`configWarning`?`warning`:null:null}function l_(e){return c_(e)!==null}function u_(e){let t=v_(e);return{explanation:b_(t,`explanation`)??null,plan:y_(t,`plan`).map(e=>{let t=b_(e,`step`),n=b_(e,`status`);return!t||n!==`completed`&&n!==`inProgress`&&n!==`pending`?null:{step:t,status:n}}).filter(e=>!!e)}}function d_(e){let t=v_(e),n=b_(t,`diff`)??``;return{diff:n,files:C_(t,`files`).filter(Boolean),hasDiff:S_(t,`hasDiff`)??!!n}}function f_(e){return y_(v_(e),`changes`).map(e=>{let t=b_(e,`path`);return t?{path:t,kind:b_(e,`kind`)??`update`,diff:b_(e,`diff`)??``}:null}).filter(e=>!!e)}function p_(e){return b_(v_(e),`text`)??e.text}function m_(e){let t=v_(e);return{summary:b_(t,`message`)??b_(t,`summary`)??e.text,details:b_(t,`details`)??null}}function h_(e){let t=v_(e);return{capReached:t?.capReached===!0,command:b_(t,`command`)??null,cwd:b_(t,`cwd`)??null,durationMs:x_(t,`durationMs`)??null,exitCode:x_(t,`exitCode`)??null,stream:b_(t,`stream`)??null,status:b_(t,`status`)??null}}function g_(e){return{status:b_(v_(e),`status`)??null}}function __(e){let t=e.trimEnd();return t?t.split(/\r?\n/).length:0}function v_(e){return w_(e.eventData)?e.eventData:null}function y_(e,t){let n=e?.[t];return Array.isArray(n)?n.filter(w_):[]}function b_(e,t){let n=e?.[t];return typeof n==`string`?n:void 0}function x_(e,t){let n=e?.[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function S_(e,t){let n=e?.[t];return typeof n==`boolean`?n:void 0}function C_(e,t){let n=e?.[t];return Array.isArray(n)?n.filter(e=>typeof e==`string`):[]}function w_(e){return!!(e&&typeof e==`object`&&!Array.isArray(e))}function T_(e,t){if(e.length===0)return t;let n=new Set(e.map(e=>e.id)),r=new Map(t.map(e=>[e.id,e])),i=new Set,a=[];for(let t of e){let e=r.get(t.id);if(e){if(E_(t,e)){i.add(e.id);continue}a.push(e)}}let o=t.filter(e=>!n.has(e.id)),s=t.filter(e=>n.has(e.id)&&i.has(e.id));return[...a,...o,...s]}function E_(e,t){return t.role===`event`&&e.role===`event`&&e.id===t.id&&D_(e,t)}function D_(e,t){return e.text!==t.text||e.eventType!==t.eventType||e.itemId!==t.itemId||O_(e.eventData)!==O_(t.eventData)}function O_(e){if(e===void 0)return``;try{return JSON.stringify(k_(e))??``}catch{return``}}function k_(e){return Array.isArray(e)?e.map(k_):A_(e)?Object.fromEntries(Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>[e,k_(t)])):e}function A_(e){return!!(e&&typeof e==`object`&&!Array.isArray(e))}var j_=[`chat.created`,`chat.updated`,`chat.message.created`,`chat.message.deleted`,`agent.thread.started`,`agent.turn.started`,`agent.plan.updated`,`agent.diff.updated`,`agent.command.output`,`agent.file.updated`,`agent.reasoning.updated`,`agent.warning`,`agent.item.updated`,`agent.item.delta`,`agent.approval.requested`,`agent.approval.resolved`,`agent.turn.completed`,`agent.error`,`agent.event`,`auth.updated`],M_=new Set([`agent.plan.updated`,`agent.diff.updated`,`agent.command.output`,`agent.file.updated`,`agent.reasoning.updated`,`agent.item.updated`,`agent.item.delta`]),N_=`phantom.chatScroll:v1:`,P_=4,F_={chat:`chat`,effort:`effort`,expandedProject:`expandedProject`,fileQuery:`fileQuery`,model:`model`,project:`project`,serviceTier:`serviceTier`},I_={archived:{badge:`secondary`,dot:`bg-[var(--status-archived-dot)]`,label:`Archived`},failed:{badge:`danger`,dot:`bg-[var(--semantic-danger-fg)]`,label:`Failed`},idle:{badge:`secondary`,dot:`bg-[var(--status-idle-dot)]`,label:`Idle`},running:{badge:`info`,dot:`bg-[var(--semantic-info-fg)]`,label:`Running`},waitingForApproval:{badge:`warning`,dot:`bg-[var(--semantic-warning-fg)]`,label:`Approval`}};function L_(e){return e.status!==`archived`&&e.status!==`running`&&e.status!==`waitingForApproval`&&!e.activeTurnId}var R_=6e3,z_=3;function B_(e,t){return e?t[e]?.[0]??null:null}function V_(e,t){return`${e}:${t}`}function H_(e){return e instanceof Error?e.message:typeof e==`string`?e:`Something went wrong`}function U_(e,t){let n=H_(t);return n?`${e}: ${n}`:e}function W_(e,t){return e.get(t)?.trim()||null}function G_(e,t){let n=e.getAll(t).flatMap(e=>e.split(`,`)).map(e=>e.trim()).filter(Boolean);return new Set(n)}function K_(e,t){return`${e??``}\u0000${t??``}`}function q_(e,t,n){n?e.set(t,n):e.delete(t)}function J_(e,t,n){e.delete(t);let r=[...n].sort();r.length>0&&e.set(t,r.join(`,`))}function Y_(e,t){if(!t)return;let n=G_(e,F_.expandedProject);n.add(t),J_(e,F_.expandedProject,n)}function X_(e,t=44){if(e.length<=t)return e;let n=t-3,r=e.slice(-n),i=r.indexOf(`/`);return`...${i>0?r.slice(i):r}`}function Z_(e){return`${N_}${e}`}function Q_(e){try{let t=window.localStorage.getItem(Z_(e));if(!t)return null;let n=JSON.parse(t);return n.version!==1||typeof n.top!=`number`||!Number.isFinite(n.top)?null:{version:1,pinnedToBottom:n.pinnedToBottom===!0,top:Math.max(0,n.top)}}catch{return null}}function $_(e,t){try{window.localStorage.setItem(Z_(e),JSON.stringify({version:1,pinnedToBottom:ev(t),top:Math.max(0,Math.round(t.scrollTop))}))}catch{}}function ev(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=P_}function tv(){let[e,t]=Ha(),n=(0,L.useRef)(e);n.current=e;let r=W_(e,F_.project),i=W_(e,F_.chat),a=K_(r,i),o=(0,L.useRef)(a);o.current=a;let s=W_(e,F_.model),c=W_(e,F_.effort),l=W_(e,F_.serviceTier),u=e.get(F_.fileQuery)??``,d=Xg(u)?u:``,f=(0,L.useMemo)(()=>G_(e,F_.expandedProject),[e]),[p,m]=(0,L.useState)([]),[h,g]=(0,L.useState)({}),[_,v]=(0,L.useState)({}),[y,b]=(0,L.useState)({}),[x,S]=(0,L.useState)(()=>new Set),[C,w]=(0,L.useState)([]),[T,E]=(0,L.useState)(null),D=(0,L.useRef)(T);D.current=T;let[O,k]=(0,L.useState)(!1),[A,ee]=(0,L.useState)(``),[j,te]=(0,L.useState)(null),[M,ne]=(0,L.useState)(null),[N,P]=(0,L.useState)(`default`),[re,ie]=(0,L.useState)(!1),[ae,oe]=(0,L.useState)(``),[F,I]=(0,L.useState)([]),[se,ce]=(0,L.useState)([]),[le,ue]=(0,L.useState)(()=>new Set),[de,fe]=(0,L.useState)(null),pe=d||(de?.workspaceSelectionKey===a?de.query:``),me=(0,L.useRef)(pe),he=(0,L.useRef)(0),ge=(0,L.useRef)(0),_e=(0,L.useRef)(0),[ve,ye]=(0,L.useState)([]),[be,xe]=(0,L.useState)([]),[Se,Ce]=(0,L.useState)(`Starting`),[we,Te]=(0,L.useState)(null),[Ee,De]=(0,L.useState)(null),[Oe,ke]=(0,L.useState)(null),[Ae,je]=(0,L.useState)(null),[Me,Ne]=(0,L.useState)(null),[Pe,Fe]=(0,L.useState)(null),[Ie,Le]=(0,L.useState)(null),[Re,Be]=(0,L.useState)(null),[Ve,Ue]=(0,L.useState)(null),[We,Ge]=(0,L.useState)([]),[Ke,qe]=(0,L.useState)(!1),[Je,Ye]=(0,L.useState)(!0),[Xe,Ze]=(0,L.useState)(()=>new Set),[Qe,$e]=(0,L.useState)(()=>new Set),[z,et]=(0,L.useState)(!0),[tt,nt]=(0,L.useState)(!1),[rt,it]=(0,L.useState)(!1),[at,ot]=(0,L.useState)(!1),[st,ct]=(0,L.useState)(()=>new Set),[lt,ut]=(0,L.useState)(null),[dt,ft]=(0,L.useState)(null),[pt,mt]=(0,L.useState)(null),[ht,gt]=(0,L.useState)(!1),[_t,vt]=(0,L.useState)(null),[yt,bt]=(0,L.useState)(!1),[xt,St]=(0,L.useState)(null),Ct=(0,L.useRef)(!1),wt=(0,L.useRef)(null),Tt=(0,L.useRef)(!0),Et=(0,L.useRef)(!1),Dt=(0,L.useRef)(null),Ot=(0,L.useRef)(null),kt=(0,L.useRef)(null),B=(0,L.useRef)(null),At=(0,L.useRef)(0),jt=(0,L.useRef)(0),Mt=(0,L.useRef)(new Map),Nt=(0,L.useRef)(h),Pt=(0,L.useRef)(_),Ft=(0,L.useRef)(y),It=(0,L.useRef)(0),Lt=(0,L.useRef)(0),Rt=(0,L.useRef)(null),zt=(0,L.useRef)(ae),Bt=(0,L.useRef)(!1),Vt=(0,L.useRef)(null),Ht=(0,L.useRef)(new Set),Ut=(0,L.useRef)(new Map),[Wt,Gt]=(0,L.useState)(null),Kt=(0,L.useRef)(Wt);Kt.current=Wt;let V=ze(),qt=He({mutationFn:vs}),Jt=He({mutationFn:ys}),Yt=He({mutationFn:({input:e,projectId:t})=>bs(t,e)}),Xt=He({mutationFn:({input:e,projectId:t})=>Ss(t,e)}),Zt=He({mutationFn:({input:e,projectId:t})=>Cs(t,e)}),Qt=He({mutationFn:({chatId:e,input:t})=>ws(e,t)}),$t=He({mutationFn:({chatId:e,messageId:t})=>Ts(e,t)}),en=He({mutationFn:({chatId:e,input:t})=>Es(e,t)}),tn=He({mutationFn:({chatId:e,input:t})=>Ds(e,t)}),nn=He({mutationFn:({chatId:e,input:t})=>Os(e,t)}),rn=He({mutationFn:ks}),an=He({mutationFn:({chatId:e,decision:t,requestId:n})=>As(e,n,t)}),on=He({mutationFn:({archived:e,chatId:t})=>xs(t,e)});function sn(e){let t=Mt.current.get(e);t!==void 0&&(window.clearTimeout(t),Mt.current.delete(e))}function cn(e){sn(e),Ge(t=>t.filter(t=>t.id!==e))}function ln(e,t=`danger`){let n=jt.current+1;jt.current=n;let r=window.setTimeout(()=>cn(n),R_);Mt.current.set(n,r),Ge(r=>{let i=[...r,{id:n,message:e,tone:t}].slice(-z_),a=new Set(i.map(e=>e.id));for(let e of r)a.has(e.id)||sn(e.id);return i})}(0,L.useEffect)(()=>()=>{for(let e of Mt.current.values())window.clearTimeout(e);Mt.current.clear()},[]);function un(e){Kt.current=e,Gt(e)}function dn(e){Gt(t=>{let n=t?.chatId===e?null:t;return Kt.current=n,n})}function fn(e,t){Gt(n=>{let r=n?.chatId===e&&n.requestId===t?null:n;return Kt.current=r,r})}function pn(e,r={}){let i=new URLSearchParams(n.current);e(i),n.current=i,t(i,{replace:r.replace??!1})}function mn(e,t={}){e.clearFileQuery&&fe(null),pn(t=>{`projectId`in e&&(q_(t,F_.project,e.projectId??null),Y_(t,e.projectId??null)),`chatId`in e&&q_(t,F_.chat,e.chatId??null),e.clearFileQuery&&t.delete(F_.fileQuery)},t)}function hn(e,t,n={}){pn(n=>{q_(n,e,t)},n)}function gn(e){let t=e.trim()?e:null;if(!t){fe(null),hn(F_.fileQuery,null,{replace:!0});return}if(!Xg(t)){fe({query:e,workspaceSelectionKey:a}),hn(F_.fileQuery,null,{replace:!0});return}fe(null),hn(F_.fileQuery,t,{replace:!0})}function _n(){let e=n.current;return K_(W_(e,F_.project),W_(e,F_.chat))}let H=(0,L.useMemo)(()=>Zg(Object.values(h).flat(),i,r),[h,r,i]),vn=!i||!!H,yn=!!H,bn=H?.id??null,U=H?.projectId??r;B.current=i,kt.current=U,Nt.current=h,Pt.current=_,Ft.current=y,me.current=pe;let xn=(0,L.useMemo)(()=>p.find(e=>e.id===U)??null,[p,U]),Sn=U&&!i?y[U]??null:null,Cn=!!(U&&st.has(U)),wn=(0,L.useMemo)(()=>Sn?.available?Sn.targets.find(e=>e.number===lt)??null:null,[lt,Sn]),Tn=!!(U&&h[U]!==void 0&&_[U]!==void 0),En=!!(U&&n_(_[U]??[],i)),Dn=!!H?.activeTurnId,On=H?.status===`archived`,kn=H?.status===`running`&&Dn,An=(0,L.useMemo)(()=>F.find(e=>e.id===s)??F.find(e=>e.isDefault)??F[0]??null,[F,s]),jn=(0,L.useMemo)(()=>i_(An),[An]),Mn=a_(An),Nn=l===`fast`&&Mn,Pn=(0,L.useMemo)(()=>se.filter(e=>e.enabled&&le.has(e.path)),[le,se]),Fn=be.length>0||Pn.length>0;zt.current=ae,Bt.current=Fn;let In=!!xn&&!i&&!!ae.trim(),Ln=yn&&!On&&!!(ae.trim()||Fn)||In,Rn=Dn?kn?`steer`:`queue`:`send`,zn=ht||On||!!(i&&xt===i)||$t.isPending||en.isPending||!!(i&&Ht.current.has(i)),Bn=Ln&&!zn&&(Rn!==`steer`||kn),Vn=yn&&!On&&Ln&&!zn,Hn=Dn&&!yt&&!!H?.activeTurnId,Un=!yn||zn,Wn=cv(Rn),Gn=_t===Rn?lv(_t):Wn,Kn=(0,L.useMemo)(()=>F.map(e=>({value:e.id,label:e.displayName,description:e.description||e.model,keywords:[e.model]})),[F]),qn=(0,L.useMemo)(()=>[{value:`auto`,label:`Auto`,description:An?.defaultReasoningEffort?`Default: ${An.defaultReasoningEffort}`:`Use model default`},...jn.map(e=>({value:e,label:sv(e)}))],[An,jn]),Jn=(0,L.useMemo)(()=>se.filter(e=>e.enabled&&!le.has(e.path)).map(e=>({value:e.path,label:e.displayName,description:e.shortDescription??e.description,keywords:[e.name]})),[le,se]),Yn=(0,L.useMemo)(()=>ve.filter(e=>!be.some(t=>t.path===e.path)).map(e=>({value:e.path,label:e.relativePath,description:e.root,keywords:[e.name]})),[ve,be]),Xn=(0,L.useMemo)(()=>j?p.find(e=>e.id===j)??null:null,[j,p]),Zn=(0,L.useMemo)(()=>j?h[j]??[]:[],[h,j]),Qn=(0,L.useMemo)(()=>Zn.find(e=>e.status===`running`||e.status===`waitingForApproval`||!!e.activeTurnId||!!e.hasQueuedMessages||!!e.isDrainingQueuedMessages||Ht.current.has(e.id))??null,[Zn]),$n=(0,L.useMemo)(()=>M?p.find(e=>e.id===M.projectId)??null:null,[M,p]),er=(0,L.useMemo)(()=>M?(_[M.projectId]??[]).find(e=>e.path===M.worktreePath)??null:null,[M,_]),tr=!!(M?.forceRequired||er&&!er.isClean),nr=(0,L.useMemo)(()=>{if(!U)return null;let e=_[U]??[];return H?e.find(e=>e.path===H.worktreePath)??null:null},[H,U,_]),rr=(0,L.useMemo)(()=>{let e={};for(let[t,n]of Object.entries(h)){let r=new Map;for(let e of n){let t=r.get(e.worktreePath)??[];t.push(e),r.set(e.worktreePath,t)}for(let[e,t]of r)r.set(e,t_(t));e[t]=r}return e},[h]),ir=(0,L.useMemo)(()=>!U||!nr?[]:rr[U]?.get(nr.path)??[],[rr,U,nr]),ar=(0,L.useMemo)(()=>C.filter(e=>e.role!==`event`||l_(e)),[C]),or=Je&&p.length===0,sr=!!i&&tt&&ar.length===0;(0,L.useEffect)(()=>{dr(),fr(),V.fetchQuery(js()).then(()=>Ce(`Ready`)).catch(e=>Ce(e.message))},[]),(0,L.useEffect)(()=>{u&&!Xg(u)&&hn(F_.fileQuery,null,{replace:!0})},[u]),(0,L.useEffect)(()=>{U&&(mr(U,{updateSelection:vn}),hr(U,{updateSelection:vn}))},[vn,U]),(0,L.useEffect)(()=>{ut(null),!(!U||i)&&gr(U)},[U,i]),(0,L.useEffect)(()=>{lt===null||!Sn?.available||Sn.targets.some(e=>e.number===lt)||ut(null)},[lt,Sn]),(0,L.useEffect)(()=>{if(At.current+=1,Tt.current=!0,Ot.current=null,De(null),ke(null),Ue(null),Dt.current!==null&&(cancelAnimationFrame(Dt.current),Dt.current=null),gt(!!(i&&Ht.current.has(i))),vt(i?Ut.current.get(i)??null:null),!vn){w([]),E(null),un(null),xe([]),ue(new Set),ye([]),ce([]),nt(!1),it(!1),ot(!1);return}if(!i){w([]),E(null),un(null),xe([]),ue(new Set),ye([]),ce([]),nt(!1),it(!1),ot(!1);return}xe([]),ue(new Set),ye([]),ce([]),w([]),E(null),Ue(null),un(null);let e=new AbortController;br(i,{showLoading:!0}),vr(i),pr(i,e.signal);let t=new EventSource(gs(`/chats/${encodeURIComponent(i)}/events`)),n=e=>{let t=JSON.parse(e.data);if(t.type===`agent.approval.requested`){let e=t.data;_e.current+=1,un({...e,chatId:i}),V.invalidateQueries({queryKey:q.chatApproval(i)})}t.type===`agent.approval.resolved`&&(_e.current+=1,dn(i),V.invalidateQueries({queryKey:q.chatApproval(i)})),V.invalidateQueries({queryKey:q.messages(i)}),V.invalidateQueries({queryKey:q.chat(i)}),br(i,{preserveStreamOrder:M_.has(t.type)}),vr(i),U&&(V.invalidateQueries({queryKey:q.projectChats(U)}),hr(U))};for(let e of j_)t.addEventListener(e,n);return t.onopen=()=>{yr(i,e.signal)},t.onerror=()=>Ce(`Event stream disconnected`),()=>{xr(i),e.abort();for(let e of j_)t.removeEventListener(e,n);t.close()}},[vn,i,U]),(0,L.useLayoutEffect)(()=>{if(!i||T!==i)return;let e=wt.current;if(e){if(Ot.current!==i){let t=Q_(i),n=!t||t.pinnedToBottom;Et.current=!0,e.scrollTop=n?e.scrollHeight:t.top,Ot.current=i,Tt.current=n||ev(e);return}Tt.current&&(Et.current=!0,e.scrollTop=e.scrollHeight)}},[T,i,ar]),(0,L.useEffect)(()=>()=>{Dt.current!==null&&(cancelAnimationFrame(Dt.current),Dt.current=null);let e=B.current;e&&xr(e)},[]),(0,L.useEffect)(()=>{s&&F.length>0&&!F.some(e=>e.id===s)&&hn(F_.model,null,{replace:!0})},[F,s]),(0,L.useEffect)(()=>{if(!c||c===`auto`){c===`auto`&&hn(F_.effort,null,{replace:!0});return}F.length===0||!An||jn.includes(c)||hn(F_.effort,null,{replace:!0})},[F.length,c,An,jn]),(0,L.useEffect)(()=>{l&&(l!==`fast`||An&&!Mn)&&hn(F_.serviceTier,null,{replace:!0})},[An,Mn,l]),(0,L.useEffect)(()=>{let e=he.current+1;if(he.current=e,!bn||!pe.trim()){ye([]),je(null),ot(!1);return}let t=new AbortController,n=pe.trim();je(null),ot(!0);let r=setTimeout(()=>{V.fetchQuery(Vs(bn,n,t.signal)).then(n=>{t.signal.aborted||he.current!==e||(ye(n.files),je(null))}).catch(n=>{n.name!==`AbortError`&&!t.signal.aborted&&he.current===e&&je(U_(`Could not search files`,n))}).finally(()=>{!t.signal.aborted&&he.current===e&&ot(!1)})},160);return()=>{clearTimeout(r),t.abort()}},[pe,bn]),(0,L.useEffect)(()=>{!vn||ir.length===0||ir.some(e=>e.id===i)||mn({chatId:ir[0]?.id??null,clearFileQuery:!!pe.trim()},{replace:!0})},[pe,vn,i,ir]),(0,L.useEffect)(()=>{!i||vn||En||!U||!Tn||mn({chatId:B_(U,_)?.chatId??null,clearFileQuery:!!pe.trim()},{replace:!0})},[pe,Tn,En,vn,i,U,_]);function cr(e,t){Ze(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})}function lr(e,t){$e(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})}function ur(e,t){ct(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})}async function dr(){let e=o.current;Ye(!0);try{let t=await V.fetchQuery(Ms());m(t.projects),Te(null);let n=new Set(t.projects.map(e=>e.id)),r=$g(Nt.current,n),i=$g(Pt.current,n),a=Object.fromEntries(Object.entries(Ft.current).filter(([e])=>n.has(e)));if(Nt.current=r,Pt.current=i,Ft.current=a,g(r),v(i),b(a),o.current!==e)return!0;let s=B.current,c=kt.current,l=me.current,u=Qg(r,t.projects,s,c),d=u?.projectId??(c&&t.projects.some(e=>e.id===c)?c:t.projects[0]?.id??null),f=c===d?s:null,p=u?.id??f;mn({projectId:d,chatId:p,clearFileQuery:!!l.trim()&&s!==p},{replace:!0});for(let e of t.projects)mr(e.id,{updateSelection:e.id===d}),hr(e.id,{updateSelection:e.id===d});return!0}catch(e){return Te(U_(`Could not load projects`,e)),!1}finally{Ye(!1)}}async function fr(){et(!0);try{I((await V.fetchQuery(Ns())).models),Ne(null)}catch(e){Ne(U_(`Could not load models`,e))}finally{et(!1)}}async function pr(e,t){it(!0);try{let n=await V.fetchQuery(Bs(e,t));if(t?.aborted)return;ce(n.skills)}catch(e){if(t?.aborted||e instanceof Error&&e.name===`AbortError`)return;ke(U_(`Could not load skills`,e))}finally{t?.aborted||it(!1)}}async function mr(e,t={}){let n=o.current;cr(e,!0);try{let r=e_((await V.fetchQuery(Ps(e))).worktrees,Nt.current[e]??[]),i={...Pt.current,[e]:r};if(Pt.current=i,v(i),t.updateSelection===!1||kt.current!==e||o.current!==n)return!0;let a=B_(e,i),s=B.current,c=me.current,l=r_(Nt.current[e],r,s,a?.chatId??null);return mn({projectId:e,chatId:l,clearFileQuery:!!c.trim()&&s!==l},{replace:!0}),!0}catch(e){return Te(U_(`Could not load worktrees`,e)),!1}finally{cr(e,!1)}}async function hr(e,t={}){let n=o.current;lr(e,!0);try{let r=await V.fetchQuery(Fs(e)),i={...Nt.current,[e]:r.chats};Nt.current=i,g(i);let a=e_(Pt.current[e]??[],r.chats),s={...Pt.current,[e]:a};if(Pt.current=s,v(s),t.updateSelection===!1||kt.current!==e||o.current!==n)return!0;let c=B_(e,s),l=B.current,u=me.current,d=r.chats.some(e=>e.id===l)?l:l?c?.chatId??r.chats[0]?.id??null:null;return mn({projectId:e,chatId:d,clearFileQuery:!!u.trim()&&l!==d},{replace:!0}),!0}catch(e){return Te(U_(`Could not load chats`,e)),!1}finally{lr(e,!1)}}async function gr(e){ur(e,!0);try{let t=await V.fetchQuery(Is(e)),n={...Ft.current,[e]:t.github};Ft.current=n,b(n)}catch{let t={...Ft.current,[e]:{available:!1,targets:[]}};Ft.current=t,b(t)}finally{ur(e,!1)}}function _r(e){let t=Nt.current[e.projectId]??[],n=t.some(t=>t.id===e.id)?t.map(t=>t.id===e.id?e:t):[e,...t],r={...Nt.current,[e.projectId]:n};Nt.current=r,g(r);let i=Pt.current[e.projectId]??[],a={...Pt.current,[e.projectId]:e_(i,n)};Pt.current=a,v(a)}async function vr(e){_r((await V.fetchQuery(Ls(e))).chat)}async function yr(e,t){let n=ge.current+1;ge.current=n;let r=_e.current;try{let i=await V.fetchQuery(Rs(e,t));B.current===e&&ge.current===n&&_e.current===r&&un(i.approval?{...i.approval,chatId:e}:null)}catch(r){if(t?.aborted||r instanceof Error&&r.name===`AbortError`)return;B.current===e&&ge.current===n&&ln(U_(`Could not load approval`,r))}}async function br(e,t={}){let n=It.current+1;It.current=n,t.showLoading&&nt(!0);try{let r=await V.fetchQuery(zs(e));if(B.current===e&&It.current===n){let n=t.preserveStreamOrder===!0&&D.current===e;w(e=>n?T_(e,r.messages):r.messages),E(e),De(null)}}catch(t){B.current===e&&It.current===n&&De(U_(`Could not load messages`,t))}finally{t.showLoading&&B.current===e&&nt(!1)}}function xr(e){let t=wt.current;!t||Ot.current!==e||$_(e,t)}function Sr(){let e=B.current,t=wt.current;if(!(!e||!t||Ot.current!==e)){if(Tt.current=ev(t),Et.current){Et.current=!1;return}Dt.current===null&&(Dt.current=requestAnimationFrame(()=>{Dt.current=null,B.current===e&&Ot.current===e&&xr(e)}))}}function Cr(){Fe(null),k(!0)}function wr(){k(!1),Fe(null)}async function Tr(e){e.preventDefault();let t=A.trim();if(!t)return;Fe(null);let n=o.current;qe(!0);try{let e=await qt.mutateAsync(t);if(V.invalidateQueries({queryKey:q.projects}),ee(``),wr(),!await dr()||o.current!==n)return;mn({projectId:e.project.id,chatId:null})}catch(e){Fe(U_(`Could not add project`,e))}finally{qe(!1)}}function Er(e){Le(null),te(e.id)}function Dr(){te(null),Le(null)}async function Or(e){if(e.preventDefault(),!Xn||Qn)return;Le(null),qe(!0);let t=Xn.id,n=(Nt.current[t]??[]).map(e=>e.id),r=kt.current===t;try{await Jt.mutateAsync(t),V.removeQueries({exact:!0,queryKey:q.projects}),V.removeQueries({queryKey:q.projectWorktrees(t)}),V.removeQueries({queryKey:q.projectChats(t)});for(let e of n)V.removeQueries({queryKey:q.chat(e)});S(e=>{let n=new Set;for(let r of e)r.startsWith(`${t}:`)||n.add(r);return n}),r&&(oe(``),xe([]),ue(new Set),fe(null),ye([]),ce([]),un(null),Vt.current=null),Dr(),await dr()}catch(e){Le(U_(`Could not delete project`,e))}finally{qe(!1)}}async function kr(e,t,n={}){let r=await Yt.mutateAsync({projectId:e,input:n});return V.invalidateQueries({queryKey:q.projectWorktrees(e)}),V.invalidateQueries({queryKey:q.projectChats(e)}),V.invalidateQueries({queryKey:q.projectGitHubCheckoutTargets(e)}),S(t=>new Set(t).add(V_(e,r.chat.worktreePath))),!await mr(e,{updateSelection:!1})||!await hr(e,{updateSelection:!1})?null:_n()===t?(mn({projectId:e,chatId:r.chat.id,clearFileQuery:!0}),kt.current=e,B.current=r.chat.id,r.chat):r.chat}async function Ar(e,t){if(Ke||Ct.current)return null;Te(null);let n=o.current,r=t?V_(e,t.path):null;Ct.current=!0,r?mt(r):ft(e),qe(!0);try{return await kr(e,n,t?{worktreeName:t.name,worktreePath:t.path}:{})}catch(e){return ln(U_(`Could not create worktree`,e)),null}finally{Ct.current=!1,ft(null),mt(null),qe(!1)}}function jr(e,t){Mr(e,t)}function Mr(e,t){Be(null),P(`default`),ie(!1),ne({forceRequired:!t.isClean,projectId:e,worktreePath:t.path})}function Nr(){ne(null),Be(null),P(`default`),ie(!1)}async function Pr(e,t,n){Be(null),qe(!0);try{let r={name:t.name,path:t.path,force:n.force};n.branchMode===`keep`&&(r.keepBranch=!0),n.branchMode===`delete`&&(r.keepBranch=!1),await Xt.mutateAsync({projectId:e,input:r}),V.invalidateQueries({queryKey:q.projectWorktrees(e)}),V.invalidateQueries({queryKey:q.projectChats(e)}),Nr(),await mr(e,{updateSelection:kt.current===e}),await hr(e,{updateSelection:kt.current===e})}catch(r){let i=r instanceof Error?r.message:String(r),a=!n.force&&i.includes(`has uncommitted changes`);a&&(P(n.branchMode),ie(!1),ne({forceRequired:!0,projectId:e,worktreePath:t.path})),M||a?Be(U_(`Could not delete worktree`,i)):ln(U_(`Could not delete worktree`,i))}finally{qe(!1)}}async function Fr(e){e.preventDefault(),!(!M||!er)&&await Pr(M.projectId,er,{branchMode:N,force:re})}async function Ir(e,t){if(!Ke){Te(null),qe(!0);try{await Zt.mutateAsync({projectId:e,input:{name:t.name,path:t.path}}),V.invalidateQueries({queryKey:q.projectWorktrees(e)}),V.invalidateQueries({queryKey:q.projectChats(e)}),await mr(e,{updateSelection:kt.current===e}),await hr(e,{updateSelection:kt.current===e})}catch(e){ln(U_(`Could not sync branch`,e))}finally{qe(!1)}}}async function Lr(e,t){if(Ke||on.isPending||t&&!L_(e))return;let n=B.current===e.id&&Vt.current?.chatId===e.id&&!!(zt.current.trim()||Bt.current),r=B.current===e.id&&!!(zt.current.trim()||Bt.current);if(t&&(r||n)){ke(`Clear or send the current message before archiving this chat`),Rt.current?.focus();return}ke(null),qe(!0),St(e.id);try{_r((await on.mutateAsync({chatId:e.id,archived:t})).chat),V.invalidateQueries({queryKey:q.chat(e.id)}),V.invalidateQueries({queryKey:q.projectChats(e.projectId)}),V.invalidateQueries({queryKey:q.projectWorktrees(e.projectId)}),B.current===e.id&&t&&(Vt.current=null,oe(``),xe([]),ue(new Set)),await hr(e.projectId,{updateSelection:!1}),await mr(e.projectId,{updateSelection:!1})}catch(e){ke(U_(t?`Could not archive chat`:`Could not restore chat`,e))}finally{St(null),qe(!1)}}function Rr(){!U||!nr||Ar(U,nr)}function zr(){!U||!nr||!nr.isManagedByPhantom||Mr(U,nr)}async function Br(e){e.preventDefault(),await Ur(`send`)}function Vr(e,t){let n=An?.id??An?.model??t?.model??void 0,r=An?c&&jn.includes(c)?c:null:t?.effort??null,i=o_(An,l,t?.serviceTier??null);return{effort:r,files:be.map(e=>({name:e.relativePath,path:e.path})),model:n,serviceTier:i,skills:s_(se,le),text:e}}async function Hr(e,t,n,r,i){let a=null,o=()=>_n()===r,s=()=>a!==null&&_n()===K_(e,a);Ct.current=!0,ft(e),qe(!0);try{let c=await kr(e,r,{githubTargetNumber:i??void 0,initialMessage:t.text,serviceTier:t.serviceTier});if(!c){o()&&oe(n);return}a=c.id,Ht.current.add(c.id),Ut.current.set(c.id,`send`),_r((await Qt.mutateAsync({chatId:c.id,input:t})).chat),V.invalidateQueries({queryKey:q.messages(c.id)}),V.invalidateQueries({queryKey:q.chat(c.id)}),s()&&(xe([]),ue(new Set),ut(null),gn(``),await br(c.id))}catch(e){(a?s():o())&&(oe(n),ke(U_(`Could not send message`,e)))}finally{a&&(Ht.current.delete(a),Ut.current.delete(a)),Ct.current=!1,ft(null),qe(!1)}}async function Ur(e){let t=bn;if(!t&&(!U||e!==`send`)||!Ln||zn||!t&&U&&(Ke||Ct.current)||e===`steer`&&!H?.activeTurnId)return;ke(null);let n=At.current,r=Lt.current+1;Lt.current=r;let i=()=>t!==null&&B.current===t&&At.current===n&&Lt.current===r,a=ae,s=a.trim().length>0?a:uv({hasFiles:be.length>0,hasSkills:Pn.length>0});oe(``);let c=Vr(s,t&&Vt.current?.chatId===t?Vt.current:null);if(!t){if(!U)return;gt(!0),vt(`send`),await Hr(U,c,a,o.current,wn?.number??null),gt(!1),vt(null);return}Ht.current.add(t),Ut.current.set(t,e),gt(!0),vt(e);try{if(await(e===`steer`?tn:e===`queue`?nn:Qt).mutateAsync({chatId:t,input:c}),V.invalidateQueries({queryKey:q.messages(t)}),Vt.current?.chatId===t&&(Vt.current=null),!i())return;xe([]),ue(new Set),gn(``),await br(t)}catch(e){if(!i())return;oe(a),ke(U_(`Could not send message`,e))}finally{Ht.current.delete(t),Ut.current.delete(t),(i()||B.current===t)&&(gt(!1),vt(Ut.current.get(t)??null))}}async function Wr(e){if(!i||e.chatId!==i)return null;let t=i;try{let n=await $t.mutateAsync({chatId:t,messageId:e.id});return V.invalidateQueries({queryKey:q.messages(t)}),await br(t),n}catch(e){return ln(U_(`Could not delete pending message`,e)),null}}async function Gr(e){if(ae.trim()||Fn){ke(`Clear the current message before editing a pending message`),Rt.current?.focus();return}let t=await Wr(e);if(t){if(!(B.current===t.message.chatId&&!zt.current.trim()&&!Bt.current)){let e=t.message.chatId;try{await en.mutateAsync({chatId:e,input:t}),V.invalidateQueries({queryKey:q.messages(e)}),B.current===e&&await br(e),ln(`Pending message was restored to the queue because the composer changed before editing completed`,`warning`)}catch(e){ln(`Pending message was deleted but could not be restored: ${H_(e)}`)}return}Vt.current={chatId:t.message.chatId,effort:t.queuedMessage.effort??null,model:t.queuedMessage.model??null,serviceTier:t.queuedMessage.serviceTier??null},oe(t.message.text),xe((t.queuedMessage.files??[]).map(Pv)),ue(new Set((t.queuedMessage.skills??[]).map(e=>e.path))),hn(F_.model,t.queuedMessage.model??null),hn(F_.effort,t.queuedMessage.effort??null),hn(F_.serviceTier,t.queuedMessage.serviceTier??null),requestAnimationFrame(()=>{Rt.current?.focus()})}}function Kr(e){let t=Ug({altKey:e.altKey,code:e.code,ctrlKey:e.ctrlKey,isComposing:e.nativeEvent.isComposing,key:e.key,keyCode:e.keyCode,metaKey:e.metaKey,shiftKey:e.shiftKey});if(!t||!bn&&!U||!Ln||ht)return;let n=Wg(t,H);if(!(!n||!bn&&n!==`send`)){if(e.preventDefault(),n===`send`){e.currentTarget.form?.requestSubmit();return}Ur(n)}}async function qr(){if(i){bt(!0);try{await rn.mutateAsync(i),V.invalidateQueries({queryKey:q.chat(i)})}catch(e){ln(U_(`Could not stop turn`,e))}finally{bt(!1)}}}async function Jr(e){if(!i||!Wt||Wt.chatId!==i)return;let t=Wt.chatId,n=Wt,r=()=>B.current===t&&Kt.current?.requestId===n.requestId;Ue(null);try{if(e!==`accept`&&e!==`acceptForSession`&&e!==`decline`&&e!==`cancel`)throw Error(`Approval decision is invalid`);await an.mutateAsync({chatId:t,decision:e,requestId:n.requestId}),_e.current+=1,V.invalidateQueries({queryKey:q.chatApproval(t)}),V.invalidateQueries({queryKey:q.chat(t)}),fn(t,n.requestId)}catch(e){r()&&Ue(U_(`Could not answer approval`,e))}}function Yr(e){pn(t=>{let n=G_(t,F_.expandedProject);n.has(e)?n.delete(e):n.add(e),J_(t,F_.expandedProject,n)})}function Xr(e){Vt.current=null,oe(``),xe([]),ue(new Set),ye([]),ce([]),mn({projectId:e,chatId:null,clearFileQuery:!0})}function Zr(e,t){let n=V_(e,t);S(e=>{let t=new Set(e);return t.has(n)?t.delete(n):t.add(n),t})}function Qr(e,t){if(!t.chatId){Ar(e,t);return}mn({projectId:e,chatId:t.chatId,clearFileQuery:!0})}function $r(e,t,n){mn({projectId:e,chatId:n,clearFileQuery:!0}),S(n=>new Set(n).add(V_(e,t.path)))}function ei(e){let t=ve.find(t=>t.path===e);t&&(xe(e=>e.some(e=>e.path===t.path)?e:[...e,t]),gn(``))}function ti(e){ue(t=>new Set(t).add(e))}let ni=Wt?.chatId===i?Wt:null;return(0,R.jsxs)(wg,{className:`app-shell`,children:[(0,R.jsxs)(Tg,{collapsible:`offcanvas`,variant:`inset`,children:[(0,R.jsxs)(Eg,{children:[(0,R.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-[var(--radius-sm)] bg-[var(--brand-mark-bg)] text-[var(--brand-mark-fg)]`,children:(0,R.jsx)(Co,{className:`size-4`})}),(0,R.jsx)(`div`,{className:`min-w-0 flex-1 group-data-[state=collapsed]/sidebar:hidden`,children:(0,R.jsx)(`h1`,{className:`truncate text-[length:var(--font-size-lg)] font-semibold leading-tight`,children:`Phantom`})}),(0,R.jsxs)(Zs,{className:`max-w-28 truncate group-data-[state=collapsed]/sidebar:hidden`,variant:Se===`Ready`?`success`:`warning`,children:[Se!==`Ready`&&(0,R.jsx)(Go,{className:`size-3`}),Se]})]}),(0,R.jsx)(Ag,{children:(0,R.jsxs)(jg,{children:[(0,R.jsxs)(Mg,{children:[(0,R.jsx)(Ng,{children:`Projects`}),(0,R.jsx)(Pg,{"aria-label":`Add project`,onClick:Cr,title:`Add project`,children:(0,R.jsx)(No,{className:`size-4`})})]}),(0,R.jsxs)(Fg,{children:[we&&(0,R.jsx)(fv,{className:`mx-2 mb-2 group-data-[state=collapsed]/sidebar:hidden`,message:we,onDismiss:()=>Te(null)}),(0,R.jsx)(Ig,{children:or?(0,R.jsx)(`li`,{className:`px-2 py-1 group-data-[state=collapsed]/sidebar:hidden`,children:(0,R.jsx)(Yo,{})}):p.length===0?(0,R.jsx)(`li`,{className:`px-2 py-4 group-data-[state=collapsed]/sidebar:hidden`,children:(0,R.jsx)(`div`,{className:`rounded-[var(--radius-md)] border border-dashed border-sidebar-border bg-[var(--surface-card)] px-3 py-3 text-[length:var(--font-size-sm)] text-muted-foreground`,children:`Add a Git project to begin.`})}):p.map(e=>{let t=f.has(e.id),n=_[e.id]??[],r=Xe.has(e.id)&&_[e.id]===void 0;return(0,R.jsxs)(Lg,{children:[(0,R.jsxs)(`div`,{className:`group/project flex items-center gap-0.5 rounded-[var(--radius-sm)]`,children:[(0,R.jsx)(`button`,{"aria-expanded":t,"aria-label":`${t?`Collapse`:`Expand`} ${e.name}`,className:`inline-flex size-7 shrink-0 items-center justify-center rounded-[var(--radius-sm)] text-[var(--icon-color-default)] outline-none transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:shadow-[var(--state-focus-ring)] group-data-[state=collapsed]/sidebar:hidden`,onClick:()=>Yr(e.id),title:t?`Collapse`:`Expand`,type:`button`,children:(0,R.jsx)(mo,{className:K(`size-4 transition-transform duration-[var(--motion-duration-fast)]`,t&&`rotate-90`)})}),(0,R.jsxs)(Rg,{className:`min-h-8 flex-1 group-data-[state=collapsed]/sidebar:flex-none`,isActive:U===e.id&&!H,onClick:()=>Xr(e.id),title:e.name,type:`button`,children:[(0,R.jsx)(Co,{className:`size-4 text-[var(--icon-color-default)]`}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 group-data-[state=collapsed]/sidebar:hidden`,children:(0,R.jsx)(`span`,{className:`block truncate font-medium`,children:e.name})})]}),(0,R.jsx)(J,{"aria-label":`Create worktree in ${e.name}`,className:`size-7 text-[var(--icon-color-default)] group-data-[state=collapsed]/sidebar:hidden`,disabled:Ke,onClick:()=>void Ar(e.id),size:`icon`,title:`Create worktree`,type:`button`,variant:`ghost`,children:dt===e.id?(0,R.jsx)(Go,{className:`size-4`}):(0,R.jsx)(ko,{className:`size-4`})}),(0,R.jsxs)(gg,{children:[(0,R.jsx)(_g,{asChild:!0,children:(0,R.jsx)(J,{"aria-label":`Open actions for ${e.name}`,className:K(`mr-1 size-7 text-[var(--icon-color-default)] opacity-100 data-[state=open]:opacity-100 group-data-[state=collapsed]/sidebar:hidden sm:opacity-0 sm:group-focus-within/project:opacity-100 sm:group-hover/project:opacity-100`,U===e.id&&`sm:opacity-100`),disabled:Ke,size:`icon`,title:`Project actions`,type:`button`,variant:`ghost`,children:(0,R.jsx)(bo,{className:`size-4`})})}),(0,R.jsx)(vg,{align:`end`,children:(0,R.jsxs)(yg,{disabled:Ke,onSelect:()=>Er(e),variant:`destructive`,children:[(0,R.jsx)(Bo,{className:`size-4`}),(0,R.jsx)(`span`,{children:`Delete project`})]})})]})]}),t&&(0,R.jsx)(zg,{children:r?(0,R.jsx)(`li`,{className:`px-2 py-1.5`,children:(0,R.jsx)(Xo,{})}):n.length===0?(0,R.jsx)(`li`,{className:`px-2 py-1.5 text-[length:var(--font-size-xs)] text-[var(--text-tertiary)]`,children:`No worktrees`}):n.map(t=>{let n=U===e.id&&nr?.path===t.path,r=rr[e.id]?.get(t.path)??[],a=r.find(e=>e.status===`running`||e.status===`waitingForApproval`||!!e.activeTurnId)??null,o=ht&&H?.projectId===e.id&&H.worktreePath===t.path,s=o?`Sending message`:a?I_[a.status].label:null,c=V_(e.id,t.path),l=pt===c,u=x.has(c),d=Qe.has(e.id)&&r.length===0,f=`${t.name} (${t.path})${t.isClean?``:` [dirty]`}${t.isMainWorktree?` [main worktree]`:``}${s?` [${s}]`:``}`,p=t.isManagedByPhantom,m=p||!!t.path;return(0,R.jsxs)(Bg,{children:[(0,R.jsxs)(`div`,{className:`group/worktree flex items-center gap-0.5 rounded-[var(--radius-sm)]`,children:[(0,R.jsx)(`button`,{"aria-expanded":u,"aria-label":`${u?`Collapse`:`Expand`} chats for ${t.name}`,className:`inline-flex size-7 shrink-0 items-center justify-center rounded-[var(--radius-sm)] text-[var(--icon-color-default)] outline-none transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:shadow-[var(--state-focus-ring)]`,onClick:()=>Zr(e.id,t.path),title:u?`Collapse chats`:`Expand chats`,type:`button`,children:(0,R.jsx)(mo,{className:K(`size-3.5 transition-transform duration-[var(--motion-duration-fast)]`,u&&`rotate-90`)})}),(0,R.jsxs)(Vg,{className:`flex-1`,disabled:!t.chatId&&Ke,isActive:n,onClick:()=>Qr(e.id,t),title:f,type:`button`,children:[t.isMainWorktree?(0,R.jsx)(Co,{className:`size-3.5 text-[var(--icon-color-default)]`}):(0,R.jsx)(wo,{className:`size-3.5 text-[var(--icon-color-default)]`}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,R.jsx)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:(0,R.jsx)(`span`,{className:`block min-w-0 truncate font-medium`,children:t.name})})}),!t.isClean&&(0,R.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-[var(--semantic-warning-fg)]`}),s&&(0,R.jsx)(rv,{label:s,status:o?`running`:a?.status??`running`})]}),(0,R.jsx)(J,{"aria-label":`Start new chat in ${t.name}`,className:K(`size-7 text-[var(--icon-color-default)] opacity-100 sm:opacity-0 sm:group-focus-within/worktree:opacity-100 sm:group-hover/worktree:opacity-100`,(n||l)&&`sm:opacity-100`),disabled:Ke,onClick:()=>void Ar(e.id,t),size:`icon`,title:`New chat`,type:`button`,variant:`ghost`,children:l?(0,R.jsx)(Go,{className:`size-4`}):(0,R.jsx)(ko,{className:`size-4`})}),m&&(0,R.jsxs)(gg,{children:[(0,R.jsx)(_g,{asChild:!0,children:(0,R.jsx)(J,{"aria-label":`Open actions for ${t.name}`,className:K(`mr-1 size-7 text-[var(--icon-color-default)] opacity-100 data-[state=open]:opacity-100 sm:opacity-0 sm:group-focus-within/worktree:opacity-100 sm:group-hover/worktree:opacity-100`,n&&`sm:opacity-100`),disabled:Ke,size:`icon`,title:`Worktree actions`,type:`button`,variant:`ghost`,children:(0,R.jsx)(bo,{className:`size-4`})})}),(0,R.jsxs)(vg,{align:`end`,children:[(0,R.jsxs)(yg,{disabled:Ke,onSelect:()=>void Ir(e.id,t),children:[(0,R.jsx)(Po,{className:`size-4`}),(0,R.jsx)(`span`,{children:`Sync branch`})]}),p&&(0,R.jsxs)(yg,{disabled:Ke,onSelect:()=>void jr(e.id,t),variant:`destructive`,children:[(0,R.jsx)(Bo,{className:`size-4`}),(0,R.jsx)(`span`,{children:`Delete worktree`})]})]})]})]}),u&&(0,R.jsx)(nv,{chats:r,isLoading:d,selectedChatId:i,onSelectChat:n=>$r(e.id,t,n),onSetChatArchived:(e,t)=>void Lr(e,t)})]},t.path)})})]},e.id)})})]})]})}),(0,R.jsx)(kg,{})]}),(0,R.jsx)(dc,{open:O,onOpenChange:e=>{e?Cr():wr()},children:(0,R.jsxs)(fc,{"aria-labelledby":`add-project-title`,children:[(0,R.jsxs)(pc,{children:[(0,R.jsx)(mc,{id:`add-project-title`,children:`Add project`}),(0,R.jsx)(hc,{children:`Add a local Git project to the Phantom sidebar.`})]}),(0,R.jsxs)(`form`,{className:`grid gap-4`,onSubmit:Tr,children:[(0,R.jsxs)(`div`,{className:`grid gap-2`,children:[(0,R.jsx)(bg,{htmlFor:`project-path`,children:`Project path`}),(0,R.jsx)(tc,{id:`project-path`,placeholder:`/Users/me/project`,value:A,onChange:e=>ee(e.target.value)})]}),Pe&&(0,R.jsx)(fv,{message:Pe,onDismiss:()=>Fe(null)}),(0,R.jsxs)(gc,{children:[(0,R.jsx)(J,{onClick:wr,type:`button`,variant:`outline`,children:`Cancel`}),(0,R.jsxs)(J,{disabled:Ke||!A.trim(),type:`submit`,children:[Ke&&(0,R.jsx)(Go,{}),`Add project`]})]})]})]})}),(0,R.jsx)(dc,{open:!!j,onOpenChange:e=>{e||Dr()},children:(0,R.jsxs)(fc,{"aria-labelledby":`delete-project-title`,children:[(0,R.jsxs)(pc,{children:[(0,R.jsx)(mc,{id:`delete-project-title`,children:`Delete project`}),(0,R.jsx)(hc,{children:`Remove this project from the Phantom sidebar and delete its Phantom chat history and messages. Local repository files and worktrees are not deleted.`})]}),(0,R.jsxs)(`form`,{className:`grid gap-4`,onSubmit:Or,children:[(0,R.jsxs)(`div`,{className:`grid gap-2 rounded-[var(--radius-sm)] bg-[var(--surface-code)] px-3 py-2`,children:[(0,R.jsx)(`p`,{className:`truncate text-[length:var(--font-size-sm)] font-medium`,children:Xn?.name??`Unknown project`}),Xn&&(0,R.jsx)(`p`,{className:`truncate font-mono text-[length:var(--font-size-xs)] text-muted-foreground`,children:Xn.rootPath})]}),(0,R.jsx)(`p`,{className:`text-[length:var(--font-size-sm)] text-muted-foreground`,children:`Projects with running, approval-blocked, or queued chats cannot be deleted.`}),Qn&&(0,R.jsx)(`div`,{className:`rounded-[var(--radius-sm)] border border-[var(--semantic-warning-border)] bg-[var(--semantic-warning-bg)] px-3 py-2 text-[length:var(--font-size-sm)] text-[var(--semantic-warning-fg)]`,children:`Stop running, approval-blocked, or queued chats before deleting this project.`}),Ie&&(0,R.jsx)(fv,{message:Ie,onDismiss:()=>Le(null)}),(0,R.jsxs)(gc,{children:[(0,R.jsx)(J,{onClick:Dr,type:`button`,variant:`outline`,children:`Cancel`}),(0,R.jsxs)(J,{disabled:Ke||!Xn||!!Qn,type:`submit`,variant:`destructive`,children:[Ke&&(0,R.jsx)(Go,{}),`Delete project`]})]})]})]})}),(0,R.jsx)(dc,{open:!!M,onOpenChange:e=>{e||Nr()},children:(0,R.jsxs)(fc,{"aria-labelledby":`delete-worktree-title`,children:[(0,R.jsxs)(pc,{children:[(0,R.jsx)(mc,{id:`delete-worktree-title`,children:`Delete worktree`}),(0,R.jsxs)(hc,{children:[tr?`This worktree has uncommitted changes. Force deletion is required to remove it from `:`This will remove the worktree and its chat history from `,$n?.name??`the project`,`.`]})]}),(0,R.jsxs)(`form`,{className:`grid gap-4`,onSubmit:Fr,children:[(0,R.jsxs)(`div`,{className:`grid gap-2 rounded-[var(--radius-sm)] bg-[var(--surface-code)] px-3 py-2`,children:[(0,R.jsx)(`p`,{className:`truncate text-[length:var(--font-size-sm)] font-medium`,children:er?.name??`Unknown worktree`}),er&&(0,R.jsx)(`p`,{className:`truncate font-mono text-[length:var(--font-size-xs)] text-muted-foreground`,children:er.path})]}),(0,R.jsxs)(`div`,{className:`grid gap-2`,children:[(0,R.jsx)(bg,{htmlFor:`delete-worktree-branch-mode`,children:`Branch handling`}),(0,R.jsxs)(`select`,{className:`h-9 rounded-[var(--radius-sm)] border border-input bg-[var(--surface-input)] px-3 text-[length:var(--font-size-sm)] shadow-[var(--shadow-xs)] outline-none transition-[border-color,box-shadow] focus-visible:border-ring focus-visible:shadow-[var(--state-focus-ring)] disabled:cursor-not-allowed disabled:opacity-[var(--opacity-disabled)]`,id:`delete-worktree-branch-mode`,onChange:e=>P(e.target.value),value:N,children:[(0,R.jsx)(`option`,{value:`default`,children:`Use project preference`}),(0,R.jsx)(`option`,{value:`keep`,children:`Keep branch`}),(0,R.jsx)(`option`,{value:`delete`,children:`Delete branch`})]})]}),tr&&(0,R.jsxs)(`label`,{className:`flex items-start gap-2 text-[length:var(--font-size-sm)] text-[var(--semantic-danger-fg)]`,children:[(0,R.jsx)(`input`,{checked:re,className:`mt-0.5 size-4 accent-[var(--semantic-danger-fg)]`,onChange:e=>ie(e.target.checked),type:`checkbox`}),(0,R.jsx)(`span`,{children:`Force delete uncommitted changes`})]}),Re&&(0,R.jsx)(fv,{message:Re,onDismiss:()=>Be(null)}),(0,R.jsxs)(gc,{children:[(0,R.jsx)(J,{onClick:Nr,type:`button`,variant:`outline`,children:`Cancel`}),(0,R.jsxs)(J,{disabled:Ke||!er||tr&&!re,type:`submit`,variant:`destructive`,children:[Ke&&(0,R.jsx)(Go,{}),`Delete`]})]})]})]})}),(0,R.jsx)(pv,{toasts:We,onDismiss:cn}),(0,R.jsxs)(Dg,{children:[(0,R.jsxs)(`header`,{className:`flex min-h-[var(--layout-topbar-height)] items-center gap-3 border-b border-border bg-[var(--surface-panel)] px-4`,children:[(0,R.jsx)(Og,{className:`-ml-1`}),(0,R.jsx)(`div`,{className:`h-5 w-px bg-[var(--border-divider)]`}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(`p`,{className:`truncate text-[length:var(--font-size-xl)] font-semibold leading-tight`,children:H?nr?.name??H.worktreeName:xn?`New chat`:`Workspace`}),H&&(0,R.jsx)(iv,{status:H.status})]}),(0,R.jsxs)(`p`,{className:`flex min-w-0 text-[length:var(--font-size-xs)] text-muted-foreground`,children:[(0,R.jsxs)(`span`,{className:`shrink-0`,children:[xn?.name??`No project selected`,nr?` / `:``]}),nr&&(0,R.jsx)(av,{text:nr.path})]})]}),H&&(0,R.jsx)(J,{"aria-label":H.status===`archived`?`Restore chat`:`Archive chat`,className:`size-8 text-[var(--icon-color-default)]`,disabled:Ke||on.isPending||H.status!==`archived`&&!L_(H),onClick:()=>void Lr(H,H.status!==`archived`),size:`icon`,title:H.status===`archived`?`Restore chat`:`Archive chat`,type:`button`,variant:`ghost`,children:on.isPending?(0,R.jsx)(Go,{}):H.status===`archived`?(0,R.jsx)(co,{}):(0,R.jsx)(lo,{})}),nr&&(0,R.jsxs)(gg,{children:[(0,R.jsx)(_g,{asChild:!0,children:(0,R.jsx)(J,{"aria-label":`Open worktree actions for ${nr.name}`,className:`size-8 shrink-0 text-[var(--icon-color-default)]`,disabled:Ke,size:`icon`,title:`Worktree actions`,type:`button`,variant:`ghost`,children:(0,R.jsx)(bo,{className:`size-4`})})}),(0,R.jsxs)(vg,{align:`end`,children:[(0,R.jsxs)(yg,{disabled:Ke,onSelect:Rr,children:[(0,R.jsx)(ko,{className:`size-4`}),(0,R.jsx)(`span`,{children:`New chat`})]}),nr.isManagedByPhantom&&(0,R.jsxs)(yg,{disabled:Ke,onSelect:zr,variant:`destructive`,children:[(0,R.jsx)(Bo,{className:`size-4`}),(0,R.jsx)(`span`,{children:`Delete worktree`})]})]})]})]}),ni&&(0,R.jsx)(`div`,{className:`border-b border-[var(--semantic-warning-border)] bg-[var(--semantic-warning-bg)] px-4 py-3 text-[var(--semantic-warning-fg)]`,children:(0,R.jsxs)(`div`,{className:`mx-auto flex max-w-[var(--layout-max-content-width)] flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsxs)(`p`,{className:`flex items-center gap-2 text-[length:var(--font-size-md)] font-semibold`,children:[(0,R.jsx)(yo,{className:`size-4`}),`Approval requested`]}),(0,R.jsx)(`p`,{className:`mt-1 truncate font-mono text-[length:var(--font-size-xs)]`,children:ni.method}),Ve&&(0,R.jsx)(fv,{className:`mt-2`,message:Ve,onDismiss:()=>Ue(null)})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[(0,R.jsx)(J,{onClick:()=>void Jr(`accept`),size:`sm`,type:`button`,children:`Accept`}),(0,R.jsx)(J,{onClick:()=>void Jr(`acceptForSession`),size:`sm`,type:`button`,variant:`outline`,children:`Accept for session`}),(0,R.jsx)(J,{onClick:()=>void Jr(`decline`),size:`sm`,type:`button`,variant:`outline`,children:`Decline`})]})]})}),(0,R.jsxs)(`section`,{"aria-busy":tt||ht||Dn||!!dt,className:`min-h-0 flex-1 overflow-y-auto px-4 py-4`,ref:wt,onScroll:Sr,children:[Ee&&(0,R.jsx)(`div`,{className:`mx-auto mb-3 max-w-[var(--layout-max-content-width)]`,children:(0,R.jsx)(fv,{message:Ee,onDismiss:()=>De(null)})}),sr?(0,R.jsx)(Zo,{}):ar.length===0?(0,R.jsx)(mv,{githubTargets:Sn,hasChat:!!H,hasWorktree:!!nr,isGitHubTargetsLoading:Cn,selectedProject:xn,selectedGitHubTargetNumber:lt,onOpenProjectDialog:Cr,onSelectGitHubTarget:ut}):(0,R.jsx)(`div`,{className:`mx-auto flex max-w-[var(--layout-max-content-width)] flex-col gap-2`,children:ar.map(e=>(0,R.jsx)(_v,{isPendingActionBusy:$t.isPending,message:e,onDeletePendingMessage:e=>void Wr(e),onEditPendingMessage:e=>void Gr(e)},e.id))})]}),(0,R.jsx)(`form`,{className:`chat-composer border-t border-border bg-[var(--surface-floating)] backdrop-blur`,onSubmit:Br,children:(0,R.jsxs)(`div`,{className:`mx-auto flex max-w-[var(--layout-max-content-width)] flex-col gap-2`,children:[Oe&&(0,R.jsx)(fv,{message:Oe,onDismiss:()=>ke(null)}),Ae&&(0,R.jsx)(fv,{message:Ae,onDismiss:()=>je(null)}),Me&&(0,R.jsx)(fv,{message:Me,onDismiss:()=>Ne(null)}),(be.length>0||Pn.length>0)&&(0,R.jsxs)(`div`,{className:`flex min-h-8 flex-wrap items-center gap-2 px-1`,children:[be.map(e=>(0,R.jsx)(ov,{icon:(0,R.jsx)(So,{className:`size-3.5`}),label:e.relativePath,onRemove:()=>xe(t=>t.filter(t=>t.path!==e.path))},e.path)),Pn.map(e=>(0,R.jsx)(ov,{icon:(0,R.jsx)(Lo,{className:`size-3.5`}),label:e.displayName,onRemove:()=>ue(t=>{let n=new Set(t);return n.delete(e.path),n})},e.path))]}),(0,R.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(bg,{className:`sr-only`,htmlFor:`composer`,children:`Message`}),(0,R.jsx)(Hg,{className:`min-h-12 border-0 bg-transparent px-2 py-2 shadow-none focus-visible:shadow-none`,disabled:!xn||zn,enterKeyHint:`enter`,id:`composer`,placeholder:On?`Restore this chat to continue`:yn?`Ask Codex to work in this worktree`:xn?`Ask Codex to create a worktree and start`:`Select a project to start`,rows:2,ref:Rt,value:ae,onChange:e=>{oe(e.target.value),Oe&&ke(null)},onKeyDown:Kr})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-end gap-1.5`,children:[yn&&Rn!==`queue`&&(0,R.jsx)(J,{"aria-label":_t===`queue`?`Queueing message`:`Queue message`,className:`size-10`,disabled:!Vn,onClick:()=>void Ur(`queue`),size:`icon`,title:`Queue message`,type:`button`,variant:`outline`,children:_t===`queue`?(0,R.jsx)(Go,{}):(0,R.jsx)(yo,{})}),(0,R.jsx)(J,{"aria-label":Gn,className:`size-10`,disabled:!Bn,onClick:Dn?()=>void Ur(Rn):void 0,size:`icon`,title:Wn,type:Dn?`button`:`submit`,children:_t===Rn?(0,R.jsx)(Go,{}):Rn===`queue`?(0,R.jsx)(yo,{}):(0,R.jsx)(Io,{})}),Dn&&(0,R.jsx)(J,{"aria-label":yt?`Stopping turn`:`Stop turn`,className:`size-10`,disabled:!Hn,onClick:qr,size:`icon`,title:`Stop turn`,type:`button`,variant:`destructive`,children:yt?(0,R.jsx)(Go,{}):(0,R.jsx)(Ro,{})})]})]}),(0,R.jsxs)(`div`,{className:`flex min-h-8 flex-wrap items-center gap-2 border-t border-[var(--border-divider)] px-1 pt-2`,children:[(0,R.jsx)(oc,{"aria-label":`Select model`,className:`w-36 max-w-full sm:w-40`,disabled:z||F.length===0||zn,emptyMessage:z?`Loading models`:`No models`,icon:(0,R.jsx)(uo,{className:`size-3.5`}),isLoading:z,options:Kn,placeholder:z?`Loading`:`Model`,searchPlaceholder:`Search models`,side:`top`,triggerClassName:`w-full justify-between`,value:An?.id??null,onValueChange:e=>hn(F_.model,e)}),(0,R.jsx)(oc,{"aria-label":`Select reasoning effort`,className:`w-28 max-w-full`,disabled:!An||zn,icon:(0,R.jsx)(fo,{className:`size-3.5`}),options:qn,placeholder:`Effort`,searchPlaceholder:`Search effort`,side:`top`,triggerClassName:`w-full justify-between`,value:c??`auto`,onValueChange:e=>hn(F_.effort,e===`auto`?null:e)}),(0,R.jsxs)(J,{"aria-label":Nn?`Disable fast mode`:`Enable fast mode`,"aria-pressed":Nn,className:`h-9 px-3`,disabled:!An||!Mn||zn,onClick:()=>hn(F_.serviceTier,Nn?null:`fast`),title:Mn?Nn?`Disable fast mode`:`Enable fast mode`:`Fast mode unavailable for selected model`,type:`button`,variant:Nn?`secondary`:`outline`,children:[(0,R.jsx)(Uo,{className:`size-3.5`}),`Fast`]}),(0,R.jsx)(oc,{"aria-label":`Attach file`,className:`w-32 max-w-full`,disabled:Un,emptyMessage:at?`Searching files`:pe.trim()?`No files`:`Type to search`,icon:(0,R.jsx)(So,{className:`size-3.5`}),isLoading:at,options:Yn,placeholder:`Files`,query:pe,searchPlaceholder:`Search files`,shouldFilter:!1,side:`top`,triggerClassName:`w-full justify-between`,value:null,onQueryChange:gn,onValueChange:ei}),(0,R.jsx)(oc,{"aria-label":`Select skill`,align:`end`,className:`w-32 max-w-full`,disabled:Un||rt,emptyMessage:rt?`Loading skills`:`No skills`,icon:(0,R.jsx)(Lo,{className:`size-3.5`}),isLoading:rt,options:Jn,placeholder:rt?`Loading`:`Skills`,searchPlaceholder:`Search skills`,side:`top`,triggerClassName:`w-full justify-between`,value:null,onValueChange:ti})]})]})})]})]})}function nv({chats:e,isLoading:t,onSetChatArchived:n,onSelectChat:r,selectedChatId:i}){let a=e.filter(e=>e.status!==`archived`);return(0,R.jsx)(`ul`,{"aria-label":`Chat history`,className:`ml-7 mt-1 space-y-1 border-l border-sidebar-border pl-2`,children:t?(0,R.jsx)(`li`,{className:`px-2 py-1.5`,children:(0,R.jsx)(qo,{label:`Loading chats`})}):a.length===0?(0,R.jsx)(`li`,{className:`px-2 py-1.5 text-[length:var(--font-size-xs)] text-[var(--text-tertiary)]`,children:`No chat history`}):a.map(e=>{let t=e.id===i;return(0,R.jsx)(`li`,{className:`group/chat min-w-0`,children:(0,R.jsxs)(`div`,{className:K(`flex min-h-7 min-w-0 items-center gap-0.5 rounded-[var(--radius-sm)] transition-colors duration-[var(--motion-duration-fast)] hover:bg-sidebar-accent`,t&&`bg-sidebar-accent text-sidebar-accent-foreground`),children:[(0,R.jsxs)(`button`,{"aria-current":t?`page`:void 0,className:K(`flex min-w-0 flex-1 items-center gap-2 rounded-[var(--radius-sm)] px-2 py-1 text-left text-[length:var(--font-size-xs)] outline-none focus-visible:shadow-[var(--state-focus-ring)]`,t?`text-sidebar-accent-foreground`:`text-[var(--text-secondary)]`),onClick:()=>r(e.id),title:e.title,type:`button`,children:[(0,R.jsx)(Ao,{className:`size-3.5 shrink-0 text-[var(--icon-color-default)]`}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),(0,R.jsx)(`span`,{"aria-hidden":`true`,className:K(`size-1.5 shrink-0 rounded-full`,I_[e.status].dot)}),(0,R.jsxs)(`span`,{className:`sr-only`,children:[`Status: `,I_[e.status].label]})]}),(0,R.jsxs)(gg,{children:[(0,R.jsx)(_g,{asChild:!0,children:(0,R.jsx)(J,{"aria-label":`Open actions for ${e.title}`,className:K(`mr-0.5 size-6 text-[var(--icon-color-default)] opacity-100 data-[state=open]:opacity-100 sm:opacity-0 sm:group-focus-within/chat:opacity-100 sm:group-hover/chat:opacity-100`,t&&`sm:opacity-100`),size:`icon`,title:`Chat actions`,type:`button`,variant:`ghost`,children:(0,R.jsx)(bo,{className:`size-3.5`})})}),(0,R.jsx)(vg,{align:`end`,children:(0,R.jsxs)(yg,{disabled:!L_(e),onSelect:()=>n(e,!0),children:[(0,R.jsx)(lo,{className:`size-4`}),(0,R.jsx)(`span`,{children:`Archive chat`})]})})]})]})},e.id)})})}function rv({label:e,status:t}){let n=I_[t],r=t===`running`;return(0,R.jsx)(`span`,{"aria-label":e,className:K(`flex size-4 shrink-0 items-center justify-center rounded-full`,r?`text-[var(--semantic-info-fg)]`:`bg-[var(--surface-card)]`),role:`status`,title:e,children:r?(0,R.jsx)(Go,{className:`size-3`}):(0,R.jsx)(`span`,{className:K(`size-1.5 rounded-full`,n.dot)})})}function iv({status:e}){let t=I_[e];return(0,R.jsxs)(Zs,{variant:t.badge,children:[(0,R.jsx)(`span`,{className:K(`size-1.5 rounded-full`,t.dot)}),t.label]})}function av({text:e}){return(0,R.jsx)(`span`,{className:`block min-w-0 truncate`,title:e,children:X_(e)})}function ov({icon:e,label:t,onRemove:n}){return(0,R.jsxs)(`span`,{className:`inline-flex h-8 max-w-52 items-center gap-1.5 rounded-[var(--radius-sm)] border border-[var(--border-divider)] bg-[var(--surface-code)] px-2 text-[length:var(--font-size-sm)] text-[var(--text-secondary)]`,children:[e,(0,R.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),(0,R.jsx)(`button`,{"aria-label":`Remove ${t}`,className:`rounded-[var(--radius-xs)] text-[var(--icon-color-muted)] outline-none transition-colors hover:bg-[var(--state-hover-bg)] hover:text-[var(--icon-color-active)] focus-visible:shadow-[var(--state-focus-ring)]`,onClick:n,title:`Remove ${t}`,type:`button`,children:(0,R.jsx)(Ho,{className:`size-3.5`})})]})}function sv(e){return e.split(/[-_\s]+/).filter(Boolean).map(e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`).join(` `)}function cv(e){switch(e){case`queue`:return`Queue message`;case`steer`:return`Steer turn`;case`send`:return`Send message`}}function lv(e){switch(e){case`queue`:return`Queueing message`;case`steer`:return`Steering turn`;case`send`:return`Sending message`}}function uv({hasFiles:e,hasSkills:t}){return e&&t?`Use the selected files and skills as context.`:e?`Use the selected files as context.`:`Use the selected skills as context.`}function dv(e){switch(e){case`danger`:return`border-[var(--semantic-danger-border)] bg-[var(--semantic-danger-bg)] text-[var(--semantic-danger-fg)]`;case`info`:return`border-[var(--semantic-info-border)] bg-[var(--semantic-info-bg)] text-[var(--semantic-info-fg)]`;case`warning`:return`border-[var(--semantic-warning-border)] bg-[var(--semantic-warning-bg)] text-[var(--semantic-warning-fg)]`}}function fv({className:e,message:t,onDismiss:n,tone:r=`danger`}){return(0,R.jsxs)(`div`,{className:K(`flex min-w-0 items-start gap-2 rounded-[var(--radius-sm)] border px-3 py-2 text-left text-[length:var(--font-size-sm)]`,dv(r),e),role:r===`danger`?`alert`:`status`,children:[(0,R.jsx)(Vo,{className:`mt-0.5 size-4 shrink-0`}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:t}),n&&(0,R.jsx)(`button`,{"aria-label":`Dismiss`,className:`rounded-[var(--radius-xs)] p-0.5 outline-none transition-colors hover:bg-[var(--state-hover-bg)] focus-visible:shadow-[var(--state-focus-ring)]`,onClick:n,type:`button`,children:(0,R.jsx)(Ho,{className:`size-3.5`})})]})}function pv({onDismiss:e,toasts:t}){return t.length===0?null:(0,R.jsx)(`div`,{"aria-live":`polite`,className:`pointer-events-none fixed bottom-4 right-4 z-50 flex w-[min(360px,calc(100vw-2rem))] flex-col gap-2`,children:t.map(t=>(0,R.jsx)(fv,{className:`pointer-events-auto shadow-[var(--shadow-md)]`,message:t.message,tone:t.tone,onDismiss:()=>e(t.id)},t.id))})}function mv({githubTargets:e,hasChat:t,hasWorktree:n,isGitHubTargetsLoading:r,onOpenProjectDialog:i,onSelectGitHubTarget:a,selectedGitHubTargetNumber:o,selectedProject:s}){let c=!!s&&!t&&e?.available;return(0,R.jsx)(`div`,{className:`mx-auto flex h-full max-w-[var(--layout-max-content-width)] items-center justify-center py-8`,children:(0,R.jsxs)(`section`,{className:`grid w-full max-w-2xl gap-4 px-5 py-6 text-center`,children:[(0,R.jsx)(`div`,{className:`mx-auto flex size-10 items-center justify-center rounded-[var(--radius-md)] bg-[var(--surface-code)] text-[var(--icon-color-default)]`,children:(0,R.jsx)(Eo,{className:`size-5`})}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h2`,{className:`text-[length:var(--font-size-xl)] font-semibold`,children:t?`No messages yet`:s?`New chat`:n?`Select chat history`:`Select a project`}),(0,R.jsx)(`p`,{className:`mt-1 text-[length:var(--font-size-md)] text-muted-foreground`,children:t?`Send a message to start a focused Codex session.`:s?`Send a message to create a named worktree and start Codex.`:n?`Choose a chat history for this worktree.`:`Select a project to begin a Codex session.`})]}),!s&&(0,R.jsx)(`div`,{className:`flex justify-center gap-2`,children:(0,R.jsxs)(J,{onClick:i,type:`button`,children:[(0,R.jsx)(No,{className:`size-4`}),`Add project`]})}),c&&e&&(0,R.jsx)(hv,{isLoading:r,selectedNumber:o,targets:e.targets,onSelectTarget:a})]})})}function hv({isLoading:e,onSelectTarget:t,selectedNumber:n,targets:r}){return(0,R.jsxs)(`div`,{className:`mx-auto mt-2 grid w-full gap-2 text-left`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-1`,children:[(0,R.jsx)(`p`,{className:`text-[length:var(--font-size-sm)] font-medium text-[var(--text-secondary)]`,children:`GitHub`}),e&&(0,R.jsx)(qo,{label:`Refreshing`})]}),r.length===0?(0,R.jsx)(`p`,{className:`rounded-[var(--radius-sm)] border border-dashed border-[var(--border-divider)] bg-[var(--surface-code)] px-3 py-2 text-[length:var(--font-size-sm)] text-muted-foreground`,children:`No open issues or pull requests.`}):(0,R.jsx)(`ul`,{className:`max-h-72 overflow-y-auto rounded-[var(--radius-sm)] border border-[var(--border-divider)] bg-[var(--surface-code)]`,children:r.map(e=>(0,R.jsx)(gv,{isSelected:n===e.number,target:e,onSelectTarget:t},`${e.kind}-${e.number}`))})]})}function gv({isSelected:e,onSelectTarget:t,target:n}){let r=`${n.kind===`pullRequest`?`PR`:`Issue`} #${n.number}: ${n.title}`;return(0,R.jsx)(`li`,{className:`border-b border-[var(--border-divider)] last:border-b-0`,children:(0,R.jsxs)(`label`,{className:K(`grid cursor-pointer grid-cols-[auto_1fr] gap-3 px-3 py-2.5 text-[length:var(--font-size-sm)] transition-colors hover:bg-[var(--state-hover-bg)]`,e&&`bg-[var(--state-selected-bg)]`),children:[(0,R.jsx)(`input`,{"aria-label":r,checked:e,className:`mt-0.5 size-4 accent-[var(--button-primary-bg)]`,type:`checkbox`,onChange:e=>t(e.target.checked?n.number:null)}),(0,R.jsxs)(`span`,{className:`grid min-w-0 gap-1`,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[n.kind===`pullRequest`?(0,R.jsx)(To,{className:`size-3.5 shrink-0 text-[var(--semantic-info-fg)]`}):(0,R.jsx)(_o,{className:`size-3.5 shrink-0 text-[var(--semantic-success-fg)]`}),(0,R.jsxs)(`span`,{className:`shrink-0 font-mono text-[length:var(--font-size-xs)] text-[var(--text-tertiary)]`,children:[`#`,n.number]}),(0,R.jsx)(`span`,{className:`truncate font-medium text-[var(--text-primary)]`,children:n.title})]}),(0,R.jsxs)(`span`,{className:`truncate text-[length:var(--font-size-xs)] text-muted-foreground`,children:[n.kind===`pullRequest`?`Pull request`:`Issue`,n.author?` by ${n.author}`:``]})]})]})})}function _v({isPendingActionBusy:e,message:t,onDeletePendingMessage:n,onEditPendingMessage:r}){if(t.role===`event`)return(0,R.jsx)(vv,{message:t});let i=t.role===`user`,a=t.role===`error`,o=Nv(t);return(0,R.jsxs)(`article`,{className:K(i&&`ml-auto max-w-[78%] rounded-[var(--radius-lg)] border px-4 py-3 shadow-[var(--shadow-xs)]`,i&&!o&&`border-transparent bg-[var(--chat-user-bg)] text-[var(--chat-user-fg)]`,o===`queued`&&`border-[var(--semantic-warning-border)] bg-[var(--semantic-warning-bg)] text-[var(--semantic-warning-fg)]`,o===`steered`&&`border-[var(--semantic-info-border)] bg-[var(--semantic-info-bg)] text-[var(--semantic-info-fg)]`,t.role===`assistant`&&`mr-auto max-w-[82%] px-2 py-1 text-[var(--text-primary)]`,a&&`rounded-[var(--radius-lg)] border border-[var(--semantic-danger-border)] bg-[var(--semantic-danger-bg)] px-4 py-3 text-[var(--semantic-danger-fg)] shadow-[var(--shadow-xs)]`),children:[t.role===`assistant`&&t.textHtml!==void 0?(0,R.jsx)(`div`,{className:`markdown-message`,dangerouslySetInnerHTML:{__html:t.textHtml}}):(0,R.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-sans text-[length:var(--font-size-md)] leading-[var(--line-height-relaxed)]`,children:t.text}),o&&(0,R.jsx)(Mv,{isActionBusy:e,message:t,state:o,onDelete:n,onEdit:r})]})}function vv({message:e}){let t=c_(e);return t===`plan`?(0,R.jsx)(yv,{message:e}):t===`diff`?(0,R.jsx)(bv,{message:e}):t===`command`?(0,R.jsx)(xv,{message:e}):t===`file`?(0,R.jsx)(Sv,{message:e}):t===`reasoning`?(0,R.jsx)(Ov,{message:e}):t===`warning`?(0,R.jsx)(kv,{message:e}):null}function yv({message:e}){let{explanation:t,plan:n}=u_(e),r=p_(e);return(0,R.jsxs)(Av,{icon:(0,R.jsx)(Do,{className:`size-4`}),meta:`${n.length} step${n.length===1?``:`s`}`,title:`Plan updated`,children:[t&&(0,R.jsx)(`p`,{className:`text-[length:var(--font-size-sm)] text-muted-foreground`,children:t}),n.length>0&&(0,R.jsx)(`ol`,{className:`mt-2 space-y-1`,children:n.map((e,t)=>(0,R.jsxs)(`li`,{className:`grid grid-cols-[1rem_minmax(0,1fr)] items-start gap-2 text-[length:var(--font-size-sm)]`,children:[(0,R.jsx)(e.status===`completed`?go:e.status===`inProgress`?yo:vo,{className:K(`mt-0.5 size-3.5`,e.status===`completed`&&`text-[var(--semantic-success-fg)]`,e.status===`inProgress`&&`text-[var(--semantic-info-fg)]`,e.status===`pending`&&`text-muted-foreground`)}),(0,R.jsx)(`span`,{className:`min-w-0 break-words`,children:e.step})]},`${e.step}-${t}`))}),!t&&n.length===0&&r&&(0,R.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-[length:var(--font-size-sm)] text-muted-foreground`,children:r})]})}function bv({message:e}){let{files:t,hasDiff:n}=d_(e);return(0,R.jsx)(Av,{defaultOpen:!1,icon:(0,R.jsx)(xo,{className:`size-4`}),meta:Ev([Tv(t.length,`file`),n?`diff hidden`:`cleared`]),summary:t.length>0?(0,R.jsx)(Dv,{paths:t}):(0,R.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e.text||(n?`Diff hidden`:`Diff cleared`)}),title:`Diff`,children:(0,R.jsx)(jv,{label:n?`Unified diff hidden`:`No diff`})})}function xv({message:e}){let t=h_(e);return(0,R.jsxs)(Av,{defaultOpen:!1,icon:(0,R.jsx)(zo,{className:`size-4`}),meta:Ev([t.status,t.exitCode===null?null:`exit ${t.exitCode}`,t.durationMs===null?null:wv(t.durationMs),t.capReached?`truncated`:null,`output hidden`]),summary:(0,R.jsx)(`span`,{className:`block min-w-0 max-w-full truncate font-mono text-[length:var(--font-size-xs)] text-[var(--text-secondary)]`,title:t.command??t.cwd??void 0,children:t.command??t.stream??`output`}),title:`Command`,children:[t.command&&(0,R.jsx)(`p`,{className:`mb-2 min-w-0 break-words font-mono text-[length:var(--font-size-xs)] text-muted-foreground`,title:t.cwd??void 0,children:t.command}),(t.status||t.exitCode!==null||t.durationMs!==null)&&(0,R.jsxs)(`div`,{className:`mb-2 flex flex-wrap gap-1.5`,children:[t.status&&(0,R.jsx)(Zs,{variant:Cv(t.status),children:t.status}),t.exitCode!==null&&(0,R.jsxs)(Zs,{variant:t.exitCode===0?`success`:`danger`,children:[`exit `,t.exitCode]}),t.durationMs!==null&&(0,R.jsx)(Zs,{variant:`secondary`,children:wv(t.durationMs)})]}),(0,R.jsx)(jv,{label:t.capReached?`Output hidden after truncation`:`Output hidden`})]})}function Sv({message:e}){let t=f_(e),n=g_(e);return e.eventType===`item/fileChange/outputDelta`?(0,R.jsx)(Av,{defaultOpen:!1,icon:(0,R.jsx)(So,{className:`size-4`}),meta:`output hidden`,summary:(0,R.jsx)(`span`,{className:`block min-w-0 max-w-full truncate text-muted-foreground`,children:`File change output`}),title:`File`,children:(0,R.jsx)(jv,{label:`Output hidden`})}):(0,R.jsxs)(Av,{defaultOpen:!1,icon:(0,R.jsx)(So,{className:`size-4`}),meta:Ev([n.status,Tv(t.length,`file`),`patch hidden`]),summary:t.length>0?(0,R.jsx)(Dv,{paths:t.map(e=>e.path)}):(0,R.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e.text||`No files`}),title:`File edit`,children:[n.status&&(0,R.jsxs)(`div`,{className:`mb-2 flex flex-wrap gap-1.5`,children:[(0,R.jsx)(Zs,{variant:Cv(n.status),children:n.status}),(0,R.jsxs)(Zs,{variant:`secondary`,children:[t.length,` file`,t.length===1?``:`s`]})]}),t.length===0?(0,R.jsx)(`p`,{className:`text-[length:var(--font-size-sm)] text-muted-foreground`,children:e.text}):(0,R.jsx)(`div`,{className:`space-y-1.5`,children:t.map(e=>(0,R.jsx)(`div`,{className:`rounded-[var(--radius-sm)] border border-[var(--border-subtle)] bg-[var(--surface-panel)]`,children:(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 px-2 py-1.5`,children:[(0,R.jsx)(Zs,{className:`shrink-0`,variant:`secondary`,children:e.kind}),(0,R.jsx)(`span`,{className:`truncate font-mono text-[length:var(--font-size-xs)]`,children:e.path}),(0,R.jsx)(`span`,{className:`ml-auto shrink-0 font-mono text-[length:var(--font-size-xs)] text-muted-foreground`,children:`patch hidden`})]})},`${e.kind}:${e.path}`))})]})}function Cv(e){return e===`completed`?`success`:e===`failed`?`danger`:e===`declined`?`warning`:e===`inProgress`?`info`:`secondary`}function wv(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function Tv(e,t){return`${e} ${t}${e===1?``:`s`}`}function Ev(e){let t=e.filter(e=>!!(e&&e.trim()));return t.length>0?t.join(` · `):void 0}function Dv({paths:e}){let t=e.slice(0,3);return(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1 overflow-hidden`,children:[t.map(e=>(0,R.jsx)(`span`,{className:`min-w-0 max-w-48 truncate rounded-[var(--radius-xs)] border border-[var(--border-subtle)] bg-[var(--surface-panel)] px-1.5 py-0.5 font-mono text-[length:var(--font-size-xs)] text-[var(--text-secondary)]`,title:e,children:e},e)),e.length>t.length&&(0,R.jsxs)(`span`,{className:`shrink-0 text-[length:var(--font-size-xs)] text-muted-foreground`,children:[`+`,e.length-t.length]})]})}function Ov({message:e}){let t=p_(e);return(0,R.jsx)(Av,{defaultOpen:!1,icon:(0,R.jsx)(fo,{className:`size-4`}),meta:Tv(__(t),`line`),summary:(0,R.jsx)(`span`,{className:`block min-w-0 max-w-full truncate text-muted-foreground`,children:`Reasoning details`}),title:`Reasoning updated`,children:(0,R.jsx)(`pre`,{className:`whitespace-pre-wrap break-words rounded-[var(--radius-md)] bg-[var(--surface-code)] p-2 font-mono text-[length:var(--font-size-xs)] leading-[var(--line-height-relaxed)]`,children:t})})}function kv({message:e}){let t=m_(e);return(0,R.jsxs)(Av,{icon:(0,R.jsx)(Vo,{className:`size-4`}),summary:(0,R.jsx)(`span`,{className:`block min-w-0 max-w-full truncate`,children:t.summary}),tone:`warning`,title:`Warning`,children:[(0,R.jsx)(`p`,{className:`text-[length:var(--font-size-sm)]`,children:t.summary}),t.details&&(0,R.jsx)(`p`,{className:`mt-1 text-[length:var(--font-size-xs)] text-muted-foreground`,children:t.details})]})}function Av({children:e,defaultOpen:t=!0,icon:n,meta:r,summary:i,title:a,tone:o=`neutral`}){return(0,R.jsxs)(`details`,{className:K(`group w-full rounded-[var(--radius-md)] border bg-[var(--surface-card)] text-[var(--text-primary)]`,o===`neutral`&&`border-[var(--border-subtle)]`,o===`warning`&&`border-[var(--semantic-warning-border)] bg-[var(--semantic-warning-bg)] text-[var(--semantic-warning-fg)]`),open:t||void 0,children:[(0,R.jsxs)(`summary`,{className:`grid min-h-9 cursor-pointer list-none grid-cols-[auto_auto_minmax(0,auto)_minmax(0,1fr)_auto] items-center gap-2 px-2.5 py-1.5 outline-none transition-colors hover:bg-[var(--state-hover-bg)] focus-visible:shadow-[var(--state-focus-ring)] [&::-webkit-details-marker]:hidden`,title:r,children:[(0,R.jsx)(mo,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-open:rotate-90`}),(0,R.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:n}),(0,R.jsx)(`span`,{className:`truncate text-[length:var(--font-size-sm)] font-semibold`,children:a}),i&&(0,R.jsx)(`span`,{className:`min-w-0 max-w-full overflow-hidden`,children:i}),r&&(0,R.jsx)(`span`,{className:`shrink-0 truncate text-[length:var(--font-size-xs)] text-muted-foreground`,children:r})]}),(0,R.jsx)(`div`,{className:K(`border-t px-3 py-2`,o===`neutral`&&`border-[var(--border-subtle)]`,o===`warning`&&`border-[var(--semantic-warning-border)]`),children:e})]})}function jv({label:e}){return(0,R.jsx)(`p`,{className:`text-[length:var(--font-size-sm)] text-muted-foreground`,children:e})}function Mv({isActionBusy:e,message:t,onDelete:n,onEdit:r,state:i}){let a=i===`queued`;return(0,R.jsxs)(`div`,{className:`mt-2 flex flex-wrap justify-end gap-1.5`,children:[(0,R.jsxs)(`span`,{className:`inline-flex h-6 max-w-full items-center gap-1.5 rounded-[var(--radius-sm)] border border-current/20 bg-[var(--surface-floating)] px-2 text-[length:var(--font-size-xs)] font-medium text-current`,children:[(0,R.jsx)(a?yo:Io,{className:`size-3.5 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate`,children:a?`Queued for next turn`:`Steered into active turn`})]}),a&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(J,{"aria-label":`Edit pending message`,className:`size-6 border-current/20 bg-[var(--surface-floating)] text-current hover:bg-[var(--state-hover-bg)]`,disabled:e,size:`icon`,title:`Edit pending message`,type:`button`,variant:`outline`,onClick:()=>r(t),children:(0,R.jsx)(Mo,{className:`size-3.5`})}),(0,R.jsx)(J,{"aria-label":`Delete pending message`,className:`size-6 border-current/20 bg-[var(--surface-floating)] text-current hover:bg-[var(--state-hover-bg)]`,disabled:e,size:`icon`,title:`Delete pending message`,type:`button`,variant:`outline`,onClick:()=>n(t),children:(0,R.jsx)(Bo,{className:`size-3.5`})})]})]})}function Nv(e){return e.role===`user`?e.eventType===`chat.message.queued`?`queued`:e.eventType===`chat.message.steered`?`steered`:null:null}function Pv(e){return{name:e.name,path:e.path,relativePath:e.name,root:``,score:0}}function Fv(){return(0,R.jsx)(Bi,{})}var Iv=[{path:`/`,Component:Fv,HydrateFallback:Jo,children:[{index:!0,Component:tv}]}];function Lv(){return ka(Iv)}var Rv=new Fe,zv=document.getElementById(`root`);if(!zv)throw Error(`Root element was not found`);(0,Wo.createRoot)(zv).render((0,R.jsx)(L.StrictMode,{children:(0,R.jsx)(Be,{client:Rv,children:(0,R.jsx)(Ii,{router:Lv()})})}));