@aku11i/phantom 6.3.0-2 → 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.
- package/app/web/assets/index-DfF5Sezp.css +2 -0
- package/app/web/assets/index-IIn3YvIM.js +52 -0
- package/app/web/icons/apple-touch-icon.png +0 -0
- package/app/web/icons/icon-192.png +0 -0
- package/app/web/icons/icon-512.png +0 -0
- package/app/web/icons/icon.svg +3 -0
- package/app/web/index.html +9 -2
- package/app/web/manifest.webmanifest +25 -0
- package/app/web/sw.js +15 -0
- package/package.json +1 -1
- package/phantom.js +2 -2
- package/app/web/assets/index-IcxJQt7a.css +0 -2
- package/app/web/assets/index-iSfjEV4I.js +0 -52
|
@@ -0,0 +1,52 @@
|
|
|
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 At(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function jt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Mt(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 Nt(e){if(!e._valueTracker){var t=jt(e)?`checked`:`value`;e._valueTracker=Mt(e,t,``+e[t])}}function Pt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=jt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Ft(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 It=/[\n"\\]/g;function Lt(e){return e.replace(It,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Rt(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=``+At(t)):e.value!==``+At(t)&&(e.value=``+At(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Bt(e,o,At(n)):Bt(e,o,At(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=``+At(s):e.removeAttribute(`name`)}function zt(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)){Nt(e);return}n=n==null?``:``+At(n),t=t==null?n:``+At(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),Nt(e)}function Bt(e,t,n){t===`number`&&Ft(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Vt(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=``+At(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 Ht(e,t,n){if(t!=null&&(t=``+At(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+At(n)}function Ut(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=At(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Nt(e)}function Wt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Gt=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 Kt(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||Gt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function qt(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&&Kt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Kt(e,o,t[o])}function Jt(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 Yt=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`]]),Xt=/^[\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 Zt(e){return Xt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Qt(){}var B=null;function $t(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var en=null,tn=null;function nn(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(Rt(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="`+Lt(``+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));Rt(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&&Pt(r)}break a;case`textarea`:Ht(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Vt(e,!!n.multiple,t,!1)}}}var rn=!1;function an(e,t,n){if(rn)return e(t,n);rn=!0;try{return e(t)}finally{if(rn=!1,(en!==null||tn!==null)&&(yu(),en&&(t=en,e=tn,tn=en=null,nn(t),e)))for(t=0;t<e.length;t++)nn(e[t])}}function on(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 sn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),cn=!1;if(sn)try{var ln={};Object.defineProperty(ln,`passive`,{get:function(){cn=!0}}),window.addEventListener(`test`,ln,ln),window.removeEventListener(`test`,ln,ln)}catch{cn=!1}var un=null,dn=null,fn=null;function pn(){if(fn)return fn;var e,t=dn,n=t.length,r,i=`value`in un?un.value:un.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 fn=i.slice(e,1<r?1-r:void 0)}function mn(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 hn(){return!0}function gn(){return!1}function _n(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)?hn:gn,this.isPropagationStopped=gn,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=hn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=hn)},persist:function(){},isPersistent:hn}),t}var vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yn=_n(vn),bn=h({},vn,{view:0,detail:0}),xn=_n(bn),Sn,Cn,wn,Tn=h({},bn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fn,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!==wn&&(wn&&e.type===`mousemove`?(Sn=e.screenX-wn.screenX,Cn=e.screenY-wn.screenY):Cn=Sn=0,wn=e),Sn)},movementY:function(e){return`movementY`in e?e.movementY:Cn}}),En=_n(Tn),Dn=_n(h({},Tn,{dataTransfer:0})),V=_n(h({},bn,{relatedTarget:0})),On=_n(h({},vn,{animationName:0,elapsedTime:0,pseudoElement:0})),kn=_n(h({},vn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),An=_n(h({},vn,{data:0})),jn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Mn={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`},Nn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Pn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nn[e])?!!t[e]:!1}function Fn(){return Pn}var In=_n(h({},bn,{key:function(e){if(e.key){var t=jn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=mn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Mn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fn,charCode:function(e){return e.type===`keypress`?mn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?mn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Ln=_n(h({},Tn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Rn=_n(h({},bn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fn})),zn=_n(h({},vn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Bn=_n(h({},Tn,{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})),Vn=_n(h({},vn,{newState:0,oldState:0})),Hn=[9,13,27,32],Un=sn&&`CompositionEvent`in window,Wn=null;sn&&`documentMode`in document&&(Wn=document.documentMode);var Gn=sn&&`TextEvent`in window&&!Wn,Kn=sn&&(!Un||Wn&&8<Wn&&11>=Wn),qn=` `,Jn=!1;function Yn(e,t){switch(e){case`keyup`:return Hn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Xn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Zn=!1;function Qn(e,t){switch(e){case`compositionend`:return Xn(t);case`keypress`:return t.which===32?(Jn=!0,qn):null;case`textInput`:return e=t.data,e===qn&&Jn?null:e;default:return null}}function $n(e,t){if(Zn)return e===`compositionend`||!Un&&Yn(e,t)?(e=pn(),fn=dn=un=null,Zn=!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 Kn&&t.locale!==`ko`?null:t.data;default:return null}}var er={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 tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!er[e.type]:t===`textarea`}function nr(e,t,n,r){en?tn?tn.push(r):tn=[r]:en=r,t=Td(t,`onChange`),0<t.length&&(n=new yn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var rr=null,ir=null;function ar(e){vd(e,0)}function or(e){if(Pt(gt(e)))return e}function sr(e,t){if(e===`change`)return t}var cr=!1;if(sn){var lr;if(sn){var ur=`oninput`in document;if(!ur){var dr=document.createElement(`div`);dr.setAttribute(`oninput`,`return;`),ur=typeof dr.oninput==`function`}lr=ur}else lr=!1;cr=lr&&(!document.documentMode||9<document.documentMode)}function fr(){rr&&(rr.detachEvent(`onpropertychange`,pr),ir=rr=null)}function pr(e){if(e.propertyName===`value`&&or(ir)){var t=[];nr(t,ir,e,$t(e)),an(ar,t)}}function mr(e,t,n){e===`focusin`?(fr(),rr=t,ir=n,rr.attachEvent(`onpropertychange`,pr)):e===`focusout`&&fr()}function hr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return or(ir)}function gr(e,t){if(e===`click`)return or(t)}function _r(e,t){if(e===`input`||e===`change`)return or(t)}function vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var yr=typeof Object.is==`function`?Object.is:vr;function br(e,t){if(yr(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)||!yr(e[i],t[i]))return!1}return!0}function xr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sr(e,t){var n=xr(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=xr(n)}}function Cr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ft(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=Ft(e.document)}return t}function Tr(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 Er=sn&&`documentMode`in document&&11>=document.documentMode,Dr=null,Or=null,kr=null,Ar=!1;function jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ar||Dr==null||Dr!==Ft(r)||(r=Dr,`selectionStart`in r&&Tr(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}),kr&&br(kr,r)||(kr=r,r=Td(Or,`onSelect`),0<r.length&&(t=new yn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Dr)))}function Mr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Nr={animationend:Mr(`Animation`,`AnimationEnd`),animationiteration:Mr(`Animation`,`AnimationIteration`),animationstart:Mr(`Animation`,`AnimationStart`),transitionrun:Mr(`Transition`,`TransitionRun`),transitionstart:Mr(`Transition`,`TransitionStart`),transitioncancel:Mr(`Transition`,`TransitionCancel`),transitionend:Mr(`Transition`,`TransitionEnd`)},Pr={},Fr={};sn&&(Fr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Nr.animationend.animation,delete Nr.animationiteration.animation,delete Nr.animationstart.animation),`TransitionEvent`in window||delete Nr.transitionend.transition);function Ir(e){if(Pr[e])return Pr[e];if(!Nr[e])return e;var t=Nr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Fr)return Pr[e]=t[n];return e}var Lr=Ir(`animationend`),Rr=Ir(`animationiteration`),zr=Ir(`animationstart`),Br=Ir(`transitionrun`),Vr=Ir(`transitionstart`),Hr=Ir(`transitioncancel`),Ur=Ir(`transitionend`),Wr=new Map,Gr=`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(` `);Gr.push(`scrollEnd`);function Kr(e,t){Wr.set(e,t),xt(t,[e])}var qr=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)},Jr=[],Yr=0,Xr=0;function Zr(){for(var e=Yr,t=Xr=Yr=0;t<e;){var n=Jr[t];Jr[t++]=null;var r=Jr[t];Jr[t++]=null;var i=Jr[t];Jr[t++]=null;var a=Jr[t];if(Jr[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&&ti(n,i,a)}}function Qr(e,t,n,r){Jr[Yr++]=e,Jr[Yr++]=t,Jr[Yr++]=n,Jr[Yr++]=r,Xr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function $r(e,t,n,r){return Qr(e,t,n,r),ni(e)}function ei(e,t){return Qr(e,null,null,t),ni(e)}function ti(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 ni(e){if(50<uu)throw uu=0,du=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ri={};function ii(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 ai(e,t,n,r){return new ii(e,t,n,r)}function oi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function si(e,t){var n=e.alternate;return n===null?(n=ai(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 ci(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 li(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)oi(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=ai(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return ui(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ai(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ai(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ai(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=ai(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ui(e,t,n,r){return e=ai(7,e,r,t),e.lanes=n,e}function di(e,t,n){return e=ai(6,e,null,t),e.lanes=n,e}function fi(e){var t=ai(18,null,null,0);return t.stateNode=e,t}function pi(e,t,n){return t=ai(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var mi=new WeakMap;function hi(e,t){if(typeof e==`object`&&e){var n=mi.get(e);return n===void 0?(t={value:e,source:t,stack:xe(t)},mi.set(e,t),t):n}return{value:e,source:t,stack:xe(t)}}var gi=[],_i=0,vi=null,yi=0,bi=[],xi=0,Si=null,Ci=1,wi=``;function Ti(e,t){gi[_i++]=yi,gi[_i++]=vi,vi=e,yi=t}function Ei(e,t,n){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Si=e;var r=Ci;e=wi;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,Ci=1<<32-R(t)+i|n<<i|r,wi=a+e}else Ci=1<<a|n<<i|r,wi=e}function Di(e){e.return!==null&&(Ti(e,1),Ei(e,1,0))}function Oi(e){for(;e===vi;)vi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null;for(;e===Si;)Si=bi[--xi],bi[xi]=null,wi=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null}function ki(e,t){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Ci=t.id,wi=t.overflow,Si=e}var Ai=null,ji=null,H=!1,Mi=null,Ni=!1,Pi=Error(i(519));function Fi(e){throw Vi(hi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Pi}function Ii(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),zt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),Ut(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=Qt),t=!0):t=!1,t||Fi(e,!0)}function Li(e){for(Ai=e.return;Ai;)switch(Ai.tag){case 5:case 31:case 13:Ni=!1;return;case 27:case 3:Ni=!0;return;default:Ai=Ai.return}}function Ri(e){if(e!==Ai)return!1;if(!H)return Li(e),H=!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&&ji&&Fi(e),Li(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ji=uf(e)}else t===27?(t=ji,Zd(e.type)?(e=lf,lf=null,ji=e):ji=t):ji=Ai?cf(e.stateNode.nextSibling):null;return!0}function zi(){ji=Ai=null,H=!1}function Bi(){var e=Mi;return e!==null&&(Xl===null?Xl=e:Xl.push.apply(Xl,e),Mi=null),e}function Vi(e){Mi===null?Mi=[e]:Mi.push(e)}var Hi=oe(null),Ui=null,Wi=null;function Gi(e,t,n){I(Hi,t._currentValue),t._currentValue=n}function Ki(e){e._currentValue=Hi.current,F(Hi)}function qi(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 Ji(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),qi(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),qi(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 Yi(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;yr(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&&Ji(t,e,n,r),t.flags|=262144}function Xi(e){for(e=e.firstContext;e!==null;){if(!yr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Zi(e){Ui=e,Wi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Qi(e){return ea(Ui,e)}function $i(e,t){return Ui===null&&Zi(e),ea(e,t)}function ea(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Wi===null){if(e===null)throw Error(i(308));Wi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Wi=Wi.next=t;return n}var ta=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()})}},na=t.unstable_scheduleCallback,ra=t.unstable_NormalPriority,ia={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function aa(){return{controller:new ta,data:new Map,refCount:0}}function oa(e){e.refCount--,e.refCount===0&&na(ra,function(){e.controller.abort()})}var sa=null,ca=0,la=0,ua=null;function da(e,t){if(sa===null){var n=sa=[];ca=0,la=ud(),ua={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ca++,t.then(fa,fa),t}function fa(){if(--ca===0&&sa!==null){ua!==null&&(ua.status=`fulfilled`);var e=sa;sa=null,la=0,ua=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function pa(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 ma=N.S;N.S=function(e,t){$l=De(),typeof t==`object`&&t&&typeof t.then==`function`&&da(e,t),ma!==null&&ma(e,t)};var ha=oe(null);function ga(){var e=ha.current;return e===null?Ll.pooledCache:e}function _a(e,t){t===null?I(ha,ha.current):I(ha,t.pool)}function va(){var e=ga();return e===null?null:{parent:ia._currentValue,pool:e}}var ya=Error(i(460)),ba=Error(i(474)),xa=Error(i(542)),Sa={then:function(){}};function Ca(e){return e=e.status,e===`fulfilled`||e===`rejected`}function wa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Qt,Qt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Oa(e),e;default:if(typeof t.status==`string`)t.then(Qt,Qt);else{if(e=Ll,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,Oa(e),e}throw Ea=t,ya}}function Ta(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ea=e,ya):e}}var Ea=null;function Da(){if(Ea===null)throw Error(i(459));var e=Ea;return Ea=null,e}function Oa(e){if(e===ya||e===xa)throw Error(i(483))}var ka=null,Aa=0;function ja(e){var t=Aa;return Aa+=1,ka===null&&(ka=[]),wa(ka,e,t)}function Ma(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Na(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 Pa(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=si(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=di(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&&Ta(i)===t.type)?(t=a(t,n.props),Ma(t,n),t.return=e,t):(t=li(n.type,n.key,n.props,null,e.mode,r),Ma(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=pi(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=ui(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=di(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=li(t.type,t.key,t.props,null,e.mode,n),Ma(n,t),n.return=e,n;case v:return t=pi(t,e.mode,n),t.return=e,t;case O:return t=Ta(t),f(e,t,n)}if(ne(t)||j(t))return t=ui(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ja(t),n);if(t.$$typeof===C)return f(e,$i(e,t),n);Na(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=Ta(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,ja(n),r);if(n.$$typeof===C)return p(e,t,$i(e,n),r);Na(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=Ta(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,ja(r),i);if(r.$$typeof===C)return m(e,t,n,$i(t,r),i);Na(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),H&&Ti(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 H&&Ti(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)}),H&&Ti(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),H&&Ti(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 H&&Ti(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)}),H&&Ti(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&&Ta(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ma(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=ui(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=li(o.type,o.key,o.props,null,e.mode,c),Ma(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=pi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Ta(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,ja(o),c);if(o.$$typeof===C)return b(e,r,$i(e,o),c);Na(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=di(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Aa=0;var i=b(e,t,n,r);return ka=null,i}catch(t){if(t===ya||t===xa)throw t;var a=ai(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Fa=Pa(!0),Ia=Pa(!1),La=!1;function Ra(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function za(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 Ba(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Va(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,J&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ni(e),ti(e,null,n),t}return Qr(e,r,t,n),ni(e)}function Ha(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 Ua(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 Wa=!1;function Ga(){if(Wa){var e=ua;if(e!==null)throw e}}function Ka(e,t,n,r){Wa=!1;var i=e.updateQueue;La=!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?(X&f)===f:(r&f)===f){f!==0&&f===la&&(Wa=!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:La=!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),Wl|=o,e.lanes=o,e.memoizedState=d}}function qa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ja(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)qa(n[e],t)}var Ya=oe(null),Xa=oe(0);function Za(e,t){e=Hl,I(Xa,e),I(Ya,t),Hl=e|t.baseLanes}function Qa(){I(Xa,Hl),I(Ya,Ya.current)}function $a(){Hl=Xa.current,F(Ya),F(Xa)}var eo=oe(null),to=null;function no(e){var t=e.alternate;I(so,so.current&1),I(eo,e),to===null&&(t===null||Ya.current!==null||t.memoizedState!==null)&&(to=e)}function ro(e){I(so,so.current),I(eo,e),to===null&&(to=e)}function io(e){e.tag===22?(I(so,so.current),I(eo,e),to===null&&(to=e)):ao(e)}function ao(){I(so,so.current),I(eo,eo.current)}function oo(e){F(eo),to===e&&(to=null),F(so)}var so=oe(0);function co(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 lo=0,U=null,uo=null,W=null,fo=!1,po=!1,mo=!1,ho=0,go=0,_o=null,vo=0;function yo(){throw Error(i(321))}function bo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!yr(e[n],t[n]))return!1;return!0}function xo(e,t,n,r,i,a){return lo=a,U=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Is:Ls,mo=!1,a=n(r,i),mo=!1,po&&(a=Co(t,n,r,i)),So(e),a}function So(e){N.H=K;var t=uo!==null&&uo.next!==null;if(lo=0,W=uo=U=null,fo=!1,go=0,_o=null,t)throw Error(i(300));e===null||ec||(e=e.dependencies,e!==null&&Xi(e)&&(ec=!0))}function Co(e,t,n,r){U=e;var a=0;do{if(po&&(_o=null),go=0,po=!1,25<=a)throw Error(i(301));if(a+=1,W=uo=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=Rs,o=t(n,r)}while(po);return o}function wo(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?jo(t):t,e=e.useState()[0],(uo===null?null:uo.memoizedState)!==e&&(U.flags|=1024),t}function To(){var e=ho!==0;return ho=0,e}function Eo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Do(e){if(fo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}fo=!1}lo=0,W=uo=U=null,po=!1,go=ho=0,_o=null}function Oo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return W===null?U.memoizedState=W=e:W=W.next=e,W}function ko(){if(uo===null){var e=U.alternate;e=e===null?null:e.memoizedState}else e=uo.next;var t=W===null?U.memoizedState:W.next;if(t!==null)W=t,uo=e;else{if(e===null)throw U.alternate===null?Error(i(467)):Error(i(310));uo=e,e={memoizedState:uo.memoizedState,baseState:uo.baseState,baseQueue:uo.baseQueue,queue:uo.queue,next:null},W===null?U.memoizedState=W=e:W=W.next=e}return W}function Ao(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function jo(e){var t=go;return go+=1,_o===null&&(_o=[]),e=wa(_o,e,t),t=U,(W===null?t.memoizedState:W.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Is:Ls),e}function Mo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return jo(e);if(e.$$typeof===C)return Qi(e)}throw Error(i(438,String(e)))}function No(e){var t=null,n=U.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=U.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=Ao(),U.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 Po(e,t){return typeof t==`function`?t(e):t}function Fo(e){return Io(ko(),uo,e)}function Io(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(lo&f)===f:(X&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===la&&(d=!0);else if((lo&p)===p){u=u.next,p===la&&(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,U.lanes|=p,Wl|=p;f=u.action,mo&&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,U.lanes|=f,Wl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!yr(o,e.memoizedState)&&(ec=!0,d&&(n=ua,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 Lo(e){var t=ko(),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);yr(o,t.memoizedState)||(ec=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ro(e,t,n){var r=U,a=ko(),o=H;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!yr((uo||a).memoizedState,n);if(s&&(a.memoizedState=n,ec=!0),a=a.queue,cs(Vo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||W!==null&&W.memoizedState.tag&1){if(r.flags|=2048,rs(9,{destroy:void 0},Bo.bind(null,r,a,n,t),null),Ll===null)throw Error(i(349));o||lo&127||zo(r,t,n)}return n}function zo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=U.updateQueue,t===null?(t=Ao(),U.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Bo(e,t,n,r){t.value=n,t.getSnapshot=r,Ho(t)&&Uo(e)}function Vo(e,t,n){return n(function(){Ho(t)&&Uo(e)})}function Ho(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yr(e,n)}catch{return!0}}function Uo(e){var t=ei(e,2);t!==null&&mu(t,e,2)}function Wo(e){var t=Oo();if(typeof e==`function`){var n=e;if(e=n(),mo){L(!0);try{n()}finally{L(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:e},t}function Go(e,t,n,r){return e.baseState=n,Io(e,uo,typeof r==`function`?r:Po)}function Ko(e,t,n,r,a){if(Ns(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,qo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function qo(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),Jo(e,t,s)}catch(n){Yo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),Jo(e,t,a)}catch(n){Yo(e,t,n)}}function Jo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){G(e,t,n)},function(n){return Yo(e,t,n)}):G(e,t,n)}function G(e,t,n){t.status=`fulfilled`,t.value=n,Xo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,qo(e,n)))}function Yo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Xo(t),t=t.next;while(t!==r)}e.action=null}function Xo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zo(e,t){return t}function Qo(e,t){if(H){var n=Ll.formState;if(n!==null){a:{var r=U;if(H){if(ji){b:{for(var i=ji,a=Ni;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){ji=cf(i.nextSibling),r=i.data===`F!`;break a}}Fi(r)}r=!1}r&&(t=n[0])}}return n=Oo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zo,lastRenderedState:t},n.queue=r,n=As.bind(null,U,r),r.dispatch=n,r=Wo(!1),a=Ms.bind(null,U,!1,r.queue),r=Oo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ko.bind(null,U,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function $o(e){return es(ko(),uo,e)}function es(e,t,n){if(t=Io(e,t,Zo)[0],e=Fo(Po)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=jo(t)}catch(e){throw e===ya?xa:e}else r=t;t=ko();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(U.flags|=2048,rs(9,{destroy:void 0},ts.bind(null,i,n),null)),[r,a,e]}function ts(e,t){e.action=t}function ns(e){var t=ko(),n=uo;if(n!==null)return es(t,n,e);ko(),t=t.memoizedState,n=ko();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=U.updateQueue,t===null&&(t=Ao(),U.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 is(){return ko().memoizedState}function as(e,t,n,r){var i=Oo();U.flags|=e,i.memoizedState=rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function os(e,t,n,r){var i=ko();r=r===void 0?null:r;var a=i.memoizedState.inst;uo!==null&&r!==null&&bo(r,uo.memoizedState.deps)?i.memoizedState=rs(t,a,n,r):(U.flags|=e,i.memoizedState=rs(1|t,a,n,r))}function ss(e,t){as(8390656,8,e,t)}function cs(e,t){os(2048,8,e,t)}function ls(e){U.flags|=4;var t=U.updateQueue;if(t===null)t=Ao(),U.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function us(e){var t=ko().memoizedState;return ls({ref:t,nextImpl:e}),function(){if(J&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ds(e,t){return os(4,2,e,t)}function fs(e,t){return os(4,4,e,t)}function ps(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 ms(e,t,n){n=n==null?null:n.concat([e]),os(4,4,ps.bind(null,t,e),n)}function hs(){}function gs(e,t){var n=ko();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&bo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _s(e,t){var n=ko();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&bo(t,r[1]))return r[0];if(r=e(),mo){L(!0);try{e()}finally{L(!1)}}return n.memoizedState=[r,t],r}function vs(e,t,n){return n===void 0||lo&1073741824&&!(X&261930)?e.memoizedState=t:(e.memoizedState=n,e=pu(),U.lanes|=e,Wl|=e,n)}function ys(e,t,n,r){return yr(n,t)?n:Ya.current===null?!(lo&42)||lo&1073741824&&!(X&261930)?(ec=!0,e.memoizedState=n):(e=pu(),U.lanes|=e,Wl|=e,t):(e=vs(e,n,r),yr(e,t)||(ec=!0),e)}function bs(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,Ms(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?js(e,t,pa(c,r),fu(e)):js(e,t,r,fu(e))}catch(n){js(e,t,{then:function(){},status:`rejected`,reason:n},fu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function xs(){}function Ss(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Cs(e).queue;bs(e,a,t,re,n===null?xs:function(){return ws(e),n(r)})}function Cs(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:Po,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ws(e){var t=Cs(e);t.next===null&&(t=e.alternate.memoizedState),js(e,t.next.queue,{},fu())}function Ts(){return Qi(Qf)}function Es(){return ko().memoizedState}function Ds(){return ko().memoizedState}function Os(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fu();e=Ba(n);var r=Va(t,e,n);r!==null&&(mu(r,t,n),Ha(r,t,n)),t={cache:aa()},e.payload=t;return}t=t.return}}function ks(e,t,n){var r=fu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ns(e)?Ps(t,n):(n=$r(e,t,n,r),n!==null&&(mu(n,e,r),Fs(n,t,r)))}function As(e,t,n){js(e,t,n,fu())}function js(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ns(e))Ps(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,yr(s,o))return Qr(e,t,i,0),Ll===null&&Zr(),!1}catch{}if(n=$r(e,t,i,r),n!==null)return mu(n,e,r),Fs(n,t,r),!0}return!1}function Ms(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ns(e)){if(t)throw Error(i(479))}else t=$r(e,n,r,2),t!==null&&mu(t,e,2)}function Ns(e){var t=e.alternate;return e===U||t!==null&&t===U}function Ps(e,t){po=fo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}var K={readContext:Qi,use:Mo,useCallback:yo,useContext:yo,useEffect:yo,useImperativeHandle:yo,useLayoutEffect:yo,useInsertionEffect:yo,useMemo:yo,useReducer:yo,useRef:yo,useState:yo,useDebugValue:yo,useDeferredValue:yo,useTransition:yo,useSyncExternalStore:yo,useId:yo,useHostTransitionStatus:yo,useFormState:yo,useActionState:yo,useOptimistic:yo,useMemoCache:yo,useCacheRefresh:yo};K.useEffectEvent=yo;var Is={readContext:Qi,use:Mo,useCallback:function(e,t){return Oo().memoizedState=[e,t===void 0?null:t],e},useContext:Qi,useEffect:ss,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ps.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=Oo();t=t===void 0?null:t;var r=e();if(mo){L(!0);try{e()}finally{L(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Oo();if(n!==void 0){var i=n(t);if(mo){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=ks.bind(null,U,e),[r.memoizedState,e]},useRef:function(e){var t=Oo();return e={current:e},t.memoizedState=e},useState:function(e){e=Wo(e);var t=e.queue,n=As.bind(null,U,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:hs,useDeferredValue:function(e,t){return vs(Oo(),e,t)},useTransition:function(){var e=Wo(!1);return e=bs.bind(null,U,e.queue,!0,!1),Oo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=U,a=Oo();if(H){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Ll===null)throw Error(i(349));X&127||zo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ss(Vo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},Bo.bind(null,r,o,n,t),null),n},useId:function(){var e=Oo(),t=Ll.identifierPrefix;if(H){var n=wi,r=Ci;n=(r&~(1<<32-R(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=ho++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=vo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ts,useFormState:Qo,useActionState:Qo,useOptimistic:function(e){var t=Oo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ms.bind(null,U,!0,n),n.dispatch=t,[e,t]},useMemoCache:No,useCacheRefresh:function(){return Oo().memoizedState=Os.bind(null,U)},useEffectEvent:function(e){var t=Oo(),n={impl:e};return t.memoizedState=n,function(){if(J&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ls={readContext:Qi,use:Mo,useCallback:gs,useContext:Qi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Fo,useRef:is,useState:function(){return Fo(Po)},useDebugValue:hs,useDeferredValue:function(e,t){return ys(ko(),uo.memoizedState,e,t)},useTransition:function(){var e=Fo(Po)[0],t=ko().memoizedState;return[typeof e==`boolean`?e:jo(e),t]},useSyncExternalStore:Ro,useId:Es,useHostTransitionStatus:Ts,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){return Go(ko(),uo,e,t)},useMemoCache:No,useCacheRefresh:Ds};Ls.useEffectEvent=us;var Rs={readContext:Qi,use:Mo,useCallback:gs,useContext:Qi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Lo,useRef:is,useState:function(){return Lo(Po)},useDebugValue:hs,useDeferredValue:function(e,t){var n=ko();return uo===null?vs(n,e,t):ys(n,uo.memoizedState,e,t)},useTransition:function(){var e=Lo(Po)[0],t=ko().memoizedState;return[typeof e==`boolean`?e:jo(e),t]},useSyncExternalStore:Ro,useId:Es,useHostTransitionStatus:Ts,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){var n=ko();return uo===null?(n.baseState=e,[e,n.queue.dispatch]):Go(n,uo,e,t)},useMemoCache:No,useCacheRefresh:Ds};Rs.useEffectEvent=us;function zs(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 Bs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=fu(),i=Ba(r);i.payload=t,n!=null&&(i.callback=n),t=Va(e,i,r),t!==null&&(mu(t,e,r),Ha(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=fu(),i=Ba(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Va(e,i,r),t!==null&&(mu(t,e,r),Ha(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fu(),r=Ba(n);r.tag=2,t!=null&&(r.callback=t),t=Va(e,r,n),t!==null&&(mu(t,e,n),Ha(t,e,n))}};function Vs(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?!br(n,r)||!br(i,a):!0}function Hs(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&&Bs.enqueueReplaceState(t,t.state,null)}function Us(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 Ws(e){qr(e)}function Gs(e){console.error(e)}function Ks(e){qr(e)}function qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Js(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 Ys(e,t,n){return n=Ba(n),n.tag=3,n.payload={element:null},n.callback=function(){qs(e,t)},n}function Xs(e){return e=Ba(e),e.tag=3,e}function Zs(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(){Js(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Js(t,n,r),typeof i!=`function`&&(nu===null?nu=new Set([this]):nu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Qs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Yi(t,n,a,!0),n=eo.current,n!==null){switch(n.tag){case 31:case 13:return to===null?Eu():n.alternate===null&&Ul===0&&(Ul=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Sa?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===Sa?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),Eu(),!1}if(H)return t=eo.current,t===null?(r!==Pi&&(t=Error(i(423),{cause:r}),Vi(hi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=hi(r,n),a=Ys(e.stateNode,r,a),Ua(e,a),Ul!==4&&(Ul=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Pi&&(e=Error(i(422),{cause:r}),Vi(hi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=hi(o,n),Yl===null?Yl=[o]:Yl.push(o),Ul!==4&&(Ul=2),t===null)return!0;r=hi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ys(n.stateNode,r,e),Ua(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`&&(nu===null||!nu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Xs(a),Zs(a,e,n,r),Ua(n,a),!1}n=n.return}while(n!==null);return!1}var $s=Error(i(461)),ec=!1;function tc(e,t,n,r){t.child=e===null?Ia(t,null,n,r):Fa(t,e.child,n,r)}function nc(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 Zi(t),r=xo(e,t,n,o,a,i),s=To(),e!==null&&!ec?(Eo(e,t,i),Tc(e,t,i)):(H&&s&&Di(t),t.flags|=1,tc(e,t,r,i),t.child)}function rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!oi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ic(e,t,a,r,i)):(e=li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ec(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?br:n,n(o,r)&&e.ref===t.ref)return Tc(e,t,i)}return t.flags|=1,e=si(a,r),e.ref=t.ref,e.return=t,t.child=e}function ic(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(br(a,r)&&e.ref===t.ref)if(ec=!1,t.pendingProps=r=a,Ec(e,i))e.flags&131072&&(ec=!0);else return t.lanes=e.lanes,Tc(e,t,i)}return fc(e,t,n,r,i)}function ac(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 sc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&_a(t,a===null?null:a.cachePool),a===null?Qa():Za(t,a),io(t);else return r=t.lanes=536870912,sc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&_a(t,null),Qa(),ao(t)):(_a(t,a.cachePool),Za(t,a),ao(t),t.memoizedState=null);return tc(e,t,i,n),t.child}function oc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function sc(e,t,n,r,i){var a=ga();return a=a===null?null:{parent:ia._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&_a(t,null),Qa(),io(t),e!==null&&Yi(e,t,r,!0),t.childLanes=i,null}function cc(e,t){return t=xc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lc(e,t,n){return Fa(t,e.child,null,n),e=cc(t,t.pendingProps),e.flags|=2,oo(t),t.memoizedState=null,e}function uc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(H){if(r.mode===`hidden`)return e=cc(t,r),t.lanes=536870912,oc(null,e);if(ro(t),(e=ji)?(e=rf(e,Ni),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Fi(t);return t.lanes=536870912,null}return cc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ro(t),a)if(t.flags&256)t.flags&=-257,t=lc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(ec||Yi(e,t,n,!1),a=(n&e.childLanes)!==0,ec||a){if(r=Ll,r!==null&&(s=z(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ei(e,s),mu(r,e,s),$s;Eu(),t=lc(e,t,n)}else e=o.treeContext,ji=cf(s.nextSibling),Ai=t,H=!0,Mi=null,Ni=!1,e!==null&&ki(t,e),t=cc(t,r),t.flags|=4096;return t}return e=si(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function dc(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 fc(e,t,n,r,i){return Zi(t),n=xo(e,t,n,r,void 0,i),r=To(),e!==null&&!ec?(Eo(e,t,i),Tc(e,t,i)):(H&&r&&Di(t),t.flags|=1,tc(e,t,n,i),t.child)}function pc(e,t,n,r,i,a){return Zi(t),t.updateQueue=null,n=Co(t,r,n,i),So(e),r=To(),e!==null&&!ec?(Eo(e,t,a),Tc(e,t,a)):(H&&r&&Di(t),t.flags|=1,tc(e,t,n,a),t.child)}function mc(e,t,n,r,i){if(Zi(t),t.stateNode===null){var a=ri,o=n.contextType;typeof o==`object`&&o&&(a=Qi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Bs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ra(t),o=n.contextType,a.context=typeof o==`object`&&o?Qi(o):ri,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(zs(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&&Bs.enqueueReplaceState(a,a.state,null),Ka(t,r,a,i),Ga(),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=Us(n,s);a.props=c;var l=a.context,u=n.contextType;o=ri,typeof u==`object`&&u&&(o=Qi(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)&&Hs(t,a,r,o),La=!1;var f=t.memoizedState;a.state=f,Ka(t,r,a,i),Ga(),l=t.memoizedState,s||f!==l||La?(typeof d==`function`&&(zs(t,n,d,r),l=t.memoizedState),(c=La||Vs(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,za(e,t),o=t.memoizedProps,u=Us(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ri,typeof l==`object`&&l&&(c=Qi(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)&&Hs(t,a,r,c),La=!1,f=t.memoizedState,a.state=f,Ka(t,r,a,i),Ga();var p=t.memoizedState;o!==d||f!==p||La||e!==null&&e.dependencies!==null&&Xi(e.dependencies)?(typeof s==`function`&&(zs(t,n,s,r),p=t.memoizedState),(u=La||Vs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Xi(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,dc(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=Fa(t,e.child,null,i),t.child=Fa(t,null,n,i)):tc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Tc(e,t,i),e}function hc(e,t,n,r){return zi(),t.flags|=256,tc(e,t,n,r),t.child}var gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _c(e){return{baseLanes:e,cachePool:va()}}function vc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ql),e}function yc(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:(so.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(H){if(a?no(t):ao(t),(e=ji)?(e=rf(e,Ni),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Fi(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(ao(t),a=t.mode,c=xc({mode:`hidden`,children:c},a),r=ui(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=_c(n),r.childLanes=vc(e,s,n),t.memoizedState=gc,oc(null,r)):(no(t),bc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(no(t),t.flags&=-257,t=Sc(e,t,n)):t.memoizedState===null?(ao(t),c=r.fallback,a=t.mode,r=xc({mode:`visible`,children:r.children},a),c=ui(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Fa(t,e.child,null,n),r=t.child,r.memoizedState=_c(n),r.childLanes=vc(e,s,n),t.memoizedState=gc,t=oc(null,r)):(ao(t),t.child=e.child,t.flags|=128,t=null);else if(no(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,Vi({value:r,source:null,stack:null}),t=Sc(e,t,n)}else if(ec||Yi(e,t,n,!1),s=(n&e.childLanes)!==0,ec||s){if(s=Ll,s!==null&&(r=z(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ei(e,r),mu(s,e,r),$s;af(c)||Eu(),t=Sc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ji=cf(c.nextSibling),Ai=t,H=!0,Mi=null,Ni=!1,e!==null&&ki(t,e),t=bc(t,r.children),t.flags|=4096);return t}return a?(ao(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=si(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ui(c,a,n,null),c.flags|=2):c=si(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,oc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=_c(n):(a=c.cachePool,a===null?a=va():(l=ia._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=vc(e,s,n),t.memoizedState=gc,oc(e.child,r)):(no(t),n=e.child,e=n.sibling,n=si(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 bc(e,t){return t=xc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function xc(e,t){return e=ai(22,e,null,t),e.lanes=0,e}function Sc(e,t,n){return Fa(t,e.child,null,n),e=bc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),qi(e.return,t,n)}function q(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 wc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=so.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,I(so,o),tc(e,t,r,n),r=H?yi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cc(e,n,t);else if(e.tag===19)Cc(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&&co(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),q(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&&co(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}q(t,!0,n,null,a,r);break;case`together`:q(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Tc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Yi(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=si(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=si(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ec(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Xi(e))):!0}function Dc(e,t,n){switch(t.tag){case 3:de(t,t.stateNode.containerInfo),Gi(t,ia,e.memoizedState.cache),zi();break;case 27:case 5:pe(t);break;case 4:de(t,t.stateNode.containerInfo);break;case 10:Gi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ro(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(no(t),e=Tc(e,t,n),e===null?null:e.sibling):yc(e,t,n):(no(t),t.flags|=128,null);no(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Yi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return wc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),I(so,so.current),r)break;return null;case 22:return t.lanes=0,ac(e,t,n,t.pendingProps);case 24:Gi(t,ia,e.memoizedState.cache)}return Tc(e,t,n)}function Oc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ec=!0;else{if(!Ec(e,n)&&!(t.flags&128))return ec=!1,Dc(e,t,n);ec=!!(e.flags&131072)}else ec=!1,H&&t.flags&1048576&&Ei(t,yi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ta(t.elementType),t.type=e,typeof e==`function`)oi(e)?(r=Us(e,r),t.tag=1,t=mc(null,t,e,r,n)):(t.tag=0,t=fc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=nc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=rc(null,t,e,r,n);break a}}throw t=M(e)||e,Error(i(306,t,``))}}return t;case 0:return fc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Us(r,t.pendingProps),mc(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,za(e,t),Ka(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Gi(t,ia,r),r!==o.cache&&Ji(t,[ia],n,!0),Ga(),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=hc(e,t,r,n);break a}else if(r!==a){a=hi(Error(i(424)),t),Vi(a),t=hc(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(ji=cf(e.firstChild),Ai=t,H=!0,Mi=null,Ni=!0,n=Ia(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(zi(),r===a){t=Tc(e,t,n);break a}tc(e,t,r,n)}t=t.child}return t;case 26:return dc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:H||(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&&H&&(r=t.stateNode=ff(t.type,t.pendingProps,le.current),Ai=t,Ni=!0,a=ji,Zd(t.type)?(lf=a,ji=cf(r.firstChild)):ji=a),tc(e,t,t.pendingProps.children,n),dc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&H&&((a=r=ji)&&(r=tf(r,t.type,t.pendingProps,Ni),r===null?a=!1:(t.stateNode=r,Ai=t,ji=cf(r.firstChild),Ni=!1,a=!0)),a||Fi(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=xo(e,t,wo,null,null,n),Qf._currentValue=a),dc(e,t),tc(e,t,r,n),t.child;case 6:return e===null&&H&&((e=n=ji)&&(n=nf(n,t.pendingProps,Ni),n===null?e=!1:(t.stateNode=n,Ai=t,ji=null,e=!0)),e||Fi(t)),null;case 13:return yc(e,t,n);case 4:return de(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Fa(t,null,r,n):tc(e,t,r,n),t.child;case 11:return nc(e,t,t.type,t.pendingProps,n);case 7:return tc(e,t,t.pendingProps,n),t.child;case 8:return tc(e,t,t.pendingProps.children,n),t.child;case 12:return tc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Gi(t,t.type,r.value),tc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Zi(t),a=Qi(a),r=r(a),t.flags|=1,tc(e,t,r,n),t.child;case 14:return rc(e,t,t.type,t.pendingProps,n);case 15:return ic(e,t,t.type,t.pendingProps,n);case 19:return wc(e,t,n);case 31:return uc(e,t,n);case 22:return ac(e,t,n,t.pendingProps);case 24:return Zi(t),r=Qi(ia),e===null?(a=ga(),a===null&&(a=Ll,o=aa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ra(t),Gi(t,ia,a)):((e.lanes&n)!==0&&(za(e,t),Ka(t,null,null,n),Ga()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Gi(t,ia,r),r!==a.cache&&Ji(t,[ia],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Gi(t,ia,r))),tc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function kc(e){e.flags|=4}function Ac(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(Cu())e.flags|=8192;else throw Ea=Sa,ba}else e.flags&=-16777217}function jc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(Cu())e.flags|=8192;else throw Ea=Sa,ba}function Mc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Je(),e.lanes|=t,Jl|=t)}function Nc(e,t){if(!H)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 Pc(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 Fc(e,t,n){var r=t.pendingProps;switch(Oi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pc(t),null;case 1:return Pc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ki(ia),fe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ri(t)?kc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Bi())),Pc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(kc(t),o===null?(Pc(t),Ac(t,a,null,r,n)):(Pc(t),jc(t,o))):o?o===e.memoizedState?(Pc(t),t.flags&=-16777217):(kc(t),Pc(t),jc(t,o)):(e=e.memoizedProps,e!==r&&kc(t),Pc(t),Ac(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&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}e=se.current,Ri(t)?Ii(t,e):(e=ff(a,r,n),t.stateNode=e,kc(t))}return Pc(t),null;case 5:if(me(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}if(o=se.current,Ri(t))Ii(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&&kc(t)}}return Pc(t),Ac(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=le.current,Ri(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ai,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||Fi(t,!0)}else e=Bd(e).createTextNode(r),e[at]=t,t.stateNode=e}return Pc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ri(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 zi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),e=!1}else n=Bi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(oo(t),t):(oo(t),null);if(t.flags&128)throw Error(i(558))}return Pc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ri(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 zi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),a=!1}else a=Bi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(oo(t),t):(oo(t),null)}return oo(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),Mc(t,t.updateQueue),Pc(t),null);case 4:return fe(),e===null&&xd(t.stateNode.containerInfo),Pc(t),null;case 10:return Ki(t.type),Pc(t),null;case 19:if(F(so),r=t.memoizedState,r===null)return Pc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Nc(r,!1);else{if(Ul!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=co(e),o!==null){for(t.flags|=128,Nc(r,!1),e=o.updateQueue,t.updateQueue=e,Mc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ci(n,e),n=n.sibling;return I(so,so.current&1|2),H&&Ti(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&De()>eu&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304)}else{if(!a)if(e=co(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Mc(t,e),Nc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!H)return Pc(t),null}else 2*De()-r.renderingStartTime>eu&&n!==536870912&&(t.flags|=128,a=!0,Nc(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?(Pc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=De(),e.sibling=null,n=so.current,I(so,a?n&1|2:n&1),H&&Ti(t,r.treeForkCount),e);case 22:case 23:return oo(t),$a(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Pc(t),t.subtreeFlags&6&&(t.flags|=8192)):Pc(t),n=t.updateQueue,n!==null&&Mc(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(ha),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ki(ia),Pc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Ic(e,t){switch(Oi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ki(ia),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(oo(t),t.alternate===null)throw Error(i(340));zi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(oo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));zi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return F(so),null;case 4:return fe(),null;case 10:return Ki(t.type),null;case 22:case 23:return oo(t),$a(),e!==null&&F(ha),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ki(ia),null;case 25:return null;default:return null}}function Lc(e,t){switch(Oi(t),t.tag){case 3:Ki(ia),fe();break;case 26:case 27:case 5:me(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&oo(t);break;case 13:oo(t);break;case 19:F(so);break;case 10:Ki(t.type);break;case 22:case 23:oo(t),$a(),e!==null&&F(ha);break;case 24:Ki(ia)}}function Rc(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){Q(t,t.return,e)}}function zc(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){Q(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Q(t,t.return,e)}}function Bc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ja(t,n)}catch(t){Q(e,e.return,t)}}}function Vc(e,t,n){n.props=Us(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Q(e,t,n)}}function Hc(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){Q(e,t,n)}}function Uc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Q(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){Q(e,t,n)}else n.current=null}function Wc(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){Q(e,e.return,t)}}function Gc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[ot]=t}catch(t){Q(e,e.return,t)}}function Kc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Kc(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 Jc(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=Qt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(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(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(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){Q(e,e.return,t)}}var Zc=!1,Qc=!1,$c=!1,el=typeof WeakSet==`function`?WeakSet:Set,tl=null;function nl(e,t){if(e=e.containerInfo,Rd=sp,e=wr(e),Tr(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,tl=t;tl!==null;)if(t=tl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,tl=e;else for(;tl!==null;){switch(t=tl,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=Us(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Q(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,tl=e;break}tl=t.return}}function rl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:vl(e,n),r&4&&Rc(5,n);break;case 1:if(vl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Q(n,n.return,e)}else{var i=Us(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Q(n,n.return,e)}}r&64&&Bc(n),r&512&&Hc(n,n.return);break;case 3:if(vl(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{Ja(e,t)}catch(e){Q(n,n.return,e)}}break;case 27:t===null&&r&4&&Xc(n);case 26:case 5:vl(e,n),t===null&&r&4&&Wc(n),r&512&&Hc(n,n.return);break;case 12:vl(e,n);break;case 31:vl(e,n),r&4&&ll(e,n);break;case 13:vl(e,n),r&4&&ul(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||Zc,!r){t=t!==null&&t.memoizedState!==null||Qc,i=Zc;var a=Qc;Zc=r,(Qc=t)&&!a?bl(e,n,(n.subtreeFlags&8772)!=0):vl(e,n),Zc=i,Qc=a}break;case 30:break;default:vl(e,n)}}function il(e){var t=e.alternate;t!==null&&(e.alternate=null,il(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 al=null,ol=!1;function sl(e,t,n){for(n=n.child;n!==null;)cl(e,t,n),n=n.sibling}function cl(e,t,n){if(Le&&typeof Le.onCommitFiberUnmount==`function`)try{Le.onCommitFiberUnmount(Ie,n)}catch{}switch(n.tag){case 26:Qc||Uc(n,t),sl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Qc||Uc(n,t);var r=al,i=ol;Zd(n.type)&&(al=n.stateNode,ol=!1),sl(e,t,n),pf(n.stateNode),al=r,ol=i;break;case 5:Qc||Uc(n,t);case 6:if(r=al,i=ol,al=null,sl(e,t,n),al=r,ol=i,al!==null)if(ol)try{(al.nodeType===9?al.body:al.nodeName===`HTML`?al.ownerDocument.body:al).removeChild(n.stateNode)}catch(e){Q(n,t,e)}else try{al.removeChild(n.stateNode)}catch(e){Q(n,t,e)}break;case 18:al!==null&&(ol?(e=al,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(al,n.stateNode));break;case 4:r=al,i=ol,al=n.stateNode.containerInfo,ol=!0,sl(e,t,n),al=r,ol=i;break;case 0:case 11:case 14:case 15:zc(2,n,t),Qc||zc(4,n,t),sl(e,t,n);break;case 1:Qc||(Uc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Vc(n,t,r)),sl(e,t,n);break;case 21:sl(e,t,n);break;case 22:Qc=(r=Qc)||n.memoizedState!==null,sl(e,t,n),Qc=r;break;default:sl(e,t,n)}}function ll(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Q(t,t.return,e)}}}function ul(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){Q(t,t.return,e)}}function dl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new el),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new el),t;default:throw Error(i(435,e.tag))}}function fl(e,t){var n=dl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function pl(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)){al=c.stateNode,ol=!1;break a}break;case 5:al=c.stateNode,ol=!1;break a;case 3:case 4:al=c.stateNode.containerInfo,ol=!0;break a}c=c.return}if(al===null)throw Error(i(160));cl(o,s,a),al=null,ol=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)hl(t,e),t=t.sibling}var ml=null;function hl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pl(t,e),gl(e),r&4&&(zc(3,e,e.return),Rc(3,e),zc(5,e,e.return));break;case 1:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&64&&Zc&&(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=ml;if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(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&&Gc(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:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),n!==null&&r&4&&Gc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),e.flags&32){a=e.stateNode;try{Wt(a,``)}catch(t){Q(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Gc(e,a,n===null?a:n.memoizedProps)),r&1024&&($c=!0);break;case 6:if(pl(t,e),gl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Q(e,e.return,t)}}break;case 3:if(Bf=null,a=ml,ml=gf(t.containerInfo),pl(t,e),ml=a,gl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Q(e,e.return,t)}$c&&($c=!1,_l(e));break;case 4:r=ml,ml=gf(e.stateNode.containerInfo),pl(t,e),gl(e),ml=r;break;case 12:pl(t,e),gl(e);break;case 31:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 13:pl(t,e),gl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ql=De()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Zc,d=Qc;if(Zc=u||a,Qc=d||l,pl(t,e),Qc=d,Zc=u,gl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Zc||Qc||yl(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){Q(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Q(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){Q(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,fl(e,n))));break;case 19:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 30:break;case 21:break;default:pl(t,e),gl(e)}}function gl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Kc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Yc(e,qc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Wt(o,``),n.flags&=-33),Yc(e,qc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Jc(e,qc(e),s);break;default:throw Error(i(161))}}catch(t){Q(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _l(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;_l(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function vl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)rl(e,t.alternate,t),t=t.sibling}function yl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:zc(4,t,t.return),yl(t);break;case 1:Uc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Vc(t,t.return,n),yl(t);break;case 27:pf(t.stateNode);case 26:case 5:Uc(t,t.return),yl(t);break;case 22:t.memoizedState===null&&yl(t);break;case 30:yl(t);break;default:yl(t)}e=e.sibling}}function bl(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:bl(i,a,n),Rc(4,a);break;case 1:if(bl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Q(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++)qa(c[i],s)}catch(e){Q(r,r.return,e)}}n&&o&64&&Bc(a),Hc(a,a.return);break;case 27:Xc(a);case 26:case 5:bl(i,a,n),n&&r===null&&o&4&&Wc(a),Hc(a,a.return);break;case 12:bl(i,a,n);break;case 31:bl(i,a,n),n&&o&4&&ll(i,a);break;case 13:bl(i,a,n),n&&o&4&&ul(i,a);break;case 22:a.memoizedState===null&&bl(i,a,n),Hc(a,a.return);break;case 30:break;default:bl(i,a,n)}t=t.sibling}}function xl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&oa(n))}function Sl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&oa(e))}function Cl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wl(e,t,n,r),t=t.sibling}function wl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Cl(e,t,n,r),i&2048&&Rc(9,t);break;case 1:Cl(e,t,n,r);break;case 3:Cl(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&&oa(e)));break;case 12:if(i&2048){Cl(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){Q(t,t.return,e)}}else Cl(e,t,n,r);break;case 31:Cl(e,t,n,r);break;case 13:Cl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Cl(e,t,n,r):(a._visibility|=2,Tl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Cl(e,t,n,r):El(e,t),i&2048&&xl(o,t);break;case 24:Cl(e,t,n,r),i&2048&&Sl(t.alternate,t);break;default:Cl(e,t,n,r)}}function Tl(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:Tl(a,o,s,c,i),Rc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Tl(a,o,s,c,i)):u._visibility&2?Tl(a,o,s,c,i):El(a,o),i&&l&2048&&xl(o.alternate,o);break;case 24:Tl(a,o,s,c,i),i&&l&2048&&Sl(o.alternate,o);break;default:Tl(a,o,s,c,i)}t=t.sibling}}function El(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:El(n,r),i&2048&&xl(r.alternate,r);break;case 24:El(n,r),i&2048&&Sl(r.alternate,r);break;default:El(n,r)}t=t.sibling}}var Dl=8192;function Ol(e,t,n){if(e.subtreeFlags&Dl)for(e=e.child;e!==null;)kl(e,t,n),e=e.sibling}function kl(e,t,n){switch(e.tag){case 26:Ol(e,t,n),e.flags&Dl&&e.memoizedState!==null&&Gf(n,ml,e.memoizedState,e.memoizedProps);break;case 5:Ol(e,t,n);break;case 3:case 4:var r=ml;ml=gf(e.stateNode.containerInfo),Ol(e,t,n),ml=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Dl,Dl=16777216,Ol(e,t,n),Dl=r):Ol(e,t,n));break;default:Ol(e,t,n)}}function Al(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 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];tl=r,Pl(r,e)}Al(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ml(e),e=e.sibling}function Ml(e){switch(e.tag){case 0:case 11:case 15:jl(e),e.flags&2048&&zc(9,e,e.return);break;case 3:jl(e);break;case 12:jl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Nl(e)):jl(e);break;default:jl(e)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:zc(8,t,t.return),Nl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Nl(t));break;default:Nl(t)}e=e.sibling}}function Pl(e,t){for(;tl!==null;){var n=tl;switch(n.tag){case 0:case 11:case 15:zc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:oa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,tl=r;else a:for(n=e;tl!==null;){r=tl;var i=r.sibling,a=r.return;if(il(r),r===n){tl=null;break a}if(i!==null){i.return=a,tl=i;break a}tl=a}}}var Fl={getCacheForType:function(e){var t=Qi(ia),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Qi(ia).controller.signal}},Il=typeof WeakMap==`function`?WeakMap:Map,J=0,Ll=null,Y=null,X=0,Z=0,Rl=null,zl=!1,Bl=!1,Vl=!1,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=null,Xl=null,Zl=!1,Ql=0,$l=0,eu=1/0,tu=null,nu=null,ru=0,iu=null,au=null,ou=0,su=0,cu=null,lu=null,uu=0,du=null;function fu(){return J&2&&X!==0?X&-X:N.T===null?nt():ud()}function pu(){if(ql===0)if(!(X&536870912)||H){var e=He;He<<=1,!(He&3932160)&&(He=262144),ql=e}else ql=536870912;return e=eo.current,e!==null&&(e.flags|=32),ql}function mu(e,t,n){(e===Ll&&(Z===2||Z===9)||e.cancelPendingCommit!==null)&&(xu(e,0),vu(e,X,ql,!1)),Xe(e,n),(!(J&2)||e!==Ll)&&(e===Ll&&(!(J&2)&&(Gl|=n),Ul===4&&vu(e,X,ql,!1)),nd(e))}function hu(e,t,n){if(J&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ke(e,t),a=r?ku(e,t):Du(e,t,!0),o=r;do{if(a===0){Bl&&!r&&vu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!_u(n)){a=Du(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=Yl;var l=c.current.memoizedState.isDehydrated;if(l&&(xu(c,s).flags|=256),s=Du(c,s,!1),s!==2){if(Vl&&!l){c.errorRecoveryDisabledLanes|=o,Gl|=o,a=4;break a}o=Xl,Xl=a,o!==null&&(Xl===null?Xl=o:Xl.push.apply(Xl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){xu(e,0),vu(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:vu(r,t,ql,!zl);break a;case 2:Xl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Ql+300-De(),10<a)){if(vu(r,t,ql,!zl),Ge(r,0,!0)!==0)break a;ou=t,r.timeoutHandle=Kd(gu.bind(null,r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,o,`Throttled`,-0,0),a);break a}gu(r,n,Xl,tu,Zl,t,ql,Gl,Jl,zl,o,null,-0,0)}}break}while(1);nd(e)}function gu(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:Qt},kl(t,a,d);var m=(a&62914560)===a?Ql-De():(a&4194048)===a?$l-De():0;if(m=qf(d,m),m!==null){ou=a,e.cancelPendingCommit=m(Iu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),vu(e,a,o,!l);return}}Iu(e,t,a,n,r,i,o,s,c)}function _u(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(!yr(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 vu(e,t,n,r){t&=~Kl,t&=~Gl,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 yu(){return J&6?!0:(rd(0,!1),!1)}function bu(){if(Y!==null){if(Z===0)var e=Y.return;else e=Y,Wi=Ui=null,Do(e),ka=null,Aa=0,e=Y;for(;e!==null;)Lc(e.alternate,e),e=e.return;Y=null}}function xu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ou=0,bu(),Ll=e,Y=n=si(e.current,null),X=t,Z=0,Rl=null,zl=!1,Bl=Ke(e,t),Vl=!1,Jl=ql=Kl=Gl=Wl=Ul=0,Xl=Yl=null,Zl=!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 Hl=t,Zr(),n}function Su(e,t){U=null,N.H=K,t===ya||t===xa?(t=Da(),Z=3):t===ba?(t=Da(),Z=4):Z=t===$s?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Rl=t,Y===null&&(Ul=1,qs(e,hi(t,e.current)))}function Cu(){var e=eo.current;return e===null?!0:(X&4194048)===X?to===null:(X&62914560)===X||X&536870912?e===to:!1}function wu(){var e=N.H;return N.H=K,e===null?K:e}function Tu(){var e=N.A;return N.A=Fl,e}function Eu(){Ul=4,zl||(X&4194048)!==X&&eo.current!==null||(Bl=!0),!(Wl&134217727)&&!(Gl&134217727)||Ll===null||vu(Ll,X,ql,!1)}function Du(e,t,n){var r=J;J|=2;var i=wu(),a=Tu();(Ll!==e||X!==t)&&(tu=null,xu(e,t)),t=!1;var o=Ul;a:do try{if(Z!==0&&Y!==null){var s=Y,c=Rl;switch(Z){case 8:bu(),o=6;break a;case 3:case 2:case 9:case 6:eo.current===null&&(t=!0);var l=Z;if(Z=0,Rl=null,Nu(e,s,c,l),n&&Bl){o=0;break a}break;default:l=Z,Z=0,Rl=null,Nu(e,s,c,l)}}Ou(),o=Ul;break}catch(t){Su(e,t)}while(1);return t&&e.shellSuspendCounter++,Wi=Ui=null,J=r,N.H=i,N.A=a,Y===null&&(Ll=null,X=0,Zr()),o}function Ou(){for(;Y!==null;)ju(Y)}function ku(e,t){var n=J;J|=2;var r=wu(),a=Tu();Ll!==e||X!==t?(tu=null,eu=De()+500,xu(e,t)):Bl=Ke(e,t);a:do try{if(Z!==0&&Y!==null){t=Y;var o=Rl;b:switch(Z){case 1:Z=0,Rl=null,Nu(e,t,o,1);break;case 2:case 9:if(Ca(o)){Z=0,Rl=null,Mu(t);break}t=function(){Z!==2&&Z!==9||Ll!==e||(Z=7),nd(e)},o.then(t,t);break a;case 3:Z=7;break a;case 4:Z=5;break a;case 7:Ca(o)?(Z=0,Rl=null,Mu(t)):(Z=0,Rl=null,Nu(e,t,o,7));break;case 5:var s=null;switch(Y.tag){case 26:s=Y.memoizedState;case 5:case 27:var c=Y;if(s?Wf(s):c.stateNode.complete){Z=0,Rl=null;var l=c.sibling;if(l!==null)Y=l;else{var u=c.return;u===null?Y=null:(Y=u,Pu(u))}break b}}Z=0,Rl=null,Nu(e,t,o,5);break;case 6:Z=0,Rl=null,Nu(e,t,o,6);break;case 8:bu(),Ul=6;break a;default:throw Error(i(462))}}Au();break}catch(t){Su(e,t)}while(1);return Wi=Ui=null,N.H=r,N.A=a,J=n,Y===null?(Ll=null,X=0,Zr(),Ul):0}function Au(){for(;Y!==null&&!Te();)ju(Y)}function ju(e){var t=Oc(e.alternate,e,Hl);e.memoizedProps=e.pendingProps,t===null?Pu(e):Y=t}function Mu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=pc(n,t,t.pendingProps,t.type,void 0,X);break;case 11:t=pc(n,t,t.pendingProps,t.type.render,t.ref,X);break;case 5:Do(t);default:Lc(n,t),t=Y=ci(t,Hl),t=Oc(n,t,Hl)}e.memoizedProps=e.pendingProps,t===null?Pu(e):Y=t}function Nu(e,t,n,r){Wi=Ui=null,Do(t),ka=null,Aa=0;var i=t.return;try{if(Qs(e,i,t,n,X)){Ul=1,qs(e,hi(n,e.current)),Y=null;return}}catch(t){if(i!==null)throw Y=i,t;Ul=1,qs(e,hi(n,e.current)),Y=null;return}t.flags&32768?(H||r===1?e=!0:Bl||X&536870912?e=!1:(zl=e=!0,(r===2||r===9||r===3||r===6)&&(r=eo.current,r!==null&&r.tag===13&&(r.flags|=16384))),Fu(t,e)):Pu(t)}function Pu(e){var t=e;do{if(t.flags&32768){Fu(t,zl);return}e=t.return;var n=Fc(t.alternate,t,Hl);if(n!==null){Y=n;return}if(t=t.sibling,t!==null){Y=t;return}Y=t=e}while(t!==null);Ul===0&&(Ul=5)}function Fu(e,t){do{var n=Ic(e.alternate,e);if(n!==null){n.flags&=32767,Y=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Y=e;return}Y=e=n}while(e!==null);Ul=6,Y=null}function Iu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Vu();while(ru!==0);if(J&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Xr,Ze(e,n,o,s,c,l),e===Ll&&(Y=Ll=null,X=0),au=t,iu=e,ou=n,su=o,cu=a,lu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Yu(je,function(){return Hu(),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=J,J|=4;try{nl(e,t,n)}finally{J=s,P.p=a,N.T=r}}ru=1,Lu(),Ru(),zu()}}function Lu(){if(ru===1){ru=0;var e=iu,t=au,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=J;J|=4;try{hl(t,e);var a=zd,o=wr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Cr(s.ownerDocument.documentElement,s)){if(c!==null&&Tr(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 _=Sr(s,h),v=Sr(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{J=i,P.p=r,N.T=n}}e.current=t,ru=2}}function Ru(){if(ru===2){ru=0;var e=iu,t=au,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=J;J|=4;try{rl(e,t.alternate,t)}finally{J=i,P.p=r,N.T=n}}ru=3}}function zu(){if(ru===4||ru===3){ru=0,Ee();var e=iu,t=au,n=ou,r=lu;t.subtreeFlags&10256||t.flags&10256?ru=5:(ru=0,au=iu=null,Bu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(nu=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}}ou&3&&Vu(),nd(e),i=e.pendingLanes,n&261930&&i&42?e===du?uu++:(uu=0,du=e):uu=0,rd(0,!1)}}function Bu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,oa(t)))}function Vu(){return Lu(),Ru(),zu(),Hu()}function Hu(){if(ru!==5)return!1;var e=iu,t=su;su=0;var n=tt(ou),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=cu,cu=null;var o=iu,s=ou;if(ru=0,au=iu=null,ou=0,J&6)throw Error(i(331));var c=J;if(J|=4,Ml(o.current),wl(o,o.current,s,n),J=c,rd(0,!1),Le&&typeof Le.onPostCommitFiberRoot==`function`)try{Le.onPostCommitFiberRoot(Ie,o)}catch{}return!0}finally{P.p=a,N.T=r,Bu(e,t)}}function Uu(e,t,n){t=hi(n,t),t=Ys(e.stateNode,t,2),e=Va(e,t,2),e!==null&&(Xe(e,2),nd(e))}function Q(e,t,n){if(e.tag===3)Uu(e,e,n);else for(;t!==null;){if(t.tag===3){Uu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(nu===null||!nu.has(r))){e=hi(n,e),n=Xs(2),r=Va(t,n,2),r!==null&&(Zs(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 Il;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)||(Vl=!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,Ll===e&&(X&n)===n&&(Ul===4||Ul===3&&(X&62914560)===X&&300>De()-Ql?!(J&2)&&xu(e,0):Kl|=n,Jl===X&&(Jl=0)),nd(e)}function Ku(e,t){t===0&&(t=Je()),e=ei(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=X,a=Ge(r,r===Ll?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}ru!==0&&ru!==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=Ll,n=X,n=Ge(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Z===2||Z===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(ru!==0&&ru!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Vu()&&e.callbackNode!==n)return null;var r=X;return r=Ge(e,e===Ll?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(hu(e,r,t),od(e,De()),e.callbackNode!=null&&e.callbackNode===n?sd.bind(null,e):null)}function cd(e,t){if(Vu())return null;hu(e,t,!0)}function ld(){Yd(function(){J&6?Ce(ke,id):ad()})}function ud(){if(td===0){var e=la;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:Zt(``+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 yn(`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);Ss(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),Ss(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var md=0;md<Gr.length;md++){var hd=Gr[md];Kr(hd.toLowerCase(),`on`+(hd[0].toUpperCase()+hd.slice(1)))}Kr(Lr,`onAnimationEnd`),Kr(Rr,`onAnimationIteration`),Kr(zr,`onAnimationStart`),Kr(`dblclick`,`onDoubleClick`),Kr(`focusin`,`onFocus`),Kr(`focusout`,`onBlur`),Kr(Br,`onTransitionRun`),Kr(Vr,`onTransitionStart`),Kr(Hr,`onTransitionCancel`),Kr(Ur,`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){qr(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){qr(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,!cn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function 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}an(function(){var r=a,i=$t(n),s=[];a:{var c=Wr.get(e);if(c!==void 0){var l=yn,u=e;switch(e){case`keypress`:if(mn(n)===0)break a;case`keydown`:case`keyup`:l=In;break;case`focusin`:u=`focus`,l=V;break;case`focusout`:u=`blur`,l=V;break;case`beforeblur`:case`afterblur`:l=V;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=En;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Dn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Rn;break;case Lr:case Rr:case zr:l=On;break;case Ur:l=zn;break;case`scroll`:case`scrollend`:l=xn;break;case`wheel`:l=Bn;break;case`copy`:case`cut`:case`paste`:l=kn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Ln;break;case`toggle`:case`beforetoggle`:l=Vn}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=on(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!==B&&(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=En,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Ln,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=sr;else if(tr(c))if(cr)v=_r;else{v=hr;var y=mr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Jt(r.elementType)&&(v=sr):v=gr;if(v&&=v(e,r)){nr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Bt(c,`number`,c.value)}switch(y=r?gt(r):window,e){case`focusin`:(tr(y)||y.contentEditable===`true`)&&(Dr=y,Or=r,kr=null);break;case`focusout`:kr=Or=Dr=null;break;case`mousedown`:Ar=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ar=!1,jr(s,n,i);break;case`selectionchange`:if(Er)break;case`keydown`:case`keyup`:jr(s,n,i)}var b;if(Un)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 Zn?Yn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Kn&&n.locale!==`ko`&&(Zn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Zn&&(b=pn()):(un=i,dn=`value`in un?un.value:un.textContent,Zn=!0)),y=Td(r,x),0<y.length&&(x=new An(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Xn(n),b!==null&&(x.data=b)))),(b=Gn?Qn(e,n):$n(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new An(`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=on(e,n),i!=null&&r.unshift(wd(e,i,a)),i=on(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=on(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=on(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===``||Wt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Wt(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`:qt(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=Zt(``+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=Zt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Qt);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=Zt(``+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=Yt.get(n)||n,Dt(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:qt(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`?Wt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Wt(e,``+r);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Qt);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)}}zt(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&&Vt(e,!!r,n,!0):Vt(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)}Ut(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(Jt(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)}}Rt(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?Vt(e,!!n,n?[]:``,!1):Vt(e,!!n,t,!0)):Vt(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)}Ht(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(Jt(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=yu();return e||t}function yf(e){var t=ht(e);t!==null&&t.tag===5&&t.type===`form`?ws(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=Lt(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="`+Lt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Lt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Lt(n.imageSizes)+`"]`)):i+=`[href="`+Lt(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="`+Lt(r)+`"][href="`+Lt(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="`+Lt(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="`+Lt(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~="`+Lt(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=ai(3,null,null,t),e.current=a,a.stateNode=e,t=aa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ra(a),e}function tp(e){return e?(e=ri,e):ri}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ba(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Va(e,r,t),n!==null&&(mu(n,e,t),Ha(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=ei(e,67108864);t!==null&&mu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=fu();t=et(t);var n=ei(e,t);n!==null&&mu(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),!(J&6)&&(eu=De()+500,rd(0,!1))}}break;case 31:case 13:s=ei(a,2),s!==null&&mu(s,a,2),yu(),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=$t(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);B=r,n.target.dispatchEvent(r),B=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,Ss(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,fu(),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),yu(),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=Ws,s=Gs,c=Ks;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=It((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=Ft(i);o=Mt(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=qt([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:At(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?jt(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 At(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 jt(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 Mt(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=Nt({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=Nt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:qt([a,u.pathname]),pathnameBase:Yt(qt([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=qt([a,u.pathnameBase]))}return o}function Nt(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Pt(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 Pt(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 Ft(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 It(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 Lt({basename:e,pathname:t}){return t===`/`?e:qt([e,t])}var Rt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,zt=e=>Rt.test(e);function Bt(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?at(e):e,a;return n?(n=Kt(n),a=n.startsWith(`/`)?Vt(n.substring(1),`/`):Vt(n,t)):a=t,{pathname:a,search:Xt(r),hash:Zt(i)}}function Vt(e,t){let n=Jt(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Ht(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 Ut(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Wt(e){let t=Ut(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Gt(e,t,n,r=!1){let i;typeof e==`string`?i=at(e):(i={...e},z(!i.pathname||!i.pathname.includes(`?`),Ht(`?`,`pathname`,`search`,i)),z(!i.pathname||!i.pathname.includes(`#`),Ht(`#`,`pathname`,`hash`,i)),z(!i.search||!i.search.includes(`#`),Ht(`#`,`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=Bt(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Kt=e=>e.replace(/\/\/+/g,`/`),qt=e=>Kt(e.join(`/`)),Jt=e=>e.replace(/\/+$/,``),Yt=e=>Jt(e).replace(/^\/*/,`/`),Xt=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Zt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Qt=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 B(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function $t(e){return qt(e.map(e=>e.route.path).filter(Boolean))||`/`}var en=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function tn(e,t){let n=e;if(typeof n!=`string`||!Rt.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(en)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=It(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 nn=Symbol(`Uninstrumented`);function rn(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=on(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=on(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[nn]??i,a=on(n[e],t,(...e)=>cn(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[nn]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[nn]??e,r=on(n.middleware,t,(...e)=>cn(e[0]));return r?(r[nn]=t,r):e})),r}function an(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[nn]??e.navigate,r=on(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?it(n):`.`,...ln(e,r??{})}});r&&(r[nn]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[nn]??e.fetch,r=on(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...ln(e,i??{})}});r&&(r[nn]=t,e.fetch=r)}return e}function on(e,t,n){return e.length===0?null:async(...r)=>{let i=await sn(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function sn(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=sn(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 cn(e){let{request:t,context:n,params:r,unstable_pattern:i}=e;return{request:un(t),params:{...r},unstable_pattern:i,context:dn(n)}}function ln(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 un(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function dn(e){if(pn(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var fn=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function pn(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`)===fn}var mn=[`POST`,`PUT`,`PATCH`,`DELETE`],hn=new Set(mn),gn=[`GET`,...mn],_n=new Set(gn),vn=new Set([301,302,303,307,308]),yn=new Set([307,308]),bn={state:`idle`,location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},xn={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Sn={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Cn=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),wn=`remix-router-transitions`,Tn=Symbol(`ResetLoaderData`);function En(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||Cn,a=i;if(e.unstable_instrumentations){let t=e.unstable_instrumentations;a=e=>({...i(e),...rn(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||Hn,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=fr(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=dr(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=>An(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=jn(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:bn,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,Sn),fe({blockers:e})}}),E?.resolve(),E=null;return}return ge(t,n)}),n){Ir(t,A);let e=()=>Lr(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&&Dr(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?cr(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,Sn)));let u=j?!1:We(t,n.matches||w.matches),d=D===!0||w.navigation.formMethod!=null&&Dr(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:bn,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||=Rr();let n=E.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=On(!1,V(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&&Dr(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,Sn),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||=Rr(),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&&hr(w.location,n)&&!(r&&r.submission&&Dr(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=nr(e.history,n,O.signal,r&&r.submission),p=e.getContext?await e.getContext():new lt,m;if(r&&r.pendingError)m=[ur(o).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Dr(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(br(r)&&B(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=jr(n,r.submission),u=!1,d.active=!1,f=nr(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,...lr(m),loaderData:_,errors:v}))}async function _e(t,n,i,c,u,d,f,p={}){if(De(),fe({navigation:Mr(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}=dr(s);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=ur(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=kr(c,n);if(!h.route.action&&!h.route.lazy)m={type:`error`,error:fr(405,{method:t.method,pathname:n.pathname,routeId:h.route.id})};else{let e=await Te(t,n,Jn(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(xr(m)){let n;return n=p&&p.replace!=null?p.replace:tr(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(br(m)){let e=ur(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||jr(n,p),x=p||m||Ar(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}=dr(s);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=ur(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}=kn(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&&br(v[1])?{[v[0]]:v[1].error}:null,...lr(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=pr(k);if(ee)return await we(t,ee.result,!0,{replace:h}),{shortCircuited:!0};if(ee=pr(A),ee)return ie.add(ee.key),await we(t,ee.result,!0,{replace:h}),{shortCircuited:!0};let{loaderData:re,errors:oe}=sr(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&&!br(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=Nr(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=V(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,fr(404,{pathname:u}),{flushSync:a});return}let{path:p,submission:m,error:h}=On(!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&&Dr(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,Pr(h,w.fetchers.get(t)),{flushSync:p});let _=new AbortController,v=nr(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,fr(404,{pathname:i}),{flushSync:p});return}}let y=kr(u,i);if(!y.route.action&&!y.route.lazy){ke(t,n,fr(405,{method:h.formMethod,pathname:i,routeId:n}),{flushSync:p});return}ne.set(t,_);let b=N,x=Jn(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(xr(C)||br(C)){Oe(t,Fr(void 0));return}}else{if(xr(C))if(ne.delete(t),P>b){Oe(t,Fr(void 0));return}else return ie.add(t),Oe(t,Nr(h)),we(v,C,!1,{fetcherSubmission:h,preventScrollReset:m});if(br(C)){ke(t,n,C.error);return}}let E=w.navigation.location||w.location,D=nr(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=Nr(h,C.data);w.fetchers.set(t,j);let{dsMatches:oe,revalidatingFetchers:I}=kn(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=Nr(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=Fr(C.data);w.fetchers.set(t,e)}let ue=pr(ce);if(ue)return we(D,ue.result,!1,{preventScrollReset:m});if(ue=pr(le),ue)return ie.add(ue.key),we(D,ue.result,!1,{preventScrollReset:m});let{loaderData:de,errors:me}=sr(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:cr(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,Nr(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=nr(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,fr(404,{pathname:i}),{flushSync:u});return}}let g=kr(s,i);ne.set(t,m);let _=N,v=await Te(h,i,Jn(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,Fr(void 0));return}if(xr(y))if(P>_){Oe(t,Fr(void 0));return}else{ie.add(t),await we(h,y,!1,{preventScrollReset:d});return}if(br(y)){ke(t,n,y.error);return}Oe(t,Fr(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=tr(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(zt(d)){let n=st(d,!0);e=n.origin!==t.location.origin||It(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=Ar(w.navigation));let _=o||s;yn.has(i.response.status)&&_&&Dr(_.formMethod)?await ge(p,f,{submission:{..._,formAction:d},preventScrollReset:c||D,enableViewTransition:a?k:void 0}):await ge(p,f,{overrideNavigation:jr(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 Yn(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(!Dr(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(yr(r)){let i=r.result;o[t]={type:`redirect`,response:$n(i,e,t,n,l)}}else o[t]=await Qn(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:fr(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=ur(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)||xn}function je(e,t){Pe(e,t?.reason),Oe(e,Fr(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=Fr(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)||Sn;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)||Sn;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=fr(404,{pathname:e}),{matches:n,route:r}=dr(c||s);return{notFoundMatches:n,route:r,error:t}}function Ve(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===bn){_=!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||Fn(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;Fn(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=an(C,e.unstable_instrumentations.map(e=>e.router).filter(Boolean))),C}function Dn(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function V(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=Gt(r||`.`,Wt(o),It(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=Or(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=Lt({basename:n,pathname:c.pathname})),it(c)}function On(e,t,n){if(!n||!Dn(n))return{path:t};if(n.formMethod&&!Er(n.formMethod))return{path:t,error:fr(405,{method:n.formMethod})};let r=()=>({path:t,error:fr(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=mr(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Dr(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(!Dr(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=ir(n.formData),s=n.formData;else if(n.body instanceof FormData)o=ir(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=ar(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=ar(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(Dr(c.formMethod))return{path:t,submission:c};let l=at(t);return e&&l.search&&Or(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:it(l),submission:c}}function kn(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b){let x=y?br(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&&br(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=$t(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(!An(s))f=!1;else if(u){let{shouldLoad:e}=jn(s,a.loaderData,a.errors);f=e}else Mn(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return qn(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?Nn(a.matches[o],i)&&(p=!0):p=!0;let m={...D,defaultShouldRevalidate:p};return qn(n,r,e,c,O,i,l,t,Pn(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=kr(y,e.path),S=new AbortController,C=nr(i,e.path,S.signal),w=null;if(f.has(s))f.delete(s),w=Jn(n,r,C,e.path,y,x,l,t);else if(m)d&&(w=Jn(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};Pn(x,a)&&(w=Jn(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 An(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function jn(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!An(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 Mn(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function Nn(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function Pn(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Fn(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=>In(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 In(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=>In(e,t)))??!1:!1}var Ln=new WeakMap,Rn=({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=Ln.get(i);o||(o={},Ln.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},zn=new WeakMap;function Bn(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=zn.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 zn.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=Rn({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 Vn(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 Hn(e){return e.matches.some(e=>e.route.middleware)?Un(e,()=>Vn(e)):Vn(e)}function Un(e,t){return Wn(e,t,e=>{if(Tr(e))throw e;return e},_r,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=ur(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 Wn(e,t,n,r,i){let{matches:a,...o}=e;return await Gn(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Gn(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 Gn(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 Kn(e,t,n,r,i){let a=Rn({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Bn(r.route,Dr(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function qn(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=Kn(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?Pn(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?Pn(a,{...l,defaultShouldRevalidate:e}):Pn(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Dr(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Dr(n.method)||!p)?Xn({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 Jn(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?qn(e,t,n,r,$t(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:Kn(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Yn(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:rr(t,n),unstable_pattern:$t(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 Un(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 Xn({request:e,path:t,unstable_pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Dr(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:rr(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 fr(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 fr(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function Zn(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 Qn(e){let{result:t,type:n}=e;if(Cr(t)){let e;try{e=await Zn(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new Qt(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?Sr(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:gr(t),statusCode:B(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:B(t)?t.status:void 0}:Sr(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 $n(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`),!zt(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=V(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var er=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function tr(e,t,n,r){if(zt(e)){let r=e,i=r.startsWith(`//`)?new URL(t.protocol+r):new URL(r);if(er.includes(i.protocol))throw Error(`Invalid redirect location`);let a=It(i.pathname,n)!=null;if(i.origin===t.origin&&a)return Kt(i.pathname)+i.search+i.hash}try{let t=r.createURL(e);if(er.includes(t.protocol))throw Error(`Invalid redirect location`)}catch{}return e}function nr(e,t,n,r){let i=e.createURL(mr(t)).toString(),a={signal:n};if(r&&Dr(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=ir(r.formData):a.body=r.formData}return new Request(i,a)}function rr(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 ir(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function ar(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function or(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&br(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(!xr(f),`Cannot handle redirect results in processLoaderData`),br(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=ur(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=Tn),c||(c=!0,s=B(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 sr(e,t,n,r,i,a){let{loaderData:o,errors:s}=or(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`),br(o)){let t=ur(e.matches,r?.route.id);s&&s[t.route.id]||(s={...s,[t.route.id]:o.error}),e.fetchers.delete(n)}else if(xr(o))z(!1,`Unhandled fetcher revalidation redirect`);else{let t=Fr(o.data);e.fetchers.set(n,t)}}),{loaderData:o,errors:s}}function cr(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==Tn).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 lr(e){return e?br(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ur(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 dr(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 fr(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 Qt(e||500,o,Error(s),!0)}function pr(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(xr(r))return{key:n,result:r}}}function mr(e){return it({...typeof e==`string`?at(e):e,hash:``})}function hr(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash?!0:t.hash!==``}function gr(e){return new Qt(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function _r(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&vr(t))}function vr(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function yr(e){return Cr(e.result)&&vn.has(e.result.status)}function br(e){return e.type===`error`}function xr(e){return(e&&e.type)===`redirect`}function Sr(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function Cr(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function wr(e){return vn.has(e)}function Tr(e){return Cr(e)&&wr(e.status)&&e.headers.has(`Location`)}function Er(e){return _n.has(e.toUpperCase())}function Dr(e){return hn.has(e.toUpperCase())}function Or(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function kr(e,t){let n=typeof t==`string`?at(t).search:t.search;if(e[e.length-1].route.index&&Or(n||``))return e[e.length-1];let r=Ut(e);return r[r.length-1]}function Ar(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 jr(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 Mr(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 Nr(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 Pr(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 Fr(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 Ir(e,t){try{let n=e.sessionStorage.getItem(wn);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 Lr(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(wn,JSON.stringify(n))}catch(e){et(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Rr(){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 zr=L.createContext(null);zr.displayName=`DataRouter`;var Br=L.createContext(null);Br.displayName=`DataRouterState`;var Vr=L.createContext(!1);function Hr(){return L.useContext(Vr)}var Ur=L.createContext({isTransitioning:!1});Ur.displayName=`ViewTransition`;var Wr=L.createContext(new Map);Wr.displayName=`Fetchers`;var Gr=L.createContext(null);Gr.displayName=`Await`;var Kr=L.createContext(null);Kr.displayName=`Navigation`;var qr=L.createContext(null);qr.displayName=`Location`;var Jr=L.createContext({outlet:null,matches:[],isDataRoute:!1});Jr.displayName=`Route`;var Yr=L.createContext(null);Yr.displayName=`RouteError`;var Xr=`REACT_ROUTER_ERROR`,Zr=`REDIRECT`,Qr=`ROUTE_ERROR_RESPONSE`;function $r(e){if(e.startsWith(`${Xr}:${Zr}:{`))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 ei(e){if(e.startsWith(`${Xr}:${Qr}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Qt(t.status,t.statusText,t.data)}catch{}}function ti(e,{relative:t}={}){z(ni(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=L.useContext(Kr),{hash:i,pathname:a,search:o}=ui(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:qt([n,a])),r.createHref({pathname:s,search:o,hash:i})}function ni(){return L.useContext(qr)!=null}function ri(){return z(ni(),`useLocation() may be used only in the context of a <Router> component.`),L.useContext(qr).location}var ii=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function ai(e){L.useContext(Kr).static||L.useLayoutEffect(e)}function oi(){let{isDataRoute:e}=L.useContext(Jr);return e?Oi():si()}function si(){z(ni(),`useNavigate() may be used only in the context of a <Router> component.`);let e=L.useContext(zr),{basename:t,navigator:n}=L.useContext(Kr),{matches:r}=L.useContext(Jr),{pathname:i}=ri(),a=JSON.stringify(Wt(r)),o=L.useRef(!1);return ai(()=>{o.current=!0}),L.useCallback((r,s={})=>{if(et(o.current,ii),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Gt(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:qt([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var ci=L.createContext(null);function li(e){let t=L.useContext(Jr).outlet;return L.useMemo(()=>t&&L.createElement(ci.Provider,{value:e},t),[t,e])}function ui(e,{relative:t}={}){let{matches:n}=L.useContext(Jr),{pathname:r}=ri(),i=JSON.stringify(Wt(n));return L.useMemo(()=>Gt(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function di(e,t,n){z(ni(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=L.useContext(Kr),{matches:i}=L.useContext(Jr),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||``;Ai(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=ri(),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=vi(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:qt([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:qt([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(qr.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,unstable_mask:void 0,...d},navigationType:`POP`}},h):h}function fi(){let e=Di(),t=B(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 pi=L.createElement(fi,null),mi=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=ei(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:L.createElement(Jr.Provider,{value:this.props.routeContext},L.createElement(Yr.Provider,{value:e,children:this.props.component}));return this.context?L.createElement(gi,{error:e},t):t}};mi.contextType=Vr;var hi=new WeakMap;function gi({children:e,error:t}){let{basename:n}=L.useContext(Kr);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=$r(t.digest);if(e){let r=hi.get(t);if(r)throw r;let i=tn(e.location,n);if(en&&!hi.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 hi.set(t,n),n}return L.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function _i({routeContext:e,match:t,children:n}){let r=L.useContext(zr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),L.createElement(Jr.Provider,{value:e},n)}function vi(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:$t(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||pi,o&&(s<0&&c===0?(Ai(`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(_i,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?L.createElement(mi,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function yi(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function bi(e){let t=L.useContext(zr);return z(t,yi(e)),t}function xi(e){let t=L.useContext(Br);return z(t,yi(e)),t}function Si(e){let t=L.useContext(Jr);return z(t,yi(e)),t}function Ci(e){let t=Si(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 wi(){return Ci(`useRouteId`)}function Ti(){return xi(`useNavigation`).navigation}function Ei(){let{matches:e,loaderData:t}=xi(`useMatches`);return L.useMemo(()=>e.map(e=>yt(e,t)),[e,t])}function Di(){let e=L.useContext(Yr),t=xi(`useRouteError`),n=Ci(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Oi(){let{router:e}=bi(`useNavigate`),t=Ci(`useNavigate`),n=L.useRef(!1);return ai(()=>{n.current=!0}),L.useCallback(async(r,i={})=>{et(n.current,ii),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var ki={};function Ai(e,t,n){!t&&!ki[e]&&(ki[e]=!0,et(!1,n))}var ji={};function H(e,t){!e&&!ji[t]&&(ji[t]=!0,console.warn(t))}var Mi=L.useOptimistic,Ni=()=>void 0;function Pi(e){return Mi?Mi(e):[e,Ni]}function Fi(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 Ii=[`HydrateFallback`,`hydrateFallbackElement`],Li=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 Ri({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=Hr()||r;let[i,a]=L.useState(e.state),[o,s]=Pi(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:$t(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&v.current.set(t,e.data)}),o.forEach(e=>v.current.delete(e)),H(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(H(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=>zi(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 Li)},[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=>zi(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(zr.Provider,{value:C},L.createElement(Br.Provider,{value:o},L.createElement(Wr.Provider,{value:v.current},L.createElement(Ur.Provider,{value:u},L.createElement(Ui,{basename:S,location:o.location,navigationType:o.historyAction,navigator:x,unstable_useTransitions:r},L.createElement(Bi,{routes:e.routes,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function zi(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 Bi=L.memo(Vi);function Vi({routes:e,future:t,state:n,isStatic:r,onError:i}){return di(e,void 0,{state:n,isStatic:r,onError:i,future:t})}function Hi(e){return li(e.context)}function Ui({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:o}){z(!ni(),`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=It(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(Kr.Provider,{value:c},L.createElement(qr.Provider,{children:t,value:h}))}L.Component;var Wi=`get`,Gi=`application/x-www-form-urlencoded`;function Ki(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function qi(e){return Ki(e)&&e.tagName.toLowerCase()===`button`}function Ji(e){return Ki(e)&&e.tagName.toLowerCase()===`form`}function Yi(e){return Ki(e)&&e.tagName.toLowerCase()===`input`}function Xi(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Zi(e,t){return e.button===0&&(!t||t===`_self`)&&!Xi(e)}function Qi(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 $i(e,t){let n=Qi(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var ea=null;function ta(){if(ea===null)try{new FormData(document.createElement(`form`),0),ea=!1}catch{ea=!0}return ea}var na=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function ra(e){return e!=null&&!na.has(e)?(et(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Gi}"`),null):e}function ia(e,t){let n,r,i,a,o;if(Ji(e)){let o=e.getAttribute(`action`);r=o?It(o,t):null,n=e.getAttribute(`method`)||Wi,i=ra(e.getAttribute(`enctype`))||Gi,a=new FormData(e)}else if(qi(e)||Yi(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?It(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Wi,i=ra(e.getAttribute(`formenctype`))||ra(o.getAttribute(`enctype`))||Gi,a=new FormData(o,e),!ta()){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(Ki(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Wi,r=null,i=Gi,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 aa={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},oa=/[&><\u2028\u2029]/g;function sa(e){return e.replace(oa,e=>aa[e])}function ca(e,t){if(e===!1||e==null)throw Error(t)}function la(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&&It(i.pathname,t)===`/`?i.pathname=`${Jt(t)}/_root.${r}`:i.pathname=`${Jt(i.pathname)}.${r}`,i}async function ua(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 da(e){return e!=null&&typeof e.page==`string`}function fa(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 pa(e,t,n){return va((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await ua(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(fa).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function ma(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 ha(e,t,{includeHydrateFallback:n}={}){return ga(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 ga(e){return[...new Set(e)]}function _a(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function va(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!da(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(_a(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function ya(){let e=L.useContext(zr);return ca(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function ba(){let e=L.useContext(Br);return ca(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var xa=L.createContext(void 0);xa.displayName=`FrameworkContext`;function Sa(){let e=L.useContext(xa);return ca(e,`You must render this element inside a <HydratedRouter> element`),e}function Ca(e,t){let n=L.useContext(xa),[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:wa(s,p),onBlur:wa(c,m),onMouseEnter:wa(l,p),onMouseLeave:wa(u,m),onTouchStart:wa(d,p)}]:[a,f,{}]:[!1,f,{}]}function wa(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Ta({page:e,...t}){let n=Hr(),{router:r}=ya(),i=L.useMemo(()=>_t(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?L.createElement(Da,{page:e,matches:i,...t}):L.createElement(Oa,{page:e,matches:i,...t}):null}function Ea(e){let{manifest:t,routeModules:n}=Sa(),[r,i]=L.useState([]);return L.useEffect(()=>{let r=!1;return pa(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Da({page:e,matches:t,...n}){let r=ri(),{future:i}=Sa(),{basename:a}=ya(),o=L.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=la(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 Oa({page:e,matches:t,...n}){let r=ri(),{future:i,manifest:a,routeModules:o}=Sa(),{basename:s}=ya(),{loaderData:c,matches:l}=ba(),u=L.useMemo(()=>ma(e,t,l,a,r,`data`),[e,t,l,a,r]),d=L.useMemo(()=>ma(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=la(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(()=>ha(d,a),[d,a]),m=Ea(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 ka(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}L.Component;var Aa=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Aa&&(window.__reactRouterVersion=`7.14.2`)}catch{}function ja(e,t){return En({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:$e({window:t?.window}),hydrationData:t?.hydrationData||Ma(),routes:e,mapRouteProperties:Fi,hydrationRouteProperties:Ii,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function Ma(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Na(e.errors)}),e}function Na(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 Qt(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 Pa({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(Ui,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}Pa.displayName=`unstable_HistoryRouter`;var Fa=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ia=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(Kr),v=typeof l==`string`&&Fa.test(l),y=tn(l,h);l=y.to;let b=ti(l,{relative:r}),x=ri(),S=null;if(o){let e=Gt(o,[],x.unstable_mask?x.unstable_mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:qt([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=Ca(n,p),E=Ua(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:ka(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?L.createElement(L.Fragment,null,k,L.createElement(Ta,{page:b})):k});Ia.displayName=`Link`;var La=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=ui(a,{relative:c.relative}),d=ri(),f=L.useContext(Br),{navigator:p,basename:m}=L.useContext(Kr),h=f!=null&&eo(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=It(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(Ia,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});La.displayName=`NavLink`;var Ra=L.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Wi,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m)=>{let{unstable_useTransitions:h}=L.useContext(Kr),g=qa(),_=Ja(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&Fa.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})});Ra.displayName=`Form`;function za({getKey:e,storageKey:t,...n}){let r=L.useContext(xa),{basename:i}=L.useContext(Kr),a=ri(),o=Ei();Qa({getKey:e,storageKey:t});let s=L.useMemo(()=>{if(!r||!e)return null;let t=Za(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})(${sa(JSON.stringify(t||Ya))}, ${sa(JSON.stringify(s))})`}})}za.displayName=`ScrollRestoration`;function Ba(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Va(e){let t=L.useContext(zr);return z(t,Ba(e)),t}function Ha(e){let t=L.useContext(Br);return z(t,Ba(e)),t}function Ua(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c,unstable_useTransitions:l}={}){let u=oi(),d=ri(),f=ui(e,{relative:o});return L.useCallback(p=>{if(Zi(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 Wa(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(Qi(e)),n=L.useRef(!1),r=ri(),i=L.useMemo(()=>$i(r.search,n.current?null:t.current),[r.search]),a=oi();return[i,L.useCallback((e,t)=>{let r=Qi(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Ga=0,Ka=()=>`__${String(++Ga)}__`;function qa(){let{router:e}=Va(`useSubmit`),{basename:t}=L.useContext(Kr),n=wi(),r=e.fetch,i=e.navigate;return L.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=ia(e,t);a.navigate===!1?await r(a.fetcherKey||Ka(),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 Ja(e,{relative:t}={}){let{basename:n}=L.useContext(Kr),r=L.useContext(Jr);z(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...ui(e||`.`,{relative:t})},o=ri();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:qt([n,a.pathname])),it(a)}var Ya=`react-router-scroll-positions`,Xa={};function Za(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:It(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Qa({getKey:e,storageKey:t}={}){let{router:n}=Va(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Ha(`useScrollRestoration`),{basename:a}=L.useContext(Kr),o=ri(),s=Ei(),c=Ti();L.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),$a(L.useCallback(()=>{if(c.state===`idle`){let t=Za(o,s,a,e);Xa[t]=window.scrollY}try{sessionStorage.setItem(t||Ya,JSON.stringify(Xa))}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||Ya);e&&(Xa=JSON.parse(e))}catch{}},[t]),L.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Xa,()=>window.scrollY,e?(t,n)=>Za(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 $a(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 eo(e,{relative:t}={}){let n=L.useContext(Ur);z(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Va(`useViewTransitionState`),i=ui(e,{relative:t});if(!n.isTransitioning)return!1;let a=It(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=It(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Nt(i.pathname,o)!=null||Nt(i.pathname,a)!=null}var to=g();function no(){`serviceWorker`in navigator&&globalThis.isSecureContext&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`).catch(()=>void 0)})}var ro=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),io=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),ao=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),oo=e=>{let t=ao(e);return t.charAt(0).toUpperCase()+t.slice(1)},so={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`},co=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},lo=(0,L.createContext)({}),U=()=>(0,L.useContext)(lo),uo=(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=``}=U()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,L.createElement)(`svg`,{ref:c,...so,width:t??l??so.width,height:t??l??so.height,stroke:e??f,strokeWidth:m,className:ro(`lucide`,p,i),...!a&&!co(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,L.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),W=(e,t)=>{let n=(0,L.forwardRef)(({className:n,...r},i)=>(0,L.createElement)(uo,{ref:i,iconNode:t,className:ro(`lucide-${io(oo(e))}`,`lucide-${e}`,n),...r}));return n.displayName=oo(e),n},fo=W(`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`}]]),po=W(`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`}]]),mo=W(`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`}]]),ho=W(`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`}]]),go=W(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),_o=W(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),vo=W(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),yo=W(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),bo=W(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),xo=W(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),So=W(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),Co=W(`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`}]]),wo=W(`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`}]]),To=W(`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`}]]),Eo=W(`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`}]]),Do=W(`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`}]]),Oo=W(`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`}]]),ko=W(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),Ao=W(`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`}]]),jo=W(`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`}]]),Mo=W(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),No=W(`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`}]]),Po=W(`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`}]]),Fo=W(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Io=W(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),Lo=W(`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`}]]),Ro=W(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),zo=W(`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`}]]),Bo=W(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Vo=W(`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`}]]),Ho=W(`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`}]]),Uo=W(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Wo=W(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Go=W(`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`}]]),Ko=W(`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`}]]),qo=W(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Jo=W(`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`}]]);function G(...e){return e.filter(Boolean).join(` `)}function Yo({className:e}){return(0,R.jsx)(Mo,{"aria-hidden":`true`,className:G(`size-4 animate-spin`,e)})}function Xo({className:e}){return(0,R.jsx)(`span`,{"aria-hidden":`true`,className:G(`block animate-pulse rounded-[var(--radius-sm)] bg-[var(--skeleton-bg)]`,e)})}function Zo({className:e,label:t}){return(0,R.jsxs)(`div`,{className:G(`inline-flex items-center gap-2 text-[length:var(--font-size-xs)] text-[var(--text-tertiary)]`,e),role:`status`,children:[(0,R.jsx)(Yo,{className:`size-3.5`}),(0,R.jsx)(`span`,{children:t})]})}function Qo(){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)(Xo,{className:`size-8`}),(0,R.jsx)(Xo,{className:`h-4 w-28`})]}),(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsx)(Xo,{className:`h-3 w-20`}),(0,R.jsx)($o,{})]})]}),(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)(Xo,{className:`size-8`}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,R.jsx)(Xo,{className:`h-4 w-40 max-w-full`}),(0,R.jsx)(Xo,{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)(ts,{})})]})]})}function $o(){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)(Xo,{className:`size-4 shrink-0`}),(0,R.jsx)(Xo,{className:`h-3.5 w-32`})]}),t<2&&(0,R.jsx)(es,{})]},t))})}function es(){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)(Xo,{className:`size-3.5 shrink-0`}),(0,R.jsx)(Xo,{className:`h-3 w-28`})]},t))})}function ts(){return(0,R.jsxs)(`div`,{className:`mx-auto flex max-w-[var(--layout-max-content-width)] flex-col gap-3`,children:[(0,R.jsx)(ns,{align:`right`}),(0,R.jsx)(ns,{align:`left`,lines:4}),(0,R.jsx)(ns,{align:`right`,lines:2}),(0,R.jsx)(ns,{align:`left`,lines:3})]})}function ns({align:e,lines:t=3}){return(0,R.jsx)(`div`,{className:G(`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)(Xo,{className:G(`h-3`,n===t-1?`w-2/3`:`w-full`)},n))})})}var rs=/^[\w!#$%&'*.^`|~+-]+$/,is=(e,t,n={})=>{if(!rs.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},as=(e,t,n)=>(t=encodeURIComponent(t),is(e,t,n)),os=(e,t)=>(e=e.replace(/\/+$/,``),e+=`/`,t=t.replace(/^\/+/,``),e+t),ss=(e,t)=>{for(let[n,r]of Object.entries(t)){let t=RegExp(`/:`+n+`(?:{[^/]+})?\\??`);e=e.replace(t,r?`/${r}`:``)}return e},cs=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},ls=(e,t)=>{switch(t){case`ws`:return e.replace(/^http/,`ws`);case`http`:return e.replace(/^ws/,`http`)}},us=e=>/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e)?e.replace(/\/index(?=\?|$)/,`/`):e.replace(/\/index(?=\?|$)/,``);function ds(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function fs(e,t){if(!ds(e)&&!ds(t))return t;let n={...e};for(let e in t){let r=t[e];ds(n[e])&&ds(r)?n[e]=fs(n[e],r):n[e]=r}return n}var ps=(e,t)=>new Proxy(()=>{},{get(n,r){if(!(typeof r!=`string`||r===`then`))return ps(e,[...t,r])},apply(n,r,i){return e({path:t,args:i})}}),ms=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(as(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=us(a),a=ss(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})}},hs=(e,t)=>ps(function n(r){let i=t?.buildSearchParams??cs,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=os(e,a.join(`/`));if(s===`url`||s===`path`){let t=c;return r.args[0]&&(r.args[0].param&&(t=ss(c,r.args[0].param)),r.args[0].query&&(t=t+`?`+i(r.args[0].query).toString())),t=us(t),s===`url`?new URL(t):t.slice(e.replace(/\/+$/,``).length).replace(/^\/?/,`/`)}if(s===`ws`){let e=ls(r.args[0]&&r.args[0].param?ss(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 ms(c,s,{buildSearchParams:i});if(s){t??={};let e=fs(t,{...r.args[1]});return l.fetch(r.args[0],e)}return l},[]),gs=`/api`,_s=hs(gs);function vs(e,t){return`${e.endsWith(`/`)?e.slice(0,-1):e}${t.startsWith(`/`)?t:`/${t}`}`}function ys(e){return encodeURIComponent(e)}function bs(e){return vs(gs,e)}async function xs(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 Ss(e,t){let n=new FormData;return n.append(`file`,t),xs(await fetch(bs(`/chats/${ys(e)}/attachments`),{body:n,method:`POST`}))}async function Cs(e){return xs(await _s.projects.$post({json:{path:e}}))}async function ws(e){return xs(await _s.projects[`:projectId`].$delete({param:{projectId:ys(e)}}))}async function Ts(e,t={}){return xs(await _s.projects[`:projectId`].chats.$post({param:{projectId:ys(e)},json:t}))}async function Es(e,t){return xs(await _s.chats[`:chatId`].archive.$post({param:{chatId:ys(e)},json:{archived:t}}))}async function Ds(e,t){return xs(await _s.projects[`:projectId`].worktrees.$delete({param:{projectId:ys(e)},json:t}))}async function Os(e,t){return xs(await _s.projects[`:projectId`].worktrees.sync.$post({param:{projectId:ys(e)},json:t}))}async function ks(e,t){return xs(await _s.chats[`:chatId`].messages.$post({param:{chatId:ys(e)},json:t}))}async function As(e,t){return xs(await _s.chats[`:chatId`].messages[`:messageId`].$delete({param:{chatId:ys(e),messageId:ys(t)}}))}async function js(e,t){return xs(await _s.chats[`:chatId`].messages[`:messageId`].restore.$post({param:{chatId:ys(e),messageId:ys(t.message.id)},json:t}))}async function Ms(e,t){return xs(await _s.chats[`:chatId`].steer.$post({param:{chatId:ys(e)},json:t}))}async function Ns(e,t){return xs(await _s.chats[`:chatId`].queue.$post({param:{chatId:ys(e)},json:t}))}async function Ps(e){return xs(await _s.chats[`:chatId`].interrupt.$post({param:{chatId:ys(e)}}))}async function Fs(e,t,n){return xs(await _s.chats[`:chatId`].approvals[`:requestId`].$post({param:{chatId:ys(e),requestId:ys(t)},json:{decision:n}}))}var K={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 Is(){return Ve({queryKey:K.auth,queryFn:async()=>xs(await _s.auth.$get())})}function Ls(){return Ve({queryKey:K.projects,queryFn:async()=>xs(await _s.projects.$get())})}function Rs(){return Ve({queryKey:K.models,queryFn:async()=>xs(await _s.models.$get())})}function zs(e){return Ve({queryKey:K.projectWorktrees(e),queryFn:async()=>xs(await _s.projects[`:projectId`].worktrees.$get({param:{projectId:ys(e)}}))})}function Bs(e){return Ve({queryKey:K.projectChats(e),queryFn:async()=>xs(await _s.projects[`:projectId`].chats.$get({param:{projectId:ys(e)}}))})}function Vs(e){return Ve({queryKey:K.projectGitHubCheckoutTargets(e),queryFn:async()=>xs(await _s.projects[`:projectId`].github[`checkout-targets`].$get({param:{projectId:ys(e)}}))})}function Hs(e){return Ve({queryKey:K.chat(e),queryFn:async()=>xs(await _s.chats[`:chatId`].$get({param:{chatId:ys(e)},query:{}}))})}function Us(e,t){return Ve({queryKey:K.chatApproval(e),queryFn:async()=>xs(await _s.chats[`:chatId`].$get({param:{chatId:ys(e)},query:{context:`approval`}},{init:{signal:t}}))})}function Ws(e){return Ve({queryKey:K.messages(e),queryFn:async()=>({messages:qs((await xs(await _s.chats[`:chatId`].messages.$get({param:{chatId:ys(e)}}))).messages)})})}function Gs(e,t){return Ve({queryKey:K.chatSkills(e),queryFn:async()=>xs(await _s.chats[`:chatId`].$get({param:{chatId:ys(e)},query:{context:`skills`}},{init:{signal:t}}))})}function Ks(e,t,n){return Ve({queryKey:K.fileSearch(e,t),queryFn:async()=>xs(await _s.chats[`:chatId`].$get({param:{chatId:ys(e)},query:{fileQuery:t}},{init:{signal:n}}))})}function qs(e){return e.map(Js)}function Js(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=Xs(e);return{...e,eventData:Zs(Ys(e.eventData,`text`),t),text:``,textHtml:``}}return e.eventType===`turn/diff/updated`?{...e,eventData:Qs(e.eventData)}:e.eventType===`item/fileChange/patchUpdated`?{...e,eventData:$s(e.eventData)}:e}function Ys(e,t){if(!ec(e))return e;let n={...e};return delete n[t],n}function Xs(e){return ec(e.eventData)&&typeof e.eventData.text==`string`?e.eventData.text:e.text}function Zs(e,t){return t?ec(e)?typeof e.hiddenContentDeltaCount==`number`||typeof e.hiddenContentLength==`number`?e:{...e,hiddenContentLength:t.length}:{hiddenContentLength:t.length}:e}function Qs(e){if(!ec(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 $s(e){if(!ec(e))return e;let t=e.changes;return Array.isArray(t)?{...e,changes:t.map(e=>Ys(e,`diff`))}:e}function ec(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var tc={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 nc({className:e,variant:t=`default`,...n}){return(0,R.jsx)(`span`,{className:G(`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`,tc[t],e),...n})}var rc={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)]`},ic={default:`h-9 px-4 py-2`,icon:`size-8`,sm:`h-8 gap-1.5 px-3`};function ac({className:e,size:t=`default`,variant:n=`default`,...r}){return(0,R.jsx)(`button`,{className:G(`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`,rc[n],ic[t],e),...r})}var oc=c(m(),1);function sc({className:e,...t}){return(0,R.jsx)(`input`,{className:G(`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 cc=4,lc=16,uc=320,dc=256;function fc({"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-lc*2),u=Math.max(0,s-lc*2),d=Math.min(uc,l),f=u,p=E.current?.getBoundingClientRect().height??0,h=D.current?Math.min(D.current.scrollHeight,dc):0,g=Math.min(p+h,f),_=i+lc,v=i+o-lc-d,y=a+lc,b=a+s-lc-g,x=t===`end`?c.right-d:c.left,S=m===`top`?c.top-cc-g:c.bottom+cc,C={left:mc(x,_,Math.max(_,v)),maxHeight:f,top:mc(S,y,Math.max(y,b)),width:d};w(e=>hc(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(pc(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=>pc(j,e,1));return}if(e.key===`ArrowUp`){e.preventDefault(),b(e=>pc(j,e,-1));return}if(e.key===`Home`){e.preventDefault(),b(pc(j,-1,1));return}if(e.key===`End`){e.preventDefault(),b(pc(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,oc.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)(Bo,{className:`size-3.5 shrink-0 text-[var(--icon-color-muted)]`}),(0,R.jsx)(sc,{"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)(Mo,{"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:G(`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)(go,{className:G(`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:G(`relative min-w-0`,n),ref:T,children:[(0,R.jsxs)(`button`,{"aria-controls":k,"aria-expanded":_,"aria-label":e,className:G(`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)(Mo,{"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)(vo,{className:`size-3.5 shrink-0 text-[var(--icon-color-muted)]`})]}),N]})}function pc(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 mc(e,t,n){return Math.min(Math.max(e,t),n)}function hc(e,t){return e.left===t.left&&e.maxHeight===t.maxHeight&&e.top===t.top&&e.width===t.width}var gc=[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex='-1'])`].join(`,`);function _c({children:e,onOpenChange:t,open:n}){let r=(0,L.useRef)(null);(0,L.useEffect)(()=>{if(!n)return;let e=document.activeElement;return Cc(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=Cc(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 vc({className:e,...t}){return(0,R.jsx)(`div`,{className:G(`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 yc({className:e,...t}){return(0,R.jsx)(`div`,{className:G(`grid gap-1.5`,e),...t})}function bc({className:e,...t}){return(0,R.jsx)(`h2`,{className:G(`text-[length:var(--font-size-xl)] font-semibold leading-none`,e),...t})}function xc({className:e,...t}){return(0,R.jsx)(`p`,{className:G(`text-[length:var(--font-size-md)] text-muted-foreground`,e),...t})}function Sc({className:e,...t}){return(0,R.jsx)(`div`,{className:G(`flex justify-end gap-2`,e),...t})}function Cc(e){return e?Array.from(e.querySelectorAll(gc)).filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-hidden`)!==`true`):[]}typeof window<`u`&&window.document&&window.document.createElement;function q(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function wc(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Tc(...e){return t=>{let n=!1,r=e.map(e=>{let r=wc(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():wc(e[t],null)}}}}function Ec(...e){return L.useCallback(Tc(...e),e)}function Dc(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,Oc(i,...t)]}function Oc(...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 kc=globalThis?.document?L.useLayoutEffect:()=>{},Ac=L.useInsertionEffect||kc;function jc({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Mc({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=Nc(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Mc({defaultProp:e,onChange:t}){let[n,r]=L.useState(e),i=L.useRef(n),a=L.useRef(t);return Ac(()=>{a.current=t},[t]),L.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Nc(e){return typeof e==`function`}function Pc(e){let t=Fc(e),n=L.forwardRef((e,n)=>{let{children:r,...i}=e,a=L.Children.toArray(r),o=a.find(Lc);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 Fc(e){let t=L.forwardRef((e,t)=>{let{children:n,...r}=e;if(L.isValidElement(n)){let e=zc(n),i=Rc(r,n.props);return n.type!==L.Fragment&&(i.ref=t?Tc(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 Ic=Symbol(`radix.slottable`);function Lc(e){return L.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ic}function Rc(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 zc(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 Bc=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Pc(`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 Vc(e,t){e&&oc.flushSync(()=>e.dispatchEvent(t))}function Hc(e){let t=e+`CollectionProvider`,[n,r]=Dc(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=Pc(s),l=L.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,R.jsx)(c,{ref:Ec(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Pc(u),p=L.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=L.useRef(null),s=Ec(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 Uc=L.createContext(void 0);function Wc(e){let t=L.useContext(Uc);return e||t||`ltr`}function Gc(e){let t=L.useRef(e);return L.useEffect(()=>{t.current=e}),L.useMemo(()=>(...e)=>t.current?.(...e),[])}function Kc(e,t=globalThis?.document){let n=Gc(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 qc=`DismissableLayer`,Jc=`dismissableLayer.update`,Yc=`dismissableLayer.pointerDownOutside`,Xc=`dismissableLayer.focusOutside`,Zc,Qc=L.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$c=L.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=L.useContext(Qc),[u,d]=L.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=L.useState({}),m=Ec(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=nl(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=rl(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return Kc(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&&(Zc=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),il(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Zc)}},[u,f,n,l]),L.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),il())},[u,l]),L.useEffect(()=>{let e=()=>p({});return document.addEventListener(Jc,e),()=>document.removeEventListener(Jc,e)},[]),(0,R.jsx)(Bc.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:q(e.onFocusCapture,S.onFocusCapture),onBlurCapture:q(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:q(e.onPointerDownCapture,x.onPointerDownCapture)})});$c.displayName=qc;var el=`DismissableLayerBranch`,tl=L.forwardRef((e,t)=>{let n=L.useContext(Qc),r=L.useRef(null),i=Ec(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)(Bc.div,{...e,ref:i})});tl.displayName=el;function nl(e,t=globalThis?.document){let n=Gc(e),r=L.useRef(!1),i=L.useRef(()=>{});return L.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){al(Yc,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 rl(e,t=globalThis?.document){let n=Gc(e),r=L.useRef(!1);return L.useEffect(()=>{let e=e=>{e.target&&!r.current&&al(Xc,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 il(){let e=new CustomEvent(Jc);document.dispatchEvent(e)}function al(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?Vc(i,a):i.dispatchEvent(a)}var ol=0;function sl(){L.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??cl()),document.body.insertAdjacentElement(`beforeend`,e[1]??cl()),ol++,()=>{ol===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),ol--}},[])}function cl(){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 ll=`focusScope.autoFocusOnMount`,ul=`focusScope.autoFocusOnUnmount`,dl={bubbles:!1,cancelable:!0},fl=`FocusScope`,pl=L.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=L.useState(null),l=Gc(i),u=Gc(a),d=L.useRef(null),f=Ec(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:bl(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||bl(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&bl(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){xl.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(ll,dl);s.addEventListener(ll,l),s.dispatchEvent(t),t.defaultPrevented||(ml(wl(gl(s)),{select:!0}),document.activeElement===e&&bl(s))}return()=>{s.removeEventListener(ll,l),setTimeout(()=>{let t=new CustomEvent(ul,dl);s.addEventListener(ul,u),s.dispatchEvent(t),t.defaultPrevented||bl(e??document.body,{select:!0}),s.removeEventListener(ul,u),xl.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]=hl(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&bl(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&bl(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,R.jsx)(Bc.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});pl.displayName=fl;function ml(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(bl(r,{select:t}),document.activeElement!==n)return}function hl(e){let t=gl(e);return[_l(t,e),_l(t.reverse(),e)]}function gl(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 _l(e,t){for(let n of e)if(!vl(n,{upTo:t}))return n}function vl(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 yl(e){return e instanceof HTMLInputElement&&`select`in e}function bl(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&yl(e)&&t&&e.select()}}var xl=Sl();function Sl(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Cl(e,t),e.unshift(t)},remove(t){e=Cl(e,t),e[0]?.resume()}}}function Cl(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function wl(e){return e.filter(e=>e.tagName!==`A`)}var Tl=L.useId||(()=>void 0),El=0;function Dl(e){let[t,n]=L.useState(Tl());return kc(()=>{e||n(e=>e??String(El++))},[e]),e||(t?`radix-${t}`:``)}var Ol=[`top`,`right`,`bottom`,`left`],kl=Math.min,Al=Math.max,jl=Math.round,Ml=Math.floor,Nl=e=>({x:e,y:e}),Pl={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Fl(e,t,n){return Al(e,kl(t,n))}function Il(e,t){return typeof e==`function`?e(t):e}function J(e){return e.split(`-`)[0]}function Ll(e){return e.split(`-`)[1]}function Y(e){return e===`x`?`y`:`x`}function X(e){return e===`y`?`height`:`width`}function Z(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Rl(e){return Y(Z(e))}function zl(e,t,n){n===void 0&&(n=!1);let r=Ll(e),i=Rl(e),a=X(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Jl(o)),[o,Jl(o)]}function Bl(e){let t=Jl(e);return[Vl(e),t,Vl(t)]}function Vl(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Hl=[`left`,`right`],Ul=[`right`,`left`],Wl=[`top`,`bottom`],Gl=[`bottom`,`top`];function Kl(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ul:Hl:t?Hl:Ul;case`left`:case`right`:return t?Wl:Gl;default:return[]}}function ql(e,t,n,r){let i=Ll(e),a=Kl(J(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Vl)))),a}function Jl(e){let t=J(e);return Pl[t]+e.slice(t.length)}function Yl(e){return{top:0,right:0,bottom:0,left:0,...e}}function Xl(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Yl(e)}function Zl(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=Z(t),o=Rl(t),s=X(o),c=J(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(Ll(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 $l(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}=Il(t,e),p=Xl(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Zl(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=Zl(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 eu=50,tu=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:$l},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<eu&&(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}},nu=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}=Il(e,t)||{};if(l==null)return{};let d=Xl(u),f={x:n,y:r},p=Rl(i),m=X(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=kl(d[_],T),D=kl(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,ee=Fl(O,A,k),j=!c.arrow&&Ll(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}}}),ru=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}=Il(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=J(r),_=Z(o),v=J(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Jl(o)]:Bl(o)),x=p!==`none`;!d&&x&&b.push(...ql(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=zl(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`&&_!==Z(t))||T.every(e=>Z(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=Z(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 iu(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function au(e){return Ol.some(t=>e[t]>=0)}var ou=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Il(e,t);switch(i){case`referenceHidden`:{let e=iu(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:au(e)}}}case`escaped`:{let e=iu(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:au(e)}}}default:return{}}}}},su=new Set([`left`,`top`]);async function cu(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=J(n),s=Ll(n),c=Z(n)===`y`,l=su.has(o)?-1:1,u=a&&c?-1:1,d=Il(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 lu=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 cu(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}}}}},uu=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}=Il(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Z(J(i)),p=Y(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=Fl(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=Fl(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}}}}}},du=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}=Il(e,t),u={x:n,y:r},d=Z(i),f=Y(d),p=u[f],m=u[d],h=Il(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=su.has(J(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}}}},fu=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}=Il(e,t),u=await o.detectOverflow(t,l),d=J(i),f=Ll(i),p=Z(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=kl(h-u[g],v),x=kl(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=Al(u.left,0),t=Al(u.right,0),n=Al(u.top,0),r=Al(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Al(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Al(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 pu(){return typeof window<`u`}function mu(e){return _u(e)?(e.nodeName||``).toLowerCase():`#document`}function hu(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gu(e){return((_u(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function _u(e){return pu()?e instanceof Node||e instanceof hu(e).Node:!1}function vu(e){return pu()?e instanceof Element||e instanceof hu(e).Element:!1}function yu(e){return pu()?e instanceof HTMLElement||e instanceof hu(e).HTMLElement:!1}function bu(e){return!pu()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof hu(e).ShadowRoot}function xu(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Mu(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Su(e){return/^(table|td|th)$/.test(mu(e))}function Cu(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var wu=/transform|translate|scale|rotate|perspective|filter/,Tu=/paint|layout|strict|content/,Eu=e=>!!e&&e!==`none`,Du;function Ou(e){let t=vu(e)?Mu(e):e;return Eu(t.transform)||Eu(t.translate)||Eu(t.scale)||Eu(t.rotate)||Eu(t.perspective)||!Au()&&(Eu(t.backdropFilter)||Eu(t.filter))||wu.test(t.willChange||``)||Tu.test(t.contain||``)}function ku(e){let t=Pu(e);for(;yu(t)&&!ju(t);){if(Ou(t))return t;if(Cu(t))return null;t=Pu(t)}return null}function Au(){return Du??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Du}function ju(e){return/^(html|body|#document)$/.test(mu(e))}function Mu(e){return hu(e).getComputedStyle(e)}function Nu(e){return vu(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pu(e){if(mu(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||bu(e)&&e.host||gu(e);return bu(t)?t.host:t}function Fu(e){let t=Pu(e);return ju(t)?e.ownerDocument?e.ownerDocument.body:e.body:yu(t)&&xu(t)?t:Fu(t)}function Iu(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Fu(e),i=r===e.ownerDocument?.body,a=hu(r);if(i){let e=Lu(a);return t.concat(a,a.visualViewport||[],xu(r)?r:[],e&&n?Iu(e):[])}else return t.concat(r,Iu(r,[],n))}function Lu(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ru(e){let t=Mu(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=yu(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=jl(n)!==a||jl(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function zu(e){return vu(e)?e:e.contextElement}function Bu(e){let t=zu(e);if(!yu(t))return Nl(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ru(t),o=(a?jl(n.width):n.width)/r,s=(a?jl(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Vu=Nl(0);function Hu(e){let t=hu(e);return!Au()||!t.visualViewport?Vu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Uu(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==hu(e)?!1:t}function Q(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=zu(e),o=Nl(1);t&&(r?vu(r)&&(o=Bu(r)):o=Bu(e));let s=Uu(a,n,r)?Hu(a):Nl(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=hu(a),t=r&&vu(r)?hu(r):r,n=e,i=Lu(n);for(;i&&r&&t!==n;){let e=Bu(i),t=i.getBoundingClientRect(),r=Mu(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=hu(i),i=Lu(n)}}return Zl({width:u,height:d,x:c,y:l})}function Wu(e,t){let n=Nu(e).scrollLeft;return t?t.left+n:Q(gu(e)).left+n}function Gu(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Wu(e,n),y:n.top+t.scrollTop}}function Ku(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=gu(r),s=t?Cu(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Nl(1),u=Nl(0),d=yu(r);if((d||!d&&!a)&&((mu(r)!==`body`||xu(o))&&(c=Nu(r)),d)){let e=Q(r);l=Bu(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Gu(o,c):Nl(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 qu(e){return Array.from(e.getClientRects())}function Ju(e){let t=gu(e),n=Nu(e),r=e.ownerDocument.body,i=Al(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Al(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Wu(e),s=-n.scrollTop;return Mu(r).direction===`rtl`&&(o+=Al(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Yu=25;function Xu(e,t){let n=hu(e),r=gu(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Au();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Wu(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<=Yu&&(a-=o)}else l<=Yu&&(a+=l);return{width:a,height:o,x:s,y:c}}function Zu(e,t){let n=Q(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=yu(e)?Bu(e):Nl(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Qu(e,t,n){let r;if(t===`viewport`)r=Xu(e,n);else if(t===`document`)r=Ju(gu(e));else if(vu(t))r=Zu(t,n);else{let n=Hu(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Zl(r)}function $u(e,t){let n=Pu(e);return n===t||!vu(n)||ju(n)?!1:Mu(n).position===`fixed`||$u(n,t)}function ed(e,t){let n=t.get(e);if(n)return n;let r=Iu(e,[],!1).filter(e=>vu(e)&&mu(e)!==`body`),i=null,a=Mu(e).position===`fixed`,o=a?Pu(e):e;for(;vu(o)&&!ju(o);){let t=Mu(o),n=Ou(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||xu(o)&&!n&&$u(e,o))?r=r.filter(e=>e!==o):i=t,o=Pu(o)}return t.set(e,r),r}function td(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Cu(t)?[]:ed(t,this._c):[].concat(n),r],o=Qu(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=Qu(t,a[e],i);s=Al(n.top,s),c=kl(n.right,c),l=kl(n.bottom,l),u=Al(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function nd(e){let{width:t,height:n}=Ru(e);return{width:t,height:n}}function rd(e,t,n){let r=yu(t),i=gu(t),a=n===`fixed`,o=Q(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Nl(0);function l(){c.x=Wu(i)}if(r||!r&&!a)if((mu(t)!==`body`||xu(i))&&(s=Nu(t)),r){let e=Q(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?Gu(i,s):Nl(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 id(e){return Mu(e).position===`static`}function ad(e,t){if(!yu(e)||Mu(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return gu(e)===n&&(n=n.ownerDocument.body),n}function od(e,t){let n=hu(e);if(Cu(e))return n;if(!yu(e)){let t=Pu(e);for(;t&&!ju(t);){if(vu(t)&&!id(t))return t;t=Pu(t)}return n}let r=ad(e,t);for(;r&&Su(r)&&id(r);)r=ad(r,t);return r&&ju(r)&&id(r)&&!Ou(r)?n:r||ku(e)||n}var sd=async function(e){let t=this.getOffsetParent||od,n=this.getDimensions,r=await n(e.floating);return{reference:rd(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function cd(e){return Mu(e).direction===`rtl`}var ld={convertOffsetParentRelativeRectToViewportRelativeRect:Ku,getDocumentElement:gu,getClippingRect:td,getOffsetParent:od,getElementRects:sd,getClientRects:qu,getDimensions:nd,getScale:Bu,isElement:vu,isRTL:cd};function ud(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function dd(e,t){let n=null,r,i=gu(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=Ml(d),h=Ml(i.clientWidth-(u+f)),g=Ml(i.clientHeight-(d+p)),_=Ml(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Al(0,kl(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&&!ud(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 fd(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=zu(e),u=i||a?[...l?Iu(l):[],...t?Iu(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?dd(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?Q(e):null;c&&g();function g(){let t=Q(e);h&&!ud(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 pd=lu,md=uu,hd=ru,gd=fu,_d=ou,vd=nu,$=du,yd=(e,t,n)=>{let r=new Map,i={platform:ld,...n},a={...i.platform,_c:r};return tu(e,t,{...i,platform:a})},bd=typeof document<`u`?L.useLayoutEffect:function(){};function xd(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(!xd(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)&&!xd(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Sd(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cd(e,t){let n=Sd(e);return Math.round(t*n)/n}function wd(e){let t=L.useRef(e);return bd(()=>{t.current=e}),t}function Td(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);xd(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=wd(c),D=wd(i),O=wd(l),k=L.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),yd(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!xd(w.current,t)&&(w.current=t,oc.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);bd(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=L.useRef(!1);bd(()=>(A.current=!0,()=>{A.current=!1}),[]),bd(()=>{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=Cd(j.floating,u.x),r=Cd(j.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Sd(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 Ed=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?{}:vd({element:r.current,padding:i}).fn(n):r?vd({element:r,padding:i}).fn(n):{}}}},Dd=(e,t)=>{let n=pd(e);return{name:n.name,fn:n.fn,options:[e,t]}},Od=(e,t)=>{let n=md(e);return{name:n.name,fn:n.fn,options:[e,t]}},kd=(e,t)=>({fn:$(e).fn,options:[e,t]}),Ad=(e,t)=>{let n=hd(e);return{name:n.name,fn:n.fn,options:[e,t]}},jd=(e,t)=>{let n=gd(e);return{name:n.name,fn:n.fn,options:[e,t]}},Md=(e,t)=>{let n=_d(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nd=(e,t)=>{let n=Ed(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pd=`Arrow`,Fd=L.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,R.jsx)(Bc.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`})})});Fd.displayName=Pd;var Id=Fd;function Ld(e){let[t,n]=L.useState(void 0);return kc(()=>{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 Rd=`Popper`,[zd,Bd]=Dc(Rd),[Vd,Hd]=zd(Rd),Ud=e=>{let{__scopePopper:t,children:n}=e,[r,i]=L.useState(null);return(0,R.jsx)(Vd,{scope:t,anchor:r,onAnchorChange:i,children:n})};Ud.displayName=Rd;var Wd=`PopperAnchor`,Gd=L.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Hd(Wd,n),o=L.useRef(null),s=Ec(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)(Bc.div,{...i,ref:s})});Gd.displayName=Wd;var Kd=`PopperContent`,[qd,Jd]=zd(Kd),Yd=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=Hd(Kd,n),[_,v]=L.useState(null),y=Ec(t,e=>v(e)),[b,x]=L.useState(null),S=Ld(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($d),altBoundary:O},{refs:A,floatingStyles:ee,placement:j,isPositioned:te,middlewareData:M}=Td({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>fd(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[Dd({mainAxis:i+w,alignmentAxis:o}),c&&Od({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?kd():void 0,...k}),c&&Ad({...k}),jd({...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&&Nd({element:b,padding:s}),ef({arrowWidth:C,arrowHeight:w}),f&&Md({strategy:`referenceHidden`,...k})]}),[ne,N]=tf(j),P=Gc(m);kc(()=>{te&&P?.()},[te,P]);let re=M.arrow?.x,ie=M.arrow?.y,ae=M.arrow?.centerOffset!==0,[oe,F]=L.useState();return kc(()=>{_&&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)(qd,{scope:n,placedSide:ne,onArrowChange:x,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,R.jsx)(Bc.div,{"data-side":ne,"data-align":N,...h,ref:y,style:{...h.style,animation:te?void 0:`none`}})})})});Yd.displayName=Kd;var Xd=`PopperArrow`,Zd={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Qd=L.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Jd(Xd,n),a=Zd[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)(Id,{...r,ref:t,style:{...r.style,display:`block`}})})});Qd.displayName=Xd;function $d(e){return e!==null}var ef=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]=tf(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 tf(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var nf=Ud,rf=Gd,af=Yd,of=Qd,sf=`Portal`,cf=L.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=L.useState(!1);kc(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?oc.createPortal((0,R.jsx)(Bc.div,{...r,ref:t}),o):null});cf.displayName=sf;function lf(e,t){return L.useReducer((e,n)=>t[e][n]??e,e)}var uf=e=>{let{present:t,children:n}=e,r=df(t),i=typeof n==`function`?n({present:r.isPresent}):L.Children.only(n),a=Ec(r.ref,pf(i));return typeof n==`function`||r.isPresent?L.cloneElement(i,{ref:a}):null};uf.displayName=`Presence`;function df(e){let[t,n]=L.useState(),r=L.useRef(null),i=L.useRef(e),a=L.useRef(`none`),[o,s]=lf(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return L.useEffect(()=>{let e=ff(r.current);a.current=o===`mounted`?e:`none`},[o]),kc(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=ff(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),kc(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=ff(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=ff(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 ff(e){return e?.animationName||`none`}function pf(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 mf=`rovingFocusGroup.onEntryFocus`,hf={bubbles:!1,cancelable:!0},gf=`RovingFocusGroup`,[_f,vf,yf]=Hc(gf),[bf,xf]=Dc(gf,[yf]),[Sf,Cf]=bf(gf),wf=L.forwardRef((e,t)=>(0,R.jsx)(_f.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(_f.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(Tf,{...e,ref:t})})}));wf.displayName=gf;var Tf=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=Ec(t,f),m=Wc(a),[h,g]=jc({prop:o,defaultProp:s??null,onChange:c,caller:gf}),[_,v]=L.useState(!1),y=Gc(l),b=vf(n),x=L.useRef(!1),[S,C]=L.useState(0);return L.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(mf,y),()=>e.removeEventListener(mf,y)},[y]),(0,R.jsx)(Sf,{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)(Bc.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:q(e.onMouseDown,()=>{x.current=!0}),onFocus:q(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(mf,hf);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);jf([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:q(e.onBlur,()=>v(!1))})})}),Ef=`RovingFocusGroupItem`,Df=L.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Dl(),l=a||c,u=Cf(Ef,n),d=u.currentTabStopId===l,f=vf(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return L.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,R.jsx)(_f.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,R.jsx)(Bc.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:q(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:q(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:q(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Af(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?Mf(n,r+1):n.slice(r+1)}setTimeout(()=>jf(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});Df.displayName=Ef;var Of={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function kf(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Af(e,t,n){let r=kf(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Of[r]}function jf(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Mf(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Nf=wf,Pf=Df,Ff=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},If=new WeakMap,Lf=new WeakMap,Rf={},zf=0,Bf=function(e){return e&&(e.host||Bf(e.parentNode))},Vf=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Bf(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})},Hf=function(e,t,n,r){var i=Vf(t,Array.isArray(e)?e:[e]);Rf[n]||(Rf[n]=new WeakMap);var a=Rf[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=(If.get(e)||0)+1,l=(a.get(e)||0)+1;If.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Lf.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(),zf++,function(){o.forEach(function(e){var t=If.get(e)-1,i=a.get(e)-1;If.set(e,t),a.set(e,i),t||(Lf.has(e)||e.removeAttribute(r),Lf.delete(e)),i||e.removeAttribute(n)}),zf--,zf||(If=new WeakMap,If=new WeakMap,Lf=new WeakMap,Rf={})}},Uf=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Ff(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Hf(r,i,n,`aria-hidden`)):function(){return null}},Wf=function(){return Wf=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},Wf.apply(this,arguments)};function Gf(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 Kf(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 qf=`right-scroll-bar-position`,Jf=`width-before-scroll-bar`,Yf=`with-scroll-bars-hidden`,Xf=`--removed-body-scroll-bar-size`;function Zf(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Qf(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 $f=typeof window<`u`?L.useLayoutEffect:L.useEffect,ep=new WeakMap;function tp(e,t){var n=Qf(t||null,function(t){return e.forEach(function(e){return Zf(e,t)})});return $f(function(){var t=ep.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Zf(e,null)}),i.forEach(function(e){r.has(e)||Zf(e,a)})}ep.set(n,e)},[e]),n}function np(e){return e}function rp(e,t){t===void 0&&(t=np);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 ip(e){e===void 0&&(e={});var t=rp(null);return t.options=Wf({async:!0,ssr:!1},e),t}var ap=function(e){var t=e.sideCar,n=Gf(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,Wf({},n))};ap.isSideCarExport=!0;function op(e,t){return e.useMedium(t),ap}var sp=ip(),cp=function(){},lp=L.forwardRef(function(e,t){var n=L.useRef(null),r=L.useState({onScrollCapture:cp,onWheelCapture:cp,onTouchMoveCapture:cp}),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=Gf(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=tp([n,t]),C=Wf(Wf({},b),i);return L.createElement(L.Fragment,null,u&&L.createElement(x,{sideCar:sp,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),Wf(Wf({},C),{ref:S})):L.createElement(v,Wf({},C,{className:c,ref:S}),s))});lp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},lp.classNames={fullWidth:Jf,zeroRight:qf};var up,dp=function(){if(up)return up;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function fp(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=dp();return t&&e.setAttribute(`nonce`,t),e}function pp(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function mp(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var hp=function(){var e=0,t=null;return{add:function(n){e==0&&(t=fp())&&(pp(t,n),mp(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},gp=function(){var e=hp();return function(t,n){L.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},_p=function(){var e=gp();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},vp={left:0,top:0,right:0,gap:0},yp=function(e){return parseInt(e||``,10)||0},bp=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[yp(n),yp(r),yp(i)]},xp=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return vp;var t=bp(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])}},Sp=_p(),Cp=`data-scroll-locked`,wp=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
|
+
.${Yf} {
|
|
14
|
+
overflow: hidden ${r};
|
|
15
|
+
padding-right: ${s}px ${r};
|
|
16
|
+
}
|
|
17
|
+
body[${Cp}] {
|
|
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
|
+
.${qf} {
|
|
31
|
+
right: ${s}px ${r};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.${Jf} {
|
|
35
|
+
margin-right: ${s}px ${r};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.${qf} .${qf} {
|
|
39
|
+
right: 0 ${r};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.${Jf} .${Jf} {
|
|
43
|
+
margin-right: 0 ${r};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
body[${Cp}] {
|
|
47
|
+
${Xf}: ${s}px;
|
|
48
|
+
}
|
|
49
|
+
`},Tp=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Ep=function(){L.useEffect(function(){return document.body.setAttribute(Cp,(Tp()+1).toString()),function(){var e=Tp()-1;e<=0?document.body.removeAttribute(Cp):document.body.setAttribute(Cp,e.toString())}},[])},Dp=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Ep();var a=L.useMemo(function(){return xp(i)},[i]);return L.createElement(Sp,{styles:wp(a,!t,i,n?``:`!important`)})},Op=!1;if(typeof window<`u`)try{var kp=Object.defineProperty({},`passive`,{get:function(){return Op=!0,!0}});window.addEventListener(`test`,kp,kp),window.removeEventListener(`test`,kp,kp)}catch{Op=!1}var Ap=Op?{passive:!1}:!1,jp=function(e){return e.tagName===`TEXTAREA`},Mp=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!jp(e)&&n[t]===`visible`)},Np=function(e){return Mp(e,`overflowY`)},Pp=function(e){return Mp(e,`overflowX`)},Fp=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Rp(e,r)){var i=zp(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ip=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Lp=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Rp=function(e,t){return e===`v`?Np(t):Pp(t)},zp=function(e,t){return e===`v`?Ip(t):Lp(t)},Bp=function(e,t){return e===`h`&&t===`rtl`?-1:1},Vp=function(e,t,n,r,i){var a=Bp(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=zp(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Rp(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},Hp=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Up=function(e){return[e.deltaX,e.deltaY]},Wp=function(e){return e&&`current`in e?e.current:e},Gp=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Kp=function(e){return`
|
|
50
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
51
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
52
|
+
`},qp=0,Jp=[];function Yp(e){var t=L.useRef([]),n=L.useRef([0,0]),r=L.useRef(),i=L.useState(qp++)[0],a=L.useState(_p)[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=Kf([e.lockRef.current],(e.shards||[]).map(Wp),!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=Hp(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=Fp(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Fp(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 Vp(h,t,e,h===`h`?s:c,!0)},[]),c=L.useCallback(function(e){var n=e;if(!(!Jp.length||Jp[Jp.length-1]!==a)){var r=`deltaY`in n?Up(n):Hp(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Gp(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Wp).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:Xp(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=Hp(e),r.current=void 0},[]),d=L.useCallback(function(t){l(t.type,Up(t),t.target,s(t,e.lockRef.current))},[]),f=L.useCallback(function(t){l(t.type,Hp(t),t.target,s(t,e.lockRef.current))},[]);L.useEffect(function(){return Jp.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Ap),document.addEventListener(`touchmove`,c,Ap),document.addEventListener(`touchstart`,u,Ap),function(){Jp=Jp.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Ap),document.removeEventListener(`touchmove`,c,Ap),document.removeEventListener(`touchstart`,u,Ap)}},[]);var p=e.removeScrollBar,m=e.inert;return L.createElement(L.Fragment,null,m?L.createElement(a,{styles:Kp(i)}):null,p?L.createElement(Dp,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Xp(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Zp=op(sp,Yp),Qp=L.forwardRef(function(e,t){return L.createElement(lp,Wf({},e,{ref:t,sideCar:Zp}))});Qp.classNames=lp.classNames;var $p=[`Enter`,` `],em=[`ArrowDown`,`PageUp`,`Home`],tm=[`ArrowUp`,`PageDown`,`End`],nm=[...em,...tm],rm={ltr:[...$p,`ArrowRight`],rtl:[...$p,`ArrowLeft`]},im={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},am=`Menu`,[om,sm,cm]=Hc(am),[lm,um]=Dc(am,[cm,Bd,xf]),dm=Bd(),fm=xf(),[pm,mm]=lm(am),[hm,gm]=lm(am),_m=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=dm(t),[c,l]=L.useState(null),u=L.useRef(!1),d=Gc(a),f=Wc(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)(nf,{...s,children:(0,R.jsx)(pm,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,R.jsx)(hm,{scope:t,onClose:L.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};_m.displayName=am;var vm=`MenuAnchor`,ym=L.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=dm(n);return(0,R.jsx)(rf,{...i,...r,ref:t})});ym.displayName=vm;var bm=`MenuPortal`,[xm,Sm]=lm(bm,{forceMount:void 0}),Cm=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=mm(bm,t);return(0,R.jsx)(xm,{scope:t,forceMount:n,children:(0,R.jsx)(uf,{present:n||a.open,children:(0,R.jsx)(cf,{asChild:!0,container:i,children:r})})})};Cm.displayName=bm;var wm=`MenuContent`,[Tm,Em]=lm(wm),Dm=L.forwardRef((e,t)=>{let n=Sm(wm,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=mm(wm,e.__scopeMenu),o=gm(wm,e.__scopeMenu);return(0,R.jsx)(om.Provider,{scope:e.__scopeMenu,children:(0,R.jsx)(uf,{present:r||a.open,children:(0,R.jsx)(om.Slot,{scope:e.__scopeMenu,children:o.modal?(0,R.jsx)(Om,{...i,ref:t}):(0,R.jsx)(km,{...i,ref:t})})})})}),Om=L.forwardRef((e,t)=>{let n=mm(wm,e.__scopeMenu),r=L.useRef(null),i=Ec(t,r);return L.useEffect(()=>{let e=r.current;if(e)return Uf(e)},[]),(0,R.jsx)(jm,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:q(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),km=L.forwardRef((e,t)=>{let n=mm(wm,e.__scopeMenu);return(0,R.jsx)(jm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Am=Pc(`MenuContent.ScrollLock`),jm=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=mm(wm,n),_=gm(wm,n),v=dm(n),y=fm(n),b=sm(n),[x,S]=L.useState(null),C=L.useRef(null),w=Ec(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?Qp:L.Fragment,j=m?{as:Am,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=hh(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),[]),sl();let M=L.useCallback(e=>k.current===O.current?.side&&_h(e,O.current?.area),[]);return(0,R.jsx)(Tm,{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)(pl,{asChild:!0,trapped:i,onMountAutoFocus:q(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,R.jsx)($c,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,R.jsx)(Nf,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:q(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,R.jsx)(af,{role:`menu`,"aria-orientation":`vertical`,"data-state":uh(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:q(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||!nm.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);tm.includes(e.key)&&a.reverse(),ph(a)}),onBlur:q(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:q(e.onPointerMove,vh(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)}))})})})})})})});Dm.displayName=wm;var Mm=`MenuGroup`,Nm=L.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,R.jsx)(Bc.div,{role:`group`,...r,ref:t})});Nm.displayName=Mm;var Pm=`MenuLabel`,Fm=L.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,R.jsx)(Bc.div,{...r,ref:t})});Fm.displayName=Pm;var Im=`MenuItem`,Lm=`menu.itemSelect`,Rm=L.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=L.useRef(null),o=gm(Im,e.__scopeMenu),s=Em(Im,e.__scopeMenu),c=Ec(t,a),l=L.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Lm,{bubbles:!0,cancelable:!0});e.addEventListener(Lm,e=>r?.(e),{once:!0}),Vc(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,R.jsx)(zm,{...i,ref:c,disabled:n,onClick:q(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:q(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:q(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||$p.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Rm.displayName=Im;var zm=L.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Em(Im,n),s=fm(n),c=L.useRef(null),l=Ec(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)(om.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,R.jsx)(Pf,{asChild:!0,...s,focusable:!r,children:(0,R.jsx)(Bc.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:q(e.onPointerMove,vh(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:q(e.onPointerLeave,vh(e=>o.onItemLeave(e))),onFocus:q(e.onFocus,()=>d(!0)),onBlur:q(e.onBlur,()=>d(!1))})})})}),Bm=`MenuCheckboxItem`,Vm=L.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,R.jsx)(Ym,{scope:e.__scopeMenu,checked:n,children:(0,R.jsx)(Rm,{role:`menuitemcheckbox`,"aria-checked":dh(n)?`mixed`:n,...i,ref:t,"data-state":fh(n),onSelect:q(i.onSelect,()=>r?.(dh(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Vm.displayName=Bm;var Hm=`MenuRadioGroup`,[Um,Wm]=lm(Hm,{value:void 0,onValueChange:()=>{}}),Gm=L.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=Gc(r);return(0,R.jsx)(Um,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,R.jsx)(Nm,{...i,ref:t})})});Gm.displayName=Hm;var Km=`MenuRadioItem`,qm=L.forwardRef((e,t)=>{let{value:n,...r}=e,i=Wm(Km,e.__scopeMenu),a=n===i.value;return(0,R.jsx)(Ym,{scope:e.__scopeMenu,checked:a,children:(0,R.jsx)(Rm,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":fh(a),onSelect:q(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});qm.displayName=Km;var Jm=`MenuItemIndicator`,[Ym,Xm]=lm(Jm,{checked:!1}),Zm=L.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=Xm(Jm,n);return(0,R.jsx)(uf,{present:r||dh(a.checked)||a.checked===!0,children:(0,R.jsx)(Bc.span,{...i,ref:t,"data-state":fh(a.checked)})})});Zm.displayName=Jm;var Qm=`MenuSeparator`,$m=L.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,R.jsx)(Bc.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});$m.displayName=Qm;var eh=`MenuArrow`,th=L.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=dm(n);return(0,R.jsx)(of,{...i,...r,ref:t})});th.displayName=eh;var nh=`MenuSub`,[rh,ih]=lm(nh),ah=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=mm(nh,t),o=dm(t),[s,c]=L.useState(null),[l,u]=L.useState(null),d=Gc(i);return L.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,R.jsx)(nf,{...o,children:(0,R.jsx)(pm,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,R.jsx)(rh,{scope:t,contentId:Dl(),triggerId:Dl(),trigger:s,onTriggerChange:c,children:n})})})};ah.displayName=nh;var oh=`MenuSubTrigger`,sh=L.forwardRef((e,t)=>{let n=mm(oh,e.__scopeMenu),r=gm(oh,e.__scopeMenu),i=ih(oh,e.__scopeMenu),a=Em(oh,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)(ym,{asChild:!0,...l,children:(0,R.jsx)(zm,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":uh(n.open),...e,ref:Tc(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:q(e.onPointerMove,vh(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:q(e.onPointerLeave,vh(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:q(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||rm[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});sh.displayName=oh;var ch=`MenuSubContent`,lh=L.forwardRef((e,t)=>{let n=Sm(wm,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=mm(wm,e.__scopeMenu),o=gm(wm,e.__scopeMenu),s=ih(ch,e.__scopeMenu),c=L.useRef(null),l=Ec(t,c);return(0,R.jsx)(om.Provider,{scope:e.__scopeMenu,children:(0,R.jsx)(uf,{present:r||a.open,children:(0,R.jsx)(om.Slot,{scope:e.__scopeMenu,children:(0,R.jsx)(jm,{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:q(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:q(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:q(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=im[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});lh.displayName=ch;function uh(e){return e?`open`:`closed`}function dh(e){return e===`indeterminate`}function fh(e){return dh(e)?`indeterminate`:e?`checked`:`unchecked`}function ph(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function mh(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function hh(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=mh(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 gh(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 _h(e,t){return t?gh({x:e.clientX,y:e.clientY},t):!1}function vh(e){return t=>t.pointerType===`mouse`?e(t):void 0}var yh=_m,bh=ym,xh=Cm,Sh=Dm,Ch=Nm,wh=Fm,Th=Rm,Eh=Vm,Dh=Gm,Oh=qm,kh=Zm,Ah=$m,jh=th,Mh=sh,Nh=lh,Ph=`DropdownMenu`,[Fh,Ih]=Dc(Ph,[um]),Lh=um(),[Rh,zh]=Fh(Ph),Bh=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Lh(t),l=L.useRef(null),[u,d]=jc({prop:i,defaultProp:a??!1,onChange:o,caller:Ph});return(0,R.jsx)(Rh,{scope:t,triggerId:Dl(),triggerRef:l,contentId:Dl(),open:u,onOpenChange:d,onOpenToggle:L.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,R.jsx)(yh,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Bh.displayName=Ph;var Vh=`DropdownMenuTrigger`,Hh=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=zh(Vh,n),o=Lh(n);return(0,R.jsx)(bh,{asChild:!0,...o,children:(0,R.jsx)(Bc.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:Tc(t,a.triggerRef),onPointerDown:q(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:q(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Hh.displayName=Vh;var Uh=`DropdownMenuPortal`,Wh=e=>{let{__scopeDropdownMenu:t,...n}=e,r=Lh(t);return(0,R.jsx)(xh,{...r,...n})};Wh.displayName=Uh;var Gh=`DropdownMenuContent`,Kh=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=zh(Gh,n),a=Lh(n),o=L.useRef(!1);return(0,R.jsx)(Sh,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:q(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:q(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)`}})});Kh.displayName=Gh;var qh=`DropdownMenuGroup`,Jh=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Lh(n);return(0,R.jsx)(Ch,{...i,...r,ref:t})});Jh.displayName=qh;var Yh=`DropdownMenuLabel`,Xh=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Lh(n);return(0,R.jsx)(wh,{...i,...r,ref:t})});Xh.displayName=Yh;var Zh=`DropdownMenuItem`,Qh=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Lh(n);return(0,R.jsx)(Th,{...i,...r,ref:t})});Qh.displayName=Zh;var $h=`DropdownMenuCheckboxItem`,eg=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Lh(n);return(0,R.jsx)(Eh,{...i,...r,ref:t})});eg.displayName=$h;var tg=`DropdownMenuRadioGroup`,ng=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Lh(n);return(0,R.jsx)(Dh,{...i,...r,ref:t})});ng.displayName=tg;var rg=`DropdownMenuRadioItem`,ig=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Lh(n);return(0,R.jsx)(Oh,{...i,...r,ref:t})});ig.displayName=rg;var ag=`DropdownMenuItemIndicator`,og=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Lh(n);return(0,R.jsx)(kh,{...i,...r,ref:t})});og.displayName=ag;var sg=`DropdownMenuSeparator`,cg=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Lh(n);return(0,R.jsx)(Ah,{...i,...r,ref:t})});cg.displayName=sg;var lg=`DropdownMenuArrow`,ug=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Lh(n);return(0,R.jsx)(jh,{...i,...r,ref:t})});ug.displayName=lg;var dg=`DropdownMenuSubTrigger`,fg=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Lh(n);return(0,R.jsx)(Mh,{...i,...r,ref:t})});fg.displayName=dg;var pg=`DropdownMenuSubContent`,mg=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Lh(n);return(0,R.jsx)(Nh,{...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)`}})});mg.displayName=pg;var hg=Bh,gg=Hh,_g=Wh,vg=Kh,yg=Qh,bg=hg,xg=gg;function Sg({align:e=`end`,className:t,sideOffset:n=4,...r}){return(0,R.jsx)(_g,{children:(0,R.jsx)(vg,{align:e,className:G(`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 Cg({className:e,variant:t,...n}){return(0,R.jsx)(yg,{className:G(`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 wg({className:e,...t}){return(0,R.jsx)(`label`,{className:G(`text-[length:var(--font-size-sm)] font-medium leading-none text-foreground`,e),...t})}function Tg(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function Eg(e,t){let n=getComputedStyle(e.ownerDocument.body);return t*parseFloat(n.fontSize)}function Dg(e){return e/100*window.innerHeight}function Og(e){return e/100*window.innerWidth}function kg(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function Ag({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=kg(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=Eg(t,i);break;case`em`:r=Tg(t,i);break;case`vh`:r=Dg(i);break;case`vw`:r=Og(i);break}return r}function jg(e){return parseFloat(e.toFixed(3))}function Mg({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function Ng(e){let{panels:t}=e,n=Mg({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=jg(Ag({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=jg(Ag({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=jg(Ag({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=jg(Ag({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function Pg(e,t=`Assertion error`){if(!e)throw Error(t)}function Fg(e,t){return Array.from(t).sort(e===`horizontal`?Ig:Lg)}function Ig(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function Lg(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function Rg(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function zg(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function Bg({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=zg(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return Pg(i,`No rect found`),i}var Vg;function Hg(){return Vg===void 0&&(Vg=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),Vg}function Ug(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=Fg(n,Array.from(t.children).filter(Rg).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,Bg({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=Hg()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:Mg({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var Wg=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},Gg=new Map,Kg=new Wg;function qg(e){Gg=new Map(Gg),Gg.delete(e)}function Jg(e,t){for(let[t]of Gg)if(t.id===e)return t}function Yg(e,t){for(let[t,n]of Gg)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function Xg(){return Gg}function Zg(e,t){return Kg.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function Qg(e,t){let n=Gg.get(e);Gg=new Map(Gg),Gg.set(e,t),Kg.emit(`groupChange`,{group:e,prev:n,next:t})}function $g(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=zg(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function e_(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function t_(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:s_(e),b:s_(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();Pg(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:o_(a_(n.a)),b:o_(a_(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var n_=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function r_(e){let t=getComputedStyle(c_(e)??e).display;return t===`flex`||t===`inline-flex`}function i_(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||r_(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||n_.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function a_(e){let t=e.length;for(;t--;){let n=e[t];if(Pg(n,`Missing node`),i_(n))return n}return null}function o_(e){return e&&Number(getComputedStyle(e).zIndex)||0}function s_(e){let t=[];for(;e;)t.push(e),e=c_(e);return t}function c_(e){let{parentNode:t}=e;return e_(t)?t.host:t}function l_(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function u_({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!Rg(n)||n.contains(e)||e.contains(n))return!0;if(t_(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(l_(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function d_(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=Ug(r),a=$g(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&u_({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function f_(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function p_(e,t,n=0){return Math.abs(jg(e)-jg(t))<=n}function m_(e,t){return p_(e,t)?0:e>t?1:-1}function h_({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(m_(r,c)<0)if(a){let e=(i+c)/2;r=m_(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=jg(r),r}function g_({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(p_(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;Pg(u!=null,`Invalid first pivot index`),Pg(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];Pg(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Pg(n!=null,`Previous layout not found for panel index ${t}`),p_(n,i)){let t=o-n;m_(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];Pg(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Pg(n!=null,`Previous layout not found for panel index ${t}`),p_(n,o)){let t=n-i;m_(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];Pg(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&m_(i,c)<0)if(e>0){let t=c-o,n=t/2;m_(i+e,c)<0&&(e=m_(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;m_(i-e,c)<0&&(e=m_(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];Pg(e!=null,`Previous layout not found for panel index ${r}`);let a=h_({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];Pg(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=h_({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!p_(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(f_(c,l))return i;{let t=e<0?d:u,r=s[t];Pg(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=h_({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!p_(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];Pg(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=h_({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(p_(i,s)||(t-=s-i,l[r]=s),p_(t,0))break;e>0?r--:r++}}}if(!p_(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function __(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||m_(e[n],t[n])!==0)return!1;return!0}function v_({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!p_(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];Pg(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];Pg(i!=null,`No layout data found for index ${e}`);let o=r[e];Pg(o!=null,`No layout data found for index ${e}`);let s=h_({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!p_(a,0))for(let e=0;e<t.length;e++){let n=r[e];Pg(n!=null,`No layout data found for index ${e}`);let i=n+a,o=h_({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,p_(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function y_({groupId:e,panelId:t}){let n=()=>{let t=Xg();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=e=>{let r=a();if(e===r)return;let{defaultLayoutDeferred:i,derivedPanelConstraints:o,group:s,groupSize:c,layout:l,separatorToPanels:u}=n(),d=s.panels.findIndex(e=>e.id===t),f=d===s.panels.length-1,p=v_({layout:g_({delta:f?r-e:e-r,initialLayout:l,panelConstraints:o,pivotIndices:f?[d-1,d]:[d,d+1],prevLayout:l,trigger:`imperative-api`}),panelConstraints:o});__(l,p)||Qg(s,{defaultLayoutDeferred:i,derivedPanelConstraints:o,groupSize:c,layout:p,separatorToPanels:u})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),s=a();e&&s!==t&&(n.expandToSize=s,o(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:s}=i(),c=a();if(e&&c===t){let e=s.expandToSize??n;e===0&&(e=1),o(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&p_(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=Mg({group:t});o(jg(Ag({groupSize:a,panelElement:r,styleProp:e})/a*100))}}}function b_(e){e.defaultPrevented||d_(e,Xg()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=y_({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function x_(e){let t=Xg();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function S_({groupId:e}){let t=()=>{let t=Xg();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=v_({layout:e,panelConstraints:r});return n?o:(__(o,c)||Qg(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function C_(e,t){let n=x_(e),r=Yg(n.id,!0),i=n.separators.find(t=>t.element===e);Pg(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);Pg(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=S_({groupId:n.id}).getLayout(),c=v_({layout:g_({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});__(s,c)||Qg(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels})}function w_(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=x_(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&C_(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&C_(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&C_(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&C_(t,-5);break;case`End`:e.preventDefault(),C_(t,100);break;case`Enter`:{e.preventDefault();let n=x_(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=Yg(n.id,!0),o=n.separators.find(e=>e.element===t);Pg(o,`Matching separator not found`);let s=a.get(o);Pg(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(Pg(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];C_(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=x_(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);Pg(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),C_(t,-100);break}}var T_={cursorFlags:0,state:`inactive`},E_=new Wg;function D_(){return T_}function O_(e){return E_.addListener(`change`,e)}function k_(e){let t=T_,n={...T_};n.cursorFlags=e,T_=n,E_.emit(`change`,{prev:t,next:n})}function A_(e){let t=T_;T_=e,E_.emit(`change`,{prev:t,next:e})}function j_(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=Xg(),n=d_(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),A_({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}var M_=e=>e,N_=()=>{},P_=1,F_=2,I_=4,L_=8,R_=3,z_=12,B_;function V_(){return B_===void 0&&(B_=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(B_=!0)),B_}function H_({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&V_()){let t=(e&P_)!==0,n=(e&F_)!==0,r=(e&I_)!==0,i=(e&L_)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return V_()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var U_=new WeakMap;function W_(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=U_.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));let r=D_();switch(r.state){case`active`:case`hover`:{let e=H_({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}U_.set(e,{prevStyle:t,styleSheet:n})}function G_({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=g_({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(__(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?P_:F_;break;case`vertical`:s|=d<0?I_:L_;break}}else Qg(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&R_:c|=s&R_,t.movementY===0?c|=o&z_:c|=s&z_,k_(c),W_(e)}function K_(e){let t=Xg(),n=D_();switch(n.state){case`active`:G_({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function q_(e){if(e.defaultPrevented)return;let t=D_(),n=Xg();switch(t.state){case`active`:if(e.buttons===0){A_({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=Yg(e.group.id,!0);Qg(e.group,t)});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}G_({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=d_(e,n);r.length===0?t.state!==`inactive`&&A_({cursorFlags:0,state:`inactive`}):A_({cursorFlags:0,hitRegions:r,state:`hover`}),W_(e.currentTarget);break}}}function J_(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(D_().state){case`hover`:A_({cursorFlags:0,state:`inactive`})}}function Y_(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=D_();switch(t.state){case`active`:A_({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(W_(e.currentTarget),t.hitRegions.forEach(e=>{let t=Yg(e.group.id,!0);Qg(e.group,t)}),e.preventDefault())}}function X_(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=jg(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=jg((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function Z_(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=Mg({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:jg(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function Q_(e,t){if(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 $_({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=jg(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e;break}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=jg((r[e]??0)/a*l);else{let e=jg(l/c.length);for(let t of c)u[t]=e}return u}function ev(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var tv=new Map;function nv(e){let t=!0;Pg(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=Mg({group:e});if(t===0)return;let n=Yg(e.id);if(!n)return;let r=Ng(e),i=n.defaultLayoutDeferred?X_(r):n.layout,a=v_({layout:$_({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&__(n.layout,a)&&Q_(n.derivedPanelConstraints,r)&&n.groupSize===t)return;Qg(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else Z_(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{Pg(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=Mg({group:e}),s=Ng(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(ev(e.panels,l)||(l=void 0));let u=v_({layout:e.mutableState.layouts[c]??l??X_(s),panelConstraints:s}),d=e.element.ownerDocument;tv.set(d,(tv.get(d)??0)+1);let f=new Map;return Ug(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),Qg(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{Pg(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,w_)}),tv.get(d)===1&&(d.addEventListener(`dblclick`,b_,!0),d.addEventListener(`pointerdown`,j_,!0),d.addEventListener(`pointerleave`,K_),d.addEventListener(`pointermove`,q_),d.addEventListener(`pointerout`,J_),d.addEventListener(`pointerup`,Y_,!0)),function(){t=!1,tv.set(d,Math.max(0,(tv.get(d)??0)-1)),qg(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,w_)}),tv.get(d)||(d.removeEventListener(`dblclick`,b_,!0),d.removeEventListener(`pointerdown`,j_,!0),d.removeEventListener(`pointerleave`,K_),d.removeEventListener(`pointermove`,q_),d.removeEventListener(`pointerout`,J_),d.removeEventListener(`pointerup`,Y_,!0)),a.disconnect()}}function rv(){let[e,t]=(0,L.useState)({});return[e,(0,L.useCallback)(()=>t({}),[])]}function iv(e){let t=(0,L.useId)();return`${e??t}`}var av=typeof window<`u`?L.useLayoutEffect:L.useEffect;function ov(e){let t=(0,L.useRef)(e);return av(()=>{t.current=e},[e]),(0,L.useCallback)((...e)=>t.current?.(...e),[t])}function sv(...e){return ov(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function cv(e){let t=(0,L.useRef)({...e});return av(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var lv=(0,L.createContext)(null);function uv(e,t){let n=(0,L.useRef)({getLayout:()=>({}),setLayout:M_});(0,L.useImperativeHandle)(t,()=>n.current,[]),av(()=>{Object.assign(n.current,S_({groupId:e}))})}function dv({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,L.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=ov(e=>{__(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=ov(e=>{__(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e))}),_=iv(s),v=(0,L.useRef)(null),[y,b]=rv(),x=(0,L.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),S=sv(v,a);uv(_,o);let C=ov((e,t)=>{let r=D_(),i=Jg(e),a=Yg(e);if(a){let e=!1;switch(r.state){case`active`:e=r.hitRegions.some(e=>e.group===i);break}return{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),w=cv({defaultLayout:n,disableCursor:r}),T=(0,L.useMemo)(()=>({get disableCursor(){return!!w.disableCursor},getPanelStyles:C,id:_,orientation:u,registerPanel:e=>{let t=x.current;return t.panels=Fg(u,[...t.panels,e]),b(),()=>{t.panels=t.panels.filter(t=>t!==e),b()}},registerSeparator:e=>{let t=x.current;return t.separators=Fg(u,[...t.separators,e]),b(),()=>{t.separators=t.separators.filter(t=>t!==e),b()}},updatePanelProps:(e,{disabled:t})=>{let n=x.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=Jg(_),i=Yg(_);r&&i&&Qg(r,{...i,derivedPanelConstraints:Ng(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=x.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[C,_,b,u,w]),E=(0,L.useRef)(null);return av(()=>{let e=v.current;if(e===null)return;let t=x.current,n;if(w.defaultLayout!==void 0&&Object.keys(w.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=w.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!w.disableCursor,expandedPanelSizes:x.current.lastExpandedPanelSizes,layouts:x.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};E.current=r;let a=nv(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=Yg(r.id,!0);!o&&s.length>0&&(h(c),g(c));let l=Zg(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=p_(t.collapsedSize,i[t.panelId]),a=p_(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=D_().state!==`active`;h(i),o&&g(i)});return()=>{E.current=null,a(),l()}},[i,_,g,h,u,y,w]),(0,L.useEffect)(()=>{let e=E.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,R.jsx)(lv.Provider,{value:T,children:(0,R.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:S,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}dv.displayName=`Group`;function fv(){let e=(0,L.useContext)(lv);return Pg(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function pv(e,t){let{id:n}=fv(),r=(0,L.useRef)({collapse:N_,expand:N_,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:N_});(0,L.useImperativeHandle)(t,()=>r.current,[]),av(()=>{Object.assign(r.current,y_({groupId:n,panelId:e}))})}function mv({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=iv(c),_=cv({disabled:a}),v=(0,L.useRef)(null),y=sv(v,o),{getPanelStyles:b,id:x,orientation:S,registerPanel:C,updatePanelProps:w}=fv(),T=d!==null,E=ov((e,t,n)=>{d?.(e,c,n)});av(()=>{let e=v.current;if(e!==null)return C({element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:T?E:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}})},[s,n,r,i,T,g,h,l,u,E,C,_]),(0,L.useEffect)(()=>{w(g,{disabled:a})},[a,g,w]),pv(g,f);let D=()=>{let e=b(x,g);if(e)return JSON.stringify(e)},O=(0,L.useSyncExternalStore)(e=>Zg(x,e),D,D),k;return k=O?JSON.parse(O):i?{flexGrow:void 0,flexShrink:void 0,flexBasis:i}:{flexGrow:1},(0,R.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:y,style:{...hv,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...k},children:(0,R.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:S===`horizontal`?`pan-y`:`pan-x`},children:e})})}mv.displayName=`Panel`;var hv={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function gv({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=v_({layout:g_({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=v_({layout:g_({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function _v({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=iv(a),l=cv({disabled:n,disableDoubleClick:r}),[u,d]=(0,L.useState)({}),[f,p]=(0,L.useState)(`inactive`),[m,h]=(0,L.useState)(!1),g=(0,L.useRef)(null),_=sv(g,i),{disableCursor:v,id:y,orientation:b,registerSeparator:x,updateSeparatorProps:S}=fv(),C=b===`horizontal`?`vertical`:`horizontal`;av(()=>{let e=g.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=x(t),r=O_(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=Zg(y,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);d(gv({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[y,c,x,l]),(0,L.useEffect)(()=>{S(c,{disabled:n,disableDoubleClick:r})},[n,r,c,S]);let w;n&&!v&&(w=`not-allowed`);let T;if(n)T=`disabled`;else switch(f){case`active`:T=`active`;break;default:T=m?`focus`:f}return(0,R.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":C,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":T,"data-testid":c,id:c,onBlur:()=>h(!1),onFocus:()=>h(!0),ref:_,role:`separator`,style:{flexBasis:`auto`,cursor:w,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}_v.displayName=`Separator`;var vv=`relative flex w-px shrink-0 items-center justify-center bg-sidebar-border outline-none transition-colors duration-[var(--motion-duration-fast)] after:absolute after:inset-y-0 after:left-1/2 after:w-3 after:-translate-x-1/2 hover:bg-[var(--border-strong)] focus-visible:shadow-[var(--state-focus-ring)] data-[separator=active]:bg-[var(--border-strong)] [aria-orientation=horizontal]:h-px [aria-orientation=horizontal]:w-full [aria-orientation=horizontal]:after:inset-x-0 [aria-orientation=horizontal]:after:inset-y-auto [aria-orientation=horizontal]:after:top-1/2 [aria-orientation=horizontal]:after:h-3 [aria-orientation=horizontal]:after:w-full [aria-orientation=horizontal]:after:translate-x-0 [aria-orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`;function yv({className:e,...t}){return(0,R.jsx)(dv,{className:G(`min-h-0 w-full`,e),...t})}var bv=mv;function xv({className:e,withHandle:t,...n}){return(0,R.jsx)(_v,{className:G(vv,e),...n,children:t&&(0,R.jsx)(`div`,{className:`z-10 flex h-5 w-3 items-center justify-center rounded-[var(--radius-xs)] border border-sidebar-border bg-[var(--surface-card)] shadow-[var(--shadow-xs)]`,children:(0,R.jsx)(ko,{className:`size-3 text-[var(--icon-color-muted)]`})})})}var Sv=`b`,Cv=(0,L.createContext)(null);function wv(){let e=(0,L.useContext)(Cv);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function Tv({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()===Sv&&(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)(Cv.Provider,{value:f,children:(0,R.jsx)(`div`,{"data-sidebar-wrapper":``,"data-state":l?`expanded`:`collapsed`,className:G(`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 Ev({children:e,className:t,collapsible:n=`offcanvas`,variant:r=`sidebar`,...i}){let{setOpen:a,state:o}=wv(),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:G(`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 Dv({className:e,...t}){return(0,R.jsx)(`div`,{className:G(`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 Ov({className:e,...t}){return(0,R.jsx)(`main`,{className:G(`relative flex min-w-0 flex-1 flex-col bg-[var(--surface-panel)]`,e),...t})}function kv({className:e,"aria-label":t,title:n=`Toggle sidebar`,...r}){let{toggleSidebar:i}=wv(),a=t??(typeof n==`string`?n:`Toggle sidebar`);return(0,R.jsxs)(`button`,{"aria-label":a,className:G(`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:i,title:n,type:`button`,...r,children:[(0,R.jsx)(Fo,{className:`size-4`}),(0,R.jsx)(`span`,{className:`sr-only`,children:a})]})}function Av({className:e,...t}){return(0,R.jsx)(`div`,{className:G(`min-h-0 flex-1 overflow-y-auto p-2 group-data-[state=collapsed]/sidebar:px-2`,e),...t})}function jv({className:e,...t}){return(0,R.jsx)(`section`,{className:G(`relative space-y-1 group-data-[state=collapsed]/sidebar:space-y-2`,e),...t})}function Mv({className:e,...t}){return(0,R.jsx)(`div`,{className:G(`flex items-center gap-2 group-data-[state=collapsed]/sidebar:hidden`,e),...t})}function Nv({className:e,...t}){return(0,R.jsx)(`div`,{className:G(`min-w-0 flex-1 px-2 py-1 text-[length:var(--font-size-xs)] font-medium text-[var(--text-secondary)]`,e),...t})}function Pv({className:e,...t}){return(0,R.jsx)(`button`,{className:G(`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 Fv({className:e,...t}){return(0,R.jsx)(`div`,{className:G(`w-full`,e),...t})}function Iv({className:e,...t}){return(0,R.jsx)(`ul`,{className:G(`space-y-1`,e),...t})}function Lv({className:e,...t}){return(0,R.jsx)(`li`,{className:G(`min-w-0`,e),...t})}function Rv({className:e,isActive:t,...n}){return(0,R.jsx)(`button`,{className:G(`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 zv({className:e,...t}){return(0,R.jsx)(`ul`,{className:G(`ml-4 mt-1 space-y-1 border-l border-sidebar-border pl-2 group-data-[state=collapsed]/sidebar:hidden`,e),...t})}function Bv({className:e,...t}){return(0,R.jsx)(`li`,{className:G(`min-w-0`,e),...t})}function Vv({className:e,isActive:t,...n}){return(0,R.jsx)(`button`,{className:G(`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 Hv({className:e,...t}){return(0,R.jsx)(`textarea`,{className:G(`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 Uv(e,t=globalThis){let n=e.isComposing||e.keyCode===229;return e.key!==`Enter`||e.shiftKey||e.altKey||n||!Gv(e)||Kv(t)?null:e.metaKey||e.ctrlKey?`modifiedSubmit`:`submit`}function Wv(e,t){return e===`modifiedSubmit`?`queue`:t?.activeTurnId?t.status===`running`?`steer`:null:`send`}function Gv(e){return e.code===`Enter`||e.code===`NumpadEnter`}function Kv(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 qv=[`low`,`medium`,`high`,`xhigh`],Jv=/%(?:2f|3a|5c|7e)/i,Yv=/^[A-Za-z]:/;function Xv(e){let t=e.trim();if(!t)return!1;for(let e=0;e<8;e+=1){if(Jv.test(t)||t.includes(`/`)||t.includes(`\\`)||t.startsWith(`~`)||Yv.test(t))return!1;try{let e=decodeURIComponent(t);if(e===t)return!0;t=e}catch{return!1}}return!1}function Zv(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 Qv(e,t,n,r){let i=new Set(t.map(e=>e.id));return Zv(Object.values(e).flat().filter(e=>i.has(e.projectId)),n,r)}function $v(e,t){return Object.fromEntries(Object.entries(e).filter(([e])=>t.has(e)))}function ey(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 ty(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 ny(e,t){return!!(t&&e.some(e=>e.chatId===t))}function ry(e,t,n,r){return n?!e||e.some(e=>e.id===n)||ny(t,n)?n:r??n:null}function iy(e){return e?e.supportedReasoningEfforts:qv}function ay(e){return!!e?.additionalSpeedTiers.includes(`fast`)}function oy(e,t,n){return e?t===`fast`&&ay(e)?`fast`:null:n===`fast`?`fast`:null}function sy(e,t){return e.filter(e=>e.enabled&&t.has(e.path)).map(e=>({name:e.name,path:e.path}))}function cy(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 ly(e){return cy(e)!==null}function uy(e){let t=vy(e);return{explanation:by(t,`explanation`)??null,plan:yy(t,`plan`).map(e=>{let t=by(e,`step`),n=by(e,`status`);return!t||n!==`completed`&&n!==`inProgress`&&n!==`pending`?null:{step:t,status:n}}).filter(e=>!!e)}}function dy(e){let t=vy(e),n=by(t,`diff`)??``;return{diff:n,files:Cy(t,`files`).filter(Boolean),hasDiff:Sy(t,`hasDiff`)??!!n}}function fy(e){return yy(vy(e),`changes`).map(e=>{let t=by(e,`path`);return t?{path:t,kind:by(e,`kind`)??`update`,diff:by(e,`diff`)??``}:null}).filter(e=>!!e)}function py(e){return by(vy(e),`text`)??e.text}function my(e){let t=vy(e);return{summary:by(t,`message`)??by(t,`summary`)??e.text,details:by(t,`details`)??null}}function hy(e){let t=vy(e);return{capReached:t?.capReached===!0,command:by(t,`command`)??null,cwd:by(t,`cwd`)??null,durationMs:xy(t,`durationMs`)??null,exitCode:xy(t,`exitCode`)??null,stream:by(t,`stream`)??null,status:by(t,`status`)??null}}function gy(e){return{status:by(vy(e),`status`)??null}}function _y(e){let t=e.trimEnd();return t?t.split(/\r?\n/).length:0}function vy(e){return wy(e.eventData)?e.eventData:null}function yy(e,t){let n=e?.[t];return Array.isArray(n)?n.filter(wy):[]}function by(e,t){let n=e?.[t];return typeof n==`string`?n:void 0}function xy(e,t){let n=e?.[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function Sy(e,t){let n=e?.[t];return typeof n==`boolean`?n:void 0}function Cy(e,t){let n=e?.[t];return Array.isArray(n)?n.filter(e=>typeof e==`string`):[]}function wy(e){return!!(e&&typeof e==`object`&&!Array.isArray(e))}var Ty=[`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`],Ey=`phantom.chatScroll:v1:`,Dy=4,Oy={chat:`chat`,effort:`effort`,expandedProject:`expandedProject`,fileQuery:`fileQuery`,model:`model`,project:`project`,serviceTier:`serviceTier`},ky={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 Ay(e){return e.status!==`archived`&&e.status!==`running`&&e.status!==`waitingForApproval`&&!e.activeTurnId}var jy=6e3,My=3,Ny=10*1024*1024,Py=new Uint8Array([137,80,78,71,13,10,26,10]),Fy=`.png,image/png`,Iy=`\0`;function Ly(e,t){return e?t[e]?.[0]??null:null}function Ry(e,t){return`${e}:${t}`}function zy(e){return e instanceof Error?e.message:typeof e==`string`?e:`Something went wrong`}function By(e,t){let n=zy(t);return n?`${e}: ${n}`:e}function Vy(e,t){return e.get(t)?.trim()||null}function Hy(e,t){let n=e.getAll(t).flatMap(e=>e.split(`,`)).map(e=>e.trim()).filter(Boolean);return new Set(n)}function Uy(e,t){return`${e??``}\u0000${t??``}`}function Wy(e,t,n){n?e.set(t,n):e.delete(t)}function Gy(e,t,n){e.delete(t);let r=[...n].sort();r.length>0&&e.set(t,r.join(`,`))}function Ky(e,t){if(!t)return;let n=Hy(e,Oy.expandedProject);n.add(t),Gy(e,Oy.expandedProject,n)}function qy(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 Jy(e){return`${Ey}${e}`}function Yy(e){try{let t=window.localStorage.getItem(Jy(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 Xy(e,t){try{window.localStorage.setItem(Jy(e),JSON.stringify({version:1,pinnedToBottom:Zy(t),top:Math.max(0,Math.round(t.scrollTop))}))}catch{}}function Zy(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=Dy}function Qy(){let[e,t]=Wa(),n=(0,L.useRef)(e);n.current=e;let r=Vy(e,Oy.project),i=Vy(e,Oy.chat),a=Uy(r,i),o=(0,L.useRef)(a);o.current=a;let s=Vy(e,Oy.model),c=Vy(e,Oy.effort),l=Vy(e,Oy.serviceTier),u=e.get(Oy.fileQuery)??``,d=Xv(u)?u:``,f=(0,L.useMemo)(()=>Hy(e,Oy.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)([]),[we,Te]=(0,L.useState)(`Starting`),[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)(null),[Ke,qe]=(0,L.useState)([]),[Je,Ye]=(0,L.useState)(!1),[Xe,Ze]=(0,L.useState)(!0),[Qe,$e]=(0,L.useState)(()=>new Set),[z,et]=(0,L.useState)(()=>new Set),[tt,nt]=(0,L.useState)(!0),[rt,it]=(0,L.useState)(!1),[at,ot]=(0,L.useState)(!1),[st,ct]=(0,L.useState)(!1),[lt,ut]=(0,L.useState)(()=>new Set),[dt,ft]=(0,L.useState)(null),[pt,mt]=(0,L.useState)(null),[ht,gt]=(0,L.useState)(null),[_t,vt]=(0,L.useState)(!1),[yt,bt]=(0,L.useState)(null),[xt,St]=(0,L.useState)(!1),[Ct,wt]=(0,L.useState)(null),Tt=(0,L.useRef)(!1),Et=(0,L.useRef)(null),Dt=(0,L.useRef)(null),Ot=(0,L.useRef)(new Set),kt=(0,L.useRef)(!0),At=(0,L.useRef)(!1),jt=(0,L.useRef)(null),Mt=(0,L.useRef)(null),Nt=(0,L.useRef)(null),Pt=(0,L.useRef)(null),Ft=(0,L.useRef)(0),It=(0,L.useRef)(0),Lt=(0,L.useRef)(new Map),Rt=(0,L.useRef)(h),zt=(0,L.useRef)(_),Bt=(0,L.useRef)(y),Vt=(0,L.useRef)(0),Ht=(0,L.useRef)(0),Ut=(0,L.useRef)(null),Wt=(0,L.useRef)(null),Gt=(0,L.useRef)(ae),Kt=(0,L.useRef)(!1),qt=(0,L.useRef)(null),Jt=(0,L.useRef)(new Set),Yt=(0,L.useRef)(new Map),[Xt,Zt]=(0,L.useState)(null),Qt=(0,L.useRef)(Xt);Qt.current=Xt;let B=ze(),$t=He({mutationFn:Cs}),en=He({mutationFn:ws}),tn=He({mutationFn:({input:e,projectId:t})=>Ts(t,e)}),nn=He({mutationFn:({input:e,projectId:t})=>Ds(t,e)}),rn=He({mutationFn:({input:e,projectId:t})=>Os(t,e)}),an=He({mutationFn:({chatId:e,input:t})=>ks(e,t)}),on=He({mutationFn:({chatId:e,messageId:t})=>As(e,t)}),sn=He({mutationFn:({chatId:e,input:t})=>js(e,t)}),cn=He({mutationFn:({chatId:e,input:t})=>Ms(e,t)}),ln=He({mutationFn:({chatId:e,input:t})=>Ns(e,t)}),un=He({mutationFn:Ps}),dn=He({mutationFn:({chatId:e,decision:t,requestId:n})=>Fs(e,n,t)}),fn=He({mutationFn:({archived:e,chatId:t})=>Es(t,e)});function pn(e){let t=Lt.current.get(e);t!==void 0&&(window.clearTimeout(t),Lt.current.delete(e))}function mn(e){pn(e),qe(t=>t.filter(t=>t.id!==e))}function hn(e,t=`danger`){let n=It.current+1;It.current=n;let r=window.setTimeout(()=>mn(n),jy);Lt.current.set(n,r),qe(r=>{let i=[...r,{id:n,message:e,tone:t}].slice(-My),a=new Set(i.map(e=>e.id));for(let e of r)a.has(e.id)||pn(e.id);return i})}(0,L.useEffect)(()=>()=>{for(let e of Lt.current.values())window.clearTimeout(e);Lt.current.clear()},[]);function gn(e){Qt.current=e,Zt(e)}function _n(e){Zt(t=>{let n=t?.chatId===e?null:t;return Qt.current=n,n})}function vn(e,t){Zt(n=>{let r=n?.chatId===e&&n.requestId===t?null:n;return Qt.current=r,r})}function yn(e,r={}){let i=new URLSearchParams(n.current);e(i),n.current=i,t(i,{replace:r.replace??!1})}function bn(e,t={}){e.clearFileQuery&&fe(null),yn(t=>{`projectId`in e&&(Wy(t,Oy.project,e.projectId??null),Ky(t,e.projectId??null)),`chatId`in e&&Wy(t,Oy.chat,e.chatId??null),e.clearFileQuery&&t.delete(Oy.fileQuery)},t)}function xn(e,t,n={}){yn(n=>{Wy(n,e,t)},n)}function Sn(e){let t=e.trim()?e:null;if(!t){fe(null),xn(Oy.fileQuery,null,{replace:!0});return}if(!Xv(t)){fe({query:e,workspaceSelectionKey:a}),xn(Oy.fileQuery,null,{replace:!0});return}fe(null),xn(Oy.fileQuery,t,{replace:!0})}function Cn(){let e=n.current;return Uy(Vy(e,Oy.project),Vy(e,Oy.chat))}let wn=(0,L.useMemo)(()=>Zv(Object.values(h).flat(),i,r),[h,r,i]),Tn=!i||!!wn,En=!!wn,Dn=wn?.id??null,V=wn?.projectId??r;Pt.current=i,Nt.current=V,Rt.current=h,zt.current=_,Bt.current=y,me.current=pe;let On=(0,L.useMemo)(()=>p.find(e=>e.id===V)??null,[p,V]),kn=V&&!i?y[V]??null:null,An=!!(V&<.has(V)),jn=(0,L.useMemo)(()=>kn?.available?kn.targets.find(e=>e.number===dt)??null:null,[dt,kn]),Mn=!!(V&&h[V]!==void 0&&_[V]!==void 0),Nn=!!(V&&ny(_[V]??[],i)),Pn=!!wn?.activeTurnId,Fn=wn?.status===`archived`,In=wn?.status===`running`&&Pn,Ln=(0,L.useMemo)(()=>F.find(e=>e.id===s)??F.find(e=>e.isDefault)??F[0]??null,[F,s]),Rn=(0,L.useMemo)(()=>iy(Ln),[Ln]),zn=ay(Ln),Bn=l===`fast`&&zn,Vn=(0,L.useMemo)(()=>se.filter(e=>e.enabled&&le.has(e.path)),[le,se]),Hn=Se.length>0||be.length>0||Vn.length>0;Gt.current=ae,Kt.current=Hn;let Un=!!On&&!i&&!!(ae.trim()||Hn),Wn=En&&!Fn&&!!(ae.trim()||Hn)||Un,Gn=Pn?In?`steer`:`queue`:`send`,Kn=_t||Fn||!!(i&&Ct===i)||on.isPending||sn.isPending||!!(i&&Jt.current.has(i)),qn=Wn&&!Kn&&(Gn!==`steer`||In),Jn=En&&!Fn&&Wn&&!Kn,Yn=Pn&&!xt&&!!wn?.activeTurnId,Xn=!En||Kn,Zn=ob(Gn),Qn=yt===Gn?sb(yt):Zn,$n=(0,L.useMemo)(()=>F.map(e=>({value:e.id,label:e.displayName,description:e.description||e.model,keywords:[e.model]})),[F]),er=(0,L.useMemo)(()=>[{value:`auto`,label:`Auto`,description:Ln?.defaultReasoningEffort?`Default: ${Ln.defaultReasoningEffort}`:`Use model default`},...Rn.map(e=>({value:e,label:ab(e)}))],[Ln,Rn]),tr=(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]),nr=(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]),rr=(0,L.useMemo)(()=>j?p.find(e=>e.id===j)??null:null,[j,p]),ir=(0,L.useMemo)(()=>j?h[j]??[]:[],[h,j]),ar=(0,L.useMemo)(()=>ir.find(e=>e.status===`running`||e.status===`waitingForApproval`||!!e.activeTurnId||!!e.hasQueuedMessages||!!e.isDrainingQueuedMessages||Jt.current.has(e.id))??null,[ir]),or=(0,L.useMemo)(()=>M?p.find(e=>e.id===M.projectId)??null:null,[M,p]),sr=(0,L.useMemo)(()=>M?(_[M.projectId]??[]).find(e=>e.path===M.worktreePath)??null:null,[M,_]),cr=!!(M?.forceRequired||sr&&!sr.isClean),lr=(0,L.useMemo)(()=>{if(!V)return null;let e=_[V]??[];return wn?e.find(e=>e.path===wn.worktreePath)??null:null},[wn,V,_]),ur=(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,ty(t));e[t]=r}return e},[h]),dr=(0,L.useMemo)(()=>!V||!lr?[]:ur[V]?.get(lr.path)??[],[ur,V,lr]),fr=(0,L.useMemo)(()=>C.filter(e=>e.role!==`event`||ly(e)),[C]),pr=(0,L.useMemo)(()=>fr.filter(e=>Nb(e)),[fr]),mr=(0,L.useMemo)(()=>pr.map(e=>e.id).join(Iy),[pr]),hr=(0,L.useMemo)(()=>fr.filter(e=>!Nb(e)),[fr]),gr=Xe&&p.length===0,_r=!!i&&rt&&hr.length===0&&pr.length===0;(0,L.useEffect)(()=>{xr(),Sr(),B.fetchQuery(Is()).then(()=>Te(`Ready`)).catch(e=>Te(e.message))},[]),(0,L.useEffect)(()=>{u&&!Xv(u)&&xn(Oy.fileQuery,null,{replace:!0})},[u]),(0,L.useEffect)(()=>{V&&(wr(V,{updateSelection:Tn}),Tr(V,{updateSelection:Tn}))},[Tn,V]),(0,L.useEffect)(()=>{ft(null),!(!V||i)&&Er(V)},[V,i]),(0,L.useEffect)(()=>{dt===null||!kn?.available||kn.targets.some(e=>e.number===dt)||ft(null)},[dt,kn]),(0,L.useEffect)(()=>{if(Ft.current+=1,kt.current=!0,Mt.current=null,ke(null),je(null),Ge(null),jt.current!==null&&(cancelAnimationFrame(jt.current),jt.current=null),vt(!!(i&&Jt.current.has(i))),bt(i?Yt.current.get(i)??null:null),!Tn){w([]),E(null),gn(null),xe([]),Ce([]),ue(new Set),ye([]),ce([]),it(!1),ot(!1),ct(!1);return}if(!i){w([]),E(null),gn(null),xe([]),Ce([]),ue(new Set),ye([]),ce([]),it(!1),ot(!1),ct(!1);return}xe([]),Ce([]),ue(new Set),ye([]),ce([]),w([]),E(null),Ge(null),gn(null);let e=new AbortController;Ar(i,{showLoading:!0}),Or(i),Cr(i,e.signal);let t=new EventSource(bs(`/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,gn({...e,chatId:i}),B.invalidateQueries({queryKey:K.chatApproval(i)})}t.type===`agent.approval.resolved`&&(_e.current+=1,_n(i),B.invalidateQueries({queryKey:K.chatApproval(i)})),B.invalidateQueries({queryKey:K.messages(i)}),B.invalidateQueries({queryKey:K.chat(i)}),Ar(i),Or(i),V&&(B.invalidateQueries({queryKey:K.projectChats(V)}),Tr(V))};for(let e of Ty)t.addEventListener(e,n);return t.onopen=()=>{kr(i,e.signal)},t.onerror=()=>Te(`Event stream disconnected`),()=>{jr(i),e.abort();for(let e of Ty)t.removeEventListener(e,n);t.close()}},[Tn,i,V]),(0,L.useLayoutEffect)(()=>{if(!i||T!==i)return;let e=Et.current;if(e){if(Mt.current!==i){let t=Yy(i),n=!t||t.pinnedToBottom;At.current=!0,e.scrollTop=n?e.scrollHeight:t.top,Mt.current=i,kt.current=n||Zy(e);return}kt.current&&(At.current=!0,e.scrollTop=e.scrollHeight)}},[T,mr,i,hr]),(0,L.useLayoutEffect)(()=>{let e=new Set(mr?mr.split(Iy):[]),t=[...e].some(e=>!Ot.current.has(e));if(Ot.current=e,!t)return;let n=Dt.current;n&&(n.scrollTop=n.scrollHeight)},[mr]),(0,L.useEffect)(()=>()=>{jt.current!==null&&(cancelAnimationFrame(jt.current),jt.current=null);let e=Pt.current;e&&jr(e)},[]),(0,L.useEffect)(()=>{s&&F.length>0&&!F.some(e=>e.id===s)&&xn(Oy.model,null,{replace:!0})},[F,s]),(0,L.useEffect)(()=>{if(!c||c===`auto`){c===`auto`&&xn(Oy.effort,null,{replace:!0});return}F.length===0||!Ln||Rn.includes(c)||xn(Oy.effort,null,{replace:!0})},[F.length,c,Ln,Rn]),(0,L.useEffect)(()=>{l&&(l!==`fast`||Ln&&!zn)&&xn(Oy.serviceTier,null,{replace:!0})},[Ln,zn,l]),(0,L.useEffect)(()=>{let e=he.current+1;if(he.current=e,!Dn||!pe.trim()){ye([]),Ne(null),ct(!1);return}let t=new AbortController,n=pe.trim();Ne(null),ct(!0);let r=setTimeout(()=>{B.fetchQuery(Ks(Dn,n,t.signal)).then(n=>{t.signal.aborted||he.current!==e||(ye(n.files),Ne(null))}).catch(n=>{n.name!==`AbortError`&&!t.signal.aborted&&he.current===e&&Ne(By(`Could not search files`,n))}).finally(()=>{!t.signal.aborted&&he.current===e&&ct(!1)})},160);return()=>{clearTimeout(r),t.abort()}},[pe,Dn]),(0,L.useEffect)(()=>{!Tn||dr.length===0||dr.some(e=>e.id===i)||bn({chatId:dr[0]?.id??null,clearFileQuery:!!pe.trim()},{replace:!0})},[pe,Tn,i,dr]),(0,L.useEffect)(()=>{!i||Tn||Nn||!V||!Mn||bn({chatId:Ly(V,_)?.chatId??null,clearFileQuery:!!pe.trim()},{replace:!0})},[pe,Mn,Nn,Tn,i,V,_]);function vr(e,t){$e(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})}function yr(e,t){et(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})}function br(e,t){ut(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})}async function xr(){let e=o.current;Ze(!0);try{let t=await B.fetchQuery(Ls());m(t.projects),De(null);let n=new Set(t.projects.map(e=>e.id)),r=$v(Rt.current,n),i=$v(zt.current,n),a=Object.fromEntries(Object.entries(Bt.current).filter(([e])=>n.has(e)));if(Rt.current=r,zt.current=i,Bt.current=a,g(r),v(i),b(a),o.current!==e)return!0;let s=Pt.current,c=Nt.current,l=me.current,u=Qv(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;bn({projectId:d,chatId:p,clearFileQuery:!!l.trim()&&s!==p},{replace:!0});for(let e of t.projects)wr(e.id,{updateSelection:e.id===d}),Tr(e.id,{updateSelection:e.id===d});return!0}catch(e){return De(By(`Could not load projects`,e)),!1}finally{Ze(!1)}}async function Sr(){nt(!0);try{I((await B.fetchQuery(Rs())).models),Fe(null)}catch(e){Fe(By(`Could not load models`,e))}finally{nt(!1)}}async function Cr(e,t){ot(!0);try{let n=await B.fetchQuery(Gs(e,t));if(t?.aborted)return;ce(n.skills)}catch(e){if(t?.aborted||e instanceof Error&&e.name===`AbortError`)return;je(By(`Could not load skills`,e))}finally{t?.aborted||ot(!1)}}async function wr(e,t={}){let n=o.current;vr(e,!0);try{let r=ey((await B.fetchQuery(zs(e))).worktrees,Rt.current[e]??[]),i={...zt.current,[e]:r};if(zt.current=i,v(i),t.updateSelection===!1||Nt.current!==e||o.current!==n)return!0;let a=Ly(e,i),s=Pt.current,c=me.current,l=ry(Rt.current[e],r,s,a?.chatId??null);return bn({projectId:e,chatId:l,clearFileQuery:!!c.trim()&&s!==l},{replace:!0}),!0}catch(e){return De(By(`Could not load worktrees`,e)),!1}finally{vr(e,!1)}}async function Tr(e,t={}){let n=o.current;yr(e,!0);try{let r=await B.fetchQuery(Bs(e)),i={...Rt.current,[e]:r.chats};Rt.current=i,g(i);let a=ey(zt.current[e]??[],r.chats),s={...zt.current,[e]:a};if(zt.current=s,v(s),t.updateSelection===!1||Nt.current!==e||o.current!==n)return!0;let c=Ly(e,s),l=Pt.current,u=me.current,d=r.chats.some(e=>e.id===l)?l:l?c?.chatId??r.chats[0]?.id??null:null;return bn({projectId:e,chatId:d,clearFileQuery:!!u.trim()&&l!==d},{replace:!0}),!0}catch(e){return De(By(`Could not load chats`,e)),!1}finally{yr(e,!1)}}async function Er(e){br(e,!0);try{let t=await B.fetchQuery(Vs(e)),n={...Bt.current,[e]:t.github};Bt.current=n,b(n)}catch{let t={...Bt.current,[e]:{available:!1,targets:[]}};Bt.current=t,b(t)}finally{br(e,!1)}}function Dr(e){let t=Rt.current[e.projectId]??[],n=t.some(t=>t.id===e.id)?t.map(t=>t.id===e.id?e:t):[e,...t],r={...Rt.current,[e.projectId]:n};Rt.current=r,g(r);let i=zt.current[e.projectId]??[],a={...zt.current,[e.projectId]:ey(i,n)};zt.current=a,v(a)}async function Or(e){Dr((await B.fetchQuery(Hs(e))).chat)}async function kr(e,t){let n=ge.current+1;ge.current=n;let r=_e.current;try{let i=await B.fetchQuery(Us(e,t));Pt.current===e&&ge.current===n&&_e.current===r&&gn(i.approval?{...i.approval,chatId:e}:null)}catch(r){if(t?.aborted||r instanceof Error&&r.name===`AbortError`)return;Pt.current===e&&ge.current===n&&hn(By(`Could not load approval`,r))}}async function Ar(e,t={}){let n=Vt.current+1;Vt.current=n,t.showLoading&&it(!0);try{let t=await B.fetchQuery(Ws(e));Pt.current===e&&Vt.current===n&&(w(t.messages),E(e),ke(null))}catch(t){Pt.current===e&&Vt.current===n&&ke(By(`Could not load messages`,t))}finally{t.showLoading&&Pt.current===e&&it(!1)}}function jr(e){let t=Et.current;!t||Mt.current!==e||Xy(e,t)}function Mr(){let e=Pt.current,t=Et.current;if(!(!e||!t||Mt.current!==e)){if(kt.current=Zy(t),At.current){At.current=!1;return}jt.current===null&&(jt.current=requestAnimationFrame(()=>{jt.current=null,Pt.current===e&&Mt.current===e&&jr(e)}))}}function Nr(){Le(null),k(!0)}function Pr(){k(!1),Le(null)}async function Fr(e){e.preventDefault();let t=A.trim();if(!t)return;Le(null);let n=o.current;Ye(!0);try{let e=await $t.mutateAsync(t);if(B.invalidateQueries({queryKey:K.projects}),ee(``),Pr(),!await xr()||o.current!==n)return;bn({projectId:e.project.id,chatId:null})}catch(e){Le(By(`Could not add project`,e))}finally{Ye(!1)}}function Ir(e){Be(null),te(e.id)}function Lr(){te(null),Be(null)}async function Rr(e){if(e.preventDefault(),!rr||ar)return;Be(null),Ye(!0);let t=rr.id,n=(Rt.current[t]??[]).map(e=>e.id),r=Nt.current===t;try{await en.mutateAsync(t),B.removeQueries({exact:!0,queryKey:K.projects}),B.removeQueries({queryKey:K.projectWorktrees(t)}),B.removeQueries({queryKey:K.projectChats(t)});for(let e of n)B.removeQueries({queryKey:K.chat(e)});S(e=>{let n=new Set;for(let r of e)r.startsWith(`${t}:`)||n.add(r);return n}),r&&(oe(``),xe([]),Ce([]),ue(new Set),fe(null),ye([]),ce([]),gn(null),qt.current=null),Lr(),await xr()}catch(e){Be(By(`Could not delete project`,e))}finally{Ye(!1)}}async function zr(e,t,n={}){let r=await tn.mutateAsync({projectId:e,input:n});return B.invalidateQueries({queryKey:K.projectWorktrees(e)}),B.invalidateQueries({queryKey:K.projectChats(e)}),B.invalidateQueries({queryKey:K.projectGitHubCheckoutTargets(e)}),S(t=>new Set(t).add(Ry(e,r.chat.worktreePath))),!await wr(e,{updateSelection:!1})||!await Tr(e,{updateSelection:!1})?null:Cn()===t?(bn({projectId:e,chatId:r.chat.id,clearFileQuery:!0}),Nt.current=e,Pt.current=r.chat.id,r.chat):r.chat}async function Br(e,t){if(Je||Tt.current)return null;De(null);let n=o.current,r=t?Ry(e,t.path):null;Tt.current=!0,r?gt(r):mt(e),Ye(!0);try{return await zr(e,n,t?{worktreeName:t.name,worktreePath:t.path}:{})}catch(e){return hn(By(`Could not create worktree`,e)),null}finally{Tt.current=!1,mt(null),gt(null),Ye(!1)}}function Vr(e,t){Hr(e,t)}function Hr(e,t){Ue(null),P(`default`),ie(!1),ne({forceRequired:!t.isClean,projectId:e,worktreePath:t.path})}function Ur(){ne(null),Ue(null),P(`default`),ie(!1)}async function Wr(e,t,n){Ue(null),Ye(!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 nn.mutateAsync({projectId:e,input:r}),B.invalidateQueries({queryKey:K.projectWorktrees(e)}),B.invalidateQueries({queryKey:K.projectChats(e)}),Ur(),await wr(e,{updateSelection:Nt.current===e}),await Tr(e,{updateSelection:Nt.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?Ue(By(`Could not delete worktree`,i)):hn(By(`Could not delete worktree`,i))}finally{Ye(!1)}}async function Gr(e){e.preventDefault(),!(!M||!sr)&&await Wr(M.projectId,sr,{branchMode:N,force:re})}async function Kr(e,t){if(!Je){De(null),Ye(!0);try{await rn.mutateAsync({projectId:e,input:{name:t.name,path:t.path}}),B.invalidateQueries({queryKey:K.projectWorktrees(e)}),B.invalidateQueries({queryKey:K.projectChats(e)}),await wr(e,{updateSelection:Nt.current===e}),await Tr(e,{updateSelection:Nt.current===e})}catch(e){hn(By(`Could not sync branch`,e))}finally{Ye(!1)}}}async function qr(e,t){if(Je||fn.isPending||t&&!Ay(e))return;let n=Pt.current===e.id&&qt.current?.chatId===e.id&&!!(Gt.current.trim()||Kt.current),r=Pt.current===e.id&&!!(Gt.current.trim()||Kt.current);if(t&&(r||n)){je(`Clear or send the current message before archiving this chat`),Wt.current?.focus();return}je(null),Ye(!0),wt(e.id);try{Dr((await fn.mutateAsync({chatId:e.id,archived:t})).chat),B.invalidateQueries({queryKey:K.chat(e.id)}),B.invalidateQueries({queryKey:K.projectChats(e.projectId)}),B.invalidateQueries({queryKey:K.projectWorktrees(e.projectId)}),Pt.current===e.id&&t&&(qt.current=null,oe(``),xe([]),Ce([]),ue(new Set)),await Tr(e.projectId,{updateSelection:!1}),await wr(e.projectId,{updateSelection:!1})}catch(e){je(By(t?`Could not archive chat`:`Could not restore chat`,e))}finally{wt(null),Ye(!1)}}function Jr(){!V||!lr||Br(V,lr)}function Yr(){!V||!lr||!lr.isManagedByPhantom||Hr(V,lr)}async function Xr(e){e.preventDefault(),await ei(`send`)}function Zr(e,t,n=[]){let r=Ln?.id??Ln?.model??t?.model??void 0,i=Ln?c&&Rn.includes(c)?c:null:t?.effort??null,a=oy(Ln,l,t?.serviceTier??null);return{attachments:n,effort:i,files:be.map(e=>({name:e.relativePath,path:e.path})),model:r,serviceTier:a,skills:sy(se,le),text:e}}async function Qr(e,t){let n=[];for(let r of t){if(r.record){n.push(r.record);continue}if(!r.file)continue;let{attachment:t}=await Ss(e,r.file);n.push(t)}return n}async function $r(e,t,n,r,i,a){let o=null,s=()=>Cn()===i,c=()=>o!==null&&Cn()===Uy(e,o);Tt.current=!0,mt(e),Ye(!0);try{let l=await zr(e,i,{githubTargetNumber:a??void 0,initialMessage:t.text,serviceTier:t.serviceTier});if(!l){s()&&(oe(n),Ce(r));return}o=l.id;let u=await Qr(l.id,r),d={...t,attachments:u};Jt.current.add(l.id),Yt.current.set(l.id,`send`),Dr((await an.mutateAsync({chatId:l.id,input:d})).chat),B.invalidateQueries({queryKey:K.messages(l.id)}),B.invalidateQueries({queryKey:K.chat(l.id)}),c()&&(xe([]),Ce([]),ue(new Set),ft(null),Sn(``),await Ar(l.id))}catch(e){(o?c():s())&&(oe(n),Ce(r),je(By(`Could not send message`,e)))}finally{o&&(Jt.current.delete(o),Yt.current.delete(o)),Tt.current=!1,mt(null),Ye(!1)}}async function ei(e){let t=Dn;if(!t&&(!V||e!==`send`)||!Wn||Kn||!t&&V&&(Je||Tt.current)||e===`steer`&&!wn?.activeTurnId)return;je(null);let n=Ft.current,r=Ht.current+1;Ht.current=r;let i=()=>t!==null&&Pt.current===t&&Ft.current===n&&Ht.current===r,a=ae,s=Se,c=a.trim().length>0?a:cb({hasAttachments:Se.length>0,hasFiles:be.length>0,hasSkills:Vn.length>0});oe(``);let l=t&&qt.current?.chatId===t?qt.current:null;if(!t){if(!V)return;let e=Zr(c,l);vt(!0),bt(`send`),await $r(V,e,a,s,o.current,jn?.number??null),vt(!1),bt(null);return}Jt.current.add(t),Yt.current.set(t,e),vt(!0),bt(e);try{let n=Zr(c,l,await Qr(t,s));if(await(e===`steer`?cn:e===`queue`?ln:an).mutateAsync({chatId:t,input:n}),B.invalidateQueries({queryKey:K.messages(t)}),qt.current?.chatId===t&&(qt.current=null),!i())return;xe([]),Ce([]),ue(new Set),Sn(``),await Ar(t)}catch(e){if(!i())return;oe(a),je(By(`Could not send message`,e))}finally{Jt.current.delete(t),Yt.current.delete(t),(i()||Pt.current===t)&&(vt(!1),bt(Yt.current.get(t)??null))}}async function ti(e){if(!i||e.chatId!==i)return null;let t=i;try{let n=await on.mutateAsync({chatId:t,messageId:e.id});return B.invalidateQueries({queryKey:K.messages(t)}),await Ar(t),n}catch(e){return hn(By(`Could not delete pending message`,e)),null}}async function ni(e){if(ae.trim()||Hn){je(`Clear the current message before editing a pending message`),Wt.current?.focus();return}let t=await ti(e);if(t){if(!(Pt.current===t.message.chatId&&!Gt.current.trim()&&!Kt.current)){let e=t.message.chatId;try{await sn.mutateAsync({chatId:e,input:t}),B.invalidateQueries({queryKey:K.messages(e)}),Pt.current===e&&await Ar(e),hn(`Pending message was restored to the queue because the composer changed before editing completed`,`warning`)}catch(e){hn(`Pending message was deleted but could not be restored: ${zy(e)}`)}return}qt.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(Pb)),Ce((t.queuedMessage.attachments??[]).map(Fb)),ue(new Set((t.queuedMessage.skills??[]).map(e=>e.path))),xn(Oy.model,t.queuedMessage.model??null),xn(Oy.effort,t.queuedMessage.effort??null),xn(Oy.serviceTier,t.queuedMessage.serviceTier??null),requestAnimationFrame(()=>{Wt.current?.focus()})}}function ri(e){let t=Uv({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||!Dn&&!V||!Wn||_t)return;let n=Wv(t,wn);if(!(!n||!Dn&&n!==`send`)){if(e.preventDefault(),n===`send`){e.currentTarget.form?.requestSubmit();return}ei(n)}}async function ii(){if(i){St(!0);try{await un.mutateAsync(i),B.invalidateQueries({queryKey:K.chat(i)})}catch(e){hn(By(`Could not stop turn`,e))}finally{St(!1)}}}async function ai(e){if(!i||!Xt||Xt.chatId!==i)return;let t=Xt.chatId,n=Xt,r=()=>Pt.current===t&&Qt.current?.requestId===n.requestId;Ge(null);try{if(e!==`accept`&&e!==`acceptForSession`&&e!==`decline`&&e!==`cancel`)throw Error(`Approval decision is invalid`);await dn.mutateAsync({chatId:t,decision:e,requestId:n.requestId}),_e.current+=1,B.invalidateQueries({queryKey:K.chatApproval(t)}),B.invalidateQueries({queryKey:K.chat(t)}),vn(t,n.requestId)}catch(e){r()&&Ge(By(`Could not answer approval`,e))}}function oi(e){yn(t=>{let n=Hy(t,Oy.expandedProject);n.has(e)?n.delete(e):n.add(e),Gy(t,Oy.expandedProject,n)})}function si(e){qt.current=null,oe(``),xe([]),Ce([]),ue(new Set),ye([]),ce([]),bn({projectId:e,chatId:null,clearFileQuery:!0})}function ci(e,t){let n=Ry(e,t);S(e=>{let t=new Set(e);return t.has(n)?t.delete(n):t.add(n),t})}function li(e,t){if(!t.chatId){Br(e,t);return}bn({projectId:e,chatId:t.chatId,clearFileQuery:!0})}function ui(e,t,n){bn({projectId:e,chatId:n,clearFileQuery:!0}),S(n=>new Set(n).add(Ry(e,t.path)))}function di(e){let t=ve.find(t=>t.path===e);t&&(xe(e=>e.some(e=>e.path===t.path)?e:[...e,t]),Sn(``))}async function fi(e){if(!e||e.length===0)return;let t=[],n=[];for(let r of Array.from(e)){if(r.size<=0||r.size>Ny){n.push(r.name);continue}if(!await Ib(r)){n.push(r.name);continue}t.push({file:r,id:`${r.name}:${r.size}:${r.lastModified}:${crypto.randomUUID()}`,mimeType:`image/png`,name:r.name,size:r.size})}t.length>0&&(Ce(e=>[...e,...t.filter(t=>!e.some(e=>e.name===t.name&&e.size===t.size))]),je(null)),n.length>0&&je(`Only PNG images up to ${Lb(Ny)} can be attached: ${n.join(`, `)}`)}function pi(e){ue(t=>new Set(t).add(e))}let mi=Xt?.chatId===i?Xt:null,hi=e=>(0,R.jsxs)(Ev,{className:e,collapsible:`offcanvas`,variant:`inset`,children:[(0,R.jsxs)(Dv,{children:[(0,R.jsx)(kv,{"aria-label":`Close sidebar`,className:`text-[var(--icon-color-default)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,title:`Close sidebar`}),(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)(nc,{className:`max-w-28 truncate group-data-[state=collapsed]/sidebar:hidden`,variant:we===`Ready`?`success`:`warning`,children:[we!==`Ready`&&(0,R.jsx)(Yo,{className:`size-3`}),we]})]}),(0,R.jsx)(Av,{children:(0,R.jsxs)(jv,{children:[(0,R.jsxs)(Mv,{children:[(0,R.jsx)(Nv,{children:`Projects`}),(0,R.jsx)(Pv,{"aria-label":`Add project`,onClick:Nr,title:`Add project`,children:(0,R.jsx)(Ro,{className:`size-4`})})]}),(0,R.jsxs)(Fv,{children:[Ee&&(0,R.jsx)(ub,{className:`mx-2 mb-2 group-data-[state=collapsed]/sidebar:hidden`,message:Ee,onDismiss:()=>De(null)}),(0,R.jsx)(Iv,{children:gr?(0,R.jsx)(`li`,{className:`px-2 py-1 group-data-[state=collapsed]/sidebar:hidden`,children:(0,R.jsx)($o,{})}):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=Qe.has(e.id)&&_[e.id]===void 0;return(0,R.jsxs)(Lv,{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:()=>oi(e.id),title:t?`Collapse`:`Expand`,type:`button`,children:(0,R.jsx)(_o,{className:G(`size-4 transition-transform duration-[var(--motion-duration-fast)]`,t&&`rotate-90`)})}),(0,R.jsxs)(Rv,{className:`min-h-8 flex-1 group-data-[state=collapsed]/sidebar:flex-none`,isActive:V===e.id&&!wn,onClick:()=>si(e.id),title:e.name,type:`button`,children:[(0,R.jsx)(Eo,{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)(ac,{"aria-label":`Create worktree in ${e.name}`,className:`size-7 text-[var(--icon-color-default)] group-data-[state=collapsed]/sidebar:hidden`,disabled:Je,onClick:()=>void Br(e.id),size:`icon`,title:`Create worktree`,type:`button`,variant:`ghost`,children:pt===e.id?(0,R.jsx)(Yo,{className:`size-4`}):(0,R.jsx)(No,{className:`size-4`})}),(0,R.jsxs)(bg,{children:[(0,R.jsx)(xg,{asChild:!0,children:(0,R.jsx)(ac,{"aria-label":`Open actions for ${e.name}`,className:G(`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`,V===e.id&&`sm:opacity-100`),disabled:Je,size:`icon`,title:`Project actions`,type:`button`,variant:`ghost`,children:(0,R.jsx)(Co,{className:`size-4`})})}),(0,R.jsx)(Sg,{align:`end`,children:(0,R.jsxs)(Cg,{disabled:Je,onSelect:()=>Ir(e),variant:`destructive`,children:[(0,R.jsx)(Go,{className:`size-4`}),(0,R.jsx)(`span`,{children:`Delete project`})]})})]})]}),t&&(0,R.jsx)(zv,{children:r?(0,R.jsx)(`li`,{className:`px-2 py-1.5`,children:(0,R.jsx)(es,{})}):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=V===e.id&&lr?.path===t.path,r=ur[e.id]?.get(t.path)??[],a=r.find(e=>e.status===`running`||e.status===`waitingForApproval`||!!e.activeTurnId)??null,o=_t&&wn?.projectId===e.id&&wn.worktreePath===t.path,s=o?`Sending message`:a?ky[a.status].label:null,c=Ry(e.id,t.path),l=ht===c,u=x.has(c),d=z.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)(Bv,{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:()=>ci(e.id,t.path),title:u?`Collapse chats`:`Expand chats`,type:`button`,children:(0,R.jsx)(_o,{className:G(`size-3.5 transition-transform duration-[var(--motion-duration-fast)]`,u&&`rotate-90`)})}),(0,R.jsxs)(Vv,{className:`flex-1`,disabled:!t.chatId&&Je,isActive:n,onClick:()=>li(e.id,t),title:f,type:`button`,children:[t.isMainWorktree?(0,R.jsx)(Eo,{className:`size-3.5 text-[var(--icon-color-default)]`}):(0,R.jsx)(Do,{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)(tb,{label:s,status:o?`running`:a?.status??`running`})]}),(0,R.jsx)(ac,{"aria-label":`Start new chat in ${t.name}`,className:G(`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:Je,onClick:()=>void Br(e.id,t),size:`icon`,title:`New chat`,type:`button`,variant:`ghost`,children:l?(0,R.jsx)(Yo,{className:`size-4`}):(0,R.jsx)(No,{className:`size-4`})}),m&&(0,R.jsxs)(bg,{children:[(0,R.jsx)(xg,{asChild:!0,children:(0,R.jsx)(ac,{"aria-label":`Open actions for ${t.name}`,className:G(`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:Je,size:`icon`,title:`Worktree actions`,type:`button`,variant:`ghost`,children:(0,R.jsx)(Co,{className:`size-4`})})}),(0,R.jsxs)(Sg,{align:`end`,children:[(0,R.jsxs)(Cg,{disabled:Je,onSelect:()=>void Kr(e.id,t),children:[(0,R.jsx)(zo,{className:`size-4`}),(0,R.jsx)(`span`,{children:`Sync branch`})]}),p&&(0,R.jsxs)(Cg,{disabled:Je,onSelect:()=>void Vr(e.id,t),variant:`destructive`,children:[(0,R.jsx)(Go,{className:`size-4`}),(0,R.jsx)(`span`,{children:`Delete worktree`})]})]})]})]}),u&&(0,R.jsx)(eb,{chats:r,isLoading:d,selectedChatId:i,onSelectChat:n=>ui(e.id,t,n),onSetChatArchived:(e,t)=>void qr(e,t)})]},t.path)})})]},e.id)})})]})]})})]});return(0,R.jsxs)(Tv,{className:`app-shell`,children:[(0,R.jsx)(`div`,{className:`contents md:hidden`,children:hi()}),(0,R.jsxs)(yv,{className:`min-h-0 flex-1`,orientation:`horizontal`,children:[(0,R.jsx)(bv,{className:`flex min-h-0`,defaultSize:`320px`,id:`workspace-sidebar-panel`,maxSize:`520px`,minSize:`240px`,style:{overflow:`hidden`},children:hi(`md:w-full`)}),(0,R.jsx)(xv,{"aria-label":`Resize sidebar`,id:`workspace-sidebar-resize-handle`}),(0,R.jsxs)(bv,{className:`flex min-h-0 min-w-0`,minSize:`320px`,style:{overflow:`hidden`},children:[(0,R.jsx)(_c,{open:O,onOpenChange:e=>{e?Nr():Pr()},children:(0,R.jsxs)(vc,{"aria-labelledby":`add-project-title`,children:[(0,R.jsxs)(yc,{children:[(0,R.jsx)(bc,{id:`add-project-title`,children:`Add project`}),(0,R.jsx)(xc,{children:`Add a local Git project to the Phantom sidebar.`})]}),(0,R.jsxs)(`form`,{className:`grid gap-4`,onSubmit:Fr,children:[(0,R.jsxs)(`div`,{className:`grid gap-2`,children:[(0,R.jsx)(wg,{htmlFor:`project-path`,children:`Project path`}),(0,R.jsx)(sc,{id:`project-path`,placeholder:`/Users/me/project`,value:A,onChange:e=>ee(e.target.value)})]}),Ie&&(0,R.jsx)(ub,{message:Ie,onDismiss:()=>Le(null)}),(0,R.jsxs)(Sc,{children:[(0,R.jsx)(ac,{onClick:Pr,type:`button`,variant:`outline`,children:`Cancel`}),(0,R.jsxs)(ac,{disabled:Je||!A.trim(),type:`submit`,children:[Je&&(0,R.jsx)(Yo,{}),`Add project`]})]})]})]})}),(0,R.jsx)(_c,{open:!!j,onOpenChange:e=>{e||Lr()},children:(0,R.jsxs)(vc,{"aria-labelledby":`delete-project-title`,children:[(0,R.jsxs)(yc,{children:[(0,R.jsx)(bc,{id:`delete-project-title`,children:`Delete project`}),(0,R.jsx)(xc,{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:Rr,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:rr?.name??`Unknown project`}),rr&&(0,R.jsx)(`p`,{className:`truncate font-mono text-[length:var(--font-size-xs)] text-muted-foreground`,children:rr.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.`}),ar&&(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.`}),Re&&(0,R.jsx)(ub,{message:Re,onDismiss:()=>Be(null)}),(0,R.jsxs)(Sc,{children:[(0,R.jsx)(ac,{onClick:Lr,type:`button`,variant:`outline`,children:`Cancel`}),(0,R.jsxs)(ac,{disabled:Je||!rr||!!ar,type:`submit`,variant:`destructive`,children:[Je&&(0,R.jsx)(Yo,{}),`Delete project`]})]})]})]})}),(0,R.jsx)(_c,{open:!!M,onOpenChange:e=>{e||Ur()},children:(0,R.jsxs)(vc,{"aria-labelledby":`delete-worktree-title`,children:[(0,R.jsxs)(yc,{children:[(0,R.jsx)(bc,{id:`delete-worktree-title`,children:`Delete worktree`}),(0,R.jsxs)(xc,{children:[cr?`This worktree has uncommitted changes. Force deletion is required to remove it from `:`This will remove the worktree and its chat history from `,or?.name??`the project`,`.`]})]}),(0,R.jsxs)(`form`,{className:`grid gap-4`,onSubmit:Gr,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:sr?.name??`Unknown worktree`}),sr&&(0,R.jsx)(`p`,{className:`truncate font-mono text-[length:var(--font-size-xs)] text-muted-foreground`,children:sr.path})]}),(0,R.jsxs)(`div`,{className:`grid gap-2`,children:[(0,R.jsx)(wg,{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`})]})]}),cr&&(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`})]}),Ve&&(0,R.jsx)(ub,{message:Ve,onDismiss:()=>Ue(null)}),(0,R.jsxs)(Sc,{children:[(0,R.jsx)(ac,{onClick:Ur,type:`button`,variant:`outline`,children:`Cancel`}),(0,R.jsxs)(ac,{disabled:Je||!sr||cr&&!re,type:`submit`,variant:`destructive`,children:[Je&&(0,R.jsx)(Yo,{}),`Delete`]})]})]})]})}),(0,R.jsx)(db,{toasts:Ke,onDismiss:mn}),(0,R.jsxs)(Ov,{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)($y,{}),(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:wn?lr?.name??wn.worktreeName:On?`New chat`:`Workspace`}),wn&&(0,R.jsx)(nb,{status:wn.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:[On?.name??`No project selected`,lr?` / `:``]}),lr&&(0,R.jsx)(rb,{text:lr.path})]})]}),wn&&(0,R.jsx)(ac,{"aria-label":wn.status===`archived`?`Restore chat`:`Archive chat`,className:`size-8 text-[var(--icon-color-default)]`,disabled:Je||fn.isPending||wn.status!==`archived`&&!Ay(wn),onClick:()=>void qr(wn,wn.status!==`archived`),size:`icon`,title:wn.status===`archived`?`Restore chat`:`Archive chat`,type:`button`,variant:`ghost`,children:fn.isPending?(0,R.jsx)(Yo,{}):wn.status===`archived`?(0,R.jsx)(fo,{}):(0,R.jsx)(po,{})}),lr&&(0,R.jsxs)(bg,{children:[(0,R.jsx)(xg,{asChild:!0,children:(0,R.jsx)(ac,{"aria-label":`Open worktree actions for ${lr.name}`,className:`size-8 shrink-0 text-[var(--icon-color-default)]`,disabled:Je,size:`icon`,title:`Worktree actions`,type:`button`,variant:`ghost`,children:(0,R.jsx)(Co,{className:`size-4`})})}),(0,R.jsxs)(Sg,{align:`end`,children:[(0,R.jsxs)(Cg,{disabled:Je,onSelect:Jr,children:[(0,R.jsx)(No,{className:`size-4`}),(0,R.jsx)(`span`,{children:`New chat`})]}),lr.isManagedByPhantom&&(0,R.jsxs)(Cg,{disabled:Je,onSelect:Yr,variant:`destructive`,children:[(0,R.jsx)(Go,{className:`size-4`}),(0,R.jsx)(`span`,{children:`Delete worktree`})]})]})]})]}),mi&&(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)(So,{className:`size-4`}),`Approval requested`]}),(0,R.jsx)(`p`,{className:`mt-1 truncate font-mono text-[length:var(--font-size-xs)]`,children:mi.method}),We&&(0,R.jsx)(ub,{className:`mt-2`,message:We,onDismiss:()=>Ge(null)})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[(0,R.jsx)(ac,{onClick:()=>void ai(`accept`),size:`sm`,type:`button`,children:`Accept`}),(0,R.jsx)(ac,{onClick:()=>void ai(`acceptForSession`),size:`sm`,type:`button`,variant:`outline`,children:`Accept for session`}),(0,R.jsx)(ac,{onClick:()=>void ai(`decline`),size:`sm`,type:`button`,variant:`outline`,children:`Decline`})]})]})}),(0,R.jsxs)(`section`,{"aria-busy":rt||_t||Pn||!!pt,className:`min-h-0 flex-1 overflow-y-auto px-4 py-4`,ref:Et,onScroll:Mr,children:[Oe&&(0,R.jsx)(`div`,{className:`mx-auto mb-3 max-w-[var(--layout-max-content-width)]`,children:(0,R.jsx)(ub,{message:Oe,onDismiss:()=>ke(null)})}),_r?(0,R.jsx)(ts,{}):hr.length===0?pr.length===0?(0,R.jsx)(fb,{githubTargets:kn,hasChat:!!wn,hasWorktree:!!lr,isGitHubTargetsLoading:An,selectedProject:On,selectedGitHubTargetNumber:dt,onOpenProjectDialog:Nr,onSelectGitHubTarget:ft}):null:(0,R.jsx)(`div`,{className:`mx-auto flex max-w-[var(--layout-max-content-width)] flex-col gap-2`,children:hr.map(e=>(0,R.jsx)(_b,{isPendingActionBusy:on.isPending,message:e,onDeletePendingMessage:e=>void ti(e),onEditPendingMessage:e=>void ni(e)},e.id))})]}),(0,R.jsxs)(`form`,{className:`chat-composer border-t border-border bg-[var(--surface-floating)] backdrop-blur`,onSubmit:Xr,children:[pr.length>0&&(0,R.jsx)(hb,{isPendingActionBusy:on.isPending,messages:pr,scrollContainerRef:Dt,onDeletePendingMessage:e=>void ti(e),onEditPendingMessage:e=>void ni(e)}),(0,R.jsxs)(`div`,{className:`mx-auto flex max-w-[var(--layout-max-content-width)] flex-col gap-2`,children:[Ae&&(0,R.jsx)(ub,{message:Ae,onDismiss:()=>je(null)}),Me&&(0,R.jsx)(ub,{message:Me,onDismiss:()=>Ne(null)}),Pe&&(0,R.jsx)(ub,{message:Pe,onDismiss:()=>Fe(null)}),(Se.length>0||be.length>0||Vn.length>0)&&(0,R.jsxs)(`div`,{className:`flex min-h-8 flex-wrap items-center gap-2 px-1`,children:[Se.map(e=>(0,R.jsx)(ib,{icon:(0,R.jsx)(Io,{className:`size-3.5`}),label:`${e.name} (${Lb(e.size)})`,onRemove:()=>Ce(t=>t.filter(t=>t.id!==e.id))},e.id)),be.map(e=>(0,R.jsx)(ib,{icon:(0,R.jsx)(To,{className:`size-3.5`}),label:e.relativePath,onRemove:()=>xe(t=>t.filter(t=>t.path!==e.path))},e.path)),Vn.map(e=>(0,R.jsx)(ib,{icon:(0,R.jsx)(Ho,{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)(wg,{className:`sr-only`,htmlFor:`composer`,children:`Message`}),(0,R.jsx)(Hv,{className:`min-h-12 border-0 bg-transparent px-2 py-2 shadow-none focus-visible:shadow-none`,disabled:!On||Kn,enterKeyHint:`enter`,id:`composer`,placeholder:Fn?`Restore this chat to continue`:En?`Ask Codex to work in this worktree`:On?`Ask Codex to create a worktree and start`:`Select a project to start`,rows:2,ref:Wt,value:ae,onChange:e=>{oe(e.target.value),Ae&&je(null)},onKeyDown:ri})]}),(0,R.jsxs)(`div`,{className:`flex shrink-0 items-end gap-1.5`,children:[(0,R.jsx)(`input`,{accept:Fy,className:`sr-only`,multiple:!0,ref:Ut,type:`file`,onChange:e=>{fi(e.target.files),e.target.value=``}}),(0,R.jsx)(ac,{"aria-label":`Attach image`,className:`size-10`,disabled:!On||Kn,onClick:()=>Ut.current?.click(),size:`icon`,title:`Attach image`,type:`button`,variant:`outline`,children:(0,R.jsx)(Io,{})}),En&&Gn!==`queue`&&(0,R.jsx)(ac,{"aria-label":yt===`queue`?`Queueing message`:`Queue message`,className:`size-10`,disabled:!Jn,onClick:()=>void ei(`queue`),size:`icon`,title:`Queue message`,type:`button`,variant:`outline`,children:yt===`queue`?(0,R.jsx)(Yo,{}):(0,R.jsx)(So,{})}),(0,R.jsx)(ac,{"aria-label":Qn,className:`size-10`,disabled:!qn,onClick:Pn?()=>void ei(Gn):void 0,size:`icon`,title:Zn,type:Pn?`button`:`submit`,children:yt===Gn?(0,R.jsx)(Yo,{}):Gn===`queue`?(0,R.jsx)(So,{}):(0,R.jsx)(Vo,{})}),Pn&&(0,R.jsx)(ac,{"aria-label":xt?`Stopping turn`:`Stop turn`,className:`size-10`,disabled:!Yn,onClick:ii,size:`icon`,title:`Stop turn`,type:`button`,variant:`destructive`,children:xt?(0,R.jsx)(Yo,{}):(0,R.jsx)(Uo,{})})]})]}),(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)(fc,{"aria-label":`Select model`,className:`w-36 max-w-full sm:w-40`,disabled:tt||F.length===0||Kn,emptyMessage:tt?`Loading models`:`No models`,icon:(0,R.jsx)(mo,{className:`size-3.5`}),isLoading:tt,options:$n,placeholder:tt?`Loading`:`Model`,searchPlaceholder:`Search models`,side:`top`,triggerClassName:`w-full justify-between`,value:Ln?.id??null,onValueChange:e=>xn(Oy.model,e)}),(0,R.jsx)(fc,{"aria-label":`Select reasoning effort`,className:`w-28 max-w-full`,disabled:!Ln||Kn,icon:(0,R.jsx)(ho,{className:`size-3.5`}),options:er,placeholder:`Effort`,searchPlaceholder:`Search effort`,side:`top`,triggerClassName:`w-full justify-between`,value:c??`auto`,onValueChange:e=>xn(Oy.effort,e===`auto`?null:e)}),(0,R.jsxs)(ac,{"aria-label":Bn?`Disable fast mode`:`Enable fast mode`,"aria-pressed":Bn,className:`h-9 px-3`,disabled:!Ln||!zn||Kn,onClick:()=>xn(Oy.serviceTier,Bn?null:`fast`),title:zn?Bn?`Disable fast mode`:`Enable fast mode`:`Fast mode unavailable for selected model`,type:`button`,variant:Bn?`secondary`:`outline`,children:[(0,R.jsx)(Jo,{className:`size-3.5`}),`Fast`]}),(0,R.jsx)(fc,{"aria-label":`Attach file`,className:`w-32 max-w-full`,disabled:Xn,emptyMessage:st?`Searching files`:pe.trim()?`No files`:`Type to search`,icon:(0,R.jsx)(To,{className:`size-3.5`}),isLoading:st,options:nr,placeholder:`Files`,query:pe,searchPlaceholder:`Search files`,shouldFilter:!1,side:`top`,triggerClassName:`w-full justify-between`,value:null,onQueryChange:Sn,onValueChange:di}),(0,R.jsx)(fc,{"aria-label":`Select skill`,align:`end`,className:`w-32 max-w-full`,disabled:Xn||at,emptyMessage:at?`Loading skills`:`No skills`,icon:(0,R.jsx)(Ho,{className:`size-3.5`}),isLoading:at,options:tr,placeholder:at?`Loading`:`Skills`,searchPlaceholder:`Search skills`,side:`top`,triggerClassName:`w-full justify-between`,value:null,onValueChange:pi})]})]})]})]})]})]})]})}function $y(){let{open:e}=wv();return e?null:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(kv,{"aria-label":`Open sidebar`,className:`-ml-1`,title:`Open sidebar`}),(0,R.jsx)(`div`,{className:`h-5 w-px bg-[var(--border-divider)]`})]})}function eb({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)(Zo,{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:G(`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:G(`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)(Po,{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:G(`size-1.5 shrink-0 rounded-full`,ky[e.status].dot)}),(0,R.jsxs)(`span`,{className:`sr-only`,children:[`Status: `,ky[e.status].label]})]}),(0,R.jsxs)(bg,{children:[(0,R.jsx)(xg,{asChild:!0,children:(0,R.jsx)(ac,{"aria-label":`Open actions for ${e.title}`,className:G(`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)(Co,{className:`size-3.5`})})}),(0,R.jsx)(Sg,{align:`end`,children:(0,R.jsxs)(Cg,{disabled:!Ay(e),onSelect:()=>n(e,!0),children:[(0,R.jsx)(po,{className:`size-4`}),(0,R.jsx)(`span`,{children:`Archive chat`})]})})]})]})},e.id)})})}function tb({label:e,status:t}){let n=ky[t],r=t===`running`;return(0,R.jsx)(`span`,{"aria-label":e,className:G(`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)(Yo,{className:`size-3`}):(0,R.jsx)(`span`,{className:G(`size-1.5 rounded-full`,n.dot)})})}function nb({status:e}){let t=ky[e];return(0,R.jsxs)(nc,{variant:t.badge,children:[(0,R.jsx)(`span`,{className:G(`size-1.5 rounded-full`,t.dot)}),t.label]})}function rb({text:e}){return(0,R.jsx)(`span`,{className:`block min-w-0 truncate`,title:e,children:qy(e)})}function ib({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)(qo,{className:`size-3.5`})})]})}function ab(e){return e.split(/[-_\s]+/).filter(Boolean).map(e=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`).join(` `)}function ob(e){switch(e){case`queue`:return`Queue message`;case`steer`:return`Steer turn`;case`send`:return`Send message`}}function sb(e){switch(e){case`queue`:return`Queueing message`;case`steer`:return`Steering turn`;case`send`:return`Sending message`}}function cb({hasAttachments:e,hasFiles:t,hasSkills:n}){return e&&t&&n?`Use the attached images, selected files, and selected skills as context.`:e&&t?`Use the attached images and selected files as context.`:e&&n?`Use the attached images and selected skills as context.`:t&&n?`Use the selected files and skills as context.`:e?`Use the attached images as context.`:t?`Use the selected files as context.`:`Use the selected skills as context.`}function lb(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 ub({className:e,message:t,onDismiss:n,tone:r=`danger`}){return(0,R.jsxs)(`div`,{className:G(`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)]`,lb(r),e),role:r===`danger`?`alert`:`status`,children:[(0,R.jsx)(Ko,{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)(qo,{className:`size-3.5`})})]})}function db({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)(ub,{className:`pointer-events-auto shadow-[var(--shadow-md)]`,message:t.message,tone:t.tone,onDismiss:()=>e(t.id)},t.id))})}function fb({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)(Ao,{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)(ac,{onClick:i,type:`button`,children:[(0,R.jsx)(Ro,{className:`size-4`}),`Add project`]})}),c&&e&&(0,R.jsx)(pb,{isLoading:r,selectedNumber:o,targets:e.targets,onSelectTarget:a})]})})}function pb({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)(Zo,{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)(mb,{isSelected:n===e.number,target:e,onSelectTarget:t},`${e.kind}-${e.number}`))})]})}function mb({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:G(`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)(Oo,{className:`size-3.5 shrink-0 text-[var(--semantic-info-fg)]`}):(0,R.jsx)(bo,{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 hb({isPendingActionBusy:e,messages:t,onDeletePendingMessage:n,onEditPendingMessage:r,scrollContainerRef:i}){return(0,R.jsx)(`div`,{"aria-live":`polite`,className:`mb-2 border-b border-[var(--border-divider)]`,children:(0,R.jsxs)(`div`,{className:`mx-auto flex max-h-56 max-w-[var(--layout-max-content-width)] flex-col gap-2 overflow-y-auto px-0 py-2`,ref:i,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-1 text-[length:var(--font-size-xs)] font-medium uppercase text-[var(--text-tertiary)]`,children:[(0,R.jsx)(`span`,{children:`Pending messages`}),(0,R.jsx)(`span`,{children:t.length})]}),(0,R.jsx)(`div`,{className:`flex flex-col gap-2`,children:t.map(t=>{let i=Nb(t);return i?(0,R.jsx)(gb,{isPendingActionBusy:e,message:t,state:i,onDeletePendingMessage:n,onEditPendingMessage:r},t.id):null})})]})})}function gb({isPendingActionBusy:e,message:t,onDeletePendingMessage:n,onEditPendingMessage:r,state:i}){let a=i===`queued`,o=t.attachments??[];return(0,R.jsxs)(`article`,{className:G(`rounded-[var(--radius-sm)] border px-3 py-2 shadow-[var(--shadow-xs)]`,a?`border-[var(--semantic-warning-border)] bg-[var(--semantic-warning-bg)] text-[var(--semantic-warning-fg)]`:`border-[var(--semantic-info-border)] bg-[var(--semantic-info-bg)] text-[var(--semantic-info-fg)]`),children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 sm:flex-row sm:items-start sm:gap-3`,children:[(0,R.jsx)(`pre`,{className:`min-w-0 flex-1 whitespace-pre-wrap break-words font-sans text-[length:var(--font-size-sm)] leading-[var(--line-height-relaxed)]`,children:t.text}),(0,R.jsx)(Mb,{className:`mt-0 shrink-0 self-end`,isActionBusy:e,message:t,state:i,onDelete:n,onEdit:r})]}),o.length>0&&(0,R.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:o.map(e=>(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`,title:`${e.name} (${Lb(e.size)})`,children:[(0,R.jsx)(Io,{className:`size-3.5 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate`,children:e.name})]},`${e.path}:${e.name}`))})]})}function _b({isPendingActionBusy:e,message:t,onDeletePendingMessage:n,onEditPendingMessage:r}){if(t.role===`event`)return(0,R.jsx)(vb,{message:t});let i=t.role===`user`,a=t.role===`error`,o=Nb(t),s=t.attachments??[];return(0,R.jsxs)(`article`,{className:G(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}),s.length>0&&(0,R.jsx)(`div`,{className:G(`mt-2 flex flex-wrap gap-1.5`,i?`justify-end`:`justify-start`),children:s.map(e=>(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`,title:`${e.name} (${Lb(e.size)})`,children:[(0,R.jsx)(Io,{className:`size-3.5 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate`,children:e.name})]},`${e.path}:${e.name}`))}),o&&(0,R.jsx)(Mb,{isActionBusy:e,message:t,state:o,onDelete:n,onEdit:r})]})}function vb({message:e}){let t=cy(e);return t===`plan`?(0,R.jsx)(yb,{message:e}):t===`diff`?(0,R.jsx)(bb,{message:e}):t===`command`?(0,R.jsx)(xb,{message:e}):t===`file`?(0,R.jsx)(Sb,{message:e}):t===`reasoning`?(0,R.jsx)(Ob,{message:e}):t===`warning`?(0,R.jsx)(kb,{message:e}):null}function yb({message:e}){let{explanation:t,plan:n}=uy(e),r=py(e);return(0,R.jsxs)(Ab,{icon:(0,R.jsx)(jo,{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`?yo:e.status===`inProgress`?So:xo,{className:G(`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 bb({message:e}){let{files:t,hasDiff:n}=dy(e);return(0,R.jsx)(Ab,{defaultOpen:!1,icon:(0,R.jsx)(wo,{className:`size-4`}),meta:Eb([Tb(t.length,`file`),n?`diff hidden`:`cleared`]),summary:t.length>0?(0,R.jsx)(Db,{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)(jb,{label:n?`Unified diff hidden`:`No diff`})})}function xb({message:e}){let t=hy(e);return(0,R.jsxs)(Ab,{defaultOpen:!1,icon:(0,R.jsx)(Wo,{className:`size-4`}),meta:Eb([t.status,t.exitCode===null?null:`exit ${t.exitCode}`,t.durationMs===null?null:wb(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)(nc,{variant:Cb(t.status),children:t.status}),t.exitCode!==null&&(0,R.jsxs)(nc,{variant:t.exitCode===0?`success`:`danger`,children:[`exit `,t.exitCode]}),t.durationMs!==null&&(0,R.jsx)(nc,{variant:`secondary`,children:wb(t.durationMs)})]}),(0,R.jsx)(jb,{label:t.capReached?`Output hidden after truncation`:`Output hidden`})]})}function Sb({message:e}){let t=fy(e),n=gy(e);return e.eventType===`item/fileChange/outputDelta`?(0,R.jsx)(Ab,{defaultOpen:!1,icon:(0,R.jsx)(To,{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)(jb,{label:`Output hidden`})}):(0,R.jsxs)(Ab,{defaultOpen:!1,icon:(0,R.jsx)(To,{className:`size-4`}),meta:Eb([n.status,Tb(t.length,`file`),`patch hidden`]),summary:t.length>0?(0,R.jsx)(Db,{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)(nc,{variant:Cb(n.status),children:n.status}),(0,R.jsxs)(nc,{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)(nc,{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 Cb(e){return e===`completed`?`success`:e===`failed`?`danger`:e===`declined`?`warning`:e===`inProgress`?`info`:`secondary`}function wb(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function Tb(e,t){return`${e} ${t}${e===1?``:`s`}`}function Eb(e){let t=e.filter(e=>!!(e&&e.trim()));return t.length>0?t.join(` · `):void 0}function Db({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 Ob({message:e}){let t=py(e);return(0,R.jsx)(Ab,{defaultOpen:!1,icon:(0,R.jsx)(ho,{className:`size-4`}),meta:Tb(_y(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 kb({message:e}){let t=my(e);return(0,R.jsxs)(Ab,{icon:(0,R.jsx)(Ko,{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 Ab({children:e,defaultOpen:t=!0,icon:n,meta:r,summary:i,title:a,tone:o=`neutral`}){return(0,R.jsxs)(`details`,{className:G(`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)(_o,{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:G(`border-t px-3 py-2`,o===`neutral`&&`border-[var(--border-subtle)]`,o===`warning`&&`border-[var(--semantic-warning-border)]`),children:e})]})}function jb({label:e}){return(0,R.jsx)(`p`,{className:`text-[length:var(--font-size-sm)] text-muted-foreground`,children:e})}function Mb({className:e,isActionBusy:t,message:n,onDelete:r,onEdit:i,state:a}){let o=a===`queued`,s=o?`Queued for next turn`:`Steered into active turn`,c=o?So:Vo;return(0,R.jsxs)(`div`,{className:G(`mt-2 flex flex-wrap justify-end gap-1.5`,e),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)(c,{className:`size-3.5 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate`,children:s})]}),o&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(ac,{"aria-label":`Edit pending message`,className:`size-6 border-current/20 bg-[var(--surface-floating)] text-current hover:bg-[var(--state-hover-bg)]`,disabled:t,size:`icon`,title:`Edit pending message`,type:`button`,variant:`outline`,onClick:()=>i(n),children:(0,R.jsx)(Lo,{className:`size-3.5`})}),(0,R.jsx)(ac,{"aria-label":`Delete pending message`,className:`size-6 border-current/20 bg-[var(--surface-floating)] text-current hover:bg-[var(--state-hover-bg)]`,disabled:t,size:`icon`,title:`Delete pending message`,type:`button`,variant:`outline`,onClick:()=>r(n),children:(0,R.jsx)(Go,{className:`size-3.5`})})]})]})}function Nb(e){return e.role===`user`?e.eventType===`chat.message.queued`?`queued`:e.eventType===`chat.message.steered`?`steered`:null:null}function Pb(e){return{name:e.name,path:e.path,relativePath:e.name,root:``,score:0}}function Fb(e){return{id:`${e.path}:${e.name}`,mimeType:e.mimeType,name:e.name,record:e,size:e.size}}async function Ib(e){try{let t=new Uint8Array(await e.slice(0,Py.length).arrayBuffer());return Py.every((e,n)=>t[n]===e)}catch{return!1}}function Lb(e){return e<1024?`${e} B`:e<1024*1024?`${Math.ceil(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Rb(){return(0,R.jsx)(Hi,{})}var zb=[{path:`/`,Component:Rb,HydrateFallback:Qo,children:[{index:!0,Component:Qy}]}];function Bb(){return ja(zb)}var Vb=new Fe,Hb=document.getElementById(`root`);if(!Hb)throw Error(`Root element was not found`);(0,to.createRoot)(Hb).render((0,R.jsx)(L.StrictMode,{children:(0,R.jsx)(Be,{client:Vb,children:(0,R.jsx)(Ri,{router:Bb()})})})),no();
|