opencandle 0.11.0 → 0.11.1
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/README.md +5 -4
- package/dist/analysts/orchestrator.d.ts +2 -0
- package/dist/analysts/orchestrator.js +19 -0
- package/dist/analysts/orchestrator.js.map +1 -1
- package/dist/doctor/report.js +1 -1
- package/dist/doctor/report.js.map +1 -1
- package/dist/infra/cache.d.ts +6 -0
- package/dist/infra/cache.js +16 -6
- package/dist/infra/cache.js.map +1 -1
- package/dist/infra/freshness.d.ts +21 -0
- package/dist/infra/freshness.js +119 -0
- package/dist/infra/freshness.js.map +1 -0
- package/dist/infra/market-calendar.d.ts +14 -0
- package/dist/infra/market-calendar.js +137 -0
- package/dist/infra/market-calendar.js.map +1 -0
- package/dist/infra/rate-limiter.js +1 -0
- package/dist/infra/rate-limiter.js.map +1 -1
- package/dist/market-state/summaries.d.ts +8 -0
- package/dist/market-state/summaries.js +70 -0
- package/dist/market-state/summaries.js.map +1 -0
- package/dist/onboarding/providers.d.ts +25 -1
- package/dist/onboarding/providers.js +26 -0
- package/dist/onboarding/providers.js.map +1 -1
- package/dist/pi/opencandle-extension.js +44 -5
- package/dist/pi/opencandle-extension.js.map +1 -1
- package/dist/providers/alpha-vantage.js +6 -0
- package/dist/providers/alpha-vantage.js.map +1 -1
- package/dist/providers/coingecko.js +1 -0
- package/dist/providers/coingecko.js.map +1 -1
- package/dist/providers/polymarket.d.ts +2 -0
- package/dist/providers/polymarket.js +163 -0
- package/dist/providers/polymarket.js.map +1 -0
- package/dist/providers/wrap-provider.js +5 -3
- package/dist/providers/wrap-provider.js.map +1 -1
- package/dist/providers/yahoo-finance.d.ts +3 -0
- package/dist/providers/yahoo-finance.js +206 -10
- package/dist/providers/yahoo-finance.js.map +1 -1
- package/dist/routing/entity-extractor.js +16 -0
- package/dist/routing/entity-extractor.js.map +1 -1
- package/dist/routing/route-manifest.js +1 -1
- package/dist/routing/route-manifest.js.map +1 -1
- package/dist/routing/router-llm-client.js +18 -3
- package/dist/routing/router-llm-client.js.map +1 -1
- package/dist/routing/router.d.ts +1 -1
- package/dist/routing/router.js +274 -5
- package/dist/routing/router.js.map +1 -1
- package/dist/routing/slot-resolver.d.ts +1 -0
- package/dist/routing/slot-resolver.js +1 -1
- package/dist/routing/slot-resolver.js.map +1 -1
- package/dist/runtime/evidence.d.ts +1 -0
- package/dist/runtime/evidence.js.map +1 -1
- package/dist/runtime/numeric-claims.d.ts +23 -0
- package/dist/runtime/numeric-claims.js +100 -0
- package/dist/runtime/numeric-claims.js.map +1 -0
- package/dist/runtime/planning-evidence.js +1 -76
- package/dist/runtime/planning-evidence.js.map +1 -1
- package/dist/runtime/prompt-step.d.ts +10 -1
- package/dist/runtime/prompt-step.js +116 -2
- package/dist/runtime/prompt-step.js.map +1 -1
- package/dist/runtime/session-coordinator.d.ts +11 -1
- package/dist/runtime/session-coordinator.js +352 -49
- package/dist/runtime/session-coordinator.js.map +1 -1
- package/dist/runtime/validation.d.ts +3 -1
- package/dist/runtime/workflow-events.d.ts +1 -1
- package/dist/runtime/workflow-events.js.map +1 -1
- package/dist/runtime/workflow-types.d.ts +3 -0
- package/dist/runtime/workflow-types.js.map +1 -1
- package/dist/tools/fundamentals/comps.d.ts +1 -0
- package/dist/tools/fundamentals/comps.js +20 -9
- package/dist/tools/fundamentals/comps.js.map +1 -1
- package/dist/tools/fundamentals/dcf.js +183 -112
- package/dist/tools/fundamentals/dcf.js.map +1 -1
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.js +3 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/macro/event-probabilities.d.ts +8 -0
- package/dist/tools/macro/event-probabilities.js +121 -0
- package/dist/tools/macro/event-probabilities.js.map +1 -0
- package/dist/tools/market/crypto-price.d.ts +4 -1
- package/dist/tools/market/crypto-price.js +10 -1
- package/dist/tools/market/crypto-price.js.map +1 -1
- package/dist/tools/market/screen-stocks.js +14 -3
- package/dist/tools/market/screen-stocks.js.map +1 -1
- package/dist/tools/market/stock-quote.d.ts +4 -1
- package/dist/tools/market/stock-quote.js +9 -4
- package/dist/tools/market/stock-quote.js.map +1 -1
- package/dist/tools/options/option-chain.d.ts +4 -1
- package/dist/tools/options/option-chain.js +12 -1
- package/dist/tools/options/option-chain.js.map +1 -1
- package/dist/tools/portfolio/risk-analysis.js +1 -1
- package/dist/tools/portfolio/risk-analysis.js.map +1 -1
- package/dist/tools/technical/indicators.js +1 -1
- package/dist/tools/technical/indicators.js.map +1 -1
- package/dist/types/fundamentals.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/market.d.ts +2 -0
- package/dist/types/options.d.ts +1 -0
- package/dist/types/prediction-markets.d.ts +13 -0
- package/dist/types/prediction-markets.js +2 -0
- package/dist/types/prediction-markets.js.map +1 -0
- package/gui/server/chat-event-adapter.ts +89 -5
- package/gui/server/http-routes.ts +285 -37
- package/gui/server/invoke-tool.ts +14 -13
- package/gui/server/live-chat-event-adapter.ts +37 -2
- package/gui/server/market-state-api.ts +63 -5
- package/gui/server/projector.ts +132 -3
- package/gui/server/session-actions.ts +32 -40
- package/gui/server/session-entry-wait.ts +22 -3
- package/gui/server/ws-hub.ts +16 -4
- package/gui/shared/chat-events.ts +10 -1
- package/gui/shared/event-reducer.ts +1 -0
- package/gui/web/dist/assets/CatalogOverlay-DZ1niyQm.js +1 -0
- package/gui/web/dist/assets/index-D4F9AJnn.css +2 -0
- package/gui/web/dist/assets/index-DtqMMBTr.js +65 -0
- package/gui/web/dist/index.html +2 -2
- package/package.json +8 -13
- package/src/analysts/orchestrator.ts +20 -0
- package/src/doctor/report.ts +1 -1
- package/src/infra/cache.ts +24 -11
- package/src/infra/freshness.ts +165 -0
- package/src/infra/market-calendar.ts +193 -0
- package/src/infra/rate-limiter.ts +1 -0
- package/src/market-state/summaries.ts +75 -0
- package/src/onboarding/providers.ts +29 -1
- package/src/pi/opencandle-extension.ts +55 -5
- package/src/providers/alpha-vantage.ts +6 -0
- package/src/providers/coingecko.ts +2 -0
- package/src/providers/polymarket.ts +214 -0
- package/src/providers/wrap-provider.ts +5 -3
- package/src/providers/yahoo-finance.ts +339 -27
- package/src/routing/entity-extractor.ts +17 -0
- package/src/routing/route-manifest.ts +1 -1
- package/src/routing/router-llm-client.ts +31 -19
- package/src/routing/router.ts +340 -5
- package/src/routing/slot-resolver.ts +1 -1
- package/src/runtime/evidence.ts +1 -0
- package/src/runtime/numeric-claims.ts +108 -0
- package/src/runtime/planning-evidence.ts +6 -91
- package/src/runtime/prompt-step.ts +127 -2
- package/src/runtime/session-coordinator.ts +462 -57
- package/src/runtime/validation.ts +1 -1
- package/src/runtime/workflow-events.ts +2 -0
- package/src/runtime/workflow-types.ts +3 -0
- package/src/tools/fundamentals/comps.ts +25 -14
- package/src/tools/fundamentals/dcf.ts +204 -124
- package/src/tools/index.ts +3 -0
- package/src/tools/macro/event-probabilities.ts +141 -0
- package/src/tools/market/crypto-price.ts +14 -2
- package/src/tools/market/screen-stocks.ts +14 -3
- package/src/tools/market/stock-quote.ts +49 -43
- package/src/tools/options/option-chain.ts +16 -2
- package/src/tools/portfolio/risk-analysis.ts +1 -1
- package/src/tools/technical/indicators.ts +1 -1
- package/src/types/fundamentals.ts +1 -0
- package/src/types/index.ts +1 -0
- package/src/types/market.ts +2 -0
- package/src/types/options.ts +1 -0
- package/src/types/prediction-markets.ts +13 -0
- package/gui/server/chat-run-session.ts +0 -16
- package/gui/web/dist/assets/CatalogOverlay-ChRTKNlf.js +0 -1
- package/gui/web/dist/assets/index-BzyqyVnd.css +0 -2
- package/gui/web/dist/assets/index-DvMjkOP9.js +0 -65
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),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 j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(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 N(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,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(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+j(a,u),c+=N(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+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(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 P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(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 I=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)},ee={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(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=ee,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:F}},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,I)}catch(e){I(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.7`})),u=o(((e,t)=>{t.exports=l()})),d=c(u(),1),f=typeof window<`u`?d.useLayoutEffect:d.useEffect;function p(e){let t=d.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function m(e,t,n={},r={}){d.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function h(e){let t=d.useRef(null);return d.useImperativeHandle(e,()=>t.current,[]),t}var g=d.createContext(null);function _(e){return d.useContext(g)}function v(e){let t=_();return d.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var y=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})),b=o(((e,t)=>{t.exports=y()})),x=b();function S({children:e,fallback:t=null}){return C()?(0,x.jsx)(d.Fragment,{children:e}):(0,x.jsx)(d.Fragment,{children:t})}function C(){return d.useSyncExternalStore(w,()=>!0,()=>!1)}function w(){return()=>{}}function T(e){return e[e.length-1]}function E(e){return typeof e==`function`}function D(e,t){return E(e)?e(t):e}var O=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;function A(e){for(let t in e)if(O.call(e,t))return!0;return!1}var j=()=>Object.create(null),M=(e,t)=>N(e,t,j);function N(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=ee(e)&&ee(i);if(!a&&!(F(e)&&F(i)))return i;let o=a?e:P(e);if(!o)return i;let s=a?i:P(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:O.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=N(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function P(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!k.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!k.call(e,t))return!1;r.push(t)}return r}function F(e){if(!I(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!I(n)||!n.hasOwnProperty(`isPrototypeOf`))}function I(e){return Object.prototype.toString.call(e)===`[object Object]`}function ee(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function te(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!te(e[r],t[r],n))return!1;return!0}if(F(e)&&F(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!te(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!te(e[o],t[o],n)))return!1;return i===a}return!1}function ne(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function L(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function R(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function z(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return R(t)}var re=[`http:`,`https:`,`mailto:`,`tel:`];function ie(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function ae(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=z(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=z(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function oe(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function se(e,t){if(e===t)return!0;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 ce(){throw Error(`Invariant failed`)}function B(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var le=4,ue=5;function de(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function fe(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=de(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function pe(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=n.options?.params?.parse??n.options?.parseParams;for(;s<o;){let e=fe(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=ge(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=ge(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=_e(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=_e(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=_e(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=ge(n.fullPath??n.from);e.kind=ue,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=ge(n.fullPath??n.from);e.kind=le,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=l??null,i.priority=n.options?.params?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)pe(e,t,r,s,i,a,o)}function me(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function he(e){if(e.pathless)for(let t of e.pathless)he(t);if(e.static)for(let t of e.static.values())he(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())he(t);if(e.dynamic?.length){e.dynamic.sort(me);for(let t of e.dynamic)he(t)}if(e.optional?.length){e.optional.sort(me);for(let t of e.optional)he(t)}if(e.wildcard?.length){e.wildcard.sort(me);for(let t of e.wildcard)he(t)}}function ge(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function _e(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function ve(e,t){let n=ge(`/`),r=new Uint16Array(6);for(let t of e)pe(!1,r,t,1,n,0);he(n),t.masksTree=n,t.flatCache=B(1e3)}function ye(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=we(e,t.masksTree);return t.flatCache.set(e,r),r}function be(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=ge(`/`),pe(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),we(r,o,n)}function xe(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=we(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Ee(a.route)),t.matchCache.set(r,a),a}function Se(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Ce(e,t=!1,n){let r=ge(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return pe(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&ce(),a[e.id]=e,s!==0&&e.path){let t=Se(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),he(r),{processedTree:{segmentTree:r,singleCache:B(1e3),matchCache:B(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function we(e,t,n=!1){let r=e.split(`/`),i=Oe(e,r,t,n);if(!i)return null;let[a]=Te(e,r,i);return{route:i.node.route,rawParams:a}}function Te(e,t,n){let r=De(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===le)break;if(u.kind===ue){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function Ee(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function De(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Oe(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!T(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,depth:f,statics:p,dynamics:m,optionals:h}=n,{extract:g,rawParams:_}=n;if(i.kind===2&&i.route&&!Me(l,n))continue;if(i.parse){if(!je(e,t,n))continue;_=n.rawParams,g=n.extract}r&&i.route&&i.kind!==le&&Me(c,n)&&(c=n);let v=u===o;if(v&&(i.route&&(!a||i.kind===le||i.kind===2)&&Me(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let y=v?void 0:t[u],b;if(v&&i.index){let n={node:i.index,index:u,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_},r=!0;if(i.index.parse&&(je(e,t,n)||(r=!1)),r){if(!m&&!h&&!d&&Ae(p,o))return n;Me(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(v||!(n.caseSensitive?y:b??=y.toLowerCase()).startsWith(r)))){if(a){if(v)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}if(i.optional){let e=d|1<<f,t=f+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:u,skipped:e,depth:t,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?y:b??=y.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:u+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+ke(o,u),extract:g,rawParams:_})}}if(!v&&i.dynamic&&y)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,depth:f+1,statics:p,dynamics:m+ke(o,u),optionals:h,extract:g,rawParams:_})}if(!v&&i.staticInsensitive){let e=i.staticInsensitive.get(b??=y.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+ke(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v&&i.static){let e=i.static.get(y);e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+ke(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(i.pathless){let e=f+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:u,skipped:d,depth:e,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function ke(e,t){return 2**(e-t-1)}function Ae(e,t){return e===2**(t-1)-1}function je(e,t,n){let r,i;try{[r,i]=Te(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Me(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===le)>(e.node.kind===le)||t.node.kind===le==(e.node.kind===le)&&t.depth>e.depth))):!0}function Ne(e){return Pe(e.filter(e=>e!==void 0).join(`/`))}function Pe(e){return e.replace(/\/{2,}/g,`/`)}function Fe(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Ie(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Le(e){return Ie(Fe(e))}function Re(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function ze(e,t,n){return Re(e,n)===Re(t,n)}function Be({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&T(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(T(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=Pe(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function Ve(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function He(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>We(e,n)).join(`/`):We(r,n):r}function Ue({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=fe(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=He(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=He(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=He(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function We(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function Ge(e){return e?.isNotFound===!0}var Ke=`__root__`;function qe(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Je(e){return e instanceof Response&&!!e.options}function Ye(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>Xe(o,_.get())),x=r(()=>Xe(s,v.get())),S=r(()=>Xe(c,y.get())),C=r(()=>_.get()[0]),w=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),T=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),E=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),D=B(64);function O(e){let t=D.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),D.set(e,t)),t}let k={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:w,matchRouteDeps:T,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:E,getRouteMatchStore:O,setMatches:A,setPending:j,setCached:M};A(e.matches),a?.(k);function A(e){Ze(e,o,_,n,i)}function j(e){Ze(e,s,v,n,i)}function M(e){Ze(e,c,y,n,i)}return k}function Xe(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function Ze(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}se(n.get(),a)||n.set(a)})}function Qe(){try{return sessionStorage}catch{return}}var $e=`tsr-scroll-restoration-v1_3`,et=Qe();function tt(){try{return JSON.parse(et?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function nt(){try{et?.setItem($e,JSON.stringify(rt))}catch{}}var rt=tt(),it=`data-scroll-restoration-id`,at=e=>e.state.__TSR_key||e.href;function ot(e){let t=e.getAttribute(it);if(t)return`[${it}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var st=!1,ct=`window`;function lt(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function ut(e){let t=[];for(let n of e){if(n===ct)continue;let e=lt(n);e&&t.push(e)}return t}function dt(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||at,a=new Map,o=(e,t,n)=>{let r=a.get(e)||{};r.scrollX=t,r.scrollY=n,a.set(e,r)},s=e=>{if(!(st||!r.restoring))if(e.target===document)o(ct,scrollX,scrollY);else{let t=e.target;o(t,t.scrollLeft,t.scrollTop)}},c=e=>{if(!r.restoring)return;let t=rt[e]||={};for(let[e,n]of a)e===ct?t[ct]=n:e.isConnected&&(t[ot(e)]=n)};n&&!r.restoration&&(r.restoration=!0,st=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,s,!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&c(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{c(i(e.stores.resolvedLocation.get()??e.stores.location.get())),nt()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c;if(a.clear(),s||(r.next=!0),typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let l=i(t.toLocation),u=t.fromLocation&&i(t.fromLocation);if(r.restoring&&u&&u!==l){let e=rt[u];if(e){let t=rt[l];for(let n in e){if(n===ct){if(s)continue}else{let e=lt(n);if(!e||s&&o&&(c??=ut(o),c.includes(e)))continue}t||=rt[l]={},t[n]??=e[n]}}}st=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){let s=tn.get(t.toLocation),u=e&&i&&(s===`PUSH`||s===`REPLACE`),d=r.restoring?rt[l]:void 0;if(d)for(let e in d){let{scrollX:t,scrollY:r}=d[e];if(e===ct){if(u)continue;scrollTo({top:r,left:t,behavior:n}),a=!0}else{let n=lt(e);n&&(n.scrollLeft=t,n.scrollTop=r)}}if(!a&&!e){let e={top:0,left:0,behavior:n};if(scrollTo(e),o){c??=ut(o);for(let t of c)t.scrollTo(e)}}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{st=!1}}))}function ft(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function pt(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function mt(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=pt(r):Array.isArray(t)?t.push(pt(r)):n[e]=[t,pt(r)]}return n}var ht=_t(JSON.parse),gt=vt(JSON.stringify,JSON.parse);function _t(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=mt(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function vt(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=ft(e,r);return t?`?${t}`:``}}var yt=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},bt=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),xt=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),St=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},Ct=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},wt=(e,t,n)=>{if(!(!Je(n)&&!Ge(n)))throw Je(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:Je(n)?`redirected`:Ge(n)?`notFound`:r.status===`pending`?`success`:r.status,context:St(e,t.index),isFetching:!1,error:n})),Ge(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Je(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},Tt=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Et=(e,t,n)=>{let r=St(e,n);e.updateMatch(t,e=>({...e,context:r}))},Dt=(e,t,n)=>{let{id:r,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,wt(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(t){n=t,wt(e,e.router.getMatch(r),n)}e.updateMatch(r,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Je(n)&&!Ge(n)&&(e.serialError??=n)},Ot=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!xt(e,t)&&(n.options.loader||n.options.beforeLoad||zt(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{yt(e)},i);r._nonReactive.pendingTimeout=t}},kt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Ot(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&wt(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},At=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=ne(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&Dt(e,n,o),s&&Dt(e,n,s),Ot(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=ne();let f={...St(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=xt(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(Je(r)||Ge(r))&&(u(),Dt(e,n,r)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),L(y))return u(),y.catch(t=>{Dt(e,n,t)}).then(v)}catch(t){u(),Dt(e,n,t)}v(y)},jt=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>At(e,n,t,i),s=()=>{if(Tt(e,n))return;let t=kt(e,n,i);return L(t)?t.then(o):o()};return a()},Mt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},Nt=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=St(e,r),d=xt(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},Pt=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{Rt(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(Nt(e,t,n,r,i)),l=!!s&&L(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;wt(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:St(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:St(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,Ge(t)&&await i.options.notFoundComponent?.preload?.(),wt(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,wt(e,e.router.getMatch(n),t)}!Je(o)&&!Ge(o)&&await Rt(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:St(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),wt(e,r,t)}},Ft=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(Nt(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await Pt(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){Je(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await Pt(e,t,i,n,d):Et(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(Tt(e,i)){if(!e.router.getMatch(i))return e.matches[n];Et(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=xt(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&wt(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=ne(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function It(e){let t=e,n=[];bt(t.router)&&yt(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=jt(t,e);L(n)&&await n}catch(e){if(Je(e))throw e;if(Ge(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?Ct(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(Ft(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(Je(e))throw e;Ge(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=Ct(t,l);e===void 0&&ce();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await Rt(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Rt(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=Mt(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=yt(t);if(L(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Lt(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Rt(e,t=Bt){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===Bt?(()=>{if(e._componentsPromise===void 0){let t=Lt(e,Bt);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Lt(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function zt(e){for(let t of Bt)if(e.options[t]?.preload)return!0;return!1}var Bt=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function Vt(e){return{input:({url:t})=>{for(let n of e)t=Ut(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Wt(e[n],t);return t}}}function Ht(e){let t=Le(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Ne([`/`,t,e.pathname]),e)}}function Ut(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Wt(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}var Gt=`__TSR_index`,Kt=`popstate`,qt=`beforeunload`;function Jt(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Qt(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[Gt];i=Yt(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[Gt];i=Yt(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[Gt]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Yt(e,t){t||={};let n=$t();return{...t,key:n,__TSR_key:n,[Gt]:e}}function Xt(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>Qt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=$t();t.history.replaceState({[Gt]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=Qt(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[Gt]-l.state[Gt],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=Jt({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(qt,S,{capture:!0}),t.removeEventListener(Kt,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(qt,S,{capture:!0}),t.addEventListener(Kt,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function Zt(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Qt(e,t){let n=Zt(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=$t();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[Gt]:0,key:a,__TSR_key:a}}}function $t(){return(Math.random()+1).toString(36).substring(7)}function en(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var tn=new WeakMap,nn=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Ve(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Xt()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=B(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=Ye(on(this.latestLocation),e),dt(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=Le(o);t&&t!==`/`&&e.push(Ht({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Vt(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a))`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Ce(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&ve(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:ae(e).path,external:!1,searchStr:o,search:M(t?.search,i),hash:ae(r.slice(1)).path,state:N(t?.state,a)}}let o=new URL(i,this.origin),s=Ut(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:ae(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:M(t?.search,c),hash:ae(s.hash.slice(1)).path,state:N(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>Be({base:e,to:t.includes(`//`)?Pe(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>cn({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=t.to?`${t.to}`:void 0,o=r.search,s=Object.assign(Object.create(null),r.params),c=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),l=a?this.resolvePathWithBase(c,a):c,u=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,D(t.params,s)),d=this.routesByPath[Ie(l)],f;if(d)f=this.getRouteBranch(d);else if(l.includes(`$`))f=[];else{let e=this.getMatchedRoutes(l);f=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(f=[...f,this.options.notFoundRoute])}if(f.length&&A(u))for(let e of f){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(u,t(u))}catch{}}let p=e.leaveParams?l:ae(Ue({path:l,params:u,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,m=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};f.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,sn(t.options.validateSearch,{...e,...m}))}catch{}}),m=e}m=ln({search:m,dest:t,destRoutes:f,_includeValidateSearch:e._includeValidateSearch}),m=M(o,m);let h=this.options.stringifySearch(m),g=t.hash===!0?n.hash:t.hash?D(t.hash,n.hash):void 0,_=g?`#${g}`:``,v=t.state===!0?n.state:t.state?D(t.state,n.state):{};v=N(n.state,v);let y=`${p}${h}${_}`,b,x,S=!1;if(this.rewrite){let e=new URL(y,this.origin),t=Wt(this.rewrite,e);b=e.href.replace(e.origin,``),t.origin===this.origin?x=t.pathname+t.search+t.hash:(x=t.href,S=!0)}else b=oe(y),x=b;return{publicHref:x,href:b,pathname:p,search:m,searchStr:h,state:v,hash:g??``,external:S,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=ye(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,D(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=te(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=Ie(this.latestLocation.href)===Ie(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=ne(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t})}return this._scroll.next=n.resetScroll??!0,this.history.subscribers.size||this.load(r?{action:{type:r}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=Qt(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Ut(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(ie(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t=e?.action?.type,n,r,i,a=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(o=>{this.startTransition(async()=>{try{this.beforeLoad(),t?tn.set(this.latestLocation,t):tn.delete(this.latestLocation);let n=this.latestLocation,r=en(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await It({router:this,sync:e?.sync,forceStaleReload:a.href===n.href,matches:this.stores.pendingMatches.get(),location:n,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){Je(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):Ge(e)&&(r=e);let t=n?n.status:r?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(t),this.stores.redirect.set(n)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.stores.matches.get().some(e=>e.status===`error`)&&(o=500),o!==void 0&&this.stores.statusCode.set(o)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(en(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&ie(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=Rt,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await It({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(Je(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});Ge(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=be(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!te(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?te(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??gt,parseSearch:e.parseSearch??ht,protocolAllowlist:e.protocolAllowlist??re}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=Ee(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n,{matchedRoutes:a}=n,o=!1;(r?r.path!==`/`&&i[`**`]:Ie(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?dn(this.options.notFoundMode,a):void 0,c=Array(a.length),l=new Map;for(let e of this.stores.matchStores.values())e.routeId&&l.set(e.routeId,e.get());for(let n=0;n<a.length;n++){let r=a[n],o=c[n-1],u,d,f;{let n=o?.search??e.search,i=o?._strictSearch??void 0;try{let e=sn(r.options.validateSearch,{...n})??void 0;u={...n,...e},d={...i,...e},f=void 0}catch(e){let r=e;if(e instanceof rn||(r=new rn(e.message,{cause:e})),t?.throwOnError)throw r;u=n,d={},f=r}}let p=r.options.loaderDeps?.({search:u})??``,m=p?JSON.stringify(p):``,{interpolatedPath:h,usedParams:g}=Ue({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),_=r.id+h+m,v=this.getMatch(_),y=l.get(r.id),b=v?._strictParams??g,x;if(!v)try{fn(r,b)}catch(e){if(x=Ge(e)||Je(e)?e:new an(e.message,{cause:e}),t?.throwOnError)throw x}Object.assign(i,b);let S=y?`stay`:`enter`,C;if(v)C={...v,cause:S,params:y?.params??i,_strictParams:b,search:M(y?y.search:v.search,u),_strictSearch:d};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||zt(r)?`pending`:`success`;C={id:_,ssr:r.options.ssr,index:n,routeId:r.id,params:y?.params??i,_strictParams:b,pathname:h,updatedAt:Date.now(),search:y?M(y.search,u):u,_strictSearch:d,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:x,__routeContext:void 0,_nonReactive:{loadPromise:ne()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:S,loaderDeps:y?N(y.loaderDeps,p):p,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(C.globalNotFound=s===r.id),C.searchError=f;let w=this.getParentContext(o);C.context={...w,...C.__routeContext,...C.__beforeLoadContext},c[n]=C}for(let t=0;t<c.length;t++){let n=c[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=l.get(n.routeId);if(n.params=o?M(o.params,i):i,!a){let i=c[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:c,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return c}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),r=T(t),i={...e.search};for(let e of t)try{Object.assign(i,sn(e.options.validateSearch,i))}catch{}let a=T(this.stores.matchesId.get()),o=a&&this.stores.matchStores.get(a)?.get(),s=o&&o.routeId===r.id&&o.pathname===e.pathname,c;if(s)c=o.params;else{let e=Object.assign(Object.create(null),n);for(let n of t)try{fn(n,e)}catch{}c=e}return{matchedRoutes:t,fullPath:r.fullPath,search:i,params:c}}},rn=class extends Error{},an=class extends Error{};function on(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function sn(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new rn(`Async validation not supported`);if(n.issues)throw new rn(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function cn({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=Ie(e),a,o=xe(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function ln({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return un(n)(e,t,r??!1)}function un(e){let t,n,r=[];for(let t of e){let e=t.options;`search`in e?e.search?.middlewares&&r.push(...e.search.middlewares):(e.preSearchFilters||e.postSearchFilters)&&r.push(({search:t,next:n})=>{let r=n(e.preSearchFilters?e.preSearchFilters.reduce((e,t)=>t(e),t):t);return e.postSearchFilters?e.postSearchFilters.reduce((e,t)=>t(e),r):r});let i=e.validateSearch;i&&r.push(({search:e,next:t,meta:r})=>{let a=t(e);if(n)try{let e=sn(i,a);if(r&&e)for(let t in e)t in a||(r.defaulted||=new Map).set(t,e[t]);return{...a,...e}}catch{}return a})}let i=(e,n,a)=>{if(e>=r.length){if(!t.search)return{};if(t.search===!0)return n;let e=D(t.search,n);return a&&(a.explicit=e),e}return r[e]({search:n,next:(t,n)=>{if(n){let n=a||{};return{search:i(e+1,t,n),meta:n}}return i(e+1,t,a)},meta:a})};return function(e,r,a){return t=r,n=a,i(0,e)}}function dn(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return Ke}function fn(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}var pn=`Error preloading route! ☝️`,mn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Ke:this.parentRoute||ce();let r=n?Ke:t?.path;r&&r!==`/`&&(r=Fe(r));let i=t?.id||r,a=n?Ke:Ne([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Ne([`/`,a]));let o=a===`__root__`?`/`:Ne([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=Ie(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>qe({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},hn=class extends mn{constructor(e){super(e)}},gn=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(gn||{});function _n({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function vn(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var yn=[],bn=0,{link:xn,unlink:Sn,propagate:Cn,checkDirty:wn,shallowPropagate:Tn}=_n({update(e){return e._update()},notify(e){yn[Dn++]=e,e.flags&=~gn.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=gn.Mutable|gn.Dirty,jn(e))}}),En=0,Dn=0,On,kn=0;function An(e){try{++kn,e()}finally{--kn||Mn()}}function jn(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Sn(n,e)}function Mn(){if(!(kn>0)){for(;En<Dn;){let e=yn[En];yn[En++]=void 0,e.notify()}En=0,Dn=0}}function Nn(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?gn.None:gn.Mutable,get(){return On!==void 0&&xn(i,On,bn),i._snapshot},subscribe(e){let t=vn(e),n={current:!1},r=Pn(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=On,o=t?.compare??Object.is;if(n)On=i,++bn,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=gn.Mutable|gn.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{On=a,n&&(i.flags&=~gn.RecursedCheck),jn(i)}}};return n?(i.flags=gn.Mutable|gn.Dirty,i.get=function(){let e=i.flags;if(e&gn.Dirty||e&gn.Pending&&wn(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Tn(e)}}else e&gn.Pending&&(i.flags=e&~gn.Pending);return On!==void 0&&xn(i,On,bn),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Cn(e),Tn(e),Mn())}},i}function Pn(e){let t=()=>{let t=On;On=n,++bn,n.depsTail=void 0,n.flags=gn.Watching|gn.RecursedCheck;try{return e()}finally{On=t,n.flags&=~gn.RecursedCheck,jn(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:gn.Watching|gn.RecursedCheck,notify(){let e=this.flags;e&gn.Dirty||e&gn.Pending&&wn(this.deps,this)?t():this.flags=gn.Watching},stop(){this.flags=gn.None,this.depsTail=void 0,jn(this)}};return t(),n}var Fn=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),In=o(((e,t)=>{t.exports=Fn()})),Ln=o((e=>{var t=u(),n=In();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Rn=o(((e,t)=>{t.exports=Ln()}))();function zn(e,t){return e===t}function Bn(e,t,n=zn){let r=(0,d.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,d.useCallback)(()=>e?.get(),[e]);return(0,Rn.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var Vn=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.7`})),Hn=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=Vn()})),Un=c(Hn(),1);function Wn(e,t){let n=_(),r=h(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:f,replace:p,startTransition:g,resetScroll:v,viewTransition:y,children:b,target:x,disabled:S,style:w,className:T,onClick:E,onBlur:O,onFocus:k,onMouseEnter:A,onMouseLeave:j,onTouchStart:M,ignoreBlocker:N,params:P,search:F,hash:I,state:ee,mask:ne,reloadDocument:L,unsafeRelative:R,from:z,_fromLocation:re,...ae}=e,oe=C(),se=d.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ce=Bn(n.stores.location,e=>e,(e,t)=>e.href===t.href),B=d.useMemo(()=>{let e={_fromLocation:ce,...se};return n.buildLocation(e)},[n,ce,se]),le=B.maskedLocation?B.maskedLocation.publicHref:B.publicHref,ue=B.maskedLocation?B.maskedLocation.external:B.external,de=d.useMemo(()=>$n(le,ue,n.history,S),[S,ue,le,n.history]),fe=d.useMemo(()=>{if(de?.external)return ie(de.href,n.protocolAllowlist)?void 0:de.href;if(!er(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),ie(s,n.protocolAllowlist)?void 0:s}catch{}},[s,de,n.protocolAllowlist]),pe=d.useMemo(()=>{if(fe)return!1;if(o?.exact){if(!ze(ce.pathname,B.pathname,n.basepath))return!1}else{let e=Re(ce.pathname,n.basepath),t=Re(B.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!te(ce.search,B.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?oe&&ce.hash===B.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,ce,fe,oe,B.hash,B.pathname,B.search,n.basepath]),me=pe?D(i,{})??Kn:Gn,he=pe?Gn:D(a,{})??Gn,ge=[T,me.className,he.className].filter(Boolean).join(` `),_e=(w||me.style||he.style)&&{...w,...me.style,...he.style},[ve,ye]=d.useState(!1),be=d.useRef(!1),xe=e.reloadDocument||fe?!1:c??n.options.defaultPreload,Se=l??n.options.defaultPreloadDelay??0,Ce=d.useCallback(()=>{n.preloadRoute({...se,_builtLocation:B}).catch(e=>{console.warn(e),console.warn(pn)})},[n,se,B]);m(r,d.useCallback(e=>{e?.isIntersecting&&Ce()},[Ce]),Zn,{disabled:!!S||xe!==`viewport`}),d.useEffect(()=>{be.current||!S&&xe===`render`&&(Ce(),be.current=!0)},[S,Ce,xe]);let we=e=>{let t=e.currentTarget.getAttribute(`target`),r=x===void 0?t:x;if(!S&&!nr(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,Un.flushSync)(()=>{ye(!0)});let t=n.subscribe(`onResolved`,()=>{t(),ye(!1)});n.navigate({...se,replace:p,resetScroll:v,hashScrollIntoView:f,startTransition:g,viewTransition:y,ignoreBlocker:N})}};if(fe)return{...ae,ref:r,href:fe,...b&&{children:b},...x&&{target:x},...S&&{disabled:S},...w&&{style:w},...T&&{className:T},...E&&{onClick:E},...O&&{onBlur:O},...k&&{onFocus:k},...A&&{onMouseEnter:A},...j&&{onMouseLeave:j},...M&&{onTouchStart:M}};let Te=e=>{if(S||xe!==`intent`)return;if(!Se){Ce();return}let t=e.currentTarget;if(Xn.has(t))return;let n=setTimeout(()=>{Xn.delete(t),Ce()},Se);Xn.set(t,n)},Ee=e=>{S||xe!==`intent`||Ce()},De=e=>{if(S||!xe||!Se)return;let t=e.currentTarget,n=Xn.get(t);n&&(clearTimeout(n),Xn.delete(t))};return{...ae,...me,...he,href:de?.href,ref:r,onClick:Qn([E,we]),onBlur:Qn([O,De]),onFocus:Qn([k,Te]),onMouseEnter:Qn([A,Te]),onMouseLeave:Qn([j,De]),onTouchStart:Qn([M,Ee]),disabled:!!S,target:x,..._e&&{style:_e},...ge&&{className:ge},...S&&qn,...pe&&Jn,...oe&&ve&&Yn}}var Gn={},Kn={className:`active`},qn={role:`link`,"aria-disabled":!0},Jn={"data-status":`active`,"aria-current":`page`},Yn={"data-transitioning":`transitioning`},Xn=new WeakMap,Zn={rootMargin:`100px`},Qn=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function $n(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function er(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var tr=d.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Wn(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return d.createElement(`a`,t,o)}return d.createElement(n,a,o)});function nr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var rr=d.createContext(void 0),ir=d.createContext(void 0),ar={get(){},subscribe(){return{unsubscribe(){}}}};function or(e,t){let n=d.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=N(n.current,i):i}}function sr(e){let t=_(),n=d.useContext(e.from?ir:rr),r=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),i=or(e,t),a=Bn(r??ar,e=>e?i(e):ar);if(a!==ar)return a;(e.shouldThrow??!0)&&ce()}function cr(e){return sr({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function lr(e){let{select:t,...n}=e;return sr({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function ur(e){return sr({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function dr(e){return sr({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function fr(e){return sr({...e,select:t=>e.select?e.select(t.context):t.context})}var pr=class extends mn{constructor(e){super(e),this.useMatch=e=>sr({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>fr({...e,from:this.id}),this.useSearch=e=>dr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ur({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>lr({...e,from:this.id}),this.useLoaderData=e=>cr({...e,from:this.id}),this.useNavigate=()=>v({from:this.fullPath}),this.Link=d.forwardRef((e,t)=>(0,x.jsx)(tr,{ref:t,from:this.fullPath,...e}))}};function mr(e){return new pr(e)}var hr=class extends hn{constructor(e){super(e),this.useMatch=e=>sr({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>fr({...e,from:this.id}),this.useSearch=e=>dr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ur({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>lr({...e,from:this.id}),this.useLoaderData=e=>cr({...e,from:this.id}),this.useNavigate=()=>v({from:this.fullPath}),this.Link=d.forwardRef((e,t)=>(0,x.jsx)(tr,{ref:t,from:this.fullPath,...e}))}};function gr(e){return new hr(e)}var _r=e=>({createMutableStore:Nn,createReadonlyStore:Nn,batch:An}),vr=e=>new yr(e),yr=class extends nn{constructor(e){super(e,_r)}};function br(e){let t=e.errorComponent??Sr;return(0,x.jsx)(xr,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?d.createElement(t,{error:n,reset:r}):e.children})}var xr=class extends d.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Sr({error:e}){let[t,n]=d.useState(!1);return(0,x.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,x.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,x.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,x.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,x.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,x.jsx)(`div`,{children:(0,x.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,x.jsx)(`code`,{children:e.message}):null})}):null]})}function Cr(){let e=_(),t=d.useRef({router:e,mounted:!1}),[n,r]=d.useState(!1),i=Bn(e.stores.isLoading,e=>e),a=Bn(e.stores.hasPending,e=>e),o=p(i),s=i||n||a,c=p(s),l=i||a,u=p(l);return e.startTransition=e=>{r(!0),d.startTransition(()=>{e(),r(!1)})},d.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ie(e.latestLocation.publicHref)!==Ie(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),f(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),f(()=>{o&&!i&&e.emit({type:`onLoad`,...en(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),f(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...en(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,u,e]),f(()=>{if(c&&!s){let t=en(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),An(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())})}},[s,c,e]),null}function wr(e){return(0,x.jsx)(x.Fragment,{children:e.children})}function Tr(e){let t=_(),n=`not-found-${Bn(t.stores.location,e=>e.pathname)}-${Bn(t.stores.status,e=>e)}`;return(0,x.jsx)(br,{getResetKey:()=>n,onCatch:(t,n)=>{if(Ge(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Ge(t))return e.fallback?.(t);throw t},children:e.children})}function Er(){return(0,x.jsx)(`p`,{children:`Not Found`})}function Dr(e,t,n){return t.options.notFoundComponent?(0,x.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,x.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,x.jsx)(Er,{})}var Or=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,kr=(e,t)=>e[0]===t[0]&&e[1]===t[1],Ar=d.memo(function({matchId:e}){let t=_(),n=t.stores.matchStores.get(e);n||ce();let r=Bn(t.stores.loadedAt,e=>e),i=Bn(n,e=>e,Or);return(0,x.jsx)(jr,{router:t,matchId:e,resetKey:r,matchState:d.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function jr({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,x.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,f=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?d.Suspense:wr,p=s?br:wr,m=l?Tr:wr;return(0,x.jsxs)(i.isRoot?i.options.shellComponent??wr:wr,{children:[(0,x.jsx)(rr.Provider,{value:t,children:(0,x.jsx)(f,{fallback:o,children:(0,x.jsx)(p,{getResetKey:()=>n,errorComponent:s||Sr,onCatch:(e,t)=>{if(Ge(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,x.jsx)(m,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return d.createElement(l,e)},children:u||r._displayPending?(0,x.jsx)(S,{fallback:o,children:(0,x.jsx)(Nr,{matchId:t})}):(0,x.jsx)(Nr,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Mr,{}),(e.options.scrollRestoration,null)]}):null]})}function Mr(){let e=_(),t=d.useRef();return f(()=>{let n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:`onRendered`,...en(e.stores.location.get(),r??n)}),t.current=n},[Bn(e.stores.resolvedLocation,e=>e?.state.__TSR_key),e]),null}var Nr=d.memo(function({matchId:e}){let t=_(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||ce();let i=Bn(r,e=>e),a=i.routeId,o=t.routesById[a],s=d.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=d.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,x.jsx)(e,{},s):(0,x.jsx)(Pr,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=ne();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return Ge(i.error)||ce(),Dr(t,o,i.error);if(i.status===`redirected`)throw Je(i.error)||ce(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),Pr=d.memo(function(){let e=_(),t=d.useContext(rr),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=Bn(a,e=>[e?.routeId,e?.globalNotFound??!1],kr),i=Bn(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,x.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||ce(),Dr(e,a,void 0);if(!i)return null;let s=(0,x.jsx)(Ar,{matchId:i});return n===`__root__`?(0,x.jsx)(d.Suspense,{fallback:o,children:s}):s});function Fr(){let e=_(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,x.jsx)(t,{}):null,r=(0,x.jsxs)(typeof document<`u`&&e.ssr?wr:d.Suspense,{fallback:n,children:[(0,x.jsx)(Cr,{}),(0,x.jsx)(Ir,{})]});return e.options.InnerWrap?(0,x.jsx)(e.options.InnerWrap,{children:r}):r}function Ir(){let e=_(),t=Bn(e.stores.firstId,e=>e),n=Bn(e.stores.loadedAt,e=>e),r=t?(0,x.jsx)(Ar,{matchId:t}):null;return(0,x.jsx)(rr.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,x.jsx)(br,{getResetKey:()=>n,errorComponent:Sr,onCatch:void 0,children:r})})}function Lr({router:e,children:t,...n}){A(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,x.jsx)(g.Provider,{value:e,children:t});return e.options.Wrap?(0,x.jsx)(e.options.Wrap,{children:r}):r}function Rr({router:e,...t}){return(0,x.jsx)(Lr,{router:e,...t,children:(0,x.jsx)(Fr,{})})}function zr(e){let t=_({warn:e?.router===void 0}),n=e?.router||t;return Bn(n.stores.__store,or(e,n))}var Br=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&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Vr=o(((e,t)=>{t.exports=Br()})),Hr=o((e=>{var t=Vr(),n=u(),r=Hn();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 f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var N=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},ee=[],te=-1;function ne(e){return{current:e}}function L(e){0>te||(e.current=ee[te],ee[te]=null,te--)}function R(e,t){te++,ee[te]=e.current,e.current=t}var z=ne(null),re=ne(null),ie=ne(null),ae=ne(null);function oe(e,t){switch(R(ie,t),R(re,e),R(z,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Gd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Gd(t),e=Kd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}L(z),R(z,e)}function se(){L(z),L(re),L(ie)}function ce(e){e.memoizedState!==null&&R(ae,e);var t=z.current,n=Kd(t,e.type);t!==n&&(R(re,e),R(z,n))}function B(e){re.current===e&&(L(z),L(re)),ae.current===e&&(L(ae),ep._currentValue=I)}var le,ue;function de(e){if(le===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);le=t&&t[1]||``,ue=-1<e.stack.indexOf(`
|
|
2
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
-
`+le+e+ue}var fe=!1;function pe(e,t){if(!e||fe)return``;fe=!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{fe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?de(n):``}function me(e,t){switch(e.tag){case 26:case 27:case 5:return de(e.type);case 16:return de(`Lazy`);case 13:return e.child!==t&&t!==null?de(`Suspense Fallback`):de(`Suspense`);case 19:return de(`SuspenseList`);case 0:case 15:return pe(e.type,!1);case 11:return pe(e.type.render,!1);case 1:return pe(e.type,!0);case 31:return de(`Activity`);default:return``}}function he(e){try{var t=``,n=null;do t+=me(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
-
Error generating stack: `+e.message+`
|
|
8
|
-
`+e.stack}}var ge=Object.prototype.hasOwnProperty,_e=t.unstable_scheduleCallback,ve=t.unstable_cancelCallback,ye=t.unstable_shouldYield,be=t.unstable_requestPaint,xe=t.unstable_now,Se=t.unstable_getCurrentPriorityLevel,Ce=t.unstable_ImmediatePriority,we=t.unstable_UserBlockingPriority,Te=t.unstable_NormalPriority,Ee=t.unstable_LowPriority,De=t.unstable_IdlePriority,Oe=t.log,ke=t.unstable_setDisableYieldValue,Ae=null,je=null;function Me(e){if(typeof Oe==`function`&&ke(e),je&&typeof je.setStrictMode==`function`)try{je.setStrictMode(Ae,e)}catch{}}var Ne=Math.clz32?Math.clz32:Ie,Pe=Math.log,Fe=Math.LN2;function Ie(e){return e>>>=0,e===0?32:31-(Pe(e)/Fe|0)|0}var Le=256,Re=262144,ze=4194304;function Be(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 Ve(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=Be(n))):i=Be(o):i=Be(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Be(n))):i=Be(o)):i=Be(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 He(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ue(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 We(){var e=ze;return ze<<=1,!(ze&62914560)&&(ze=4194304),e}function Ge(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ke(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function qe(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-Ne(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&&Je(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Je(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ne(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ye(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ne(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Xe(e,t){var n=t&-t;return n=n&42?1:Ze(n),(n&(e.suspendedLanes|t))===0?n:0}function Ze(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 Qe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function $e(){var e=F.p;return e===0?(e=window.event,e===void 0?32:gp(e.type)):e}function et(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var tt=Math.random().toString(36).slice(2),nt=`__reactFiber$`+tt,rt=`__reactProps$`+tt,it=`__reactContainer$`+tt,at=`__reactEvents$`+tt,ot=`__reactListeners$`+tt,st=`__reactHandles$`+tt,ct=`__reactResources$`+tt,lt=`__reactMarker$`+tt;function ut(e){delete e[nt],delete e[rt],delete e[at],delete e[ot],delete e[st]}function dt(e){var t=e[nt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[it]||n[nt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mf(e);e!==null;){if(n=e[nt])return n;e=mf(e)}return t}e=n,n=e.parentNode}return null}function ft(e){if(e=e[nt]||e[it]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function mt(e){var t=e[ct];return t||=e[ct]={hoistableStyles:new Map,hoistableScripts:new Map},t}function ht(e){e[lt]=!0}var gt=new Set,_t={};function vt(e,t){yt(e,t),yt(e+`Capture`,t)}function yt(e,t){for(_t[e]=t,e=0;e<t.length;e++)gt.add(t[e])}var bt=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]*$`),xt={},St={};function Ct(e){return ge.call(St,e)?!0:ge.call(xt,e)?!1:bt.test(e)?St[e]=!0:(xt[e]=!0,!1)}function wt(e,t,n){if(Ct(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 Tt(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 Et(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 Dt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ot(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function kt(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 At(e){if(!e._valueTracker){var t=Ot(e)?`checked`:`value`;e._valueTracker=kt(e,t,``+e[t])}}function jt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ot(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Mt(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 Nt=/[\n"\\]/g;function Pt(e){return e.replace(Nt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ft(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=``+Dt(t)):e.value!==``+Dt(t)&&(e.value=``+Dt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Lt(e,o,Dt(n)):Lt(e,o,Dt(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=``+Dt(s):e.removeAttribute(`name`)}function It(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)){At(e);return}n=n==null?``:``+Dt(n),t=t==null?n:``+Dt(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),At(e)}function Lt(e,t,n){t===`number`&&Mt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Rt(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=``+Dt(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 zt(e,t,n){if(t!=null&&(t=``+Dt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Dt(n)}function Bt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(N(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Dt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),At(e)}function Vt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ht=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 Ut(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||Ht.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Wt(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&&Ut(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Ut(e,o,t[o])}function Gt(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 Kt=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`]]),qt=/^[\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 Jt(e){return qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Yt(){}var Xt=null;function Zt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qt=null,$t=null;function en(e){var t=ft(e);if(t&&(e=t.stateNode)){var n=e[rt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ft(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="`+Pt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[rt]||null;if(!a)throw Error(i(90));Ft(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&&jt(r)}break a;case`textarea`:zt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Rt(e,!!n.multiple,t,!1)}}}var tn=!1;function nn(e,t,n){if(tn)return e(t,n);tn=!0;try{return e(t)}finally{if(tn=!1,(Qt!==null||$t!==null)&&(Cu(),Qt&&(t=Qt,e=$t,$t=Qt=null,en(t),e)))for(t=0;t<e.length;t++)en(e[t])}}function rn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[rt]||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 an=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),on=!1;if(an)try{var sn={};Object.defineProperty(sn,"passive",{get:function(){on=!0}}),window.addEventListener(`test`,sn,sn),window.removeEventListener(`test`,sn,sn)}catch{on=!1}var cn=null,ln=null,un=null;function dn(){if(un)return un;var e,t=ln,n=t.length,r,i=`value`in cn?cn.value:cn.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 un=i.slice(e,1<r?1-r:void 0)}function fn(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 pn(){return!0}function mn(){return!1}function hn(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)?pn:mn,this.isPropagationStopped=mn,this}return p(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=pn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=pn)},persist:function(){},isPersistent:pn}),t}var gn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_n=hn(gn),vn=p({},gn,{view:0,detail:0}),yn=hn(vn),bn,xn,Sn,Cn=p({},vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pn,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!==Sn&&(Sn&&e.type===`mousemove`?(bn=e.screenX-Sn.screenX,xn=e.screenY-Sn.screenY):xn=bn=0,Sn=e),bn)},movementY:function(e){return`movementY`in e?e.movementY:xn}}),wn=hn(Cn),Tn=hn(p({},Cn,{dataTransfer:0})),En=hn(p({},vn,{relatedTarget:0})),Dn=hn(p({},gn,{animationName:0,elapsedTime:0,pseudoElement:0})),On=hn(p({},gn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),kn=hn(p({},gn,{data:0})),An={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},jn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Mn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Nn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Mn[e])?!!t[e]:!1}function Pn(){return Nn}var Fn=hn(p({},vn,{key:function(e){if(e.key){var t=An[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?jn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pn,charCode:function(e){return e.type===`keypress`?fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),In=hn(p({},Cn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Ln=hn(p({},vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pn})),Rn=hn(p({},gn,{propertyName:0,elapsedTime:0,pseudoElement:0})),zn=hn(p({},Cn,{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})),Bn=hn(p({},gn,{newState:0,oldState:0})),Vn=[9,13,27,32],Un=an&&`CompositionEvent`in window,Wn=null;an&&`documentMode`in document&&(Wn=document.documentMode);var Gn=an&&`TextEvent`in window&&!Wn,Kn=an&&(!Un||Wn&&8<Wn&&11>=Wn),qn=` `,Jn=!1;function Yn(e,t){switch(e){case`keyup`:return Vn.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=dn(),un=ln=cn=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){Qt?$t?$t.push(r):$t=[r]:Qt=r,t=kd(t,`onChange`),0<t.length&&(n=new _n(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var rr=null,ir=null;function ar(e){Sd(e,0)}function or(e){if(jt(pt(e)))return e}function sr(e,t){if(e===`change`)return t}var cr=!1;if(an){var lr;if(an){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,Zt(e)),nn(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(!ge.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=Mt(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=Mt(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=an&&`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!==Mt(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=kd(Or,`onSelect`),0<r.length&&(t=new _n(`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={};an&&(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`),Hr=Ir(`transitionstart`),Ur=Ir(`transitioncancel`),Wr=Ir(`transitionend`),Gr=new Map,Kr=`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(` `);Kr.push(`scrollEnd`);function qr(e,t){Gr.set(e,t),vt(t,[e])}var Jr=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)},Yr=[],Xr=0,Zr=0;function Qr(){for(var e=Xr,t=Zr=Xr=0;t<e;){var n=Yr[t];Yr[t++]=null;var r=Yr[t];Yr[t++]=null;var i=Yr[t];Yr[t++]=null;var a=Yr[t];if(Yr[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&&ni(n,i,a)}}function $r(e,t,n,r){Yr[Xr++]=e,Yr[Xr++]=t,Yr[Xr++]=n,Yr[Xr++]=r,Zr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ei(e,t,n,r){return $r(e,t,n,r),ri(e)}function ti(e,t){return $r(e,null,null,t),ri(e)}function ni(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-Ne(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ri(e){if(50<mu)throw mu=0,hu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ii={};function ai(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 oi(e,t,n,r){return new ai(e,t,n,r)}function si(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ci(e,t){var n=e.alternate;return n===null?(n=oi(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 li(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 ui(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)si(e)&&(s=1);else if(typeof e==`string`)s=Gf(e,n,z.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case D:return e=oi(31,n,t,a),e.elementType=D,e.lanes=o,e;case _:return di(n.children,a,o,t);case v:s=8,a|=24;break;case y:return e=oi(12,n,t,a|2),e.elementType=y,e.lanes=o,e;case C:return e=oi(13,n,t,a),e.elementType=C,e.lanes=o,e;case w:return e=oi(19,n,t,a),e.elementType=w,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case x:s=10;break a;case b:s=9;break a;case S:s=11;break a;case T:s=14;break a;case E:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=oi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function di(e,t,n,r){return e=oi(7,e,r,t),e.lanes=n,e}function fi(e,t,n){return e=oi(6,e,null,t),e.lanes=n,e}function pi(e){var t=oi(18,null,null,0);return t.stateNode=e,t}function mi(e,t,n){return t=oi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var hi=new WeakMap;function gi(e,t){if(typeof e==`object`&&e){var n=hi.get(e);return n===void 0?(t={value:e,source:t,stack:he(t)},hi.set(e,t),t):n}return{value:e,source:t,stack:he(t)}}var _i=[],vi=0,yi=null,bi=0,xi=[],Si=0,Ci=null,wi=1,Ti=``;function Ei(e,t){_i[vi++]=bi,_i[vi++]=yi,yi=e,bi=t}function Di(e,t,n){xi[Si++]=wi,xi[Si++]=Ti,xi[Si++]=Ci,Ci=e;var r=wi;e=Ti;var i=32-Ne(r)-1;r&=~(1<<i),n+=1;var a=32-Ne(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,wi=1<<32-Ne(t)+i|n<<i|r,Ti=a+e}else wi=1<<a|n<<i|r,Ti=e}function Oi(e){e.return!==null&&(Ei(e,1),Di(e,1,0))}function ki(e){for(;e===yi;)yi=_i[--vi],_i[vi]=null,bi=_i[--vi],_i[vi]=null;for(;e===Ci;)Ci=xi[--Si],xi[Si]=null,Ti=xi[--Si],xi[Si]=null,wi=xi[--Si],xi[Si]=null}function Ai(e,t){xi[Si++]=wi,xi[Si++]=Ti,xi[Si++]=Ci,wi=t.id,Ti=t.overflow,Ci=e}var ji=null,Mi=null,V=!1,Ni=null,Pi=!1,Fi=Error(i(519));function Ii(e){throw Hi(gi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Fi}function Li(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[nt]=e,t[rt]=r,n){case`dialog`:Y(`cancel`,t),Y(`close`,t);break;case`iframe`:case`object`:case`embed`:Y(`load`,t);break;case`video`:case`audio`:for(n=0;n<bd.length;n++)Y(bd[n],t);break;case`source`:Y(`error`,t);break;case`img`:case`image`:case`link`:Y(`error`,t),Y(`load`,t);break;case`details`:Y(`toggle`,t);break;case`input`:Y(`invalid`,t),It(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Y(`invalid`,t);break;case`textarea`:Y(`invalid`,t),Bt(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||Fd(t.textContent,n)?(r.popover!=null&&(Y(`beforetoggle`,t),Y(`toggle`,t)),r.onScroll!=null&&Y(`scroll`,t),r.onScrollEnd!=null&&Y(`scrollend`,t),r.onClick!=null&&(t.onclick=Yt),t=!0):t=!1,t||Ii(e,!0)}function Ri(e){for(ji=e.return;ji;)switch(ji.tag){case 5:case 31:case 13:Pi=!1;return;case 27:case 3:Pi=!0;return;default:ji=ji.return}}function zi(e){if(e!==ji)return!1;if(!V)return Ri(e),V=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||qd(e.type,e.memoizedProps)),n=!n),n&&Mi&&Ii(e),Ri(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Mi=pf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Mi=pf(e)}else t===27?(t=Mi,ef(e.type)?(e=ff,ff=null,Mi=e):Mi=t):Mi=ji?df(e.stateNode.nextSibling):null;return!0}function Bi(){Mi=ji=null,V=!1}function Vi(){var e=Ni;return e!==null&&(eu===null?eu=e:eu.push.apply(eu,e),Ni=null),e}function Hi(e){Ni===null?Ni=[e]:Ni.push(e)}var Ui=ne(null),Wi=null,Gi=null;function Ki(e,t,n){R(Ui,t._currentValue),t._currentValue=n}function qi(e){e._currentValue=Ui.current,L(Ui)}function Ji(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 Yi(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),Ji(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),Ji(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 Xi(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===ae.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ep]:e.push(ep))}a=a.return}e!==null&&Yi(t,e,n,r),t.flags|=262144}function Zi(e){for(e=e.firstContext;e!==null;){if(!yr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Qi(e){Wi=e,Gi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $i(e){return ta(Wi,e)}function ea(e,t){return Wi===null&&Qi(e),ta(e,t)}function ta(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Gi===null){if(e===null)throw Error(i(308));Gi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Gi=Gi.next=t;return n}var na=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()})}},ra=t.unstable_scheduleCallback,ia=t.unstable_NormalPriority,aa={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oa(){return{controller:new na,data:new Map,refCount:0}}function sa(e){e.refCount--,e.refCount===0&&ra(ia,function(){e.controller.abort()})}var ca=null,la=0,ua=0,da=null;function fa(e,t){if(ca===null){var n=ca=[];la=0,ua=md(),da={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return la++,t.then(pa,pa),t}function pa(){if(--la===0&&ca!==null){da!==null&&(da.status=`fulfilled`);var e=ca;ca=null,ua=0,da=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ma(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 ha=P.S;P.S=function(e,t){ru=xe(),typeof t==`object`&&t&&typeof t.then==`function`&&fa(e,t),ha!==null&&ha(e,t)};var ga=ne(null);function _a(){var e=ga.current;return e===null?Bl.pooledCache:e}function va(e,t){t===null?R(ga,ga.current):R(ga,t.pool)}function ya(){var e=_a();return e===null?null:{parent:aa._currentValue,pool:e}}var ba=Error(i(460)),xa=Error(i(474)),Sa=Error(i(542)),Ca={then:function(){}};function wa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ta(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Yt,Yt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e;default:if(typeof t.status==`string`)t.then(Yt,Yt);else{if(e=Bl,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,ka(e),e}throw Da=t,ba}}function Ea(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Da=e,ba):e}}var Da=null;function Oa(){if(Da===null)throw Error(i(459));var e=Da;return Da=null,e}function ka(e){if(e===ba||e===Sa)throw Error(i(483))}var Aa=null,ja=0;function Ma(e){var t=ja;return ja+=1,Aa===null&&(Aa=[]),Ta(Aa,e,t)}function Na(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Pa(e,t){throw t.$$typeof===m?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Fa(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=ci(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=fi(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===_?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===E&&Ea(i)===t.type)?(t=a(t,n.props),Na(t,n),t.return=e,t):(t=ui(n.type,n.key,n.props,null,e.mode,r),Na(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=mi(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=di(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=fi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case h:return n=ui(t.type,t.key,t.props,null,e.mode,n),Na(n,t),n.return=e,n;case g:return t=mi(t,e.mode,n),t.return=e,t;case E:return t=Ea(t),f(e,t,n)}if(N(t)||A(t))return t=di(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ma(t),n);if(t.$$typeof===x)return f(e,ea(e,t),n);Pa(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 h:return n.key===i?l(e,t,n,r):null;case g:return n.key===i?u(e,t,n,r):null;case E:return n=Ea(n),p(e,t,n,r)}if(N(n)||A(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ma(n),r);if(n.$$typeof===x)return p(e,t,ea(e,n),r);Pa(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 h:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case g:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case E:return r=Ea(r),m(e,t,n,r,i)}if(N(r)||A(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ma(r),i);if(r.$$typeof===x)return m(e,t,n,ea(t,r),i);Pa(t,r)}return null}function v(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),V&&Ei(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 V&&Ei(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)}),V&&Ei(i,h),l}function y(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),V&&Ei(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 V&&Ei(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)}),V&&Ei(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===_&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case h:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===_){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===E&&Ea(l)===r.type){n(e,r.sibling),c=a(r,o.props),Na(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===_?(c=di(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ui(o.type,o.key,o.props,null,e.mode,c),Na(c,o),c.return=e,e=c)}return s(e);case g: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=mi(o,e.mode,c),c.return=e,e=c}return s(e);case E:return o=Ea(o),b(e,r,o,c)}if(N(o))return v(e,r,o,c);if(A(o)){if(l=A(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ma(o),c);if(o.$$typeof===x)return b(e,r,ea(e,o),c);Pa(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=fi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ja=0;var i=b(e,t,n,r);return Aa=null,i}catch(t){if(t===ba||t===Sa)throw t;var a=oi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ia=Fa(!0),La=Fa(!1),Ra=!1;function za(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ba(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 Va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ha(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,zl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ri(e),ni(e,null,n),t}return $r(e,r,t,n),ri(e)}function Ua(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,Ye(e,n)}}function Wa(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 Ga=!1;function Ka(){if(Ga){var e=da;if(e!==null)throw e}}function qa(e,t,n,r){Ga=!1;var i=e.updateQueue;Ra=!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,m=f!==s.lane;if(m?(q&f)===f:(r&f)===f){f!==0&&f===ua&&(Ga=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=p({},d,f);break a;case 2:Ra=!0}}f=s.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,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),Jl|=o,e.lanes=o,e.memoizedState=d}}function Ja(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ya(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ja(n[e],t)}var Xa=ne(null),Za=ne(0);function Qa(e,t){e=Kl,R(Za,e),R(Xa,t),Kl=e|t.baseLanes}function $a(){R(Za,Kl),R(Xa,Xa.current)}function eo(){Kl=Za.current,L(Xa),L(Za)}var to=ne(null),no=null;function ro(e){var t=e.alternate;R(co,co.current&1),R(to,e),no===null&&(t===null||Xa.current!==null||t.memoizedState!==null)&&(no=e)}function io(e){R(co,co.current),R(to,e),no===null&&(no=e)}function ao(e){e.tag===22?(R(co,co.current),R(to,e),no===null&&(no=e)):oo(e)}function oo(){R(co,co.current),R(to,to.current)}function so(e){L(to),no===e&&(no=null),L(co)}var co=ne(0);function lo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||cf(n)||lf(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 uo=0,H=null,fo=null,po=null,mo=!1,ho=!1,go=!1,_o=0,vo=0,yo=null,bo=0;function xo(){throw Error(i(321))}function So(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 Co(e,t,n,r,i,a){return uo=a,H=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?Bs:Vs,go=!1,a=n(r,i),go=!1,ho&&(a=To(t,n,r,i)),wo(e),a}function wo(e){P.H=zs;var t=fo!==null&&fo.next!==null;if(uo=0,po=fo=H=null,mo=!1,vo=0,yo=null,t)throw Error(i(300));e===null||ic||(e=e.dependencies,e!==null&&Zi(e)&&(ic=!0))}function To(e,t,n,r){H=e;var a=0;do{if(ho&&(yo=null),vo=0,ho=!1,25<=a)throw Error(i(301));if(a+=1,po=fo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=Hs,o=t(n,r)}while(ho);return o}function Eo(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?No(t):t,e=e.useState()[0],(fo===null?null:fo.memoizedState)!==e&&(H.flags|=1024),t}function Do(){var e=_o!==0;return _o=0,e}function Oo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ko(e){if(mo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}mo=!1}uo=0,po=fo=H=null,ho=!1,vo=_o=0,yo=null}function Ao(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return po===null?H.memoizedState=po=e:po=po.next=e,po}function jo(){if(fo===null){var e=H.alternate;e=e===null?null:e.memoizedState}else e=fo.next;var t=po===null?H.memoizedState:po.next;if(t!==null)po=t,fo=e;else{if(e===null)throw H.alternate===null?Error(i(467)):Error(i(310));fo=e,e={memoizedState:fo.memoizedState,baseState:fo.baseState,baseQueue:fo.baseQueue,queue:fo.queue,next:null},po===null?H.memoizedState=po=e:po=po.next=e}return po}function Mo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function No(e){var t=vo;return vo+=1,yo===null&&(yo=[]),e=Ta(yo,e,t),t=H,(po===null?t.memoizedState:po.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?Bs:Vs),e}function Po(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return No(e);if(e.$$typeof===x)return $i(e)}throw Error(i(438,String(e)))}function Fo(e){var t=null,n=H.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=H.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=Mo(),H.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]=O;return t.index++,n}function Io(e,t){return typeof t==`function`?t(e):t}function Lo(e){return Ro(jo(),fo,e)}function Ro(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?(uo&f)===f:(q&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ua&&(d=!0);else if((uo&p)===p){u=u.next,p===ua&&(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,H.lanes|=p,Jl|=p;f=u.action,go&&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,H.lanes|=f,Jl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!yr(o,e.memoizedState)&&(ic=!0,d&&(n=da,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 zo(e){var t=jo(),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)||(ic=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Bo(e,t,n){var r=H,a=jo(),o=V;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!yr((fo||a).memoizedState,n);if(s&&(a.memoizedState=n,ic=!0),a=a.queue,ds(Uo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||po!==null&&po.memoizedState.tag&1){if(r.flags|=2048,os(9,{destroy:void 0},Ho.bind(null,r,a,n,t),null),Bl===null)throw Error(i(349));o||uo&127||Vo(r,t,n)}return n}function Vo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=H.updateQueue,t===null?(t=Mo(),H.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ho(e,t,n,r){t.value=n,t.getSnapshot=r,Wo(t)&&Go(e)}function Uo(e,t,n){return n(function(){Wo(t)&&Go(e)})}function Wo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yr(e,n)}catch{return!0}}function Go(e){var t=ti(e,2);t!==null&&vu(t,e,2)}function Ko(e){var t=Ao();if(typeof e==`function`){var n=e;if(e=n(),go){Me(!0);try{n()}finally{Me(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:e},t}function qo(e,t,n,r){return e.baseState=n,Ro(e,fo,typeof r==`function`?r:Io)}function Jo(e,t,n,r,a){if(Is(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)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Yo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Yo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),Xo(e,t,s)}catch(n){Qo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),Xo(e,t,a)}catch(n){Qo(e,t,n)}}function Xo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Zo(e,t,n)},function(n){return Qo(e,t,n)}):Zo(e,t,n)}function Zo(e,t,n){t.status=`fulfilled`,t.value=n,$o(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Yo(e,n)))}function Qo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,$o(t),t=t.next;while(t!==r)}e.action=null}function $o(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function es(e,t){return t}function ts(e,t){if(V){var n=Bl.formState;if(n!==null){a:{var r=H;if(V){if(Mi){b:{for(var i=Mi,a=Pi;i.nodeType!==8;){if(!a){i=null;break b}if(i=df(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Mi=df(i.nextSibling),r=i.data===`F!`;break a}}Ii(r)}r=!1}r&&(t=n[0])}}return n=Ao(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:es,lastRenderedState:t},n.queue=r,n=Ns.bind(null,H,r),r.dispatch=n,r=Ko(!1),a=Fs.bind(null,H,!1,r.queue),r=Ao(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Jo.bind(null,H,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ns(e){return rs(jo(),fo,e)}function rs(e,t,n){if(t=Ro(e,t,es)[0],e=Lo(Io)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=No(t)}catch(e){throw e===ba?Sa:e}else r=t;t=jo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(H.flags|=2048,os(9,{destroy:void 0},is.bind(null,i,n),null)),[r,a,e]}function is(e,t){e.action=t}function as(e){var t=jo(),n=fo;if(n!==null)return rs(t,n,e);jo(),t=t.memoizedState,n=jo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function os(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=H.updateQueue,t===null&&(t=Mo(),H.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 ss(){return jo().memoizedState}function cs(e,t,n,r){var i=Ao();H.flags|=e,i.memoizedState=os(1|t,{destroy:void 0},n,r===void 0?null:r)}function ls(e,t,n,r){var i=jo();r=r===void 0?null:r;var a=i.memoizedState.inst;fo!==null&&r!==null&&So(r,fo.memoizedState.deps)?i.memoizedState=os(t,a,n,r):(H.flags|=e,i.memoizedState=os(1|t,a,n,r))}function us(e,t){cs(8390656,8,e,t)}function ds(e,t){ls(2048,8,e,t)}function fs(e){H.flags|=4;var t=H.updateQueue;if(t===null)t=Mo(),H.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ps(e){var t=jo().memoizedState;return fs({ref:t,nextImpl:e}),function(){if(zl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ms(e,t){return ls(4,2,e,t)}function hs(e,t){return ls(4,4,e,t)}function gs(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 _s(e,t,n){n=n==null?null:n.concat([e]),ls(4,4,gs.bind(null,t,e),n)}function vs(){}function ys(e,t){var n=jo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&So(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function bs(e,t){var n=jo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&So(t,r[1]))return r[0];if(r=e(),go){Me(!0);try{e()}finally{Me(!1)}}return n.memoizedState=[r,t],r}function xs(e,t,n){return n===void 0||uo&1073741824&&!(q&261930)?e.memoizedState=t:(e.memoizedState=n,e=_u(),H.lanes|=e,Jl|=e,n)}function Ss(e,t,n,r){return yr(n,t)?n:Xa.current===null?!(uo&42)||uo&1073741824&&!(q&261930)?(ic=!0,e.memoizedState=n):(e=_u(),H.lanes|=e,Jl|=e,t):(e=xs(e,n,r),yr(e,t)||(ic=!0),e)}function Cs(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,Fs(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ps(e,t,ma(c,r),gu(e)):Ps(e,t,r,gu(e))}catch(n){Ps(e,t,{then:function(){},status:`rejected`,reason:n},gu())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function ws(){}function Ts(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Es(e).queue;Cs(e,a,t,I,n===null?ws:function(){return Ds(e),n(r)})}function Es(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:I},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ds(e){var t=Es(e);t.next===null&&(t=e.alternate.memoizedState),Ps(e,t.next.queue,{},gu())}function Os(){return $i(ep)}function ks(){return jo().memoizedState}function As(){return jo().memoizedState}function js(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=gu();e=Va(n);var r=Ha(t,e,n);r!==null&&(vu(r,t,n),Ua(r,t,n)),t={cache:oa()},e.payload=t;return}t=t.return}}function Ms(e,t,n){var r=gu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Is(e)?Ls(t,n):(n=ei(e,t,n,r),n!==null&&(vu(n,e,r),Rs(n,t,r)))}function Ns(e,t,n){Ps(e,t,n,gu())}function Ps(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Is(e))Ls(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 $r(e,t,i,0),Bl===null&&Qr(),!1}catch{}if(n=ei(e,t,i,r),n!==null)return vu(n,e,r),Rs(n,t,r),!0}return!1}function Fs(e,t,n,r){if(r={lane:2,revertLane:md(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Is(e)){if(t)throw Error(i(479))}else t=ei(e,n,r,2),t!==null&&vu(t,e,2)}function Is(e){var t=e.alternate;return e===H||t!==null&&t===H}function Ls(e,t){ho=mo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Rs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ye(e,n)}}var zs={readContext:$i,use:Po,useCallback:xo,useContext:xo,useEffect:xo,useImperativeHandle:xo,useLayoutEffect:xo,useInsertionEffect:xo,useMemo:xo,useReducer:xo,useRef:xo,useState:xo,useDebugValue:xo,useDeferredValue:xo,useTransition:xo,useSyncExternalStore:xo,useId:xo,useHostTransitionStatus:xo,useFormState:xo,useActionState:xo,useOptimistic:xo,useMemoCache:xo,useCacheRefresh:xo};zs.useEffectEvent=xo;var Bs={readContext:$i,use:Po,useCallback:function(e,t){return Ao().memoizedState=[e,t===void 0?null:t],e},useContext:$i,useEffect:us,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),cs(4194308,4,gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return cs(4194308,4,e,t)},useInsertionEffect:function(e,t){cs(4,2,e,t)},useMemo:function(e,t){var n=Ao();t=t===void 0?null:t;var r=e();if(go){Me(!0);try{e()}finally{Me(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Ao();if(n!==void 0){var i=n(t);if(go){Me(!0);try{n(t)}finally{Me(!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=Ms.bind(null,H,e),[r.memoizedState,e]},useRef:function(e){var t=Ao();return e={current:e},t.memoizedState=e},useState:function(e){e=Ko(e);var t=e.queue,n=Ns.bind(null,H,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:vs,useDeferredValue:function(e,t){return xs(Ao(),e,t)},useTransition:function(){var e=Ko(!1);return e=Cs.bind(null,H,e.queue,!0,!1),Ao().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=H,a=Ao();if(V){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Bl===null)throw Error(i(349));q&127||Vo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,us(Uo.bind(null,r,o,e),[e]),r.flags|=2048,os(9,{destroy:void 0},Ho.bind(null,r,o,n,t),null),n},useId:function(){var e=Ao(),t=Bl.identifierPrefix;if(V){var n=Ti,r=wi;n=(r&~(1<<32-Ne(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=_o++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=bo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Os,useFormState:ts,useActionState:ts,useOptimistic:function(e){var t=Ao();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Fs.bind(null,H,!0,n),n.dispatch=t,[e,t]},useMemoCache:Fo,useCacheRefresh:function(){return Ao().memoizedState=js.bind(null,H)},useEffectEvent:function(e){var t=Ao(),n={impl:e};return t.memoizedState=n,function(){if(zl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Vs={readContext:$i,use:Po,useCallback:ys,useContext:$i,useEffect:ds,useImperativeHandle:_s,useInsertionEffect:ms,useLayoutEffect:hs,useMemo:bs,useReducer:Lo,useRef:ss,useState:function(){return Lo(Io)},useDebugValue:vs,useDeferredValue:function(e,t){return Ss(jo(),fo.memoizedState,e,t)},useTransition:function(){var e=Lo(Io)[0],t=jo().memoizedState;return[typeof e==`boolean`?e:No(e),t]},useSyncExternalStore:Bo,useId:ks,useHostTransitionStatus:Os,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){return qo(jo(),fo,e,t)},useMemoCache:Fo,useCacheRefresh:As};Vs.useEffectEvent=ps;var Hs={readContext:$i,use:Po,useCallback:ys,useContext:$i,useEffect:ds,useImperativeHandle:_s,useInsertionEffect:ms,useLayoutEffect:hs,useMemo:bs,useReducer:zo,useRef:ss,useState:function(){return zo(Io)},useDebugValue:vs,useDeferredValue:function(e,t){var n=jo();return fo===null?xs(n,e,t):Ss(n,fo.memoizedState,e,t)},useTransition:function(){var e=zo(Io)[0],t=jo().memoizedState;return[typeof e==`boolean`?e:No(e),t]},useSyncExternalStore:Bo,useId:ks,useHostTransitionStatus:Os,useFormState:as,useActionState:as,useOptimistic:function(e,t){var n=jo();return fo===null?(n.baseState=e,[e,n.queue.dispatch]):qo(n,fo,e,t)},useMemoCache:Fo,useCacheRefresh:As};Hs.useEffectEvent=ps;function Us(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:p({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ws={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=gu(),i=Va(r);i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(vu(t,e,r),Ua(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=gu(),i=Va(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(vu(t,e,r),Ua(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gu(),r=Va(n);r.tag=2,t!=null&&(r.callback=t),t=Ha(e,r,n),t!==null&&(vu(t,e,n),Ua(t,e,n))}};function Gs(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 Ks(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&&Ws.enqueueReplaceState(t,t.state,null)}function qs(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=p({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Js(e){Jr(e)}function Ys(e){console.error(e)}function Xs(e){Jr(e)}function Zs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Qs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function $s(e,t,n){return n=Va(n),n.tag=3,n.payload={element:null},n.callback=function(){Zs(e,t)},n}function ec(e){return e=Va(e),e.tag=3,e}function tc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Qs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Qs(t,n,r),typeof i!=`function`&&(ou===null?ou=new Set([this]):ou.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function nc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Xi(t,n,a,!0),n=to.current,n!==null){switch(n.tag){case 31:case 13:return no===null?Au():n.alternate===null&&ql===0&&(ql=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ca?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Yu(e,r,a)),!1;case 22:return n.flags|=65536,r===Ca?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)),Yu(e,r,a)),!1}throw Error(i(435,n.tag))}return Yu(e,r,a),Au(),!1}if(V)return t=to.current,t===null?(r!==Fi&&(t=Error(i(423),{cause:r}),Hi(gi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=gi(r,n),a=$s(e.stateNode,r,a),Wa(e,a),ql!==4&&(ql=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Fi&&(e=Error(i(422),{cause:r}),Hi(gi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=gi(o,n),$l===null?$l=[o]:$l.push(o),ql!==4&&(ql=2),t===null)return!0;r=gi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=$s(n.stateNode,r,e),Wa(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`&&(ou===null||!ou.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=ec(a),tc(a,e,n,r),Wa(n,a),!1}n=n.return}while(n!==null);return!1}var rc=Error(i(461)),ic=!1;function ac(e,t,n,r){t.child=e===null?La(t,null,n,r):Ia(t,e.child,n,r)}function oc(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 Qi(t),r=Co(e,t,n,o,a,i),s=Do(),e!==null&&!ic?(Oo(e,t,i),Ac(e,t,i)):(V&&s&&Oi(t),t.flags|=1,ac(e,t,r,i),t.child)}function sc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!si(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,cc(e,t,a,r,i)):(e=ui(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!jc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?br:n,n(o,r)&&e.ref===t.ref)return Ac(e,t,i)}return t.flags|=1,e=ci(a,r),e.ref=t.ref,e.return=t,t.child=e}function cc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(br(a,r)&&e.ref===t.ref)if(ic=!1,t.pendingProps=r=a,jc(e,i))e.flags&131072&&(ic=!0);else return t.lanes=e.lanes,Ac(e,t,i)}return gc(e,t,n,r,i)}function lc(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 dc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&va(t,a===null?null:a.cachePool),a===null?$a():Qa(t,a),ao(t);else return r=t.lanes=536870912,dc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&va(t,null),$a(),oo(t)):(va(t,a.cachePool),Qa(t,a),oo(t),t.memoizedState=null);return ac(e,t,i,n),t.child}function uc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function dc(e,t,n,r,i){var a=_a();return a=a===null?null:{parent:aa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&va(t,null),$a(),ao(t),e!==null&&Xi(e,t,r,!0),t.childLanes=i,null}function fc(e,t){return t=Tc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function pc(e,t,n){return Ia(t,e.child,null,n),e=fc(t,t.pendingProps),e.flags|=2,so(t),t.memoizedState=null,e}function mc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(V){if(r.mode===`hidden`)return e=fc(t,r),t.lanes=536870912,uc(null,e);if(io(t),(e=Mi)?(e=sf(e,Pi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ci===null?null:{id:wi,overflow:Ti},retryLane:536870912,hydrationErrors:null},n=pi(e),n.return=t,t.child=n,ji=t,Mi=null)):e=null,e===null)throw Ii(t);return t.lanes=536870912,null}return fc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(io(t),a)if(t.flags&256)t.flags&=-257,t=pc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(ic||Xi(e,t,n,!1),a=(n&e.childLanes)!==0,ic||a){if(r=Bl,r!==null&&(s=Xe(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ti(e,s),vu(r,e,s),rc;Au(),t=pc(e,t,n)}else e=o.treeContext,Mi=df(s.nextSibling),ji=t,V=!0,Ni=null,Pi=!1,e!==null&&Ai(t,e),t=fc(t,r),t.flags|=4096;return t}return e=ci(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function hc(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 gc(e,t,n,r,i){return Qi(t),n=Co(e,t,n,r,void 0,i),r=Do(),e!==null&&!ic?(Oo(e,t,i),Ac(e,t,i)):(V&&r&&Oi(t),t.flags|=1,ac(e,t,n,i),t.child)}function _c(e,t,n,r,i,a){return Qi(t),t.updateQueue=null,n=To(t,r,n,i),wo(e),r=Do(),e!==null&&!ic?(Oo(e,t,a),Ac(e,t,a)):(V&&r&&Oi(t),t.flags|=1,ac(e,t,n,a),t.child)}function vc(e,t,n,r,i){if(Qi(t),t.stateNode===null){var a=ii,o=n.contextType;typeof o==`object`&&o&&(a=$i(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ws,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},za(t),o=n.contextType,a.context=typeof o==`object`&&o?$i(o):ii,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Us(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&&Ws.enqueueReplaceState(a,a.state,null),qa(t,r,a,i),Ka(),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=qs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ii,typeof u==`object`&&u&&(o=$i(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)&&Ks(t,a,r,o),Ra=!1;var f=t.memoizedState;a.state=f,qa(t,r,a,i),Ka(),l=t.memoizedState,s||f!==l||Ra?(typeof d==`function`&&(Us(t,n,d,r),l=t.memoizedState),(c=Ra||Gs(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,Ba(e,t),o=t.memoizedProps,u=qs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ii,typeof l==`object`&&l&&(c=$i(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)&&Ks(t,a,r,c),Ra=!1,f=t.memoizedState,a.state=f,qa(t,r,a,i),Ka();var p=t.memoizedState;o!==d||f!==p||Ra||e!==null&&e.dependencies!==null&&Zi(e.dependencies)?(typeof s==`function`&&(Us(t,n,s,r),p=t.memoizedState),(u=Ra||Gs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Zi(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,hc(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=Ia(t,e.child,null,i),t.child=Ia(t,null,n,i)):ac(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ac(e,t,i),e}function yc(e,t,n,r){return Bi(),t.flags|=256,ac(e,t,n,r),t.child}var bc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xc(e){return{baseLanes:e,cachePool:ya()}}function Sc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Zl),e}function Cc(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:(co.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(V){if(a?ro(t):oo(t),(e=Mi)?(e=sf(e,Pi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ci===null?null:{id:wi,overflow:Ti},retryLane:536870912,hydrationErrors:null},n=pi(e),n.return=t,t.child=n,ji=t,Mi=null)):e=null,e===null)throw Ii(t);return lf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(oo(t),a=t.mode,c=Tc({mode:`hidden`,children:c},a),r=di(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=xc(n),r.childLanes=Sc(e,s,n),t.memoizedState=bc,uc(null,r)):(ro(t),wc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(ro(t),t.flags&=-257,t=Ec(e,t,n)):t.memoizedState===null?(oo(t),c=r.fallback,a=t.mode,r=Tc({mode:`visible`,children:r.children},a),c=di(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ia(t,e.child,null,n),r=t.child,r.memoizedState=xc(n),r.childLanes=Sc(e,s,n),t.memoizedState=bc,t=uc(null,r)):(oo(t),t.child=e.child,t.flags|=128,t=null);else if(ro(t),lf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Hi({value:r,source:null,stack:null}),t=Ec(e,t,n)}else if(ic||Xi(e,t,n,!1),s=(n&e.childLanes)!==0,ic||s){if(s=Bl,s!==null&&(r=Xe(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ti(e,r),vu(s,e,r),rc;cf(c)||Au(),t=Ec(e,t,n)}else cf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Mi=df(c.nextSibling),ji=t,V=!0,Ni=null,Pi=!1,e!==null&&Ai(t,e),t=wc(t,r.children),t.flags|=4096);return t}return a?(oo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ci(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=di(c,a,n,null),c.flags|=2):c=ci(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,uc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=xc(n):(a=c.cachePool,a===null?a=ya():(l=aa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Sc(e,s,n),t.memoizedState=bc,uc(e.child,r)):(ro(t),n=e.child,e=n.sibling,n=ci(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 wc(e,t){return t=Tc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Tc(e,t){return e=oi(22,e,null,t),e.lanes=0,e}function Ec(e,t,n){return Ia(t,e.child,null,n),e=wc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Dc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ji(e.return,t,n)}function Oc(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 kc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=co.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,R(co,o),ac(e,t,r,n),r=V?bi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Dc(e,n,t);else if(e.tag===19)Dc(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&&lo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Oc(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&&lo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Oc(t,!0,n,null,a,r);break;case`together`:Oc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ac(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Jl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Xi(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=ci(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ci(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function jc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Zi(e))):!0}function Mc(e,t,n){switch(t.tag){case 3:oe(t,t.stateNode.containerInfo),Ki(t,aa,e.memoizedState.cache),Bi();break;case 27:case 5:ce(t);break;case 4:oe(t,t.stateNode.containerInfo);break;case 10:Ki(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,io(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(ro(t),e=Ac(e,t,n),e===null?null:e.sibling):Cc(e,t,n):(ro(t),t.flags|=128,null);ro(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Xi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return kc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),R(co,co.current),r)break;return null;case 22:return t.lanes=0,lc(e,t,n,t.pendingProps);case 24:Ki(t,aa,e.memoizedState.cache)}return Ac(e,t,n)}function Nc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ic=!0;else{if(!jc(e,n)&&!(t.flags&128))return ic=!1,Mc(e,t,n);ic=!!(e.flags&131072)}else ic=!1,V&&t.flags&1048576&&Di(t,bi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ea(t.elementType),t.type=e,typeof e==`function`)si(e)?(r=qs(e,r),t.tag=1,t=vc(null,t,e,r,n)):(t.tag=0,t=gc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===S){t.tag=11,t=oc(null,t,e,r,n);break a}else if(a===T){t.tag=14,t=sc(null,t,e,r,n);break a}}throw t=M(e)||e,Error(i(306,t,``))}}return t;case 0:return gc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=qs(r,t.pendingProps),vc(e,t,r,a,n);case 3:a:{if(oe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ba(e,t),qa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ki(t,aa,r),r!==o.cache&&Yi(t,[aa],n,!0),Ka(),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=yc(e,t,r,n);break a}else if(r!==a){a=gi(Error(i(424)),t),Hi(a),t=yc(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(Mi=df(e.firstChild),ji=t,V=!0,Ni=null,Pi=!0,n=La(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Bi(),r===a){t=Ac(e,t,n);break a}ac(e,t,r,n)}t=t.child}return t;case 26:return hc(e,t),e===null?(n=Z(t.type,null,t.pendingProps,null))?t.memoizedState=n:V||(n=t.type,e=t.pendingProps,r=Wd(ie.current).createElement(n),r[nt]=t,r[rt]=e,Rd(r,n,e),ht(r),t.stateNode=r):t.memoizedState=Z(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ce(t),e===null&&V&&(r=t.stateNode=hf(t.type,t.pendingProps,ie.current),ji=t,Pi=!0,a=Mi,ef(t.type)?(ff=a,Mi=df(r.firstChild)):Mi=a),ac(e,t,t.pendingProps.children,n),hc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&V&&((a=r=Mi)&&(r=af(r,t.type,t.pendingProps,Pi),r===null?a=!1:(t.stateNode=r,ji=t,Mi=df(r.firstChild),Pi=!1,a=!0)),a||Ii(t)),ce(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,qd(a,o)?r=null:s!==null&&qd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Co(e,t,Eo,null,null,n),ep._currentValue=a),hc(e,t),ac(e,t,r,n),t.child;case 6:return e===null&&V&&((e=n=Mi)&&(n=of(n,t.pendingProps,Pi),n===null?e=!1:(t.stateNode=n,ji=t,Mi=null,e=!0)),e||Ii(t)),null;case 13:return Cc(e,t,n);case 4:return oe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ia(t,null,r,n):ac(e,t,r,n),t.child;case 11:return oc(e,t,t.type,t.pendingProps,n);case 7:return ac(e,t,t.pendingProps,n),t.child;case 8:return ac(e,t,t.pendingProps.children,n),t.child;case 12:return ac(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ki(t,t.type,r.value),ac(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Qi(t),a=$i(a),r=r(a),t.flags|=1,ac(e,t,r,n),t.child;case 14:return sc(e,t,t.type,t.pendingProps,n);case 15:return cc(e,t,t.type,t.pendingProps,n);case 19:return kc(e,t,n);case 31:return mc(e,t,n);case 22:return lc(e,t,n,t.pendingProps);case 24:return Qi(t),r=$i(aa),e===null?(a=_a(),a===null&&(a=Bl,o=oa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},za(t),Ki(t,aa,a)):((e.lanes&n)!==0&&(Ba(e,t),qa(t,null,null,n),Ka()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ki(t,aa,r),r!==a.cache&&Yi(t,[aa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ki(t,aa,r))),ac(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Pc(e){e.flags|=4}function Fc(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(Du())e.flags|=8192;else throw Da=Ca,xa}else e.flags&=-16777217}function Ic(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Kf(t))if(Du())e.flags|=8192;else throw Da=Ca,xa}function Lc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:We(),e.lanes|=t,Ql|=t)}function Rc(e,t){if(!V)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 zc(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 Bc(e,t,n){var r=t.pendingProps;switch(ki(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zc(t),null;case 1:return zc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),qi(aa),se(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(zi(t)?Pc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vi())),zc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Pc(t),o===null?(zc(t),Fc(t,a,null,r,n)):(zc(t),Ic(t,o))):o?o===e.memoizedState?(zc(t),t.flags&=-16777217):(Pc(t),zc(t),Ic(t,o)):(e=e.memoizedProps,e!==r&&Pc(t),zc(t),Fc(t,a,e,r,n)),null;case 27:if(B(t),n=ie.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return zc(t),null}e=z.current,zi(t)?Li(t,e):(e=hf(a,r,n),t.stateNode=e,Pc(t))}return zc(t),null;case 5:if(B(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return zc(t),null}if(o=z.current,zi(t))Li(t,o);else{var s=Wd(ie.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[nt]=t,o[rt]=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(Rd(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&&Pc(t)}}return zc(t),Fc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ie.current,zi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ji,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[nt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Fd(e.nodeValue,n)),e||Ii(t,!0)}else e=Wd(e).createTextNode(r),e[nt]=t,t.stateNode=e}return zc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=zi(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[nt]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;zc(t),e=!1}else n=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(so(t),t):(so(t),null);if(t.flags&128)throw Error(i(558))}return zc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=zi(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[nt]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;zc(t),a=!1}else a=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(so(t),t):(so(t),null)}return so(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),Lc(t,t.updateQueue),zc(t),null);case 4:return se(),e===null&&Td(t.stateNode.containerInfo),zc(t),null;case 10:return qi(t.type),zc(t),null;case 19:if(L(co),r=t.memoizedState,r===null)return zc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Rc(r,!1);else{if(ql!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=lo(e),o!==null){for(t.flags|=128,Rc(r,!1),e=o.updateQueue,t.updateQueue=e,Lc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)li(n,e),n=n.sibling;return R(co,co.current&1|2),V&&Ei(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&xe()>iu&&(t.flags|=128,a=!0,Rc(r,!1),t.lanes=4194304)}else{if(!a)if(e=lo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Lc(t,e),Rc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!V)return zc(t),null}else 2*xe()-r.renderingStartTime>iu&&n!==536870912&&(t.flags|=128,a=!0,Rc(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?(zc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=xe(),e.sibling=null,n=co.current,R(co,a?n&1|2:n&1),V&&Ei(t,r.treeForkCount),e);case 22:case 23:return so(t),eo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(zc(t),t.subtreeFlags&6&&(t.flags|=8192)):zc(t),n=t.updateQueue,n!==null&&Lc(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&&L(ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),qi(aa),zc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Vc(e,t){switch(ki(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qi(aa),se(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return B(t),null;case 31:if(t.memoizedState!==null){if(so(t),t.alternate===null)throw Error(i(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(so(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return L(co),null;case 4:return se(),null;case 10:return qi(t.type),null;case 22:case 23:return so(t),eo(),e!==null&&L(ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return qi(aa),null;case 25:return null;default:return null}}function Hc(e,t){switch(ki(t),t.tag){case 3:qi(aa),se();break;case 26:case 27:case 5:B(t);break;case 4:se();break;case 31:t.memoizedState!==null&&so(t);break;case 13:so(t);break;case 19:L(co);break;case 10:qi(t.type);break;case 22:case 23:so(t),eo(),e!==null&&L(ga);break;case 24:qi(aa)}}function Uc(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){Ju(t,t.return,e)}}function Wc(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){Ju(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ju(t,t.return,e)}}function Gc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ya(t,n)}catch(t){Ju(e,e.return,t)}}}function Kc(e,t,n){n.props=qs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ju(e,t,n)}}function qc(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){Ju(e,t,n)}}function Jc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Ju(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){Ju(e,t,n)}else n.current=null}function Yc(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){Ju(e,e.return,t)}}function Xc(e,t,n){try{var r=e.stateNode;zd(r,e.type,n,t),r[rt]=t}catch(t){Ju(e,e.return,t)}}function Zc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ef(e.type)||e.tag===4}function Qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Zc(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&&ef(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 $c(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=Yt));else if(r!==4&&(r===27&&ef(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function el(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&&ef(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(el(e,t,n),e=e.sibling;e!==null;)el(e,t,n),e=e.sibling}function tl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Rd(t,r,n),t[nt]=e,t[rt]=n}catch(t){Ju(e,e.return,t)}}var nl=!1,rl=!1,il=!1,al=typeof WeakSet==`function`?WeakSet:Set,ol=null;function sl(e,t){if(e=e.containerInfo,Hd=lp,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(Ud={focusedElem:e,selectionRange:n},lp=!1,ol=t;ol!==null;)if(t=ol,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,ol=e;else for(;ol!==null;){switch(t=ol,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=qs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ju(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)rf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:rf(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,ol=e;break}ol=t.return}}function cl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:xl(e,n),r&4&&Uc(5,n);break;case 1:if(xl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ju(n,n.return,e)}else{var i=qs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ju(n,n.return,e)}}r&64&&Gc(n),r&512&&qc(n,n.return);break;case 3:if(xl(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{Ya(e,t)}catch(e){Ju(n,n.return,e)}}break;case 27:t===null&&r&4&&tl(n);case 26:case 5:xl(e,n),t===null&&r&4&&Yc(n),r&512&&qc(n,n.return);break;case 12:xl(e,n);break;case 31:xl(e,n),r&4&&pl(e,n);break;case 13:xl(e,n),r&4&&ml(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Qu.bind(null,n),uf(e,n))));break;case 22:if(r=n.memoizedState!==null||nl,!r){t=t!==null&&t.memoizedState!==null||rl,i=nl;var a=rl;nl=r,(rl=t)&&!a?Cl(e,n,(n.subtreeFlags&8772)!=0):xl(e,n),nl=i,rl=a}break;case 30:break;default:xl(e,n)}}function ll(e){var t=e.alternate;t!==null&&(e.alternate=null,ll(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ut(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 U=null,ul=!1;function dl(e,t,n){for(n=n.child;n!==null;)fl(e,t,n),n=n.sibling}function fl(e,t,n){if(je&&typeof je.onCommitFiberUnmount==`function`)try{je.onCommitFiberUnmount(Ae,n)}catch{}switch(n.tag){case 26:rl||Jc(n,t),dl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:rl||Jc(n,t);var r=U,i=ul;ef(n.type)&&(U=n.stateNode,ul=!1),dl(e,t,n),gf(n.stateNode),U=r,ul=i;break;case 5:rl||Jc(n,t);case 6:if(r=U,i=ul,U=null,dl(e,t,n),U=r,ul=i,U!==null)if(ul)try{(U.nodeType===9?U.body:U.nodeName===`HTML`?U.ownerDocument.body:U).removeChild(n.stateNode)}catch(e){Ju(n,t,e)}else try{U.removeChild(n.stateNode)}catch(e){Ju(n,t,e)}break;case 18:U!==null&&(ul?(e=U,tf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Fp(e)):tf(U,n.stateNode));break;case 4:r=U,i=ul,U=n.stateNode.containerInfo,ul=!0,dl(e,t,n),U=r,ul=i;break;case 0:case 11:case 14:case 15:Wc(2,n,t),rl||Wc(4,n,t),dl(e,t,n);break;case 1:rl||(Jc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Kc(n,t,r)),dl(e,t,n);break;case 21:dl(e,t,n);break;case 22:rl=(r=rl)||n.memoizedState!==null,dl(e,t,n),rl=r;break;default:dl(e,t,n)}}function pl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Fp(e)}catch(e){Ju(t,t.return,e)}}}function ml(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Fp(e)}catch(e){Ju(t,t.return,e)}}function hl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new al),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new al),t;default:throw Error(i(435,e.tag))}}function gl(e,t){var n=hl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=$u.bind(null,e,t);t.then(r,r)}})}function _l(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(ef(c.type)){U=c.stateNode,ul=!1;break a}break;case 5:U=c.stateNode,ul=!1;break a;case 3:case 4:U=c.stateNode.containerInfo,ul=!0;break a}c=c.return}if(U===null)throw Error(i(160));fl(o,s,a),U=null,ul=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)yl(t,e),t=t.sibling}var vl=null;function yl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:_l(t,e),bl(e),r&4&&(Wc(3,e,e.return),Uc(3,e),Wc(5,e,e.return));break;case 1:_l(t,e),bl(e),r&512&&(rl||n===null||Jc(n,n.return)),r&64&&nl&&(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=vl;if(_l(t,e),bl(e),r&512&&(rl||n===null||Jc(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[lt]||o[nt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Rd(o,r,n),o[nt]=e,ht(o),r=o;break a;case`link`:var s=Uf(`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),Rd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Uf(`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),Rd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[nt]=e,ht(o),r=o}e.stateNode=r}else Wf(a,e.type,e.stateNode);else e.stateNode=Rf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Xc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Wf(a,e.type,e.stateNode):Rf(a,r,e.memoizedProps))}break;case 27:_l(t,e),bl(e),r&512&&(rl||n===null||Jc(n,n.return)),n!==null&&r&4&&Xc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(_l(t,e),bl(e),r&512&&(rl||n===null||Jc(n,n.return)),e.flags&32){a=e.stateNode;try{Vt(a,``)}catch(t){Ju(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Xc(e,a,n===null?a:n.memoizedProps)),r&1024&&(il=!0);break;case 6:if(_l(t,e),bl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ju(e,e.return,t)}}break;case 3:if(Hf=null,a=vl,vl=yf(t.containerInfo),_l(t,e),vl=a,bl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Fp(t.containerInfo)}catch(t){Ju(e,e.return,t)}il&&(il=!1,W(e));break;case 4:r=vl,vl=yf(e.stateNode.containerInfo),_l(t,e),bl(e),vl=r;break;case 12:_l(t,e),bl(e);break;case 31:_l(t,e),bl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 13:_l(t,e),bl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(nu=xe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=nl,d=rl;if(nl=u||a,rl=d||l,_l(t,e),rl=d,nl=u,bl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||nl||rl||Sl(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){Ju(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Ju(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?nf(m,!0):nf(l.stateNode,!1)}catch(e){Ju(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,gl(e,n))));break;case 19:_l(t,e),bl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,gl(e,r)));break;case 30:break;case 21:break;default:_l(t,e),bl(e)}}function bl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Zc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;el(e,Qc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Vt(o,``),n.flags&=-33),el(e,Qc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;$c(e,Qc(e),s);break;default:throw Error(i(161))}}catch(t){Ju(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function W(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;W(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function xl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)cl(e,t.alternate,t),t=t.sibling}function Sl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Wc(4,t,t.return),Sl(t);break;case 1:Jc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Kc(t,t.return,n),Sl(t);break;case 27:gf(t.stateNode);case 26:case 5:Jc(t,t.return),Sl(t);break;case 22:t.memoizedState===null&&Sl(t);break;case 30:Sl(t);break;default:Sl(t)}e=e.sibling}}function Cl(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:Cl(i,a,n),Uc(4,a);break;case 1:if(Cl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ju(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++)Ja(c[i],s)}catch(e){Ju(r,r.return,e)}}n&&o&64&&Gc(a),qc(a,a.return);break;case 27:tl(a);case 26:case 5:Cl(i,a,n),n&&r===null&&o&4&&Yc(a),qc(a,a.return);break;case 12:Cl(i,a,n);break;case 31:Cl(i,a,n),n&&o&4&&pl(i,a);break;case 13:Cl(i,a,n),n&&o&4&&ml(i,a);break;case 22:a.memoizedState===null&&Cl(i,a,n),qc(a,a.return);break;case 30:break;default:Cl(i,a,n)}t=t.sibling}}function wl(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&&sa(n))}function Tl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e))}function El(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Dl(e,t,n,r),t=t.sibling}function Dl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:El(e,t,n,r),i&2048&&Uc(9,t);break;case 1:El(e,t,n,r);break;case 3:El(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&&sa(e)));break;case 12:if(i&2048){El(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){Ju(t,t.return,e)}}else El(e,t,n,r);break;case 31:El(e,t,n,r);break;case 13:El(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?El(e,t,n,r):(a._visibility|=2,G(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?El(e,t,n,r):Ol(e,t),i&2048&&wl(o,t);break;case 24:El(e,t,n,r),i&2048&&Tl(t.alternate,t);break;default:El(e,t,n,r)}}function G(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:G(a,o,s,c,i),Uc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,G(a,o,s,c,i)):u._visibility&2?G(a,o,s,c,i):Ol(a,o),i&&l&2048&&wl(o.alternate,o);break;case 24:G(a,o,s,c,i),i&&l&2048&&Tl(o.alternate,o);break;default:G(a,o,s,c,i)}t=t.sibling}}function Ol(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:Ol(n,r),i&2048&&wl(r.alternate,r);break;case 24:Ol(n,r),i&2048&&Tl(r.alternate,r);break;default:Ol(n,r)}t=t.sibling}}var kl=8192;function Al(e,t,n){if(e.subtreeFlags&kl)for(e=e.child;e!==null;)jl(e,t,n),e=e.sibling}function jl(e,t,n){switch(e.tag){case 26:Al(e,t,n),e.flags&kl&&e.memoizedState!==null&&qf(n,vl,e.memoizedState,e.memoizedProps);break;case 5:Al(e,t,n);break;case 3:case 4:var r=vl;vl=yf(e.stateNode.containerInfo),Al(e,t,n),vl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=kl,kl=16777216,Al(e,t,n),kl=r):Al(e,t,n));break;default:Al(e,t,n)}}function Ml(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 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];ol=r,Il(r,e)}Ml(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Pl(e),e=e.sibling}function Pl(e){switch(e.tag){case 0:case 11:case 15:Nl(e),e.flags&2048&&Wc(9,e,e.return);break;case 3:Nl(e);break;case 12:Nl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fl(e)):Nl(e);break;default:Nl(e)}}function Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ol=r,Il(r,e)}Ml(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Wc(8,t,t.return),Fl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Fl(t));break;default:Fl(t)}e=e.sibling}}function Il(e,t){for(;ol!==null;){var n=ol;switch(n.tag){case 0:case 11:case 15:Wc(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:sa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ol=r;else a:for(n=e;ol!==null;){r=ol;var i=r.sibling,a=r.return;if(ll(r),r===n){ol=null;break a}if(i!==null){i.return=a,ol=i;break a}ol=a}}}var Ll={getCacheForType:function(e){var t=$i(aa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return $i(aa).controller.signal}},Rl=typeof WeakMap==`function`?WeakMap:Map,zl=0,Bl=null,K=null,q=0,Vl=0,Hl=null,Ul=!1,Wl=!1,Gl=!1,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=null,eu=null,tu=!1,nu=0,ru=0,iu=1/0,au=null,ou=null,su=0,cu=null,lu=null,uu=0,du=0,fu=null,pu=null,mu=0,hu=null;function gu(){return zl&2&&q!==0?q&-q:P.T===null?$e():md()}function _u(){if(Zl===0)if(!(q&536870912)||V){var e=Re;Re<<=1,!(Re&3932160)&&(Re=262144),Zl=e}else Zl=536870912;return e=to.current,e!==null&&(e.flags|=32),Zl}function vu(e,t,n){(e===Bl&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)&&(Tu(e,0),Su(e,q,Zl,!1)),Ke(e,n),(!(zl&2)||e!==Bl)&&(e===Bl&&(!(zl&2)&&(Yl|=n),ql===4&&Su(e,q,Zl,!1)),od(e))}function yu(e,t,n){if(zl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||He(e,t),a=r?Nu(e,t):ju(e,t,!0),o=r;do{if(a===0){Wl&&!r&&Su(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!xu(n)){a=ju(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=$l;var l=c.current.memoizedState.isDehydrated;if(l&&(Tu(c,s).flags|=256),s=ju(c,s,!1),s!==2){if(Gl&&!l){c.errorRecoveryDisabledLanes|=o,Yl|=o,a=4;break a}o=eu,eu=a,o!==null&&(eu===null?eu=o:eu.push.apply(eu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Tu(e,0),Su(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:Su(r,t,Zl,!Ul);break a;case 2:eu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=nu+300-xe(),10<a)){if(Su(r,t,Zl,!Ul),Ve(r,0,!0)!==0)break a;uu=t,r.timeoutHandle=Xd(bu.bind(null,r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,`Throttled`,-0,0),a);break a}bu(r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,null,-0,0)}}break}while(1);od(e)}function bu(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:Yt},jl(t,a,d);var m=(a&62914560)===a?nu-xe():(a&4194048)===a?ru-xe():0;if(m=Yf(d,m),m!==null){uu=a,e.cancelPendingCommit=m(Bu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Su(e,a,o,!l);return}}Bu(e,t,a,n,r,i,o,s,c)}function xu(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 Su(e,t,n,r){t&=~Xl,t&=~Yl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ne(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Je(e,n,t)}function Cu(){return zl&6?!0:(sd(0,!1),!1)}function wu(){if(K!==null){if(Vl===0)var e=K.return;else e=K,Gi=Wi=null,ko(e),Aa=null,ja=0,e=K;for(;e!==null;)Hc(e.alternate,e),e=e.return;K=null}}function Tu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Zd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),uu=0,wu(),Bl=e,K=n=ci(e.current,null),q=t,Vl=0,Hl=null,Ul=!1,Wl=He(e,t),Gl=!1,Ql=Zl=Xl=Yl=Jl=ql=0,eu=$l=null,tu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ne(r),a=1<<i;t|=e[i],r&=~a}return Kl=t,Qr(),n}function Eu(e,t){H=null,P.H=zs,t===ba||t===Sa?(t=Oa(),Vl=3):t===xa?(t=Oa(),Vl=4):Vl=t===rc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Hl=t,K===null&&(ql=1,Zs(e,gi(t,e.current)))}function Du(){var e=to.current;return e===null?!0:(q&4194048)===q?no===null:(q&62914560)===q||q&536870912?e===no:!1}function Ou(){var e=P.H;return P.H=zs,e===null?zs:e}function ku(){var e=P.A;return P.A=Ll,e}function Au(){ql=4,Ul||(q&4194048)!==q&&to.current!==null||(Wl=!0),!(Jl&134217727)&&!(Yl&134217727)||Bl===null||Su(Bl,q,Zl,!1)}function ju(e,t,n){var r=zl;zl|=2;var i=Ou(),a=ku();(Bl!==e||q!==t)&&(au=null,Tu(e,t)),t=!1;var o=ql;a:do try{if(Vl!==0&&K!==null){var s=K,c=Hl;switch(Vl){case 8:wu(),o=6;break a;case 3:case 2:case 9:case 6:to.current===null&&(t=!0);var l=Vl;if(Vl=0,Hl=null,Lu(e,s,c,l),n&&Wl){o=0;break a}break;default:l=Vl,Vl=0,Hl=null,Lu(e,s,c,l)}}Mu(),o=ql;break}catch(t){Eu(e,t)}while(1);return t&&e.shellSuspendCounter++,Gi=Wi=null,zl=r,P.H=i,P.A=a,K===null&&(Bl=null,q=0,Qr()),o}function Mu(){for(;K!==null;)Fu(K)}function Nu(e,t){var n=zl;zl|=2;var r=Ou(),a=ku();Bl!==e||q!==t?(au=null,iu=xe()+500,Tu(e,t)):Wl=He(e,t);a:do try{if(Vl!==0&&K!==null){t=K;var o=Hl;b:switch(Vl){case 1:Vl=0,Hl=null,Lu(e,t,o,1);break;case 2:case 9:if(wa(o)){Vl=0,Hl=null,Iu(t);break}t=function(){Vl!==2&&Vl!==9||Bl!==e||(Vl=7),od(e)},o.then(t,t);break a;case 3:Vl=7;break a;case 4:Vl=5;break a;case 7:wa(o)?(Vl=0,Hl=null,Iu(t)):(Vl=0,Hl=null,Lu(e,t,o,7));break;case 5:var s=null;switch(K.tag){case 26:s=K.memoizedState;case 5:case 27:var c=K;if(s?Kf(s):c.stateNode.complete){Vl=0,Hl=null;var l=c.sibling;if(l!==null)K=l;else{var u=c.return;u===null?K=null:(K=u,Ru(u))}break b}}Vl=0,Hl=null,Lu(e,t,o,5);break;case 6:Vl=0,Hl=null,Lu(e,t,o,6);break;case 8:wu(),ql=6;break a;default:throw Error(i(462))}}Pu();break}catch(t){Eu(e,t)}while(1);return Gi=Wi=null,P.H=r,P.A=a,zl=n,K===null?(Bl=null,q=0,Qr(),ql):0}function Pu(){for(;K!==null&&!ye();)Fu(K)}function Fu(e){var t=Nc(e.alternate,e,Kl);e.memoizedProps=e.pendingProps,t===null?Ru(e):K=t}function Iu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=_c(n,t,t.pendingProps,t.type,void 0,q);break;case 11:t=_c(n,t,t.pendingProps,t.type.render,t.ref,q);break;case 5:ko(t);default:Hc(n,t),t=K=li(t,Kl),t=Nc(n,t,Kl)}e.memoizedProps=e.pendingProps,t===null?Ru(e):K=t}function Lu(e,t,n,r){Gi=Wi=null,ko(t),Aa=null,ja=0;var i=t.return;try{if(nc(e,i,t,n,q)){ql=1,Zs(e,gi(n,e.current)),K=null;return}}catch(t){if(i!==null)throw K=i,t;ql=1,Zs(e,gi(n,e.current)),K=null;return}t.flags&32768?(V||r===1?e=!0:Wl||q&536870912?e=!1:(Ul=e=!0,(r===2||r===9||r===3||r===6)&&(r=to.current,r!==null&&r.tag===13&&(r.flags|=16384))),zu(t,e)):Ru(t)}function Ru(e){var t=e;do{if(t.flags&32768){zu(t,Ul);return}e=t.return;var n=Bc(t.alternate,t,Kl);if(n!==null){K=n;return}if(t=t.sibling,t!==null){K=t;return}K=t=e}while(t!==null);ql===0&&(ql=5)}function zu(e,t){do{var n=Vc(e.alternate,e);if(n!==null){n.flags&=32767,K=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){K=e;return}K=e=n}while(e!==null);ql=6,K=null}function Bu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Gu();while(su!==0);if(zl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Zr,qe(e,n,o,s,c,l),e===Bl&&(K=Bl=null,q=0),lu=t,cu=e,uu=n,du=o,fu=a,pu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,ed(Te,function(){return Ku(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=P.T,P.T=null,a=F.p,F.p=2,s=zl,zl|=4;try{sl(e,t,n)}finally{zl=s,F.p=a,P.T=r}}su=1,Vu(),Hu(),Uu()}}function Vu(){if(su===1){su=0;var e=cu,t=lu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=zl;zl|=4;try{yl(t,e);var a=Ud,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}}lp=!!Hd,Ud=Hd=null}finally{zl=i,F.p=r,P.T=n}}e.current=t,su=2}}function Hu(){if(su===2){su=0;var e=cu,t=lu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=zl;zl|=4;try{cl(e,t.alternate,t)}finally{zl=i,F.p=r,P.T=n}}su=3}}function Uu(){if(su===4||su===3){su=0,be();var e=cu,t=lu,n=uu,r=pu;t.subtreeFlags&10256||t.flags&10256?su=5:(su=0,lu=cu=null,Wu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ou=null),Qe(n),t=t.stateNode,je&&typeof je.onCommitFiberRoot==`function`)try{je.onCommitFiberRoot(Ae,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=F.p,F.p=2,P.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{P.T=t,F.p=i}}uu&3&&Gu(),od(e),i=e.pendingLanes,n&261930&&i&42?e===hu?mu++:(mu=0,hu=e):mu=0,sd(0,!1)}}function Wu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,sa(t)))}function Gu(){return Vu(),Hu(),Uu(),Ku()}function Ku(){if(su!==5)return!1;var e=cu,t=du;du=0;var n=Qe(uu),r=P.T,a=F.p;try{F.p=32>n?32:n,P.T=null,n=fu,fu=null;var o=cu,s=uu;if(su=0,lu=cu=null,uu=0,zl&6)throw Error(i(331));var c=zl;if(zl|=4,Pl(o.current),Dl(o,o.current,s,n),zl=c,sd(0,!1),je&&typeof je.onPostCommitFiberRoot==`function`)try{je.onPostCommitFiberRoot(Ae,o)}catch{}return!0}finally{F.p=a,P.T=r,Wu(e,t)}}function qu(e,t,n){t=gi(n,t),t=$s(e.stateNode,t,2),e=Ha(e,t,2),e!==null&&(Ke(e,2),od(e))}function Ju(e,t,n){if(e.tag===3)qu(e,e,n);else for(;t!==null;){if(t.tag===3){qu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ou===null||!ou.has(r))){e=gi(n,e),n=ec(2),r=Ha(t,n,2),r!==null&&(tc(n,r,t,e),Ke(r,2),od(r));break}}t=t.return}}function Yu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rl;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)||(Gl=!0,i.add(n),e=Xu.bind(null,e,t,n),t.then(e,e))}function Xu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Bl===e&&(q&n)===n&&(ql===4||ql===3&&(q&62914560)===q&&300>xe()-nu?!(zl&2)&&Tu(e,0):Xl|=n,Ql===q&&(Ql=0)),od(e)}function Zu(e,t){t===0&&(t=We()),e=ti(e,t),e!==null&&(Ke(e,t),od(e))}function Qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zu(e,n)}function $u(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),Zu(e,n)}function ed(e,t){return _e(e,t)}var td=null,J=null,nd=!1,rd=!1,id=!1,ad=0;function od(e){e!==J&&e.next===null&&(J===null?td=J=e:J=J.next=e),rd=!0,nd||(nd=!0,pd())}function sd(e,t){if(!id&&rd){id=!0;do for(var n=!1,r=td;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-Ne(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,fd(r,a))}else a=q,a=Ve(r,r===Bl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||He(r,a)||(n=!0,fd(r,a));r=r.next}while(n);id=!1}}function cd(){ld()}function ld(){rd=nd=!1;var e=0;ad!==0&&Yd()&&(e=ad);for(var t=xe(),n=null,r=td;r!==null;){var i=r.next,a=ud(r,t);a===0?(r.next=null,n===null?td=i:n.next=i,i===null&&(J=n)):(n=r,(e!==0||a&3)&&(rd=!0)),r=i}su!==0&&su!==5||sd(e,!1),ad!==0&&(ad=0)}function ud(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ne(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ue(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Bl,n=q,n=Ve(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ve(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||He(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ve(r),Qe(n)){case 2:case 8:n=we;break;case 32:n=Te;break;case 268435456:n=De;break;default:n=Te}return r=dd.bind(null,e),n=_e(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ve(r),e.callbackPriority=2,e.callbackNode=null,2}function dd(e,t){if(su!==0&&su!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Gu()&&e.callbackNode!==n)return null;var r=q;return r=Ve(e,e===Bl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(yu(e,r,t),ud(e,xe()),e.callbackNode!=null&&e.callbackNode===n?dd.bind(null,e):null)}function fd(e,t){if(Gu())return null;yu(e,t,!0)}function pd(){$d(function(){zl&6?_e(Ce,cd):ld()})}function md(){if(ad===0){var e=ua;e===0&&(e=Le,Le<<=1,!(Le&261888)&&(Le=256)),ad=e}return ad}function hd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Jt(``+e)}function gd(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 _d(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=hd((i[rt]||null).action),o=r.submitter;o&&(t=(t=o[rt]||null)?hd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new _n(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ad!==0){var e=o?gd(i,o):new FormData(i);Ts(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?gd(i,o):new FormData(i),Ts(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var vd=0;vd<Kr.length;vd++){var yd=Kr[vd];qr(yd.toLowerCase(),`on`+(yd[0].toUpperCase()+yd.slice(1)))}qr(Lr,`onAnimationEnd`),qr(Rr,`onAnimationIteration`),qr(zr,`onAnimationStart`),qr(`dblclick`,`onDoubleClick`),qr(`focusin`,`onFocus`),qr(`focusout`,`onBlur`),qr(Br,`onTransitionRun`),qr(Hr,`onTransitionStart`),qr(Ur,`onTransitionCancel`),qr(Wr,`onTransitionEnd`),yt(`onMouseEnter`,[`mouseout`,`mouseover`]),yt(`onMouseLeave`,[`mouseout`,`mouseover`]),yt(`onPointerEnter`,[`pointerout`,`pointerover`]),yt(`onPointerLeave`,[`pointerout`,`pointerover`]),vt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),vt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),vt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),vt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),vt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),vt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var bd=`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(` `),xd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(bd));function Sd(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){Jr(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){Jr(e)}i.currentTarget=null,a=c}}}}function Y(e,t){var n=t[at];n===void 0&&(n=t[at]=new Set);var r=e+`__bubble`;n.has(r)||(Ed(t,e,2,!1),n.add(r))}function Cd(e,t,n){var r=0;t&&(r|=4),Ed(n,e,r,t)}var wd=`_reactListening`+Math.random().toString(36).slice(2);function Td(e){if(!e[wd]){e[wd]=!0,gt.forEach(function(t){t!==`selectionchange`&&(xd.has(t)||Cd(t,!1,e),Cd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wd]||(t[wd]=!0,Cd(`selectionchange`,!1,t))}}function Ed(e,t,n,r){switch(gp(t)){case 2:var i=up;break;case 8:i=dp;break;default:i=fp}n=i.bind(null,t,n,e),i=void 0,!on||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 Dd(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=dt(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}nn(function(){var r=a,i=Zt(n),s=[];a:{var c=Gr.get(e);if(c!==void 0){var l=_n,u=e;switch(e){case`keypress`:if(fn(n)===0)break a;case`keydown`:case`keyup`:l=Fn;break;case`focusin`:u=`focus`,l=En;break;case`focusout`:u=`blur`,l=En;break;case`beforeblur`:case`afterblur`:l=En;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=wn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Tn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Ln;break;case Lr:case Rr:case zr:l=Dn;break;case Wr:l=Rn;break;case`scroll`:case`scrollend`:l=yn;break;case`wheel`:l=zn;break;case`copy`:case`cut`:case`paste`:l=On;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=In;break;case`toggle`:case`beforetoggle`:l=Bn}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=rn(m,p),g!=null&&d.push(Od(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!==Xt&&(u=n.relatedTarget||n.fromElement)&&(dt(u)||u[it]))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?dt(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=wn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=In,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:pt(l),h=u==null?c:pt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,dt(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=Ad,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&&jd(s,c,l,d,!1),u!==null&&f!==null&&jd(s,f,u,d,!0)}}a:{if(c=r?pt(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&&Gt(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&&Lt(c,`number`,c.value)}switch(y=r?pt(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=dn()):(cn=i,ln=`value`in cn?cn.value:cn.textContent,Zn=!0)),y=kd(r,x),0<y.length&&(x=new kn(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=kd(r,`onBeforeInput`),0<x.length&&(y=new kn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),_d(s,e,r,n,i)}Sd(s,t)})}function Od(e,t,n){return{instance:e,listener:t,currentTarget:n}}function kd(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=rn(e,n),i!=null&&r.unshift(Od(e,i,a)),i=rn(e,t),i!=null&&r.push(Od(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ad(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function jd(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=rn(n,a),l!=null&&o.unshift(Od(n,l,c))):i||(l=rn(n,a),l!=null&&o.push(Od(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Md=/\r\n?/g,Nd=/\u0000|\uFFFD/g;function Pd(e){return(typeof e==`string`?e:``+e).replace(Md,`
|
|
9
|
-
`).replace(Nd,``)}function Fd(e,t){return t=Pd(t),Pd(e)===t}function Id(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Vt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Vt(e,``+r);break;case`className`:Tt(e,`class`,r);break;case`tabIndex`:Tt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Tt(e,n,r);break;case`style`:Wt(e,r,o);break;case`data`:if(t!==`object`){Tt(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=Jt(``+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`&&Id(e,t,`name`,a.name,a,null),Id(e,t,`formEncType`,a.formEncType,a,null),Id(e,t,`formMethod`,a.formMethod,a,null),Id(e,t,`formTarget`,a.formTarget,a,null)):(Id(e,t,`encType`,a.encType,a,null),Id(e,t,`method`,a.method,a,null),Id(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Jt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`onScroll`:r!=null&&Y(`scroll`,e);break;case`onScrollEnd`:r!=null&&Y(`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=Jt(``+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`:Y(`beforetoggle`,e),Y(`toggle`,e),wt(e,`popover`,r);break;case`xlinkActuate`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:wt(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=Kt.get(n)||n,wt(e,n,r))}}function Ld(e,t,n,r,a,o){switch(n){case`style`:Wt(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`?Vt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Vt(e,``+r);break;case`onScroll`:r!=null&&Y(`scroll`,e);break;case`onScrollEnd`:r!=null&&Y(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!_t.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[rt]||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,``):wt(e,n,r)}}}function Rd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Y(`error`,e),Y(`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:Id(e,t,o,s,n,null)}}a&&Id(e,t,`srcSet`,n.srcSet,n,null),r&&Id(e,t,`src`,n.src,n,null);return;case`input`:Y(`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:Id(e,t,r,d,n,null)}}It(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Y(`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:Id(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Rt(e,!!r,n,!0):Rt(e,!!r,t,!1);return;case`textarea`:for(s in Y(`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:Id(e,t,s,c,n,null)}Bt(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:Id(e,t,l,r,n,null)}return;case`dialog`:Y(`beforetoggle`,e),Y(`toggle`,e),Y(`cancel`,e),Y(`close`,e);break;case`iframe`:case`object`:Y(`load`,e);break;case`video`:case`audio`:for(r=0;r<bd.length;r++)Y(bd[r],e);break;case`image`:Y(`error`,e),Y(`load`,e);break;case`details`:Y(`toggle`,e);break;case`embed`:case`source`:case`link`:Y(`error`,e),Y(`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:Id(e,t,u,r,n,null)}return;default:if(Gt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Ld(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Id(e,t,c,r,n,null))}function zd(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)||Id(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&&Id(e,t,p,m,r,f)}}Ft(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)||Id(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&&Id(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Rt(e,!!n,n?[]:``,!1):Rt(e,!!n,t,!0)):Rt(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:Id(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&&Id(e,t,s,a,r,o)}zt(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:Id(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:Id(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)&&Id(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:Id(e,t,u,p,r,m)}return;default:if(Gt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Ld(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||Ld(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Id(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||Id(e,t,f,p,r,m)}function Bd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Vd(){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&&Bd(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&&Bd(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 Hd=null,Ud=null;function Wd(e){return e.nodeType===9?e:e.ownerDocument}function Gd(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 Kd(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 qd(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 Jd=null;function Yd(){var e=window.event;return e&&e.type===`popstate`?e===Jd?!1:(Jd=e,!0):(Jd=null,!1)}var Xd=typeof setTimeout==`function`?setTimeout:void 0,Zd=typeof clearTimeout==`function`?clearTimeout:void 0,Qd=typeof Promise==`function`?Promise:void 0,$d=typeof queueMicrotask==`function`?queueMicrotask:Qd===void 0?Xd:function(e){return Qd.resolve(null).then(e).catch(X)};function X(e){setTimeout(function(){throw e})}function ef(e){return e===`head`}function tf(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),Fp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)gf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,gf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[lt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&gf(e.ownerDocument.body);n=i}while(n);Fp(t)}function nf(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 rf(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`:rf(n),ut(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function af(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[lt])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=df(e.nextSibling),e===null)break}return null}function of(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=df(e.nextSibling),e===null))return null;return e}function sf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=df(e.nextSibling),e===null))return null;return e}function cf(e){return e.data===`$?`||e.data===`$~`}function lf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function uf(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 df(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 ff=null;function pf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return df(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function mf(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 hf(e,t,n){switch(t=Wd(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 gf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ut(e)}var _f=new Map,vf=new Set;function yf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var bf=F.d;F.d={f:xf,r:Sf,D:Tf,C:Ef,L:Df,m:Of,X:Af,S:kf,M:jf};function xf(){var e=bf.f(),t=Cu();return e||t}function Sf(e){var t=ft(e);t!==null&&t.tag===5&&t.type===`form`?Ds(t):bf.r(e)}var Cf=typeof document>`u`?null:document;function wf(e,t,n){var r=Cf;if(r&&typeof t==`string`&&t){var i=Pt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),vf.has(i)||(vf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Rd(t,`link`,e),ht(t),r.head.appendChild(t)))}}function Tf(e){bf.D(e),wf(`dns-prefetch`,e,null)}function Ef(e,t){bf.C(e,t),wf(`preconnect`,e,t)}function Df(e,t,n){bf.L(e,t,n);var r=Cf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Pt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Pt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Pt(n.imageSizes)+`"]`)):i+=`[href="`+Pt(e)+`"]`;var a=i;switch(t){case`style`:a=Mf(e);break;case`script`:a=If(e)}_f.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),_f.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Nf(a))||t===`script`&&r.querySelector(Lf(a))||(t=r.createElement(`link`),Rd(t,`link`,e),ht(t),r.head.appendChild(t)))}}function Of(e,t){bf.m(e,t);var n=Cf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Pt(r)+`"][href="`+Pt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=If(e)}if(!_f.has(a)&&(e=p({rel:`modulepreload`,href:e},t),_f.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Lf(a)))return}r=n.createElement(`link`),Rd(r,`link`,e),ht(r),n.head.appendChild(r)}}}function kf(e,t,n){bf.S(e,t,n);var r=Cf;if(r&&e){var i=mt(r).hoistableStyles,a=Mf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Nf(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=_f.get(a))&&Bf(e,n);var c=o=r.createElement(`link`);ht(c),Rd(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,zf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Af(e,t){bf.X(e,t);var n=Cf;if(n&&e){var r=mt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=p({src:e,async:!0},t),(t=_f.get(i))&&Vf(e,t),a=n.createElement(`script`),ht(a),Rd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function jf(e,t){bf.M(e,t);var n=Cf;if(n&&e){var r=mt(n).hoistableScripts,i=If(e),a=r.get(i);a||(a=n.querySelector(Lf(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=_f.get(i))&&Vf(e,t),a=n.createElement(`script`),ht(a),Rd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Z(e,t,n,r){var a=(a=ie.current)?yf(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=Mf(n.href),n=mt(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=Mf(n.href);var o=mt(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(Nf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),_f.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},_f.set(e,n),o||Ff(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=If(n),n=mt(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 Mf(e){return`href="`+Pt(e)+`"`}function Nf(e){return`link[rel="stylesheet"][`+e+`]`}function Pf(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Ff(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}),Rd(t,`link`,n),ht(t),e.head.appendChild(t))}function If(e){return`[src="`+Pt(e)+`"]`}function Lf(e){return`script[async]`+e}function Rf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Pt(n.href)+`"]`);if(r)return t.instance=r,ht(r),r;var a=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),ht(r),Rd(r,`style`,a),zf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Mf(n.href);var o=e.querySelector(Nf(a));if(o)return t.state.loading|=4,t.instance=o,ht(o),o;r=Pf(n),(a=_f.get(a))&&Bf(r,a),o=(e.ownerDocument||e).createElement(`link`),ht(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Rd(o,`link`,r),t.state.loading|=4,zf(o,n.precedence,e),t.instance=o;case`script`:return o=If(n.src),(a=e.querySelector(Lf(o)))?(t.instance=a,ht(a),a):(r=n,(a=_f.get(o))&&(r=p({},n),Vf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),ht(a),Rd(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,zf(r,n.precedence,e));return t.instance}function zf(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 Bf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Vf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Hf=null;function Uf(e,t,n){if(Hf===null){var r=new Map,i=Hf=new Map;i.set(n,r)}else i=Hf,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[lt]||a[nt]||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 Wf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Gf(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 Kf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function qf(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=Mf(r.href),a=t.querySelector(Nf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Xf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,ht(a);return}a=t.ownerDocument||t,r=Pf(r),(i=_f.get(i))&&Bf(r,i),a=a.createElement(`link`),ht(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Rd(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=Xf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Jf=0;function Yf(e,t){return e.stylesheets&&e.count===0&&Qf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Jf===0&&(Jf=62500*Vd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Qf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Jf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Xf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zf=null;function Qf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zf=new Map,t.forEach($f,e),Zf=null,Xf.call(e))}function $f(e,t){if(!(t.state.loading&4)){var n=Zf.get(e);if(n)var r=n.get(null);else{n=new Map,Zf.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=Xf.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 ep={$$typeof:x,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function tp(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=Ge(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ge(0),this.hiddenUpdates=Ge(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 np(e,t,n,r,i,a,o,s,c,l,u,d){return e=new tp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=oi(3,null,null,t),e.current=a,a.stateNode=e,t=oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},za(a),e}function rp(e){return e?(e=ii,e):ii}function ip(e,t,n,r,i,a){i=rp(i),r.context===null?r.context=i:r.pendingContext=i,r=Va(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ha(e,r,t),n!==null&&(vu(n,e,t),Ua(n,e,t))}function ap(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function op(e,t){ap(e,t),(e=e.alternate)&&ap(e,t)}function sp(e){if(e.tag===13||e.tag===31){var t=ti(e,67108864);t!==null&&vu(t,e,67108864),op(e,67108864)}}function cp(e){if(e.tag===13||e.tag===31){var t=gu();t=Ze(t);var n=ti(e,t);n!==null&&vu(n,e,t),op(e,t)}}var lp=!0;function up(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,fp(e,t,n,r)}finally{F.p=a,P.T=i}}function dp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,fp(e,t,n,r)}finally{F.p=a,P.T=i}}function fp(e,t,n,r){if(lp){var i=pp(r);if(i===null)Dd(e,t,r,mp,n),Tp(e,r);else if(Dp(i,e,t,n,r))r.stopPropagation();else if(Tp(e,r),t&4&&-1<wp.indexOf(e)){for(;i!==null;){var a=ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Be(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ne(o);s.entanglements[1]|=c,o&=~c}od(a),!(zl&6)&&(iu=xe()+500,sd(0,!1))}}break;case 31:case 13:s=ti(a,2),s!==null&&vu(s,a,2),Cu(),op(a,2)}if(a=pp(r),a===null&&Dd(e,t,r,mp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Dd(e,t,r,null,n)}}function pp(e){return e=Zt(e),hp(e)}var mp=null;function hp(e){if(mp=null,e=dt(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 mp=e,null}function gp(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(Se()){case Ce:return 2;case we:return 8;case Te:case Ee:return 32;case De:return 268435456;default:return 32}default:return 32}}var _p=!1,vp=null,yp=null,bp=null,xp=new Map,Sp=new Map,Cp=[],wp=`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 Tp(e,t){switch(e){case`focusin`:case`focusout`:vp=null;break;case`dragenter`:case`dragleave`:yp=null;break;case`mouseover`:case`mouseout`:bp=null;break;case`pointerover`:case`pointerout`:xp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Sp.delete(t.pointerId)}}function Ep(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=ft(t),t!==null&&sp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Dp(e,t,n,r,i){switch(t){case`focusin`:return vp=Ep(vp,e,t,n,r,i),!0;case`dragenter`:return yp=Ep(yp,e,t,n,r,i),!0;case`mouseover`:return bp=Ep(bp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return xp.set(a,Ep(xp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Sp.set(a,Ep(Sp.get(a)||null,e,t,n,r,i)),!0}return!1}function Op(e){var t=dt(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,et(e.priority,function(){cp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,et(e.priority,function(){cp(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 kp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=pp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Xt=r,n.target.dispatchEvent(r),Xt=null}else return t=ft(n),t!==null&&sp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ap(e,t,n){kp(e)&&n.delete(t)}function jp(){_p=!1,vp!==null&&kp(vp)&&(vp=null),yp!==null&&kp(yp)&&(yp=null),bp!==null&&kp(bp)&&(bp=null),xp.forEach(Ap),Sp.forEach(Ap)}function Mp(e,n){e.blockedOn===n&&(e.blockedOn=null,_p||(_p=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,jp)))}var Np=null;function Pp(e){Np!==e&&(Np=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Np===e&&(Np=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(hp(r||n)===null)continue;break}var a=ft(n);a!==null&&(e.splice(t,3),t-=3,Ts(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Fp(e){function t(t){return Mp(t,e)}vp!==null&&Mp(vp,e),yp!==null&&Mp(yp,e),bp!==null&&Mp(bp,e),xp.forEach(t),Sp.forEach(t);for(var n=0;n<Cp.length;n++){var r=Cp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Cp.length&&(n=Cp[0],n.blockedOn===null);)Op(n),n.blockedOn===null&&Cp.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[rt]||null;if(typeof a==`function`)o||Pp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[rt]||null)s=o.formAction;else if(hp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Pp(n)}}}function Ip(){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 Lp(e){this._internalRoot=e}Rp.prototype.render=Lp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;ip(n,gu(),e,t,null,null)},Rp.prototype.unmount=Lp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ip(e.current,2,null,e,null,null),Cu(),t[it]=null}};function Rp(e){this._internalRoot=e}Rp.prototype.unstable_scheduleHydration=function(e){if(e){var t=$e();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cp.length&&t!==0&&t<Cp[n].priority;n++);Cp.splice(n,0,e),n===0&&Op(e)}};var zp=n.version;if(zp!==`19.2.7`)throw Error(i(527,zp,`19.2.7`));F.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:f(e),e=e===null?null:e.stateNode,e};var Bp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Vp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vp.isDisabled&&Vp.supportsFiber)try{Ae=Vp.inject(Bp),je=Vp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Js,s=Ys,c=Xs;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=np(e,1,!1,null,null,n,r,null,o,s,c,Ip),e[it]=t.current,Td(e),new Lp(t)}})),Ur=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=Hr()}))();typeof window<`u`&&window.document&&window.document.createElement;function Wr(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function Gr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Kr(...e){return t=>{let n=!1,r=e.map(e=>{let r=Gr(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():Gr(e[t],null)}}}}function qr(...e){return d.useCallback(Kr(...e),e)}function Jr(e,t=[]){let n=[];function r(t,r){let i=d.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=d.useMemo(()=>o,Object.values(o));return(0,x.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=d.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=>d.createContext(e));return function(n){let r=n?.[e]||t;return d.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Yr(i,...t)]}function Yr(...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 d.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function Xr(e){let t=d.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];ai(r)&&typeof li==`function`&&(r=li(r._payload)),d.Children.forEach(r,e=>{if(ri(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;ai(n)&&typeof li==`function`&&(n=li(n._payload)),a=ei(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=d.cloneElement(a,void 0,s):!o&&d.Children.count(r)===1&&d.isValidElement(r)&&(a=r);let c=a?ni(a):void 0,l=qr(n,c);if(!a){if(r||r===0)throw Error(o?ci(e):si(e));return r}let u=ti(i,a.props??{});return a.type!==d.Fragment&&(u.ref=n?l:c),d.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var Zr=Xr(`Slot`),Qr=Symbol.for(`radix.slottable`);function $r(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=Qr,t}var ei=(e,t)=>{if(`child`in e.props){let t=e.props.child;return d.isValidElement(t)?d.cloneElement(t,void 0,e.props.children(t.props.children)):null}return d.isValidElement(t)?t:null};function ti(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 ni(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ri(e){return d.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Qr}var ii=Symbol.for(`react.lazy`);function ai(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===ii&&`_payload`in e&&oi(e._payload)}function oi(e){return typeof e==`object`&&!!e&&`then`in e}var si=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,ci=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,li=d.use,ui=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Xr(`Primitive.${t}`),r=d.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,x.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function di(e,t){e&&Un.flushSync(()=>e.dispatchEvent(t))}function fi(e){let t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>((...e)=>t.current?.(...e)),[])}function pi(e,t=globalThis?.document){let n=fi(e);d.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 mi=`DismissableLayer`,hi=`dismissableLayer.update`,gi=`dismissableLayer.pointerDownOutside`,_i=`dismissableLayer.focusOutside`,vi,yi=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),bi=d.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=d.useContext(yi),[f,p]=d.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=d.useState({}),g=qr(t,e=>p(e)),_=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=_.indexOf(v),b=f?_.indexOf(f):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,C=b>=y,w=d.useRef(!1),T=wi(e=>{let t=e.target;if(!(t instanceof Node))return;let n=[...u.branches].some(e=>e.contains(t));!C||n||(a?.(e),s?.(e),e.defaultPrevented||c?.())},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:w,dismissableSurfaces:u.dismissableSurfaces}),E=Ti(e=>{if(r&&w.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},m);return pi(e=>{b===u.layers.size-1&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},m),d.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(vi=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Ei(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(f),u.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=vi))}},[f,m,n,u]),d.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Ei())},[f,u]),d.useEffect(()=>{let e=()=>h({});return document.addEventListener(hi,e),()=>document.removeEventListener(hi,e)},[]),(0,x.jsx)(ui.div,{...l,ref:g,style:{pointerEvents:S?C?`auto`:`none`:void 0,...e.style},onFocusCapture:Wr(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Wr(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Wr(e.onPointerDownCapture,T.onPointerDownCapture)})});bi.displayName=mi;var xi=`DismissableLayerBranch`,Si=d.forwardRef((e,t)=>{let n=d.useContext(yi),r=d.useRef(null),i=qr(t,r);return d.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,x.jsx)(ui.div,{...e,ref:i})});Si.displayName=xi;function Ci(){let e=d.useContext(yi),[t,n]=d.useState(null);return d.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}function wi(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a}=t,o=fi(e),s=d.useRef(!1),c=d.useRef(!1),l=d.useRef(new Map),u=d.useRef(()=>{});return d.useEffect(()=>{function e(){c.current=!1,i.current=!1,l.current.clear()}function t(){return Array.from(l.current.values()).some(Boolean)}function d(e){if(!c.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||l.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{c.current&&u.current()},0)}function f(e){c.current&&l.current.set(e.type,!1)}let p=a=>{if(a.target&&!s.current){let s=function(){n.removeEventListener(`click`,u.current);let r=t();e(),r||Di(gi,o,d,{discrete:!0})},d={originalEvent:a};c.current=!0,i.current=r&&a.button===0,l.current.clear(),!r||a.button!==0?s():(n.removeEventListener(`click`,u.current),u.current=s,n.addEventListener(`click`,u.current,{once:!0}))}else n.removeEventListener(`click`,u.current),e();s.current=!1},m=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of m)n.addEventListener(e,d,!0),n.addEventListener(e,f);let h=window.setTimeout(()=>{n.addEventListener(`pointerdown`,p)},0);return()=>{window.clearTimeout(h),n.removeEventListener(`pointerdown`,p),n.removeEventListener(`click`,u.current);for(let e of m)n.removeEventListener(e,d,!0),n.removeEventListener(e,f)}},[n,o,r,i,a]),{onPointerDownCapture:()=>s.current=!0}}function Ti(e,t=globalThis?.document){let n=fi(e),r=d.useRef(!1);return d.useEffect(()=>{let e=e=>{e.target&&!r.current&&Di(_i,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 Ei(){let e=new CustomEvent(hi);document.dispatchEvent(e)}function Di(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?di(i,a):i.dispatchEvent(a)}var Oi=bi,ki=Si,Ai=globalThis?.document?d.useLayoutEffect:()=>{},ji=d.useId||(()=>void 0),Mi=0;function V(e){let[t,n]=d.useState(ji());return Ai(()=>{e||n(e=>e??String(Mi++))},[e]),e||(t?`radix-${t}`:``)}var Ni=[`top`,`right`,`bottom`,`left`],Pi=Math.min,Fi=Math.max,Ii=Math.round,Li=Math.floor,Ri=e=>({x:e,y:e}),zi={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Bi(e,t,n){return Fi(e,Pi(t,n))}function Vi(e,t){return typeof e==`function`?e(t):e}function Hi(e){return e.split(`-`)[0]}function Ui(e){return e.split(`-`)[1]}function Wi(e){return e===`x`?`y`:`x`}function Gi(e){return e===`y`?`height`:`width`}function Ki(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function qi(e){return Wi(Ki(e))}function Ji(e,t,n){n===void 0&&(n=!1);let r=Ui(e),i=qi(e),a=Gi(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ra(o)),[o,ra(o)]}function Yi(e){let t=ra(e);return[Xi(e),t,Xi(t)]}function Xi(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Zi=[`left`,`right`],Qi=[`right`,`left`],$i=[`top`,`bottom`],ea=[`bottom`,`top`];function ta(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Qi:Zi:t?Zi:Qi;case`left`:case`right`:return t?$i:ea;default:return[]}}function na(e,t,n,r){let i=Ui(e),a=ta(Hi(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Xi)))),a}function ra(e){let t=Hi(e);return zi[t]+e.slice(t.length)}function ia(e){return{top:0,right:0,bottom:0,left:0,...e}}function aa(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ia(e)}function oa(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 sa(e,t,n){let{reference:r,floating:i}=e,a=Ki(t),o=qi(t),s=Gi(o),c=Hi(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(Ui(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 ca(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}=Vi(t,e),p=aa(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=oa(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=oa(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 la=50,ua=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ca},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=sa(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<la&&(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}=sa(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},da=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}=Vi(e,t)||{};if(l==null)return{};let d=aa(u),f={x:n,y:r},p=qi(i),m=Gi(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=Pi(d[_],T),D=Pi(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Bi(O,A,k),M=!c.arrow&&Ui(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),fa=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Vi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Hi(r),_=Ki(o),v=Hi(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ra(o)]:Yi(o)),x=p!==`none`;!d&&x&&b.push(...na(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=Ji(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`&&_!==Ki(t))||T.every(e=>Ki(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=Ki(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 pa(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ma(e){return Ni.some(t=>e[t]>=0)}var ha=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Vi(e,t);switch(i){case`referenceHidden`:{let e=pa(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ma(e)}}}case`escaped`:{let e=pa(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ma(e)}}}default:return{}}}}},ga=new Set([`left`,`top`]);async function _a(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Hi(n),s=Ui(n),c=Ki(n)===`y`,l=ga.has(o)?-1:1,u=a&&c?-1:1,d=Vi(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 va=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 _a(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}}}}},ya=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}=Vi(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Ki(Hi(i)),p=Wi(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=Bi(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=Bi(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}}}}}},ba=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}=Vi(e,t),u={x:n,y:r},d=Ki(i),f=Wi(d),p=u[f],m=u[d],h=Vi(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=ga.has(Hi(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}}}},xa=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}=Vi(e,t),u=await o.detectOverflow(t,l),d=Hi(i),f=Ui(i),p=Ki(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=Pi(h-u[g],v),x=Pi(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=Fi(u.left,0),t=Fi(u.right,0),n=Fi(u.top,0),r=Fi(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Fi(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Fi(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 Sa(){return typeof window<`u`}function Ca(e){return Ea(e)?(e.nodeName||``).toLowerCase():`#document`}function wa(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ta(e){return((Ea(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ea(e){return Sa()?e instanceof Node||e instanceof wa(e).Node:!1}function Da(e){return Sa()?e instanceof Element||e instanceof wa(e).Element:!1}function Oa(e){return Sa()?e instanceof HTMLElement||e instanceof wa(e).HTMLElement:!1}function ka(e){return!Sa()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof wa(e).ShadowRoot}function Aa(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Va(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ja(e){return/^(table|td|th)$/.test(Ca(e))}function Ma(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Na=/transform|translate|scale|rotate|perspective|filter/,Pa=/paint|layout|strict|content/,Fa=e=>!!e&&e!==`none`,Ia;function La(e){let t=Da(e)?Va(e):e;return Fa(t.transform)||Fa(t.translate)||Fa(t.scale)||Fa(t.rotate)||Fa(t.perspective)||!za()&&(Fa(t.backdropFilter)||Fa(t.filter))||Na.test(t.willChange||``)||Pa.test(t.contain||``)}function Ra(e){let t=Ua(e);for(;Oa(t)&&!Ba(t);){if(La(t))return t;if(Ma(t))return null;t=Ua(t)}return null}function za(){return Ia??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ia}function Ba(e){return/^(html|body|#document)$/.test(Ca(e))}function Va(e){return wa(e).getComputedStyle(e)}function Ha(e){return Da(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ua(e){if(Ca(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ka(e)&&e.host||Ta(e);return ka(t)?t.host:t}function Wa(e){let t=Ua(e);return Ba(t)?e.ownerDocument?e.ownerDocument.body:e.body:Oa(t)&&Aa(t)?t:Wa(t)}function Ga(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Wa(e),i=r===e.ownerDocument?.body,a=wa(r);if(i){let e=Ka(a);return t.concat(a,a.visualViewport||[],Aa(r)?r:[],e&&n?Ga(e):[])}else return t.concat(r,Ga(r,[],n))}function Ka(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qa(e){let t=Va(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Oa(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ii(n)!==a||Ii(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ja(e){return Da(e)?e:e.contextElement}function Ya(e){let t=Ja(e);if(!Oa(t))return Ri(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=qa(t),o=(a?Ii(n.width):n.width)/r,s=(a?Ii(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Xa=Ri(0);function Za(e){let t=wa(e);return!za()||!t.visualViewport?Xa:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Qa(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==wa(e)?!1:t}function $a(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ja(e),o=Ri(1);t&&(r?Da(r)&&(o=Ya(r)):o=Ya(e));let s=Qa(a,n,r)?Za(a):Ri(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=wa(a),t=r&&Da(r)?wa(r):r,n=e,i=Ka(n);for(;i&&r&&t!==n;){let e=Ya(i),t=i.getBoundingClientRect(),r=Va(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=wa(i),i=Ka(n)}}return oa({width:u,height:d,x:c,y:l})}function eo(e,t){let n=Ha(e).scrollLeft;return t?t.left+n:$a(Ta(e)).left+n}function to(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-eo(e,n),y:n.top+t.scrollTop}}function no(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ta(r),s=t?Ma(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ri(1),u=Ri(0),d=Oa(r);if((d||!d&&!a)&&((Ca(r)!==`body`||Aa(o))&&(c=Ha(r)),d)){let e=$a(r);l=Ya(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?to(o,c):Ri(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 ro(e){return Array.from(e.getClientRects())}function io(e){let t=Ta(e),n=Ha(e),r=e.ownerDocument.body,i=Fi(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Fi(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+eo(e),s=-n.scrollTop;return Va(r).direction===`rtl`&&(o+=Fi(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var ao=25;function oo(e,t){let n=wa(e),r=Ta(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=za();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=eo(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<=ao&&(a-=o)}else l<=ao&&(a+=l);return{width:a,height:o,x:s,y:c}}function so(e,t){let n=$a(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Oa(e)?Ya(e):Ri(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function co(e,t,n){let r;if(t===`viewport`)r=oo(e,n);else if(t===`document`)r=io(Ta(e));else if(Da(t))r=so(t,n);else{let n=Za(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return oa(r)}function lo(e,t){let n=Ua(e);return n===t||!Da(n)||Ba(n)?!1:Va(n).position===`fixed`||lo(n,t)}function uo(e,t){let n=t.get(e);if(n)return n;let r=Ga(e,[],!1).filter(e=>Da(e)&&Ca(e)!==`body`),i=null,a=Va(e).position===`fixed`,o=a?Ua(e):e;for(;Da(o)&&!Ba(o);){let t=Va(o),n=La(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Aa(o)&&!n&&lo(e,o))?r=r.filter(e=>e!==o):i=t,o=Ua(o)}return t.set(e,r),r}function H(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ma(t)?[]:uo(t,this._c):[].concat(n),r],o=co(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=co(t,a[e],i);s=Fi(n.top,s),c=Pi(n.right,c),l=Pi(n.bottom,l),u=Fi(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function fo(e){let{width:t,height:n}=qa(e);return{width:t,height:n}}function po(e,t,n){let r=Oa(t),i=Ta(t),a=n===`fixed`,o=$a(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ri(0);function l(){c.x=eo(i)}if(r||!r&&!a)if((Ca(t)!==`body`||Aa(i))&&(s=Ha(t)),r){let e=$a(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?to(i,s):Ri(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 mo(e){return Va(e).position===`static`}function ho(e,t){if(!Oa(e)||Va(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Ta(e)===n&&(n=n.ownerDocument.body),n}function go(e,t){let n=wa(e);if(Ma(e))return n;if(!Oa(e)){let t=Ua(e);for(;t&&!Ba(t);){if(Da(t)&&!mo(t))return t;t=Ua(t)}return n}let r=ho(e,t);for(;r&&ja(r)&&mo(r);)r=ho(r,t);return r&&Ba(r)&&mo(r)&&!La(r)?n:r||Ra(e)||n}var _o=async function(e){let t=this.getOffsetParent||go,n=this.getDimensions,r=await n(e.floating);return{reference:po(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function vo(e){return Va(e).direction===`rtl`}var yo={convertOffsetParentRelativeRectToViewportRelativeRect:no,getDocumentElement:Ta,getClippingRect:H,getOffsetParent:go,getElementRects:_o,getClientRects:ro,getDimensions:fo,getScale:Ya,isElement:Da,isRTL:vo};function bo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xo(e,t){let n=null,r,i=Ta(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=Li(d),h=Li(i.clientWidth-(u+f)),g=Li(i.clientHeight-(d+p)),_=Li(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Fi(0,Pi(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&&!bo(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 So(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=Ja(e),u=i||a?[...l?Ga(l):[],...t?Ga(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?xo(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?$a(e):null;c&&g();function g(){let t=$a(e);h&&!bo(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 Co=va,wo=ya,To=fa,Eo=xa,Do=ha,Oo=da,ko=ba,Ao=(e,t,n)=>{let r=new Map,i={platform:yo,...n},a={...i.platform,_c:r};return ua(e,t,{...i,platform:a})},jo=typeof document<`u`?d.useLayoutEffect:function(){};function Mo(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(!Mo(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)&&!Mo(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function No(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Po(e,t){let n=No(e);return Math.round(t*n)/n}function Fo(e){let t=d.useRef(e);return jo(()=>{t.current=e}),t}function Io(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,f]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=d.useState(r);Mo(p,r)||m(r);let[h,g]=d.useState(null),[_,v]=d.useState(null),y=d.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=d.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=d.useRef(null),w=d.useRef(null),T=d.useRef(u),E=c!=null,D=Fo(c),O=Fo(i),k=Fo(l),A=d.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),Ao(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Mo(T.current,t)&&(T.current=t,Un.flushSync(()=>{f(t)}))})},[p,t,n,O,k]);jo(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);let j=d.useRef(!1);jo(()=>(j.current=!0,()=>{j.current=!1}),[]),jo(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=d.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=d.useMemo(()=>({reference:x,floating:S}),[x,S]),P=d.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Po(N.floating,u.x),r=Po(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...No(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return d.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Lo=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?{}:Oo({element:r.current,padding:i}).fn(n):r?Oo({element:r,padding:i}).fn(n):{}}}},Ro=(e,t)=>{let n=Co(e);return{name:n.name,fn:n.fn,options:[e,t]}},zo=(e,t)=>{let n=wo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bo=(e,t)=>({fn:ko(e).fn,options:[e,t]}),Vo=(e,t)=>{let n=To(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ho=(e,t)=>{let n=Eo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Uo=(e,t)=>{let n=Do(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wo=(e,t)=>{let n=Lo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Go=`Arrow`,Ko=d.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,x.jsx)(ui.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,x.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Ko.displayName=Go;var qo=Ko;function Jo(e){let[t,n]=d.useState(void 0);return Ai(()=>{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 Yo=`Popper`,[Xo,Zo]=Jr(Yo),[Qo,$o]=Xo(Yo),es=e=>{let{__scopePopper:t,children:n}=e,[r,i]=d.useState(null),[a,o]=d.useState(void 0);return(0,x.jsx)(Qo,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};es.displayName=Yo;var ts=`PopperAnchor`,ns=d.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=$o(ts,n),o=d.useRef(null),s=a.onAnchorChange,c=qr(t,d.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=d.useRef(null);d.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&fs(a.placementState),f=u?.[0],p=u?.[1];return r?null:(0,x.jsx)(ui.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:c})});ns.displayName=ts;var rs=`PopperContent`,[is,as]=Xo(rs),os=d.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:f=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:m=`optimized`,onPlaced:h,...g}=e,_=$o(rs,n),[v,y]=d.useState(null),b=qr(t,e=>y(e)),[S,C]=d.useState(null),w=Jo(S),T=w?.width??0,E=w?.height??0,D=r+(a===`center`?``:`-`+a),O=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},k=Array.isArray(l)?l:[l],A=k.length>0,j={padding:O,boundary:k.filter(us),altBoundary:A},{refs:M,floatingStyles:N,placement:P,isPositioned:F,middlewareData:I}=Io({strategy:`fixed`,placement:D,whileElementsMounted:(...e)=>So(...e,{animationFrame:m===`always`}),elements:{reference:_.anchor},middleware:[Ro({mainAxis:i+E,alignmentAxis:o}),c&&zo({mainAxis:!0,crossAxis:!1,limiter:f===`partial`?Bo():void 0,...j}),c&&Vo({...j}),Ho({...j,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`)}}),S&&Wo({element:S,padding:s}),ds({arrowWidth:T,arrowHeight:E}),p&&Uo({strategy:`referenceHidden`,...j,boundary:A?j.boundary:void 0})]}),ee=_.setPlacementState;Ai(()=>(ee(P),()=>{ee(void 0)}),[P,ee]);let[te,ne]=fs(P),L=fi(h);Ai(()=>{F&&L?.()},[F,L]);let R=I.arrow?.x,z=I.arrow?.y,re=I.arrow?.centerOffset!==0,[ie,ae]=d.useState();return Ai(()=>{v&&ae(window.getComputedStyle(v).zIndex)},[v]),(0,x.jsx)(`div`,{ref:M.setFloating,"data-radix-popper-content-wrapper":``,style:{...N,transform:F?N.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ie,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(` `),...I.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,x.jsx)(is,{scope:n,placedSide:te,placedAlign:ne,onArrowChange:C,arrowX:R,arrowY:z,shouldHideArrow:re,children:(0,x.jsx)(ui.div,{"data-side":te,"data-align":ne,...g,ref:b,style:{...g.style,animation:F?void 0:`none`}})})})});os.displayName=rs;var ss=`PopperArrow`,cs={top:`bottom`,right:`left`,bottom:`top`,left:`right`},ls=d.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=as(ss,n),a=cs[i.placedSide];return(0,x.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,x.jsx)(qo,{...r,ref:t,style:{...r.style,display:`block`}})})});ls.displayName=ss;function us(e){return e!==null}var ds=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]=fs(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 fs(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var ps=es,ms=ns,hs=os,gs=ls,_s=`Portal`,vs=d.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=d.useState(!1);Ai(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Un.createPortal((0,x.jsx)(ui.div,{...r,ref:t}),o):null});vs.displayName=_s;function ys(e,t){return d.useReducer((e,n)=>t[e][n]??e,e)}var bs=e=>{let{present:t,children:n}=e,r=xs(t),i=typeof n==`function`?n({present:r.isPresent}):d.Children.only(n),a=Cs(r.ref,Ts(i));return typeof n==`function`||r.isPresent?d.cloneElement(i,{ref:a}):null};bs.displayName=`Presence`;function xs(e){let[t,n]=d.useState(),r=d.useRef(null),i=d.useRef(e),a=d.useRef(`none`),[o,s]=ys(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return d.useEffect(()=>{let e=ws(r.current);a.current=o===`mounted`?e:`none`},[o]),Ai(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=ws(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Ai(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=ws(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=ws(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:d.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Ss(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Cs(...e){let t=d.useRef(e);return t.current=e,d.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Ss(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Ss(n[e],null)}}},[])}function ws(e){return e?.animationName||`none`}function Ts(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 Es=d.useInsertionEffect||Ai;function Ds({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Os({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=d.useRef(e!==void 0);d.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,d.useCallback(t=>{if(s){let n=ks(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Os({defaultProp:e,onChange:t}){let[n,r]=d.useState(e),i=d.useRef(n),a=d.useRef(t);return Es(()=>{a.current=t},[t]),d.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function ks(e){return typeof e==`function`}var As=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),js=`VisuallyHidden`,Ms=d.forwardRef((e,t)=>(0,x.jsx)(ui.span,{...e,ref:t,style:{...As,...e.style}}));Ms.displayName=js;var Ns=Ms,[Ps,Fs]=Jr(`Tooltip`,[Zo]),Is=Zo(),Ls=`TooltipProvider`,Rs=700,zs=`tooltip.open`,[Bs,Vs]=Ps(Ls),Hs=e=>{let{__scopeTooltip:t,delayDuration:n=Rs,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=d.useRef(!0),s=d.useRef(!1),c=d.useRef(0);return d.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,x.jsx)(Bs,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:d.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:d.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:d.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};Hs.displayName=Ls;var Us=`Tooltip`,[Ws,Gs]=Ps(Us),Ks=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Vs(Us,e.__scopeTooltip),l=Is(t),[u,f]=d.useState(null),p=V(),m=d.useRef(0),h=o??c.disableHoverableContent,g=s??c.delayDuration,_=d.useRef(!1),[v,y]=Ds({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(zs))):c.onClose(),a?.(e)},caller:Us}),b=d.useMemo(()=>v?_.current?`delayed-open`:`instant-open`:`closed`,[v]),S=d.useCallback(()=>{window.clearTimeout(m.current),m.current=0,_.current=!1,y(!0)},[y]),C=d.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y(!1)},[y]),w=d.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{_.current=!0,y(!0),m.current=0},g)},[g,y]);return d.useEffect(()=>()=>{m.current&&=(window.clearTimeout(m.current),0)},[]),(0,x.jsx)(ps,{...l,children:(0,x.jsx)(Ws,{scope:t,contentId:p,open:v,stateAttribute:b,trigger:u,onTriggerChange:f,onTriggerEnter:d.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:d.useCallback(()=>{h?C():(window.clearTimeout(m.current),m.current=0)},[C,h]),onOpen:S,onClose:C,disableHoverableContent:h,children:n})})};Ks.displayName=Us;var qs=`TooltipTrigger`,Js=d.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Gs(qs,n),a=Vs(qs,n),o=Is(n),s=qr(t,d.useRef(null),i.onTriggerChange),c=d.useRef(!1),l=d.useRef(!1),u=d.useCallback(()=>c.current=!1,[]);return d.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,x.jsx)(ms,{asChild:!0,...o,children:(0,x.jsx)(ui.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:Wr(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:Wr(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:Wr(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:Wr(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Wr(e.onBlur,i.onClose),onClick:Wr(e.onClick,i.onClose)})})});Js.displayName=qs;var Ys=`TooltipPortal`,[Xs,Zs]=Ps(Ys,{forceMount:void 0}),Qs=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Gs(Ys,t);return(0,x.jsx)(Xs,{scope:t,forceMount:n,children:(0,x.jsx)(bs,{present:n||a.open,children:(0,x.jsx)(vs,{asChild:!0,container:i,children:r})})})};Qs.displayName=Ys;var $s=`TooltipContent`,ec=d.forwardRef((e,t)=>{let n=Zs($s,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Gs($s,e.__scopeTooltip);return(0,x.jsx)(bs,{present:r||o.open,children:o.disableHoverableContent?(0,x.jsx)(ac,{side:i,...a,ref:t}):(0,x.jsx)(tc,{side:i,...a,ref:t})})}),tc=d.forwardRef((e,t)=>{let n=Gs($s,e.__scopeTooltip),r=Vs($s,e.__scopeTooltip),i=d.useRef(null),a=qr(t,i),[o,s]=d.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:f}=r,p=d.useCallback(()=>{s(null),f(!1)},[f]),m=d.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=lc(r,cc(r,n.getBoundingClientRect())),a=uc(t.getBoundingClientRect());s(fc([...i,...a])),f(!0)},[f]);return d.useEffect(()=>()=>p(),[p]),d.useEffect(()=>{if(c&&u){let e=e=>m(e,u),t=e=>m(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,m,p]),d.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!dc(n,o);r?p():i&&(p(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,p]),(0,x.jsx)(ac,{...e,ref:a})}),[nc,rc]=Ps(Us,{isInside:!1}),ic=$r(`TooltipContent`),ac=d.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=Gs($s,n),l=Is(n),{onClose:u}=c;return d.useEffect(()=>(document.addEventListener(zs,u),()=>document.removeEventListener(zs,u)),[u]),d.useEffect(()=>{if(c.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,x.jsx)(bi,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,x.jsxs)(hs,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,x.jsx)(ic,{children:r}),(0,x.jsx)(nc,{scope:n,isInside:!0,children:(0,x.jsx)(Ns,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});ec.displayName=$s;var oc=`TooltipArrow`,sc=d.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Is(n);return rc(oc,n).isInside?null:(0,x.jsx)(gs,{...i,...r,ref:t})});sc.displayName=oc;function cc(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function lc(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function uc(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function dc(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 fc(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),pc(t)}function pc(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var mc=Hs,hc=Ks,gc=Js,_c=Qs,vc=ec;function yc(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=yc(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function bc(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=yc(e))&&(r&&(r+=` `),r+=t);return r}var xc=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Sc=(e,t)=>({classGroupId:e,validator:t}),Cc=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),wc=`-`,Tc=[],Ec=`arbitrary..`,Dc=e=>{let t=Ac(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return kc(e);let n=e.split(wc);return Oc(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?xc(i,t):t:i||Tc}return n[e]||Tc}}},Oc=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Oc(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(wc):e.slice(t).join(wc),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},kc=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Ec+r:void 0})(),Ac=e=>{let{theme:t,classGroups:n}=e;return jc(n,t)},jc=(e,t)=>{let n=Cc();for(let r in e){let i=e[r];Mc(i,n,r,t)}return n},Mc=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Nc(i,t,n,r)}},Nc=(e,t,n,r)=>{if(typeof e==`string`){Pc(e,t,n);return}if(typeof e==`function`){Fc(e,t,n,r);return}Ic(e,t,n,r)},Pc=(e,t,n)=>{let r=e===``?t:Lc(t,e);r.classGroupId=n},Fc=(e,t,n,r)=>{if(Rc(e)){Mc(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Sc(n,e))},Ic=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Mc(o,Lc(t,a),n,r)}},Lc=(e,t)=>{let n=e,r=t.split(wc),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Cc(),n.nextPart.set(t,i)),n=i}return n},Rc=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,zc=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Bc=`!`,Vc=`:`,Hc=[],Uc=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Wc=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Vc){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Bc)?(c=s.slice(0,-1),l=!0):s.startsWith(Bc)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Uc(t,l,c,u)};if(t){let e=t+Vc,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Uc(Hc,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Gc=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Kc=e=>({cache:zc(e.cacheSize),parseClassName:Wc(e),sortModifiers:Gc(e),postfixLookupClassGroupIds:qc(e),...Dc(e)}),qc=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Jc=/\s+/,Yc=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Jc),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Bc:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Xc=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Zc(n))&&(i&&(i+=` `),i+=r);return i},Zc=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Zc(e[r]))&&(n&&(n+=` `),n+=t);return n},Qc=(e,...t)=>{let n,r,i,a,o=o=>(n=Kc(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Yc(e,n);return i(e,a),a};return a=o,(...e)=>a(Xc(...e))},$c=[],el=e=>{let t=t=>t[e]||$c;return t.isThemeGetter=!0,t},tl=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,nl=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rl=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,il=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,al=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ol=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,sl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ll=e=>rl.test(e),U=e=>!!e&&!Number.isNaN(Number(e)),ul=e=>!!e&&Number.isInteger(Number(e)),dl=e=>e.endsWith(`%`)&&U(e.slice(0,-1)),fl=e=>il.test(e),pl=()=>!0,ml=e=>al.test(e)&&!ol.test(e),hl=()=>!1,gl=e=>sl.test(e),_l=e=>cl.test(e),vl=e=>!W(e)&&!G(e),yl=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),bl=e=>Fl(e,zl,hl),W=e=>tl.test(e),xl=e=>Fl(e,Bl,ml),Sl=e=>Fl(e,K,U),Cl=e=>Fl(e,Vl,pl),wl=e=>Fl(e,q,hl),Tl=e=>Fl(e,Ll,hl),El=e=>Fl(e,Rl,_l),Dl=e=>Fl(e,Hl,gl),G=e=>nl.test(e),Ol=e=>Il(e,Bl),kl=e=>Il(e,q),Al=e=>Il(e,Ll),jl=e=>Il(e,zl),Ml=e=>Il(e,Rl),Nl=e=>Il(e,Hl,!0),Pl=e=>Il(e,Vl,!0),Fl=(e,t,n)=>{let r=tl.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Il=(e,t,n=!1)=>{let r=nl.exec(e);return r?r[1]?t(r[1]):n:!1},Ll=e=>e===`position`||e===`percentage`,Rl=e=>e===`image`||e===`url`,zl=e=>e===`length`||e===`size`||e===`bg-size`,Bl=e=>e===`length`,K=e=>e===`number`,q=e=>e===`family-name`,Vl=e=>e===`number`||e===`weight`,Hl=e=>e===`shadow`,Ul=Qc(()=>{let e=el(`color`),t=el(`font`),n=el(`text`),r=el(`font-weight`),i=el(`tracking`),a=el(`leading`),o=el(`breakpoint`),s=el(`container`),c=el(`spacing`),l=el(`radius`),u=el(`shadow`),d=el(`inset-shadow`),f=el(`text-shadow`),p=el(`drop-shadow`),m=el(`blur`),h=el(`perspective`),g=el(`aspect`),_=el(`ease`),v=el(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),G,W],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[G,W,c],T=()=>[ll,`full`,`auto`,...w()],E=()=>[ul,`none`,`subgrid`,G,W],D=()=>[`auto`,{span:[`full`,ul,G,W]},ul,G,W],O=()=>[ul,`auto`,G,W],k=()=>[`auto`,`min`,`max`,`fr`,G,W],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[ll,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[ll,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[ll,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,G,W],ee=()=>[...b(),Al,Tl,{position:[G,W]}],te=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ne=()=>[`auto`,`cover`,`contain`,jl,bl,{size:[G,W]}],L=()=>[dl,Ol,xl],R=()=>[``,`none`,`full`,l,G,W],z=()=>[``,U,Ol,xl],re=()=>[`solid`,`dashed`,`dotted`,`double`],ie=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ae=()=>[U,dl,Al,Tl],oe=()=>[``,`none`,m,G,W],se=()=>[`none`,U,G,W],ce=()=>[`none`,U,G,W],B=()=>[U,G,W],le=()=>[ll,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[fl],breakpoint:[fl],color:[pl],container:[fl],"drop-shadow":[fl],ease:[`in`,`out`,`in-out`],font:[vl],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[fl],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[fl],shadow:[fl],spacing:[`px`,U],text:[fl],"text-shadow":[fl],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,ll,W,G,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,G,W]}],"container-named":[yl],columns:[{columns:[U,W,G,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[ul,`auto`,G,W]}],basis:[{basis:[ll,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[U,ll,`auto`,`initial`,`none`,W]}],grow:[{grow:[``,U,G,W]}],shrink:[{shrink:[``,U,G,W]}],order:[{order:[ul,`first`,`last`,`none`,G,W]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,Ol,xl]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Pl,Cl]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,dl,W]}],"font-family":[{font:[kl,wl,t]}],"font-features":[{"font-features":[W]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,G,W]}],"line-clamp":[{"line-clamp":[U,`none`,G,Sl]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,G,W]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,G,W]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...re(),`wavy`]}],"text-decoration-thickness":[{decoration:[U,`from-font`,`auto`,G,xl]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[U,`auto`,G,W]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[ul,G,W]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,G,W]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,G,W]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ee()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:ne()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},ul,G,W],radial:[``,G,W],conic:[ul,G,W]},Ml,El]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:L()}],"gradient-via-pos":[{via:L()}],"gradient-to-pos":[{to:L()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:R()}],"rounded-s":[{"rounded-s":R()}],"rounded-e":[{"rounded-e":R()}],"rounded-t":[{"rounded-t":R()}],"rounded-r":[{"rounded-r":R()}],"rounded-b":[{"rounded-b":R()}],"rounded-l":[{"rounded-l":R()}],"rounded-ss":[{"rounded-ss":R()}],"rounded-se":[{"rounded-se":R()}],"rounded-ee":[{"rounded-ee":R()}],"rounded-es":[{"rounded-es":R()}],"rounded-tl":[{"rounded-tl":R()}],"rounded-tr":[{"rounded-tr":R()}],"rounded-br":[{"rounded-br":R()}],"rounded-bl":[{"rounded-bl":R()}],"border-w":[{border:z()}],"border-w-x":[{"border-x":z()}],"border-w-y":[{"border-y":z()}],"border-w-s":[{"border-s":z()}],"border-w-e":[{"border-e":z()}],"border-w-bs":[{"border-bs":z()}],"border-w-be":[{"border-be":z()}],"border-w-t":[{"border-t":z()}],"border-w-r":[{"border-r":z()}],"border-w-b":[{"border-b":z()}],"border-w-l":[{"border-l":z()}],"divide-x":[{"divide-x":z()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":z()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...re(),`hidden`,`none`]}],"divide-style":[{divide:[...re(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...re(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[U,G,W]}],"outline-w":[{outline:[``,U,Ol,xl]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,Nl,Dl]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,Nl,Dl]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:z()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[U,xl]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":z()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,Nl,Dl]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[U,G,W]}],"mix-blend":[{"mix-blend":[...ie(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ie()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[U]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[G,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[U]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ee()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:ne()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,G,W]}],filter:[{filter:[``,`none`,G,W]}],blur:[{blur:oe()}],brightness:[{brightness:[U,G,W]}],contrast:[{contrast:[U,G,W]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Nl,Dl]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,U,G,W]}],"hue-rotate":[{"hue-rotate":[U,G,W]}],invert:[{invert:[``,U,G,W]}],saturate:[{saturate:[U,G,W]}],sepia:[{sepia:[``,U,G,W]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,G,W]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[U,G,W]}],"backdrop-contrast":[{"backdrop-contrast":[U,G,W]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,U,G,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[U,G,W]}],"backdrop-invert":[{"backdrop-invert":[``,U,G,W]}],"backdrop-opacity":[{"backdrop-opacity":[U,G,W]}],"backdrop-saturate":[{"backdrop-saturate":[U,G,W]}],"backdrop-sepia":[{"backdrop-sepia":[``,U,G,W]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,G,W]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[U,`initial`,G,W]}],ease:[{ease:[`linear`,`initial`,_,G,W]}],delay:[{delay:[U,G,W]}],animate:[{animate:[`none`,v,G,W]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,G,W]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":[`scale-3d`],skew:[{skew:B()}],"skew-x":[{"skew-x":B()}],"skew-y":[{"skew-y":B()}],transform:[{transform:[G,W,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":[`translate-none`],zoom:[{zoom:[ul,G,W]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,G,W]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,G,W]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[U,Ol,xl,Sl]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Wl(...e){return Ul(bc(e))}var Gl=mc,Kl=(0,d.forwardRef)(function({className:e,sideOffset:t=6,...n},r){return(0,x.jsx)(_c,{children:(0,x.jsx)(vc,{ref:r,sideOffset:t,className:Wl(`z-50 overflow-hidden rounded-lg bg-foreground px-2 py-1 text-xs font-medium text-background shadow-subtle-sm animate-in fade-in-0 zoom-in-95`,e),...n})})});function ql({children:e,content:t,side:n=`top`,sideOffset:r}){return t?(0,x.jsxs)(hc,{delayDuration:120,children:[(0,x.jsx)(gc,{asChild:!0,children:e}),(0,x.jsx)(Kl,{side:n,sideOffset:r,children:t})]}):e}function Jl(e){let t=e+`CollectionProvider`,[n,r]=Jr(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=d.useRef(null),a=d.useRef(new Map).current;return(0,x.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Xr(s),l=d.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,x.jsx)(c,{ref:qr(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=Xr(u),m=d.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=d.useRef(null),s=qr(t,o),c=a(u,n);return d.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,x.jsx)(p,{[f]:``,ref:s,children:r})});m.displayName=u;function h(t){let n=a(e+`CollectionConsumer`,t);return d.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));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:m},h,r]}var Yl=`ToastProvider`,[Xl,Zl,Ql]=Jl(`Toast`),[$l,eu]=Jr(`Toast`,[Ql]),[tu,nu]=$l(Yl),ru=e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,announcerContainer:o,children:s}=e,[c,l]=d.useState(null),[u,f]=d.useState(0),p=d.useRef(!1),m=d.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Yl}\`. Expected non-empty \`string\`.`),(0,x.jsx)(Xl.Provider,{scope:t,children:(0,x.jsx)(tu,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:u,viewport:c,onViewportChange:l,onToastAdd:d.useCallback(()=>f(e=>e+1),[]),onToastRemove:d.useCallback(()=>f(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:m,announcerContainer:o,children:s})})};ru.displayName=Yl;var iu=`ToastViewport`,au=[`F8`],ou=`toast.viewportPause`,su=`toast.viewportResume`,cu=d.forwardRef((e,t)=>{let{__scopeToast:n,hotkey:r=au,label:i=`Notifications ({hotkey})`,...a}=e,o=nu(iu,n),s=Zl(n),c=d.useRef(null),l=d.useRef(null),u=d.useRef(null),f=d.useRef(null),p=qr(t,f,o.onViewportChange),m=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),h=o.toastCount>0;d.useEffect(()=>{let e=e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&f.current?.focus()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),d.useEffect(()=>{let e=c.current,t=f.current;if(h&&e&&t){let n=()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(ou);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},r=()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(su);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},i=t=>{e.contains(t.relatedTarget)||r()},a=()=>{e.contains(document.activeElement)||r()};return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[h,o.isClosePausedRef]);let g=d.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...Fu(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return d.useEffect(()=>{let e=f.current;if(e){let t=t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=g({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);Iu(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,g]),(0,x.jsxs)(ki,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,m),tabIndex:-1,style:{pointerEvents:h?void 0:`none`},children:[h&&(0,x.jsx)(uu,{ref:l,onFocusFromOutsideViewport:()=>{Iu(g({tabbingDirection:`forwards`}))}}),(0,x.jsx)(Xl.Slot,{scope:n,children:(0,x.jsx)(ui.ol,{tabIndex:-1,...a,ref:p})}),h&&(0,x.jsx)(uu,{ref:u,onFocusFromOutsideViewport:()=>{Iu(g({tabbingDirection:`backwards`}))}})]})});cu.displayName=iu;var lu=`ToastFocusProxy`,uu=d.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=nu(lu,n);return(0,x.jsx)(Ms,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})});uu.displayName=lu;var du=`Toast`,fu=`toast.swipeStart`,pu=`toast.swipeMove`,mu=`toast.swipeCancel`,hu=`toast.swipeEnd`,gu=d.forwardRef((e,t)=>{let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=Ds({prop:r,defaultProp:i??!0,onChange:a,caller:du});return(0,x.jsx)(bs,{present:n||s,children:(0,x.jsx)(yu,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:fi(e.onPause),onResume:fi(e.onResume),onSwipeStart:Wr(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:Wr(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:Wr(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:Wr(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})});gu.displayName=du;var[_u,vu]=$l(du,{onClose(){}}),yu=d.forwardRef((e,t)=>{let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:m,...h}=e,g=nu(du,n),[_,v]=d.useState(null),y=qr(t,e=>v(e)),b=d.useRef(null),S=d.useRef(null),C=i||g.duration,w=d.useRef(0),T=d.useRef(C),E=d.useRef(0),{onToastAdd:D,onToastRemove:O}=g,k=fi(()=>{_?.contains(document.activeElement)&&g.viewport?.focus(),o()}),A=d.useCallback(e=>{!e||e===1/0||(window.clearTimeout(E.current),w.current=new Date().getTime(),E.current=window.setTimeout(k,e))},[k]);d.useEffect(()=>{let e=g.viewport;if(e){let t=()=>{A(T.current),l?.()},n=()=>{let e=new Date().getTime()-w.current;T.current-=e,window.clearTimeout(E.current),c?.()};return e.addEventListener(ou,n),e.addEventListener(su,t),()=>{e.removeEventListener(ou,n),e.removeEventListener(su,t)}}},[g.viewport,C,c,l,A]),d.useEffect(()=>{a&&!g.isClosePausedRef.current&&A(C)},[a,C,g.isClosePausedRef,A]),d.useEffect(()=>(D(),()=>O()),[D,O]);let j=d.useMemo(()=>_?Au(_):null,[_]);return g.viewport?(0,x.jsxs)(x.Fragment,{children:[j&&(0,x.jsx)(bu,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:j}),(0,x.jsx)(_u,{scope:n,onClose:k,children:Un.createPortal((0,x.jsx)(Xl.ItemSlot,{scope:n,children:(0,x.jsx)(Oi,{asChild:!0,onEscapeKeyDown:Wr(s,()=>{g.isFocusedToastEscapeKeyDownRef.current||k(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,x.jsx)(ui.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":g.swipeDirection,...h,ref:y,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:Wr(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,k()))}),onPointerDown:Wr(e.onPointerDown,e=>{e.button===0&&(b.current={x:e.clientX,y:e.clientY})}),onPointerMove:Wr(e.onPointerMove,e=>{if(!b.current)return;let t=e.clientX-b.current.x,n=e.clientY-b.current.y,r=!!S.current,i=[`left`,`right`].includes(g.swipeDirection),a=[`left`,`up`].includes(g.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},d={originalEvent:e,delta:l};r?(S.current=l,ju(pu,f,d,{discrete:!1})):Mu(l,g.swipeDirection,c)?(S.current=l,ju(fu,u,d,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(b.current=null)}),onPointerUp:Wr(e.onPointerUp,e=>{let t=S.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),S.current=null,b.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};Mu(t,g.swipeDirection,g.swipeThreshold)?ju(hu,m,r,{discrete:!0}):ju(mu,p,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),bu=e=>{let{__scopeToast:t,children:n,...r}=e,i=nu(du,t),[a,o]=d.useState(!1),[s,c]=d.useState(!1);return Nu(()=>o(!0)),d.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,x.jsx)(vs,{asChild:!0,container:i.announcerContainer||void 0,children:(0,x.jsx)(Ms,{...r,children:a&&(0,x.jsxs)(x.Fragment,{children:[i.label,` `,n]})})})},xu=`ToastTitle`,Su=d.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,x.jsx)(ui.div,{...r,ref:t})});Su.displayName=xu;var Cu=`ToastDescription`,wu=d.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,x.jsx)(ui.div,{...r,ref:t})});wu.displayName=Cu;var Tu=`ToastAction`,Eu=d.forwardRef((e,t)=>{let{altText:n,...r}=e;return n.trim()?(0,x.jsx)(ku,{altText:n,asChild:!0,children:(0,x.jsx)(Ou,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Tu}\`. Expected non-empty \`string\`.`),null)});Eu.displayName=Tu;var Du=`ToastClose`,Ou=d.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e,i=vu(Du,n);return(0,x.jsx)(ku,{asChild:!0,children:(0,x.jsx)(ui.button,{type:`button`,...r,ref:t,onClick:Wr(e.onClick,i.onClose)})})});Ou.displayName=Du;var ku=d.forwardRef((e,t)=>{let{__scopeToast:n,altText:r,...i}=e;return(0,x.jsx)(ui.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function Au(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),Pu(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n)if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Au(e))}}),t}function ju(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?di(i,a):i.dispatchEvent(a)}var Mu=(e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n};function Nu(e=()=>{}){let t=fi(e);Ai(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}function Pu(e){return e.nodeType===e.ELEMENT_NODE}function Fu(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 Iu(e){let t=document.activeElement;return e.some(e=>e===t?!0:(e.focus(),document.activeElement!==t))}var Lu=ru,Ru=cu,zu=gu,Bu=Su,Vu=wu,Hu=Eu,Uu=Ou,Wu=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Gu=bc,Ku=(e,t)=>n=>{if(t?.variants==null)return Gu(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Wu(t)||Wu(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Gu(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},qu=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Ju=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Yu=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Xu=e=>{let t=Yu(e);return t.charAt(0).toUpperCase()+t.slice(1)},Zu={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`},Qu=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},$u=(0,d.createContext)({}),ed=()=>(0,d.useContext)($u),td=(0,d.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:f=!1,color:p=`currentColor`,className:m=``}=ed()??{},h=r??f?Number(n??u)*24/Number(t??l):n??u;return(0,d.createElement)(`svg`,{ref:c,...Zu,width:t??l??Zu.width,height:t??l??Zu.height,stroke:e??p,strokeWidth:h,className:qu(`lucide`,m,i),...!a&&!Qu(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,d.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),J=(e,t)=>{let n=(0,d.forwardRef)(({className:n,...r},i)=>(0,d.createElement)(td,{ref:i,iconNode:t,className:qu(`lucide-${Ju(Xu(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Xu(e),n},nd=J(`chart-candlestick`,[[`path`,{d:`M9 5v4`,key:`14uxtq`}],[`rect`,{width:`4`,height:`6`,x:`7`,y:`9`,rx:`1`,key:`f4fvz0`}],[`path`,{d:`M9 15v2`,key:`r5rk32`}],[`path`,{d:`M17 3v2`,key:`1l2re6`}],[`rect`,{width:`4`,height:`8`,x:`15`,y:`5`,rx:`1`,key:`z38je5`}],[`path`,{d:`M17 13v3`,key:`5l0wba`}],[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}]]),rd=J(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),id=J(`chart-line`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`m19 9-5 5-4-4-3 3`,key:`2osh9i`}]]),ad=J(`chart-pie`,[[`path`,{d:`M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z`,key:`pzmjnu`}],[`path`,{d:`M21.21 15.89A10 10 0 1 1 8 2.83`,key:`k2fpak`}]]),od=J(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),sd=J(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),cd=J(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),ld=J(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),ud=J(`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`}]]),dd=J(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),fd=J(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),pd=J(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),md=J(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),hd=J(`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`}]]),gd=J(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),_d=J(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),vd=J(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),yd=J(`at-sign`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]),bd=J(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),xd=J(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),Sd=J(`briefcase-business`,[[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2`,key:`1ksdt3`}],[`path`,{d:`M22 13a18.15 18.15 0 0 1-20 0`,key:`12hx5q`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),Y=J(`briefcase`,[[`path`,{d:`M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16`,key:`jecpp`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),Cd=J(`building-2`,[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]]),wd=J(`calculator`,[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,key:`1nb95v`}],[`line`,{x1:`8`,x2:`16`,y1:`6`,y2:`6`,key:`x4nwl0`}],[`line`,{x1:`16`,x2:`16`,y1:`14`,y2:`18`,key:`wjye3r`}],[`path`,{d:`M16 10h.01`,key:`1m94wz`}],[`path`,{d:`M12 10h.01`,key:`1nrarc`}],[`path`,{d:`M8 10h.01`,key:`19clt8`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}]]),Td=J(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Ed=J(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Dd=J(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Od=J(`clipboard-check`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`m9 14 2 2 4-4`,key:`df797q`}]]),kd=J(`coins`,[[`path`,{d:`M13.744 17.736a6 6 0 1 1-7.48-7.48`,key:`bq4yh3`}],[`path`,{d:`M15 6h1v4`,key:`11y1tn`}],[`path`,{d:`m6.134 14.768.866-.5 2 3.464`,key:`17snzx`}],[`circle`,{cx:`16`,cy:`8`,r:`6`,key:`14bfc9`}]]),Ad=J(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),jd=J(`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`}]]),Md=J(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),Nd=J(`git-compare`,[[`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`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]),Pd=J(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Fd=J(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Id=J(`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`}]]),Ld=J(`list-plus`,[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]),Rd=J(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),zd=J(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),Bd=J(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),Vd=J(`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`}]]),Hd=J(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Ud=J(`receipt`,[[`path`,{d:`M12 17V7`,key:`pyj7ub`}],[`path`,{d:`M16 8h-6a2 2 0 0 0 0 4h4a2 2 0 0 1 0 4H8`,key:`1elt7d`}],[`path`,{d:`M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z`,key:`ycz6yz`}]]),Wd=J(`refresh-ccw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),Gd=J(`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`}]]),Kd=J(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),qd=J(`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`}]]),Jd=J(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Yd=J(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Xd=J(`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`}]]),Zd=J(`trending-up`,[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]),Qd=J(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),$d=J(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function X(...e){return Ul(bc(e))}var ef=Lu,tf=(0,d.forwardRef)(function({className:e,...t},n){return(0,x.jsx)(Ru,{ref:n,className:X(`fixed bottom-0 right-0 z-[100] flex max-h-screen w-full flex-col-reverse gap-2 p-4 sm:bottom-4 sm:right-4 sm:w-[380px] sm:flex-col`,e),...t})}),nf=Ku(`group pointer-events-auto relative flex w-full items-start justify-between gap-3 overflow-hidden rounded-md border p-4 pr-10 shadow-subtle-md transition-all data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-80 data-[state=open]:slide-in-from-bottom-full data-[state=closed]:slide-out-to-right-full data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:transition-none`,{variants:{variant:{default:`border-border bg-card text-foreground`,destructive:`destructive border-destructive/50 bg-destructive text-destructive-foreground`}},defaultVariants:{variant:`default`}}),rf=(0,d.forwardRef)(function({className:e,variant:t,...n},r){return(0,x.jsx)(zu,{ref:r,className:X(nf({variant:t}),e),...n})}),af=(0,d.forwardRef)(function({className:e,...t},n){return(0,x.jsx)(Hu,{ref:n,className:X(`inline-flex h-8 shrink-0 items-center justify-center rounded-md border border-border bg-card px-3 text-xs font-medium text-foreground transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card disabled:pointer-events-none disabled:opacity-50`,e),...t})}),of=(0,d.forwardRef)(function({className:e,...t},n){return(0,x.jsxs)(Uu,{ref:n,className:X(`absolute right-2 top-2 rounded-md p-1 text-muted-foreground opacity-80 transition-opacity hover:text-foreground focus:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring group-[.destructive]:text-destructive-foreground/80 group-[.destructive]:hover:text-destructive-foreground`,e),"toast-close":``,...t,children:[(0,x.jsx)($d,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,x.jsx)(`span`,{className:`sr-only`,children:`Close`})]})}),sf=(0,d.forwardRef)(function({className:e,...t},n){return(0,x.jsx)(Bu,{ref:n,className:X(`text-sm font-semibold`,e),...t})}),cf=(0,d.forwardRef)(function({className:e,...t},n){return(0,x.jsx)(Vu,{ref:n,className:X(`text-sm opacity-90`,e),...t})}),lf=5,uf=1e3,df=0,ff={toasts:[]},pf=[],mf=new Map;function hf(){return df=(df+1)%(2**53-1),String(df)}function gf(e){if(mf.has(e))return;let t=setTimeout(()=>{mf.delete(e),vf({type:`remove`,toastId:e})},uf);mf.set(e,t)}function _f(e,t){switch(t.type){case`add`:return{...e,toasts:[t.toast,...e.toasts].slice(0,lf)};case`update`:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case`dismiss`:{let n=t.toastId;if(n)gf(n);else for(let t of e.toasts)gf(t.id);return{...e,toasts:e.toasts.map(e=>n===void 0||e.id===n?{...e,open:!1}:e)}}case`remove`:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)};default:return e}}function vf(e){ff=_f(ff,e);for(let e of pf)e(ff)}function yf({title:e,description:t,variant:n=`default`,...r}){let i=hf(),a=e=>vf({type:`update`,toast:{...e,id:i}}),o=()=>vf({type:`dismiss`,toastId:i});return vf({type:`add`,toast:{...r,id:i,title:e,description:t,variant:n,open:!0,onOpenChange:e=>{e||o()}}}),{id:i,dismiss:o,update:a}}function bf(e){vf({type:`dismiss`,toastId:e})}function xf(){let[e,t]=(0,d.useState)(ff);return(0,d.useEffect)(()=>(pf.push(t),()=>{let e=pf.indexOf(t);e>-1&&pf.splice(e,1)}),[]),{...e,toast:yf,dismiss:bf}}function Sf(){let{toasts:e}=xf();return(0,x.jsxs)(ef,{children:[e.map(({id:e,title:t,description:n,action:r,...i})=>(0,x.jsxs)(rf,{...i,children:[(0,x.jsxs)(`div`,{className:`grid gap-1`,children:[t?(0,x.jsx)(sf,{children:t}):null,n?(0,x.jsx)(cf,{children:n}):null]}),r?(0,x.jsx)(af,{asChild:!0,children:r}):null,(0,x.jsx)(of,{})]},e)),(0,x.jsx)(tf,{})]})}function Cf(){return{lastSeq:0,seenSeq:new Set,lastSeqBySession:new Map,messages:[],messageById:new Map,tools:new Map,runs:new Map,thinking:new Map,gaps:[]}}function wf(e){return[...e].sort((e,t)=>e.sessionId===t.sessionId?e.seq-t.seq:0).reduce((e,t)=>Tf(e,t),Cf())}function Tf(e,t){let n=`${t.sessionId}:${t.seq}`;if(e.seenSeq.has(n))return e;let r=Df(e),i=r.lastSeqBySession.get(t.sessionId)??0;switch(t.seq>i+1&&i!==0&&r.gaps.push({expected:i+1,received:t.seq}),r.seenSeq.add(n),r.lastSeqBySession.set(t.sessionId,Math.max(i,t.seq)),r.lastSeq=Math.max(r.lastSeq,t.seq),t.type){case`run.started`:r.runs.set(kf(t.sessionId,t.runId),{id:t.runId,sessionId:t.sessionId,status:`running`}),r.session={...r.session,id:t.sessionId};break;case`thinking.delta`:{let e=Of(r,t.sessionId,t.runId);e.status=`streaming`,e.text+=t.text;break}case`thinking.completed`:{let e=Of(r,t.sessionId,t.runId);e.status=`completed`,t.text!==void 0&&(e.text=t.text);break}case`message.created`:Ef(r,t.sessionId,t.messageId,t.role);break;case`message.delta`:{let e=Ef(r,t.sessionId,t.messageId,`assistant`);e.status=`streaming`,e.text+=t.text,e.content=[{type:`text`,text:e.text}];break}case`message.completed`:{let e=Ef(r,t.sessionId,t.messageId,`assistant`);e.status=`completed`,e.content=t.content,e.text=Af(t.content);break}case`custom.message`:{let e=Ef(r,t.sessionId,t.messageId,`assistant`);e.status=`completed`,e.content=t.content,e.text=Af(t.content),e.customType=t.customType;break}case`tool.started`:Ef(r,t.sessionId,t.messageId,`assistant`),r.tools.set(kf(t.sessionId,t.toolCallId),{id:t.toolCallId,sessionId:t.sessionId,messageId:t.messageId,name:t.name,input:t.input,status:`running`,chunks:[]});break;case`tool.delta`:{let e=r.tools.get(kf(t.sessionId,t.toolCallId));e&&e.chunks.push(t.chunk);break}case`tool.completed`:{let e=r.tools.get(kf(t.sessionId,t.toolCallId));e&&(e.status=t.output.isError?`failed`:`completed`,e.output=t.output);break}case`tool.failed`:{let e=r.tools.get(kf(t.sessionId,t.toolCallId));e&&(e.status=`failed`,e.error=t.error);break}case`run.completed`:{let e=r.runs.get(kf(t.sessionId,t.runId));e&&(e.status=`completed`,e.usage=t.usage);break}case`run.failed`:{let e=r.runs.get(kf(t.sessionId,t.runId));e&&(e.status=`failed`,e.error=t.error);break}case`session.updated`:r.session={id:t.sessionId,title:t.title,updatedAt:t.updatedAt};break}return r}function Ef(e,t,n,r){let i=kf(t,n),a=e.messageById.get(i);if(a)return a;let o={id:n,sessionId:t,role:r,status:`streaming`,content:[],text:``};return e.messageById.set(i,o),e.messages.push(o),o}function Df(e){let t=e.messages.map(e=>({...e,content:[...e.content]})),n=new Map(t.map(e=>[kf(e.sessionId??``,e.id),e]));return{...e,seenSeq:new Set(e.seenSeq),lastSeqBySession:new Map(e.lastSeqBySession),messages:t,messageById:n,tools:new Map([...e.tools].map(([e,t])=>[e,{...t,chunks:[...t.chunks]}])),runs:new Map([...e.runs].map(([e,t])=>[e,{...t}])),thinking:new Map([...e.thinking].map(([e,t])=>[e,{...t}])),session:e.session?{...e.session}:void 0,gaps:[...e.gaps]}}function Of(e,t,n){let r=kf(t,n),i=e.thinking.get(r);if(i)return i;let a={runId:n,sessionId:t,status:`streaming`,text:``};return e.thinking.set(r,a),a}function kf(e,t){return`${e??``}::${t}`}function Af(e){return e.filter(e=>e.type===`text`).map(e=>e.text).join(``)}var jf=Ku(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_.button-icon]:h-[var(--button-icon-size)] [&_.button-icon]:w-[var(--button-icon-size)] [&_.button-icon]:shrink-0 [&>svg]:h-[var(--button-icon-size)] [&>svg]:w-[var(--button-icon-size)] [&>svg]:shrink-0`,{variants:{variant:{default:`bg-secondary text-foreground hover:bg-tertiary`,brand:`bg-brand text-brand-foreground hover:opacity-90`,bordered:`border border-border bg-card text-foreground hover:bg-secondary`,secondary:`bg-secondary text-foreground hover:bg-tertiary`,ghost:`text-muted-foreground hover:bg-secondary hover:text-foreground`,link:`h-auto p-0 text-foreground underline-offset-4 hover:underline`},size:{default:`h-11 px-3 text-sm [--button-icon-size:16px] md:h-9`,sm:`h-10 px-3 text-sm [--button-icon-size:15px] md:h-8`,xs:`h-8 px-2 text-xs [--button-icon-size:14px] md:h-7`,icon:`h-11 w-11 shrink-0 px-0 [--button-icon-size:17px] md:h-9 md:w-9`,"icon-sm":`h-11 w-11 shrink-0 px-0 [--button-icon-size:16px] md:h-8 md:w-8`,"icon-xs":`h-8 w-8 shrink-0 px-0 [--button-icon-size:14px] md:h-7 md:w-7`},rounded:{default:`rounded-md`,lg:`rounded-lg`,xl:`rounded-xl`,full:`rounded-full`}},defaultVariants:{variant:`default`,size:`default`,rounded:`default`}});function Z({className:e,variant:t,size:n,rounded:r,asChild:i=!1,icon:a,prefixIcon:o,suffixIcon:s,iconSize:c,tooltip:l,tooltipSide:u,children:d,style:f,...p}){let m=i?Zr:`button`,h=c?{"--button-icon-size":`${c}px`,...f}:f;if(i)return(0,x.jsx)(m,{className:Wl(jf({variant:t,size:n,rounded:r}),e),style:h,...p,children:d});let g=(0,x.jsxs)(m,{className:Wl(jf({variant:t,size:n,rounded:r}),e),style:h,...p,children:[o?(0,x.jsx)(o,{className:`button-icon`,"aria-hidden":`true`,focusable:`false`,strokeWidth:2}):null,a?(0,x.jsx)(a,{className:`button-icon`,"aria-hidden":`true`,focusable:`false`,strokeWidth:2}):Mf(d),s?(0,x.jsx)(s,{className:`button-icon`,"aria-hidden":`true`,focusable:`false`,strokeWidth:2}):null]});return l?(0,x.jsx)(ql,{content:l,side:u,children:g}):g}function Mf(e){return d.Children.map(e,e=>!(0,d.isValidElement)(e)||!Nf(e)?e:(0,d.cloneElement)(e,{"aria-hidden":e.props[`aria-hidden`]??`true`,className:Wl(`button-icon`,e.props.className),focusable:e.props.focusable??`false`,strokeWidth:e.props.strokeWidth??2}))}function Nf(e){return typeof e.type!=`string`||e.props?.size!=null||e.props?.strokeWidth!=null||e.props?.absoluteStrokeWidth!=null}function Pf({open:e,defaultOpen:t=!1,onOpenChange:n,children:r}){let[i,a]=(0,d.useState)(t),o=e===void 0?i:e,s=(0,d.useCallback)(t=>{e===void 0&&a(t),n?.(t)},[n,e]),c=(0,d.useRef)(null),l=(0,d.useRef)(null),u=(0,d.useId)(),f=(0,d.useId)();(0,d.useEffect)(()=>{if(!o)return;let e=e=>{let t=e.target;c.current?.contains(t)||l.current?.contains(t)||s(!1)},t=e=>{e.key===`Escape`&&(e.stopPropagation(),s(!1),c.current?.focus?.())};return document.addEventListener(`pointerdown`,e,!0),document.addEventListener(`keydown`,t,!0),()=>{document.removeEventListener(`pointerdown`,e,!0),document.removeEventListener(`keydown`,t,!0)}},[o,s]);let p={open:o,setOpen:s,triggerRef:c,contentRef:l,triggerId:u,contentId:f};return(0,x.jsx)(Ff.Provider,{value:p,children:r})}var Ff=(0,d.createContext)(null);function If(){let e=(0,d.useContext)(Ff);if(!e)throw Error(`Popover subcomponents must be used inside <Popover>`);return e}var Lf=(0,d.forwardRef)(function({children:e,asChild:t=!1,onClick:n,...r},i){let{open:a,setOpen:o,triggerRef:s,triggerId:c,contentId:l}=If(),u={"aria-expanded":a,"aria-haspopup":`menu`,"aria-controls":a?l:void 0,id:c,onClick:e=>{n?.(e),!e.defaultPrevented&&o(!a)},ref:s,...r};return t&&(0,d.isValidElement)(e)?(0,d.cloneElement)(e,u):(0,x.jsx)(`button`,{type:`button`,...u,children:e})}),Rf=(0,d.forwardRef)(function({className:e,align:t=`start`,side:n=`bottom`,sideOffset:r=6,children:i,...a},o){let{open:s,contentRef:c,contentId:l,triggerId:u}=If();if(!s)return null;let d=t===`end`?`right-0`:t===`center`?`left-1/2 -translate-x-1/2`:`left-0`,f=n===`top`?`bottom-full mb-[var(--popover-offset)]`:`top-full mt-[var(--popover-offset)]`;return(0,x.jsx)(`div`,{ref:c,id:l,role:`menu`,"aria-labelledby":u,style:{"--popover-offset":`${r}px`},className:X(`absolute z-50 min-w-[12rem] overflow-hidden rounded-lg border border-border bg-card shadow-subtle-md outline-none animate-in fade-in-0 zoom-in-95`,f,d,e),...a,children:i})});function zf({children:e,className:t}){return(0,x.jsx)(`div`,{className:X(`relative inline-block`,t),children:e})}var Bf=Ku(`inline-flex items-center gap-1.5 whitespace-nowrap rounded-md border border-transparent px-2 py-0.5 text-[0.7rem] font-medium`,{variants:{variant:{default:`bg-secondary text-muted-foreground`,secondary:`bg-secondary text-muted-foreground rounded-full`,brand:`bg-brand text-brand-foreground`,outline:`border-border bg-background text-foreground`,success:`border-success/30 bg-success/10 text-success`,warning:`border-warning/30 bg-warning/10 text-warning`,destructive:`border-destructive/30 bg-destructive/10 text-destructive`},size:{sm:`h-5 px-2 text-xs`,md:`h-6 px-2 text-[11px]`,lg:`h-7 px-3 text-xs`}},defaultVariants:{variant:`default`,size:`md`}});function Vf({className:e,variant:t,size:n,...r}){return(0,x.jsx)(`div`,{className:Wl(Bf({variant:t,size:n}),e),...r})}function Hf({className:e,...t}){return(0,x.jsx)(`div`,{className:Wl(`rounded-lg border border-border bg-card text-card-foreground`,e),...t})}var Uf=`focusScope.autoFocusOnMount`,Wf=`focusScope.autoFocusOnUnmount`,Gf={bubbles:!1,cancelable:!0},Kf=`FocusScope`,qf=d.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=d.useState(null),l=fi(i),u=fi(a),f=d.useRef(null),p=qr(t,e=>c(e)),m=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let e=function(e){if(m.paused||!s)return;let t=e.target;s.contains(t)?f.current=t:ep(f.current,{select:!0})},t=function(e){if(m.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||ep(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ep(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,m.paused]),d.useEffect(()=>{if(s){tp.add(m);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Uf,Gf);s.addEventListener(Uf,l),s.dispatchEvent(t),t.defaultPrevented||(Jf(ip(Xf(s)),{select:!0}),document.activeElement===e&&ep(s))}return()=>{s.removeEventListener(Uf,l),setTimeout(()=>{let t=new CustomEvent(Wf,Gf);s.addEventListener(Wf,u),s.dispatchEvent(t),t.defaultPrevented||ep(e??document.body,{select:!0}),s.removeEventListener(Wf,u),tp.remove(m)},0)}}},[s,l,u,m]);let h=d.useCallback(e=>{if(!n&&!r||m.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]=Yf(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ep(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ep(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,x.jsx)(ui.div,{tabIndex:-1,...o,ref:p,onKeyDown:h})});qf.displayName=Kf;function Jf(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ep(r,{select:t}),document.activeElement!==n)return}function Yf(e){let t=Xf(e);return[Zf(t,e),Zf(t.reverse(),e)]}function Xf(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 Zf(e,t){for(let n of e)if(!Qf(n,{upTo:t}))return n}function Qf(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 $f(e){return e instanceof HTMLInputElement&&`select`in e}function ep(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&$f(e)&&t&&e.select()}}var tp=np();function np(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=rp(e,t),e.unshift(t)},remove(t){e=rp(e,t),e[0]?.resume()}}}function rp(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ip(e){return e.filter(e=>e.tagName!==`A`)}var ap=0,op=null;function sp(){d.useEffect(()=>{op||={start:cp(),end:cp()};let{start:e,end:t}=op;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),ap++,()=>{ap===1&&(op?.start.remove(),op?.end.remove(),op=null),ap=Math.max(0,ap-1)}},[])}function cp(){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 lp=function(){return lp=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},lp.apply(this,arguments)};function up(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 dp(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 fp=`right-scroll-bar-position`,pp=`width-before-scroll-bar`,mp=`with-scroll-bars-hidden`,hp=`--removed-body-scroll-bar-size`;function gp(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function _p(e,t){var n=(0,d.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 vp=typeof window<`u`?d.useLayoutEffect:d.useEffect,yp=new WeakMap;function bp(e,t){var n=_p(t||null,function(t){return e.forEach(function(e){return gp(e,t)})});return vp(function(){var t=yp.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||gp(e,null)}),i.forEach(function(e){r.has(e)||gp(e,a)})}yp.set(n,e)},[e]),n}function xp(e){return e}function Sp(e,t){t===void 0&&(t=xp);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 Cp(e){e===void 0&&(e={});var t=Sp(null);return t.options=lp({async:!0,ssr:!1},e),t}var wp=function(e){var t=e.sideCar,n=up(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 d.createElement(r,lp({},n))};wp.isSideCarExport=!0;function Tp(e,t){return e.useMedium(t),wp}var Ep=Cp(),Dp=function(){},Op=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:Dp,onWheelCapture:Dp,onTouchMoveCapture:Dp}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=up(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=bp([n,t]),w=lp(lp({},x),i);return d.createElement(d.Fragment,null,u&&d.createElement(S,{sideCar:Ep,removeScrollBar:l,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?d.cloneElement(d.Children.only(s),lp(lp({},w),{ref:C})):d.createElement(y,lp({},w,{className:c,ref:C}),s))});Op.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Op.classNames={fullWidth:pp,zeroRight:fp};var kp,Ap=function(){if(kp)return kp;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function jp(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ap();return t&&e.setAttribute(`nonce`,t),e}function Mp(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Np(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Pp=function(){var e=0,t=null;return{add:function(n){e==0&&(t=jp())&&(Mp(t,n),Np(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Fp=function(){var e=Pp();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ip=function(){var e=Fp();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Lp={left:0,top:0,right:0,gap:0},Rp=function(e){return parseInt(e||``,10)||0},zp=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[Rp(n),Rp(r),Rp(i)]},Bp=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Lp;var t=zp(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Vp=Ip(),Hp=`data-scroll-locked`,Up=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
10
|
-
.${mp} {
|
|
11
|
-
overflow: hidden ${r};
|
|
12
|
-
padding-right: ${s}px ${r};
|
|
13
|
-
}
|
|
14
|
-
body[${Hp}] {
|
|
15
|
-
overflow: hidden ${r};
|
|
16
|
-
overscroll-behavior: contain;
|
|
17
|
-
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
18
|
-
padding-left: ${i}px;
|
|
19
|
-
padding-top: ${a}px;
|
|
20
|
-
padding-right: ${o}px;
|
|
21
|
-
margin-left:0;
|
|
22
|
-
margin-top:0;
|
|
23
|
-
margin-right: ${s}px ${r};
|
|
24
|
-
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.${fp} {
|
|
28
|
-
right: ${s}px ${r};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.${pp} {
|
|
32
|
-
margin-right: ${s}px ${r};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.${fp} .${fp} {
|
|
36
|
-
right: 0 ${r};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.${pp} .${pp} {
|
|
40
|
-
margin-right: 0 ${r};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
body[${Hp}] {
|
|
44
|
-
${hp}: ${s}px;
|
|
45
|
-
}
|
|
46
|
-
`},Wp=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Gp=function(){d.useEffect(function(){return document.body.setAttribute(Hp,(Wp()+1).toString()),function(){var e=Wp()-1;e<=0?document.body.removeAttribute(Hp):document.body.setAttribute(Hp,e.toString())}},[])},Kp=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Gp();var a=d.useMemo(function(){return Bp(i)},[i]);return d.createElement(Vp,{styles:Up(a,!t,i,n?``:`!important`)})},qp=!1;if(typeof window<`u`)try{var Jp=Object.defineProperty({},"passive",{get:function(){return qp=!0,!0}});window.addEventListener(`test`,Jp,Jp),window.removeEventListener(`test`,Jp,Jp)}catch{qp=!1}var Yp=qp?{passive:!1}:!1,Xp=function(e){return e.tagName===`TEXTAREA`},Zp=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Xp(e)&&n[t]===`visible`)},Qp=function(e){return Zp(e,`overflowY`)},$p=function(e){return Zp(e,`overflowX`)},em=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),rm(e,r)){var i=im(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},tm=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},nm=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},rm=function(e,t){return e===`v`?Qp(t):$p(t)},im=function(e,t){return e===`v`?tm(t):nm(t)},am=function(e,t){return e===`h`&&t===`rtl`?-1:1},om=function(e,t,n,r,i){var a=am(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=im(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&rm(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},sm=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},cm=function(e){return[e.deltaX,e.deltaY]},lm=function(e){return e&&`current`in e?e.current:e},um=function(e,t){return e[0]===t[0]&&e[1]===t[1]},dm=function(e){return`
|
|
47
|
-
.block-interactivity-${e} {pointer-events: none;}
|
|
48
|
-
.allow-interactivity-${e} {pointer-events: all;}
|
|
49
|
-
`},fm=0,pm=[];function mm(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),i=d.useState(fm++)[0],a=d.useState(Ip)[0],o=d.useRef(e);d.useEffect(function(){o.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=dp([e.lockRef.current],(e.shards||[]).map(lm),!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=d.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=sm(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=em(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=em(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 om(h,t,e,h===`h`?s:c,!0)},[]),c=d.useCallback(function(e){var n=e;if(!(!pm.length||pm[pm.length-1]!==a)){var r=`deltaY`in n?cm(n):sm(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&um(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(lm).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=d.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:hm(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=d.useCallback(function(e){n.current=sm(e),r.current=void 0},[]),f=d.useCallback(function(t){l(t.type,cm(t),t.target,s(t,e.lockRef.current))},[]),p=d.useCallback(function(t){l(t.type,sm(t),t.target,s(t,e.lockRef.current))},[]);d.useEffect(function(){return pm.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,c,Yp),document.addEventListener(`touchmove`,c,Yp),document.addEventListener(`touchstart`,u,Yp),function(){pm=pm.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Yp),document.removeEventListener(`touchmove`,c,Yp),document.removeEventListener(`touchstart`,u,Yp)}},[]);var m=e.removeScrollBar,h=e.inert;return d.createElement(d.Fragment,null,h?d.createElement(a,{styles:dm(i)}):null,m?d.createElement(Kp,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function hm(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var gm=Tp(Ep,mm),_m=d.forwardRef(function(e,t){return d.createElement(Op,lp({},e,{ref:t,sideCar:gm}))});_m.classNames=Op.classNames;var vm=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},ym=new WeakMap,bm=new WeakMap,xm={},Sm=0,Cm=function(e){return e&&(e.host||Cm(e.parentNode))},wm=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Cm(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})},Tm=function(e,t,n,r){var i=wm(t,Array.isArray(e)?e:[e]);xm[n]||(xm[n]=new WeakMap);var a=xm[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=(ym.get(e)||0)+1,l=(a.get(e)||0)+1;ym.set(e,c),a.set(e,l),o.push(e),c===1&&i&&bm.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(),Sm++,function(){o.forEach(function(e){var t=ym.get(e)-1,i=a.get(e)-1;ym.set(e,t),a.set(e,i),t||(bm.has(e)||e.removeAttribute(r),bm.delete(e)),i||e.removeAttribute(n)}),Sm--,Sm||(ym=new WeakMap,ym=new WeakMap,bm=new WeakMap,xm={})}},Em=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||vm(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Tm(r,i,n,`aria-hidden`)):function(){return null}},Dm=`Dialog`,[Om,km]=Jr(Dm),[Am,jm]=Om(Dm),Mm=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=d.useRef(null),c=d.useRef(null),[l,u]=Ds({prop:r,defaultProp:i??!1,onChange:a,caller:Dm});return(0,x.jsx)(Am,{scope:t,triggerRef:s,contentRef:c,contentId:V(),titleId:V(),descriptionId:V(),open:l,onOpenChange:u,onOpenToggle:d.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};Mm.displayName=Dm;var Nm=`DialogTrigger`,Pm=d.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=jm(Nm,n),a=qr(t,i.triggerRef);return(0,x.jsx)(ui.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":eh(i.open),...r,ref:a,onClick:Wr(e.onClick,i.onOpenToggle)})});Pm.displayName=Nm;var Fm=`DialogPortal`,[Im,Lm]=Om(Fm,{forceMount:void 0}),Rm=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=jm(Fm,t);return(0,x.jsx)(Im,{scope:t,forceMount:n,children:d.Children.map(r,e=>(0,x.jsx)(bs,{present:n||a.open,children:(0,x.jsx)(vs,{asChild:!0,container:i,children:e})}))})};Rm.displayName=Fm;var zm=`DialogOverlay`,Bm=d.forwardRef((e,t)=>{let n=Lm(zm,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=jm(zm,e.__scopeDialog);return a.modal?(0,x.jsx)(bs,{present:r||a.open,children:(0,x.jsx)(Hm,{...i,ref:t})}):null});Bm.displayName=zm;var Vm=Xr(`DialogOverlay.RemoveScroll`),Hm=d.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=jm(zm,n),a=qr(t,Ci());return(0,x.jsx)(_m,{as:Vm,allowPinchZoom:!0,shards:[i.contentRef],children:(0,x.jsx)(ui.div,{"data-state":eh(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})}),Um=`DialogContent`,Wm=d.forwardRef((e,t)=>{let n=Lm(Um,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=jm(Um,e.__scopeDialog);return(0,x.jsx)(bs,{present:r||a.open,children:a.modal?(0,x.jsx)(Gm,{...i,ref:t}):(0,x.jsx)(Km,{...i,ref:t})})});Wm.displayName=Um;var Gm=d.forwardRef((e,t)=>{let n=jm(Um,e.__scopeDialog),r=d.useRef(null),i=qr(t,n.contentRef,r);return d.useEffect(()=>{let e=r.current;if(e)return Em(e)},[]),(0,x.jsx)(qm,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Wr(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Wr(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Wr(e.onFocusOutside,e=>e.preventDefault())})}),Km=d.forwardRef((e,t)=>{let n=jm(Um,e.__scopeDialog),r=d.useRef(!1),i=d.useRef(!1);return(0,x.jsx)(qm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),qm=d.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=jm(Um,n);return sp(),(0,x.jsx)(x.Fragment,{children:(0,x.jsx)(qf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,x.jsx)(bi,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":eh(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),Jm=`DialogTitle`,Ym=d.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=jm(Jm,n);return(0,x.jsx)(ui.h2,{id:i.titleId,...r,ref:t})});Ym.displayName=Jm;var Xm=`DialogDescription`,Zm=d.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=jm(Xm,n);return(0,x.jsx)(ui.p,{id:i.descriptionId,...r,ref:t})});Zm.displayName=Xm;var Qm=`DialogClose`,$m=d.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=jm(Qm,n);return(0,x.jsx)(ui.button,{type:`button`,...r,ref:t,onClick:Wr(e.onClick,()=>i.onOpenChange(!1))})});$m.displayName=Qm;function eh(e){return e?`open`:`closed`}var th=Mm,nh=(0,d.forwardRef)(function({className:e,...t},n){return(0,x.jsx)(Bm,{ref:n,className:X(`fixed inset-0 z-40 bg-foreground/30 backdrop-blur-[2px] overscroll-contain data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}),rh=(0,d.forwardRef)(function({className:e,children:t,ariaTitle:n,closeButtonClassName:r,...i},a){return(0,x.jsxs)(Rm,{children:[(0,x.jsx)(nh,{}),(0,x.jsxs)(Wm,{ref:a,className:X(`fixed left-1/2 top-[46%] z-50 grid w-[calc(100vw-32px)] max-w-3xl -translate-x-1/2 -translate-y-1/2 gap-0 overflow-hidden rounded-xl border border-border bg-card shadow-subtle-md outline-none overscroll-contain data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...i,children:[(0,x.jsx)(Ns,{children:(0,x.jsx)(Ym,{children:n})}),t,(0,x.jsxs)($m,{className:X(`absolute right-3 top-3 z-10 inline-flex h-11 w-11 items-center justify-center rounded-md text-muted-foreground hover:bg-secondary hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card md:h-9 md:w-9`,r),children:[(0,x.jsx)($d,{className:`h-4 w-4 shrink-0`,"aria-hidden":`true`}),(0,x.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}),ih=Ku(`flex w-full rounded-md border border-border bg-card text-foreground transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50`,{variants:{variant:{default:`text-sm`,ghost:`border-transparent bg-transparent shadow-none focus-visible:ring-0 focus-visible:ring-offset-0`},size:{default:`h-11 px-4 text-sm md:h-9`,sm:`h-10 px-3 text-sm md:h-9`},rounded:{default:`rounded-md`,lg:`rounded-lg`,full:`rounded-full`}},defaultVariants:{variant:`default`,size:`default`,rounded:`default`}}),ah=(0,d.forwardRef)(function({className:e,type:t=`text`,variant:n,size:r,rounded:i,...a},o){return(0,x.jsx)(`input`,{ref:o,type:t,className:Wl(ih({variant:n,size:r,rounded:i}),e),autoComplete:`off`,...a})});function oh({modelSetup:e,role:t=`writer`,send:n,setToast:r}){return(0,x.jsxs)(Hf,{className:`mx-auto grid w-full max-w-[760px] gap-4 p-6 shadow-subtle-xs`,children:[(0,x.jsx)(ch,{variant:`first-run`,role:t,requirement:e?.requirement}),(0,x.jsx)(lh,{modelSetup:e,role:t,send:n,setToast:r})]})}function sh({open:e,onOpenChange:t,modelSetup:n,role:r=`writer`,send:i,setToast:a}){return(0,x.jsx)(th,{open:e,onOpenChange:t,children:(0,x.jsx)(rh,{ariaTitle:`Connect a model`,className:`max-w-[760px]`,children:(0,x.jsxs)(`div`,{className:`grid gap-4 p-6`,children:[(0,x.jsx)(ch,{variant:`manage`,hasReady:n?.requirement===`ready`,role:r,requirement:n?.requirement}),(0,x.jsx)(lh,{modelSetup:n,role:r,send:i,setToast:a})]})})})}function ch({variant:e,hasReady:t,role:n,requirement:r}){let i=n===`follower`;return e===`first-run`?(0,x.jsxs)(`div`,{className:`grid gap-2`,children:[(0,x.jsx)(Vf,{variant:`success`,className:`w-fit`,children:`First run`}),(0,x.jsx)(`h2`,{className:`m-0 text-2xl font-semibold tracking-tight text-foreground`,children:`Connect an AI model`}),(0,x.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-muted-foreground`,children:i?`Model setup is unavailable in this window while OpenCandle reconnects local setup access.`:r===`select_model`?`OpenCandle found model credentials. Choose one model below and chat will be ready.`:`OpenCandle needs one model before chat can run. Paste a key below or use terminal sign-in, then start chatting from the same window.`})]}):(0,x.jsxs)(`div`,{className:`grid gap-2`,children:[(0,x.jsx)(`h2`,{className:`m-0 text-2xl font-semibold tracking-tight text-foreground`,children:`Connect a model`}),(0,x.jsx)(`p`,{className:`m-0 text-sm leading-relaxed text-muted-foreground`,children:i?`Model setup is unavailable in this window while OpenCandle reconnects local setup access.`:t?`Add or switch the model that powers chat. Keys are saved locally in Pi's auth store.`:`Paste a Google Gemini, OpenAI, or Anthropic API key. Keys are saved locally in Pi's auth store.`})]})}function lh({modelSetup:e,role:t,send:n,setToast:r}){let[i,a]=(0,d.useState)({}),o=e?.providers||[],s=e?.availableModels||[],c=t===`follower`,l=e=>{let t=i[e]?.trim()||``;if(!t){r?.(`Paste an API key first.`);return}if(c){r?.(`Model setup is unavailable in this window while OpenCandle reconnects.`);return}r?.(`Saving model key...`),n?.(`model.setup.save_api_key`,{provider:e,apiKey:t}),a(t=>({...t,[e]:``}))};return(0,x.jsxs)(x.Fragment,{children:[c?(0,x.jsx)(`div`,{className:`rounded-md border border-amber-700/30 bg-amber-100/60 px-3 py-2 text-sm leading-relaxed text-amber-900 dark:border-amber-300/30 dark:bg-amber-950/30 dark:text-amber-200`,children:`Model setup changes are unavailable in this window while OpenCandle reconnects local setup access.`}):null,s.length>0?(0,x.jsxs)(`label`,{className:`grid max-w-[420px] gap-1.5`,children:[(0,x.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Available model`}),(0,x.jsxs)(`select`,{className:`h-11 w-full rounded-md border border-border bg-card px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background md:h-9`,value:e?.currentModel||``,onChange:e=>uh(n,e.target.value),disabled:c,children:[(0,x.jsx)(`option`,{value:``,children:`Choose model`}),s.map(e=>(0,x.jsx)(`option`,{value:`${e.provider}/${e.id}`,children:e.label},`${e.provider}/${e.id}`))]})]}):null,(0,x.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:o.map(e=>(0,x.jsxs)(`div`,{className:`grid content-start gap-3 rounded-md border border-border bg-secondary p-3`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h3`,{className:`m-0 mb-1 text-sm font-semibold text-foreground`,children:e.label}),(0,x.jsxs)(`p`,{className:`m-0 text-xs leading-5 text-muted-foreground`,children:[`Uses `,(0,x.jsx)(`code`,{children:e.envVar}),` or a saved local key. Default model:`,` `,(0,x.jsx)(`code`,{children:e.defaultModel}),`.`]})]}),(0,x.jsxs)(`label`,{className:`grid gap-1.5`,htmlFor:`${e.id}-api-key`,children:[(0,x.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`API key`}),(0,x.jsx)(ah,{id:`${e.id}-api-key`,type:`password`,name:`${e.id}-api-key`,value:i[e.id]||``,onChange:t=>a(n=>({...n,[e.id]:t.target.value})),autoComplete:`off`,placeholder:`${e.label} API key`,spellCheck:!1,disabled:c})]}),(0,x.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,x.jsx)(Z,{variant:`brand`,size:`sm`,onClick:()=>l(e.id),disabled:c,children:`Save key`}),(0,x.jsx)(Z,{asChild:!0,variant:`bordered`,size:`sm`,children:(0,x.jsx)(`a`,{href:e.signupUrl,target:`_blank`,rel:`noreferrer`,children:`Get key`})})]})]},e.id))}),(0,x.jsxs)(`div`,{className:`flex flex-col items-stretch justify-between gap-3 border-t border-border pt-4 text-sm leading-relaxed text-muted-foreground sm:flex-row sm:items-center`,children:[(0,x.jsxs)(`span`,{className:`text-xs`,children:[`Prefer browser sign-in? Run `,(0,x.jsx)(`code`,{children:`/setup`}),` in the terminal, then refresh this panel.`]}),(0,x.jsx)(Z,{variant:`bordered`,size:`sm`,onClick:()=>n?.(`model.setup.refresh`),disabled:c,children:`Refresh`})]})]})}function uh(e,t){if(!t)return;let[n,...r]=t.split(`/`),i=r.join(`/`);n&&i&&e?.(`model.setup.select_model`,{provider:n,modelId:i})}var dh={google:`Google`,openai:`OpenAI`,anthropic:`Anthropic`};function fh({modelSetup:e,role:t=`writer`,send:n,setToast:r,disabled:i}){let[a,o]=(0,d.useState)(!1),[s,c]=(0,d.useState)(!1),l=e?.availableModels||[],u=e?.currentModel||``,f=ph(u)||`Connect a model`,p=e=>{n?.(`model.setup.select_model`,{provider:e.provider,modelId:e.id}),o(!1)};return(0,x.jsxs)(`div`,{className:`relative inline-block`,children:[(0,x.jsxs)(Pf,{open:a,onOpenChange:o,children:[(0,x.jsx)(Lf,{asChild:!0,children:(0,x.jsx)(Z,{variant:`bordered`,size:`xs`,disabled:i,suffixIcon:Ed,className:`gap-1.5`,children:(0,x.jsx)(`span`,{className:`truncate max-w-[160px]`,children:f})})}),(0,x.jsxs)(Rf,{align:`start`,side:`top`,className:`w-[280px] p-1`,children:[(0,x.jsx)(`div`,{className:`max-h-[280px] overflow-y-auto py-1`,children:l.length>0?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{className:`px-2 pb-1 pt-1 text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Models`}),l.map(e=>{let t=`${e.provider}/${e.id}`,n=t===u;return(0,x.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":n,onClick:()=>p(e),className:X(`flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left text-sm text-foreground transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,n&&`bg-secondary`),children:[(0,x.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,x.jsx)(`div`,{className:`truncate font-medium`,children:ph(t)}),(0,x.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:dh[e.provider]??e.provider})]}),n?(0,x.jsx)(Td,{className:`mt-1 h-3.5 w-3.5 shrink-0 text-foreground`,"aria-hidden":`true`}):null]},t)})]}):(0,x.jsx)(`div`,{className:`px-2 py-3 text-xs text-muted-foreground`,children:`No models connected. Add an API key to get started.`})}),(0,x.jsx)(`div`,{className:`border-t border-border p-1`,children:(0,x.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{o(!1),c(!0)},className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-foreground transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,x.jsx)(Hd,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`,strokeWidth:2}),(0,x.jsx)(`span`,{children:`Connect more models`})]})})]})]}),(0,x.jsx)(sh,{open:s,onOpenChange:c,modelSetup:e,role:t,send:n,setToast:r})]})}function ph(e){if(!e)return``;let[,...t]=e.split(`/`);return t.join(`/`)||e}var mh=(0,d.forwardRef)(function({className:e,...t},n){return(0,x.jsx)(`textarea`,{ref:n,className:Wl(`flex min-h-[80px] w-full resize-none rounded-md border-0 bg-transparent px-4 py-3 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50`,e),...t})});function hh({draft:e,setDraft:t,disabled:n,setupBlocked:r,placeholder:i,canSend:a,onSubmit:o,onOpenCatalog:s,onOpenContext:c,modelSetup:l,role:u,send:d,setToast:f}){return(0,x.jsx)(`div`,{className:`bg-background px-3 pb-4 pt-2 sm:px-6 md:px-12`,children:(0,x.jsxs)(`div`,{className:`mx-auto w-full max-w-[760px] rounded-2xl border border-border bg-card shadow-subtle-xs`,children:[(0,x.jsx)(`label`,{className:`sr-only`,htmlFor:`chat-composer`,children:`Message OpenCandle`}),(0,x.jsx)(mh,{id:`chat-composer`,value:e,disabled:n,placeholder:i,className:`min-h-[60px] rounded-2xl rounded-b-none px-4 py-3`,onChange:e=>t(e.target.value),onKeyDown:t=>{if(t.key===`/`&&!t.metaKey&&!t.ctrlKey&&!t.altKey&&!e.trim()){t.preventDefault(),s?.();return}t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),o())}}),(0,x.jsxs)(`div`,{className:`flex items-center gap-1 border-t border-dashed border-border px-2 py-2`,children:[(0,x.jsx)(fh,{modelSetup:l,role:u,send:d,setToast:f,disabled:n}),(0,x.jsxs)(`div`,{className:`ml-1 flex items-center`,children:[(0,x.jsx)(Z,{variant:`ghost`,size:`icon-sm`,rounded:`full`,tooltip:`Catalog`,"aria-label":`Open catalog`,onClick:()=>s?.(),disabled:n,children:(0,x.jsx)(Hd,{})}),(0,x.jsx)(Z,{variant:`ghost`,size:`icon-sm`,rounded:`full`,tooltip:`Context`,"aria-label":`Open context`,onClick:()=>c?.(),disabled:n,children:(0,x.jsx)(rd,{})})]}),(0,x.jsx)(`div`,{className:`ml-auto`,children:(0,x.jsx)(Z,{variant:a?`brand`:`secondary`,size:`icon-sm`,rounded:`full`,tooltip:r?`Connect a model to send`:`Send message`,"aria-label":`Send message`,onClick:o,disabled:!a,children:(0,x.jsx)(vd,{})})})]})]})})}var gh=(0,d.forwardRef)(function({className:e,children:t,...n},r){return(0,x.jsx)(`kbd`,{ref:r,className:Wl(`inline-flex h-5 items-center justify-center gap-0.5 rounded border border-border bg-background px-1.5 font-mono text-[10px] font-medium text-muted-foreground`,e),...n,children:t})}),_h=[[`What is NVDA trading at?`,`What is NVDA trading at?`],[`Compare NVDA and AMD`,`Compare NVDA and AMD using latest quotes.`],[`Options chain for NVDA`,`Show options chain for NVDA`],[`Deep research: NVDA (multi-analyst, takes a few minutes)`,`/analyze NVDA`]];function vh({prompts:e=_h,onPrompt:t,onOpenCatalog:n,disabled:r=!1}){return(0,x.jsxs)(`div`,{className:`mx-auto grid w-full max-w-[760px] animate-fade-in-once justify-items-center gap-6 px-2 pb-20 pt-16 text-center sm:pt-24`,children:[(0,x.jsxs)(`div`,{className:`grid gap-2`,children:[(0,x.jsx)(`h1`,{className:`m-0 text-3xl font-semibold leading-tight tracking-tight text-foreground`,children:`What are we watching?`}),(0,x.jsx)(`p`,{className:`m-0 max-w-[520px] text-sm leading-relaxed text-muted-foreground`,children:`Ask for quotes, filings, macro data, options chains, or a full research workflow.`})]}),(0,x.jsx)(yh,{prompts:e,onPrompt:t,disabled:r}),n?(0,x.jsxs)(`button`,{type:`button`,onClick:()=>n(),className:`inline-flex items-center gap-2 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,children:[(0,x.jsx)(xd,{"aria-hidden":`true`,className:`h-3.5 w-3.5`}),`Browse workflows, tools, and providers`,(0,x.jsx)(gh,{className:`hidden sm:inline-flex`,children:`⌘K / Ctrl+K`})]}):null]})}function yh({prompts:e=_h,onPrompt:t,disabled:n=!1}){return(0,x.jsx)(`div`,{className:`flex w-full flex-wrap justify-center gap-2`,children:e.map(([e,r])=>(0,x.jsx)(Z,{variant:`bordered`,size:`sm`,rounded:`full`,className:`font-normal text-muted-foreground`,disabled:n,onClick:()=>{n||t(r)},children:e},e))})}function bh(e){return typeof e==`string`?e:Array.isArray(e)?e.map(e=>e.text||e.name||``).join(`
|
|
50
|
-
`):``}function xh(e){let t=String(e||``).split(/\r?\n/),n=[],r=[],i=[],a=[],o=()=>{r.length&&(n.push(`<p>${Ch(r.join(` `))}</p>`),r=[])},s=()=>{i.length&&(n.push(`<ul>${i.map(e=>`<li>${Ch(e)}</li>`).join(``)}</ul>`),i=[])},c=()=>{if(a.length<2){r.push(...a),a=[];return}let[e,...t]=a.filter(e=>!/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(e)).map(Sh);n.push(`<div class="rich-table"><table><thead><tr>${e.map(e=>`<th>${Ch(e)}</th>`).join(``)}</tr></thead><tbody>${t.map(e=>`<tr>${e.map(e=>`<td>${Ch(e)}</td>`).join(``)}</tr>`).join(``)}</tbody></table></div>`),a=[]},l=()=>{c(),s(),o()};for(let e of t){let t=e.trim();if(!t){l();continue}if(t.includes(`|`)&&/^\|?.+\|.+/.test(t)){o(),s(),a.push(t);continue}if(c(),/^([-*_])(?:\s*\1){2,}$/.test(t)){s(),o(),n.push(`<hr>`);continue}let u=t.match(/^(#{1,6})\s+(.+)$/);if(u){s(),o();let e=Math.min(5,Math.max(3,u[1].length));n.push(`<h${e}>${Ch(u[2])}</h${e}>`);continue}let d=t.match(/^[-*]\s+(.+)$/);if(d){o(),i.push(d[1]);continue}s(),r.push(t)}return l(),n.join(``)}function Sh(e){return e.replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim())}function Ch(e){return wh(e).replace(/\*\*([^*]+)\*\*/g,`<strong>$1</strong>`).replace(/`([^`]+)`/g,`<code>$1</code>`)}function wh(e){return String(e??``).replace(/[&<>"']/g,e=>({"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`})[e])}function Th({content:e}){return(0,x.jsx)(`div`,{className:`flex justify-end`,children:(0,x.jsx)(`div`,{className:`max-w-[min(640px,86%)] rounded-2xl bg-secondary px-4 py-2.5 text-sm leading-relaxed text-foreground`,children:bh(e)})})}function Eh({content:e}){return(0,x.jsx)(`div`,{className:`max-w-[min(920px,100%)] text-base leading-[1.65rem] text-foreground`,children:(0,x.jsx)(`div`,{className:`rich-text chat-markdown`,dangerouslySetInnerHTML:{__html:xh(bh(e))}})})}function Dh({customType:e,content:t}){return(0,x.jsxs)(`div`,{className:`flex max-w-[760px] flex-wrap items-start gap-2 text-sm`,children:[(0,x.jsx)(Vf,{variant:`warning`,children:e}),(0,x.jsx)(`span`,{className:`text-foreground`,children:bh(t)})]})}function Oh({className:e,...t}){return(0,x.jsx)(`div`,{className:X(`animate-pulse rounded-md bg-primary/10`,e),...t})}function kh({status:e=`pending`,className:t}){return e===`completed`?(0,x.jsx)(`span`,{className:X(`relative inline-flex size-3 items-center justify-center`,t),"aria-hidden":`true`,children:(0,x.jsx)(`span`,{className:`size-1.5 rounded-full bg-foreground`})}):e===`error`?(0,x.jsx)(`span`,{className:X(`relative inline-flex size-3 items-center justify-center`,t),"aria-hidden":`true`,children:(0,x.jsx)(`span`,{className:`size-1.5 rounded-full bg-destructive`})}):(0,x.jsxs)(`span`,{className:X(`relative inline-flex size-3 items-center justify-center`,t),"aria-hidden":`true`,children:[(0,x.jsx)(`span`,{className:`absolute inline-flex size-3 animate-ping rounded-full bg-foreground/30`}),(0,x.jsx)(`span`,{className:`relative inline-flex size-1.5 rounded-full bg-foreground`})]})}function Ah({children:e,active:t=!0,className:n,as:r=`span`}){return(0,x.jsx)(r,{className:X(`tool-shimmer-base`,t&&`tool-shimmer`,n),"data-shimmer":t?`on`:`off`,children:e})}function jh({className:e=`h-5 w-5`,src:t=`/assets/logo.svg`}){return(0,x.jsx)(`img`,{src:t,alt:``,"aria-hidden":`true`,width:`20`,height:`20`,className:`shrink-0 ${e}`,draggable:`false`})}var Mh=`/assets/logo-CWpt6Y2a.svg`;function Nh(e){return(0,x.jsx)(jh,{src:Mh,...e})}function Ph({onExpandSidebar:e}){return(0,x.jsx)(`div`,{className:`hidden h-12 shrink-0 items-center border-b border-border bg-background px-3 md:flex`,children:(0,x.jsx)(Z,{variant:`ghost`,size:`icon-sm`,"aria-label":`Expand sidebar`,onClick:e,children:(0,x.jsx)(pd,{})})})}function Fh({onOpenSidebar:e,onOpenHome:t}){return(0,x.jsxs)(`header`,{className:`flex h-12 shrink-0 items-center gap-2 border-b border-border bg-background px-2 md:hidden`,children:[(0,x.jsx)(Z,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open sidebar`,onClick:e,children:(0,x.jsx)(Rd,{})}),(0,x.jsxs)(`button`,{type:`button`,"aria-label":`Go to new chat`,onClick:t,className:`flex min-w-0 items-center gap-1.5 rounded-md px-1.5 py-1 text-sm font-semibold tracking-tight text-foreground transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,x.jsx)(Nh,{}),(0,x.jsx)(`span`,{className:`truncate`,children:`OpenCandle`})]})]})}function Ih(e){return e?.details?.value??e?.details??{}}function Lh(e){if(!Number.isFinite(e))return`—`;let t=Math.abs(e);return t>=0xe8d4a51000?`${(e/0xe8d4a51000).toFixed(2)}T`:t>=1e9?`${(e/1e9).toFixed(2)}B`:t>=1e6?`${(e/1e6).toFixed(2)}M`:t>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function Rh(e,t){if(!Number.isFinite(e))return`—`;let n=typeof t==`number`?t:e<1?4:2;return`$${e.toFixed(n)}`}function zh(e,t=2){return Number.isFinite(e)?`${e>0?`+`:e<0?`−`:``}${Math.abs(e).toFixed(t)}%`:`—`}function Bh(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function Vh(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function Hh(e){if(!e)return`—`;let t=new Date(e).getTime();if(Number.isNaN(t))return String(e);let n=Date.now()-t,r=60*1e3,i=60*r,a=24*i;return n<r?`just now`:n<i?`${Math.floor(n/r)}m ago`:n<a?`${Math.floor(n/i)}h ago`:n<7*a?`${Math.floor(n/a)}d ago`:Bh(e)}function Uh(e){return String(e||``).replace(/\[OPENCANDLE_[A-Z_]+[^\]]*\]\s*/g,``).replace(/\n{3,}/g,`
|
|
51
|
-
|
|
52
|
-
`).trim()}function Q({children:e,isError:t,className:n}){return(0,x.jsx)(`div`,{className:X(`grid max-w-[760px] gap-3 rounded-lg border border-border bg-card p-4`,t&&`border-destructive`,n),children:e})}function Wh({category:e,title:t,manual:n,isError:r}){return(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,x.jsx)(Vf,{children:e}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-foreground`,children:t}),r?(0,x.jsx)(Vf,{variant:`destructive`,children:`error`}):null,n?(0,x.jsx)(Vf,{variant:`warning`,children:`manual`}):null]})}function Gh({items:e}){return e?.length?(0,x.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.map(e=>(0,x.jsx)(Vf,{variant:`warning`,children:e},e))}):null}function $({label:e,value:t,tone:n,className:r}){let i=n===`success`?`text-success`:n===`destructive`?`text-destructive`:`text-foreground`;return(0,x.jsxs)(`div`,{className:X(`min-w-0 rounded-md bg-secondary px-3 py-2.5`,r),children:[(0,x.jsx)(`div`,{className:`text-[10.5px] font-medium uppercase tracking-wider text-muted-foreground`,children:e}),(0,x.jsx)(`div`,{className:X(`mt-0.5 truncate tabular-nums text-sm font-medium`,i),children:t})]})}function Kh({label:e,value:t,tone:n,mono:r=!0}){return(0,x.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-border py-1.5 last:border-b-0`,children:[(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,x.jsx)(`span`,{className:X(`text-sm`,r&&`tabular-nums`,n===`success`?`text-success`:n===`destructive`?`text-destructive`:`text-foreground`,`font-medium`),children:t})]})}function qh({value:e,percent:t,prefix:n=`$`,size:r=`md`}){let i=((Number.isFinite(t)?t:e)??0)>=0,a=i?`↑`:`↓`,o=i?`text-success`:`text-destructive`,s=[];return Number.isFinite(e)&&s.push(`${n}${Math.abs(e).toFixed(2)}`),Number.isFinite(t)&&s.push(`${Math.abs(t).toFixed(2)}%`),(0,x.jsxs)(`span`,{className:X(`inline-flex items-center gap-1 font-medium tabular-nums`,r===`lg`?`text-base`:`text-sm`,o),children:[(0,x.jsx)(`span`,{"aria-hidden":`true`,children:a}),(0,x.jsx)(`span`,{children:s.join(` · `)||`—`})]})}function Jh({values:e,height:t=56,className:n,fill:r=!0}){if(!Array.isArray(e)||e.length<2)return null;let i=e.filter(e=>Number.isFinite(e));if(i.length<2)return null;let a=Math.min(...i),o=Math.max(...i)-a||1,s=i[i.length-1]>=i[0],c=s?`hsl(var(--tw-success))`:`hsl(var(--tw-destructive))`,l=s?`hsl(var(--tw-success) / 0.10)`:`hsl(var(--tw-destructive) / 0.10)`,u=i.map((e,n)=>[n/(i.length-1)*600,t-(e-a)/o*t]).map(([e,t],n)=>`${n===0?`M`:`L`}${e.toFixed(1)},${t.toFixed(1)}`).join(` `),d=`${u} L${600 .toFixed(1)},${t.toFixed(1)} L0,${t.toFixed(1)} Z`;return(0,x.jsxs)(`svg`,{viewBox:`0 0 600 ${t}`,className:X(`w-full`,n),preserveAspectRatio:`none`,children:[r?(0,x.jsx)(`path`,{d,fill:l,stroke:`none`}):null,(0,x.jsx)(`path`,{d:u,fill:`none`,stroke:c,strokeWidth:`1.5`,strokeLinejoin:`round`,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`})]})}function Yh({low:e,high:t,current:n,label:r,prefix:i=`$`}){if(!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(n))return null;let a=t-e||1,o=Math.max(0,Math.min(100,(n-e)/a*100));return(0,x.jsxs)(`div`,{children:[r?(0,x.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:[(0,x.jsx)(`span`,{children:r}),(0,x.jsxs)(`span`,{className:`tabular-nums normal-case tracking-normal`,children:[Math.round(o),`%`]})]}):null,(0,x.jsx)(`div`,{className:`relative h-1.5 rounded-full bg-secondary`,children:(0,x.jsx)(`div`,{className:`absolute -top-1 h-3.5 w-0.5 rounded-full bg-foreground`,style:{left:`${o}%`},"aria-hidden":`true`})}),(0,x.jsxs)(`div`,{className:`mt-1 flex items-center justify-between text-[11px] tabular-nums text-muted-foreground`,children:[(0,x.jsxs)(`span`,{children:[i,Number(e).toFixed(2)]}),(0,x.jsxs)(`span`,{children:[i,Number(t).toFixed(2)]})]})]})}function Xh({left:e,right:t,leftLabel:n,rightLabel:r,leftClass:i=`bg-success`,rightClass:a=`bg-destructive`,neutral:o,neutralLabel:s,neutralClass:c=`bg-hard`}){let l=(e||0)+(t||0)+(o||0)||1,u=(e||0)/l*100,d=(o||0)/l*100,f=(t||0)/l*100;return(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] tabular-nums text-muted-foreground`,children:[(0,x.jsx)(`span`,{children:n}),s?(0,x.jsx)(`span`,{children:s}):null,(0,x.jsx)(`span`,{children:r})]}),(0,x.jsxs)(`div`,{className:`mt-1 flex h-2 overflow-hidden rounded-full bg-secondary`,children:[(0,x.jsx)(`div`,{style:{width:`${u}%`},className:i}),o?(0,x.jsx)(`div`,{style:{width:`${d}%`},className:c}):null,(0,x.jsx)(`div`,{style:{width:`${f}%`},className:a})]})]})}function Zh({message:e,details:t,text:n}){return(0,x.jsxs)(`details`,{className:`group`,children:[(0,x.jsxs)(`summary`,{className:`inline-flex cursor-pointer list-none items-center gap-1 rounded-sm text-[10.5px] uppercase tracking-wider text-muted-foreground/80 transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card [&::-webkit-details-marker]:hidden`,children:[(0,x.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block transition-transform group-open:rotate-90`,children:`›`}),(0,x.jsx)(`span`,{children:`Raw input · output`})]}),(0,x.jsx)(`pre`,{className:`mt-1.5 max-h-72 overflow-auto rounded-md border border-border bg-secondary/50 p-2 text-[11px] leading-relaxed text-muted-foreground`,children:JSON.stringify({input:e?.details?.args||null,details:t,text:n},null,2)})]})}function Qh({text:e}){let t=Uh(e);return t?(0,x.jsx)(`div`,{className:`rich-text break-words text-[13px] leading-relaxed text-foreground`,dangerouslySetInnerHTML:{__html:xh(t)}}):(0,x.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`No output returned.`})}function $h({message:e,header:t}){let n=Ih(e);return!n||!n.symbol?(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:`Company overview unavailable.`})]}):(0,x.jsxs)(Q,{children:[t,(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,x.jsx)(`span`,{className:`text-lg font-semibold tracking-tight text-foreground`,children:n.name||n.symbol}),(0,x.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:n.symbol}),n.exchange?(0,x.jsx)(Vf,{variant:`outline`,children:n.exchange}):null]}),n.sector||n.industry?(0,x.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[n.sector,n.industry].filter(Boolean).join(` · `)}):null]}),n.description?(0,x.jsx)(`p`,{className:`line-clamp-3 text-[13px] leading-relaxed text-muted-foreground`,children:n.description}):null,(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-3`,children:[(0,x.jsx)($,{label:`Market cap`,value:n.marketCap>0?`$${Lh(n.marketCap)}`:`—`}),(0,x.jsx)($,{label:`P/E`,value:Number.isFinite(n.pe)&&n.pe?n.pe.toFixed(2):`—`}),(0,x.jsx)($,{label:`Forward P/E`,value:Number.isFinite(n.forwardPe)&&n.forwardPe?n.forwardPe.toFixed(2):`—`}),(0,x.jsx)($,{label:`EPS`,value:Number.isFinite(n.eps)?n.eps.toFixed(2):`—`}),(0,x.jsx)($,{label:`Beta`,value:Number.isFinite(n.beta)?n.beta.toFixed(2):`—`}),(0,x.jsx)($,{label:`Dividend yield`,value:Number.isFinite(n.dividendYield)?`${(n.dividendYield*100).toFixed(2)}%`:`—`}),(0,x.jsx)($,{label:`Profit margin`,value:Number.isFinite(n.profitMargin)?`${(n.profitMargin*100).toFixed(2)}%`:`—`}),(0,x.jsx)($,{label:`Revenue growth`,value:Number.isFinite(n.revenueGrowth)?`${(n.revenueGrowth*100).toFixed(2)}%`:`—`,tone:n.revenueGrowth>0?`success`:n.revenueGrowth<0?`destructive`:`default`}),(0,x.jsx)($,{label:`Avg volume`,value:Lh(n.avgVolume)})]}),Number.isFinite(n.week52Low)&&Number.isFinite(n.week52High)?(0,x.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`52-week range`,` `,(0,x.jsxs)(`span`,{className:`tabular-nums text-foreground`,children:[Rh(n.week52Low),` – `,Rh(n.week52High)]})]}):null]})}function eg({message:e,header:t,text:n}){let r=Ih(e),i=Array.isArray(r)?r:Array.isArray(r?.statements)?r.statements:null;if(!i||i.length===0)return(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:n})]});let a=i[0],o=i[1],s=o?.revenue?(a.revenue-o.revenue)/o.revenue*100:null,c=o?.eps?(a.eps-o.eps)/o.eps*100:null;return(0,x.jsxs)(Q,{children:[t,(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Latest filing`}),(0,x.jsx)(`div`,{className:`mt-0.5 text-base font-medium text-foreground`,children:Vh(a.fiscalDate)})]}),(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-4`,children:[(0,x.jsx)($,{label:`Revenue`,value:`$${Lh(a.revenue)}`}),(0,x.jsx)($,{label:`Net income`,value:`$${Lh(a.netIncome)}`,tone:a.netIncome>=0?`success`:`destructive`}),(0,x.jsx)($,{label:`Operating income`,value:`$${Lh(a.operatingIncome)}`}),(0,x.jsx)($,{label:`EPS`,value:Number.isFinite(a.eps)?`$${a.eps.toFixed(2)}`:`—`}),(0,x.jsx)($,{label:`Free cash flow`,value:`$${Lh(a.freeCashFlow)}`}),(0,x.jsx)($,{label:`Operating cash flow`,value:`$${Lh(a.operatingCashFlow)}`}),(0,x.jsx)($,{label:`Total assets`,value:`$${Lh(a.totalAssets)}`}),(0,x.jsx)($,{label:`Total debt`,value:Number.isFinite(a.totalDebt)?`$${Lh(a.totalDebt)}`:`—`})]}),s!==null||c!==null?(0,x.jsxs)(`div`,{className:`grid gap-1.5 rounded-md bg-secondary px-3 py-2`,children:[(0,x.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Year over year`}),s===null?null:(0,x.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`Revenue`}),(0,x.jsx)(qh,{percent:s})]}),c===null?null:(0,x.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`EPS`}),(0,x.jsx)(qh,{percent:c})]})]}):null]})}function tg({message:e,header:t,text:n}){let r=Ih(e),i=Array.isArray(r?.quarterly)?r.quarterly:Array.isArray(r)?r:null;if(!i||i.length===0)return(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:n})]});let a=i[0],o=r?.symbol;return(0,x.jsxs)(Q,{children:[t,(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[o?`${o} · `:``,`Latest quarter`]}),(0,x.jsx)(`div`,{className:`mt-0.5 text-base font-medium text-foreground`,children:Vh(a.date)})]}),(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-4`,children:[(0,x.jsx)($,{label:`Reported EPS`,value:Number.isFinite(a.reportedEPS)?`$${a.reportedEPS.toFixed(2)}`:`—`}),(0,x.jsx)($,{label:`Estimated EPS`,value:Number.isFinite(a.estimatedEPS)?`$${a.estimatedEPS.toFixed(2)}`:`—`}),(0,x.jsx)($,{label:`Surprise`,value:Number.isFinite(a.surprise)?`$${a.surprise.toFixed(2)}`:`—`,tone:a.surprise>0?`success`:a.surprise<0?`destructive`:`default`}),(0,x.jsx)($,{label:`Surprise %`,value:Number.isFinite(a.surprisePercent)?zh(a.surprisePercent):`—`,tone:a.surprisePercent>0?`success`:a.surprisePercent<0?`destructive`:`default`})]}),i.length>1?(0,x.jsxs)(`div`,{className:`rounded-md border border-border`,children:[(0,x.jsx)(`div`,{className:`border-b border-border px-3 py-1.5 text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Recent quarters`}),(0,x.jsx)(`ul`,{children:i.slice(0,5).map(e=>(0,x.jsxs)(`li`,{className:`flex items-center justify-between gap-3 border-b border-border px-3 py-1.5 last:border-b-0`,children:[(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:Vh(e.date)}),(0,x.jsxs)(`span`,{className:`text-xs tabular-nums text-foreground`,children:[`EPS $`,e.reportedEPS?.toFixed(2)??`—`]}),(0,x.jsxs)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:[`est $`,e.estimatedEPS?.toFixed(2)??`—`]}),(0,x.jsx)(qh,{percent:e.surprisePercent,prefix:``})]},e.date))})]}):null]})}function ng({message:e,header:t,text:n}){let r=Ih(e),i=r.fairValue??r.intrinsicValue??r.value,a=r.currentPrice??r.price,o=r.upside??r.upsidePercent??(Number.isFinite(i)&&Number.isFinite(a)?(i-a)/a*100:null);return!Number.isFinite(i)&&!Number.isFinite(a)?(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:n})]}):(0,x.jsxs)(Q,{children:[t,(0,x.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Fair value`}),(0,x.jsx)(`div`,{className:`mt-1 text-2xl font-semibold tabular-nums tracking-tight text-foreground`,children:Rh(i)})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Current price`}),(0,x.jsxs)(`div`,{className:`mt-1 flex items-baseline gap-2`,children:[(0,x.jsx)(`span`,{className:`text-2xl font-semibold tabular-nums tracking-tight text-muted-foreground`,children:Rh(a)}),Number.isFinite(o)?(0,x.jsx)(qh,{percent:o}):null]})]})]}),r.assumptions||r.inputs?(0,x.jsxs)(`div`,{className:`rounded-md bg-secondary px-3 py-2`,children:[(0,x.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Assumptions`}),(0,x.jsx)(`div`,{className:`mt-1.5 grid gap-1`,children:Object.entries(r.assumptions||r.inputs||{}).map(([e,t])=>(0,x.jsx)(Kh,{label:e,value:typeof t==`number`?t.toLocaleString():String(t)},e))})]}):null]})}function rg({message:e,header:t,text:n}){let r=Ih(e),i=Array.isArray(r?.observations)?r.observations:[];if(i.length===0)return(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:n})]});let a=i.map(e=>({date:e.date,value:typeof e.value==`string`?parseFloat(e.value):e.value})).filter(e=>Number.isFinite(e.value));if(a.length===0)return(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:n})]});let o=a[a.length-1],s=a[a.length-2],c=s?o.value-s.value:null,l=s&&s.value!==0?c/s.value*100:null;return(0,x.jsxs)(Q,{children:[t,(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`text-base font-medium tracking-tight text-foreground`,children:r.title||r.id||`Series`}),(0,x.jsxs)(`div`,{className:`mt-0.5 flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[r.id?(0,x.jsx)(`span`,{className:`font-mono`,children:r.id}):null,r.frequency?(0,x.jsx)(Vf,{variant:`outline`,children:r.frequency}):null,r.units?(0,x.jsx)(`span`,{children:r.units}):null]})]}),(0,x.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-3`,children:[(0,x.jsx)(`span`,{className:`text-3xl font-semibold tabular-nums tracking-tight text-foreground`,children:o.value.toFixed(2)}),c===null?null:(0,x.jsx)(qh,{value:c,percent:l,prefix:``}),(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:Vh(o.date)})]}),(0,x.jsx)(Jh,{values:a.map(e=>e.value),height:64}),(0,x.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] uppercase tracking-wider text-muted-foreground`,children:[(0,x.jsx)(`span`,{children:Vh(a[0].date)}),(0,x.jsxs)(`span`,{children:[a.length,` observations`]}),(0,x.jsx)(`span`,{children:Vh(o.date)})]}),r.lastUpdated?(0,x.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[`FRED last updated `,Vh(r.lastUpdated)]}):null]})}function ig({message:e,header:t,text:n}){let r=Ih(e);if(!Number.isFinite(r?.value))return(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:n})]});let i=ag(r.label);return(0,x.jsxs)(Q,{children:[t,(0,x.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-3`,children:[(0,x.jsx)(`span`,{className:`text-[3rem] font-semibold leading-none tabular-nums tracking-tight text-foreground`,children:r.value}),(0,x.jsx)(`span`,{className:`text-base font-medium ${i}`,children:r.label||`—`}),(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`/ 100`})]}),(0,x.jsx)(Yh,{low:0,high:100,current:r.value,label:`Sentiment scale`,prefix:``}),(0,x.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,x.jsx)($,{label:`Prev close`,value:Number.isFinite(r.previousClose)?r.previousClose:`—`}),(0,x.jsx)($,{label:`Week ago`,value:Number.isFinite(r.weekAgo)?r.weekAgo:`—`}),(0,x.jsx)($,{label:`Month ago`,value:Number.isFinite(r.monthAgo)?r.monthAgo:`—`})]})]})}function ag(e){if(!e)return`text-foreground`;let t=String(e).toLowerCase();return t.includes(`extreme fear`)||t.includes(`fear`)?`text-destructive`:t.includes(`extreme greed`)||t.includes(`greed`)?`text-success`:`text-foreground`}function og({message:e,header:t}){let n=Ih(e);return!n||!Number.isFinite(n.price)?(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:`Quote unavailable.`})]}):(0,x.jsxs)(Q,{children:[t,(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-3`,children:[(0,x.jsx)(`span`,{className:`font-mono text-[13px] tracking-tight text-muted-foreground`,children:n.symbol}),(0,x.jsx)(`span`,{className:`text-[2rem] font-semibold leading-none tabular-nums tracking-tight text-foreground`,children:Rh(n.price)}),(0,x.jsx)(qh,{value:n.change,percent:n.changePercent,size:`lg`})]}),(0,x.jsxs)(`div`,{className:`mt-1.5 text-xs text-muted-foreground`,children:[`Prev close `,(0,x.jsx)(`span`,{className:`tabular-nums`,children:Rh(n.previousClose)})]})]}),(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-4`,children:[(0,x.jsx)($,{label:`Open`,value:Rh(n.open)}),(0,x.jsx)($,{label:`High`,value:Rh(n.high)}),(0,x.jsx)($,{label:`Low`,value:Rh(n.low)}),(0,x.jsx)($,{label:`Volume`,value:Lh(n.volume)})]}),(0,x.jsx)(Yh,{low:n.week52Low,high:n.week52High,current:n.price,label:`52-week range`}),(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-3`,children:[(0,x.jsx)($,{label:`Market cap`,value:n.marketCap>0?`$${Lh(n.marketCap)}`:`—`}),(0,x.jsx)($,{label:`P/E`,value:Number.isFinite(n.pe)&&n.pe?n.pe.toFixed(2):`—`}),(0,x.jsx)($,{label:`As of`,value:n.timestamp?new Date(n.timestamp).toLocaleTimeString():`—`})]})]})}function sg({message:e,header:t}){let n=Ih(e);return!n||!Number.isFinite(n.price)?(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:`Crypto price unavailable.`})]}):(0,x.jsxs)(Q,{children:[t,(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-3`,children:[(0,x.jsx)(`span`,{className:`font-mono text-[13px] tracking-tight text-muted-foreground`,children:n.symbol}),(0,x.jsx)(`span`,{className:`text-[2rem] font-semibold leading-none tabular-nums tracking-tight text-foreground`,children:Rh(n.price)}),(0,x.jsx)(qh,{value:n.change24h,percent:n.changePercent24h,size:`lg`})]}),(0,x.jsxs)(`div`,{className:`mt-1.5 text-xs text-muted-foreground`,children:[n.name,` · 24h change`]})]}),(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-4`,children:[(0,x.jsx)($,{label:`High 24h`,value:Rh(n.high24h)}),(0,x.jsx)($,{label:`Low 24h`,value:Rh(n.low24h)}),(0,x.jsx)($,{label:`Volume 24h`,value:n.volume24h?`$${Lh(n.volume24h)}`:`—`}),(0,x.jsx)($,{label:`Market cap`,value:n.marketCap?`$${Lh(n.marketCap)}`:`—`})]}),(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,x.jsx)($,{label:`All-time high`,value:Rh(n.ath)}),(0,x.jsx)($,{label:`ATH date`,value:n.athDate?Vh(n.athDate):`—`})]}),n.circulatingSupply?(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,x.jsx)($,{label:`Circulating supply`,value:Lh(n.circulatingSupply)}),(0,x.jsx)($,{label:`Total supply`,value:n.totalSupply?Lh(n.totalSupply):`—`})]}):null]})}function cg({message:e,header:t}){let n=Ih(e),r=Array.isArray(n)?n:Array.isArray(n?.bars)?n.bars:[];if(r.length===0)return(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:`No price history returned.`})]});let i=r[0],a=r[r.length-1],o=Math.max(...r.map(e=>e.high??e.close)),s=Math.min(...r.map(e=>e.low??e.close)),c=a.close-i.close,l=i.close?c/i.close*100:0,u=r.map(e=>e.volume).filter(Number.isFinite),d=u.length?u.reduce((e,t)=>e+t,0)/u.length:0;return(0,x.jsxs)(Q,{children:[t,(0,x.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-3`,children:[(0,x.jsx)(`span`,{className:`text-2xl font-semibold tabular-nums tracking-tight text-foreground`,children:Rh(a.close)}),(0,x.jsx)(qh,{value:c,percent:l}),(0,x.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`over `,r.length,` bars`]})]}),(0,x.jsx)(lg,{bars:r,change:c}),(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-4`,children:[(0,x.jsx)($,{label:`Period high`,value:Rh(o)}),(0,x.jsx)($,{label:`Period low`,value:Rh(s)}),(0,x.jsx)($,{label:`First close`,value:Rh(i.close)}),(0,x.jsx)($,{label:`Avg volume`,value:Lh(d)})]})]})}function lg({bars:e,change:t}){let[n,r]=(0,d.useState)(null),i=(0,d.useRef)(null),a=e.map(e=>e.close),o=a.filter(Number.isFinite);if(o.length<2)return null;let s=Math.min(...o),c=Math.max(...o),l=c-s||1,u=dg(s,l),f=fg(c,l),p=f-u||1,m=pg(u,f,4),h=e=>48+e/(a.length-1||1)*540,g=e=>178-(e-u)/p*170,_=a.map((e,t)=>Number.isFinite(e)?`${t===0?`M`:`L`}${h(t).toFixed(1)},${g(e).toFixed(1)}`:``).filter(Boolean).join(` `),v=`${_} L${h(a.length-1).toFixed(1)},${178 .toFixed(1)} L${48 .toFixed(1)},${178 .toFixed(1)} Z`,y=t>=0,b=y?`hsl(var(--tw-success))`:`hsl(var(--tw-destructive))`,S=y?`hsl(var(--tw-success) / 0.08)`:`hsl(var(--tw-destructive) / 0.08)`,C=mg(a.length,4),w=e=>{let t=i.current;if(!t)return;let n=t.getBoundingClientRect(),o=(e.clientX-n.left)/n.width*600;r(Math.max(0,Math.min(a.length-1,Math.round((o-48)/540*(a.length-1)))))},T=()=>r(null),E=n==null?null:e[n],D=E?h(n):null,O=E?g(E.close):null;return(0,x.jsxs)(`div`,{ref:i,className:`relative -mx-1 select-none`,onMouseMove:w,onMouseLeave:T,onTouchEnd:T,children:[(0,x.jsxs)(`svg`,{viewBox:`0 0 600 200`,preserveAspectRatio:`none`,className:`block h-44 w-full`,role:`img`,"aria-label":`Price history chart`,children:[m.map(e=>{let t=g(e);return(0,x.jsxs)(`g`,{children:[(0,x.jsx)(`line`,{x1:48,y1:t,x2:588,y2:t,stroke:`hsl(var(--tw-border))`,strokeWidth:`1`,vectorEffect:`non-scaling-stroke`,strokeDasharray:`2 4`}),(0,x.jsx)(`text`,{x:42,y:t+3,textAnchor:`end`,className:`fill-muted-foreground`,style:{fontSize:10,fontVariantNumeric:`tabular-nums`},children:hg(e,p)})]},`y-${e}`)}),C.map(t=>(0,x.jsx)(`text`,{x:h(t),y:194,textAnchor:t===0?`start`:t===a.length-1?`end`:`middle`,className:`fill-muted-foreground`,style:{fontSize:10},children:Vh(e[t].date)},`x-${t}`)),(0,x.jsx)(`path`,{d:v,fill:S,stroke:`none`}),(0,x.jsx)(`path`,{d:_,fill:`none`,stroke:b,strokeWidth:`1.5`,strokeLinejoin:`round`,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`}),E?(0,x.jsxs)(`g`,{children:[(0,x.jsx)(`line`,{x1:D,y1:8,x2:D,y2:178,stroke:`hsl(var(--tw-foreground) / 0.35)`,strokeWidth:`1`,strokeDasharray:`2 3`,vectorEffect:`non-scaling-stroke`}),(0,x.jsx)(`circle`,{cx:D,cy:O,r:`3`,fill:`hsl(var(--tw-card))`,stroke:b,strokeWidth:`1.5`,vectorEffect:`non-scaling-stroke`})]}):null]}),E?(0,x.jsx)(ug,{bar:E,index:n,bars:e}):null]})}function ug({bar:e,index:t,bars:n}){let r=n.length>1?t/(n.length-1)*100:50,i=r>60;return(0,x.jsxs)(`div`,{className:`pointer-events-none absolute top-1 -translate-x-1/2 rounded-md border border-border bg-card px-2 py-1.5 text-[11px] tabular-nums shadow-subtle-xs`,style:{left:`${r}%`,transform:`translateX(${i?`-100%`:`0%`})`,marginLeft:i?-8:8},"aria-hidden":`true`,children:[(0,x.jsx)(`div`,{className:`font-medium text-foreground`,children:Rh(e.close)}),(0,x.jsx)(`div`,{className:`text-muted-foreground`,children:gg(e.date)}),Number.isFinite(e.high)&&Number.isFinite(e.low)?(0,x.jsxs)(`div`,{className:`mt-0.5 text-muted-foreground/80`,children:[`H `,Rh(e.high),` · L `,Rh(e.low)]}):null]})}function dg(e,t){let n=10**Math.floor(Math.log10(t/4||1));return Math.floor(e/n)*n}function fg(e,t){let n=10**Math.floor(Math.log10(t/4||1));return Math.ceil(e/n)*n}function pg(e,t,n){let r=t-e;if(r<=0)return[e];let i=r/(n-1);return Array.from({length:n},(t,n)=>e+i*n)}function mg(e,t){if(e<=t)return Array.from({length:e},(e,t)=>t);let n=(e-1)/(t-1);return Array.from({length:t},(e,t)=>Math.round(n*t))}function hg(e,t){return t>=100?`$${Math.round(e)}`:t>=10?`$${e.toFixed(1)}`:`$${e.toFixed(2)}`}function gg(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?String(e):t.toLocaleString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`,hour:`2-digit`,minute:`2-digit`})}function _g({message:e,header:t,text:n}){let r=Ih(e),i=Array.isArray(r)?r:Array.isArray(r?.quotes)?r.quotes:Array.isArray(r?.symbols)?r.symbols:null;return!i||i.length===0?(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:n})]}):(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(`div`,{className:`grid gap-2`,children:i.map((e,t)=>{let n=e.symbol||e.ticker||e.name||e.id||`#${t+1}`,r=e.price??e.last??e.close,i=e.symbol||e.ticker||e.id||`${n}-${t}`;return(0,x.jsxs)(`div`,{className:`flex items-center justify-between rounded-md bg-secondary px-3 py-2.5`,children:[(0,x.jsx)(`span`,{className:`font-mono text-sm font-medium text-foreground`,children:n}),(0,x.jsx)(`span`,{className:`tabular-nums text-sm font-medium text-foreground`,children:Rh(r)}),(0,x.jsx)(qh,{value:e.change,percent:e.changePercent??e.changePct})]},i)})})]})}function vg(e){if(!e)return``;try{return new URL(e).hostname.replace(/^www\./,``)}catch{return String(e).replace(/^www\./,``).split(`/`)[0]||``}}function yg(e){let t=vg(e);if(!t)return``;let n=t.split(`.`);return n.length<=1?t:n.slice(-2,-1)[0]||t}var bg={xs:`size-3.5`,sm:`size-4`,md:`size-5`,lg:`size-6`};function xg({url:e,size:t=`sm`,className:n}){let r=vg(e),[i,a]=(0,d.useState)(!1);return(0,x.jsxs)(`span`,{className:X(`relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-secondary`,bg[t]??bg.sm,n),"aria-hidden":`true`,children:[r&&!i?(0,x.jsx)(`img`,{src:`https://www.google.com/s2/favicons?domain=${encodeURIComponent(r)}&sz=64`,alt:``,loading:`lazy`,className:`absolute inset-0 h-full w-full object-cover`,onError:()=>a(!0)}):(0,x.jsx)(Pd,{className:`h-3 w-3 text-muted-foreground`,strokeWidth:1.75}),(0,x.jsx)(`span`,{className:`pointer-events-none absolute inset-0 rounded-full ring-1 ring-inset ring-foreground/10`})]})}function Sg({url:e,label:t,title:n,snippet:r,className:i,onClick:a}){let o=yg(e)||t||e||`source`,s=!!(n||r),c=(0,x.jsxs)(`a`,{href:e||void 0,target:e?`_blank`:void 0,rel:e?`noreferrer`:void 0,onClick:a,className:X(`inline-flex items-center gap-1.5 rounded-full border border-border bg-card px-2 py-0.5 text-[11px] text-foreground transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,i),children:[(0,x.jsx)(xg,{url:e,size:`xs`}),(0,x.jsx)(`span`,{className:`max-w-[120px] truncate`,children:o})]});return s?(0,x.jsx)(mc,{delayDuration:200,skipDelayDuration:120,children:(0,x.jsxs)(hc,{children:[(0,x.jsx)(gc,{asChild:!0,children:c}),(0,x.jsx)(_c,{children:(0,x.jsxs)(vc,{side:`top`,sideOffset:6,className:`z-[60] max-w-[320px] rounded-lg border border-border bg-card p-3 text-left shadow-subtle-sm data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] text-muted-foreground`,children:[(0,x.jsx)(xg,{url:e,size:`xs`}),(0,x.jsx)(`span`,{className:`truncate`,children:vg(e)}),e?(0,x.jsx)(Ad,{className:`ml-auto h-3 w-3`,"aria-hidden":`true`}):null]}),n?(0,x.jsx)(`div`,{className:`mt-1.5 line-clamp-2 text-[13px] font-medium text-foreground`,children:n}):null,r?(0,x.jsx)(`div`,{className:`mt-1 line-clamp-3 text-xs leading-relaxed text-muted-foreground`,children:r}):null]})})]})}):c}function Cg({message:e,header:t,text:n}){let r=Ih(e),i=Array.isArray(r?.results)?r.results:Array.isArray(r)?r:null;return!i||i.length===0?(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:n})]}):(0,x.jsxs)(Q,{children:[t,r.query||i.length?(0,x.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[r.query?(0,x.jsxs)(x.Fragment,{children:[`“`,(0,x.jsx)(`span`,{className:`text-foreground`,children:r.query}),`” ·`,` `]}):null,i.length,` result`,i.length===1?``:`s`,r.provider?(0,x.jsxs)(x.Fragment,{children:[` · via `,r.provider]}):null]}):null,(0,x.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.slice(0,12).map((e,t)=>(0,x.jsx)(Sg,{url:e.url,title:e.title,snippet:e.snippet},`pill-${e.url||e.title||t}`))}),(0,x.jsx)(`ul`,{className:`grid gap-1.5`,children:i.slice(0,8).map((e,t)=>(0,x.jsx)(`li`,{children:(0,x.jsxs)(`a`,{href:e.url||void 0,target:e.url?`_blank`:void 0,rel:e.url?`noreferrer`:void 0,className:`grid grid-cols-[20px_minmax(0,1fr)_auto] items-start gap-2.5 rounded-md px-1 py-1.5 transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card`,children:[(0,x.jsx)(xg,{url:e.url,size:`sm`,className:`mt-0.5`}),(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`div`,{className:`line-clamp-1 text-[13px] font-medium text-foreground`,children:e.title}),e.snippet?(0,x.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-[11.5px] leading-relaxed text-muted-foreground`,children:e.snippet}):null,(0,x.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-1.5 text-[10.5px] text-muted-foreground`,children:[(0,x.jsx)(`span`,{className:`truncate`,children:vg(e.url)||e.source}),e.published?(0,x.jsxs)(`span`,{children:[`· `,Hh(e.published)]}):null,e.category&&e.category!==`general`?(0,x.jsx)(Vf,{variant:`outline`,size:`sm`,children:e.category}):null]})]})]})},`row-${e.url||e.title||t}`))})]})}function wg({message:e,header:t,text:n,sourceLabel:r}){let i=Ih(e),a=Number.isFinite(i?.sentimentScore)?i.sentimentScore:null,o=i?.bullishCount??0,s=i?.bearishCount??0;if(a===null&&o+s===0)return(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:n})]});let c=a===null?`text-foreground`:a>.15?`text-success`:a<-.15?`text-destructive`:`text-foreground`,l=(i?.tweets||i?.posts||[]).slice(0,4),u=i?.query||i?.subreddit,d=i?.insight||null;return(0,x.jsxs)(Q,{children:[t,r||u?(0,x.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[r?(0,x.jsx)(`span`,{children:r}):null,r&&u?(0,x.jsx)(`span`,{children:` · `}):null,u?(0,x.jsx)(`span`,{className:`font-mono text-foreground`,children:u}):null]}):null,a===null?null:(0,x.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-3`,children:[(0,x.jsxs)(`span`,{className:`text-3xl font-semibold tabular-nums tracking-tight ${c}`,children:[a>=0?`+`:`−`,Math.abs(a).toFixed(2)]}),(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:kg(a)})]}),(0,x.jsx)(Xh,{left:o,right:s,leftLabel:`Bullish ${o}`,rightLabel:`Bearish ${s}`}),(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-3`,children:[(0,x.jsx)($,{label:`Sample size`,value:i?.tweetCount??i?.postCount??l.length??`—`}),(0,x.jsx)($,{label:`Bullish`,value:o,tone:`success`}),(0,x.jsx)($,{label:`Bearish`,value:s,tone:`destructive`})]}),Array.isArray(i?.topMentions)&&i.topMentions.length>0?(0,x.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.topMentions.slice(0,8).map(e=>(0,x.jsx)(Vf,{variant:`outline`,className:`font-mono`,children:e},e))}):null,(0,x.jsx)(Dg,{insight:d}),l.length>0?(0,x.jsxs)(`div`,{className:`rounded-md border border-border`,children:[(0,x.jsx)(`div`,{className:`border-b border-border px-3 py-1.5 text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Top items`}),(0,x.jsx)(`ul`,{children:l.map((e,t)=>{let n=e.url||e.permalink;return(0,x.jsx)(`li`,{className:`border-b border-border last:border-b-0`,children:(0,x.jsxs)(`a`,{href:n||void 0,target:n?`_blank`:void 0,rel:n?`noreferrer`:void 0,className:`grid grid-cols-[20px_minmax(0,1fr)] items-start gap-2 px-3 py-2 transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card`,children:[(0,x.jsx)(xg,{url:n,size:`sm`,className:`mt-0.5`}),(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`p`,{className:`line-clamp-2 text-xs leading-relaxed text-foreground`,children:e.title||e.text}),(0,x.jsxs)(`div`,{className:`mt-0.5 flex flex-wrap items-center gap-1.5 text-[10.5px] text-muted-foreground`,children:[e.author?(0,x.jsx)(`span`,{children:e.author}):null,Number.isFinite(e.score)?(0,x.jsxs)(`span`,{children:[`· `,Lh(e.score),` pts`]}):null,Number.isFinite(e.likes)?(0,x.jsxs)(`span`,{children:[`· `,Lh(e.likes),` likes`]}):null,Number.isFinite(e.comments)?(0,x.jsxs)(`span`,{children:[`· `,Lh(e.comments),` comments`]}):null,e.created?(0,x.jsxs)(`span`,{children:[`· `,Hh(e.created)]}):null]})]})]})},e.id||t)})})]}):null]})}function Tg({message:e,header:t,text:n}){let r=Ih(e),i=Array.isArray(r?.fresh)?r.fresh:Array.isArray(r?.records)?r.records:null;if(!i||i.length===0)return(0,x.jsx)(wg,{message:e,header:t,text:n,sourceLabel:`Web sentiment`});let a=i.map(e=>e.sentiment?.score).filter(Number.isFinite),o=a.length?a.reduce((e,t)=>e+t,0)/a.length:null,s=a.filter(e=>e>.15).length,c=a.filter(e=>e<-.15).length,l=o===null?`text-foreground`:o>.15?`text-success`:o<-.15?`text-destructive`:`text-foreground`,u=Array.isArray(r?.trend)&&r.trend[0]?.values?r.trend[0].values.filter(Number.isFinite):null;return(0,x.jsxs)(Q,{children:[t,(0,x.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`Web sentiment`,` `,r?.query?(0,x.jsxs)(x.Fragment,{children:[`for `,(0,x.jsx)(`span`,{className:`font-mono text-foreground`,children:r.query})]}):null]}),o===null?null:(0,x.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-3`,children:[(0,x.jsxs)(`span`,{className:`text-3xl font-semibold tabular-nums tracking-tight ${l}`,children:[o>=0?`+`:`−`,Math.abs(o).toFixed(2)]}),(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:kg(o)})]}),(0,x.jsx)(Xh,{left:s,right:c,leftLabel:`Bullish ${s}`,rightLabel:`Bearish ${c}`,neutral:i.length-s-c,neutralLabel:`Neutral ${i.length-s-c}`}),u&&u.length>1?(0,x.jsx)(Jh,{values:u,height:48}):null,(0,x.jsx)(Dg,{insight:r?.insight}),(0,x.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.slice(0,10).map((e,t)=>(0,x.jsx)(Sg,{url:e.url,title:e.title,snippet:e.snippet||e.summary},`wp-${e.url||e.id||t}`))}),(0,x.jsx)(`ul`,{className:`grid gap-1`,children:i.slice(0,6).map((e,t)=>{let n=e.sentiment?.score,r=Number.isFinite(n)?n>.15?`text-success`:n<-.15?`text-destructive`:`text-muted-foreground`:`text-muted-foreground`;return(0,x.jsx)(`li`,{children:(0,x.jsxs)(e.url?`a`:`div`,{href:e.url||void 0,target:e.url?`_blank`:void 0,rel:e.url?`noreferrer`:void 0,className:`grid grid-cols-[20px_minmax(0,1fr)_auto] items-start gap-2.5 rounded-md px-1 py-1.5 transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card`,children:[(0,x.jsx)(xg,{url:e.url,size:`sm`,className:`mt-0.5`}),(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`div`,{className:`line-clamp-1 text-[12.5px] text-foreground`,children:e.title}),(0,x.jsxs)(`div`,{className:`mt-0.5 flex flex-wrap items-center gap-1.5 text-[10.5px] text-muted-foreground`,children:[e.author?(0,x.jsx)(`span`,{children:e.author}):null,e.published?(0,x.jsxs)(`span`,{children:[`· `,Hh(e.published)]}):null]})]}),(0,x.jsx)(`span`,{className:`shrink-0 text-[11px] tabular-nums ${r}`,children:Number.isFinite(n)?`${n>=0?`+`:`−`}${Math.abs(n).toFixed(2)}`:`—`})]})},e.id||e.url||t)})})]})}function Eg({message:e,header:t,text:n}){let r=Ih(e),i=r?.sources||r?.bySource||null,a=r?.insight||null,o=Number.isFinite(r?.score)?r.score:Number.isFinite(r?.aggregateScore)?r.aggregateScore:null,s=Array.isArray(r?.trend)?r.trend.map(e=>Number(e.score??e.value)).filter(Number.isFinite):null;return o===null&&!i?(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Dg,{insight:a}),(0,x.jsx)(Qh,{text:n})]}):(0,x.jsxs)(Q,{children:[t,o===null?null:(0,x.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-3`,children:[(0,x.jsxs)(`span`,{className:`text-3xl font-semibold tabular-nums tracking-tight ${o===null?`text-foreground`:o>.15?`text-success`:o<-.15?`text-destructive`:`text-foreground`}`,children:[o>=0?`+`:`−`,Math.abs(o).toFixed(2)]}),(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:kg(o)})]}),s&&s.length>1?(0,x.jsx)(Jh,{values:s,height:48}):null,(0,x.jsx)(Dg,{insight:a}),i?(0,x.jsx)(`div`,{className:`grid gap-1`,children:Object.entries(i).map(([e,t])=>{let n=typeof t==`object`?t.score??t.sentimentScore:t;return(0,x.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border py-1.5 last:border-b-0`,children:[(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,x.jsx)(`span`,{className:`text-sm font-medium tabular-nums text-foreground`,children:Number.isFinite(n)?n.toFixed(2):`—`})]},e)})}):null]})}function Dg({insight:e}){if(!e)return null;let t=e.confidence||{},n=Array.isArray(e.representativeItems)?e.representativeItems.length:0;return(0,x.jsxs)(`div`,{className:`grid gap-2 rounded-md border border-border bg-secondary/35 p-3`,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,x.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Findings`}),(0,x.jsxs)(Vf,{variant:`outline`,className:`capitalize`,children:[t.level||`unknown`,` confidence`]})]}),(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-3`,children:[(0,x.jsx)($,{label:`Scored sample`,value:e.sampleSize??`—`}),(0,x.jsx)($,{label:`With evidence`,value:e.scoredSampleSize??`—`}),(0,x.jsx)($,{label:`Preview shown`,value:n})]}),(0,x.jsx)(Og,{label:`Positive drivers`,drivers:e.positiveDrivers}),(0,x.jsx)(Og,{label:`Negative drivers`,drivers:e.negativeDrivers}),(0,x.jsx)(Og,{label:`Mixed drivers`,drivers:e.mixedDrivers}),Array.isArray(e.caveats)&&e.caveats.length>0?(0,x.jsxs)(`div`,{className:`grid gap-1`,children:[(0,x.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Caveats`}),(0,x.jsx)(`ul`,{className:`grid gap-1 text-[11.5px] leading-relaxed text-muted-foreground`,children:e.caveats.slice(0,3).map(e=>(0,x.jsx)(`li`,{children:e},e))})]}):null,n>0?(0,x.jsxs)(`p`,{className:`text-[11.5px] leading-relaxed text-muted-foreground`,children:[`Representative evidence preview: `,n,` shown from`,` `,e.scoredSampleSize??`the scored`,` scored records`,e.sampleSize==null?`.`:` (${e.sampleSize} total records).`]}):null]})}function Og({label:e,drivers:t}){return!Array.isArray(t)||t.length===0?null:(0,x.jsxs)(`div`,{className:`grid gap-1`,children:[(0,x.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:e}),(0,x.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:t.slice(0,4).map(e=>(0,x.jsxs)(Vf,{variant:`outline`,children:[`Source evidence: `,e.label,` (`,e.count,`)`]},`${e.polarity}-${e.label}`))})]})}function kg(e){return e>=.5?`strongly bullish`:e>=.15?`leaning bullish`:e<=-.5?`strongly bearish`:e<=-.15?`leaning bearish`:`neutral`}function Ag({message:e,header:t,text:n}){let r=Ih(e);if(!r||!r.symbol)return(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:n})]});let i=Array.isArray(r.calls)?r.calls:[],a=Array.isArray(r.puts)?r.puts:[],o=Number.isFinite(r.totalCallVolume)?r.totalCallVolume:i.reduce((e,t)=>e+(t.volume||0),0),s=Number.isFinite(r.totalPutVolume)?r.totalPutVolume:a.reduce((e,t)=>e+(t.volume||0),0),c=[...i,...a].map(e=>e.impliedVolatility).filter(Number.isFinite),l=c.length?c.reduce((e,t)=>e+t,0)/c.length:null,u=i.filter(e=>!e.inTheMoney).slice(0,4),d=a.filter(e=>!e.inTheMoney).slice(0,4);return(0,x.jsxs)(Q,{children:[t,(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-3`,children:[(0,x.jsx)(`span`,{className:`font-mono text-base font-medium text-foreground`,children:r.symbol}),(0,x.jsx)(`span`,{className:`text-xl font-semibold tabular-nums tracking-tight text-foreground`,children:Rh(r.underlyingPrice)}),(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`underlying`})]}),(0,x.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Expiration `,Vh(r.expirationDate),` · `,r.expirationDates?.length??0,` dates available`]})]}),(0,x.jsx)(Xh,{left:o,right:s,leftLabel:`Calls ${Lh(o)}`,rightLabel:`Puts ${Lh(s)}`}),(0,x.jsxs)(`div`,{className:`text-[11px] tabular-nums text-muted-foreground`,children:[`Put/Call ratio`,` `,(0,x.jsx)(`span`,{className:`text-foreground`,children:Number.isFinite(r.putCallRatio)?r.putCallRatio.toFixed(2):`—`})]}),(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-4`,children:[(0,x.jsx)($,{label:`Avg IV`,value:Number.isFinite(l)?`${(l*100).toFixed(1)}%`:`—`}),(0,x.jsx)($,{label:`Call contracts`,value:i.length}),(0,x.jsx)($,{label:`Put contracts`,value:a.length}),(0,x.jsx)($,{label:`Total volume`,value:Lh(o+s)})]}),u.length>0||d.length>0?(0,x.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[u.length>0?(0,x.jsx)(jg,{title:`OTM calls`,rows:u}):null,d.length>0?(0,x.jsx)(jg,{title:`OTM puts`,rows:d}):null]}):null]})}function jg({title:e,rows:t}){return(0,x.jsxs)(`div`,{className:`rounded-md border border-border`,children:[(0,x.jsx)(`div`,{className:`border-b border-border px-3 py-1.5 text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:e}),(0,x.jsx)(`ul`,{children:t.map(e=>(0,x.jsxs)(`li`,{className:`grid grid-cols-3 items-center gap-2 border-b border-border px-3 py-1.5 last:border-b-0 text-xs tabular-nums`,children:[(0,x.jsx)(`span`,{className:`text-foreground`,children:Rh(e.strike)}),(0,x.jsxs)(`span`,{className:`text-muted-foreground`,children:[`last `,Rh(e.lastPrice)]}),(0,x.jsxs)(`span`,{className:`text-right text-muted-foreground`,children:[`IV`,` `,Number.isFinite(e.impliedVolatility)?`${(e.impliedVolatility*100).toFixed(0)}%`:`—`]})]},e.contractSymbol))})]})}function Mg({message:e,header:t,text:n}){let r=Ih(e),i=Array.isArray(r?.positions)?r.positions:null;return!i||i.length===0?(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:n})]}):(r.totalPnl,(0,x.jsxs)(Q,{children:[t,(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-3`,children:[(0,x.jsxs)(`span`,{className:`text-[2rem] font-semibold leading-none tabular-nums tracking-tight text-foreground`,children:[`$`,Lh(r.totalValue)]}),(0,x.jsx)(qh,{value:r.totalPnl,percent:r.totalPnlPercent,size:`lg`})]}),(0,x.jsxs)(`div`,{className:`mt-1.5 text-xs text-muted-foreground`,children:[i.length,` position`,i.length===1?``:`s`,` · cost basis $`,Lh(r.totalCost)]})]}),(0,x.jsxs)(`div`,{className:`rounded-md border border-border`,children:[(0,x.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto_auto_auto] items-center gap-3 border-b border-border px-3 py-1.5 text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:[(0,x.jsx)(`span`,{children:`Symbol`}),(0,x.jsx)(`span`,{className:`text-right`,children:`Value`}),(0,x.jsx)(`span`,{className:`text-right`,children:`Weight`}),(0,x.jsx)(`span`,{className:`text-right`,children:`P&L`})]}),(0,x.jsx)(`ul`,{children:i.map(e=>{let t=r.totalValue?e.marketValue/r.totalValue*100:0;return(0,x.jsxs)(`li`,{className:`grid grid-cols-[1fr_auto_auto_auto] items-center gap-3 border-b border-border px-3 py-2 last:border-b-0`,children:[(0,x.jsxs)(`div`,{className:`grid`,children:[(0,x.jsx)(`span`,{className:`font-mono text-sm font-medium text-foreground`,children:e.symbol}),(0,x.jsxs)(`span`,{className:`text-[11px] tabular-nums text-muted-foreground`,children:[e.shares,` @ `,Rh(e.avgCost)]})]}),(0,x.jsxs)(`span`,{className:`text-right text-sm tabular-nums text-foreground`,children:[`$`,Lh(e.marketValue)]}),(0,x.jsxs)(`span`,{className:`text-right text-xs tabular-nums text-muted-foreground`,children:[t.toFixed(1),`%`]}),(0,x.jsx)(`span`,{className:`text-right`,children:(0,x.jsx)(qh,{percent:e.pnlPercent,prefix:``})})]},e.symbol)})})]})]}))}function Ng({message:e,header:t,text:n}){let r=Ih(e);if(!r?.symbol&&!Number.isFinite(r?.sharpeRatio)&&!Number.isFinite(r?.annualizedVolatility))return(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:n})]});let i=r.sharpeRatio>1?`success`:r.sharpeRatio<0?`destructive`:`default`,a=r.maxDrawdown<=-.3?`destructive`:r.maxDrawdown<=-.1?`default`:`success`;return(0,x.jsxs)(Q,{children:[t,r.symbol?(0,x.jsx)(`div`,{className:`font-mono text-sm font-medium text-foreground`,children:r.symbol}):null,(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 sm:grid-cols-3`,children:[(0,x.jsx)($,{label:`Annualized return`,value:Number.isFinite(r.annualizedReturn)?zh(r.annualizedReturn*100):`—`,tone:r.annualizedReturn>0?`success`:r.annualizedReturn<0?`destructive`:`default`}),(0,x.jsx)($,{label:`Volatility (annl.)`,value:Number.isFinite(r.annualizedVolatility)?zh(r.annualizedVolatility*100):`—`}),(0,x.jsx)($,{label:`Sharpe ratio`,value:Number.isFinite(r.sharpeRatio)?r.sharpeRatio.toFixed(2):`—`,tone:i}),(0,x.jsx)($,{label:`Max drawdown`,value:Number.isFinite(r.maxDrawdown)?zh(r.maxDrawdown*100):`—`,tone:a}),(0,x.jsx)($,{label:`VaR 95% (daily)`,value:Number.isFinite(r.var95)?zh(r.var95*100):`—`,tone:`destructive`})]})]})}function Pg({message:e,header:t,text:n}){let r=Ih(e),i=r?.matrix||r?.correlations||null,a=Array.isArray(r?.symbols)&&r.symbols.length>0?r.symbols:i&&typeof i==`object`?Object.keys(i):null;if(!i||!a||a.length===0)return(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:n})]});let o=Array.isArray(r?.warnings)?r.warnings:[];return(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-border`,children:(0,x.jsxs)(`table`,{className:`w-full border-collapse text-xs tabular-nums`,children:[(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{className:`bg-secondary`,children:[(0,x.jsx)(`th`,{className:`border-b border-border px-2 py-1.5 text-left text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:` `}),a.map(e=>(0,x.jsx)(`th`,{className:`border-b border-border px-2 py-1.5 text-right font-mono text-[11px] font-medium text-foreground`,children:e},e))]})}),(0,x.jsx)(`tbody`,{children:a.map(e=>(0,x.jsxs)(`tr`,{children:[(0,x.jsx)(`th`,{className:`border-b border-border px-2 py-1.5 text-left font-mono text-[11px] font-medium text-foreground`,children:e}),a.map(t=>{let n=i[e]?.[t]??i[t]?.[e];return(0,x.jsx)(`td`,{className:`border-b border-border px-2 py-1.5 text-right`,style:Number.isFinite(n)?{backgroundColor:Fg(n)}:void 0,children:Number.isFinite(n)?n.toFixed(2):`—`},t)})]},e))})]})}),(0,x.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Cell shading: green for positive correlation, red for negative.`}),o.length>0?(0,x.jsx)(`ul`,{className:`grid gap-1 text-[11px] text-muted-foreground`,children:o.map((e,t)=>(0,x.jsxs)(`li`,{children:[`· `,e]},`${e}-${t}`))}):null]})}function Fg(e){let t=Math.max(-1,Math.min(1,e));return t>=0?`hsl(142 71% 35% / ${(t*.18).toFixed(3)})`:`hsl(0 84% 60% / ${(Math.abs(t)*.18).toFixed(3)})`}function Ig({message:e,header:t,text:n}){let r=Ih(e),i=Array.isArray(r?.symbols)?r.symbols:Array.isArray(r?.watchlist)?r.watchlist:Array.isArray(r)?r:null;return!i||i.length===0?(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:n})]}):(0,x.jsxs)(Q,{children:[t,(0,x.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[i.length,` symbol`,i.length===1?``:`s`]}),(0,x.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.map(e=>(0,x.jsx)(Vf,{variant:`outline`,className:`font-mono`,children:typeof e==`string`?e:e.symbol},typeof e==`string`?e:e.symbol))})]})}function Lg({message:e,header:t,text:n}){let r=Ih(e),i=Array.isArray(r?.filings)?r.filings:Array.isArray(r?.results)?r.results:Array.isArray(r)?r:null;if(!i||i.length===0)return(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:n})]});let a=r?.symbol,o=i[0]?.entityName;return(0,x.jsxs)(Q,{children:[t,(0,x.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[a?(0,x.jsx)(`span`,{className:`font-mono text-foreground`,children:a}):null,o?(0,x.jsxs)(`span`,{children:[` · `,o]}):null,(0,x.jsxs)(`span`,{children:[` `,`· `,i.length,` filing`,i.length===1?``:`s`]})]}),(0,x.jsx)(`ul`,{className:`grid gap-0.5`,children:i.slice(0,10).map((e,t)=>{let n=e.filedDate||e.filedAt||e.filingDate||e.acceptedAt,r=e.formType||e.form||e.type,i=e.periodOfReport,a=e.url||e.documentUrl||e.link,o=e.accessionNumber;return(0,x.jsx)(`li`,{children:(0,x.jsxs)(a?`a`:`div`,{href:a||void 0,target:a?`_blank`:void 0,rel:a?`noreferrer`:void 0,className:`grid grid-cols-[20px_auto_minmax(0,1fr)_auto] items-center gap-2 rounded-md px-1 py-1.5 transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card`,children:[(0,x.jsx)(xg,{url:`https://www.sec.gov`,size:`sm`}),(0,x.jsx)(Vf,{variant:`outline`,size:`sm`,className:`font-mono`,children:r||`—`}),(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`div`,{className:`truncate text-[12.5px] text-foreground`,children:i?`Period ${i}`:e.title||e.description||e.primaryDocument||`Filing`}),o?(0,x.jsx)(`div`,{className:`truncate font-mono text-[10.5px] text-muted-foreground`,children:o}):null]}),(0,x.jsx)(`span`,{className:`whitespace-nowrap text-[10.5px] tabular-nums text-muted-foreground`,children:n?Hh(n):`—`})]})},o||`${r}-${n}-${t}`)})})]})}function Rg({message:e,header:t,text:n}){let r=Ih(e),i=(0,d.useMemo)(()=>zg(r),[r]);return i?(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:n}),(0,x.jsx)(Vg,{series:i}),(0,x.jsx)(Hg,{series:i}),(0,x.jsx)(Ug,{series:i})]}):(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:n})]})}function zg(e){if(!e)return null;let t=Bg(e.sma20),n=Bg(e.sma50),r=Bg(e.rsi),i=Bg(e.macd).map(e=>e&&typeof e==`object`?e:null).filter(Boolean),a=Bg(e.bb).map(e=>e&&typeof e==`object`?e:null).filter(Boolean),o=Bg(e.prices).filter(Number.isFinite),s=o.length?o:a.map(e=>e.middle);return s.length<2?null:{price:s,sma20:t,sma50:n,rsi:r,macdLine:i.map(e=>e.macd),macdSignal:i.map(e=>e.signal),macdHist:i.map(e=>e.histogram),bbUpper:a.map(e=>e.upper),bbLower:a.map(e=>e.lower)}}function Bg(e){return Array.isArray(e)?e:[]}function Vg({series:e}){let t=[...e.price,...e.sma20,...e.sma50,...e.bbUpper,...e.bbLower].filter(Number.isFinite);if(t.length<2)return null;let n=Math.min(...t),r=Math.max(...t),i=r-n||1,a=e=>160-(e-n)/i*152-4,o=Kg(e.bbUpper,e.bbLower,600,a),s=Gg(e.sma20,600,a),c=Gg(e.sma50,600,a),l=Gg(e.price,600,a);return(0,x.jsx)(Wg,{label:`Price`,height:160,legend:[{color:`currentColor`,label:`Close`},{color:`hsl(var(--tw-info))`,label:`SMA(20)`},{color:`hsl(var(--tw-warning))`,label:`SMA(50)`},{color:`hsl(var(--tw-foreground) / 0.18)`,label:`Bollinger`}],valueLabel:`$${n.toFixed(2)} – $${r.toFixed(2)}`,children:(0,x.jsxs)(`svg`,{viewBox:`0 0 600 160`,preserveAspectRatio:`none`,className:`block h-40 w-full`,children:[o?(0,x.jsx)(`path`,{d:o,fill:`hsl(var(--tw-foreground) / 0.06)`,stroke:`none`}):null,c?(0,x.jsx)(`path`,{d:c,fill:`none`,stroke:`hsl(var(--tw-warning))`,strokeWidth:`1`,strokeDasharray:`3 3`,vectorEffect:`non-scaling-stroke`}):null,s?(0,x.jsx)(`path`,{d:s,fill:`none`,stroke:`hsl(var(--tw-info))`,strokeWidth:`1`,vectorEffect:`non-scaling-stroke`}):null,l?(0,x.jsx)(`path`,{d:l,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinejoin:`round`,vectorEffect:`non-scaling-stroke`}):null]})})}function Hg({series:e}){if(e.rsi.length<2)return null;let t=e=>56-(e-0)/100*48-4,n=Gg(e.rsi,600,t),r=e.rsi[e.rsi.length-1];return(0,x.jsx)(Wg,{label:`RSI(14)`,height:56,valueLabel:(0,x.jsx)(`span`,{className:X(`tabular-nums`,r>=70?`text-warning`:r<=30?`text-info`:`text-muted-foreground`),children:Number.isFinite(r)?r.toFixed(1):`—`}),children:(0,x.jsxs)(`svg`,{viewBox:`0 0 600 56`,preserveAspectRatio:`none`,className:`block h-14 w-full`,children:[(0,x.jsx)(`line`,{x1:`0`,y1:t(70),x2:600,y2:t(70),stroke:`hsl(var(--tw-warning) / 0.5)`,strokeDasharray:`2 2`,strokeWidth:`1`,vectorEffect:`non-scaling-stroke`}),(0,x.jsx)(`line`,{x1:`0`,y1:t(30),x2:600,y2:t(30),stroke:`hsl(var(--tw-info) / 0.5)`,strokeDasharray:`2 2`,strokeWidth:`1`,vectorEffect:`non-scaling-stroke`}),n?(0,x.jsx)(`path`,{d:n,fill:`none`,stroke:`currentColor`,strokeWidth:`1.4`,vectorEffect:`non-scaling-stroke`}):null]})})}function Ug({series:e}){let t=e.macdHist.length>=2,n=e.macdLine.length>=2;if(!t&&!n)return null;let r=[...e.macdLine,...e.macdSignal,...e.macdHist].filter(Number.isFinite);if(r.length<2)return null;let i=Math.max(...r.map(Math.abs)),a=i*2||1,o=e=>70-(e+i)/a*62-4,s=e.macdLine[e.macdLine.length-1],c=e.macdSignal[e.macdSignal.length-1];return(0,x.jsx)(Wg,{label:`MACD`,height:70,legend:[{color:`currentColor`,label:`MACD`},{color:`hsl(var(--tw-warning))`,label:`Signal`},{color:`hsl(var(--tw-foreground) / 0.35)`,label:`Histogram`}],valueLabel:Number.isFinite(s)&&Number.isFinite(c)?(0,x.jsxs)(`span`,{className:`tabular-nums text-muted-foreground`,children:[s.toFixed(2),` / `,c.toFixed(2)]}):null,children:(0,x.jsxs)(`svg`,{viewBox:`0 0 600 70`,preserveAspectRatio:`none`,className:`block h-[70px] w-full`,children:[(0,x.jsx)(`line`,{x1:`0`,y1:o(0),x2:600,y2:o(0),stroke:`hsl(var(--tw-border))`,strokeWidth:`1`,vectorEffect:`non-scaling-stroke`}),e.macdHist.map((t,n)=>{if(!Number.isFinite(t))return null;let r=n/(e.macdHist.length-1)*600,i=o(0),a=o(t),s=t>=0;return(0,x.jsx)(`line`,{x1:r.toFixed(1),y1:i.toFixed(1),x2:r.toFixed(1),y2:a.toFixed(1),stroke:s?`hsl(var(--tw-success) / 0.6)`:`hsl(var(--tw-destructive) / 0.6)`,strokeWidth:`1.4`,vectorEffect:`non-scaling-stroke`},n)}),Gg(e.macdSignal,600,o)?(0,x.jsx)(`path`,{d:Gg(e.macdSignal,600,o),fill:`none`,stroke:`hsl(var(--tw-warning))`,strokeWidth:`1.2`,strokeDasharray:`3 3`,vectorEffect:`non-scaling-stroke`}):null,Gg(e.macdLine,600,o)?(0,x.jsx)(`path`,{d:Gg(e.macdLine,600,o),fill:`none`,stroke:`currentColor`,strokeWidth:`1.4`,vectorEffect:`non-scaling-stroke`}):null]})})}function Wg({label:e,valueLabel:t,legend:n,height:r,children:i}){return(0,x.jsxs)(`div`,{className:`grid gap-1.5 border-t border-border pt-2`,children:[(0,x.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,x.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,x.jsx)(`span`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:e}),n?(0,x.jsx)(`div`,{className:`hidden items-center gap-2 sm:flex`,children:n.map(e=>(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,x.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block h-1 w-3 rounded-sm`,style:{background:e.color}}),e.label]},e.label))}):null]}),t?(0,x.jsx)(`span`,{className:`text-[11px] tabular-nums text-muted-foreground`,children:t}):null]}),i]})}function Gg(e,t,n){let r=e.map((e,t)=>[t,e]).filter(([,e])=>Number.isFinite(e));if(r.length<2)return null;let i=e.length-1||1;return r.map(([e,r],a)=>{let o=e/i*t,s=n(r);return`${a===0?`M`:`L`}${o.toFixed(1)},${s.toFixed(1)}`}).join(` `)}function Kg(e,t,n,r){if(e.length<2||t.length!==e.length)return null;let i=e.length-1||1;return`${e.map((e,t)=>`${t===0?`M`:`L`}${(t/i*n).toFixed(1)},${r(e).toFixed(1)}`).join(` `)} ${t.map((e,t)=>`L${(t/i*n).toFixed(1)},${r(e).toFixed(1)}`).reverse().join(` `)} Z`}var qg=new Map([[`get_stock_quote`,{category:`Stock quote`,Component:og}],[`get_crypto_price`,{category:`Crypto price`,Component:sg}],[`compare_companies`,{category:`Comparison`,Component:_g}],[`get_stock_history`,{category:`Price history`,Component:cg}],[`get_crypto_history`,{category:`Price history`,Component:cg}],[`get_company_overview`,{category:`Company`,Component:$h}],[`get_financials`,{category:`Financials`,Component:eg}],[`get_earnings`,{category:`Earnings`,Component:tg}],[`compute_dcf`,{category:`DCF`,Component:ng}],[`get_option_chain`,{category:`Options chain`,Component:Ag}],[`get_technical_indicators`,{category:`Technical indicators`,Component:Rg}],[`get_economic_data`,{category:`Macro series`,Component:rg}],[`get_fear_greed`,{category:`Fear & greed`,Component:ig}],[`search_web`,{category:`Web search`,Component:Cg}],[`get_web_sentiment`,{category:`Web sentiment`,Component:Tg}],[`get_reddit_sentiment`,{category:`Reddit sentiment`,Component:e=>(0,x.jsx)(wg,{...e,sourceLabel:`Reddit`})}],[`get_twitter_sentiment`,{category:`Twitter sentiment`,Component:e=>(0,x.jsx)(wg,{...e,sourceLabel:`Twitter / X`})}],[`get_sentiment_summary`,{category:`Sentiment summary`,Component:Eg}],[`get_sentiment_trend`,{category:`Sentiment trend`,Component:Eg}],[`get_sec_filings`,{category:`SEC filings`,Component:Lg}],[`track_portfolio`,{category:`Portfolio`,Component:Mg}],[`analyze_risk`,{category:`Risk`,Component:Ng}],[`analyze_correlation`,{category:`Correlation`,Component:Pg}],[`manage_watchlist`,{category:`Watchlist`,Component:Ig}]]);function Jg(e){return qg.get(e)||null}function Yg({message:e,header:t,text:n}){return(0,x.jsxs)(Q,{children:[t,(0,x.jsx)(Qh,{text:n})]})}function Xg({message:e}){let t=bh(e.content),n=Ih(e),r=e.details?.source===`ui`,i=!!e.isError,a=Jg(e.toolName),o=a?.Component??Yg,s=a?.category??`Tool`,c=Zg(n,t);return(0,x.jsxs)(`div`,{className:`grid gap-2`,children:[(0,x.jsx)(o,{message:e,header:(0,x.jsxs)(`div`,{className:`grid gap-2`,children:[(0,x.jsx)(Wh,{category:s,title:Qg(e.toolName),manual:r,isError:i}),(0,x.jsx)(Gh,{items:c})]}),text:t}),(0,x.jsx)(Zh,{message:e,details:n,text:t})]})}function Zg(e,t){let n=[],r=`${JSON.stringify(e||{})}\n${t||``}`.toLowerCase();return(r.includes(`credential_required`)||r.includes(`api key`))&&n.push(`Credential required`),r.includes(`stale`)&&n.push(`Stale data`),(r.includes(`partial`)||r.includes(`degraded`))&&n.push(`Partial data`),r.includes(`delayed`)&&n.push(`Delayed data`),[...new Set(n)]}function Qg(e){return String(e||``).replace(/^get_/,``).replace(/_/g,` `)}function $g(e=[],t=[],n=``){let r=wf(e_(e,t)),i=r_([...r.tools.values()]),a=[];for(let e of r.messages){let t=i.get(e.id)||[],r=e.sessionId||n||``;if(e.customType){a.push({type:`custom_message`,id:`message-${e.id}`,messageId:e.id,sessionId:r,customType:e.customType,content:e.content});continue}if(e.role===`user`){a.push({type:`user_message`,id:`message-${e.id}`,messageId:e.id,sessionId:r,content:e.content});continue}if(e.role===`assistant`){let n=t_(e,t,r);n.length>0&&!o_(n)&&a.push({type:`assistant_message`,id:`message-${e.id}`,sessionId:r,content:n,messageId:e.id})}for(let e of t)!e.output&&!e.error||a_(e)||a.push({type:`tool_result`,id:`tool-${e.id}`,sessionId:e.sessionId||r,message:n_(e)})}return i_(a)}function e_(e=[],t=[]){if(!t.length)return e;let n=e.reduce((e,t)=>Math.max(e,Number(t.seq)||0),0),r=t.map((e,t)=>({...e,seq:n+t+1}));return[...e,...r]}function t_(e,t,n=``){let r=(e.content||[]).map(e=>{if(e.type===`tool`){let r=t.find(t=>t.id===e.toolCallId);return{type:`toolCall`,id:e.toolCallId,name:r?.name||`tool`,arguments:r?.input||{},sessionId:r?.sessionId||n}}return e}),i=new Set(r.filter(e=>e.type===`toolCall`).map(e=>e.id));for(let e of t)i.has(e.id)||a_(e)||r.push({type:`toolCall`,id:e.id,name:e.name,arguments:e.input||{},sessionId:e.sessionId||n});return r}function n_(e){return e.output?{role:`toolResult`,toolCallId:e.id,toolName:e.name,content:e.output.content||[],details:e.output.details,isError:!!e.output.isError,sessionId:e.sessionId||``}:{role:`toolResult`,toolCallId:e.id,toolName:e.name,content:[{type:`text`,text:e.error?.message||`Tool failed`}],details:e.error?.details,isError:!0,sessionId:e.sessionId||``}}function r_(e){let t=new Map;for(let n of e){let e=t.get(n.messageId)||[];e.push(n),t.set(n.messageId,e)}return t}function i_(e){let t=[];for(let n of e){let e=t[t.length-1];n.type===`user_message`&&e?.type===`user_message`&&bh(n.content)===bh(e.content)||t.push(n)}return t}function a_(e){return String(e.id||``).startsWith(`background-`)||e.output?.source===`background`||e.output?.details?.source===`background`}function o_(e){return e.some(e=>e.type===`toolCall`&&String(e.id||``).startsWith(`background-`))}function s_({sources:e,className:t,onClick:n,label:r}){if(!e?.length)return null;let i=e.slice(0,4),a=e.length,o=typeof n==`function`;return(0,x.jsxs)(o?`button`:`div`,{type:o?`button`:void 0,onClick:n,className:X(`inline-flex items-center gap-1.5 overflow-hidden rounded-full border border-border bg-card pl-1 pr-2 py-0.5 text-[11px]`,o&&`cursor-pointer transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,t),children:[(0,x.jsx)(`span`,{className:`flex flex-row`,children:i.map((e,t)=>(0,x.jsx)(`span`,{className:`-mr-1 last:mr-0`,children:(0,x.jsx)(xg,{url:e.url,size:`xs`,className:`ring-1 ring-card`})},`${e.url||t}`))}),(0,x.jsxs)(`span`,{className:`text-foreground`,children:[a,` `,r??(a===1?`source`:`sources`)]})]})}var c_={get_stock_quote:{icon:id,label:`Stock quote`,group:`market`},get_crypto_price:{icon:kd,label:`Crypto price`,group:`market`},compare_companies:{icon:Nd,label:`Comparison`,group:`market`},get_stock_history:{icon:nd,label:`Price history`,group:`market`},get_crypto_history:{icon:nd,label:`Price history`,group:`market`},get_company_overview:{icon:Cd,label:`Company overview`,group:`fundamentals`},get_financials:{icon:xd,label:`Financials`,group:`fundamentals`},get_earnings:{icon:Ud,label:`Earnings`,group:`fundamentals`},compute_dcf:{icon:wd,label:`DCF valuation`,group:`fundamentals`},get_option_chain:{icon:dd,label:`Options chain`,group:`options`},get_technical_indicators:{icon:gd,label:`Technical indicators`,group:`technical`},get_economic_data:{icon:rd,label:`Economic data`,group:`macro`},get_fear_greed:{icon:Md,label:`Fear & greed`,group:`macro`},search_web:{icon:Kd,label:`Web search`,group:`research`},get_sec_filings:{icon:jd,label:`SEC filings`,group:`research`},get_web_sentiment:{icon:Pd,label:`Web sentiment`,group:`sentiment`},get_reddit_sentiment:{icon:zd,label:`Reddit sentiment`,group:`sentiment`},get_twitter_sentiment:{icon:yd,label:`Twitter sentiment`,group:`sentiment`},get_sentiment_summary:{icon:ad,label:`Sentiment summary`,group:`sentiment`},get_sentiment_trend:{icon:Zd,label:`Sentiment trend`,group:`sentiment`},track_portfolio:{icon:Y,label:`Portfolio`,group:`portfolio`},analyze_risk:{icon:hd,label:`Risk analysis`,group:`portfolio`},analyze_correlation:{icon:Bd,label:`Correlation`,group:`portfolio`},manage_watchlist:{icon:Id,label:`Watchlist`,group:`portfolio`},ask_user:{icon:cd,label:`Question`,group:`interaction`}};function l_(e){return c_[e]||{icon:Qd,label:u_(e),group:`tool`}}function u_(e){return String(e||`tool`).replace(/^get_/,``).replace(/_/g,` `)}function d_({name:e,size:t=`md`,className:n,status:r}){let i=l_(e).icon;return(0,x.jsx)(`span`,{"aria-hidden":`true`,className:X(`inline-flex shrink-0 items-center justify-center rounded-md border`,t===`sm`?`size-5 [&_svg]:size-3`:t===`lg`?`size-7 [&_svg]:size-4`:`size-6 [&_svg]:size-3.5`,r===`error`?`border-destructive/40 bg-destructive/10 text-destructive`:`border-amber-700/40 bg-amber-100/70 text-amber-800 dark:border-amber-300/30 dark:bg-amber-950/40 dark:text-amber-300`,n),children:(0,x.jsx)(i,{strokeWidth:2})})}function f_(e){if(!e?.length)return`Working`;let t=new Set(e.map(e=>l_(e).group));return t.has(`research`)||t.has(`sentiment`)?t.has(`market`)||t.has(`fundamentals`)?`Research & analysis`:`Research`:t.has(`portfolio`)?`Portfolio analysis`:t.has(`interaction`)?`Question`:t.has(`fundamentals`)?`Fundamental analysis`:t.has(`technical`)?`Technical analysis`:t.has(`macro`)?`Macro lookup`:t.has(`market`)?`Market lookup`:e.length===1?l_(e[0]).label:`Steps`}function p_(e){if(!e?.steps)return[];let t=new Set,n=[];for(let r of e.steps){let e=r.result;if(!e)continue;let i=e.details?.value??e.details??{},a=m_(r.name,i);for(let e of a){let r=e.url||`${e.title||``}::${e.source||``}`;!r||t.has(r)||(t.add(r),n.push(e))}}return n}function m_(e,t){if(!t||typeof t!=`object`)return[];if(Array.isArray(t.results))return t.results.filter(e=>e&&(e.url||e.title)).map(e=>({url:e.url,title:e.title,snippet:e.snippet,source:e.source,published:e.published}));let n=Array.isArray(t.fresh)?t.fresh:Array.isArray(t.records)?t.records:null;if(n)return n.filter(e=>e&&(e.url||e.title)).map(e=>({url:e.url,title:e.title,snippet:e.snippet??e.summary,source:e.source??e.publisher,published:e.published}));if(Array.isArray(t.filings))return t.filings.filter(e=>e&&(e.url||e.documentUrl||e.link)).slice(0,20).map(e=>({url:e.url||e.documentUrl||e.link,title:`${e.formType||e.form||`Filing`}${e.periodOfReport?` · ${e.periodOfReport}`:``}`,snippet:e.entityName||e.title||e.description,source:`sec.gov`,published:e.filedDate||e.filedAt}));let r=Array.isArray(t.tweets)?t.tweets:Array.isArray(t.posts)?t.posts:null;return r?r.filter(e=>e&&(e.url||e.permalink)).slice(0,20).map(e=>({url:e.url||e.permalink,title:e.title||e.text,snippet:e.text||e.body,source:e.author||e.subreddit,published:e.created})):Array.isArray(t.sources)&&t.sources.every(e=>typeof e==`object`)?t.sources.filter(e=>e&&e.url).map(e=>({url:e.url,title:e.title,source:e.name,snippet:e.snippet})):[]}var h_=(0,d.createContext)(null);function g_({activeSessionId:e=``,children:t}){let[n,r]=(0,d.useState)(null),i=(0,d.useRef)(new Set);(0,d.useEffect)(()=>{!n||!e||n.sessionId&&n.sessionId!==e&&r(null)},[e,n]);let a=(0,d.useCallback)(t=>{t&&(e&&t.sessionId&&t.sessionId!==e||r(t))},[e]),o=(0,d.useCallback)(()=>{r(null)},[]),s=(0,d.useCallback)(t=>{if(t?.status!==`pending`||e&&t.sessionId&&t.sessionId!==e)return;let n=v_(t);i.current.has(n)||(i.current.add(n),r(t))},[e]),c=(0,d.useMemo)(()=>({run:n,open:a,close:o,requestAutoOpen:s}),[n,a,o,s]);return(0,x.jsx)(h_.Provider,{value:c,children:t})}function __(){let e=(0,d.useContext)(h_);if(!e)throw Error(`useToolDrawer must be used inside ToolDrawerProvider`);return e}function v_(e){return`${e?.sessionId||``}::${e?.id||``}`}function y_({run:e,autoOpen:t=!1}){let{open:n,requestAutoOpen:r,run:i}=__(),a=i?.id===e.id&&(i?.sessionId||``)===(e.sessionId||``),o=e.steps.length,s=f_(e.steps.map(e=>e.name)),c=e.status===`pending`,l=e.status===`error`,u=e.steps.filter(e=>e.status===`completed`).length,f=p_(e);(0,d.useEffect)(()=>{t&&r(e)},[t,e,r]);let p=e.steps.find(e=>e.status===`pending`),m=p?l_(p.name):null;return(0,x.jsxs)(`div`,{className:`max-w-[760px]`,children:[(0,x.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground`,children:[c?(0,x.jsx)(fd,{className:`h-3.5 w-3.5 animate-spin`,"aria-hidden":`true`}):null,(0,x.jsx)(`span`,{children:c?`Working`:l?`Tool error`:`Answer`})]}),(0,x.jsxs)(`button`,{type:`button`,onClick:()=>n(e),className:X(`group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-left shadow-subtle-xs transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,a&&`bg-secondary`),"aria-expanded":a,children:[(0,x.jsx)(b_,{run:e}),(0,x.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,x.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:s}),c?(0,x.jsx)(Ah,{className:`block truncate text-[11px]`,children:m?`Calling ${m.label.toLowerCase()}${x_(p)?` · ${x_(p)}`:``}`:`Working · ${u} of ${o} ${o===1?`step`:`steps`} done`}):(0,x.jsxs)(`div`,{className:`truncate text-[11px] text-muted-foreground`,children:[u,` of `,o,` `,o===1?`step`:`steps`,f.length>0?` · ${f.length} ${f.length===1?`source`:`sources`}`:``]})]}),f.length>0&&!c?(0,x.jsx)(`span`,{className:`hidden sm:inline-flex`,children:(0,x.jsx)(s_,{sources:f})}):null,(0,x.jsxs)(Vf,{variant:`outline`,size:`sm`,className:`shrink-0 font-mono`,children:[o,` `,o===1?`step`:`steps`]}),(0,x.jsx)(Dd,{className:`h-4 w-4 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5`,"aria-hidden":`true`})]})]})}function b_({run:e}){let t=e.steps[0];return t?(0,x.jsx)(d_,{name:t.name,size:`lg`,status:e.status===`error`?`error`:void 0}):(0,x.jsx)(kh,{status:`pending`})}function x_(e){if(!e?.args)return``;let t=Object.entries(e.args).filter(([,e])=>e!=null&&e!==``);if(t.length===0)return``;let[,n]=t[0],r=typeof n==`string`?n:typeof n==`number`?String(n):null;return r?r.length>24?`${r.slice(0,24)}…`:r:``}function S_(e){return typeof e==`string`?e:Array.isArray(e)?e.filter(e=>e&&e.type!==`toolCall`&&e.type!==`tool`).map(e=>e.text||``).join(`
|
|
53
|
-
`).trim():``}function C_(e){let t=[],n=null,r=``,i=()=>{n&&=(n.status=T_(n.steps),t.push(n),null)};for(let a of e){if(a.type!==`assistant_message`&&a.type!==`tool_result`&&a.type!==`user_message`){i(),t.push(a);continue}if(a.type===`user_message`){i(),r=``,t.push(a);continue}if(a.type===`assistant_message`){let e=(Array.isArray(a.content)?a.content:[]).filter(e=>e?.type===`toolCall`),o=S_(a.content);if(e.length===0){i(),r=``,o&&t.push(a);continue}if(!n)n=w_(e[0],a.sessionId),n.narrationBefore=(r||o||``).trim(),r=``;else if(o){let e=n.steps[n.steps.length-1];e&&(e.narrationAfter=`${e.narrationAfter||``}${e.narrationAfter?`
|
|
54
|
-
|
|
55
|
-
`:``}${o}`.trim())}for(let t of e)n.steps.push({id:t.id,name:t.name,args:t.arguments||{},status:`pending`,result:null,messageId:a.messageId,sessionId:t.sessionId||a.sessionId||n.sessionId||``});continue}if(a.type===`tool_result`){let e=a.message;n||(n={type:`tool_run`,id:`run-${e.toolCallId||a.id}`,sessionId:a.sessionId||e.sessionId||``,steps:[],status:`pending`,narrationBefore:``,entryRange:[t.length,t.length]},n.steps.push({id:e.toolCallId,name:e.toolName,args:{},status:`pending`,result:null,messageId:null,sessionId:a.sessionId||e.sessionId||``}));let r=n.steps.find(t=>t.id===e.toolCallId)??n.steps.find(t=>t.name===e.toolName&&!t.result);r?(r.result=e,r.status=e.isError?`error`:`completed`):n.steps.push({id:e.toolCallId,name:e.toolName,args:{},status:e.isError?`error`:`completed`,result:e,messageId:null,sessionId:a.sessionId||e.sessionId||n.sessionId||``});continue}i(),t.push(a)}return i(),t}function w_(e,t=``){return{type:`tool_run`,id:`run-${e.id}`,sessionId:e.sessionId||t||``,steps:[],status:`pending`,narrationBefore:``,entryRange:[]}}function T_(e){return e.some(e=>e.status===`pending`)?`pending`:e.some(e=>e.status===`error`)?`error`:`completed`}function E_({events:e=[],liveEvents:t=[],askUserPrompts:n=[],modelSetup:r,role:i,inputDisabled:a=!1,sessionLoading:o=!1,runState:s,catalog:c,send:l,startChatRun:u,setToast:f,draft:p,setDraft:m,onOpenCommandPalette:h,onOpenSidebar:g,onOpenHome:_,onOpenContext:v,sidebarCollapsed:y,onExpandSidebar:b,sessionId:S=``,scrollAnchorId:C=``}){let[w,T]=(0,d.useState)(``),[E,D]=(0,d.useState)(!1),O=p===void 0?w:p,k=m??T,A=(0,d.useMemo)(()=>wf(t),[t]),j=(0,d.useMemo)(()=>$g(e,t,S),[e,t,S]),M=(0,d.useMemo)(()=>C_(j),[j]),N=(0,d.useMemo)(()=>z_(A,s),[A,s]),P=n.length>0,F=(0,d.useMemo)(()=>{if(!E)return null;let e=M.filter(e=>e.type===`tool_run`&&e.status===`pending`);return e[e.length-1]?.id??null},[E,M]),I=__(),ee=D_({rows:M,sessionId:S,scrollAnchorId:C,drawerOpen:!!(I.run&&(!I.run.sessionId||I.run.sessionId===S))}),te=C||F_(M);(0,d.useEffect)(()=>{if(!I.run)return;if(I.run.sessionId&&I.run.sessionId!==S){I.close();return}let e=M.find(e=>e.type===`tool_run`&&e.id===I.run.id&&(e.sessionId||``)===(I.run.sessionId||``));e&&e!==I.run&&I.open(e)},[M,I,S]),E&&!F&&s!==`connecting`&&s!==`streaming`&&D(!1);let ne=r?.requirement&&r.requirement!==`ready`,L=a,R=L||ne,z=(e=O)=>{let t=String(e||``).trim();if(t){if(ne){f?.(`Connect or select an AI model before sending this message.`);return}R||(D(!0),k(``),u(t))}},re=ne?`Draft a question, then connect a model to send`:`Ask anything`;return(0,x.jsxs)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background`,"data-run-state":s,children:[(0,x.jsx)(Fh,{onOpenSidebar:g,onOpenHome:_}),y?(0,x.jsx)(Ph,{onExpandSidebar:b}):null,(0,x.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,x.jsx)(`section`,{ref:ee.viewportRef,className:`h-full overflow-y-auto px-3 py-6 sm:px-6 md:px-12`,"data-chat-transcript":!0,"data-scroll-anchor-id":C||void 0,"aria-label":`Chat transcript`,onScroll:ee.onScroll,onWheel:ee.onReaderIntent,onMouseDown:ee.onReaderIntent,onTouchStart:ee.onReaderIntent,onKeyDown:ee.onReaderIntent,children:ne?(0,x.jsx)(oh,{modelSetup:r,role:i,send:l,setToast:f}):o?(0,x.jsx)(O_,{}):j.length===0&&!N&&!P?(0,x.jsx)(vh,{onPrompt:z,onOpenCatalog:h,disabled:R}):(0,x.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[1040px] flex-col gap-6`,children:[M.map(e=>(0,x.jsx)(M_,{entry:e,catalog:c,autoOpenToolRun:e.id===F,anchorRowId:te,anchorRef:ee.anchorRowRef},e.id)),n.map(e=>(0,x.jsx)(k_,{prompt:e,send:l},e.id)),N?(0,x.jsx)(j_,{activity:N}):null,(0,x.jsx)(`div`,{ref:ee.bottomRef,"data-chat-bottom-sentinel":!0,"aria-hidden":`true`})]})}),ee.showJumpToLatest?(0,x.jsxs)(Z,{type:`button`,size:`sm`,rounded:`full`,className:`absolute bottom-4 left-1/2 z-10 -translate-x-1/2 gap-1.5 shadow-subtle-md`,onClick:ee.jumpToLatest,"aria-label":`Jump to latest`,children:[(0,x.jsx)(_d,{className:`h-4 w-4`}),`Latest`]}):null]}),(0,x.jsx)(hh,{draft:O,setDraft:k,disabled:L,setupBlocked:ne,placeholder:re,canSend:!!O.trim()&&!R,onSubmit:()=>z(),onOpenCatalog:()=>h?.(`catalog`),onOpenContext:v,modelSetup:r,role:i,send:l,setToast:f})]})}function D_({rows:e,sessionId:t,scrollAnchorId:n,drawerOpen:r}){let i=(0,d.useRef)(null),a=(0,d.useRef)(null),[o,s]=(0,d.useState)(!1),c=(0,d.useRef)(!0),l=(0,d.useRef)(``),u=(0,d.useRef)(``),f=(0,d.useRef)(``),p=(0,d.useRef)(``),m=(0,d.useMemo)(()=>{for(let t=e.length-1;t>=0;--t)if(e[t].type===`user_message`)return e[t].id;return``},[e]),h=(0,d.useCallback)(()=>{let t=i.current;t&&s(e.length>0&&!P_(t))},[e.length]),g=(0,d.useCallback)(()=>{let e=a.current;if(e){e.scrollIntoView({block:`end`});return}let t=i.current;t&&(t.scrollTop=t.scrollHeight)},[]),_=(0,d.useCallback)(()=>{c.current=!0,g(),s(!1)},[g]),v=(0,d.useCallback)(e=>{if(!e)return;let r=n||m;if(!r)return;let i=`${t||``}::${r}`;window.setTimeout(()=>{if(p.current!==i)return;let t=e.closest(`[data-chat-transcript]`);t instanceof HTMLElement&&(R_(t,e),p.current=``,h())},0)},[m,n,t,h]),y=(0,d.useCallback)(()=>{let t=i.current;!t||P_(t)||(c.current=!1,s(e.length>0))},[e.length]),b=(0,d.useCallback)(()=>{let t=i.current;if(t){if(P_(t)){c.current=!0,s(!1);return}s(e.length>0)}},[e.length]);return(0,d.useEffect)(()=>{r&&(c.current=!1,h())},[r,h]),(0,d.useLayoutEffect)(()=>{if(!i.current||e.length===0){s(!1);return}let r=l.current!==t,a=u.current!==m,o=`${t||``}::${n||``}`,d=n&&f.current!==o,_=I_({hasNewExplicitAnchor:d,scrollAnchorId:n,sessionChanged:r,latestUserChanged:a,latestUserRowId:m,following:c.current});_&&(p.current=`${t||``}::${_}`),l.current=t,u.current=m;let v=()=>{let e=i.current;if(e){if(d&&L_(e,n,t)){f.current=o,c.current=!1,p.current=``,h();return}if(r){if(f.current=n?f.current:``,m&&L_(e,m,t)){c.current=!0,p.current=``,h();return}c.current=!0,g(),h();return}if(a&&m&&c.current){L_(e,m,t),c.current=!0,p.current=``,h();return}if(c.current||P_(e)){g(),s(!1);return}h()}};v();let y=window.setTimeout(v,0);return()=>window.clearTimeout(y)},[m,e.length,n,g,t,h]),{viewportRef:i,bottomRef:a,anchorRowRef:v,showJumpToLatest:o,jumpToLatest:_,onReaderIntent:y,onScroll:b}}function O_(){return(0,x.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[1040px] flex-col gap-6`,"aria-label":`Loading session`,role:`status`,children:[(0,x.jsxs)(`div`,{className:`grid max-w-[760px] gap-3`,children:[(0,x.jsx)(Oh,{className:`h-4 w-44`}),(0,x.jsx)(Oh,{className:`h-4 w-full`}),(0,x.jsx)(Oh,{className:`h-4 w-5/6`})]}),(0,x.jsxs)(`div`,{className:`ml-auto grid w-full max-w-[720px] gap-3`,children:[(0,x.jsx)(Oh,{className:`h-4 w-36 justify-self-end`}),(0,x.jsx)(Oh,{className:`h-4 w-full`}),(0,x.jsx)(Oh,{className:`h-4 w-2/3 justify-self-end`})]}),(0,x.jsxs)(`div`,{className:`grid max-w-[760px] gap-3`,children:[(0,x.jsx)(Oh,{className:`h-4 w-52`}),(0,x.jsx)(Oh,{className:`h-4 w-full`}),(0,x.jsx)(Oh,{className:`h-4 w-4/5`})]})]})}function k_({prompt:e,send:t}){let[n,r]=(0,d.useState)(``),i=e.status===`pending`,a=!i;return(0,x.jsxs)(`div`,{className:`max-w-[760px]`,children:[(0,x.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground`,children:[(0,x.jsx)(cd,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),(0,x.jsx)(`span`,{children:i?`Question`:e.status===`answered`?`Answered`:`Cancelled`})]}),(0,x.jsx)(`div`,{className:`rounded-lg border border-border bg-card px-3 py-3 shadow-subtle-xs`,children:(0,x.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,x.jsx)(`span`,{"aria-hidden":`true`,className:`mt-0.5 inline-flex size-7 shrink-0 items-center justify-center rounded-md border border-amber-700/40 bg-amber-100/70 text-amber-800 dark:border-amber-300/30 dark:bg-amber-950/40 dark:text-amber-300`,children:(0,x.jsx)(cd,{className:`size-4`})}),(0,x.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,x.jsx)(`div`,{className:`text-sm font-medium leading-relaxed text-foreground`,children:e.question}),e.reason?(0,x.jsx)(`div`,{className:`mt-1 text-[12px] leading-relaxed text-muted-foreground`,children:e.reason}):null,e.status===`answered`?(0,x.jsxs)(`div`,{className:`mt-2 rounded-md bg-secondary px-2 py-1.5 text-[12px] text-foreground`,children:[`Answer: `,(0,x.jsx)(`span`,{className:`font-medium`,children:e.answer})]}):e.status===`cancelled`?(0,x.jsx)(`div`,{className:`mt-2 text-[12px] text-muted-foreground`,children:`The question was cancelled.`}):(0,x.jsx)(A_,{prompt:e,draft:n,setDraft:r,disabled:a,onSubmit:i=>{let o=String(i??n).trim();!o||a||(t(`ask_user.answer`,{id:e.id,sessionId:e.sessionId,answer:o}),r(``))},onCancel:()=>{a||t(`ask_user.cancel`,{id:e.id,sessionId:e.sessionId})}})]})]})})]})}function A_({prompt:e,draft:t,setDraft:n,disabled:r,onSubmit:i,onCancel:a}){return e.questionType===`confirm`?(0,x.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,x.jsx)(Z,{size:`sm`,disabled:r,onClick:()=>i(`Yes`),children:`Answer yes`}),(0,x.jsx)(Z,{size:`sm`,variant:`bordered`,disabled:r,onClick:()=>i(`No`),children:`Answer no`}),(0,x.jsx)(Z,{size:`sm`,variant:`ghost`,disabled:r,onClick:a,"aria-label":`Cancel question`,children:(0,x.jsx)($d,{})})]}):e.questionType===`select`?(0,x.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(Array.isArray(e.options)?e.options:[]).map(e=>(0,x.jsx)(Z,{size:`sm`,variant:`bordered`,disabled:r,onClick:()=>i(e),children:e},e)),(0,x.jsx)(Z,{size:`sm`,variant:`ghost`,disabled:r,onClick:a,"aria-label":`Cancel question`,children:(0,x.jsx)($d,{})})]}):(0,x.jsxs)(`form`,{className:`mt-3 flex gap-2`,onSubmit:e=>{e.preventDefault(),i(t)},children:[(0,x.jsx)(ah,{value:t,onChange:e=>n(e.target.value),disabled:r,placeholder:e.placeholder||`Type an answer`,"aria-label":e.question}),(0,x.jsx)(Z,{type:`submit`,size:`icon`,disabled:r||!t.trim(),"aria-label":`Send answer`,children:(0,x.jsx)(qd,{})}),(0,x.jsx)(Z,{type:`button`,variant:`ghost`,size:`icon`,disabled:r,onClick:a,"aria-label":`Cancel question`,children:(0,x.jsx)($d,{})})]})}function j_({activity:e}){let t=!!e.thinkingText;return(0,x.jsxs)(`div`,{className:`max-w-[760px]`,children:[(0,x.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground`,children:[(0,x.jsx)(kh,{status:e.status}),(0,x.jsx)(Ah,{active:e.status===`pending`,children:t?`Analyzing`:`Working`})]}),t?(0,x.jsx)(`div`,{className:`border-l border-dashed border-border pl-4 text-sm leading-relaxed text-muted-foreground`,children:(0,x.jsx)(`div`,{className:X(`whitespace-pre-wrap`,e.status===`pending`&&`max-h-32 overflow-hidden`),children:V_(e.thinkingText)})}):null]})}function M_({entry:e,catalog:t,autoOpenToolRun:n=!1,anchorRowId:r=``,anchorRef:i}){let a=e.messageId||(String(e.id||``).startsWith(`message-`)?e.id.slice(8):``);return(0,x.jsx)(`div`,{ref:r&&(e.id===r||a===r||e.id===`message-${r}`)?i:void 0,"data-chat-row-id":e.id,"data-message-id":a||void 0,"data-session-id":e.sessionId||void 0,"data-scroll-anchor":e.type===`user_message`?`true`:void 0,className:`min-w-0 scroll-mt-6`,children:(0,x.jsx)(N_,{entry:e,catalog:t,autoOpenToolRun:n})})}function N_({entry:e,catalog:t,autoOpenToolRun:n=!1}){return e.type===`tool_run`?(0,x.jsx)(y_,{run:e,autoOpen:n}):e.type===`custom_message`?(0,x.jsx)(Dh,{customType:e.customType,content:e.content}):e.type===`user_message`?(0,x.jsx)(Th,{content:e.content}):e.type===`tool_result`?(0,x.jsx)(Xg,{message:e.message,catalog:t}):e.type===`assistant_message`?(0,x.jsx)(Eh,{content:e.content}):(0,x.jsx)(`div`,{className:`rounded-lg border border-border bg-card p-4 text-sm`,children:JSON.stringify(e)})}function P_(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=48}function F_(e){for(let t=e.length-1;t>=0;--t)if(e[t].type===`user_message`)return e[t].id;return``}function I_({hasNewExplicitAnchor:e=!1,scrollAnchorId:t=``,sessionChanged:n=!1,latestUserChanged:r=!1,latestUserRowId:i=``,following:a=!1}={}){return e?t:n&&i||r&&i&&a?i:``}function L_(e,t,n){if(!t)return!1;let r=[...e.querySelectorAll(`[data-chat-row-id]`)].find(e=>{if(n&&e.dataset.sessionId&&e.dataset.sessionId!==n)return!1;let r=e.dataset.chatRowId||``,i=e.dataset.messageId||``;return r===t||i===t||r===`message-${t}`});return r?(R_(e,r),!0):!1}function R_(e,t){let n=Math.max(0,t.offsetTop-e.clientHeight*.12);e.scrollTo({top:n,behavior:`auto`})}function z_(e,t){if(!(t===`connecting`||t===`streaming`))return null;let n=[...e.runs.values()],r=n.find(e=>e.status===`running`)||n.at(-1),i=r?B_(e,r):void 0,a=[...e.tools.values()].some(e=>e.status===`running`),o=e.messages.some(e=>e.role===`assistant`&&e.text.trim());return!i?.text&&(a||o)?null:{status:i?.status===`completed`?`completed`:`pending`,thinkingText:i?.text||``}}function B_(e,t){let n=`${t.sessionId||``}::${t.id}`;return e.thinking.get(n)||e.thinking.get(t.id)||[...e.thinking.values()].find(e=>e.runId===t.id&&e.sessionId===t.sessionId)}function V_(e){let t=String(e||``).trim().replace(/\n{3,}/g,`
|
|
56
|
-
|
|
57
|
-
`);return t.length<=700?t:`${t.slice(0,700).trimEnd()}...`}var H_=0;function U_(e,t){let n=String(e||``).trim();if(!n)return[];let r=String(t??``).trim(),i=`optimistic-user-${Date.now()}-${++H_}`;return[{type:`message.created`,messageId:i,role:`user`,sessionId:r,seq:-2},{type:`message.completed`,messageId:i,sessionId:r,content:[{type:`text`,text:n}],seq:-1}]}function W_(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var G_=d.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:`bottom`,shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),K_=()=>{let e=d.useContext(G_);if(!e)throw Error(`useDrawerContext must be used within a Drawer.Root`);return e};W_(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
|
|
58
|
-
[data-state=closed]
|
|
59
|
-
){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function q_(){let e=navigator.userAgent;return typeof window<`u`&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function J_(){return $_(/^Mac/)}function Y_(){return $_(/^iPhone/)}function X_(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Z_(){return $_(/^iPad/)||J_()&&navigator.maxTouchPoints>1}function Q_(){return Y_()||Z_()}function $_(e){return typeof window<`u`&&window.navigator!=null?e.test(window.navigator.platform):void 0}var ev=24,tv=typeof window<`u`?d.useLayoutEffect:d.useEffect;function nv(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}var rv=typeof document<`u`&&window.visualViewport;function iv(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function av(e){for(iv(e)&&(e=e.parentElement);e&&!iv(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}var ov=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]),sv=0,cv;function lv(e={}){let{isDisabled:t}=e;tv(()=>{if(!t)return sv++,sv===1&&Q_()&&(cv=uv()),()=>{sv--,sv===0&&cv?.()}},[t])}function uv(){let e,t=0,n=n=>{e=av(n.target),!(e===document.documentElement&&e===document.body)&&(t=n.changedTouches[0].pageY)},r=n=>{if(!e||e===document.documentElement||e===document.body){n.preventDefault();return}let r=n.changedTouches[0].pageY,i=e.scrollTop,a=e.scrollHeight-e.clientHeight;a!==0&&((i<=0&&r>t||i>=a&&r<t)&&n.preventDefault(),t=r)},i=e=>{let t=e.target;mv(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform=`translateY(-2000px)`,t.focus(),requestAnimationFrame(()=>{t.style.transform=``}))},a=e=>{let t=e.target;mv(t)&&(t.style.transform=`translateY(-2000px)`,requestAnimationFrame(()=>{t.style.transform=``,rv&&(rv.height<window.innerHeight?requestAnimationFrame(()=>{pv(t)}):rv.addEventListener(`resize`,()=>pv(t),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},s=window.pageXOffset,c=window.pageYOffset,l=nv(dv(document.documentElement,`paddingRight`,`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=nv(fv(document,`touchstart`,n,{passive:!1,capture:!0}),fv(document,`touchmove`,r,{passive:!1,capture:!0}),fv(document,`touchend`,i,{passive:!1,capture:!0}),fv(document,`focus`,a,!0),fv(window,`scroll`,o));return()=>{l(),u(),window.scrollTo(s,c)}}function dv(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function fv(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function pv(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=av(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,r=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+ev&&(t.scrollTop+=r-n)}e=t.parentElement}}function mv(e){return e instanceof HTMLInputElement&&!ov.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function hv(e,t){typeof e==`function`?e(t):e!=null&&(e.current=t)}function gv(...e){return t=>e.forEach(e=>hv(e,t))}function _v(...e){return d.useCallback(gv(...e),e)}var vv=new WeakMap;function yv(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([t,n])=>{if(t.startsWith(`--`)){e.style.setProperty(t,n);return}r[t]=e.style[t],e.style[t]=n}),!n&&vv.set(e,r)}function bv(e,t){if(!e||!(e instanceof HTMLElement))return;let n=vv.get(e);n&&(e.style[t]=n[t])}var xv=e=>{switch(e){case`top`:case`bottom`:return!0;case`left`:case`right`:return!1;default:return e}};function Sv(e,t){if(!e)return null;let n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform,i=r.match(/^matrix3d\((.+)\)$/);return i?parseFloat(i[1].split(`, `)[xv(t)?13:12]):(i=r.match(/^matrix\((.+)\)$/),i?parseFloat(i[1].split(`, `)[xv(t)?5:4]):null)}function Cv(e){return 8*(Math.log(e+1)-2)}function wv(e,t){if(!e)return()=>{};let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}var Tv={DURATION:.5,EASE:[.32,.72,0,1]},Ev=.4,Dv=.25,Ov=100,kv=8,Av=16,jv=26,Mv=`vaul-dragging`;function Nv(e){let t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...e)=>t.current==null?void 0:t.current.call(t,...e),[])}function Pv({defaultProp:e,onChange:t}){let n=d.useState(e),[r]=n,i=d.useRef(r),a=Nv(t);return d.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}function Fv({prop:e,defaultProp:t,onChange:n=()=>{}}){let[r,i]=Pv({defaultProp:t,onChange:n}),a=e!==void 0,o=a?e:r,s=Nv(n);return[o,d.useCallback(t=>{if(a){let n=typeof t==`function`?t(e):t;n!==e&&s(n)}else i(t)},[a,e,i,s])]}function Iv({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:i,fadeFromIndex:a,onSnapPointChange:o,direction:s=`bottom`,container:c,snapToSequentialPoint:l}){let[u,f]=Fv({prop:e,defaultProp:n?.[0],onChange:t}),[p,m]=d.useState(typeof window<`u`?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);d.useEffect(()=>{function e(){m({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let h=d.useMemo(()=>u===n?.[n.length-1]||null,[n,u]),g=d.useMemo(()=>n?.findIndex(e=>e===u)??null,[n,u]),_=n&&n.length>0&&(a||a===0)&&!Number.isNaN(a)&&n[a]===u||!n,v=d.useMemo(()=>{let e=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};return n?.map(t=>{let n=typeof t==`string`,r=0;if(n&&(r=parseInt(t,10)),xv(s)){let i=n?r:p?t*e.height:0;return p?s===`bottom`?e.height-i:-e.height+i:i}let i=n?r:p?t*e.width:0;return p?s===`right`?e.width-i:-e.width+i:i})??[]},[n,p,c]),y=d.useMemo(()=>g===null?null:v?.[g],[v,g]),b=d.useCallback(e=>{let t=v?.findIndex(t=>t===e)??null;o(t),yv(r.current,{transition:`transform ${Tv.DURATION}s cubic-bezier(${Tv.EASE.join(`,`)})`,transform:xv(s)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),v&&t!==v.length-1&&a!==void 0&&t!==a&&t<a?yv(i.current,{transition:`opacity ${Tv.DURATION}s cubic-bezier(${Tv.EASE.join(`,`)})`,opacity:`0`}):yv(i.current,{transition:`opacity ${Tv.DURATION}s cubic-bezier(${Tv.EASE.join(`,`)})`,opacity:`1`}),f(n?.[Math.max(t,0)])},[r.current,n,v,a,i,f]);d.useEffect(()=>{if(u||e){let t=n?.findIndex(t=>t===e||t===u)??-1;v&&t!==-1&&typeof v[t]==`number`&&b(v[t])}},[u,e,n,v,b]);function x({draggedDistance:e,closeDrawer:t,velocity:r,dismissible:o}){if(a===void 0)return;let c=s===`bottom`||s===`right`?(y??0)-e:(y??0)+e,u=g===a-1,d=g===0,f=e>0;if(u&&yv(i.current,{transition:`opacity ${Tv.DURATION}s cubic-bezier(${Tv.EASE.join(`,`)})`}),!l&&r>2&&!f){o?t():b(v[0]);return}if(!l&&r>2&&f&&v&&n){b(v[n.length-1]);return}let p=v?.reduce((e,t)=>typeof e!=`number`||typeof t!=`number`?e:Math.abs(t-c)<Math.abs(e-c)?t:e),m=xv(s)?window.innerHeight:window.innerWidth;if(r>Ev&&Math.abs(e)<m*.4){let e=f?1:-1;if(e>0&&h&&n){b(v[n.length-1]);return}if(d&&e<0&&o&&t(),g===null)return;b(v[g+e]);return}b(p)}function S({draggedDistance:e}){if(y===null)return;let t=s===`bottom`||s===`right`?y-e:y+e;(s===`bottom`||s===`right`)&&t<v[v.length-1]||(s===`top`||s===`left`)&&t>v[v.length-1]||yv(r.current,{transform:xv(s)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})}function C(e,t){if(!n||typeof g!=`number`||!v||a===void 0)return null;let r=g===a-1;if(g>=a&&t)return 0;if(r&&!t)return 1;if(!_&&!r)return null;let i=r?g+1:g-1,o=r?v[i]-v[i-1]:v[i+1]-v[i],s=e/Math.abs(o);return r?1-s:s}return{isLastSnapPoint:h,activeSnapPoint:u,shouldFade:_,getPercentageDragged:C,setActiveSnapPoint:f,activeSnapPointIndex:g,onRelease:x,onDrag:S,snapPointsOffset:v}}function Lv(){let{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:i}=K_(),a=d.useRef(null),o=(0,d.useMemo)(()=>document.body.style.backgroundColor,[]);function s(){return(window.innerWidth-jv)/window.innerWidth}d.useEffect(()=>{if(t&&n){a.current&&clearTimeout(a.current);let t=document.querySelector(`[data-vaul-drawer-wrapper]`)||document.querySelector(`[vaul-drawer-wrapper]`);if(!t)return;r&&!i&&wv(document.body,{background:`black`}),wv(t,{transformOrigin:xv(e)?`top`:`left`,transitionProperty:`transform, border-radius`,transitionDuration:`${Tv.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Tv.EASE.join(`,`)})`});let n=wv(t,{borderRadius:`${kv}px`,overflow:`hidden`,...xv(e)?{transform:`scale(${s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),a.current=window.setTimeout(()=>{o?document.body.style.background=o:document.body.style.removeProperty(`background`)},Tv.DURATION*1e3)}}},[t,n,o])}var Rv=null;function zv({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:i,noBodyStyles:a}){let[o,s]=d.useState(()=>typeof window<`u`?window.location.href:``),c=d.useRef(0),l=d.useCallback(()=>{if(X_()&&Rv===null&&e&&!a){Rv={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:`unset`};let{scrollX:e,innerHeight:t}=window;document.body.style.setProperty(`position`,`fixed`,`important`),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-e}px`,right:`0px`,height:`auto`}),window.setTimeout(()=>window.requestAnimationFrame(()=>{let e=t-window.innerHeight;e&&c.current>=t&&(document.body.style.top=`${-(c.current+e)}px`)}),300)}},[e]),u=d.useCallback(()=>{if(X_()&&Rv!==null&&!a){let e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Rv),window.requestAnimationFrame(()=>{if(i&&o!==window.location.href){s(window.location.href);return}window.scrollTo(t,e)}),Rv=null}},[o]);return d.useEffect(()=>{function e(){c.current=window.scrollY}return e(),window.addEventListener(`scroll`,e),()=>{window.removeEventListener(`scroll`,e)}},[]),d.useEffect(()=>{if(t)return()=>{typeof document>`u`||document.querySelector(`[data-vaul-drawer]`)||u()}},[t,u]),d.useEffect(()=>{n||!r||(e?(!window.matchMedia(`(display-mode: standalone)`).matches&&l(),t||window.setTimeout(()=>{u()},500)):u())},[e,r,o,t,n,l,u]),{restorePositionSetting:u}}function Bv({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:i,snapPoints:a,shouldScaleBackground:o=!1,setBackgroundColorOnScale:s=!0,closeThreshold:c=Dv,scrollLockTimeout:l=Ov,dismissible:u=!0,handleOnly:f=!1,fadeFromIndex:p=a&&a.length-1,activeSnapPoint:m,setActiveSnapPoint:h,fixed:g,modal:_=!0,onClose:v,nested:y,noBodyStyles:b=!1,direction:x=`bottom`,defaultOpen:S=!1,disablePreventScroll:C=!0,snapToSequentialPoint:w=!1,preventScrollRestoration:T=!1,repositionInputs:E=!0,onAnimationEnd:D,container:O,autoFocus:k=!1}){let[A=!1,j]=Fv({defaultProp:S,prop:e,onChange:e=>{t?.(e),!e&&!y&&be(),setTimeout(()=>{D?.(e)},Tv.DURATION*1e3),e&&!_&&typeof window<`u`&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents=`auto`}),e||(document.body.style.pointerEvents=`auto`)}}),[M,N]=d.useState(!1),[P,F]=d.useState(!1),[I,ee]=d.useState(!1),te=d.useRef(null),ne=d.useRef(null),L=d.useRef(null),R=d.useRef(null),z=d.useRef(null),re=d.useRef(!1),ie=d.useRef(null),ae=d.useRef(0),oe=d.useRef(!1),se=d.useRef(!S),ce=d.useRef(0),B=d.useRef(null),le=d.useRef(B.current?.getBoundingClientRect().height||0),ue=d.useRef(B.current?.getBoundingClientRect().width||0),de=d.useRef(0),{activeSnapPoint:fe,activeSnapPointIndex:pe,setActiveSnapPoint:me,onRelease:he,snapPointsOffset:ge,onDrag:_e,shouldFade:ve,getPercentageDragged:ye}=Iv({snapPoints:a,activeSnapPointProp:m,setActiveSnapPointProp:h,drawerRef:B,fadeFromIndex:p,overlayRef:te,onSnapPointChange:d.useCallback(e=>{a&&e===ge.length-1&&(ne.current=new Date)},[]),direction:x,container:O,snapToSequentialPoint:w});lv({isDisabled:!A||P||!_||I||!M||!E||!C});let{restorePositionSetting:be}=zv({isOpen:A,modal:_,nested:y??!1,hasBeenOpened:M,preventScrollRestoration:T,noBodyStyles:b});function xe(){return(window.innerWidth-jv)/window.innerWidth}function Se(e){!u&&!a||B.current&&!B.current.contains(e.target)||(le.current=B.current?.getBoundingClientRect().height||0,ue.current=B.current?.getBoundingClientRect().width||0,F(!0),L.current=new Date,Q_()&&window.addEventListener(`touchend`,()=>re.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),ae.current=xv(x)?e.pageY:e.pageX)}function Ce(e,t){let n=e,r=window.getSelection()?.toString(),i=B.current?Sv(B.current,x):null,a=new Date;if(n.tagName===`SELECT`||n.hasAttribute(`data-vaul-no-drag`)||n.closest(`[data-vaul-no-drag]`))return!1;if(x===`right`||x===`left`)return!0;if(ne.current&&a.getTime()-ne.current.getTime()<500)return!1;if(i!==null&&(x===`bottom`?i>0:i<0))return!0;if(r&&r.length>0)return!1;if(z.current&&a.getTime()-z.current.getTime()<l&&i===0||t)return z.current=a,!1;for(;n;){if(n.scrollHeight>n.clientHeight){if(n.scrollTop!==0)return z.current=new Date,!1;if(n.getAttribute(`role`)===`dialog`)return!0}n=n.parentNode}return!0}function we(e){if(B.current&&P){let t=x===`bottom`||x===`right`?1:-1,n=(ae.current-(xv(x)?e.pageY:e.pageX))*t,i=n>0,s=a&&!u&&!i;if(s&&pe===0)return;let c=Math.abs(n),l=document.querySelector(`[data-vaul-drawer-wrapper]`),d=c/(x===`bottom`||x===`top`?le.current:ue.current),f=ye(c,i);if(f!==null&&(d=f),s&&d>=1||!re.current&&!Ce(e.target,i))return;if(B.current.classList.add(Mv),re.current=!0,yv(B.current,{transition:`none`}),yv(te.current,{transition:`none`}),a&&_e({draggedDistance:n}),i&&!a){let e=Cv(n),r=Math.min(e*-1,0)*t;yv(B.current,{transform:xv(x)?`translate3d(0, ${r}px, 0)`:`translate3d(${r}px, 0, 0)`});return}let m=1-d;if((ve||p&&pe===p-1)&&(r?.(e,d),yv(te.current,{opacity:`${m}`,transition:`none`},!0)),l&&te.current&&o){let e=Math.min(xe()+d*(1-xe()),1),t=8-d*8,n=Math.max(0,14-d*14);yv(l,{borderRadius:`${t}px`,transform:xv(x)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:`none`},!0)}if(!a){let e=c*t;yv(B.current,{transform:xv(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}}d.useEffect(()=>{window.requestAnimationFrame(()=>{se.current=!0})},[]),d.useEffect(()=>{var e;function t(){if(!B.current||!E)return;let e=document.activeElement;if(mv(e)||oe.current){let e=window.visualViewport?.height||0,t=window.innerHeight,n=t-e,r=B.current.getBoundingClientRect().height||0,i=r>t*.8;de.current||=r;let o=B.current.getBoundingClientRect().top;if(Math.abs(ce.current-n)>60&&(oe.current=!oe.current),a&&a.length>0&&ge&&pe){let e=ge[pe]||0;n+=e}if(ce.current=n,r>e||oe.current){let t=B.current.getBoundingClientRect().height,r=t;t>e&&(r=e-(i?o:jv)),g?B.current.style.height=`${t-Math.max(n,0)}px`:B.current.style.height=`${Math.max(r,e-o)}px`}else q_()||(B.current.style.height=`${de.current}px`);a&&a.length>0&&!oe.current?B.current.style.bottom=`0px`:B.current.style.bottom=`${Math.max(n,0)}px`}}return(e=window.visualViewport)==null||e.addEventListener(`resize`,t),()=>window.visualViewport?.removeEventListener(`resize`,t)},[pe,a,ge]);function Te(e){De(),v?.(),e||j(!1),setTimeout(()=>{a&&me(a[0])},Tv.DURATION*1e3)}function Ee(){if(!B.current)return;let e=document.querySelector(`[data-vaul-drawer-wrapper]`),t=Sv(B.current,x);yv(B.current,{transform:`translate3d(0, 0, 0)`,transition:`transform ${Tv.DURATION}s cubic-bezier(${Tv.EASE.join(`,`)})`}),yv(te.current,{transition:`opacity ${Tv.DURATION}s cubic-bezier(${Tv.EASE.join(`,`)})`,opacity:`1`}),o&&t&&t>0&&A&&yv(e,{borderRadius:`${kv}px`,overflow:`hidden`,...xv(x)?{transform:`scale(${xe()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:`top`}:{transform:`scale(${xe()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:`left`},transitionProperty:`transform, border-radius`,transitionDuration:`${Tv.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Tv.EASE.join(`,`)})`},!0)}function De(){!P||!B.current||(B.current.classList.remove(Mv),re.current=!1,F(!1),R.current=new Date)}function Oe(e){if(!P||!B.current)return;B.current.classList.remove(Mv),re.current=!1,F(!1),R.current=new Date;let t=Sv(B.current,x);if(!e||!Ce(e.target,!1)||!t||Number.isNaN(t)||L.current===null)return;let n=R.current.getTime()-L.current.getTime(),r=ae.current-(xv(x)?e.pageY:e.pageX),o=Math.abs(r)/n;if(o>.05&&(ee(!0),setTimeout(()=>{ee(!1)},200)),a){he({draggedDistance:r*(x===`bottom`||x===`right`?1:-1),closeDrawer:Te,velocity:o,dismissible:u}),i?.(e,!0);return}if(x===`bottom`||x===`right`?r>0:r<0){Ee(),i?.(e,!0);return}if(o>Ev){Te(),i?.(e,!1);return}let s=Math.min(B.current.getBoundingClientRect().height??0,window.innerHeight),l=Math.min(B.current.getBoundingClientRect().width??0,window.innerWidth);if(Math.abs(t)>=(x===`left`||x===`right`?l:s)*c){Te(),i?.(e,!1);return}i?.(e,!0),Ee()}d.useEffect(()=>(A&&(yv(document.documentElement,{scrollBehavior:`auto`}),ne.current=new Date),()=>{bv(document.documentElement,`scrollBehavior`)}),[A]);function ke(e){let t=e?(window.innerWidth-Av)/window.innerWidth:1,n=e?-16:0;ie.current&&window.clearTimeout(ie.current),yv(B.current,{transition:`transform ${Tv.DURATION}s cubic-bezier(${Tv.EASE.join(`,`)})`,transform:xv(x)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&B.current&&(ie.current=setTimeout(()=>{let e=Sv(B.current,x);yv(B.current,{transition:`none`,transform:xv(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))}function Ae(e,t){if(t<0)return;let n=(window.innerWidth-Av)/window.innerWidth,r=n+t*(1-n),i=-16+t*Av;yv(B.current,{transform:xv(x)?`scale(${r}) translate3d(0, ${i}px, 0)`:`scale(${r}) translate3d(${i}px, 0, 0)`,transition:`none`})}function je(e,t){let n=xv(x)?window.innerHeight:window.innerWidth,r=t?(n-Av)/n:1,i=t?-16:0;t&&yv(B.current,{transition:`transform ${Tv.DURATION}s cubic-bezier(${Tv.EASE.join(`,`)})`,transform:xv(x)?`scale(${r}) translate3d(0, ${i}px, 0)`:`scale(${r}) translate3d(${i}px, 0, 0)`})}return d.useEffect(()=>{_||window.requestAnimationFrame(()=>{document.body.style.pointerEvents=`auto`})},[_]),d.createElement(Mm,{defaultOpen:S,onOpenChange:e=>{!u&&!e||(e?N(!0):Te(!0),j(e))},open:A},d.createElement(G_.Provider,{value:{activeSnapPoint:fe,snapPoints:a,setActiveSnapPoint:me,drawerRef:B,overlayRef:te,onOpenChange:t,onPress:Se,onRelease:Oe,onDrag:we,dismissible:u,shouldAnimate:se,handleOnly:f,isOpen:A,isDragging:P,shouldFade:ve,closeDrawer:Te,onNestedDrag:Ae,onNestedOpenChange:ke,onNestedRelease:je,keyboardIsOpen:oe,modal:_,snapPointsOffset:ge,activeSnapPointIndex:pe,direction:x,shouldScaleBackground:o,setBackgroundColorOnScale:s,noBodyStyles:b,container:O,autoFocus:k}},n))}var Vv=d.forwardRef(function({...e},t){let{overlayRef:n,snapPoints:r,onRelease:i,shouldFade:a,isOpen:o,modal:s,shouldAnimate:c}=K_(),l=_v(t,n),u=r&&r.length>0;if(!s)return null;let f=d.useCallback(e=>i(e),[i]);return d.createElement(Bm,{onMouseUp:f,ref:l,"data-vaul-overlay":``,"data-vaul-snap-points":o&&u?`true`:`false`,"data-vaul-snap-points-overlay":o&&a?`true`:`false`,"data-vaul-animate":c?.current?`true`:`false`,...e})});Vv.displayName=`Drawer.Overlay`;var Hv=d.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},i){let{drawerRef:a,onPress:o,onRelease:s,onDrag:c,keyboardIsOpen:l,snapPointsOffset:u,activeSnapPointIndex:f,modal:p,isOpen:m,direction:h,snapPoints:g,container:_,handleOnly:v,shouldAnimate:y,autoFocus:b}=K_(),[x,S]=d.useState(!1),C=_v(i,a),w=d.useRef(null),T=d.useRef(null),E=d.useRef(!1),D=g&&g.length>0;Lv();let O=(e,t,n=0)=>{if(E.current)return!0;let r=Math.abs(e.y),i=Math.abs(e.x),a=i>r,o=[`bottom`,`right`].includes(t)?1:-1;if(t===`left`||t===`right`){if(!(e.x*o<0)&&i>=0&&i<=n)return a}else if(!(e.y*o<0)&&r>=0&&r<=n)return!a;return E.current=!0,!0};d.useEffect(()=>{D&&window.requestAnimationFrame(()=>{S(!0)})},[]);function k(e){w.current=null,E.current=!1,s(e)}return d.createElement(Wm,{"data-vaul-drawer-direction":h,"data-vaul-drawer":``,"data-vaul-delayed-snap-points":x?`true`:`false`,"data-vaul-snap-points":m&&D?`true`:`false`,"data-vaul-custom-container":_?`true`:`false`,"data-vaul-animate":y?.current?`true`:`false`,...r,ref:C,style:u&&u.length>0?{"--snap-point-height":`${u[f??0]}px`,...t}:t,onPointerDown:e=>{v||(r.onPointerDown==null||r.onPointerDown.call(r,e),w.current={x:e.pageX,y:e.pageY},o(e))},onOpenAutoFocus:e=>{n?.(e),b||e.preventDefault()},onPointerDownOutside:t=>{if(e?.(t),!p||t.defaultPrevented){t.preventDefault();return}l.current&&=!1},onFocusOutside:e=>{if(!p){e.preventDefault();return}},onPointerMove:e=>{if(T.current=e,v||(r.onPointerMove==null||r.onPointerMove.call(r,e),!w.current))return;let t=e.pageY-w.current.y,n=e.pageX-w.current.x,i=e.pointerType===`touch`?10:2;O({x:n,y:t},h,i)?c(e):(Math.abs(n)>i||Math.abs(t)>i)&&(w.current=null)},onPointerUp:e=>{r.onPointerUp==null||r.onPointerUp.call(r,e),w.current=null,E.current=!1,s(e)},onPointerOut:e=>{r.onPointerOut==null||r.onPointerOut.call(r,e),k(T.current)},onContextMenu:e=>{r.onContextMenu==null||r.onContextMenu.call(r,e),T.current&&k(T.current)}})});Hv.displayName=`Drawer.Content`;var Uv=250,Wv=120,Gv=d.forwardRef(function({preventCycle:e=!1,children:t,...n},r){let{closeDrawer:i,isDragging:a,snapPoints:o,activeSnapPoint:s,setActiveSnapPoint:c,dismissible:l,handleOnly:u,isOpen:f,onPress:p,onDrag:m}=K_(),h=d.useRef(null),g=d.useRef(!1);function _(){if(g.current){b();return}window.setTimeout(()=>{v()},Wv)}function v(){if(a||e||g.current){b();return}if(b(),!o||o.length===0){l||i();return}if(s===o[o.length-1]&&l){i();return}let t=o.findIndex(e=>e===s);if(t===-1)return;let n=o[t+1];c(n)}function y(){h.current=window.setTimeout(()=>{g.current=!0},Uv)}function b(){h.current&&window.clearTimeout(h.current),g.current=!1}return d.createElement(`div`,{onClick:_,onPointerCancel:b,onPointerDown:e=>{u&&p(e),y()},onPointerMove:e=>{u&&m(e)},ref:r,"data-vaul-drawer-visible":f?`true`:`false`,"data-vaul-handle":``,"aria-hidden":`true`,...n},d.createElement(`span`,{"data-vaul-handle-hitarea":``,"aria-hidden":`true`},t))});Gv.displayName=`Drawer.Handle`;function Kv({onDrag:e,onOpenChange:t,open:n,...r}){let{onNestedDrag:i,onNestedOpenChange:a,onNestedRelease:o}=K_();if(!i)throw Error(`Drawer.NestedRoot must be placed in another drawer`);return d.createElement(Bv,{nested:!0,open:n,onClose:()=>{a(!1)},onDrag:(t,n)=>{i(t,n),e?.(t,n)},onOpenChange:e=>{e&&a(e),t?.(e)},onRelease:o,...r})}function qv(e){let t=K_(),{container:n=t.container,...r}=e;return d.createElement(Rm,{container:n,...r})}var Jv={Root:Bv,NestedRoot:Kv,Content:Hv,Overlay:Vv,Trigger:Pm,Portal:qv,Handle:Gv,Close:$m,Title:Ym,Description:Zm};function Yv({sources:e,onOpenAll:t,className:n,max:r=3}){if(!e?.length)return null;let i=e.slice(0,r),a=e.slice(r),o=a.length>0;return(0,x.jsxs)(`div`,{className:X(`grid grid-cols-2 gap-2 sm:grid-cols-4`,n),children:[i.map((e,t)=>(0,x.jsxs)(`a`,{href:e.url||void 0,target:e.url?`_blank`:void 0,rel:e.url?`noreferrer`:void 0,className:`group flex min-h-[68px] flex-col justify-between rounded-md border border-border bg-card p-2 text-left transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(xg,{url:e.url,size:`xs`}),(0,x.jsx)(`span`,{className:`line-clamp-1 text-[11px] text-muted-foreground`,children:vg(e.url)||e.source||`source`})]}),(0,x.jsx)(`span`,{className:`mt-1 line-clamp-2 text-[12px] font-medium text-foreground`,children:e.title||e.snippet||e.url||`—`})]},`${e.url||e.title||t}`)),o?(0,x.jsxs)(`button`,{type:`button`,onClick:t,className:`flex min-h-[68px] flex-col justify-between rounded-md border border-border bg-secondary p-2 text-left transition-colors hover:bg-card focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,children:[(0,x.jsx)(`span`,{className:`flex flex-row pl-0.5`,children:a.slice(0,5).map((e,t)=>(0,x.jsx)(`span`,{className:`-mr-1.5 last:mr-0`,children:(0,x.jsx)(xg,{url:e.url,size:`xs`,className:`ring-2 ring-secondary`})},`${e.url||t}`))}),(0,x.jsxs)(`span`,{className:`mt-1 text-[12px] font-medium text-muted-foreground`,children:[`+`,a.length,` sources`]})]}):null]})}function Xv({step:e,isLast:t}){let n=l_(e.name),r=e.status===`pending`,i=e.status===`error`,a=e.status===`completed`;return(0,x.jsxs)(`li`,{className:`grid grid-cols-[28px_minmax(0,1fr)]`,children:[(0,x.jsxs)(`div`,{className:`relative flex flex-col items-center`,children:[(0,x.jsx)(`div`,{className:`flex h-6 items-center justify-center`,children:(0,x.jsx)(kh,{status:e.status})}),t?(0,x.jsx)(`div`,{className:`flex-1`,"aria-hidden":`true`}):(0,x.jsx)(`div`,{className:`my-0.5 flex-1 border-l border-dashed border-border`,"aria-hidden":`true`})]}),(0,x.jsxs)(`div`,{className:`min-w-0 pb-5`,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,x.jsx)(d_,{name:e.name,size:`sm`,status:i?`error`:void 0}),(0,x.jsx)(`span`,{className:`text-[13px] font-medium text-foreground`,children:n.label}),r?(0,x.jsx)(Ah,{className:`text-[11px]`,children:`Calling…`}):i?(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[11px] text-destructive`,children:[(0,x.jsx)(od,{className:`h-3 w-3`,"aria-hidden":`true`}),`Errored`]}):a?(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[11px] text-muted-foreground`,children:[(0,x.jsx)(sd,{className:`h-3 w-3`,"aria-hidden":`true`}),`Completed`]}):null]}),(0,x.jsx)(Zv,{args:e.args}),a||i?(0,x.jsx)(`div`,{className:`mt-2 pr-1`,children:(0,x.jsx)($v,{step:e})}):null,e.narrationAfter?(0,x.jsx)(`p`,{className:`mt-2 line-clamp-3 text-[12px] leading-relaxed text-muted-foreground`,children:e.narrationAfter}):null]})]})}function Zv({args:e}){let t=Object.entries(e||{}).filter(([,e])=>e!=null&&e!==``);return t.length===0?null:(0,x.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:t.slice(0,6).map(([e,t])=>(0,x.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1 rounded-md bg-secondary px-1.5 py-0.5 text-[10.5px]`,children:[(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:e}),(0,x.jsx)(`span`,{className:`max-w-[140px] truncate font-mono text-foreground`,children:Qv(t)})]},e))})}function Qv(e){return e==null?`—`:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):Array.isArray(e)?e.length===0?`[]`:`[${e.slice(0,3).map(Qv).join(`, `)}${e.length>3?`, …`:``}]`:JSON.stringify(e)}function $v({step:e}){let t=e.result;if(!t)return null;let n=bh(t.content),r=Ih(t),i=Jg(t.toolName)?.Component??Yg;return(0,x.jsxs)(`div`,{className:X(`grid gap-2`,t.isError&&`rounded-md border border-destructive/30 bg-destructive/5 p-2`),children:[(0,x.jsx)(i,{message:t,header:null,text:n,variant:`step`}),ey(t,r,n)?(0,x.jsx)(Zh,{message:t,details:r,text:n}):null]})}function ey(e,t,n){return!!(n||t&&Object.keys(t).length>0||e?.details?.args&&Object.keys(e.details.args).length>0)}function ty(){let{run:e,close:t}=__();return ay()||!e?null:(0,x.jsxs)(`aside`,{className:`flex w-[min(520px,42vw)] shrink-0 flex-col border-l border-border bg-background animate-in slide-in-from-right duration-200`,role:`complementary`,"aria-label":`Tool run timeline`,children:[(0,x.jsx)(ry,{run:e,onClose:t}),(0,x.jsx)(iy,{run:e})]})}function ny(){let{run:e,close:t}=__();return!ay()||!e?null:(0,x.jsx)(Jv.Root,{open:!0,onOpenChange:e=>{e||t()},children:(0,x.jsxs)(Jv.Portal,{children:[(0,x.jsx)(Jv.Overlay,{className:`fixed inset-0 z-40 bg-foreground/40`}),(0,x.jsxs)(Jv.Content,{"aria-describedby":void 0,className:`fixed inset-x-0 bottom-0 z-50 flex h-[min(90dvh,calc(100dvh-40px))] flex-col rounded-t-2xl bg-background outline-none shadow-subtle-md`,children:[(0,x.jsx)(Ns,{children:(0,x.jsx)(Jv.Title,{children:`Tool run timeline`})}),(0,x.jsx)(`div`,{className:`mx-auto mt-2 h-1 w-10 shrink-0 rounded-full bg-border`,"aria-hidden":`true`}),(0,x.jsx)(ry,{run:e,onClose:t}),(0,x.jsx)(iy,{run:e})]})]})})}function ry({run:e,onClose:t}){let n=f_(e.steps.map(e=>e.name));return(0,d.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]),(0,x.jsxs)(`header`,{className:`flex shrink-0 items-center gap-2 border-b border-border px-4 py-2.5`,children:[(0,x.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,x.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:n}),(0,x.jsx)(`div`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:e.status===`pending`?`In progress`:e.status===`error`?`Errored`:`Completed`})]}),(0,x.jsxs)(Vf,{variant:`outline`,size:`sm`,className:`font-mono`,children:[e.steps.length,` `,e.steps.length===1?`step`:`steps`]}),(0,x.jsx)(Z,{variant:`ghost`,size:`icon-sm`,onClick:t,"aria-label":`Close drawer`,children:(0,x.jsx)($d,{})})]})}function iy({run:e}){let t=p_(e);return(0,x.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-1 py-3 sm:px-2`,children:[t.length>0?(0,x.jsxs)(`div`,{className:`mb-3 px-3`,children:[(0,x.jsx)(`div`,{className:`mb-1.5 text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Sources`}),(0,x.jsx)(Yv,{sources:t,max:3})]}):null,(0,x.jsx)(`ol`,{className:`grid`,children:e.steps.map((t,n)=>(0,x.jsx)(Xv,{step:t,isLast:n===e.steps.length-1},t.id||`${t.name}-${n}`))})]})}function ay(){let[e,t]=(0,d.useState)(()=>typeof window>`u`?!1:window.matchMedia(`(max-width: 819px)`).matches);return(0,d.useEffect)(()=>{if(typeof window>`u`)return;let e=window.matchMedia(`(max-width: 819px)`),n=e=>t(e.matches);return e.addEventListener?e.addEventListener(`change`,n):e.addListener(n),()=>{e.removeEventListener?e.removeEventListener(`change`,n):e.removeListener(n)}},[]),e}var oy=`(min-width: 820px)`;function sy(){let[e,t]=(0,d.useState)(()=>typeof window>`u`||!window.matchMedia?!1:window.matchMedia(oy).matches);return(0,d.useEffect)(()=>{if(typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(oy),n=e=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var cy=(0,d.createContext)({isDesktop:!1});function ly({open:e,onOpenChange:t,children:n}){let r=sy(),i=r?Mm:Jv.Root;return(0,x.jsx)(cy.Provider,{value:{isDesktop:r},children:(0,x.jsx)(i,{open:e,onOpenChange:t,children:n})})}var uy={sm:`w-[calc(100vw-32px)] max-w-[420px]`,md:`w-[calc(100vw-32px)] max-w-[560px]`,lg:`w-[calc(100vw-32px)] max-w-[780px]`,xl:`w-[calc(100vw-32px)] max-w-[920px]`},dy={sm:`md:left-1/2 md:right-auto md:w-[420px] md:-translate-x-1/2`,md:`md:left-1/2 md:right-auto md:w-[560px] md:-translate-x-1/2`,lg:`md:left-1/2 md:right-auto md:w-[780px] md:-translate-x-1/2`,xl:`md:left-1/2 md:right-auto md:w-[920px] md:-translate-x-1/2`};function fy({children:e,className:t,width:n=`md`,handleLabel:r=`Panel`}){let{isDesktop:i}=(0,d.useContext)(cy);return i?(0,x.jsxs)(Rm,{children:[(0,x.jsx)(Bm,{className:`fixed inset-0 z-40 bg-foreground/30 backdrop-blur-[2px] overscroll-contain data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0`}),(0,x.jsxs)(Wm,{"aria-describedby":void 0,className:X(`fixed left-1/2 top-1/2 z-50 flex max-h-[min(84dvh,720px)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-border bg-card shadow-subtle-md outline-none data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95`,uy[n]??uy.md,t),children:[(0,x.jsx)(Ns,{children:(0,x.jsx)(Ym,{children:r})}),e]})]}):(0,x.jsxs)(Jv.Portal,{children:[(0,x.jsx)(Jv.Overlay,{className:`fixed inset-0 z-40 bg-foreground/30 backdrop-blur-[2px] overscroll-contain`}),(0,x.jsxs)(Jv.Content,{"aria-describedby":void 0,className:X(`fixed inset-x-2 bottom-0 z-50 flex h-[min(88dvh,calc(100dvh-64px))] max-h-[min(88dvh,calc(100dvh-64px))] flex-col overflow-hidden rounded-t-xl border border-border bg-card shadow-subtle-md outline-none overscroll-contain md:inset-x-auto md:bottom-4 md:h-auto md:max-h-[84vh] md:rounded-xl`,dy[n]??dy.md,t),children:[(0,x.jsx)(Ns,{children:(0,x.jsx)(Jv.Title,{children:r})}),(0,x.jsx)(py,{}),e]})]})}function py({className:e}){return(0,x.jsx)(`div`,{className:X(`mx-auto mb-2 mt-3 h-1 w-9 shrink-0 rounded-full bg-hard`,e),"aria-hidden":`true`})}var my={comprehensive_analysis:`Comprehensive analysis`,portfolio_builder:`Portfolio builder`,options_screener:`Options screener`,compare_assets:`Compare assets`,single_asset_analysis:`Single-asset analysis`,watchlist_or_tracking:`Watchlist update`,general_finance_qa:`General Q&A`},hy=[{path:`/watchlists`,label:`Watchlists`},{path:`/portfolios`,label:`Portfolios`},{path:`/alerts`,label:`Alerts`},{path:`/reports`,label:`Reports`}];function gy({open:e,state:t,catalog:n,onClose:r,onConfigureProvider:i,onOpenMarketState:a}){return(0,x.jsx)(ly,{open:e,onOpenChange:e=>{e||r()},children:(0,x.jsxs)(fy,{width:`sm`,handleLabel:`Context`,className:`bg-card p-0`,children:[(0,x.jsx)(vy,{state:t}),(0,x.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto`,children:[(0,x.jsx)(_y,{onOpenMarketState:a}),(0,x.jsx)(Cy,{rows:t?.watchlist??[]}),(0,x.jsx)(Ty,{rows:t?.activeAnalyses??[]}),(0,x.jsx)(Dy,{rows:t?.recentResearch??[]}),(0,x.jsx)(Oy,{state:t?.dataQuality??{softGaps:[],hardSkips:[]},catalog:n,onConfigureProvider:i})]})]})})}function _y({onOpenMarketState:e}){return e?(0,x.jsx)(by,{title:`Saved state`,children:(0,x.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:hy.map(t=>(0,x.jsx)(Z,{size:`xs`,variant:`bordered`,onClick:()=>e(t.path),children:t.label},t.path))})}):null}function vy({state:e}){let t=(0,d.useMemo)(()=>yy(e),[e]);return(0,x.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center justify-between gap-2 border-b border-border px-4`,children:[(0,x.jsx)(`span`,{className:`text-xs font-medium uppercase tracking-wider text-muted-foreground`,children:`Context`}),t?(0,x.jsxs)(`span`,{className:X(`inline-flex h-6 items-center gap-1.5 rounded-full px-2 text-[11px] font-medium tabular-nums`,t.tone===`success`&&`text-success`,t.tone===`warning`&&`text-warning`,t.tone===`info`&&`text-info`,t.tone===`muted`&&`text-muted-foreground`),children:[(0,x.jsx)(`span`,{className:X(`inline-block h-1.5 w-1.5 rounded-full`,t.tone===`success`&&`bg-success`,t.tone===`warning`&&`bg-warning`,t.tone===`info`&&`bg-info`,t.tone===`muted`&&`bg-muted-foreground/40`)}),t.label]}):null]})}function yy(e){if(!e)return null;let t=new Set((e.dataQuality?.hardSkips??[]).map(e=>e.provider)),n=new Set((e.dataQuality?.softGaps??[]).map(e=>e.provider));return t.size>0?{tone:`warning`,label:`${t.size} provider${t.size===1?``:`s`} need a key`}:(e.activeAnalyses??[]).length>0?{tone:`info`,label:`${e.activeAnalyses.length} running`}:n.size>0?{tone:`muted`,label:`${n.size} data gap${n.size===1?``:`s`}`}:(e.watchlist??[]).length>0?{tone:`success`,label:`All clear`}:null}function by({title:e,meta:t,children:n,last:r=!1}){return(0,x.jsxs)(`section`,{className:X(`px-3 pt-3`,r?`pb-4`:`pb-3 border-b border-border`),children:[(0,x.jsxs)(`div`,{className:`mb-1.5 flex items-baseline justify-between gap-2`,children:[(0,x.jsx)(`h3`,{className:`text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground`,children:e}),t?(0,x.jsx)(`span`,{className:`text-[11px] tabular-nums text-muted-foreground/70`,children:t}):null]}),n]})}function xy({children:e}){return(0,x.jsx)(`p`,{className:`py-1 text-xs text-muted-foreground`,children:e})}function Sy({children:e,className:t}){return(0,x.jsx)(`div`,{className:X(`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3 py-2 first:pt-1 last:pb-0`,t),children:e})}function Cy({rows:e}){let t=(0,d.useMemo)(()=>[...e].sort((e,t)=>{let n=Date.parse(e.lastSeen??``)||0;return(Date.parse(t.lastSeen??``)||0)-n}),[e]);return(0,x.jsx)(by,{title:`Recent quotes`,meta:t.length?`${t.length}`:null,children:t.length===0?(0,x.jsxs)(xy,{children:[`No quotes pulled yet. Try`,` `,(0,x.jsx)(`code`,{className:`font-mono text-foreground/70`,children:`/quote AAPL`}),` or run a workflow.`]}):(0,x.jsx)(`div`,{className:`divide-y divide-border`,children:t.map(e=>(0,x.jsx)(wy,{row:e},e.symbol))})})}function wy({row:e}){let t=Number(e.quote?.changePercent),n=Number(e.quote?.price),r=Number.isFinite(n),i=Number.isFinite(t),a=i&&t>=0;return(0,x.jsxs)(Sy,{children:[(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`text-sm font-semibold tabular-nums text-foreground`,children:e.symbol}),e.lastSeen?(0,x.jsx)(`span`,{className:`text-[11px] text-muted-foreground/70`,children:jy(e.lastSeen)}):null]}),(0,x.jsx)(`div`,{className:`text-xs tabular-nums text-muted-foreground`,children:r?My(n):(0,x.jsx)(`span`,{className:`italic text-muted-foreground/70`,children:`No quote`})})]}),i?(0,x.jsxs)(`span`,{className:X(`text-sm font-medium tabular-nums`,a?`text-success`:`text-destructive`),children:[a?`+`:``,t.toFixed(2),`%`]}):null]})}function Ty({rows:e}){return(0,x.jsx)(by,{title:`Active analyses`,meta:e.length?`${e.length}`:null,children:e.length===0?(0,x.jsxs)(xy,{children:[`None running. Start one from`,` `,(0,x.jsx)(`span`,{className:`text-foreground/80`,children:`Catalog → Workflows`}),`.`]}):(0,x.jsx)(`div`,{className:`divide-y divide-border`,children:e.map(e=>(0,x.jsxs)(Sy,{children:[(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(gd,{"aria-hidden":`true`,className:`h-3 w-3 animate-pulse text-info`}),(0,x.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:Ay(e.workflow)}),e.symbol?(0,x.jsx)(`span`,{className:`rounded bg-secondary px-1.5 py-0.5 text-[11px] font-medium tabular-nums text-foreground`,children:e.symbol}):null]}),(0,x.jsxs)(`div`,{className:`mt-0.5 text-[11px] tabular-nums text-muted-foreground`,children:[e.startedAt?`${jy(e.startedAt)}`:`just started`,e.analystsTotal>0?(0,x.jsxs)(`span`,{children:[` `,`· `,e.analystsDone,`/`,e.analystsTotal,` analysts`]}):null]})]}),e.analystsTotal>0?(0,x.jsx)(Ey,{done:e.analystsDone,total:e.analystsTotal}):null]},e.workflowId))})})}function Ey({done:e,total:t}){return(0,x.jsxs)(`span`,{className:`text-[11px] tabular-nums text-muted-foreground`,children:[Math.max(0,Math.min(100,t>0?Math.round(e/t*100):0)),`%`]})}function Dy({rows:e}){return(0,x.jsx)(by,{title:`Recent research`,meta:e.length?`${e.length}`:null,children:e.length===0?(0,x.jsx)(xy,{children:`Completed workflows will appear here.`}):(0,x.jsx)(`div`,{className:`divide-y divide-border`,children:e.map(e=>(0,x.jsxs)(Sy,{children:[(0,x.jsxs)(`div`,{className:`min-w-0 flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`truncate text-sm text-foreground`,children:Ay(e.workflow)}),e.symbol?(0,x.jsx)(`span`,{className:`rounded bg-secondary px-1.5 py-0.5 text-[11px] font-medium tabular-nums text-foreground`,children:e.symbol}):null]}),(0,x.jsx)(`span`,{className:`text-[11px] tabular-nums text-muted-foreground`,children:jy(e.completedAt)})]},`${e.sessionId}-${e.completedAt}`))})})}function Oy({state:e,catalog:t,onConfigureProvider:n}){let r=(0,d.useMemo)(()=>Ny(e,t),[e,t]),i=r.length;return(0,x.jsx)(by,{title:`Data quality`,meta:i?`${i}`:null,last:!0,children:i===0?(0,x.jsxs)(`div`,{className:`flex items-center gap-2 py-1 text-xs text-muted-foreground`,children:[(0,x.jsx)(sd,{"aria-hidden":`true`,className:`h-3.5 w-3.5 text-success`}),`All providers reporting clean data this session.`]}):(0,x.jsx)(`div`,{className:`grid divide-y divide-border`,children:r.map(e=>(0,x.jsx)(ky,{gap:e,onConfigure:()=>n?.(e.providerId)},`${e.kind}-${e.providerId}`))})})}function ky({gap:e,onConfigure:t}){let n=e.kind===`hard`;return(0,x.jsxs)(`div`,{className:`grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-3 py-2.5`,children:[(0,x.jsx)(`span`,{"aria-hidden":`true`,className:X(`mt-0.5 inline-flex h-5 w-5 items-center justify-center rounded-full`,n?`bg-warning/15 text-warning`:`bg-muted/15 text-muted-foreground`),children:n?(0,x.jsx)(Fd,{className:`h-3 w-3`}):(0,x.jsx)(Wd,{className:`h-3 w-3`})}),(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.displayName}),(0,x.jsx)(Vf,{variant:n?`warning`:`outline`,className:`h-4 px-1.5 text-[10px]`,children:n?`Missing key`:`Data gap`})]}),(0,x.jsxs)(`p`,{className:`mt-0.5 text-[11px] leading-4 text-muted-foreground`,children:[n?(0,x.jsxs)(x.Fragment,{children:[`Skipped `,e.count,`× — add an API key to unlock`,` `,e.unlocks||`this provider's tools`,`.`]}):(0,x.jsxs)(x.Fragment,{children:[`Reported a data gap `,e.count,`× this session`,e.fallbackDescription?` — ${e.fallbackDescription}`:``,`.`]}),e.lastSeen?(0,x.jsxs)(x.Fragment,{children:[` · last `,jy(e.lastSeen)]}):null]})]}),n?(0,x.jsx)(Z,{variant:`bordered`,size:`xs`,prefixIcon:Jd,onClick:t,className:`shrink-0`,children:`Configure`}):null]})}function Ay(e){return e?my[e]||String(e).replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase()):`Workflow`}function jy(e){if(!e)return``;let t=Date.parse(e);if(!Number.isFinite(t))return``;let n=Date.now()-t,r=Math.round(n/1e3);if(r<30)return`just now`;if(r<60)return`${r}s ago`;let i=Math.round(r/60);if(i<60)return`${i}m ago`;let a=Math.round(i/60);return a<24?`${a}h ago`:`${Math.round(a/24)}d ago`}function My(e){return e>=1e3?`$${e.toLocaleString(`en-US`,{maximumFractionDigits:2})}`:`$${e.toFixed(2)}`}function Ny(e,t){if(!e)return[];let n=new Map;for(let e of t?.providers??[])n.set(e.id,e);let r=new Map,i=(e,t)=>{if(!t?.provider)return;let i=`${e}:${t.provider}`,a=Date.parse(t.lastSeen??``),o=r.get(i);if(o){o.count+=1,Number.isFinite(a)&&a>o.tsLast&&(o.tsLast=a,o.lastSeen=t.lastSeen);return}let s=n.get(t.provider);r.set(i,{kind:e,providerId:t.provider,displayName:s?.displayName??Py(t.provider),unlocks:(s?.unlocks??[]).slice(0,2).join(` + `),fallbackDescription:s?.fallbackDescription??null,count:1,tsLast:Number.isFinite(a)?a:0,lastSeen:t.lastSeen??null})};for(let t of e.hardSkips??[])i(`hard`,t);for(let t of e.softGaps??[])i(`soft`,t);return[...r.values()].sort((e,t)=>e.kind===t.kind?t.tsLast-e.tsLast:e.kind===`hard`?-1:1)}function Py(e){return String(e||``).replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function Fy({label:e,confirmLabel:t=`Confirm?`,disabled:n,onConfirm:r,variant:i=`ghost`,size:a=`xs`,className:o}){let[s,c]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{if(!s)return;let e=window.setTimeout(()=>c(!1),4e3);return()=>window.clearTimeout(e)},[s]),(0,x.jsx)(Z,{type:`button`,variant:s?`bordered`:i,size:a,className:X(s&&`border-destructive/40 text-destructive`,o),disabled:n,onClick:()=>{s?(c(!1),r()):c(!0)},children:s?t:e})}function Iy({title:e,count:t,meta:n,actions:r,children:i}){return(0,x.jsxs)(`section`,{className:`rounded-xl border border-border bg-card shadow-subtle-xs`,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 border-b border-border px-4 py-3`,children:[(0,x.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,x.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:e}),t===void 0?null:(0,x.jsx)(`span`,{className:`rounded-full bg-secondary px-2 py-0.5 text-[11px] tabular-nums text-muted-foreground`,children:t}),n?(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n}):null]}),r?(0,x.jsx)(`div`,{className:`flex items-center gap-2`,children:r}):null]}),i]})}function Ly({label:e,filter:t,setFilter:n}){return(0,x.jsxs)(`label`,{className:`relative`,children:[(0,x.jsx)(`span`,{className:`sr-only`,children:e}),(0,x.jsx)(Kd,{className:`pointer-events-none absolute left-2.5 top-2 size-3.5 text-muted-foreground`,"aria-hidden":`true`}),(0,x.jsx)(ah,{className:`h-8 w-44 pl-8 text-xs`,placeholder:e,value:t,onChange:e=>n(e.target.value)})]})}function Ry({icon:e,title:t,action:n,cta:r}){return(0,x.jsxs)(`div`,{className:`flex min-h-[120px] flex-col gap-3 p-4 sm:flex-row sm:items-center`,children:[(0,x.jsx)(`span`,{className:`inline-flex size-9 shrink-0 items-center justify-center rounded-md bg-secondary text-muted-foreground`,children:(0,x.jsx)(e,{className:`size-4`,"aria-hidden":`true`})}),(0,x.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,x.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:t}),(0,x.jsx)(`div`,{className:`text-xs leading-5 text-muted-foreground`,children:n})]}),r?(0,x.jsx)(Z,{type:`button`,variant:`bordered`,size:`sm`,disabled:r.disabled,onClick:r.onClick,children:r.label}):null]})}function zy({tone:e=`default`,children:t}){return(0,x.jsx)(`div`,{className:X(`rounded-md border px-3 py-2 text-xs`,e===`error`?`border-destructive/40 bg-destructive/10 text-destructive`:`border-border bg-secondary text-muted-foreground`),children:t})}function By({symbol:e,name:t}){return(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`div`,{className:`text-[13px] font-semibold text-foreground`,children:e}),t?(0,x.jsx)(`div`,{className:`truncate text-[11px] text-muted-foreground`,children:t}):null]})}function Vy({value:e,decimals:t=2}){if(typeof e!=`number`||!Number.isFinite(e))return(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});let n=e>0?`+`:e<0?`−`:``;return(0,x.jsxs)(`span`,{className:X(`tabular-nums font-medium`,e>0?`text-success`:e<0?`text-destructive`:`text-muted-foreground`),children:[n,Math.abs(e).toFixed(t),`%`]})}function Hy({value:e,percent:t,currency:n=`USD`}){if(typeof e!=`number`||!Number.isFinite(e))return(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});let r=e>0?`+`:e<0?`−`:``;return(0,x.jsxs)(`span`,{className:X(`tabular-nums font-medium`,e>0?`text-success`:e<0?`text-destructive`:`text-muted-foreground`),children:[r,qy(Math.abs(e),n),typeof t==`number`&&Number.isFinite(t)?` (${r}${Math.abs(t).toFixed(1)}%)`:``]})}function Uy({tone:e,label:t}){return(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,x.jsx)(`span`,{"aria-hidden":`true`,className:X(`size-[7px] rounded-full`,e===`armed`?`bg-success`:e===`degraded`?`bg-warning`:`bg-hard`)}),t]})}function Wy({tone:e=`neutral`,children:t}){return(0,x.jsx)(`span`,{className:X(`inline-flex h-[22px] items-center gap-1.5 whitespace-nowrap rounded-md border px-2 text-[11px] font-medium`,e===`warn`?`border-warning/30 bg-warning/10 text-warning`:e===`ok`?`border-success/30 bg-success/10 text-success`:`border-transparent bg-secondary text-muted-foreground`),children:t})}function Gy({actions:e,disabled:t}){return(0,x.jsx)(`div`,{className:`flex flex-wrap justify-end gap-1`,children:e.map(e=>(0,x.jsx)(Ky,{action:e,disabled:t},Array.isArray(e)?e[0]:e.label))})}function Ky({action:e,disabled:t}){let n=Array.isArray(e)?{label:e[0],onClick:e[1],disabled:!1}:e;return(0,x.jsx)(Z,{type:`button`,variant:`ghost`,size:`xs`,disabled:t&&!n.readOnlySafe||n.disabled,onClick:n.onClick,children:n.label})}function qy(e,t=`USD`){if(typeof e!=`number`||!Number.isFinite(e))return`—`;let n=e.toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2});return t===`USD`?`$${n}`:`${t} ${n}`}function Jy(e,t=`USD`){return typeof e==`number`?qy(e,t):`—`}function Yy(e,t){let n=new Map;for(let r of e||[]){let e=r?.[t];if(e==null)continue;let i=n.get(e)||[];i.push(r),n.set(e,i)}return n}function Xy(e,t){let n=new Map;for(let r of e||[]){let e=r?.[t];e!=null&&n.set(e,r)}return n}function Zy(e,t,n){let r=t.trim().toLowerCase();return r?e.filter(e=>n.some(t=>{let n=e?.[t];return Array.isArray(n)?n.join(` `).toLowerCase().includes(r):String(n??``).toLowerCase().includes(r)})):e}var Qy={ready:{label:`Ready`,tone:`success`},degraded:{label:`Degraded`,tone:`warn`},blocked:{label:`Blocked`,tone:`error`},pass:{label:`Pass`,tone:`success`,icon:sd},warn:{label:`Warn`,tone:`warn`,icon:hd},fail:{label:`Fail`,tone:`error`,icon:ld},skip:{label:`Skip`,tone:`muted`,icon:cd},unknown:{label:`Info`,tone:`muted`,icon:cd}};function $y(e=window.confirm){return e(`Session checks may read browser cookies or trigger platform permission prompts for Reddit and X/Twitter. Continue?`)}function eb({role:e,onOpenSidebar:t,onOpenHome:n,sidebarCollapsed:r=!1,onExpandSidebar:i,onOpenProviders:a,onOpenModelSetup:o,setToast:s,initialReport:c}){let[l,u]=(0,d.useState)(c??null),[f,p]=(0,d.useState)(!c),[m,h]=(0,d.useState)(!1),[g,_]=(0,d.useState)(``),v=(0,d.useCallback)(async({sessions:e=!1}={})=>{p(!e),h(e),_(``);try{let t=await fetch(e?`/api/doctor?sessions=1`:`/api/doctor`),n=await t.json().catch(()=>({}));if(!t.ok)throw Error(n?.error||t.statusText);u(n)}catch(e){let t=e instanceof Error?e.message:String(e);_(t),s?.(t,{destructive:!0,title:`Diagnostics failed`})}finally{p(!1),h(!1)}},[s]);(0,d.useEffect)(()=>{c||v()},[c,v]);let y=(0,d.useCallback)(()=>{$y()&&v({sessions:!0})},[v]),b=(0,d.useMemo)(()=>rb(l),[l]);return(0,x.jsxs)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background`,children:[(0,x.jsx)(Fh,{onOpenSidebar:t,onOpenHome:n}),r?(0,x.jsx)(Ph,{onExpandSidebar:i}):null,(0,x.jsx)(`main`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-5 sm:px-6`,children:(0,x.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[1240px] flex-col gap-3`,children:[(0,x.jsxs)(`header`,{className:`flex flex-wrap items-center justify-between gap-3 px-1`,children:[(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`h1`,{className:`m-0 text-[17px] font-semibold text-foreground`,children:`Diagnostics`}),(0,x.jsx)(`p`,{className:`m-0 mt-1 text-xs text-muted-foreground`,children:l?.summary||`Checking OpenCandle health...`})]}),(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[l?.status?(0,x.jsx)(Wy,{tone:ab(Qy[l.status]?.tone),children:Qy[l.status]?.label}):null,(0,x.jsx)(Z,{type:`button`,variant:`bordered`,size:`sm`,prefixIcon:Gd,disabled:f||m,onClick:()=>v(),children:`Refresh`}),(0,x.jsx)(Z,{type:`button`,variant:`brand`,size:`sm`,prefixIcon:Yd,disabled:f||m,onClick:y,children:m?`Checking...`:`Check sessions`})]})]}),g?(0,x.jsx)(zy,{tone:`error`,children:g}):null,e===`follower`?(0,x.jsx)(zy,{children:`Some setup changes are unavailable while OpenCandle reconnects local access.`}):null,(0,x.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-4`,children:[(0,x.jsx)(tb,{label:`Passed`,value:b.pass,tone:`success`}),(0,x.jsx)(tb,{label:`Warnings`,value:b.warn,tone:`warn`}),(0,x.jsx)(tb,{label:`Failures`,value:b.fail,tone:`error`}),(0,x.jsx)(tb,{label:`Unchecked`,value:b.unknown+b.skip,tone:`muted`})]}),f&&!l?(0,x.jsx)(zy,{children:`Loading diagnostics...`}):(0,x.jsx)(`div`,{className:`grid gap-3`,children:(l?.sections||[]).map(e=>(0,x.jsxs)(`section`,{className:`rounded-md border border-border bg-card p-3 shadow-subtle-xs`,children:[(0,x.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,x.jsx)(`h2`,{className:`m-0 text-sm font-semibold text-foreground`,children:e.label}),(0,x.jsx)(Wy,{tone:ab(Qy[e.status]?.tone),children:Qy[e.status]?.label})]}),(0,x.jsx)(`div`,{className:`grid gap-2`,children:e.checks.map(e=>(0,x.jsx)(nb,{check:e,onOpenProviders:a,onOpenModelSetup:o,onCheckSessions:y},e.id))})]},e.id))})]})})]})}function tb({label:e,value:t,tone:n}){return(0,x.jsxs)(`div`,{className:`rounded-md border border-border bg-card p-3`,children:[(0,x.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:e}),(0,x.jsx)(`div`,{className:X(`mt-1 text-2xl font-semibold`,ib(n)),children:t})]})}function nb({check:e,onOpenProviders:t,onOpenModelSetup:n,onCheckSessions:r}){let i=Qy[e.status]||Qy.unknown,a=i.icon,o=e.metadata?.providerId,s=!!o,c=e.id===`model.readiness`,l=e.id?.endsWith(`.session`)&&e.status===`unknown`;return(0,x.jsxs)(`div`,{className:`grid gap-2 rounded-md border border-border bg-background p-3 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start`,children:[(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[a?(0,x.jsx)(a,{className:X(`h-4 w-4 shrink-0`,ib(i.tone)),"aria-hidden":`true`}):null,(0,x.jsx)(`h3`,{className:`m-0 truncate text-sm font-medium text-foreground`,children:e.label}),(0,x.jsx)(Wy,{tone:ab(i.tone),children:i.label})]}),(0,x.jsx)(`p`,{className:`m-0 mt-1 text-sm leading-5 text-muted-foreground`,children:e.summary}),e.remediation?(0,x.jsx)(`p`,{className:`m-0 mt-1 text-xs leading-5 text-muted-foreground`,children:e.remediation}):null]}),(0,x.jsxs)(`div`,{className:`flex flex-wrap gap-2 sm:justify-end`,children:[s?(0,x.jsx)(Z,{type:`button`,variant:`bordered`,size:`sm`,onClick:()=>t?.(o),children:`Providers`}):null,c?(0,x.jsx)(Z,{type:`button`,variant:`bordered`,size:`sm`,onClick:n,children:`Model setup`}):null,l?(0,x.jsx)(Z,{type:`button`,variant:`bordered`,size:`sm`,onClick:r,children:`Check`}):null]})]})}function rb(e){let t={pass:0,warn:0,fail:0,unknown:0,skip:0};for(let n of e?.sections?.flatMap(e=>e.checks)||[])t[n.status]!==void 0&&t[n.status]++;return t}function ib(e){return e===`success`?`text-success`:e===`warn`?`text-warning`:e===`error`?`text-destructive`:`text-muted-foreground`}function ab(e){return e===`success`?`ok`:e===`warn`||e===`error`?`warn`:`neutral`}var ob={watchlist:[],activeAnalyses:[],recentResearch:[],dataQuality:{softGaps:[],hardSkips:[]}},sb=`The operation is still running. OpenCandle will refresh state when the server finishes.`;function cb(e,t={}){return e?{title:t.title,description:String(e),variant:t.variant||(t.destructive?`destructive`:`default`)}:null}function lb(e,t={}){switch(e){case`model.setup.refresh`:return{path:`/api/model-setup/refresh`,body:{}};case`model.setup.save_api_key`:return{path:`/api/model-setup/api-key`,body:{provider:t.provider,apiKey:t.apiKey}};case`model.setup.select_model`:return{path:`/api/model-setup/model`,body:{provider:t.provider,modelId:t.modelId}};case`provider.save_api_key`:return{path:`/api/provider-setup/api-key`,body:{providerId:t.providerId,apiKey:t.apiKey}};default:return null}}function ub(e,t,n,r){let i=e.get(t);return i?(globalThis.clearTimeout(i.timeout),e.delete(t),i[n](r),!0):!1}function db(e,t){let n=e.get(t);return n?(n.timedOut=!0,n.reject(Error(sb)),!0):!1}function fb(e){let t=Sb(e),n=Sb(t.snapshot),r=Object.keys(n).length>0?n:t,i=String(t.sessionId??r.sessionId??``).trim();if(!i)return null;let a=Sb(r.state);return{sessionId:i,entries:Array.isArray(r.entries)?r.entries:[],events:Array.isArray(r.events)?r.events:[],dashboard:Object.keys(a).length>0?a:ob}}function pb(e,t){let n=fb(t);return n?{...e,[n.sessionId]:n}:e}function mb(e,t=``,n=``){let r=n||t;return{type:`tool.invoke`,actionId:e.actionId||hb(`tool`),...e,...r?{sessionId:r}:{}}}function hb(e=`action`){return`${e}-${globalThis.crypto?.randomUUID?.()||`${Date.now()}-${Math.random().toString(36).slice(2)}`}`}function gb(e,t={},n=``){let r=e.replace(/[^a-z0-9]+/gi,`-`).replace(/^-|-$/g,``)||`action`,i=t.sessionId||n;return{type:e,...t,actionId:t.actionId||hb(r),...i?{sessionId:i}:{}}}function _b(e,t,n=!0){return n?t.role||`writer`:e}function vb(e,t,n=!0){return n?t:e}function yb(e,t){return t&&(!e||e.sessionId===t.sessionId)?t:e}function bb({documentVisibility:e,readyState:t}){return e&&e!==`visible`?!1:t!==0&&t!==1}function xb(){let e=(0,d.useRef)(null),t=(0,d.useRef)(0),n=(0,d.useRef)(new Map),[r,i]=(0,d.useState)(`connecting`),[a,o]=(0,d.useState)({tools:[],workflows:[],providers:[]}),[s,c]=(0,d.useState)([]),[l,u]=(0,d.useState)([]),[f,p]=(0,d.useState)([]),[m,h]=(0,d.useState)({}),[g,_]=(0,d.useState)([]),[v,y]=(0,d.useState)(ob),[b,x]=(0,d.useState)(``),[S,C]=(0,d.useState)(null),[w,T]=(0,d.useState)({requirement:`unknown`,providers:[],availableModels:[]}),[E,D]=(0,d.useState)(!1),O=(0,d.useCallback)((e,t={})=>{let n=cb(e,t);n&&yf(n)},[]),k=(0,d.useCallback)((e,t,r)=>{ub(n.current,e,t,r)},[]),A=(0,d.useCallback)((e,t=``,n={})=>{let r=e.snapshot||{},a=fb(e),s=String(e.sessionId||r.sessionId||``).trim();if(t&&s!==t)return!1;let l=n.updateVisibleState!==!1;return i(t=>_b(t,e,n.updateRole!==!1)),C(e.coordination||null),x(e=>vb(e,s,n.updateCurrentSessionId!==!1)),_(e.askUserPrompts||[]),l&&u(a?.entries||[]),a&&h(t=>pb(t,e)),(0,d.startTransition)(()=>{c(e.sessions||[]),l&&(y(a?.dashboard||ob),p(a?.events||[])),o(e.catalog||{tools:[],workflows:[],providers:[]}),T(e.modelSetup||{requirement:`unknown`,providers:[],availableModels:[]})}),!0},[]);(0,d.useEffect)(()=>{let t=!1,r=0,a=async()=>{try{e.current=null;let n=await fetch(`/api/bootstrap`);if(!n.ok)throw Error(n.statusText);let r=await n.json();if(t)return;D(r.supportsSessionActions!==!1),A(r)}catch{t||i(`disconnected`)}},s=()=>{if(typeof WebSocket!=`function`){a();return}let l=location.protocol===`https:`?`wss:`:`ws:`,f;try{f=new WebSocket(`${l}//${location.host}/ws`)}catch{a();return}let m=!1,g=!1,v=window.setTimeout(()=>{m||t||(g=!0,f.close(),a())},1500);e.current=f,f.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{O(`Received malformed GUI server message.`,{destructive:!0});return}if(t.type===`boot`)m=!0,window.clearTimeout(v),D(!0),i(t.role),C(t.coordination||null),x(t.sessionId),_(t.askUserPrompts||[]),(0,d.startTransition)(()=>{o(t.catalog),T(t.modelSetup||{requirement:`unknown`,providers:[],availableModels:[]})});else if(t.type===`catalog`)(0,d.startTransition)(()=>o(t.catalog));else if(t.type===`provider.status`)(0,d.startTransition)(()=>o(e=>wb(e,t.providerId,t.status)));else if(t.type===`model.setup`)(0,d.startTransition)(()=>T(t.modelSetup||{requirement:`unknown`,providers:[],availableModels:[]}));else if(t.type===`sessions`)(0,d.startTransition)(()=>c(t.sessions));else if(t.type===`state.snapshot`){let e=fb(t);u(e?.entries||[]),x(t.sessionId||``),C(e=>yb(e,t.coordination)),e&&h(e=>pb(e,t)),(0,d.startTransition)(()=>{y(e?.dashboard||ob),p(e?.events||[])})}else if(t.type===`session.snapshot`)fb(t)&&h(e=>pb(e,t));else if(t.type===`ask_user.prompt`||t.type===`ask_user.resolved`)_(e=>Cb(e,t.prompt));else if(t.type===`tool.invoke.result`){let e=typeof t.requestId==`string`?t.requestId:``;t.ok?k(e,`resolve`,t):k(e,`reject`,Error(t.error?.message||`Tool invocation failed`))}else t.type===`error`&&O(t.message,{destructive:!0})},f.onclose=()=>{if(window.clearTimeout(v),e.current===f){for(let[e,t]of n.current)window.clearTimeout(t.timeout),t.reject(Error(`GUI connection closed before the tool finished.`)),n.current.delete(e);g||(D(!1),i(`disconnected`),t||(r=window.setTimeout(s,1e3)))}}},l=()=>{t||bb({documentVisibility:typeof document>`u`?`visible`:document.visibilityState,readyState:e.current?.readyState})&&(window.clearTimeout(r),D(!1),i(`connecting`),e.current?.close?.(),s())};return s(),window.addEventListener(`focus`,l),document.addEventListener(`visibilitychange`,l),()=>{t=!0,window.clearTimeout(r),window.removeEventListener(`focus`,l),document.removeEventListener(`visibilitychange`,l),e.current?.close()}},[A,O,k]);let j=(0,d.useCallback)(async e=>{try{let t=await fetch(e.path,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e.body)}),n=await t.json().catch(()=>({}));if(!t.ok)throw Error(n?.error||t.statusText);A(n)}catch(e){O(e instanceof Error?e.message:String(e),{destructive:!0})}},[A,O]),M=(0,d.useCallback)((t,n={})=>{let r=e.current;if(r?.readyState!==1||typeof r.send!=`function`){let e=lb(t,n);return e?(j(e),!0):(O(`GUI connection is not open.`,{destructive:!0}),!1)}return r.send(JSON.stringify(t===`tool.invoke`?mb(n,b,n.sessionId):gb(t,n,b))),!0},[b,j,O]),N=(0,d.useCallback)((r,i={},a=``)=>{let o=e.current;if(o?.readyState!==1||typeof o.send!=`function`){let e=Error(`GUI connection is not open.`);return O(e.message,{destructive:!0}),Promise.reject(e)}let s=`tool-${Date.now()}-${t.current++}`,c=hb(`tool`),l=window.setTimeout(()=>{db(n.current,s)},3e4),u=new Promise((e,t)=>{n.current.set(s,{resolve:e,reject:t,timeout:l})});return o.send(JSON.stringify(mb({requestId:s,actionId:c,toolName:r,args:i},b,a))),u},[b,O]),P=(0,d.useCallback)(async()=>{try{let e=await fetch(`/api/session/new`,{method:`POST`}),t=await e.json();if(!e.ok)throw Error(t?.error||e.statusText);return D(!0),A(t),String(t?.sessionId??``)}catch(e){return O(e instanceof Error?e.message:String(e),{destructive:!0}),``}},[A,O]),F=(0,d.useCallback)(async e=>{let t=String(e??``).trim();if(!t)return!1;try{let e=await fetch(`/api/sessions/${encodeURIComponent(t)}/bootstrap`),n=await e.json().catch(()=>({}));if(!e.ok)throw Error(n?.error||e.statusText);return D(!0),A(n,t,{updateCurrentSessionId:!1,updateRole:!1,updateVisibleState:!1})}catch(e){return O(e instanceof Error?e.message:String(e),{destructive:!0}),!1}},[A,O]);return(0,d.useMemo)(()=>({role:r,catalog:a,sessions:s,entries:l,events:f,sessionSnapshots:m,askUserPrompts:g,dashboard:v,currentSessionId:b,coordination:S,modelSetup:w,supportsSessionActions:E,setToast:O,send:M,invokeTool:N,newSession:P,loadSession:F,adoptSessionId:x}),[r,a,s,l,f,m,g,v,b,S,w,E,O,M,N,P,F])}function Sb(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:{}}function Cb(e,t){if(!t?.id)return e;let n=e.filter(e=>e.id!==t.id);return n.push(t),n}function wb(e,t,n){return!t||!n?e:{...e,providers:(e.providers||[]).map(e=>e.id===t?{...e,status:n.state||e.status,statusDetail:n}:e)}}var Tb={instruments:[],watchlist:[],portfolio:[],alerts:[],alertEvents:[],alertCheckRuns:[],reportTemplates:[],reportRuns:[],runnerLease:null,notifications:[],notificationDeliveryAttempts:[],quoteSnapshot:null};function Eb(e,t){let n=Object.hasOwn(t,`quoteSnapshot`)?t.quoteSnapshot:Db(e,t);return{...Tb,...t,quoteSnapshot:n}}function Db(e,t){let n=e?.quoteSnapshot??null;return n?!Object.hasOwn(t,`portfolio`)||Ob(e?.portfolio??[])===Ob(t.portfolio??[])?n:{...n,portfolioQuotes:[],portfolioSummary:null}:null}function Ob(e){return e.map(e=>[e.id,e.instrumentId,e.symbol,e.quantity,e.avgCost,e.currency].join(`:`)).sort().join(`|`)}function kb({pollMs:e=4e3,quotePollMs:t=2e4}={}){let[n,r]=(0,d.useState)(Tb),[i,a]=(0,d.useState)(!0),[o,s]=(0,d.useState)(``),c=(0,d.useCallback)(async()=>{try{let e=await fetch(`/api/market-state`);if(!e.ok)throw Error(e.statusText||`Failed to load market state`);let t=await e.json();r(e=>Eb(e,t)),s(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}},[]),l=(0,d.useCallback)(async()=>{try{let e=await fetch(`/api/market-state/quotes`);if(!e.ok)throw Error(e.statusText||`Failed to load market quotes`);let t=await e.json();r(e=>({...e,quoteSnapshot:t})),s(``)}catch(e){s(e instanceof Error?e.message:String(e))}},[]);return(0,d.useEffect)(()=>{let t=!1,n=async()=>{t||await c()};n();let r=window.setInterval(n,e);return()=>{t=!0,window.clearInterval(r)}},[e,c]),(0,d.useEffect)(()=>{let e=!1,n=async()=>{e||await l()};n();let r=window.setInterval(n,t);return()=>{e=!0,window.clearInterval(r)}},[t,l]),(0,d.useMemo)(()=>({state:n,loading:i,error:o,refresh:c,refreshQuotes:l}),[n,i,o,c,l])}async function Ab(e){let t=String(e??``).trim();if(!t)return[];let n=await fetch(`/api/instruments/search?q=${encodeURIComponent(t)}`);if(!n.ok)throw Error(n.statusText||`Search failed`);return(await n.json()).candidates||[]}var jb=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Mb=900*1e3;function Nb(e,t=Date.now()){let n=Date.parse(e??``);if(!Number.isFinite(n))return``;let r=t-n;if(r<6e4)return`just now`;if(r<60*6e4)return`${Math.floor(r/6e4)}m ago`;if(r<1440*6e4)return`${Math.floor(r/(60*6e4))}h ago`;let i=new Date(n);return`${jb[i.getUTCMonth()]} ${i.getUTCDate()}`}function Pb(e,t=Date.now()){let n=Date.parse(e??``);if(!Number.isFinite(n))return``;let r=new Date(n),i=`${jb[r.getUTCMonth()]} ${r.getUTCDate()}`;return r.getUTCFullYear()===new Date(t).getUTCFullYear()?i:`${i}, ${r.getUTCFullYear()}`}function Fb(e,t=Date.now()){let n=Date.parse(e?.fetchedAt??``);if(!Number.isFinite(n))return{label:`Awaiting quotes`,stale:null};let r=t-n;return r>=Mb?{label:`Quote ${Math.floor(r/6e4)}m old`,stale:!0}:{label:`Updated ${Nb(e.fetchedAt,t)}`,stale:!1}}function Ib(e=[],t=[],n=[],r=Date.now()){let i=new Map(n.map(e=>[e.id,e.symbol])),a=new Map;for(let e of t){let t=a.get(e.alertRuleId);(!t||Ub(e.triggeredAt,t.triggeredAt)>0)&&a.set(e.alertRuleId,e)}return e.map(e=>{let t=e.enabled!==!1,n=a.get(e.id);return{id:e.id,symbol:e.instrumentId?i.get(e.instrumentId)??`Unknown`:Bb(e),sentence:Lb(e.conditionType,e.conditionJson),detail:Rb(e,t,r),tone:zb(e,t,n),retriggerMode:e.retriggerMode??`recurring`,enabled:t}})}function Lb(e,t={}){let n=t&&typeof t==`object`?t:{};switch(e){case`price_crosses_above`:return`Price crosses above ${Vb(n.threshold)}`;case`price_crosses_below`:return`Price drops below ${Vb(n.threshold)}`;case`rsi_threshold`:return`RSI (${n.period??14}-day) ${n.direction===`below`?`falls below`:`rises above`} ${n.threshold}`;case`percent_move`:return`${n.direction===`down`?`Falls`:`Rises`} more than ${n.percent}% in a day`;case`price_crosses_sma`:return`Price ${n.direction===`below`?`drops below`:`crosses above`} the ${n.period}-day average`;case`sma_cross`:return`${n.fast_period}-day average crosses ${n.direction===`below`?`below`:`above`} the ${n.slow_period}-day average`;case`volume_spike`:return`Volume spikes to ${n.multiplier}× the ${n.lookback_period}-day average`;default:return e.replaceAll(`_`,` `)}}function Rb(e,t,n){if(!t)return`Paused`;if(!e.lastCheckedAt)return`Armed · not checked yet`;let r=e.lastObservedJson,i=r&&typeof r==`object`&&typeof r.value==`number`?` at ${r.field===`price`?Vb(r.value):Hb(r.value)}`:``;return`Armed · last checked ${Nb(e.lastCheckedAt,n)}${i}`}function zb(e,t,n){return t?n?.status===`unavailable`||e.lastConditionState===`unavailable`?`degraded`:`armed`:`paused`}function Bb(e){return e.scopeType===`watchlist`?`Watchlist`:e.scopeType===`portfolio`?`Portfolio`:`Unknown`}function Vb(e){return typeof e==`number`?`$${e.toFixed(2)}`:`N/A`}function Hb(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function Ub(e,t){return(Date.parse(e??``)||0)-(Date.parse(t??``)||0)}function Wb({state:e,filter:t,setFilter:n,readOnly:r,openPanel:i,invokeTool:a}){let o=(0,d.useMemo)(()=>Ib(e.alerts,e.alertEvents,e.instruments),[e.alerts,e.alertEvents,e.instruments]),s=(0,d.useMemo)(()=>Zy(o,t,[`symbol`,`sentence`,`detail`]),[o,t]),c=(0,d.useMemo)(()=>Xy(e.instruments,`id`),[e.instruments]),l=e.alertCheckRuns?.[0]??null,u=[e.runnerLease?`Monitoring locally`:`Manual checks only`,l?`last check ${Nb(l.startedAt)}`:null].filter(Boolean).join(` · `);return(0,x.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,x.jsx)(Iy,{title:`Active rules`,count:s.length,meta:u,actions:(0,x.jsxs)(x.Fragment,{children:[e.alerts.length>3?(0,x.jsx)(Ly,{label:`Search alerts`,filter:t,setFilter:n}):null,(0,x.jsx)(Z,{type:`button`,variant:`bordered`,size:`sm`,disabled:r,onClick:()=>a(`manage_alerts`,{action:`check`}),children:`Check now`})]}),children:s.length===0?(0,x.jsx)(Ry,{icon:bd,title:e.alerts.length===0?`No alerts yet`:`No alerts match this search`,action:`Create an alert from a watchlist symbol, or set one up here. Rules are checked while OpenCandle is open.`,cta:{label:`Create alert`,disabled:r,onClick:()=>i(`alert-create`)}}):(0,x.jsx)(`ul`,{children:s.map(e=>(0,x.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 border-b border-border/70 px-4 py-3 last:border-0`,children:[(0,x.jsx)(Uy,{tone:e.tone,label:``}),(0,x.jsx)(`span`,{className:`w-14 shrink-0 text-[13px] font-semibold text-foreground`,children:e.symbol}),(0,x.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,x.jsx)(`div`,{className:`text-[13px] text-foreground`,children:e.sentence}),(0,x.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.detail})]}),e.tone===`degraded`?(0,x.jsx)(Wy,{tone:`warn`,children:`data unavailable`}):(0,x.jsx)(Wy,{children:e.retriggerMode}),(0,x.jsx)(Z,{type:`button`,variant:`ghost`,size:`xs`,role:`switch`,"aria-checked":e.enabled,disabled:r,onClick:()=>a(`manage_alerts`,{action:`set_enabled`,id:e.id,enabled:!e.enabled}),children:e.enabled?`Pause`:`Resume`})]},e.id))})}),(0,x.jsx)(Iy,{title:`Alert log`,count:e.alertEvents.length,children:e.alertEvents.length===0?(0,x.jsx)(Ry,{icon:bd,title:`Nothing logged yet`,action:`Alert firings, unavailable checks, and report runs appear here as they happen.`}):(0,x.jsx)(`ul`,{children:e.alertEvents.slice(0,15).map(e=>(0,x.jsxs)(`li`,{className:`grid grid-cols-[90px_minmax(0,1fr)] gap-3 border-b border-border/70 px-4 py-2.5 text-[13px] last:border-0 sm:grid-cols-[110px_minmax(0,1fr)]`,children:[(0,x.jsx)(`time`,{className:`tabular-nums text-muted-foreground`,children:Nb(e.observedAt||e.triggeredAt)||`—`}),(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`span`,{className:`font-semibold`,children:c.get(e.instrumentId)?.symbol??``}),` `,e.message||e.status,e.status===`unavailable`?(0,x.jsx)(Wy,{tone:`warn`,children:`unavailable`}):null]})]},e.id??`${e.alertRuleId}:${e.observedAt||e.triggeredAt}`))})}),(0,x.jsx)(Gb,{notifications:e.notifications,attempts:e.notificationDeliveryAttempts,readOnly:r,invokeTool:a})]})}function Gb({notifications:e,attempts:t,readOnly:n,invokeTool:r,title:i=`Notifications`}){let a=e.filter(e=>e.status!==`acknowledged`);return e.length===0?null:(0,x.jsx)(Iy,{title:i,count:a.length||void 0,children:(0,x.jsx)(`ul`,{children:e.slice(0,10).map(e=>(0,x.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 border-b border-border/70 px-4 py-2.5 text-[13px] last:border-0`,children:[(0,x.jsx)(`time`,{className:`w-[90px] shrink-0 tabular-nums text-muted-foreground sm:w-[110px]`,children:Nb(e.createdAt)||`—`}),(0,x.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,x.jsx)(`span`,{className:`text-foreground`,children:e.title}),e.severity===`warning`?(0,x.jsx)(Wy,{tone:`warn`,children:`warning`}):null]}),(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:Kb(t,e.id)}),(0,x.jsx)(Gy,{disabled:n||e.status===`acknowledged`,actions:[[`Mark read`,()=>r(`manage_notifications`,{action:`acknowledge`,id:e.id})]]})]},e.id))})})}function Kb(e=[],t){let n=e.filter(e=>e.notificationEventId===t);return n.length===0?`in-app`:n[0].status}function qb(e=[],t=[]){let n=new Map(t.map(e=>[e.lotId,e])),r=new Map;for(let t of e){let e=n.get(t.id)??null,i=r.get(t.symbol);i||(i={symbol:t.symbol,name:t.name??null,instrumentId:t.instrumentId,currency:t.currency,totalQuantity:0,totalCost:0,marketValue:null,currentPrice:null,pnl:null,pnlPercent:null,changePercent:null,allocationPercent:null,fetchedAt:null,excludedLotCount:0,lots:[]},r.set(t.symbol,i)),i.totalQuantity+=t.quantity,i.lots.push({...t,quote:e}),e?.status===`ok`&&e.includedInTotals?(i.totalCost+=e.totalCost,i.marketValue=(i.marketValue??0)+(e.marketValue??0),i.pnl=(i.pnl??0)+(e.pnl??0),i.allocationPercent=(i.allocationPercent??0)+(e.allocationPercent??0),i.currentPrice=e.currentPrice??i.currentPrice,i.changePercent=e.changePercent??i.changePercent,i.fetchedAt=e.fetchedAt??i.fetchedAt):(i.totalCost+=t.avgCost*t.quantity,e!=null&&(i.excludedLotCount+=1))}return[...r.values()].map(e=>({...e,blendedCost:e.totalQuantity>0?e.totalCost/e.totalQuantity:null,pnlPercent:e.pnl!=null&&e.marketValue!=null&&e.marketValue-e.pnl>0?e.pnl/(e.marketValue-e.pnl)*100:null})).sort((e,t)=>(t.marketValue??-1)-(e.marketValue??-1))}var Jb=[`#18181b`,`#52525b`,`#71717a`,`#a1a1aa`,`#d4d4d8`,`#e4e4e7`];function Yb({state:e,filter:t,setFilter:n,readOnly:r,openPanel:i,invokeTool:a,navigate:o}){let s=(0,d.useMemo)(()=>qb(e.portfolio??[],e.quoteSnapshot?.portfolioQuotes??[]),[e.portfolio,e.quoteSnapshot]),c=(0,d.useMemo)(()=>Zy(s,t,[`symbol`,`name`,`currency`]),[s,t]),l=e.quoteSnapshot?.portfolioSummary,[u,f]=(0,d.useState)(()=>new Set),p=e=>{f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},m=(e.portfolio??[]).length;return m===0?(0,x.jsx)(Iy,{title:`Holdings`,children:(0,x.jsx)(Ry,{icon:Sd,title:`No holdings yet`,action:`Add a holding when you are ready, or keep using watchlists without a portfolio.`,cta:{label:`Skip For Now`,onClick:()=>o?.({to:`/watchlists`})}})}):(0,x.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,x.jsx)(Zb,{summary:l,holdings:s}),(0,x.jsxs)(Iy,{title:`Holdings`,meta:`${s.length} ${s.length===1?`symbol`:`symbols`} · ${m} ${m===1?`lot`:`lots`}`,actions:(0,x.jsx)(Ly,{label:`Search holdings`,filter:t,setFilter:n}),children:[c.length===0?(0,x.jsx)(Ry,{icon:Sd,title:`No holdings match this search`,action:`Clear the search to see all holdings.`,cta:{label:`Clear search`,onClick:()=>n(``)}}):(0,x.jsx)(`div`,{className:`overflow-x-auto`,children:(0,x.jsxs)(`table`,{className:`w-full border-collapse text-left text-sm md:min-w-[700px]`,children:[(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{className:`border-b border-border text-xs text-muted-foreground`,children:[(0,x.jsx)(`th`,{className:`w-8 px-2 py-2`,"aria-label":`Expand`}),(0,x.jsx)(`th`,{className:`px-2 py-2 font-medium`,children:`Symbol`}),(0,x.jsx)(`th`,{className:`hidden px-2 py-2 text-right font-medium md:table-cell`,children:`Qty`}),(0,x.jsx)(`th`,{className:`hidden px-2 py-2 text-right font-medium md:table-cell`,children:`Last`}),(0,x.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Value`}),(0,x.jsx)(`th`,{className:`px-2 py-2 text-right font-medium`,children:`Today`}),(0,x.jsx)(`th`,{className:`hidden px-2 py-2 text-right font-medium sm:table-cell`,children:`Total return`}),(0,x.jsx)(`th`,{className:`hidden px-2 py-2 pr-4 text-right font-medium md:table-cell`,children:`Weight`})]})}),(0,x.jsx)(`tbody`,{children:c.map(e=>(0,x.jsxs)(d.Fragment,{children:[(0,x.jsxs)(`tr`,{className:`cursor-pointer border-b border-border/70 last:border-0 hover:bg-secondary/60`,onClick:()=>p(e.symbol),children:[(0,x.jsx)(`td`,{className:`px-2 py-2.5`,children:(0,x.jsx)(`button`,{type:`button`,className:`inline-flex size-5 items-center justify-center rounded text-muted-foreground hover:bg-secondary`,"aria-expanded":u.has(e.symbol),"aria-label":`${u.has(e.symbol)?`Collapse`:`Expand`} ${e.symbol} lots`,onClick:t=>{t.stopPropagation(),p(e.symbol)},children:u.has(e.symbol)?(0,x.jsx)(Ed,{className:`size-3.5`}):(0,x.jsx)(Dd,{className:`size-3.5`})})}),(0,x.jsx)(`td`,{className:`px-2 py-2.5`,children:(0,x.jsx)(By,{symbol:e.symbol,name:e.name})}),(0,x.jsx)(`td`,{className:`hidden px-2 py-2.5 text-right tabular-nums md:table-cell`,children:e.totalQuantity.toLocaleString()}),(0,x.jsx)(`td`,{className:`hidden px-2 py-2.5 text-right tabular-nums md:table-cell`,children:Jy(e.currentPrice,e.currency)}),(0,x.jsx)(`td`,{className:`px-2 py-2.5 text-right tabular-nums`,children:Jy(e.marketValue,e.currency)}),(0,x.jsx)(`td`,{className:`px-2 py-2.5 text-right`,children:(0,x.jsx)(Vy,{value:e.changePercent})}),(0,x.jsx)(`td`,{className:`hidden px-2 py-2.5 text-right sm:table-cell`,children:(0,x.jsx)(Hy,{value:e.pnl,percent:e.pnlPercent,currency:e.currency})}),(0,x.jsx)(`td`,{className:`hidden px-2 py-2.5 pr-4 text-right tabular-nums md:table-cell`,children:typeof e.allocationPercent==`number`?`${e.allocationPercent.toFixed(1)}%`:`—`})]}),u.has(e.symbol)?e.lots.map(e=>(0,x.jsxs)(`tr`,{className:`border-b border-border/70 bg-secondary/60 text-[13px] last:border-0`,children:[(0,x.jsx)(`td`,{className:`px-2 py-2`}),(0,x.jsxs)(`td`,{className:`px-2 py-2`,children:[(0,x.jsxs)(`div`,{className:`font-mono text-xs text-muted-foreground`,children:[`Lot · `,Pb(e.openedAt)||`—`,e.notes?` · ${e.notes}`:``]}),(0,x.jsxs)(`div`,{className:`mt-0.5 font-mono text-xs text-muted-foreground md:hidden`,children:[e.quantity.toLocaleString(),` @ `,qy(e.avgCost,e.currency)]}),(0,x.jsx)(`div`,{className:`mt-1 flex gap-1 md:hidden`,children:(0,x.jsx)(Xb,{lot:e,readOnly:r,openPanel:i,invokeTool:a})})]}),(0,x.jsx)(`td`,{className:`hidden px-2 py-2 text-right tabular-nums md:table-cell`,children:e.quantity.toLocaleString()}),(0,x.jsxs)(`td`,{className:`hidden px-2 py-2 text-right font-mono text-xs text-muted-foreground md:table-cell`,children:[`cost `,qy(e.avgCost,e.currency)]}),(0,x.jsx)(`td`,{className:`px-2 py-2 text-right tabular-nums`,children:Jy(e.quote?.marketValue,e.currency)}),(0,x.jsx)(`td`,{className:`px-2 py-2`}),(0,x.jsx)(`td`,{className:`hidden px-2 py-2 text-right sm:table-cell`,children:e.quote?.status===`ok`?(0,x.jsx)(Hy,{value:e.quote.pnl,percent:e.quote.pnlPercent,currency:e.currency}):(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.quote?.reason??`Awaiting quote`})}),(0,x.jsx)(`td`,{className:`hidden px-2 py-2 pr-4 text-right md:table-cell`,children:(0,x.jsx)(`div`,{className:`flex justify-end gap-1`,children:(0,x.jsx)(Xb,{lot:e,readOnly:r,openPanel:i,invokeTool:a})})})]},e.id)):null]},e.symbol))})]})}),l?.excludedFromTotals?.length?(0,x.jsxs)(`p`,{className:`border-t border-border px-4 py-2 text-xs text-muted-foreground`,children:[`Excluded from totals:`,` `,l.excludedFromTotals.map(e=>`${e.symbol} (${e.reason})`).join(`, `)]}):null]})]})}function Xb({lot:e,readOnly:t,openPanel:n,invokeTool:r}){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Z,{type:`button`,variant:`ghost`,size:`xs`,disabled:t,onClick:()=>n(`holding-edit`,{lot:e}),children:`Edit`}),(0,x.jsx)(Fy,{label:`Remove`,confirmLabel:`Remove lot?`,disabled:t,onConfirm:()=>r(`track_portfolio`,{action:`remove`,lot_id:e.id})})]})}function Zb({summary:e,holdings:t}){let n=(0,d.useMemo)(()=>{let e=0,n=!1;for(let r of t)if(typeof r.changePercent==`number`&&typeof r.marketValue==`number`){let t=r.marketValue/(1+r.changePercent/100);e+=r.marketValue-t,n=!0}return n?e:null},[t]),r=t.filter(e=>typeof e.allocationPercent==`number`&&e.allocationPercent>0).map((e,t)=>({symbol:e.symbol,percent:e.allocationPercent,color:Jb[Math.min(t,Jb.length-1)]}));return(0,x.jsxs)(`section`,{className:`rounded-xl border border-border bg-card p-4 shadow-subtle-xs sm:p-5`,children:[(0,x.jsx)(`div`,{className:`text-[32px] font-semibold leading-tight tabular-nums text-foreground`,children:e?qy(e.totalValue,e.baseCurrency):`—`}),(0,x.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-baseline gap-x-2 text-[13px]`,children:[n!=null&&e?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Hy,{value:n,percent:e.totalValue-n>0?n/(e.totalValue-n)*100:null,currency:e.baseCurrency}),(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`today ·`})]}):null,e?(0,x.jsx)(Hy,{value:e.totalPnl,percent:e.totalPnlPercent,currency:e.baseCurrency}):(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`Totals appear once quotes load.`}),e?(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`all time`}):null]}),r.length>0?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{className:`mt-4 flex h-2 gap-0.5 overflow-hidden rounded-full`,"aria-hidden":`true`,children:r.map(e=>(0,x.jsx)(`div`,{className:`rounded-sm`,style:{width:`${e.percent}%`,backgroundColor:e.color}},e.symbol))}),(0,x.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:r.map(e=>(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,x.jsx)(`i`,{className:`size-2 rounded-sm`,style:{backgroundColor:e.color},"aria-hidden":`true`}),e.symbol,` `,e.percent.toFixed(1),`%`]},e.symbol))})]}):null]})}function Qb({state:e,readOnly:t,openPanel:n,invokeTool:r}){let i=e.reportTemplates.find(e=>e.enabled)??e.reportTemplates[0]??null,a=e.reportRuns.find(e=>e.status===`completed`)??null,o=typeof a?.summaryJson?.text==`string`?a.summaryJson.text:null,s=e.notifications.filter(e=>e.sourceType===`report_run`);return(0,x.jsxs)(`div`,{className:`grid items-start gap-3 xl:grid-cols-[minmax(0,1fr)_300px]`,children:[(0,x.jsx)(Iy,{title:`Morning report`,meta:i?`Daily at ${i.localTime} (${i.timezone})${i.nextRunAt?` · next run ${Pb(i.nextRunAt)}`:``}`:`No schedule configured`,actions:(0,x.jsx)(Z,{type:`button`,variant:`bordered`,size:`sm`,disabled:t,onClick:()=>n(`report-configure`),children:`Edit schedule`}),children:o?(0,x.jsxs)(`article`,{className:`max-w-[720px] px-5 py-4`,children:[(0,x.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Generated`,` `,Nb(a.completedAt||a.startedAt)||Pb(a.startedAt),a.triggerType===`scheduled`?` · scheduled`:` · manual`]}),(0,x.jsx)(`pre`,{className:`mt-3 whitespace-pre-wrap font-sans text-[13px] leading-6 text-foreground`,children:o})]}):(0,x.jsx)(Ry,{icon:jd,title:`No report yet`,action:`Generate today's watchlist report to see movers, levels approaching, and data gaps in one place.`,cta:{label:`Generate today`,disabled:t,onClick:()=>r(`daily_watchlist_report`,{action:`run`})}})}),(0,x.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,x.jsx)(Iy,{title:`History`,count:e.reportRuns.length,children:e.reportRuns.length===0?(0,x.jsx)(`p`,{className:`px-4 py-3 text-xs text-muted-foreground`,children:`Past report runs appear here.`}):(0,x.jsx)(`ul`,{children:e.reportRuns.slice(0,10).map(e=>(0,x.jsxs)(`li`,{className:`flex items-center justify-between gap-2 border-b border-border/70 px-4 py-2.5 text-[13px] last:border-0`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`div`,{className:`font-medium text-foreground`,children:Pb(e.startedAt)||`—`}),(0,x.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[e.triggerType,Array.isArray(e.errorsJson)&&e.errorsJson.length?` · ${e.errorsJson.length} data gap${e.errorsJson.length===1?``:`s`}`:``]})]}),e.status===`completed`?(0,x.jsx)(Wy,{tone:`ok`,children:`done`}):(0,x.jsx)(Wy,{tone:`warn`,children:e.status})]},e.id??e.startedAt))})}),(0,x.jsx)(Gb,{title:`Report notifications`,notifications:s,attempts:e.notificationDeliveryAttempts,readOnly:t,invokeTool:r})]})]})}function $b({state:e,filter:t,setFilter:n,readOnly:r,openPanel:i,invokeTool:a}){let o=(0,d.useMemo)(()=>Xy(e.quoteSnapshot?.watchlistQuotes,`itemId`),[e.quoteSnapshot]),s=(0,d.useMemo)(()=>Yy(e.alerts,`instrumentId`),[e.alerts]),c=(0,d.useMemo)(()=>Zy(e.watchlist,t,[`symbol`,`name`,`thesis`,`notes`,`tags`]),[e.watchlist,t]),[l,u]=(0,d.useState)(null),f=c.find(e=>e.id===l)??c[0]??null;return(0,x.jsxs)(`div`,{className:X(`grid min-w-0 grid-cols-1 items-start gap-3`,f&&`xl:grid-cols-[minmax(0,1fr)_350px]`),children:[(0,x.jsx)(Iy,{title:`Watchlist`,count:c.length,actions:e.watchlist.length>0?(0,x.jsx)(Ly,{label:`Search symbols`,filter:t,setFilter:n}):null,children:c.length===0?(0,x.jsx)(Ry,{icon:Ld,title:e.watchlist.length===0?`No tickers yet`:`No symbols match this search`,action:`Add a ticker to start the watchlist, then keep thesis, targets, stops, and alerts on its row.`,cta:{label:`Add ticker`,disabled:r,onClick:()=>i(`watchlist-add`)}}):(0,x.jsx)(`div`,{className:`overflow-x-auto`,children:(0,x.jsxs)(`table`,{className:`w-full border-collapse text-left text-sm sm:min-w-[560px]`,children:[(0,x.jsx)(`thead`,{children:(0,x.jsxs)(`tr`,{className:`border-b border-border text-xs text-muted-foreground`,children:[(0,x.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Symbol`}),(0,x.jsx)(`th`,{className:`px-4 py-2 text-right font-medium`,children:`Last`}),(0,x.jsx)(`th`,{className:`px-4 py-2 text-right font-medium`,children:`Today`}),(0,x.jsx)(`th`,{className:`hidden px-4 py-2 text-right font-medium sm:table-cell`,children:`To target`}),(0,x.jsx)(`th`,{className:`hidden px-4 py-2 font-medium sm:table-cell`,children:`Signals`})]})}),(0,x.jsx)(`tbody`,{children:c.map(e=>{let t=o.get(e.id),n=f?.id===e.id;return(0,x.jsxs)(`tr`,{"aria-selected":n,className:X(`cursor-pointer border-b border-border/70 last:border-0`,n?`bg-secondary`:`hover:bg-secondary/60`),onClick:()=>u(e.id),children:[(0,x.jsx)(`td`,{className:`px-4 py-2.5`,children:(0,x.jsx)(By,{symbol:e.symbol,name:e.name})}),(0,x.jsx)(`td`,{className:`px-4 py-2.5 text-right tabular-nums`,children:t?.status===`ok`?qy(t.price):`—`}),(0,x.jsx)(`td`,{className:`px-4 py-2.5 text-right`,children:(0,x.jsx)(Vy,{value:t?.status===`ok`?t.changePercent:null})}),(0,x.jsx)(`td`,{className:`hidden px-4 py-2.5 text-right tabular-nums text-muted-foreground sm:table-cell`,children:ex(e,t)}),(0,x.jsx)(`td`,{className:`hidden px-4 py-2.5 sm:table-cell`,children:(0,x.jsx)(tx,{alerts:s.get(e.instrumentId),quote:t})})]},e.id)})})]})})}),f?(0,x.jsx)(nx,{item:f,quote:o.get(f.id),state:e,readOnly:r,openPanel:i,invokeTool:a},f.id):null]})}function ex(e,t){if(typeof e.targetPrice!=`number`)return`No target`;if(t?.status!==`ok`||typeof t.price!=`number`||t.price<=0)return qy(e.targetPrice);let n=(e.targetPrice-t.price)/t.price*100;return`${n>0?`+`:n<0?`−`:``}${Math.abs(n).toFixed(1)}% to ${qy(e.targetPrice)}`}function tx({alerts:e,quote:t}){if(t&&t.status!==`ok`)return(0,x.jsx)(Wy,{tone:`warn`,children:`Quote unavailable`});if(t?.stale)return(0,x.jsx)(Wy,{tone:`warn`,children:`Stale quote`});let n=(e??[]).filter(e=>e.enabled!==!1);return n.length===0?(0,x.jsx)(Wy,{children:`No alerts`}):(0,x.jsxs)(Wy,{tone:`ok`,children:[n.length,` `,n.length===1?`alert`:`alerts`]})}function nx({item:e,quote:t,state:n,readOnly:r,openPanel:i,invokeTool:a}){let o=Fb(t),s=(0,d.useMemo)(()=>qb((n.portfolio??[]).filter(t=>t.symbol===e.symbol),n.quoteSnapshot?.portfolioQuotes??[])[0]??null,[n.portfolio,n.quoteSnapshot,e.symbol]),c=(0,d.useMemo)(()=>Ib((n.alerts??[]).filter(t=>t.instrumentId===e.instrumentId),n.alertEvents??[],n.instruments??[]),[n.alerts,n.alertEvents,n.instruments,e.instrumentId]);return(0,x.jsxs)(`aside`,{className:`rounded-xl border border-border bg-card shadow-subtle-xs xl:sticky xl:top-4`,"aria-label":`${e.symbol} details`,children:[(0,x.jsxs)(`div`,{className:`border-b border-border p-4`,children:[(0,x.jsx)(By,{symbol:e.symbol,name:[e.name,e.exchange].filter(Boolean).join(` · `)}),(0,x.jsx)(`div`,{className:`mt-2 text-[28px] font-semibold leading-tight tabular-nums text-foreground`,children:t?.status===`ok`?qy(t.price):`—`}),(0,x.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-xs text-muted-foreground`,children:[t?.status===`ok`?(0,x.jsx)(Vy,{value:t.changePercent}):null,(0,x.jsx)(`span`,{children:t?.status===`ok`||!t?o.label:t.reason||`Quote unavailable`}),o.stale?(0,x.jsx)(Wy,{tone:`warn`,children:`stale`}):null]}),(0,x.jsx)(rx,{item:e,quote:t})]}),e.thesis||e.tags?.length?(0,x.jsxs)(ix,{title:`Thesis`,children:[e.thesis?(0,x.jsx)(`p`,{className:`text-[13px] leading-5 text-foreground`,children:e.thesis}):null,e.tags?.length?(0,x.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:e.tags.map(e=>(0,x.jsx)(Wy,{children:e},e))}):null]}):null,s?(0,x.jsxs)(ix,{title:`Position`,children:[(0,x.jsxs)(`div`,{className:`flex items-baseline justify-between text-[13px]`,children:[(0,x.jsxs)(`span`,{className:`text-muted-foreground`,children:[s.totalQuantity.toLocaleString(),` shares @`,` `,Jy(s.blendedCost,s.currency)]}),(0,x.jsx)(`span`,{className:`tabular-nums`,children:Jy(s.marketValue,s.currency)})]}),(0,x.jsxs)(`div`,{className:`mt-1 flex items-baseline justify-between text-[13px]`,children:[(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`Unrealized`}),(0,x.jsx)(Hy,{value:s.pnl,percent:s.pnlPercent,currency:s.currency})]})]}):null,(0,x.jsxs)(ix,{title:`Alerts`,children:[c.length===0?(0,x.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`No alerts for `,e.symbol,` yet.`]}):(0,x.jsx)(`ul`,{className:`space-y-1.5`,children:c.map(e=>(0,x.jsxs)(`li`,{className:`flex items-center justify-between gap-2 text-[13px]`,children:[(0,x.jsx)(Uy,{tone:e.tone,label:e.sentence}),(0,x.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:e.enabled?`armed`:`paused`})]},e.id))}),(0,x.jsx)(Z,{type:`button`,variant:`bordered`,size:`sm`,className:`mt-3 w-full`,disabled:r||e.targetPrice==null,onClick:()=>a(`manage_alerts`,{action:`create_price_above`,symbol:e.symbol,threshold:e.targetPrice}),children:e.targetPrice==null?`Set a target to enable alerts`:`Alert at target ${qy(e.targetPrice)}`})]}),(0,x.jsxs)(`div`,{className:`flex gap-2 p-4`,children:[(0,x.jsx)(Z,{type:`button`,variant:`bordered`,size:`sm`,className:`flex-1`,disabled:r,onClick:()=>i(`watchlist-edit`,{item:e}),children:`Edit`}),(0,x.jsx)(Fy,{label:`Remove`,confirmLabel:`Remove ${e.symbol}?`,size:`sm`,disabled:r,onConfirm:()=>a(`manage_watchlist`,{action:`remove`,symbol:e.symbol})})]})]})}function rx({item:e,quote:t}){let n=e.targetPrice,r=e.stopPrice;if(typeof n!=`number`&&typeof r!=`number`)return null;let i=t?.status===`ok`?t.price:null,a=typeof r==`number`?r:Math.min(i??n,n??i??0)*.8,o=(typeof n==`number`?n:Math.max(i??r,r??i??0)*1.2)-a,s=i!=null&&o>0?Math.min(1,Math.max(0,(i-a)/o)):null;return(0,x.jsxs)(`div`,{className:`mt-3`,children:[(0,x.jsx)(`div`,{className:`relative h-[5px] rounded-full bg-tertiary`,children:s==null?null:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{className:`absolute inset-y-0 left-0 rounded-full bg-hard`,style:{width:`${s*100}%`}}),(0,x.jsx)(`div`,{className:`absolute top-[-3px] h-[11px] w-[2px] rounded-sm bg-foreground`,style:{left:`${s*100}%`}})]})}),(0,x.jsxs)(`div`,{className:`mt-1.5 flex justify-between text-[11px] tabular-nums text-muted-foreground`,children:[(0,x.jsx)(`span`,{children:typeof r==`number`?`Stop ${qy(r)}`:``}),(0,x.jsx)(`span`,{children:typeof n==`number`?`Target ${qy(n)}`:``})]})]})}function ix({title:e,children:t}){return(0,x.jsxs)(`section`,{className:`border-b border-border p-4 last:border-0`,children:[(0,x.jsx)(`h3`,{className:`mb-2 text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:e}),t]})}var ax={watchlists:{title:`Watchlists`,primaryLabel:`Add ticker`,primaryPanel:`watchlist-add`},portfolios:{title:`Portfolios`,primaryLabel:`Add holding`,primaryPanel:`holding-add`},alerts:{title:`Alerts`,primaryLabel:`Create alert`,primaryPanel:`alert-create`},reports:{title:`Reports`,primaryLabel:`Generate today`}},ox=`Market-state mutations require acknowledged tool invocation support. Reconnect the GUI and try again.`;async function sx({readOnly:e,toolName:t,args:n,invokeToolRequest:r,setToast:i,refresh:a,refreshQuotes:o,setPendingMutation:s}){if(e)return i?.(`Saved-state changes are unavailable while OpenCandle reconnects local access.`,{destructive:!0}),!1;s?.({toolName:t});try{if(typeof r!=`function`)throw Error(ox);return await r(t,n),await a(),await o?.(),!0}catch(e){let t=e instanceof Error?e.message:String(e),n=t===sb;return i?.(t,{destructive:!n,title:n?`Operation still running`:`Tool failed`}),!1}finally{s?.(null)}}function cx({domain:e,role:t,send:n,invokeTool:r,navigate:i,setToast:a,onOpenSidebar:o,onOpenHome:s,sidebarCollapsed:c=!1,onExpandSidebar:l}){let{state:u,loading:f,error:p,refresh:m,refreshQuotes:h}=kb(),g=t!==`writer`,_=ax[e]??ax.watchlists,v=ax[e]?e:`watchlists`,[y,b]=(0,d.useState)(``),[S,C]=(0,d.useState)(null),[w,T]=(0,d.useState)(null),E=(0,d.useRef)(null),D=!!w,O=async(e,t)=>sx({readOnly:g,toolName:e,args:t,invokeToolRequest:r,setToast:a,refresh:m,refreshQuotes:h,setPendingMutation:T}),k=(e,t)=>{E.current=typeof document<`u`&&document.activeElement instanceof HTMLElement?document.activeElement:null,C({type:e,data:t})},A=()=>{let e=E.current;C(null),E.current=null,window.setTimeout(()=>{e?.isConnected&&e.focus()},0)};return(0,x.jsxs)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background`,children:[(0,x.jsx)(Fh,{onOpenSidebar:o,onOpenHome:s}),c?(0,x.jsx)(Ph,{onExpandSidebar:l}):null,(0,x.jsx)(`main`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-5 sm:px-6`,children:(0,x.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[1240px] flex-col gap-3`,children:[(0,x.jsx)(lx,{meta:_,loading:f,readOnly:g||D,onPrimary:()=>{if(v===`reports`){O(`daily_watchlist_report`,{action:`run`});return}k(_.primaryPanel)},quoteSnapshot:u.quoteSnapshot}),p?(0,x.jsx)(zy,{tone:`error`,children:p}):null,D?(0,x.jsx)(zy,{children:`Saving market-state change. Controls will unlock after the server acknowledges the operation.`}):null,g?(0,x.jsx)(zy,{children:bx(t)}):null,(0,x.jsxs)(`div`,{className:X(`grid min-h-0 gap-3`,S?`xl:grid-cols-[minmax(0,1fr)_380px]`:`grid-cols-1`),children:[(0,x.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3`,children:[v===`watchlists`?(0,x.jsx)($b,{state:u,filter:y,setFilter:b,readOnly:g||D,openPanel:k,invokeTool:O}):null,v===`portfolios`?(0,x.jsx)(Yb,{state:u,filter:y,setFilter:b,readOnly:g||D,openPanel:k,invokeTool:O,navigate:i}):null,v===`alerts`?(0,x.jsx)(Wb,{state:u,filter:y,setFilter:b,readOnly:g||D,openPanel:k,invokeTool:O}):null,v===`reports`?(0,x.jsx)(Qb,{state:u,readOnly:g||D,openPanel:k,invokeTool:O}):null]}),S?(0,x.jsx)(fx,{title:xx(S.type),onClose:A,children:(0,x.jsx)(ux,{panel:S,state:u,readOnly:g||D,invokeTool:O,closePanel:A})}):null]})]})})]})}function lx({meta:e,loading:t,readOnly:n,onPrimary:r,quoteSnapshot:i}){let a=Fb({fetchedAt:i?.generatedAt});return(0,x.jsxs)(`header`,{className:`flex flex-wrap items-center justify-between gap-3 px-1`,children:[(0,x.jsx)(`h1`,{className:`text-[17px] font-semibold text-foreground`,children:e.title}),(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:a.label}),a.stale?(0,x.jsx)(Wy,{tone:`warn`,children:`stale`}):null,(0,x.jsx)(Z,{type:`button`,variant:`brand`,size:`sm`,rounded:`full`,prefixIcon:Hd,disabled:n||t,onClick:r,children:e.primaryLabel})]})]})}function ux({panel:e,state:t,readOnly:n,invokeTool:r,closePanel:i}){let a=e.data?.item,o=e.data?.lot;return e.type===`watchlist-add`||e.type===`watchlist-edit`?(0,x.jsx)(px,{title:e.type===`watchlist-add`?`Add ticker`:`Edit ticker`,disabled:n,initialSymbol:a?.symbol,fields:[{name:`target_price`,label:`Target`,type:`number`,defaultValue:a?.targetPrice},{name:`stop_price`,label:`Stop`,type:`number`,defaultValue:a?.stopPrice},{name:`thesis`,label:`Thesis`,multiline:!0,defaultValue:a?.thesis},{name:`notes`,label:`Notes`,multiline:!0,defaultValue:a?.notes},{name:`tags`,label:`Tags`,defaultValue:a?.tags?.join(`, `)}],onSubmit:async t=>{let n=await r(`manage_watchlist`,mx(e.type,t));return n&&i(),n}},`${e.type}:${a?.id??a?.symbol??`new`}`):e.type===`holding-add`||e.type===`holding-edit`?(0,x.jsx)(hx,{disabled:n,lot:o,onSubmit:async e=>{let t=await r(`track_portfolio`,{action:o?`update`:`add`,lot_id:o?.id,symbol:e.symbol,shares:Number(e.shares),avg_cost:Number(e.avg_cost),currency:e.currency||void 0});return t&&i(),t}},`${e.type}:${o?.id??`new`}`):e.type===`alert-create`?(0,x.jsx)(yx,{disabled:n,invokeTool:r,onSaved:i}):e.type===`report-configure`?(0,x.jsx)(dx,{disabled:n,invokeTool:r,closePanel:i}):(0,x.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Select an action to continue.`})}function dx({disabled:e,invokeTool:t,closePanel:n}){let[r,i]=(0,d.useState)(`08:00`),a=Intl.DateTimeFormat().resolvedOptions().timeZone;return(0,x.jsxs)(`form`,{className:`space-y-3`,onSubmit:async e=>{e.preventDefault(),await t(`daily_watchlist_report`,{action:`configure`,timezone:a,local_time:r})&&n()},children:[(0,x.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`The morning report runs daily while OpenCandle is open. Times use your timezone (`,a,`).`]}),(0,x.jsxs)(`label`,{className:`grid gap-1 text-xs font-medium text-muted-foreground`,children:[`Run at`,(0,x.jsx)(ah,{"aria-label":`Report time`,type:`time`,value:r,disabled:e,required:!0,onChange:e=>i(e.target.value)})]}),(0,x.jsx)(Z,{type:`submit`,variant:`brand`,size:`sm`,disabled:e||!r,children:`Save schedule`})]})}function fx({title:e,onClose:t,children:n}){let r=(0,d.useRef)(null);return(0,d.useEffect)(()=>{let e=r.current;if(e){if(window.matchMedia(`(min-width: 1280px)`).matches){let t=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;e.scrollIntoView({block:`start`,behavior:t?`auto`:`smooth`})}e.focus({preventScroll:!0})}},[e]),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{className:`fixed inset-0 z-40 bg-foreground/25 xl:hidden`,"aria-hidden":`true`,onClick:t}),(0,x.jsxs)(`aside`,{ref:r,tabIndex:-1,className:`fixed inset-x-0 bottom-0 z-50 max-h-[85dvh] overflow-y-auto rounded-t-xl border border-border bg-card shadow-subtle-md outline-none focus-visible:ring-2 focus-visible:ring-ring xl:sticky xl:top-0 xl:bottom-auto xl:inset-x-auto xl:z-auto xl:max-h-[calc(100vh-120px)] xl:rounded-md xl:shadow-subtle-xs`,children:[(0,x.jsxs)(`div`,{className:`sticky top-0 flex items-center justify-between gap-2 border-b border-border bg-card px-4 py-3`,children:[(0,x.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:e}),(0,x.jsx)(Z,{type:`button`,variant:`ghost`,size:`xs`,icon:$d,tooltip:`Close panel`,"aria-label":`Close panel`,onClick:t})]}),(0,x.jsx)(`div`,{className:`p-4`,children:n})]})]})}function px({fields:e,disabled:t,initialSymbol:n=``,onSubmit:r}){let[i,a]=(0,d.useState)(()=>Object.fromEntries(e.map(e=>[e.name,e.defaultValue??``]))),[o,s]=(0,d.useState)(n),[c,l]=(0,d.useState)(n),u=c||n;return(0,x.jsxs)(`form`,{className:`space-y-3`,onSubmit:async t=>{t.preventDefault(),u&&await r({...i,symbol:u})!==!1&&(a(Object.fromEntries(e.map(e=>[e.name,e.defaultValue??``]))),s(n),l(n))},children:[(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:u?`Selected ${u}`:`Search and select a ticker before saving.`}),(0,x.jsx)(gx,{query:o,selected:c,disabled:t||!!n,onQueryChange:s,onSelectedChange:l}),(0,x.jsx)(`div`,{className:`grid gap-3`,children:e.map(e=>(0,x.jsxs)(`label`,{className:`grid gap-1 text-xs font-medium text-muted-foreground`,children:[e.label,e.type===`select`?(0,x.jsx)(`select`,{"aria-label":e.label,className:`h-11 w-full rounded-md border border-border bg-card px-3 text-sm text-foreground md:h-9`,value:i[e.name]||``,disabled:t,required:e.required,onChange:t=>a(n=>({...n,[e.name]:t.target.value})),children:e.options.map(e=>(0,x.jsx)(`option`,{value:e,children:e},e))}):e.multiline?(0,x.jsx)(mh,{"aria-label":e.label,className:`rounded-md border border-border bg-card px-3 py-2`,value:i[e.name]||``,disabled:t,required:e.required,onChange:t=>a(n=>({...n,[e.name]:t.target.value}))}):(0,x.jsx)(ah,{"aria-label":e.label,type:e.type||`text`,step:e.type===`number`?`any`:void 0,placeholder:e.placeholder,value:i[e.name]||``,disabled:t,required:e.required,onChange:t=>a(n=>({...n,[e.name]:t.target.value}))})]},e.name))}),(0,x.jsx)(Z,{type:`submit`,variant:`brand`,disabled:t||!u,children:u?`Save`:`Select a ticker to save`})]})}function mx(e,t){let n=e===`watchlist-edit`;return{action:n?`update`:`add`,symbol:t.symbol,target_price:n?wx(t.target_price):Cx(t.target_price),stop_price:n?wx(t.stop_price):Cx(t.stop_price),thesis:n?Tx(t.thesis):t.thesis||void 0,notes:n?Tx(t.notes):t.notes||void 0,tags:n?Ex(t.tags)??[]:Ex(t.tags)}}function hx({disabled:e,lot:t,onSubmit:n}){let[r,i]=(0,d.useState)({shares:t?.quantity??``,avg_cost:t?.avgCost??``,currency:t?.currency??`USD`}),[a,o]=(0,d.useState)(t?.symbol??``),[s,c]=(0,d.useState)(t?.symbol??``),l=s||t?.symbol;return(0,x.jsxs)(`form`,{className:`space-y-3`,onSubmit:async e=>{e.preventDefault(),!(!l||!r.shares||!r.avg_cost)&&await n({...r,symbol:l})},children:[(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:l?`Selected ${l}`:`Search provider-backed candidates and select a resolved ticker before saving.`}),(0,x.jsx)(gx,{query:a,selected:s,disabled:e||!!t,onQueryChange:o,onSelectedChange:c}),(0,x.jsxs)(`label`,{className:`grid gap-1 text-xs font-medium text-muted-foreground`,children:[`Quantity`,(0,x.jsx)(ah,{"aria-label":`Quantity`,type:`number`,step:`any`,value:r.shares,disabled:e,required:!0,onChange:e=>i(t=>({...t,shares:e.target.value}))})]}),(0,x.jsxs)(`label`,{className:`grid gap-1 text-xs font-medium text-muted-foreground`,children:[`Average cost per share`,(0,x.jsx)(ah,{"aria-label":`Average cost`,type:`number`,step:`any`,value:r.avg_cost,disabled:e,required:!0,onChange:e=>i(t=>({...t,avg_cost:e.target.value}))})]}),(0,x.jsxs)(`label`,{className:`grid gap-1 text-xs font-medium text-muted-foreground`,children:[`Currency`,(0,x.jsx)(ah,{"aria-label":`Currency`,value:r.currency,disabled:e,onChange:e=>i(t=>({...t,currency:e.target.value}))})]}),(0,x.jsx)(Z,{type:`submit`,variant:`brand`,disabled:e||!l||!r.shares||!r.avg_cost,children:`Save`})]})}function gx({query:e,selected:t,disabled:n,onQueryChange:r,onSelectedChange:i}){let a=(0,d.useId)(),o=(0,d.useId)(),[s,c]=(0,d.useState)([]),[l,u]=(0,d.useState)(-1),f=e.trim().length>=2&&!t?s:[],p=_x(l,f.length),m=p>=0?f[p]:null,h=m?`${o}-option-${p}`:void 0,g=e=>{i(e.symbol),r(`${e.symbol} - ${e.name||e.quoteType}`),c([]),u(-1)};return(0,d.useEffect)(()=>{if(e.trim().length<2||t)return;let n=!1,r=window.setTimeout(()=>{Ab(e).then(e=>{n||c(e.slice(0,5))}).catch(()=>{n||c([])})},180);return()=>{n=!0,window.clearTimeout(r)}},[e,t]),(0,x.jsxs)(`div`,{className:`relative`,children:[(0,x.jsx)(`label`,{className:`sr-only`,htmlFor:a,children:`Search ticker or company`}),(0,x.jsx)(Kd,{className:`pointer-events-none absolute left-3 top-2.5 size-4 text-muted-foreground`,"aria-hidden":`true`}),(0,x.jsx)(ah,{id:a,role:`combobox`,"aria-autocomplete":`list`,"aria-expanded":f.length>0,"aria-controls":o,"aria-activedescendant":h,className:`pl-9`,placeholder:`Search ticker or company`,value:e,disabled:n,onKeyDown:e=>{if(e.key===`ArrowDown`){if(e.preventDefault(),f.length===0)return;u(e=>vx(e,f.length,`next`))}else if(e.key===`ArrowUp`){if(e.preventDefault(),f.length===0)return;u(e=>vx(e,f.length,`previous`))}else e.key===`Enter`&&m?(e.preventDefault(),g(m)):e.key===`Escape`&&f.length>0&&(e.preventDefault(),c([]),u(-1))},onChange:e=>{c([]),u(-1),r(e.target.value),i(``)}}),f.length?(0,x.jsx)(`div`,{id:o,role:`listbox`,"aria-label":`Ticker suggestions`,className:`absolute z-20 mt-1 w-full overflow-hidden rounded-md border border-border bg-card shadow-subtle-md`,children:f.map((e,t)=>(0,x.jsxs)(`button`,{id:`${o}-option-${t}`,type:`button`,role:`option`,"aria-selected":t===p,className:X(`flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs hover:bg-secondary`,t===p&&`bg-secondary`),onMouseDown:e=>e.preventDefault(),onMouseEnter:()=>u(t),onClick:()=>g(e),children:[(0,x.jsx)(`span`,{className:`font-medium text-foreground`,children:e.symbol}),(0,x.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e.name||e.quoteType})]},`${e.provider}:${e.symbol}:${e.exchange}`))}):null]})}function _x(e,t){return t<=0||e<0?-1:Math.min(e,t-1)}function vx(e,t,n){if(t<=0)return-1;let r=_x(e,t);return n===`next`?(r+1)%t:r<=0?t-1:r-1}function yx({disabled:e,invokeTool:t,onSaved:n}){let[r,i]=(0,d.useState)({query:``,selected:``,threshold:``,condition:`create_price_above`,period:`14`,cooldown:`3600`}),a=(e,t)=>i(n=>({...n,[e]:t})),{query:o,selected:s,threshold:c,condition:l,period:u,cooldown:f}=r,p=!l.includes(`_sma`)&&l!==`create_volume_spike`,m=p||l===`create_volume_spike`,h=l.includes(`_sma`)||l.includes(`_rsi_`)||l===`create_volume_spike`,g=s,_=g?`Notify once when ${g} ${Sx(l,c,u)} during a manual or local-runner check.`:`Select an instrument to preview the alert rule.`;return(0,x.jsxs)(`form`,{className:`space-y-3`,onSubmit:async e=>{e.preventDefault(),!(!g||p&&!c)&&await t(`manage_alerts`,{action:l,symbol:g,threshold:m&&c?Number(c):void 0,period:h?Number(u):void 0,cooldown_seconds:Cx(f)})&&(i(e=>({...e,query:``,selected:``,threshold:``})),n?.())},children:[(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Pick a symbol and condition. Rules are checked while OpenCandle is open.`}),(0,x.jsx)(gx,{query:o,selected:s,disabled:e,onQueryChange:e=>a(`query`,e),onSelectedChange:e=>a(`selected`,e)}),(0,x.jsxs)(`label`,{className:`grid gap-1 text-xs font-medium text-muted-foreground`,children:[`Condition`,(0,x.jsxs)(`select`,{"aria-label":`Alert condition`,className:`h-11 w-full rounded-md border border-border bg-card px-3 text-sm text-foreground md:h-9`,value:l,disabled:e,onChange:e=>a(`condition`,e.target.value),children:[(0,x.jsx)(`option`,{value:`create_price_above`,children:`Price above`}),(0,x.jsx)(`option`,{value:`create_price_below`,children:`Price below`}),(0,x.jsx)(`option`,{value:`create_price_above_sma`,children:`Price above SMA`}),(0,x.jsx)(`option`,{value:`create_price_below_sma`,children:`Price below SMA`}),(0,x.jsx)(`option`,{value:`create_rsi_above`,children:`RSI above`}),(0,x.jsx)(`option`,{value:`create_rsi_below`,children:`RSI below`}),(0,x.jsx)(`option`,{value:`create_volume_spike`,children:`Volume spike`})]})]}),m?(0,x.jsxs)(`label`,{className:`grid gap-1 text-xs font-medium text-muted-foreground`,children:[l===`create_volume_spike`?`Multiplier (× average volume, optional)`:`Threshold`,(0,x.jsx)(ah,{"aria-label":`Alert threshold`,type:`number`,step:`any`,value:c,disabled:e,onChange:e=>a(`threshold`,e.target.value)})]}):null,h?(0,x.jsxs)(`label`,{className:`grid gap-1 text-xs font-medium text-muted-foreground`,children:[`Period (days)`,(0,x.jsx)(ah,{"aria-label":`Alert period`,type:`number`,step:`any`,value:u,disabled:e,onChange:e=>a(`period`,e.target.value)})]}):null,(0,x.jsxs)(`label`,{className:`grid gap-1 text-xs font-medium text-muted-foreground`,children:[`Cooldown between triggers (seconds)`,(0,x.jsx)(ah,{"aria-label":`Alert cooldown seconds`,type:`number`,step:`any`,value:f,disabled:e,onChange:e=>a(`cooldown`,e.target.value)})]}),(0,x.jsx)(`div`,{className:`rounded-md border border-border bg-secondary px-3 py-2 text-xs text-muted-foreground`,children:_}),(0,x.jsx)(Z,{type:`submit`,variant:`brand`,disabled:e||!g||p&&!c,children:`Create alert`})]})}function bx(e){return e===`connecting`?`Connecting to the GUI session. Saved-state changes will resume when local access is ready.`:e===`disconnected`?`Disconnected from the GUI session. Saved-state changes will resume automatically.`:`Saved-state changes are unavailable in this window while OpenCandle reconnects local access. Tables, summaries, and details remain available.`}function xx(e){return{"watchlist-add":`Add Ticker`,"watchlist-edit":`Edit Ticker`,"holding-add":`Add Holding`,"holding-edit":`Edit Holding`,"alert-create":`Create Alert`,"report-configure":`Configure Report`}[e]||`Details`}function Sx(e,t,n){let r=e.replace(`create_`,``).replaceAll(`_`,` `);return e.includes(`_sma`)?`${r} over ${n||`the selected`} periods`:e.includes(`_rsi_`)?`${r} ${t||`the threshold`} over ${n||`the selected`} periods`:e===`create_volume_spike`?`has a volume spike above ${t||`2`}x the ${n||`selected`}-period average`:`${r} $${t||`the threshold`}`}function Cx(e){if(e===``||e==null)return;let t=Number(e);return Number.isFinite(t)?t:void 0}function wx(e){if(e===``||e==null)return null;let t=Number(e);return Number.isFinite(t)?t:null}function Tx(e){return String(e??``).trim()?e:null}function Ex(e){let t=[];for(let n of String(e??``).split(`,`)){let e=n.trim();e&&t.push(e)}return t.length?t:void 0}function Dx(e){let t=String(e||``).match(/^\/sessions\/([^/]+)$/);return t?decodeURIComponent(t[1]):``}function Ox({pathname:e,currentSessionId:t,events:n,runState:r,liveBaseEventCount:i,canStartFreshHomeSession:a=!0}){let o=Dx(e),s=!!(o&&o!==t),c=a&&e===`/`&&Ax(n);return{routeSessionId:o,pendingSessionSwitch:s,pendingFreshHomeSession:c,activeSessionId:o||t||``,events:s||c?[]:r===`connecting`||r===`streaming`?n.slice(0,i):n}}function kx({pathname:e,supportsSessionActions:t,hasCurrentSessionContent:n=!1,canStartFreshHomeSession:r=!0}){let i=Dx(e);return i?{mode:`route`,sessionId:i}:t&&r&&n?{mode:`fresh`}:{mode:`current`}}function Ax(e){return(e||[]).some(e=>e.type===`message.completed`||e.type===`custom.message`)}function jx({pathname:e,currentSessionId:t,entryCount:n,lastResetSessionId:r,canStartFreshHomeSession:i=!0}){return e===`/`&&i&&!!t&&n>0&&r===``}function Mx(e){return e===`touch`||e===`pen`}function Nx({session:e,active:t,onOpen:n,onRename:r,onDelete:i}){let a=e.name||e.firstMessage||`Untitled session`,[o,s]=(0,d.useState)(!1),[c,l]=(0,d.useState)(!1),[u,f]=(0,d.useState)(a),p=(0,d.useRef)(null),m=(0,d.useRef)(null),h=(0,d.useRef)(!1);(0,d.useEffect)(()=>{c||f(a)},[c,a]),(0,d.useEffect)(()=>{c&&(p.current?.focus?.(),p.current?.select?.())},[c]),(0,d.useEffect)(()=>()=>{m.current&&window.clearTimeout(m.current)},[]);let g=()=>{m.current&&=(window.clearTimeout(m.current),null)},_=()=>{g(),h.current=!0,s(!0)},v=e=>{Mx(e.pointerType)&&(g(),m.current=window.setTimeout(_,500))},y=()=>{let t=u.trim();t&&(r?.(e,t),l(!1))};return c?(0,x.jsxs)(`form`,{className:X(`rounded-md px-2 py-1.5`,t?`bg-tertiary`:`bg-background`),onSubmit:e=>{e.preventDefault(),y()},children:[(0,x.jsx)(`label`,{className:`sr-only`,htmlFor:`rename-session-${e.id}`,children:`Rename session`}),(0,x.jsx)(`input`,{ref:p,id:`rename-session-${e.id}`,value:u,onChange:e=>f(e.target.value),onBlur:y,onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),f(a),l(!1))},className:`h-7 w-full rounded-md border border-border bg-card px-2 text-sm text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring`})]}):(0,x.jsxs)(`div`,{className:X(`group flex items-center rounded-md transition-colors focus-within:bg-tertiary hover:bg-tertiary`,t?`bg-tertiary text-foreground`:`text-muted-foreground hover:text-foreground`),children:[(0,x.jsx)(`button`,{type:`button`,"data-long-press-menu":!0,onPointerDown:v,onPointerUp:g,onPointerCancel:g,onPointerLeave:g,onContextMenu:e=>{e.preventDefault(),_()},onClick:t=>{if(h.current){t.preventDefault(),t.stopPropagation(),h.current=!1;return}n(e)},className:`min-w-0 flex-1 truncate px-3 py-2 text-left text-sm focus-visible:outline-none`,title:a,children:a}),(0,x.jsx)(Pf,{open:o,onOpenChange:e=>{s(e),e||(h.current=!1)},children:(0,x.jsxs)(zf,{className:`mr-1 shrink-0`,children:[(0,x.jsx)(Lf,{asChild:!0,children:(0,x.jsx)(Z,{variant:`ghost`,size:`icon-xs`,"aria-label":`Session options for ${a}`,className:X(`opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100`,o&&`opacity-100`),onClick:e=>{e.stopPropagation()},children:(0,x.jsx)(ud,{})})}),(0,x.jsxs)(Rf,{align:`end`,side:`bottom`,className:`w-44 p-1`,children:[(0,x.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`flex w-full items-center gap-2 rounded-md px-2 py-2 text-left text-sm text-foreground hover:bg-secondary`,onClick:()=>{s(!1),l(!0)},children:[(0,x.jsx)(Vd,{className:`h-4 w-4 text-muted-foreground`,"aria-hidden":`true`}),`Rename`]}),(0,x.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`flex w-full items-center gap-2 rounded-md px-2 py-2 text-left text-sm text-destructive hover:bg-destructive/10`,onClick:()=>{s(!1),window.confirm(`Delete "${a}"?`)&&i?.(e)},children:[(0,x.jsx)(Xd,{className:`h-4 w-4`,"aria-hidden":`true`}),`Delete chat`]})]})]})})]})}function Px(e,t){let n=Ix(t);return n?e.filter(e=>Fx(e,n)):e}function Fx(e,t){return[e.name,e.firstMessage,e.allMessagesText,e.id].some(e=>Ix(e).includes(t))}function Ix(e){return String(e||``).trim().toLowerCase()}var Lx=1440*60*1e3;function Rx({collapsed:e,onCollapse:t,...n}){return e?null:(0,x.jsx)(`aside`,{className:`hidden h-full w-[260px] shrink-0 overflow-hidden border-r border-border bg-secondary md:block`,children:(0,x.jsx)(Bx,{...n,onClose:t,closeLabel:`Collapse sidebar`,closeIcon:md})})}function zx({open:e,onClose:t,...n}){return(0,x.jsx)(ly,{open:e,onOpenChange:e=>{e||t()},children:(0,x.jsx)(fy,{width:`sm`,handleLabel:`Sessions`,className:`bg-secondary p-0`,children:(0,x.jsx)(`div`,{className:`flex h-full min-h-0 flex-col`,children:(0,x.jsx)(Bx,{...n,showHeader:!1})})})})}function Bx({sessions:e,currentSessionId:t,currentPath:n=``,onOpenSession:r,onRenameSession:i,onDeleteSession:a,onNewSession:o,onOpenHome:s,onClose:c,showHeader:l=!0,closeLabel:u=`Close sidebar`,closeIcon:f=$d}){let[p,m]=(0,d.useState)(``),h=(0,d.useMemo)(()=>Px(e,p),[e,p]),g=(0,d.useMemo)(()=>Gx(h),[h]),_=p.trim().length>0;return(0,x.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-2 px-3 py-3`,children:[l?(0,x.jsxs)(`div`,{className:`flex items-center gap-2 px-1`,children:[(0,x.jsxs)(`button`,{type:`button`,"aria-label":`Go to new chat`,onClick:s,className:`flex min-w-0 items-center gap-2 rounded-md px-1 py-1 text-sm font-semibold tracking-tight text-foreground transition-colors hover:bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[(0,x.jsx)(Nh,{}),(0,x.jsx)(`span`,{className:`truncate`,children:`OpenCandle`})]}),c?(0,x.jsx)(Z,{variant:`ghost`,size:`icon-sm`,className:`ml-auto`,"aria-label":u,onClick:c,children:(0,x.jsx)(f,{})}):(0,x.jsx)(md,{className:`ml-auto h-4 w-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`})]}):null,(0,x.jsxs)(Z,{variant:`bordered`,className:`w-full justify-center gap-2`,onClick:o,children:[(0,x.jsx)(Hd,{}),` New chat`]}),(0,x.jsx)(Hx,{value:p,onChange:m}),(0,x.jsxs)(`div`,{className:`-mx-1 flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto px-1 pb-2`,children:[(0,x.jsx)(Vx,{currentPath:n}),(0,x.jsx)(Wx,{label:`Today`,sessions:g.today,currentSessionId:t,onOpenSession:r,onRenameSession:i,onDeleteSession:a}),(0,x.jsx)(Wx,{label:`Yesterday`,sessions:g.yesterday,currentSessionId:t,onOpenSession:r,onRenameSession:i,onDeleteSession:a}),(0,x.jsx)(Wx,{label:`Earlier`,sessions:g.earlier,currentSessionId:t,onOpenSession:r,onRenameSession:i,onDeleteSession:a}),_&&h.length===0?(0,x.jsx)(`p`,{className:`px-3 py-2 text-sm text-muted-foreground`,children:`No matching chats`}):null,e.length===0?(0,x.jsx)(`p`,{className:`px-3 text-xs text-muted-foreground`,children:`Current local session`}):null]})]})}function Vx({currentPath:e}){return(0,x.jsxs)(`div`,{className:`flex flex-col gap-0.5 border-b border-border pb-2`,children:[(0,x.jsx)(Ux,{children:`Market State`}),[{to:`/watchlists`,label:`Watchlists`,icon:Ld},{to:`/portfolios`,label:`Portfolios`,icon:Sd},{to:`/alerts`,label:`Alerts`,icon:bd},{to:`/reports`,label:`Reports`,icon:jd},{to:`/diagnostics`,label:`Diagnostics`,icon:Od}].map(t=>{let n=e===t.to,r=t.icon;return(0,x.jsx)(Z,{asChild:!0,variant:n?`default`:`ghost`,size:`sm`,className:`w-full justify-start`,children:(0,x.jsxs)(tr,{to:t.to,children:[(0,x.jsx)(r,{className:`button-icon`,"aria-hidden":`true`}),t.label]})},t.to)})]})}function Hx({value:e,onChange:t}){return(0,x.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border bg-background px-3 transition-colors focus-within:border-foreground/40`,children:[(0,x.jsx)(Kd,{className:`h-4 w-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,x.jsx)(`label`,{className:`sr-only`,htmlFor:`session-search`,children:`Search`}),(0,x.jsx)(ah,{variant:`ghost`,id:`session-search`,placeholder:`Search`,value:e,onChange:e=>t(e.target.value),className:`h-9 px-0 text-sm shadow-none`})]})}function Ux({icon:e,children:t}){return(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 pt-2 text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:[e?(0,x.jsx)(e,{className:`h-3 w-3 shrink-0`,"aria-hidden":`true`}):null,t]})}function Wx({label:e,sessions:t,currentSessionId:n,onOpenSession:r,onRenameSession:i,onDeleteSession:a}){return t?.length?(0,x.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,x.jsx)(Ux,{children:e}),t.map(e=>(0,x.jsx)(Nx,{session:e,active:e.id===n,onOpen:r,onRename:i,onDelete:a},e.path))]}):null}function Gx(e){let t=Kx(Date.now()),n=t-Lx,r={today:[],yesterday:[],earlier:[]};for(let i of e){let e=new Date(i.modified).getTime();if(Number.isNaN(e)){r.earlier.push(i);continue}e>=t?r.today.push(i):e>=n?r.yesterday.push(i):r.earlier.push(i)}return r}function Kx(e){let t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}var qx=`__current__`;function Jx(e){return String(e??``).trim()}function Yx(e){return Jx(e)||qx}function Xx(e){let t=Jx(e);return t?`/api/sessions/${encodeURIComponent(t)}/runs`:`/api/chat/run`}function Zx(e=`action`){return`${e}-${globalThis.crypto?.randomUUID?.()||`${Date.now()}-${Math.random().toString(36).slice(2)}`}`}function Qx(e,t,n){let r=Jx(t),i={prompt:e,actionId:n};return r?{...i,sessionId:r}:i}function $x(e){return e?{sessionId:e.sessionId,...e.actionId?{actionId:e.actionId}:{}}:null}function eS(e,t){return e===409&&t?.code===`session_changed`}function tS(e){return e?.ok===!0&&e?.duplicate===!0}function nS({activeSessionId:e=``,setToast:t,onEvent:n,onRunStart:r}){let i=(0,d.useRef)(new Map),a=(0,d.useRef)({}),[o,s]=(0,d.useState)({}),[c,l]=(0,d.useState)({}),u=(0,d.useCallback)((e,t)=>{s(n=>{let r={...n,[e]:t};return a.current=r,r})},[]),f=(0,d.useCallback)(async(o,c={})=>{let d=String(o||``).trim(),f=Jx(c.sessionId||e),p=Yx(f),m=a.current[p]||`ready`;if(!d||m===`connecting`||m===`streaming`)return;let h=c.actionId||Zx(`chat`);l(e=>({...e,[p]:{prompt:d,sessionId:f,actionId:h}})),u(p,`connecting`),t(``),r?.(d,c.baseEventCount,f);let g=new AbortController;i.current.set(p,g);try{let e=await fetch(Xx(f),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(Qx(d,f,h)),signal:g.signal});if(!e.ok){let t=await e.json().catch(()=>({error:e.statusText}));if(eS(e.status,t))return u(p,`ready`),{sessionChanged:!0};throw Error(t.error||e.statusText)}if(e.headers.get(`content-type`)?.includes(`application/json`)&&tS(await e.json().catch(()=>null)))return u(p,`ready`),{duplicate:!0};u(p,`streaming`),await rS(e,e=>{n?.(e,f),e.type===`run.failed`&&(l(e=>({...e,[p]:{prompt:d,sessionId:f,actionId:``}})),u(p,`failed`),t(e.error?.message||`Run failed`)),e.type===`run.completed`&&u(p,`ready`)}),s(e=>{let t={...e,[p]:e[p]===`failed`?`failed`:`ready`};return a.current=t,t})}catch(e){e?.name===`AbortError`?(t(`Stopped response.`),u(p,`ready`)):(t(e?.message||String(e)),u(p,`failed`))}finally{i.current.delete(p)}},[e,u,t,n,r]),p=(0,d.useCallback)((t=e)=>{i.current.get(Yx(t))?.abort()},[e]),m=(0,d.useCallback)((t=e)=>{let n=c[Yx(t)],r=$x(n);n&&r&&f(n.prompt,r)},[e,c,f]),h=Yx(e),g=o[h]||`ready`,_=(c[h]||null)?.prompt??``;return(0,d.useMemo)(()=>({runState:g,runStates:o,lastPrompt:_,startChatRun:f,stopRun:p,retryRun:m}),[g,o,_,f,p,m])}async function rS(e,t){let n=e.body?.getReader();if(!n)return;let r=new TextDecoder,i=``;for(;;){let{value:e,done:a}=await n.read();if(a)break;i+=r.decode(e,{stream:!0});let o=i.indexOf(`
|
|
60
|
-
|
|
61
|
-
`);for(;o!==-1;){let e=i.slice(0,o);i=i.slice(o+2);let n=e.split(`
|
|
62
|
-
`).filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).trim()).join(`
|
|
63
|
-
`);if(n){try{t(JSON.parse(n))}catch{}o=i.indexOf(`
|
|
64
|
-
|
|
65
|
-
`)}}}}var iS=`modulepreload`,aS=function(e){return`/`+e},oS={},sS=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}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,new URL(`../../../src/node/plugins/importAnalysisBuild.ts`,import.meta.url)).href}r=o(t.map(t=>{if(t=aS(t,n),t=s(t),t in oS)return;oS[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:iS,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.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)})},cS=()=>sS(()=>import(`./CatalogOverlay-ChRTKNlf.js`),[]),lS=(0,d.lazy)(()=>cS().then(e=>({default:e.CatalogOverlay}))),uS=new Set([`catalog`,`tools`,`workflows`,`providers`]);function dS(){let e=v(),t=zr({select:e=>e.location.pathname}),n=zr({select:e=>e.location.search}),r=xb(),i=Dx(t),a=i||r.currentSessionId||``,o=a?r.sessionSnapshots[a]:null,s=o?.events||r.events,c=o?.dashboard||r.dashboard,l=s.length,[u,f]=(0,d.useState)({}),[p,m]=(0,d.useState)({}),h=nS({activeSessionId:a,setToast:r.setToast,onRunStart:(0,d.useCallback)((e,t,n)=>{let i=n||a;if(!i)return;let o=r.sessionSnapshots[i];m(e=>({...e,[i]:t??o?.events?.length??l})),f(t=>({...t,[i]:U_(e,i)}))},[a,r.sessionSnapshots,l]),onEvent:(0,d.useCallback)((n,o)=>{let s=String(n.sessionId||o||a);if(!s||(f(e=>({...e,[s]:[...e[s]||[],n]})),n.type!==`run.started`||!n.sessionId))return;let c=String(n.sessionId);r.adoptSessionId(c);let l=`/sessions/${encodeURIComponent(c)}`;i||t===l||e({to:`/sessions/$sessionId`,params:{sessionId:c},search:e=>({...e,drawer:void 0})})},[a,t,i,e,r])}),g=n?.drawer,_=uS.has(g),y=g===`history`||t===`/history`,b=g===`context`,[S,C]=(0,d.useState)(``),[w,T]=(0,d.useState)(!1),[E,D]=(0,d.useState)(!1),O=(0,d.useRef)(``),k=(0,d.useRef)(!1),A=Ox({pathname:t,currentSessionId:i&&o?i:r.currentSessionId,events:s,runState:h.runState,liveBaseEventCount:p[a]||0,canStartFreshHomeSession:r.role===`writer`&&r.supportsSessionActions&&!n?.messageId}),j=u[A.activeSessionId]||[],M=p[A.activeSessionId]||0,N=r.coordination?.sessionId===A.activeSessionId&&r.coordination?.ownerKind===`tui`,P=N?[]:r.askUserPrompts.filter(e=>!e.sessionId||e.sessionId===A.activeSessionId),F=Ax(s),I=s.length,ee=A.pendingSessionSwitch||A.pendingFreshHomeSession||!r.supportsSessionActions,te=(0,d.useCallback)(t=>{e({search:e=>({...e,drawer:t})})},[e]),ne=(0,d.useCallback)(e=>{e&&(f(t=>{if(!t[e])return t;let n={...t};return delete n[e],n}),m(t=>{if(!t[e])return t;let n={...t};return delete n[e],n}))},[]),L=(0,d.useCallback)(()=>{e({search:e=>({...e,drawer:void 0})})},[e]);(0,d.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),cS(),te(`catalog`)),e.key===`Escape`&&L()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[L,te]),(0,d.useEffect)(()=>{!i||o||r.loadSession(i)},[r.loadSession,i,o]),(0,d.useEffect)(()=>{if(t!==`/`){O.current=``;return}jx({pathname:t,currentSessionId:r.currentSessionId,entryCount:F?I:0,lastResetSessionId:O.current,canStartFreshHomeSession:r.role===`writer`&&r.supportsSessionActions&&!n?.messageId})&&(O.current=r.currentSessionId,r.newSession())},[t,r.currentSessionId,F,I,r.newSession,r.role,r.supportsSessionActions,n?.messageId]),(0,d.useEffect)(()=>{j.length===0||h.runState===`connecting`||h.runState===`streaming`||s.length<=M||ne(A.activeSessionId)},[h.runState,ne,M,j.length,A.activeSessionId,s.length]);let R=(0,d.useCallback)((e=`catalog`)=>{cS(),te(uS.has(e)?e:`catalog`)},[te]),z=(0,d.useCallback)(e=>{C(String(e??``)),setTimeout(()=>{let e=document.getElementById(`chat-composer`);e?.focus?.(),e instanceof HTMLTextAreaElement&&e.setSelectionRange(e.value.length,e.value.length)},220)},[]),re=(0,d.useCallback)(async e=>{let n=kx({pathname:t,supportsSessionActions:r.supportsSessionActions,hasCurrentSessionContent:F,canStartFreshHomeSession:r.role===`writer`});if(n.mode===`current`){h.startChatRun(e);return}if(n.mode===`route`){(await h.startChatRun(e,{sessionId:n.sessionId}))?.sessionChanged&&(ne(n.sessionId),r.setToast(`The active session changed before your message was sent. Please resend.`,{destructive:!0}));return}if(!k.current){k.current=!0;try{for(let t=0;t<2;t++){let t=await r.newSession();if(!t||(O.current=t,!(await h.startChatRun(e,{sessionId:t,baseEventCount:0}))?.sessionChanged))return}ne(O.current||a),r.setToast(`The active session changed before your message was sent. Please resend.`,{destructive:!0})}finally{k.current=!1}}},[a,t,F,r.role,r.supportsSessionActions,r.newSession,r.setToast,h.startChatRun,ne]),ie=(0,d.useCallback)(()=>{e({to:`/`,search:e=>({...e,drawer:void 0})})},[e]),ae=(0,d.useCallback)(()=>{(async()=>{let t=await r.newSession();t&&(T(!1),e({to:`/sessions/$sessionId`,params:{sessionId:t},search:e=>({...e,drawer:void 0})}))})()},[r,e]),oe=(0,d.useCallback)(t=>{T(!1),e({to:`/sessions/$sessionId`,params:{sessionId:t.id},search:e=>({...e,drawer:void 0})})},[e]),se=(0,d.useCallback)((e,t)=>{r.send(`session.rename`,{path:e.path,name:t})},[r]),ce=(0,d.useCallback)(t=>{r.send(`session.delete`,{path:t.path}),t.id===A.activeSessionId&&e({to:`/`,search:e=>({...e,drawer:void 0})})},[r,e,A.activeSessionId]),B={sessions:r.sessions,currentSessionId:A.activeSessionId,currentPath:t,collapsed:w,onCollapse:()=>T(!0),onOpenSession:oe,onRenameSession:se,onDeleteSession:ce,onNewSession:ae,onOpenHome:ie},le=g===`tools`?`tools`:g===`providers`?`providers`:`workflows`,ue=pS(t),de=(0,d.useCallback)((e,t)=>{if(N){let e=`OpenCandle is reconnecting to this session.`;return r.setToast(e),Promise.reject(Error(e))}return r.invokeTool(e,t,A.activeSessionId)},[r.invokeTool,r.setToast,N,A.activeSessionId]),fe=n?.messageId||n?.researchId||n?.synthesisId||``;return(0,x.jsxs)(g_,{activeSessionId:A.activeSessionId,children:[(0,x.jsxs)(`div`,{className:`flex overflow-hidden bg-background`,style:{height:`100dvh`},children:[(0,x.jsx)(Rx,{...B}),(0,x.jsx)(fS,{role:r.role}),t===`/diagnostics`?(0,x.jsx)(eb,{role:r.role,onOpenSidebar:()=>te(`history`),sidebarCollapsed:w,onExpandSidebar:()=>T(!1),onOpenProviders:()=>R(`providers`),onOpenModelSetup:()=>D(!0),onOpenHome:ie,setToast:r.setToast}):ue?(0,x.jsx)(cx,{domain:ue,role:r.role,send:r.send,invokeTool:de,navigate:e,setToast:r.setToast,onOpenSidebar:()=>te(`history`),onOpenHome:ie,sidebarCollapsed:w,onExpandSidebar:()=>T(!1)}):(0,x.jsx)(E_,{events:A.events,liveEvents:j,askUserPrompts:P,modelSetup:r.modelSetup,role:r.role,inputDisabled:ee,sessionLoading:A.pendingSessionSwitch,runState:h.runState,lastPrompt:h.lastPrompt,catalog:r.catalog,send:r.send,startChatRun:re,stopRun:h.stopRun,retryRun:h.retryRun,setToast:r.setToast,draft:S,setDraft:C,onOpenCommandPalette:R,onOpenSidebar:()=>te(`history`),onOpenHome:ie,onOpenContext:()=>te(`context`),sidebarCollapsed:w,onExpandSidebar:()=>T(!1),sessionId:A.activeSessionId,scrollAnchorId:fe}),(0,x.jsx)(ty,{})]}),(0,x.jsx)(ny,{}),(0,x.jsx)(zx,{open:y,...B,onClose:L}),(0,x.jsx)(gy,{open:b,state:c,catalog:r.catalog,onClose:L,onOpenMarketState:t=>{L(),e({to:t,search:e=>({...e,drawer:void 0})})},onConfigureProvider:()=>{L(),R(`providers`)}}),(0,x.jsx)(d.Suspense,{fallback:null,children:_?(0,x.jsx)(lS,{open:_,initialTab:le,catalog:r.catalog,onClose:L,send:r.send,setToast:r.setToast,startChatRun:re,fillComposer:z,sessionId:A.activeSessionId}):null}),(0,x.jsx)(sh,{open:E,onOpenChange:D,modelSetup:r.modelSetup,role:r.role,send:r.send,setToast:r.setToast}),(0,x.jsx)(Sf,{})]})}function fS({role:e}){return e!==`connecting`&&e!==`disconnected`?null:(0,x.jsx)(`div`,{className:`fixed left-1/2 top-3 z-[90] max-w-[calc(100vw-24px)] -translate-x-1/2 rounded-md border border-border bg-card px-3 py-2 text-xs text-muted-foreground shadow-subtle-md`,role:`status`,"aria-live":`polite`,children:e===`connecting`?`Connecting to the GUI session...`:`Reconnecting to the GUI session. Editing will resume automatically.`})}function pS(e){return e===`/watchlists`?`watchlists`:e===`/portfolios`?`portfolios`:e===`/alerts`?`alerts`:e===`/reports`?`reports`:``}var mS=gr({component:dS}),hS=mr({getParentRoute:()=>mS,path:`/`,validateSearch:ES}),gS=mr({getParentRoute:()=>mS,path:`/sessions/$sessionId`,validateSearch:ES}),_S=mr({getParentRoute:()=>mS,path:`/history`,validateSearch:ES}),vS=mr({getParentRoute:()=>mS,path:`/settings`,validateSearch:ES}),yS=mr({getParentRoute:()=>mS,path:`/diagnostics`,validateSearch:ES}),bS=mr({getParentRoute:()=>mS,path:`/watchlists`,validateSearch:ES}),xS=mr({getParentRoute:()=>mS,path:`/portfolios`,validateSearch:ES}),SS=mr({getParentRoute:()=>mS,path:`/alerts`,validateSearch:ES}),CS=mr({getParentRoute:()=>mS,path:`/reports`,validateSearch:ES}),wS=vr({routeTree:mS.addChildren([hS,gS,_S,vS,yS,bS,xS,SS,CS]),defaultPreload:`intent`}),TS=new Set([`history`,`context`,`catalog`,`tools`,`providers`,`workflows`]);function ES(e){return{drawer:typeof e.drawer==`string`&&TS.has(e.drawer)?e.drawer:void 0,prompt:typeof e.prompt==`string`?e.prompt:void 0,messageId:typeof e.messageId==`string`?e.messageId:void 0,researchId:typeof e.researchId==`string`?e.researchId:void 0,synthesisId:typeof e.synthesisId==`string`?e.synthesisId:void 0}}(0,Ur.createRoot)(document.getElementById(`root`)).render((0,x.jsx)(d.StrictMode,{children:(0,x.jsx)(Gl,{children:(0,x.jsx)(Rr,{router:wS})})}));export{b as _,Z as a,Qd as c,Hd as d,Fd as f,J as g,Td as h,Vf as i,Kd as l,Ed as m,fy as n,X as o,Ad as p,ah as r,$d as s,ly as t,Gd as u,u as v,c as y};
|