(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))c(f);new MutationObserver(f=>{for(const h of f)if(h.type==="childList")for(const v of h.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&c(v)}).observe(document,{childList:!0,subtree:!0});function r(f){const h={};return f.integrity&&(h.integrity=f.integrity),f.referrerPolicy&&(h.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?h.credentials="include":f.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function c(f){if(f.ep)return;f.ep=!0;const h=r(f);fetch(f.href,h)}})();function Wr(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Nr={exports:{}},Dl={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var th;function Pp(){if(th)return Dl;th=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function r(c,f,h){var v=null;if(h!==void 0&&(v=""+h),f.key!==void 0&&(v=""+f.key),"key"in f){h={};for(var S in f)S!=="key"&&(h[S]=f[S])}else h=f;return f=h.ref,{$$typeof:l,type:c,key:v,ref:f!==void 0?f:null,props:h}}return Dl.Fragment=s,Dl.jsx=r,Dl.jsxs=r,Dl}var eh;function tv(){return eh||(eh=1,Nr.exports=Pp()),Nr.exports}var H=tv(),Br={exports:{}},J={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ah;function ev(){if(ah)return J;ah=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),v=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),O=Symbol.iterator;function D(g){return g===null||typeof g!="object"?null:(g=O&&g[O]||g["@@iterator"],typeof g=="function"?g:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,nt={};function $(g,N,L){this.props=g,this.context=N,this.refs=nt,this.updater=L||B}$.prototype.isReactComponent={},$.prototype.setState=function(g,N){if(typeof g!="object"&&typeof g!="function"&&g!=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,g,N,"setState")},$.prototype.forceUpdate=function(g){this.updater.enqueueForceUpdate(this,g,"forceUpdate")};function Jt(){}Jt.prototype=$.prototype;function zt(g,N,L){this.props=g,this.context=N,this.refs=nt,this.updater=L||B}var lt=zt.prototype=new Jt;lt.constructor=zt,k(lt,$.prototype),lt.isPureReactComponent=!0;var Mt=Array.isArray,P={H:null,A:null,T:null,S:null,V:null},At=Object.prototype.hasOwnProperty;function qt(g,N,L,j,I,st){return L=st.ref,{$$typeof:l,type:g,key:N,ref:L!==void 0?L:null,props:st}}function It(g,N){return qt(g.type,N,void 0,void 0,void 0,g.props)}function Dt(g){return typeof g=="object"&&g!==null&&g.$$typeof===l}function rt(g){var N={"=":"=0",":":"=2"};return"$"+g.replace(/[=:]/g,function(L){return N[L]})}var ae=/\/+/g;function wt(g,N){return typeof g=="object"&&g!==null&&g.key!=null?rt(""+g.key):N.toString(36)}function Te(){}function Aa(g){switch(g.status){case"fulfilled":return g.value;case"rejected":throw g.reason;default:switch(typeof g.status=="string"?g.then(Te,Te):(g.status="pending",g.then(function(N){g.status==="pending"&&(g.status="fulfilled",g.value=N)},function(N){g.status==="pending"&&(g.status="rejected",g.reason=N)})),g.status){case"fulfilled":return g.value;case"rejected":throw g.reason}}throw g}function Vt(g,N,L,j,I){var st=typeof g;(st==="undefined"||st==="boolean")&&(g=null);var K=!1;if(g===null)K=!0;else switch(st){case"bigint":case"string":case"number":K=!0;break;case"object":switch(g.$$typeof){case l:case s:K=!0;break;case M:return K=g._init,Vt(K(g._payload),N,L,j,I)}}if(K)return I=I(g),K=j===""?"."+wt(g,0):j,Mt(I)?(L="",K!=null&&(L=K.replace(ae,"$&/")+"/"),Vt(I,N,L,"",function(We){return We})):I!=null&&(Dt(I)&&(I=It(I,L+(I.key==null||g&&g.key===I.key?"":(""+I.key).replace(ae,"$&/")+"/")+K)),N.push(I)),1;K=0;var ne=j===""?".":j+":";if(Mt(g))for(var vt=0;vt<g.length;vt++)j=g[vt],st=ne+wt(j,vt),K+=Vt(j,N,L,st,I);else if(vt=D(g),typeof vt=="function")for(g=vt.call(g),vt=0;!(j=g.next()).done;)j=j.value,st=ne+wt(j,vt++),K+=Vt(j,N,L,st,I);else if(st==="object"){if(typeof g.then=="function")return Vt(Aa(g),N,L,j,I);throw N=String(g),Error("Objects are not valid as a React child (found: "+(N==="[object Object]"?"object with keys {"+Object.keys(g).join(", ")+"}":N)+"). If you meant to render a collection of children, use an array instead.")}return K}function C(g,N,L){if(g==null)return g;var j=[],I=0;return Vt(g,j,"","",function(st){return N.call(L,st,I++)}),j}function q(g){if(g._status===-1){var N=g._result;N=N(),N.then(function(L){(g._status===0||g._status===-1)&&(g._status=1,g._result=L)},function(L){(g._status===0||g._status===-1)&&(g._status=2,g._result=L)}),g._status===-1&&(g._status=0,g._result=N)}if(g._status===1)return g._result.default;throw g._result}var Q=typeof reportError=="function"?reportError:function(g){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var N=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof g=="object"&&g!==null&&typeof g.message=="string"?String(g.message):String(g),error:g});if(!window.dispatchEvent(N))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",g);return}console.error(g)};function mt(){}return J.Children={map:C,forEach:function(g,N,L){C(g,function(){N.apply(this,arguments)},L)},count:function(g){var N=0;return C(g,function(){N++}),N},toArray:function(g){return C(g,function(N){return N})||[]},only:function(g){if(!Dt(g))throw Error("React.Children.only expected to receive a single React element child.");return g}},J.Component=$,J.Fragment=r,J.Profiler=f,J.PureComponent=zt,J.StrictMode=c,J.Suspense=T,J.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,J.__COMPILER_RUNTIME={__proto__:null,c:function(g){return P.H.useMemoCache(g)}},J.cache=function(g){return function(){return g.apply(null,arguments)}},J.cloneElement=function(g,N,L){if(g==null)throw Error("The argument must be a React element, but you passed "+g+".");var j=k({},g.props),I=g.key,st=void 0;if(N!=null)for(K in N.ref!==void 0&&(st=void 0),N.key!==void 0&&(I=""+N.key),N)!At.call(N,K)||K==="key"||K==="__self"||K==="__source"||K==="ref"&&N.ref===void 0||(j[K]=N[K]);var K=arguments.length-2;if(K===1)j.children=L;else if(1<K){for(var ne=Array(K),vt=0;vt<K;vt++)ne[vt]=arguments[vt+2];j.children=ne}return qt(g.type,I,void 0,void 0,st,j)},J.createContext=function(g){return g={$$typeof:v,_currentValue:g,_currentValue2:g,_threadCount:0,Provider:null,Consumer:null},g.Provider=g,g.Consumer={$$typeof:h,_context:g},g},J.createElement=function(g,N,L){var j,I={},st=null;if(N!=null)for(j in N.key!==void 0&&(st=""+N.key),N)At.call(N,j)&&j!=="key"&&j!=="__self"&&j!=="__source"&&(I[j]=N[j]);var K=arguments.length-2;if(K===1)I.children=L;else if(1<K){for(var ne=Array(K),vt=0;vt<K;vt++)ne[vt]=arguments[vt+2];I.children=ne}if(g&&g.defaultProps)for(j in K=g.defaultProps,K)I[j]===void 0&&(I[j]=K[j]);return qt(g,st,void 0,void 0,null,I)},J.createRef=function(){return{current:null}},J.forwardRef=function(g){return{$$typeof:S,render:g}},J.isValidElement=Dt,J.lazy=function(g){return{$$typeof:M,_payload:{_status:-1,_result:g},_init:q}},J.memo=function(g,N){return{$$typeof:y,type:g,compare:N===void 0?null:N}},J.startTransition=function(g){var N=P.T,L={};P.T=L;try{var j=g(),I=P.S;I!==null&&I(L,j),typeof j=="object"&&j!==null&&typeof j.then=="function"&&j.then(mt,Q)}catch(st){Q(st)}finally{P.T=N}},J.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},J.use=function(g){return P.H.use(g)},J.useActionState=function(g,N,L){return P.H.useActionState(g,N,L)},J.useCallback=function(g,N){return P.H.useCallback(g,N)},J.useContext=function(g){return P.H.useContext(g)},J.useDebugValue=function(){},J.useDeferredValue=function(g,N){return P.H.useDeferredValue(g,N)},J.useEffect=function(g,N,L){var j=P.H;if(typeof L=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return j.useEffect(g,N)},J.useId=function(){return P.H.useId()},J.useImperativeHandle=function(g,N,L){return P.H.useImperativeHandle(g,N,L)},J.useInsertionEffect=function(g,N){return P.H.useInsertionEffect(g,N)},J.useLayoutEffect=function(g,N){return P.H.useLayoutEffect(g,N)},J.useMemo=function(g,N){return P.H.useMemo(g,N)},J.useOptimistic=function(g,N){return P.H.useOptimistic(g,N)},J.useReducer=function(g,N,L){return P.H.useReducer(g,N,L)},J.useRef=function(g){return P.H.useRef(g)},J.useState=function(g){return P.H.useState(g)},J.useSyncExternalStore=function(g,N,L){return P.H.useSyncExternalStore(g,N,L)},J.useTransition=function(){return P.H.useTransition()},J.version="19.1.1",J}var nh;function Pr(){return nh||(nh=1,Br.exports=ev()),Br.exports}var x=Pr();const $e=Wr(x);var Hr={exports:{}},Ul={},jr={exports:{}},qr={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var lh;function av(){return lh||(lh=1,(function(l){function s(C,q){var Q=C.length;C.push(q);t:for(;0<Q;){var mt=Q-1>>>1,g=C[mt];if(0<f(g,q))C[mt]=q,C[Q]=g,Q=mt;else break t}}function r(C){return C.length===0?null:C[0]}function c(C){if(C.length===0)return null;var q=C[0],Q=C.pop();if(Q!==q){C[0]=Q;t:for(var mt=0,g=C.length,N=g>>>1;mt<N;){var L=2*(mt+1)-1,j=C[L],I=L+1,st=C[I];if(0>f(j,Q))I<g&&0>f(st,j)?(C[mt]=st,C[I]=Q,mt=I):(C[mt]=j,C[L]=Q,mt=L);else if(I<g&&0>f(st,Q))C[mt]=st,C[I]=Q,mt=I;else break t}}return q}function f(C,q){var Q=C.sortIndex-q.sortIndex;return Q!==0?Q:C.id-q.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;l.unstable_now=function(){return h.now()}}else{var v=Date,S=v.now();l.unstable_now=function(){return v.now()-S}}var T=[],y=[],M=1,O=null,D=3,B=!1,k=!1,nt=!1,$=!1,Jt=typeof setTimeout=="function"?setTimeout:null,zt=typeof clearTimeout=="function"?clearTimeout:null,lt=typeof setImmediate<"u"?setImmediate:null;function Mt(C){for(var q=r(y);q!==null;){if(q.callback===null)c(y);else if(q.startTime<=C)c(y),q.sortIndex=q.expirationTime,s(T,q);else break;q=r(y)}}function P(C){if(nt=!1,Mt(C),!k)if(r(T)!==null)k=!0,At||(At=!0,wt());else{var q=r(y);q!==null&&Vt(P,q.startTime-C)}}var At=!1,qt=-1,It=5,Dt=-1;function rt(){return $?!0:!(l.unstable_now()-Dt<It)}function ae(){if($=!1,At){var C=l.unstable_now();Dt=C;var q=!0;try{t:{k=!1,nt&&(nt=!1,zt(qt),qt=-1),B=!0;var Q=D;try{e:{for(Mt(C),O=r(T);O!==null&&!(O.expirationTime>C&&rt());){var mt=O.callback;if(typeof mt=="function"){O.callback=null,D=O.priorityLevel;var g=mt(O.expirationTime<=C);if(C=l.unstable_now(),typeof g=="function"){O.callback=g,Mt(C),q=!0;break e}O===r(T)&&c(T),Mt(C)}else c(T);O=r(T)}if(O!==null)q=!0;else{var N=r(y);N!==null&&Vt(P,N.startTime-C),q=!1}}break t}finally{O=null,D=Q,B=!1}q=void 0}}finally{q?wt():At=!1}}}var wt;if(typeof lt=="function")wt=function(){lt(ae)};else if(typeof MessageChannel<"u"){var Te=new MessageChannel,Aa=Te.port2;Te.port1.onmessage=ae,wt=function(){Aa.postMessage(null)}}else wt=function(){Jt(ae,0)};function Vt(C,q){qt=Jt(function(){C(l.unstable_now())},q)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(C){C.callback=null},l.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):It=0<C?Math.floor(1e3/C):5},l.unstable_getCurrentPriorityLevel=function(){return D},l.unstable_next=function(C){switch(D){case 1:case 2:case 3:var q=3;break;default:q=D}var Q=D;D=q;try{return C()}finally{D=Q}},l.unstable_requestPaint=function(){$=!0},l.unstable_runWithPriority=function(C,q){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var Q=D;D=C;try{return q()}finally{D=Q}},l.unstable_scheduleCallback=function(C,q,Q){var mt=l.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?mt+Q:mt):Q=mt,C){case 1:var g=-1;break;case 2:g=250;break;case 5:g=1073741823;break;case 4:g=1e4;break;default:g=5e3}return g=Q+g,C={id:M++,callback:q,priorityLevel:C,startTime:Q,expirationTime:g,sortIndex:-1},Q>mt?(C.sortIndex=Q,s(y,C),r(T)===null&&C===r(y)&&(nt?(zt(qt),qt=-1):nt=!0,Vt(P,Q-mt))):(C.sortIndex=g,s(T,C),k||B||(k=!0,At||(At=!0,wt()))),C},l.unstable_shouldYield=rt,l.unstable_wrapCallback=function(C){var q=D;return function(){var Q=D;D=q;try{return C.apply(this,arguments)}finally{D=Q}}}})(qr)),qr}var sh;function nv(){return sh||(sh=1,jr.exports=av()),jr.exports}var Lr={exports:{}},Zt={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ih;function lv(){if(ih)return Zt;ih=1;var l=Pr();function s(T){var y="https://react.dev/errors/"+T;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var M=2;M<arguments.length;M++)y+="&args[]="+encodeURIComponent(arguments[M])}return"Minified React error #"+T+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var c={d:{f:r,r:function(){throw Error(s(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},f=Symbol.for("react.portal");function h(T,y,M){var O=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:O==null?null:""+O,children:T,containerInfo:y,implementation:M}}var v=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function S(T,y){if(T==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return Zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,Zt.createPortal=function(T,y){var M=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(s(299));return h(T,y,null,M)},Zt.flushSync=function(T){var y=v.T,M=c.p;try{if(v.T=null,c.p=2,T)return T()}finally{v.T=y,c.p=M,c.d.f()}},Zt.preconnect=function(T,y){typeof T=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,c.d.C(T,y))},Zt.prefetchDNS=function(T){typeof T=="string"&&c.d.D(T)},Zt.preinit=function(T,y){if(typeof T=="string"&&y&&typeof y.as=="string"){var M=y.as,O=S(M,y.crossOrigin),D=typeof y.integrity=="string"?y.integrity:void 0,B=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;M==="style"?c.d.S(T,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:O,integrity:D,fetchPriority:B}):M==="script"&&c.d.X(T,{crossOrigin:O,integrity:D,fetchPriority:B,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},Zt.preinitModule=function(T,y){if(typeof T=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var M=S(y.as,y.crossOrigin);c.d.M(T,{crossOrigin:M,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&c.d.M(T)},Zt.preload=function(T,y){if(typeof T=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var M=y.as,O=S(M,y.crossOrigin);c.d.L(T,M,{crossOrigin:O,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},Zt.preloadModule=function(T,y){if(typeof T=="string")if(y){var M=S(y.as,y.crossOrigin);c.d.m(T,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:M,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else c.d.m(T)},Zt.requestFormReset=function(T){c.d.r(T)},Zt.unstable_batchedUpdates=function(T,y){return T(y)},Zt.useFormState=function(T,y,M){return v.H.useFormState(T,y,M)},Zt.useFormStatus=function(){return v.H.useHostTransitionStatus()},Zt.version="19.1.1",Zt}var uh;function Lh(){if(uh)return Lr.exports;uh=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),Lr.exports=lv(),Lr.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var rh;function sv(){if(rh)return Ul;rh=1;var l=nv(),s=Pr(),r=Lh();function c(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)e+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function h(t){var e=t,a=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(a=e.return),t=e.return;while(t)}return e.tag===3?a:null}function v(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function S(t){if(h(t)!==t)throw Error(c(188))}function T(t){var e=t.alternate;if(!e){if(e=h(t),e===null)throw Error(c(188));return e!==t?null:t}for(var a=t,n=e;;){var i=a.return;if(i===null)break;var u=i.alternate;if(u===null){if(n=i.return,n!==null){a=n;continue}break}if(i.child===u.child){for(u=i.child;u;){if(u===a)return S(i),t;if(u===n)return S(i),e;u=u.sibling}throw Error(c(188))}if(a.return!==n.return)a=i,n=u;else{for(var o=!1,d=i.child;d;){if(d===a){o=!0,a=i,n=u;break}if(d===n){o=!0,n=i,a=u;break}d=d.sibling}if(!o){for(d=u.child;d;){if(d===a){o=!0,a=u,n=i;break}if(d===n){o=!0,n=u,a=i;break}d=d.sibling}if(!o)throw Error(c(189))}}if(a.alternate!==n)throw Error(c(190))}if(a.tag!==3)throw Error(c(188));return a.stateNode.current===a?t:e}function y(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=y(t),e!==null)return e;t=t.sibling}return null}var M=Object.assign,O=Symbol.for("react.element"),D=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),nt=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),Jt=Symbol.for("react.provider"),zt=Symbol.for("react.consumer"),lt=Symbol.for("react.context"),Mt=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),At=Symbol.for("react.suspense_list"),qt=Symbol.for("react.memo"),It=Symbol.for("react.lazy"),Dt=Symbol.for("react.activity"),rt=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function wt(t){return t===null||typeof t!="object"?null:(t=ae&&t[ae]||t["@@iterator"],typeof t=="function"?t:null)}var Te=Symbol.for("react.client.reference");function Aa(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Te?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case k:return"Fragment";case $:return"Profiler";case nt:return"StrictMode";case P:return"Suspense";case At:return"SuspenseList";case Dt:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case B:return"Portal";case lt:return(t.displayName||"Context")+".Provider";case zt:return(t._context.displayName||"Context")+".Consumer";case Mt:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case qt:return e=t.displayName||null,e!==null?e:Aa(t.type)||"Memo";case It:e=t._payload,t=t._init;try{return Aa(t(e))}catch{}}return null}var Vt=Array.isArray,C=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},mt=[],g=-1;function N(t){return{current:t}}function L(t){0>g||(t.current=mt[g],mt[g]=null,g--)}function j(t,e){g++,mt[g]=t.current,t.current=e}var I=N(null),st=N(null),K=N(null),ne=N(null);function vt(t,e){switch(j(K,e),j(st,t),j(I,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?wd(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=wd(e),t=Cd(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}L(I),j(I,t)}function We(){L(I),L(st),L(K)}function bi(t){t.memoizedState!==null&&j(ne,t);var e=I.current,a=Cd(e,t.type);e!==a&&(j(st,t),j(I,a))}function jl(t){st.current===t&&(L(I),L(st)),ne.current===t&&(L(ne),Ml._currentValue=Q)}var Si=Object.prototype.hasOwnProperty,_i=l.unstable_scheduleCallback,Ti=l.unstable_cancelCallback,zm=l.unstable_shouldYield,Dm=l.unstable_requestPaint,we=l.unstable_now,Um=l.unstable_getCurrentPriorityLevel,ic=l.unstable_ImmediatePriority,uc=l.unstable_UserBlockingPriority,ql=l.unstable_NormalPriority,Nm=l.unstable_LowPriority,rc=l.unstable_IdlePriority,Bm=l.log,Hm=l.unstable_setDisableYieldValue,Bn=null,le=null;function Pe(t){if(typeof Bm=="function"&&Hm(t),le&&typeof le.setStrictMode=="function")try{le.setStrictMode(Bn,t)}catch{}}var se=Math.clz32?Math.clz32:Lm,jm=Math.log,qm=Math.LN2;function Lm(t){return t>>>=0,t===0?32:31-(jm(t)/qm|0)|0}var Ll=256,Yl=4194304;function Ra(t){var e=t&42;if(e!==0)return e;switch(t&-t){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:case 262144:case 524288:case 1048576:case 2097152:return t&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Gl(t,e,a){var n=t.pendingLanes;if(n===0)return 0;var i=0,u=t.suspendedLanes,o=t.pingedLanes;t=t.warmLanes;var d=n&134217727;return d!==0?(n=d&~u,n!==0?i=Ra(n):(o&=d,o!==0?i=Ra(o):a||(a=d&~t,a!==0&&(i=Ra(a))))):(d=n&~u,d!==0?i=Ra(d):o!==0?i=Ra(o):a||(a=n&~t,a!==0&&(i=Ra(a)))),i===0?0:e!==0&&e!==i&&(e&u)===0&&(u=i&-i,a=e&-e,u>=a||u===32&&(a&4194048)!==0)?e:i}function Hn(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function Ym(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+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 e+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 cc(){var t=Ll;return Ll<<=1,(Ll&4194048)===0&&(Ll=256),t}function oc(){var t=Yl;return Yl<<=1,(Yl&62914560)===0&&(Yl=4194304),t}function Ei(t){for(var e=[],a=0;31>a;a++)e.push(t);return e}function jn(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Gm(t,e,a,n,i,u){var o=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var d=t.entanglements,m=t.expirationTimes,E=t.hiddenUpdates;for(a=o&~a;0<a;){var w=31-se(a),U=1<<w;d[w]=0,m[w]=-1;var A=E[w];if(A!==null)for(E[w]=null,w=0;w<A.length;w++){var R=A[w];R!==null&&(R.lane&=-536870913)}a&=~U}n!==0&&fc(t,n,0),u!==0&&i===0&&t.tag!==0&&(t.suspendedLanes|=u&~(o&~e))}function fc(t,e,a){t.pendingLanes|=e,t.suspendedLanes&=~e;var n=31-se(e);t.entangledLanes|=e,t.entanglements[n]=t.entanglements[n]|1073741824|a&4194090}function dc(t,e){var a=t.entangledLanes|=e;for(t=t.entanglements;a;){var n=31-se(a),i=1<<n;i&e|t[n]&e&&(t[n]|=e),a&=~i}}function Ai(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Ri(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function hc(){var t=q.p;return t!==0?t:(t=window.event,t===void 0?32:kd(t.type))}function Im(t,e){var a=q.p;try{return q.p=t,e()}finally{q.p=a}}var ta=Math.random().toString(36).slice(2),Xt="__reactFiber$"+ta,$t="__reactProps$"+ta,Xa="__reactContainer$"+ta,xi="__reactEvents$"+ta,Vm="__reactListeners$"+ta,Xm="__reactHandles$"+ta,mc="__reactResources$"+ta,qn="__reactMarker$"+ta;function Mi(t){delete t[Xt],delete t[$t],delete t[xi],delete t[Vm],delete t[Xm]}function Qa(t){var e=t[Xt];if(e)return e;for(var a=t.parentNode;a;){if(e=a[Xa]||a[Xt]){if(a=e.alternate,e.child!==null||a!==null&&a.child!==null)for(t=Ud(t);t!==null;){if(a=t[Xt])return a;t=Ud(t)}return e}t=a,a=t.parentNode}return null}function Za(t){if(t=t[Xt]||t[Xa]){var e=t.tag;if(e===5||e===6||e===13||e===26||e===27||e===3)return t}return null}function Ln(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(c(33))}function Ka(t){var e=t[mc];return e||(e=t[mc]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function Ut(t){t[qn]=!0}var gc=new Set,pc={};function xa(t,e){ka(t,e),ka(t+"Capture",e)}function ka(t,e){for(pc[t]=e,t=0;t<e.length;t++)gc.add(e[t])}var Qm=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]*$"),vc={},yc={};function Zm(t){return Si.call(yc,t)?!0:Si.call(vc,t)?!1:Qm.test(t)?yc[t]=!0:(vc[t]=!0,!1)}function Il(t,e,a){if(Zm(e))if(a===null)t.removeAttribute(e);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var n=e.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+a)}}function Vl(t,e,a){if(a===null)t.removeAttribute(e);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+a)}}function Be(t,e,a,n){if(n===null)t.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(e,a,""+n)}}var wi,bc;function Ja(t){if(wi===void 0)try{throw Error()}catch(a){var e=a.stack.trim().match(/\n( *(at )?)/);wi=e&&e[1]||"",bc=-1<a.stack.indexOf(`
    at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
`+wi+t+bc}var Ci=!1;function Oi(t,e){if(!t||Ci)return"";Ci=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(e){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(U,[])}catch(R){var A=R}Reflect.construct(t,[],U)}else{try{U.call()}catch(R){A=R}t.call(U.prototype)}}else{try{throw Error()}catch(R){A=R}(U=t())&&typeof U.catch=="function"&&U.catch(function(){})}}catch(R){if(R&&A&&typeof R.stack=="string")return[R.stack,A.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=n.DetermineComponentFrameRoot(),o=u[0],d=u[1];if(o&&d){var m=o.split(`
`),E=d.split(`
`);for(i=n=0;n<m.length&&!m[n].includes("DetermineComponentFrameRoot");)n++;for(;i<E.length&&!E[i].includes("DetermineComponentFrameRoot");)i++;if(n===m.length||i===E.length)for(n=m.length-1,i=E.length-1;1<=n&&0<=i&&m[n]!==E[i];)i--;for(;1<=n&&0<=i;n--,i--)if(m[n]!==E[i]){if(n!==1||i!==1)do if(n--,i--,0>i||m[n]!==E[i]){var w=`
`+m[n].replace(" at new "," at ");return t.displayName&&w.includes("<anonymous>")&&(w=w.replace("<anonymous>",t.displayName)),w}while(1<=n&&0<=i);break}}}finally{Ci=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?Ja(a):""}function Km(t){switch(t.tag){case 26:case 27:case 5:return Ja(t.type);case 16:return Ja("Lazy");case 13:return Ja("Suspense");case 19:return Ja("SuspenseList");case 0:case 15:return Oi(t.type,!1);case 11:return Oi(t.type.render,!1);case 1:return Oi(t.type,!0);case 31:return Ja("Activity");default:return""}}function Sc(t){try{var e="";do e+=Km(t),t=t.return;while(t);return e}catch(a){return`
Error generating stack: `+a.message+`
`+a.stack}}function he(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function _c(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function km(t){var e=_c(t)?"checked":"value",a=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var i=a.get,u=a.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,u.call(this,o)}}),Object.defineProperty(t,e,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Xl(t){t._valueTracker||(t._valueTracker=km(t))}function Tc(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var a=e.getValue(),n="";return t&&(n=_c(t)?t.checked?"true":"false":t.value),t=n,t!==a?(e.setValue(t),!0):!1}function Ql(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Jm=/[\n"\\]/g;function me(t){return t.replace(Jm,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function zi(t,e,a,n,i,u,o,d){t.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.type=o:t.removeAttribute("type"),e!=null?o==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+he(e)):t.value!==""+he(e)&&(t.value=""+he(e)):o!=="submit"&&o!=="reset"||t.removeAttribute("value"),e!=null?Di(t,o,he(e)):a!=null?Di(t,o,he(a)):n!=null&&t.removeAttribute("value"),i==null&&u!=null&&(t.defaultChecked=!!u),i!=null&&(t.checked=i&&typeof i!="function"&&typeof i!="symbol"),d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?t.name=""+he(d):t.removeAttribute("name")}function Ec(t,e,a,n,i,u,o,d){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(t.type=u),e!=null||a!=null){if(!(u!=="submit"&&u!=="reset"||e!=null))return;a=a!=null?""+he(a):"",e=e!=null?""+he(e):a,d||e===t.value||(t.value=e),t.defaultValue=e}n=n??i,n=typeof n!="function"&&typeof n!="symbol"&&!!n,t.checked=d?t.checked:!!n,t.defaultChecked=!!n,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.name=o)}function Di(t,e,a){e==="number"&&Ql(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function $a(t,e,a,n){if(t=t.options,e){e={};for(var i=0;i<a.length;i++)e["$"+a[i]]=!0;for(a=0;a<t.length;a++)i=e.hasOwnProperty("$"+t[a].value),t[a].selected!==i&&(t[a].selected=i),i&&n&&(t[a].defaultSelected=!0)}else{for(a=""+he(a),e=null,i=0;i<t.length;i++){if(t[i].value===a){t[i].selected=!0,n&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function Ac(t,e,a){if(e!=null&&(e=""+he(e),e!==t.value&&(t.value=e),a==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=a!=null?""+he(a):""}function Rc(t,e,a,n){if(e==null){if(n!=null){if(a!=null)throw Error(c(92));if(Vt(n)){if(1<n.length)throw Error(c(93));n=n[0]}a=n}a==null&&(a=""),e=a}a=he(e),t.defaultValue=a,n=t.textContent,n===a&&n!==""&&n!==null&&(t.value=n)}function Fa(t,e){if(e){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=e;return}}t.textContent=e}var $m=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 xc(t,e,a){var n=e.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":n?t.setProperty(e,a):typeof a!="number"||a===0||$m.has(e)?e==="float"?t.cssFloat=a:t[e]=(""+a).trim():t[e]=a+"px"}function Mc(t,e,a){if(e!=null&&typeof e!="object")throw Error(c(62));if(t=t.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||e!=null&&e.hasOwnProperty(n)||(n.indexOf("--")===0?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="");for(var i in e)n=e[i],e.hasOwnProperty(i)&&a[i]!==n&&xc(t,i,n)}else for(var u in e)e.hasOwnProperty(u)&&xc(t,u,e[u])}function Ui(t){if(t.indexOf("-")===-1)return!1;switch(t){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 Fm=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"]]),Wm=/^[\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 Zl(t){return Wm.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var Ni=null;function Bi(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Wa=null,Pa=null;function wc(t){var e=Za(t);if(e&&(t=e.stateNode)){var a=t[$t]||null;t:switch(t=e.stateNode,e.type){case"input":if(zi(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),e=a.name,a.type==="radio"&&e!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+me(""+e)+'"][type="radio"]'),e=0;e<a.length;e++){var n=a[e];if(n!==t&&n.form===t.form){var i=n[$t]||null;if(!i)throw Error(c(90));zi(n,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(e=0;e<a.length;e++)n=a[e],n.form===t.form&&Tc(n)}break t;case"textarea":Ac(t,a.value,a.defaultValue);break t;case"select":e=a.value,e!=null&&$a(t,!!a.multiple,e,!1)}}}var Hi=!1;function Cc(t,e,a){if(Hi)return t(e,a);Hi=!0;try{var n=t(e);return n}finally{if(Hi=!1,(Wa!==null||Pa!==null)&&(zs(),Wa&&(e=Wa,t=Pa,Pa=Wa=null,wc(e),t)))for(e=0;e<t.length;e++)wc(t[e])}}function Yn(t,e){var a=t.stateNode;if(a===null)return null;var n=a[$t]||null;if(n===null)return null;a=n[e];t:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(t=t.type,n=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!n;break t;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(c(231,e,typeof a));return a}var He=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ji=!1;if(He)try{var Gn={};Object.defineProperty(Gn,"passive",{get:function(){ji=!0}}),window.addEventListener("test",Gn,Gn),window.removeEventListener("test",Gn,Gn)}catch{ji=!1}var ea=null,qi=null,Kl=null;function Oc(){if(Kl)return Kl;var t,e=qi,a=e.length,n,i="value"in ea?ea.value:ea.textContent,u=i.length;for(t=0;t<a&&e[t]===i[t];t++);var o=a-t;for(n=1;n<=o&&e[a-n]===i[u-n];n++);return Kl=i.slice(t,1<n?1-n:void 0)}function kl(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Jl(){return!0}function zc(){return!1}function Ft(t){function e(a,n,i,u,o){this._reactName=a,this._targetInst=i,this.type=n,this.nativeEvent=u,this.target=o,this.currentTarget=null;for(var d in t)t.hasOwnProperty(d)&&(a=t[d],this[d]=a?a(u):u[d]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?Jl:zc,this.isPropagationStopped=zc,this}return M(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Jl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Jl)},persist:function(){},isPersistent:Jl}),e}var Ma={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$l=Ft(Ma),In=M({},Ma,{view:0,detail:0}),Pm=Ft(In),Li,Yi,Vn,Fl=M({},In,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ii,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Vn&&(Vn&&t.type==="mousemove"?(Li=t.screenX-Vn.screenX,Yi=t.screenY-Vn.screenY):Yi=Li=0,Vn=t),Li)},movementY:function(t){return"movementY"in t?t.movementY:Yi}}),Dc=Ft(Fl),tg=M({},Fl,{dataTransfer:0}),eg=Ft(tg),ag=M({},In,{relatedTarget:0}),Gi=Ft(ag),ng=M({},Ma,{animationName:0,elapsedTime:0,pseudoElement:0}),lg=Ft(ng),sg=M({},Ma,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),ig=Ft(sg),ug=M({},Ma,{data:0}),Uc=Ft(ug),rg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cg={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"},og={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fg(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=og[t])?!!e[t]:!1}function Ii(){return fg}var dg=M({},In,{key:function(t){if(t.key){var e=rg[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=kl(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?cg[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ii,charCode:function(t){return t.type==="keypress"?kl(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?kl(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),hg=Ft(dg),mg=M({},Fl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nc=Ft(mg),gg=M({},In,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ii}),pg=Ft(gg),vg=M({},Ma,{propertyName:0,elapsedTime:0,pseudoElement:0}),yg=Ft(vg),bg=M({},Fl,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Sg=Ft(bg),_g=M({},Ma,{newState:0,oldState:0}),Tg=Ft(_g),Eg=[9,13,27,32],Vi=He&&"CompositionEvent"in window,Xn=null;He&&"documentMode"in document&&(Xn=document.documentMode);var Ag=He&&"TextEvent"in window&&!Xn,Bc=He&&(!Vi||Xn&&8<Xn&&11>=Xn),Hc=" ",jc=!1;function qc(t,e){switch(t){case"keyup":return Eg.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lc(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var tn=!1;function Rg(t,e){switch(t){case"compositionend":return Lc(e);case"keypress":return e.which!==32?null:(jc=!0,Hc);case"textInput":return t=e.data,t===Hc&&jc?null:t;default:return null}}function xg(t,e){if(tn)return t==="compositionend"||!Vi&&qc(t,e)?(t=Oc(),Kl=qi=ea=null,tn=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Bc&&e.locale!=="ko"?null:e.data;default:return null}}var Mg={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 Yc(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!Mg[t.type]:e==="textarea"}function Gc(t,e,a,n){Wa?Pa?Pa.push(n):Pa=[n]:Wa=n,e=js(e,"onChange"),0<e.length&&(a=new $l("onChange","change",null,a,n),t.push({event:a,listeners:e}))}var Qn=null,Zn=null;function wg(t){Ed(t,0)}function Wl(t){var e=Ln(t);if(Tc(e))return t}function Ic(t,e){if(t==="change")return e}var Vc=!1;if(He){var Xi;if(He){var Qi="oninput"in document;if(!Qi){var Xc=document.createElement("div");Xc.setAttribute("oninput","return;"),Qi=typeof Xc.oninput=="function"}Xi=Qi}else Xi=!1;Vc=Xi&&(!document.documentMode||9<document.documentMode)}function Qc(){Qn&&(Qn.detachEvent("onpropertychange",Zc),Zn=Qn=null)}function Zc(t){if(t.propertyName==="value"&&Wl(Zn)){var e=[];Gc(e,Zn,t,Bi(t)),Cc(wg,e)}}function Cg(t,e,a){t==="focusin"?(Qc(),Qn=e,Zn=a,Qn.attachEvent("onpropertychange",Zc)):t==="focusout"&&Qc()}function Og(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Wl(Zn)}function zg(t,e){if(t==="click")return Wl(e)}function Dg(t,e){if(t==="input"||t==="change")return Wl(e)}function Ug(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ie=typeof Object.is=="function"?Object.is:Ug;function Kn(t,e){if(ie(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var a=Object.keys(t),n=Object.keys(e);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var i=a[n];if(!Si.call(e,i)||!ie(t[i],e[i]))return!1}return!0}function Kc(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function kc(t,e){var a=Kc(t);t=0;for(var n;a;){if(a.nodeType===3){if(n=t+a.textContent.length,t<=e&&n>=e)return{node:a,offset:e-t};t=n}t:{for(;a;){if(a.nextSibling){a=a.nextSibling;break t}a=a.parentNode}a=void 0}a=Kc(a)}}function Jc(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Jc(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function $c(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Ql(t.document);e instanceof t.HTMLIFrameElement;){try{var a=typeof e.contentWindow.location.href=="string"}catch{a=!1}if(a)t=e.contentWindow;else break;e=Ql(t.document)}return e}function Zi(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var Ng=He&&"documentMode"in document&&11>=document.documentMode,en=null,Ki=null,kn=null,ki=!1;function Fc(t,e,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ki||en==null||en!==Ql(n)||(n=en,"selectionStart"in n&&Zi(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),kn&&Kn(kn,n)||(kn=n,n=js(Ki,"onSelect"),0<n.length&&(e=new $l("onSelect","select",null,e,a),t.push({event:e,listeners:n}),e.target=en)))}function wa(t,e){var a={};return a[t.toLowerCase()]=e.toLowerCase(),a["Webkit"+t]="webkit"+e,a["Moz"+t]="moz"+e,a}var an={animationend:wa("Animation","AnimationEnd"),animationiteration:wa("Animation","AnimationIteration"),animationstart:wa("Animation","AnimationStart"),transitionrun:wa("Transition","TransitionRun"),transitionstart:wa("Transition","TransitionStart"),transitioncancel:wa("Transition","TransitionCancel"),transitionend:wa("Transition","TransitionEnd")},Ji={},Wc={};He&&(Wc=document.createElement("div").style,"AnimationEvent"in window||(delete an.animationend.animation,delete an.animationiteration.animation,delete an.animationstart.animation),"TransitionEvent"in window||delete an.transitionend.transition);function Ca(t){if(Ji[t])return Ji[t];if(!an[t])return t;var e=an[t],a;for(a in e)if(e.hasOwnProperty(a)&&a in Wc)return Ji[t]=e[a];return t}var Pc=Ca("animationend"),to=Ca("animationiteration"),eo=Ca("animationstart"),Bg=Ca("transitionrun"),Hg=Ca("transitionstart"),jg=Ca("transitioncancel"),ao=Ca("transitionend"),no=new Map,$i="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(" ");$i.push("scrollEnd");function Ee(t,e){no.set(t,e),xa(e,[t])}var lo=new WeakMap;function ge(t,e){if(typeof t=="object"&&t!==null){var a=lo.get(t);return a!==void 0?a:(e={value:t,source:e,stack:Sc(e)},lo.set(t,e),e)}return{value:t,source:e,stack:Sc(e)}}var pe=[],nn=0,Fi=0;function Pl(){for(var t=nn,e=Fi=nn=0;e<t;){var a=pe[e];pe[e++]=null;var n=pe[e];pe[e++]=null;var i=pe[e];pe[e++]=null;var u=pe[e];if(pe[e++]=null,n!==null&&i!==null){var o=n.pending;o===null?i.next=i:(i.next=o.next,o.next=i),n.pending=i}u!==0&&so(a,i,u)}}function ts(t,e,a,n){pe[nn++]=t,pe[nn++]=e,pe[nn++]=a,pe[nn++]=n,Fi|=n,t.lanes|=n,t=t.alternate,t!==null&&(t.lanes|=n)}function Wi(t,e,a,n){return ts(t,e,a,n),es(t)}function ln(t,e){return ts(t,null,null,e),es(t)}function so(t,e,a){t.lanes|=a;var n=t.alternate;n!==null&&(n.lanes|=a);for(var i=!1,u=t.return;u!==null;)u.childLanes|=a,n=u.alternate,n!==null&&(n.childLanes|=a),u.tag===22&&(t=u.stateNode,t===null||t._visibility&1||(i=!0)),t=u,u=u.return;return t.tag===3?(u=t.stateNode,i&&e!==null&&(i=31-se(a),t=u.hiddenUpdates,n=t[i],n===null?t[i]=[e]:n.push(e),e.lane=a|536870912),u):null}function es(t){if(50<bl)throw bl=0,lr=null,Error(c(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var sn={};function qg(t,e,a,n){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ue(t,e,a,n){return new qg(t,e,a,n)}function Pi(t){return t=t.prototype,!(!t||!t.isReactComponent)}function je(t,e){var a=t.alternate;return a===null?(a=ue(t.tag,e,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=e,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,e=t.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function io(t,e){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,e=a.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function as(t,e,a,n,i,u){var o=0;if(n=t,typeof t=="function")Pi(t)&&(o=1);else if(typeof t=="string")o=Yp(t,a,I.current)?26:t==="html"||t==="head"||t==="body"?27:5;else t:switch(t){case Dt:return t=ue(31,a,e,i),t.elementType=Dt,t.lanes=u,t;case k:return Oa(a.children,i,u,e);case nt:o=8,i|=24;break;case $:return t=ue(12,a,e,i|2),t.elementType=$,t.lanes=u,t;case P:return t=ue(13,a,e,i),t.elementType=P,t.lanes=u,t;case At:return t=ue(19,a,e,i),t.elementType=At,t.lanes=u,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Jt:case lt:o=10;break t;case zt:o=9;break t;case Mt:o=11;break t;case qt:o=14;break t;case It:o=16,n=null;break t}o=29,a=Error(c(130,t===null?"null":typeof t,"")),n=null}return e=ue(o,a,e,i),e.elementType=t,e.type=n,e.lanes=u,e}function Oa(t,e,a,n){return t=ue(7,t,n,e),t.lanes=a,t}function tu(t,e,a){return t=ue(6,t,null,e),t.lanes=a,t}function eu(t,e,a){return e=ue(4,t.children!==null?t.children:[],t.key,e),e.lanes=a,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var un=[],rn=0,ns=null,ls=0,ve=[],ye=0,za=null,qe=1,Le="";function Da(t,e){un[rn++]=ls,un[rn++]=ns,ns=t,ls=e}function uo(t,e,a){ve[ye++]=qe,ve[ye++]=Le,ve[ye++]=za,za=t;var n=qe;t=Le;var i=32-se(n)-1;n&=~(1<<i),a+=1;var u=32-se(e)+i;if(30<u){var o=i-i%5;u=(n&(1<<o)-1).toString(32),n>>=o,i-=o,qe=1<<32-se(e)+i|a<<i|n,Le=u+t}else qe=1<<u|a<<i|n,Le=t}function au(t){t.return!==null&&(Da(t,1),uo(t,1,0))}function nu(t){for(;t===ns;)ns=un[--rn],un[rn]=null,ls=un[--rn],un[rn]=null;for(;t===za;)za=ve[--ye],ve[ye]=null,Le=ve[--ye],ve[ye]=null,qe=ve[--ye],ve[ye]=null}var Kt=null,St=null,ut=!1,Ua=null,Ce=!1,lu=Error(c(519));function Na(t){var e=Error(c(418,""));throw Fn(ge(e,t)),lu}function ro(t){var e=t.stateNode,a=t.type,n=t.memoizedProps;switch(e[Xt]=t,e[$t]=n,a){case"dialog":et("cancel",e),et("close",e);break;case"iframe":case"object":case"embed":et("load",e);break;case"video":case"audio":for(a=0;a<_l.length;a++)et(_l[a],e);break;case"source":et("error",e);break;case"img":case"image":case"link":et("error",e),et("load",e);break;case"details":et("toggle",e);break;case"input":et("invalid",e),Ec(e,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0),Xl(e);break;case"select":et("invalid",e);break;case"textarea":et("invalid",e),Rc(e,n.value,n.defaultValue,n.children),Xl(e)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||e.textContent===""+a||n.suppressHydrationWarning===!0||Md(e.textContent,a)?(n.popover!=null&&(et("beforetoggle",e),et("toggle",e)),n.onScroll!=null&&et("scroll",e),n.onScrollEnd!=null&&et("scrollend",e),n.onClick!=null&&(e.onclick=qs),e=!0):e=!1,e||Na(t)}function co(t){for(Kt=t.return;Kt;)switch(Kt.tag){case 5:case 13:Ce=!1;return;case 27:case 3:Ce=!0;return;default:Kt=Kt.return}}function Jn(t){if(t!==Kt)return!1;if(!ut)return co(t),ut=!0,!1;var e=t.tag,a;if((a=e!==3&&e!==27)&&((a=e===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Sr(t.type,t.memoizedProps)),a=!a),a&&St&&Na(t),co(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(c(317));t:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8)if(a=t.data,a==="/$"){if(e===0){St=Re(t.nextSibling);break t}e--}else a!=="$"&&a!=="$!"&&a!=="$?"||e++;t=t.nextSibling}St=null}}else e===27?(e=St,va(t.type)?(t=Ar,Ar=null,St=t):St=e):St=Kt?Re(t.stateNode.nextSibling):null;return!0}function $n(){St=Kt=null,ut=!1}function oo(){var t=Ua;return t!==null&&(te===null?te=t:te.push.apply(te,t),Ua=null),t}function Fn(t){Ua===null?Ua=[t]:Ua.push(t)}var su=N(null),Ba=null,Ye=null;function aa(t,e,a){j(su,e._currentValue),e._currentValue=a}function Ge(t){t._currentValue=su.current,L(su)}function iu(t,e,a){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===a)break;t=t.return}}function uu(t,e,a,n){var i=t.child;for(i!==null&&(i.return=t);i!==null;){var u=i.dependencies;if(u!==null){var o=i.child;u=u.firstContext;t:for(;u!==null;){var d=u;u=i;for(var m=0;m<e.length;m++)if(d.context===e[m]){u.lanes|=a,d=u.alternate,d!==null&&(d.lanes|=a),iu(u.return,a,t),n||(o=null);break t}u=d.next}}else if(i.tag===18){if(o=i.return,o===null)throw Error(c(341));o.lanes|=a,u=o.alternate,u!==null&&(u.lanes|=a),iu(o,a,t),o=null}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}}function Wn(t,e,a,n){t=null;for(var i=e,u=!1;i!==null;){if(!u){if((i.flags&524288)!==0)u=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var o=i.alternate;if(o===null)throw Error(c(387));if(o=o.memoizedProps,o!==null){var d=i.type;ie(i.pendingProps.value,o.value)||(t!==null?t.push(d):t=[d])}}else if(i===ne.current){if(o=i.alternate,o===null)throw Error(c(387));o.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(t!==null?t.push(Ml):t=[Ml])}i=i.return}t!==null&&uu(e,t,a,n),e.flags|=262144}function ss(t){for(t=t.firstContext;t!==null;){if(!ie(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Ha(t){Ba=t,Ye=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Qt(t){return fo(Ba,t)}function is(t,e){return Ba===null&&Ha(t),fo(t,e)}function fo(t,e){var a=e._currentValue;if(e={context:e,memoizedValue:a,next:null},Ye===null){if(t===null)throw Error(c(308));Ye=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Ye=Ye.next=e;return a}var Lg=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(a,n){t.push(n)}};this.abort=function(){e.aborted=!0,t.forEach(function(a){return a()})}},Yg=l.unstable_scheduleCallback,Gg=l.unstable_NormalPriority,Ct={$$typeof:lt,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ru(){return{controller:new Lg,data:new Map,refCount:0}}function Pn(t){t.refCount--,t.refCount===0&&Yg(Gg,function(){t.controller.abort()})}var tl=null,cu=0,cn=0,on=null;function Ig(t,e){if(tl===null){var a=tl=[];cu=0,cn=fr(),on={status:"pending",value:void 0,then:function(n){a.push(n)}}}return cu++,e.then(ho,ho),e}function ho(){if(--cu===0&&tl!==null){on!==null&&(on.status="fulfilled");var t=tl;tl=null,cn=0,on=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function Vg(t,e){var a=[],n={status:"pending",value:null,reason:null,then:function(i){a.push(i)}};return t.then(function(){n.status="fulfilled",n.value=e;for(var i=0;i<a.length;i++)(0,a[i])(e)},function(i){for(n.status="rejected",n.reason=i,i=0;i<a.length;i++)(0,a[i])(void 0)}),n}var mo=C.S;C.S=function(t,e){typeof e=="object"&&e!==null&&typeof e.then=="function"&&Ig(t,e),mo!==null&&mo(t,e)};var ja=N(null);function ou(){var t=ja.current;return t!==null?t:pt.pooledCache}function us(t,e){e===null?j(ja,ja.current):j(ja,e.pool)}function go(){var t=ou();return t===null?null:{parent:Ct._currentValue,pool:t}}var el=Error(c(460)),po=Error(c(474)),rs=Error(c(542)),fu={then:function(){}};function vo(t){return t=t.status,t==="fulfilled"||t==="rejected"}function cs(){}function yo(t,e,a){switch(a=t[a],a===void 0?t.push(e):a!==e&&(e.then(cs,cs),e=a),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,So(t),t;default:if(typeof e.status=="string")e.then(cs,cs);else{if(t=pt,t!==null&&100<t.shellSuspendCounter)throw Error(c(482));t=e,t.status="pending",t.then(function(n){if(e.status==="pending"){var i=e;i.status="fulfilled",i.value=n}},function(n){if(e.status==="pending"){var i=e;i.status="rejected",i.reason=n}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,So(t),t}throw al=e,el}}var al=null;function bo(){if(al===null)throw Error(c(459));var t=al;return al=null,t}function So(t){if(t===el||t===rs)throw Error(c(483))}var na=!1;function du(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function hu(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function la(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function sa(t,e,a){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,(ct&2)!==0){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,e=es(t),so(t,null,a),e}return ts(t,n,e,a),es(t)}function nl(t,e,a){if(e=e.updateQueue,e!==null&&(e=e.shared,(a&4194048)!==0)){var n=e.lanes;n&=t.pendingLanes,a|=n,e.lanes=a,dc(t,a)}}function mu(t,e){var a=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var i=null,u=null;if(a=a.firstBaseUpdate,a!==null){do{var o={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};u===null?i=u=o:u=u.next=o,a=a.next}while(a!==null);u===null?i=u=e:u=u.next=e}else i=u=e;a={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:u,shared:n.shared,callbacks:n.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=e:t.next=e,a.lastBaseUpdate=e}var gu=!1;function ll(){if(gu){var t=on;if(t!==null)throw t}}function sl(t,e,a,n){gu=!1;var i=t.updateQueue;na=!1;var u=i.firstBaseUpdate,o=i.lastBaseUpdate,d=i.shared.pending;if(d!==null){i.shared.pending=null;var m=d,E=m.next;m.next=null,o===null?u=E:o.next=E,o=m;var w=t.alternate;w!==null&&(w=w.updateQueue,d=w.lastBaseUpdate,d!==o&&(d===null?w.firstBaseUpdate=E:d.next=E,w.lastBaseUpdate=m))}if(u!==null){var U=i.baseState;o=0,w=E=m=null,d=u;do{var A=d.lane&-536870913,R=A!==d.lane;if(R?(at&A)===A:(n&A)===A){A!==0&&A===cn&&(gu=!0),w!==null&&(w=w.next={lane:0,tag:d.tag,payload:d.payload,callback:null,next:null});t:{var Z=t,V=d;A=e;var ht=a;switch(V.tag){case 1:if(Z=V.payload,typeof Z=="function"){U=Z.call(ht,U,A);break t}U=Z;break t;case 3:Z.flags=Z.flags&-65537|128;case 0:if(Z=V.payload,A=typeof Z=="function"?Z.call(ht,U,A):Z,A==null)break t;U=M({},U,A);break t;case 2:na=!0}}A=d.callback,A!==null&&(t.flags|=64,R&&(t.flags|=8192),R=i.callbacks,R===null?i.callbacks=[A]:R.push(A))}else R={lane:A,tag:d.tag,payload:d.payload,callback:d.callback,next:null},w===null?(E=w=R,m=U):w=w.next=R,o|=A;if(d=d.next,d===null){if(d=i.shared.pending,d===null)break;R=d,d=R.next,R.next=null,i.lastBaseUpdate=R,i.shared.pending=null}}while(!0);w===null&&(m=U),i.baseState=m,i.firstBaseUpdate=E,i.lastBaseUpdate=w,u===null&&(i.shared.lanes=0),ha|=o,t.lanes=o,t.memoizedState=U}}function _o(t,e){if(typeof t!="function")throw Error(c(191,t));t.call(e)}function To(t,e){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)_o(a[t],e)}var fn=N(null),os=N(0);function Eo(t,e){t=ke,j(os,t),j(fn,e),ke=t|e.baseLanes}function pu(){j(os,ke),j(fn,fn.current)}function vu(){ke=os.current,L(fn),L(os)}var ia=0,F=null,ft=null,Rt=null,fs=!1,dn=!1,qa=!1,ds=0,il=0,hn=null,Xg=0;function Tt(){throw Error(c(321))}function yu(t,e){if(e===null)return!1;for(var a=0;a<e.length&&a<t.length;a++)if(!ie(t[a],e[a]))return!1;return!0}function bu(t,e,a,n,i,u){return ia=u,F=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,C.H=t===null||t.memoizedState===null?uf:rf,qa=!1,u=a(n,i),qa=!1,dn&&(u=Ro(e,a,n,i)),Ao(t),u}function Ao(t){C.H=ys;var e=ft!==null&&ft.next!==null;if(ia=0,Rt=ft=F=null,fs=!1,il=0,hn=null,e)throw Error(c(300));t===null||Nt||(t=t.dependencies,t!==null&&ss(t)&&(Nt=!0))}function Ro(t,e,a,n){F=t;var i=0;do{if(dn&&(hn=null),il=0,dn=!1,25<=i)throw Error(c(301));if(i+=1,Rt=ft=null,t.updateQueue!=null){var u=t.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}C.H=Fg,u=e(a,n)}while(dn);return u}function Qg(){var t=C.H,e=t.useState()[0];return e=typeof e.then=="function"?ul(e):e,t=t.useState()[0],(ft!==null?ft.memoizedState:null)!==t&&(F.flags|=1024),e}function Su(){var t=ds!==0;return ds=0,t}function _u(t,e,a){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a}function Tu(t){if(fs){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}fs=!1}ia=0,Rt=ft=F=null,dn=!1,il=ds=0,hn=null}function Wt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?F.memoizedState=Rt=t:Rt=Rt.next=t,Rt}function xt(){if(ft===null){var t=F.alternate;t=t!==null?t.memoizedState:null}else t=ft.next;var e=Rt===null?F.memoizedState:Rt.next;if(e!==null)Rt=e,ft=t;else{if(t===null)throw F.alternate===null?Error(c(467)):Error(c(310));ft=t,t={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},Rt===null?F.memoizedState=Rt=t:Rt=Rt.next=t}return Rt}function Eu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ul(t){var e=il;return il+=1,hn===null&&(hn=[]),t=yo(hn,t,e),e=F,(Rt===null?e.memoizedState:Rt.next)===null&&(e=e.alternate,C.H=e===null||e.memoizedState===null?uf:rf),t}function hs(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return ul(t);if(t.$$typeof===lt)return Qt(t)}throw Error(c(438,String(t)))}function Au(t){var e=null,a=F.updateQueue;if(a!==null&&(e=a.memoCache),e==null){var n=F.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(e={data:n.data.map(function(i){return i.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),a===null&&(a=Eu(),F.updateQueue=a),a.memoCache=e,a=e.data[e.index],a===void 0)for(a=e.data[e.index]=Array(t),n=0;n<t;n++)a[n]=rt;return e.index++,a}function Ie(t,e){return typeof e=="function"?e(t):e}function ms(t){var e=xt();return Ru(e,ft,t)}function Ru(t,e,a){var n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=a;var i=t.baseQueue,u=n.pending;if(u!==null){if(i!==null){var o=i.next;i.next=u.next,u.next=o}e.baseQueue=i=u,n.pending=null}if(u=t.baseState,i===null)t.memoizedState=u;else{e=i.next;var d=o=null,m=null,E=e,w=!1;do{var U=E.lane&-536870913;if(U!==E.lane?(at&U)===U:(ia&U)===U){var A=E.revertLane;if(A===0)m!==null&&(m=m.next={lane:0,revertLane:0,action:E.action,hasEagerState:E.hasEagerState,eagerState:E.eagerState,next:null}),U===cn&&(w=!0);else if((ia&A)===A){E=E.next,A===cn&&(w=!0);continue}else U={lane:0,revertLane:E.revertLane,action:E.action,hasEagerState:E.hasEagerState,eagerState:E.eagerState,next:null},m===null?(d=m=U,o=u):m=m.next=U,F.lanes|=A,ha|=A;U=E.action,qa&&a(u,U),u=E.hasEagerState?E.eagerState:a(u,U)}else A={lane:U,revertLane:E.revertLane,action:E.action,hasEagerState:E.hasEagerState,eagerState:E.eagerState,next:null},m===null?(d=m=A,o=u):m=m.next=A,F.lanes|=U,ha|=U;E=E.next}while(E!==null&&E!==e);if(m===null?o=u:m.next=d,!ie(u,t.memoizedState)&&(Nt=!0,w&&(a=on,a!==null)))throw a;t.memoizedState=u,t.baseState=o,t.baseQueue=m,n.lastRenderedState=u}return i===null&&(n.lanes=0),[t.memoizedState,n.dispatch]}function xu(t){var e=xt(),a=e.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=t;var n=a.dispatch,i=a.pending,u=e.memoizedState;if(i!==null){a.pending=null;var o=i=i.next;do u=t(u,o.action),o=o.next;while(o!==i);ie(u,e.memoizedState)||(Nt=!0),e.memoizedState=u,e.baseQueue===null&&(e.baseState=u),a.lastRenderedState=u}return[u,n]}function xo(t,e,a){var n=F,i=xt(),u=ut;if(u){if(a===void 0)throw Error(c(407));a=a()}else a=e();var o=!ie((ft||i).memoizedState,a);o&&(i.memoizedState=a,Nt=!0),i=i.queue;var d=Co.bind(null,n,i,t);if(rl(2048,8,d,[t]),i.getSnapshot!==e||o||Rt!==null&&Rt.memoizedState.tag&1){if(n.flags|=2048,mn(9,gs(),wo.bind(null,n,i,a,e),null),pt===null)throw Error(c(349));u||(ia&124)!==0||Mo(n,e,a)}return a}function Mo(t,e,a){t.flags|=16384,t={getSnapshot:e,value:a},e=F.updateQueue,e===null?(e=Eu(),F.updateQueue=e,e.stores=[t]):(a=e.stores,a===null?e.stores=[t]:a.push(t))}function wo(t,e,a,n){e.value=a,e.getSnapshot=n,Oo(e)&&zo(t)}function Co(t,e,a){return a(function(){Oo(e)&&zo(t)})}function Oo(t){var e=t.getSnapshot;t=t.value;try{var a=e();return!ie(t,a)}catch{return!0}}function zo(t){var e=ln(t,2);e!==null&&de(e,t,2)}function Mu(t){var e=Wt();if(typeof t=="function"){var a=t;if(t=a(),qa){Pe(!0);try{a()}finally{Pe(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ie,lastRenderedState:t},e}function Do(t,e,a,n){return t.baseState=a,Ru(t,ft,typeof n=="function"?n:Ie)}function Zg(t,e,a,n,i){if(vs(t))throw Error(c(485));if(t=e.action,t!==null){var u={payload:i,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){u.listeners.push(o)}};C.T!==null?a(!0):u.isTransition=!1,n(u),a=e.pending,a===null?(u.next=e.pending=u,Uo(e,u)):(u.next=a.next,e.pending=a.next=u)}}function Uo(t,e){var a=e.action,n=e.payload,i=t.state;if(e.isTransition){var u=C.T,o={};C.T=o;try{var d=a(i,n),m=C.S;m!==null&&m(o,d),No(t,e,d)}catch(E){wu(t,e,E)}finally{C.T=u}}else try{u=a(i,n),No(t,e,u)}catch(E){wu(t,e,E)}}function No(t,e,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){Bo(t,e,n)},function(n){return wu(t,e,n)}):Bo(t,e,a)}function Bo(t,e,a){e.status="fulfilled",e.value=a,Ho(e),t.state=a,e=t.pending,e!==null&&(a=e.next,a===e?t.pending=null:(a=a.next,e.next=a,Uo(t,a)))}function wu(t,e,a){var n=t.pending;if(t.pending=null,n!==null){n=n.next;do e.status="rejected",e.reason=a,Ho(e),e=e.next;while(e!==n)}t.action=null}function Ho(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function jo(t,e){return e}function qo(t,e){if(ut){var a=pt.formState;if(a!==null){t:{var n=F;if(ut){if(St){e:{for(var i=St,u=Ce;i.nodeType!==8;){if(!u){i=null;break e}if(i=Re(i.nextSibling),i===null){i=null;break e}}u=i.data,i=u==="F!"||u==="F"?i:null}if(i){St=Re(i.nextSibling),n=i.data==="F!";break t}}Na(n)}n=!1}n&&(e=a[0])}}return a=Wt(),a.memoizedState=a.baseState=e,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:e},a.queue=n,a=nf.bind(null,F,n),n.dispatch=a,n=Mu(!1),u=Uu.bind(null,F,!1,n.queue),n=Wt(),i={state:e,dispatch:null,action:t,pending:null},n.queue=i,a=Zg.bind(null,F,i,u,a),i.dispatch=a,n.memoizedState=t,[e,a,!1]}function Lo(t){var e=xt();return Yo(e,ft,t)}function Yo(t,e,a){if(e=Ru(t,e,jo)[0],t=ms(Ie)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var n=ul(e)}catch(o){throw o===el?rs:o}else n=e;e=xt();var i=e.queue,u=i.dispatch;return a!==e.memoizedState&&(F.flags|=2048,mn(9,gs(),Kg.bind(null,i,a),null)),[n,u,t]}function Kg(t,e){t.action=e}function Go(t){var e=xt(),a=ft;if(a!==null)return Yo(e,a,t);xt(),e=e.memoizedState,a=xt();var n=a.queue.dispatch;return a.memoizedState=t,[e,n,!1]}function mn(t,e,a,n){return t={tag:t,create:a,deps:n,inst:e,next:null},e=F.updateQueue,e===null&&(e=Eu(),F.updateQueue=e),a=e.lastEffect,a===null?e.lastEffect=t.next=t:(n=a.next,a.next=t,t.next=n,e.lastEffect=t),t}function gs(){return{destroy:void 0,resource:void 0}}function Io(){return xt().memoizedState}function ps(t,e,a,n){var i=Wt();n=n===void 0?null:n,F.flags|=t,i.memoizedState=mn(1|e,gs(),a,n)}function rl(t,e,a,n){var i=xt();n=n===void 0?null:n;var u=i.memoizedState.inst;ft!==null&&n!==null&&yu(n,ft.memoizedState.deps)?i.memoizedState=mn(e,u,a,n):(F.flags|=t,i.memoizedState=mn(1|e,u,a,n))}function Vo(t,e){ps(8390656,8,t,e)}function Xo(t,e){rl(2048,8,t,e)}function Qo(t,e){return rl(4,2,t,e)}function Zo(t,e){return rl(4,4,t,e)}function Ko(t,e){if(typeof e=="function"){t=t();var a=e(t);return function(){typeof a=="function"?a():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function ko(t,e,a){a=a!=null?a.concat([t]):null,rl(4,4,Ko.bind(null,e,t),a)}function Cu(){}function Jo(t,e){var a=xt();e=e===void 0?null:e;var n=a.memoizedState;return e!==null&&yu(e,n[1])?n[0]:(a.memoizedState=[t,e],t)}function $o(t,e){var a=xt();e=e===void 0?null:e;var n=a.memoizedState;if(e!==null&&yu(e,n[1]))return n[0];if(n=t(),qa){Pe(!0);try{t()}finally{Pe(!1)}}return a.memoizedState=[n,e],n}function Ou(t,e,a){return a===void 0||(ia&1073741824)!==0?t.memoizedState=e:(t.memoizedState=a,t=td(),F.lanes|=t,ha|=t,a)}function Fo(t,e,a,n){return ie(a,e)?a:fn.current!==null?(t=Ou(t,a,n),ie(t,e)||(Nt=!0),t):(ia&42)===0?(Nt=!0,t.memoizedState=a):(t=td(),F.lanes|=t,ha|=t,e)}function Wo(t,e,a,n,i){var u=q.p;q.p=u!==0&&8>u?u:8;var o=C.T,d={};C.T=d,Uu(t,!1,e,a);try{var m=i(),E=C.S;if(E!==null&&E(d,m),m!==null&&typeof m=="object"&&typeof m.then=="function"){var w=Vg(m,n);cl(t,e,w,fe(t))}else cl(t,e,n,fe(t))}catch(U){cl(t,e,{then:function(){},status:"rejected",reason:U},fe())}finally{q.p=u,C.T=o}}function kg(){}function zu(t,e,a,n){if(t.tag!==5)throw Error(c(476));var i=Po(t).queue;Wo(t,i,e,Q,a===null?kg:function(){return tf(t),a(n)})}function Po(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ie,lastRenderedState:Q},next:null};var a={};return e.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ie,lastRenderedState:a},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function tf(t){var e=Po(t).next.queue;cl(t,e,{},fe())}function Du(){return Qt(Ml)}function ef(){return xt().memoizedState}function af(){return xt().memoizedState}function Jg(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var a=fe();t=la(a);var n=sa(e,t,a);n!==null&&(de(n,e,a),nl(n,e,a)),e={cache:ru()},t.payload=e;return}e=e.return}}function $g(t,e,a){var n=fe();a={lane:n,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},vs(t)?lf(e,a):(a=Wi(t,e,a,n),a!==null&&(de(a,t,n),sf(a,e,n)))}function nf(t,e,a){var n=fe();cl(t,e,a,n)}function cl(t,e,a,n){var i={lane:n,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(vs(t))lf(e,i);else{var u=t.alternate;if(t.lanes===0&&(u===null||u.lanes===0)&&(u=e.lastRenderedReducer,u!==null))try{var o=e.lastRenderedState,d=u(o,a);if(i.hasEagerState=!0,i.eagerState=d,ie(d,o))return ts(t,e,i,0),pt===null&&Pl(),!1}catch{}finally{}if(a=Wi(t,e,i,n),a!==null)return de(a,t,n),sf(a,e,n),!0}return!1}function Uu(t,e,a,n){if(n={lane:2,revertLane:fr(),action:n,hasEagerState:!1,eagerState:null,next:null},vs(t)){if(e)throw Error(c(479))}else e=Wi(t,a,n,2),e!==null&&de(e,t,2)}function vs(t){var e=t.alternate;return t===F||e!==null&&e===F}function lf(t,e){dn=fs=!0;var a=t.pending;a===null?e.next=e:(e.next=a.next,a.next=e),t.pending=e}function sf(t,e,a){if((a&4194048)!==0){var n=e.lanes;n&=t.pendingLanes,a|=n,e.lanes=a,dc(t,a)}}var ys={readContext:Qt,use:hs,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useLayoutEffect:Tt,useInsertionEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useSyncExternalStore:Tt,useId:Tt,useHostTransitionStatus:Tt,useFormState:Tt,useActionState:Tt,useOptimistic:Tt,useMemoCache:Tt,useCacheRefresh:Tt},uf={readContext:Qt,use:hs,useCallback:function(t,e){return Wt().memoizedState=[t,e===void 0?null:e],t},useContext:Qt,useEffect:Vo,useImperativeHandle:function(t,e,a){a=a!=null?a.concat([t]):null,ps(4194308,4,Ko.bind(null,e,t),a)},useLayoutEffect:function(t,e){return ps(4194308,4,t,e)},useInsertionEffect:function(t,e){ps(4,2,t,e)},useMemo:function(t,e){var a=Wt();e=e===void 0?null:e;var n=t();if(qa){Pe(!0);try{t()}finally{Pe(!1)}}return a.memoizedState=[n,e],n},useReducer:function(t,e,a){var n=Wt();if(a!==void 0){var i=a(e);if(qa){Pe(!0);try{a(e)}finally{Pe(!1)}}}else i=e;return n.memoizedState=n.baseState=i,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:i},n.queue=t,t=t.dispatch=$g.bind(null,F,t),[n.memoizedState,t]},useRef:function(t){var e=Wt();return t={current:t},e.memoizedState=t},useState:function(t){t=Mu(t);var e=t.queue,a=nf.bind(null,F,e);return e.dispatch=a,[t.memoizedState,a]},useDebugValue:Cu,useDeferredValue:function(t,e){var a=Wt();return Ou(a,t,e)},useTransition:function(){var t=Mu(!1);return t=Wo.bind(null,F,t.queue,!0,!1),Wt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,a){var n=F,i=Wt();if(ut){if(a===void 0)throw Error(c(407));a=a()}else{if(a=e(),pt===null)throw Error(c(349));(at&124)!==0||Mo(n,e,a)}i.memoizedState=a;var u={value:a,getSnapshot:e};return i.queue=u,Vo(Co.bind(null,n,u,t),[t]),n.flags|=2048,mn(9,gs(),wo.bind(null,n,u,a,e),null),a},useId:function(){var t=Wt(),e=pt.identifierPrefix;if(ut){var a=Le,n=qe;a=(n&~(1<<32-se(n)-1)).toString(32)+a,e="«"+e+"R"+a,a=ds++,0<a&&(e+="H"+a.toString(32)),e+="»"}else a=Xg++,e="«"+e+"r"+a.toString(32)+"»";return t.memoizedState=e},useHostTransitionStatus:Du,useFormState:qo,useActionState:qo,useOptimistic:function(t){var e=Wt();e.memoizedState=e.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=a,e=Uu.bind(null,F,!0,a),a.dispatch=e,[t,e]},useMemoCache:Au,useCacheRefresh:function(){return Wt().memoizedState=Jg.bind(null,F)}},rf={readContext:Qt,use:hs,useCallback:Jo,useContext:Qt,useEffect:Xo,useImperativeHandle:ko,useInsertionEffect:Qo,useLayoutEffect:Zo,useMemo:$o,useReducer:ms,useRef:Io,useState:function(){return ms(Ie)},useDebugValue:Cu,useDeferredValue:function(t,e){var a=xt();return Fo(a,ft.memoizedState,t,e)},useTransition:function(){var t=ms(Ie)[0],e=xt().memoizedState;return[typeof t=="boolean"?t:ul(t),e]},useSyncExternalStore:xo,useId:ef,useHostTransitionStatus:Du,useFormState:Lo,useActionState:Lo,useOptimistic:function(t,e){var a=xt();return Do(a,ft,t,e)},useMemoCache:Au,useCacheRefresh:af},Fg={readContext:Qt,use:hs,useCallback:Jo,useContext:Qt,useEffect:Xo,useImperativeHandle:ko,useInsertionEffect:Qo,useLayoutEffect:Zo,useMemo:$o,useReducer:xu,useRef:Io,useState:function(){return xu(Ie)},useDebugValue:Cu,useDeferredValue:function(t,e){var a=xt();return ft===null?Ou(a,t,e):Fo(a,ft.memoizedState,t,e)},useTransition:function(){var t=xu(Ie)[0],e=xt().memoizedState;return[typeof t=="boolean"?t:ul(t),e]},useSyncExternalStore:xo,useId:ef,useHostTransitionStatus:Du,useFormState:Go,useActionState:Go,useOptimistic:function(t,e){var a=xt();return ft!==null?Do(a,ft,t,e):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:Au,useCacheRefresh:af},gn=null,ol=0;function bs(t){var e=ol;return ol+=1,gn===null&&(gn=[]),yo(gn,t,e)}function fl(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function Ss(t,e){throw e.$$typeof===O?Error(c(525)):(t=Object.prototype.toString.call(e),Error(c(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function cf(t){var e=t._init;return e(t._payload)}function of(t){function e(b,p){if(t){var _=b.deletions;_===null?(b.deletions=[p],b.flags|=16):_.push(p)}}function a(b,p){if(!t)return null;for(;p!==null;)e(b,p),p=p.sibling;return null}function n(b){for(var p=new Map;b!==null;)b.key!==null?p.set(b.key,b):p.set(b.index,b),b=b.sibling;return p}function i(b,p){return b=je(b,p),b.index=0,b.sibling=null,b}function u(b,p,_){return b.index=_,t?(_=b.alternate,_!==null?(_=_.index,_<p?(b.flags|=67108866,p):_):(b.flags|=67108866,p)):(b.flags|=1048576,p)}function o(b){return t&&b.alternate===null&&(b.flags|=67108866),b}function d(b,p,_,z){return p===null||p.tag!==6?(p=tu(_,b.mode,z),p.return=b,p):(p=i(p,_),p.return=b,p)}function m(b,p,_,z){var Y=_.type;return Y===k?w(b,p,_.props.children,z,_.key):p!==null&&(p.elementType===Y||typeof Y=="object"&&Y!==null&&Y.$$typeof===It&&cf(Y)===p.type)?(p=i(p,_.props),fl(p,_),p.return=b,p):(p=as(_.type,_.key,_.props,null,b.mode,z),fl(p,_),p.return=b,p)}function E(b,p,_,z){return p===null||p.tag!==4||p.stateNode.containerInfo!==_.containerInfo||p.stateNode.implementation!==_.implementation?(p=eu(_,b.mode,z),p.return=b,p):(p=i(p,_.children||[]),p.return=b,p)}function w(b,p,_,z,Y){return p===null||p.tag!==7?(p=Oa(_,b.mode,z,Y),p.return=b,p):(p=i(p,_),p.return=b,p)}function U(b,p,_){if(typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint")return p=tu(""+p,b.mode,_),p.return=b,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case D:return _=as(p.type,p.key,p.props,null,b.mode,_),fl(_,p),_.return=b,_;case B:return p=eu(p,b.mode,_),p.return=b,p;case It:var z=p._init;return p=z(p._payload),U(b,p,_)}if(Vt(p)||wt(p))return p=Oa(p,b.mode,_,null),p.return=b,p;if(typeof p.then=="function")return U(b,bs(p),_);if(p.$$typeof===lt)return U(b,is(b,p),_);Ss(b,p)}return null}function A(b,p,_,z){var Y=p!==null?p.key:null;if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return Y!==null?null:d(b,p,""+_,z);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case D:return _.key===Y?m(b,p,_,z):null;case B:return _.key===Y?E(b,p,_,z):null;case It:return Y=_._init,_=Y(_._payload),A(b,p,_,z)}if(Vt(_)||wt(_))return Y!==null?null:w(b,p,_,z,null);if(typeof _.then=="function")return A(b,p,bs(_),z);if(_.$$typeof===lt)return A(b,p,is(b,_),z);Ss(b,_)}return null}function R(b,p,_,z,Y){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return b=b.get(_)||null,d(p,b,""+z,Y);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case D:return b=b.get(z.key===null?_:z.key)||null,m(p,b,z,Y);case B:return b=b.get(z.key===null?_:z.key)||null,E(p,b,z,Y);case It:var W=z._init;return z=W(z._payload),R(b,p,_,z,Y)}if(Vt(z)||wt(z))return b=b.get(_)||null,w(p,b,z,Y,null);if(typeof z.then=="function")return R(b,p,_,bs(z),Y);if(z.$$typeof===lt)return R(b,p,_,is(p,z),Y);Ss(p,z)}return null}function Z(b,p,_,z){for(var Y=null,W=null,G=p,X=p=0,Ht=null;G!==null&&X<_.length;X++){G.index>X?(Ht=G,G=null):Ht=G.sibling;var it=A(b,G,_[X],z);if(it===null){G===null&&(G=Ht);break}t&&G&&it.alternate===null&&e(b,G),p=u(it,p,X),W===null?Y=it:W.sibling=it,W=it,G=Ht}if(X===_.length)return a(b,G),ut&&Da(b,X),Y;if(G===null){for(;X<_.length;X++)G=U(b,_[X],z),G!==null&&(p=u(G,p,X),W===null?Y=G:W.sibling=G,W=G);return ut&&Da(b,X),Y}for(G=n(G);X<_.length;X++)Ht=R(G,b,X,_[X],z),Ht!==null&&(t&&Ht.alternate!==null&&G.delete(Ht.key===null?X:Ht.key),p=u(Ht,p,X),W===null?Y=Ht:W.sibling=Ht,W=Ht);return t&&G.forEach(function(Ta){return e(b,Ta)}),ut&&Da(b,X),Y}function V(b,p,_,z){if(_==null)throw Error(c(151));for(var Y=null,W=null,G=p,X=p=0,Ht=null,it=_.next();G!==null&&!it.done;X++,it=_.next()){G.index>X?(Ht=G,G=null):Ht=G.sibling;var Ta=A(b,G,it.value,z);if(Ta===null){G===null&&(G=Ht);break}t&&G&&Ta.alternate===null&&e(b,G),p=u(Ta,p,X),W===null?Y=Ta:W.sibling=Ta,W=Ta,G=Ht}if(it.done)return a(b,G),ut&&Da(b,X),Y;if(G===null){for(;!it.done;X++,it=_.next())it=U(b,it.value,z),it!==null&&(p=u(it,p,X),W===null?Y=it:W.sibling=it,W=it);return ut&&Da(b,X),Y}for(G=n(G);!it.done;X++,it=_.next())it=R(G,b,X,it.value,z),it!==null&&(t&&it.alternate!==null&&G.delete(it.key===null?X:it.key),p=u(it,p,X),W===null?Y=it:W.sibling=it,W=it);return t&&G.forEach(function(Wp){return e(b,Wp)}),ut&&Da(b,X),Y}function ht(b,p,_,z){if(typeof _=="object"&&_!==null&&_.type===k&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case D:t:{for(var Y=_.key;p!==null;){if(p.key===Y){if(Y=_.type,Y===k){if(p.tag===7){a(b,p.sibling),z=i(p,_.props.children),z.return=b,b=z;break t}}else if(p.elementType===Y||typeof Y=="object"&&Y!==null&&Y.$$typeof===It&&cf(Y)===p.type){a(b,p.sibling),z=i(p,_.props),fl(z,_),z.return=b,b=z;break t}a(b,p);break}else e(b,p);p=p.sibling}_.type===k?(z=Oa(_.props.children,b.mode,z,_.key),z.return=b,b=z):(z=as(_.type,_.key,_.props,null,b.mode,z),fl(z,_),z.return=b,b=z)}return o(b);case B:t:{for(Y=_.key;p!==null;){if(p.key===Y)if(p.tag===4&&p.stateNode.containerInfo===_.containerInfo&&p.stateNode.implementation===_.implementation){a(b,p.sibling),z=i(p,_.children||[]),z.return=b,b=z;break t}else{a(b,p);break}else e(b,p);p=p.sibling}z=eu(_,b.mode,z),z.return=b,b=z}return o(b);case It:return Y=_._init,_=Y(_._payload),ht(b,p,_,z)}if(Vt(_))return Z(b,p,_,z);if(wt(_)){if(Y=wt(_),typeof Y!="function")throw Error(c(150));return _=Y.call(_),V(b,p,_,z)}if(typeof _.then=="function")return ht(b,p,bs(_),z);if(_.$$typeof===lt)return ht(b,p,is(b,_),z);Ss(b,_)}return typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint"?(_=""+_,p!==null&&p.tag===6?(a(b,p.sibling),z=i(p,_),z.return=b,b=z):(a(b,p),z=tu(_,b.mode,z),z.return=b,b=z),o(b)):a(b,p)}return function(b,p,_,z){try{ol=0;var Y=ht(b,p,_,z);return gn=null,Y}catch(G){if(G===el||G===rs)throw G;var W=ue(29,G,null,b.mode);return W.lanes=z,W.return=b,W}finally{}}}var pn=of(!0),ff=of(!1),be=N(null),Oe=null;function ua(t){var e=t.alternate;j(Ot,Ot.current&1),j(be,t),Oe===null&&(e===null||fn.current!==null||e.memoizedState!==null)&&(Oe=t)}function df(t){if(t.tag===22){if(j(Ot,Ot.current),j(be,t),Oe===null){var e=t.alternate;e!==null&&e.memoizedState!==null&&(Oe=t)}}else ra()}function ra(){j(Ot,Ot.current),j(be,be.current)}function Ve(t){L(be),Oe===t&&(Oe=null),L(Ot)}var Ot=N(0);function _s(t){for(var e=t;e!==null;){if(e.tag===13){var a=e.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||Er(a)))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}function Nu(t,e,a,n){e=t.memoizedState,a=a(n,e),a=a==null?e:M({},e,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var Bu={enqueueSetState:function(t,e,a){t=t._reactInternals;var n=fe(),i=la(n);i.payload=e,a!=null&&(i.callback=a),e=sa(t,i,n),e!==null&&(de(e,t,n),nl(e,t,n))},enqueueReplaceState:function(t,e,a){t=t._reactInternals;var n=fe(),i=la(n);i.tag=1,i.payload=e,a!=null&&(i.callback=a),e=sa(t,i,n),e!==null&&(de(e,t,n),nl(e,t,n))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var a=fe(),n=la(a);n.tag=2,e!=null&&(n.callback=e),e=sa(t,n,a),e!==null&&(de(e,t,a),nl(e,t,a))}};function hf(t,e,a,n,i,u,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(n,u,o):e.prototype&&e.prototype.isPureReactComponent?!Kn(a,n)||!Kn(i,u):!0}function mf(t,e,a,n){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(a,n),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(a,n),e.state!==t&&Bu.enqueueReplaceState(e,e.state,null)}function La(t,e){var a=e;if("ref"in e){a={};for(var n in e)n!=="ref"&&(a[n]=e[n])}if(t=t.defaultProps){a===e&&(a=M({},a));for(var i in t)a[i]===void 0&&(a[i]=t[i])}return a}var Ts=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function gf(t){Ts(t)}function pf(t){console.error(t)}function vf(t){Ts(t)}function Es(t,e){try{var a=t.onUncaughtError;a(e.value,{componentStack:e.stack})}catch(n){setTimeout(function(){throw n})}}function yf(t,e,a){try{var n=t.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function Hu(t,e,a){return a=la(a),a.tag=3,a.payload={element:null},a.callback=function(){Es(t,e)},a}function bf(t){return t=la(t),t.tag=3,t}function Sf(t,e,a,n){var i=a.type.getDerivedStateFromError;if(typeof i=="function"){var u=n.value;t.payload=function(){return i(u)},t.callback=function(){yf(e,a,n)}}var o=a.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(t.callback=function(){yf(e,a,n),typeof i!="function"&&(ma===null?ma=new Set([this]):ma.add(this));var d=n.stack;this.componentDidCatch(n.value,{componentStack:d!==null?d:""})})}function Wg(t,e,a,n,i){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(e=a.alternate,e!==null&&Wn(e,a,i,!0),a=be.current,a!==null){switch(a.tag){case 13:return Oe===null?ir():a.alternate===null&&_t===0&&(_t=3),a.flags&=-257,a.flags|=65536,a.lanes=i,n===fu?a.flags|=16384:(e=a.updateQueue,e===null?a.updateQueue=new Set([n]):e.add(n),rr(t,n,i)),!1;case 22:return a.flags|=65536,n===fu?a.flags|=16384:(e=a.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=e):(a=e.retryQueue,a===null?e.retryQueue=new Set([n]):a.add(n)),rr(t,n,i)),!1}throw Error(c(435,a.tag))}return rr(t,n,i),ir(),!1}if(ut)return e=be.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=i,n!==lu&&(t=Error(c(422),{cause:n}),Fn(ge(t,a)))):(n!==lu&&(e=Error(c(423),{cause:n}),Fn(ge(e,a))),t=t.current.alternate,t.flags|=65536,i&=-i,t.lanes|=i,n=ge(n,a),i=Hu(t.stateNode,n,i),mu(t,i),_t!==4&&(_t=2)),!1;var u=Error(c(520),{cause:n});if(u=ge(u,a),yl===null?yl=[u]:yl.push(u),_t!==4&&(_t=2),e===null)return!0;n=ge(n,a),a=e;do{switch(a.tag){case 3:return a.flags|=65536,t=i&-i,a.lanes|=t,t=Hu(a.stateNode,n,t),mu(a,t),!1;case 1:if(e=a.type,u=a.stateNode,(a.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(ma===null||!ma.has(u))))return a.flags|=65536,i&=-i,a.lanes|=i,i=bf(i),Sf(i,t,a,n),mu(a,i),!1}a=a.return}while(a!==null);return!1}var _f=Error(c(461)),Nt=!1;function Lt(t,e,a,n){e.child=t===null?ff(e,null,a,n):pn(e,t.child,a,n)}function Tf(t,e,a,n,i){a=a.render;var u=e.ref;if("ref"in n){var o={};for(var d in n)d!=="ref"&&(o[d]=n[d])}else o=n;return Ha(e),n=bu(t,e,a,o,u,i),d=Su(),t!==null&&!Nt?(_u(t,e,i),Xe(t,e,i)):(ut&&d&&au(e),e.flags|=1,Lt(t,e,n,i),e.child)}function Ef(t,e,a,n,i){if(t===null){var u=a.type;return typeof u=="function"&&!Pi(u)&&u.defaultProps===void 0&&a.compare===null?(e.tag=15,e.type=u,Af(t,e,u,n,i)):(t=as(a.type,null,n,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(u=t.child,!Xu(t,i)){var o=u.memoizedProps;if(a=a.compare,a=a!==null?a:Kn,a(o,n)&&t.ref===e.ref)return Xe(t,e,i)}return e.flags|=1,t=je(u,n),t.ref=e.ref,t.return=e,e.child=t}function Af(t,e,a,n,i){if(t!==null){var u=t.memoizedProps;if(Kn(u,n)&&t.ref===e.ref)if(Nt=!1,e.pendingProps=n=u,Xu(t,i))(t.flags&131072)!==0&&(Nt=!0);else return e.lanes=t.lanes,Xe(t,e,i)}return ju(t,e,a,n,i)}function Rf(t,e,a){var n=e.pendingProps,i=n.children,u=t!==null?t.memoizedState:null;if(n.mode==="hidden"){if((e.flags&128)!==0){if(n=u!==null?u.baseLanes|a:a,t!==null){for(i=e.child=t.child,u=0;i!==null;)u=u|i.lanes|i.childLanes,i=i.sibling;e.childLanes=u&~n}else e.childLanes=0,e.child=null;return xf(t,e,n,a)}if((a&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&us(e,u!==null?u.cachePool:null),u!==null?Eo(e,u):pu(),df(e);else return e.lanes=e.childLanes=536870912,xf(t,e,u!==null?u.baseLanes|a:a,a)}else u!==null?(us(e,u.cachePool),Eo(e,u),ra(),e.memoizedState=null):(t!==null&&us(e,null),pu(),ra());return Lt(t,e,i,a),e.child}function xf(t,e,a,n){var i=ou();return i=i===null?null:{parent:Ct._currentValue,pool:i},e.memoizedState={baseLanes:a,cachePool:i},t!==null&&us(e,null),pu(),df(e),t!==null&&Wn(t,e,n,!0),null}function As(t,e){var a=e.ref;if(a===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(c(284));(t===null||t.ref!==a)&&(e.flags|=4194816)}}function ju(t,e,a,n,i){return Ha(e),a=bu(t,e,a,n,void 0,i),n=Su(),t!==null&&!Nt?(_u(t,e,i),Xe(t,e,i)):(ut&&n&&au(e),e.flags|=1,Lt(t,e,a,i),e.child)}function Mf(t,e,a,n,i,u){return Ha(e),e.updateQueue=null,a=Ro(e,n,a,i),Ao(t),n=Su(),t!==null&&!Nt?(_u(t,e,u),Xe(t,e,u)):(ut&&n&&au(e),e.flags|=1,Lt(t,e,a,u),e.child)}function wf(t,e,a,n,i){if(Ha(e),e.stateNode===null){var u=sn,o=a.contextType;typeof o=="object"&&o!==null&&(u=Qt(o)),u=new a(n,u),e.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Bu,e.stateNode=u,u._reactInternals=e,u=e.stateNode,u.props=n,u.state=e.memoizedState,u.refs={},du(e),o=a.contextType,u.context=typeof o=="object"&&o!==null?Qt(o):sn,u.state=e.memoizedState,o=a.getDerivedStateFromProps,typeof o=="function"&&(Nu(e,a,o,n),u.state=e.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(o=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),o!==u.state&&Bu.enqueueReplaceState(u,u.state,null),sl(e,n,u,i),ll(),u.state=e.memoizedState),typeof u.componentDidMount=="function"&&(e.flags|=4194308),n=!0}else if(t===null){u=e.stateNode;var d=e.memoizedProps,m=La(a,d);u.props=m;var E=u.context,w=a.contextType;o=sn,typeof w=="object"&&w!==null&&(o=Qt(w));var U=a.getDerivedStateFromProps;w=typeof U=="function"||typeof u.getSnapshotBeforeUpdate=="function",d=e.pendingProps!==d,w||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(d||E!==o)&&mf(e,u,n,o),na=!1;var A=e.memoizedState;u.state=A,sl(e,n,u,i),ll(),E=e.memoizedState,d||A!==E||na?(typeof U=="function"&&(Nu(e,a,U,n),E=e.memoizedState),(m=na||hf(e,a,m,n,A,E,o))?(w||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(e.flags|=4194308)):(typeof u.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=E),u.props=n,u.state=E,u.context=o,n=m):(typeof u.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{u=e.stateNode,hu(t,e),o=e.memoizedProps,w=La(a,o),u.props=w,U=e.pendingProps,A=u.context,E=a.contextType,m=sn,typeof E=="object"&&E!==null&&(m=Qt(E)),d=a.getDerivedStateFromProps,(E=typeof d=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(o!==U||A!==m)&&mf(e,u,n,m),na=!1,A=e.memoizedState,u.state=A,sl(e,n,u,i),ll();var R=e.memoizedState;o!==U||A!==R||na||t!==null&&t.dependencies!==null&&ss(t.dependencies)?(typeof d=="function"&&(Nu(e,a,d,n),R=e.memoizedState),(w=na||hf(e,a,w,n,A,R,m)||t!==null&&t.dependencies!==null&&ss(t.dependencies))?(E||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(n,R,m),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(n,R,m)),typeof u.componentDidUpdate=="function"&&(e.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof u.componentDidUpdate!="function"||o===t.memoizedProps&&A===t.memoizedState||(e.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&A===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=R),u.props=n,u.state=R,u.context=m,n=w):(typeof u.componentDidUpdate!="function"||o===t.memoizedProps&&A===t.memoizedState||(e.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&A===t.memoizedState||(e.flags|=1024),n=!1)}return u=n,As(t,e),n=(e.flags&128)!==0,u||n?(u=e.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:u.render(),e.flags|=1,t!==null&&n?(e.child=pn(e,t.child,null,i),e.child=pn(e,null,a,i)):Lt(t,e,a,i),e.memoizedState=u.state,t=e.child):t=Xe(t,e,i),t}function Cf(t,e,a,n){return $n(),e.flags|=256,Lt(t,e,a,n),e.child}var qu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Lu(t){return{baseLanes:t,cachePool:go()}}function Yu(t,e,a){return t=t!==null?t.childLanes&~a:0,e&&(t|=Se),t}function Of(t,e,a){var n=e.pendingProps,i=!1,u=(e.flags&128)!==0,o;if((o=u)||(o=t!==null&&t.memoizedState===null?!1:(Ot.current&2)!==0),o&&(i=!0,e.flags&=-129),o=(e.flags&32)!==0,e.flags&=-33,t===null){if(ut){if(i?ua(e):ra(),ut){var d=St,m;if(m=d){t:{for(m=d,d=Ce;m.nodeType!==8;){if(!d){d=null;break t}if(m=Re(m.nextSibling),m===null){d=null;break t}}d=m}d!==null?(e.memoizedState={dehydrated:d,treeContext:za!==null?{id:qe,overflow:Le}:null,retryLane:536870912,hydrationErrors:null},m=ue(18,null,null,0),m.stateNode=d,m.return=e,e.child=m,Kt=e,St=null,m=!0):m=!1}m||Na(e)}if(d=e.memoizedState,d!==null&&(d=d.dehydrated,d!==null))return Er(d)?e.lanes=32:e.lanes=536870912,null;Ve(e)}return d=n.children,n=n.fallback,i?(ra(),i=e.mode,d=Rs({mode:"hidden",children:d},i),n=Oa(n,i,a,null),d.return=e,n.return=e,d.sibling=n,e.child=d,i=e.child,i.memoizedState=Lu(a),i.childLanes=Yu(t,o,a),e.memoizedState=qu,n):(ua(e),Gu(e,d))}if(m=t.memoizedState,m!==null&&(d=m.dehydrated,d!==null)){if(u)e.flags&256?(ua(e),e.flags&=-257,e=Iu(t,e,a)):e.memoizedState!==null?(ra(),e.child=t.child,e.flags|=128,e=null):(ra(),i=n.fallback,d=e.mode,n=Rs({mode:"visible",children:n.children},d),i=Oa(i,d,a,null),i.flags|=2,n.return=e,i.return=e,n.sibling=i,e.child=n,pn(e,t.child,null,a),n=e.child,n.memoizedState=Lu(a),n.childLanes=Yu(t,o,a),e.memoizedState=qu,e=i);else if(ua(e),Er(d)){if(o=d.nextSibling&&d.nextSibling.dataset,o)var E=o.dgst;o=E,n=Error(c(419)),n.stack="",n.digest=o,Fn({value:n,source:null,stack:null}),e=Iu(t,e,a)}else if(Nt||Wn(t,e,a,!1),o=(a&t.childLanes)!==0,Nt||o){if(o=pt,o!==null&&(n=a&-a,n=(n&42)!==0?1:Ai(n),n=(n&(o.suspendedLanes|a))!==0?0:n,n!==0&&n!==m.retryLane))throw m.retryLane=n,ln(t,n),de(o,t,n),_f;d.data==="$?"||ir(),e=Iu(t,e,a)}else d.data==="$?"?(e.flags|=192,e.child=t.child,e=null):(t=m.treeContext,St=Re(d.nextSibling),Kt=e,ut=!0,Ua=null,Ce=!1,t!==null&&(ve[ye++]=qe,ve[ye++]=Le,ve[ye++]=za,qe=t.id,Le=t.overflow,za=e),e=Gu(e,n.children),e.flags|=4096);return e}return i?(ra(),i=n.fallback,d=e.mode,m=t.child,E=m.sibling,n=je(m,{mode:"hidden",children:n.children}),n.subtreeFlags=m.subtreeFlags&65011712,E!==null?i=je(E,i):(i=Oa(i,d,a,null),i.flags|=2),i.return=e,n.return=e,n.sibling=i,e.child=n,n=i,i=e.child,d=t.child.memoizedState,d===null?d=Lu(a):(m=d.cachePool,m!==null?(E=Ct._currentValue,m=m.parent!==E?{parent:E,pool:E}:m):m=go(),d={baseLanes:d.baseLanes|a,cachePool:m}),i.memoizedState=d,i.childLanes=Yu(t,o,a),e.memoizedState=qu,n):(ua(e),a=t.child,t=a.sibling,a=je(a,{mode:"visible",children:n.children}),a.return=e,a.sibling=null,t!==null&&(o=e.deletions,o===null?(e.deletions=[t],e.flags|=16):o.push(t)),e.child=a,e.memoizedState=null,a)}function Gu(t,e){return e=Rs({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function Rs(t,e){return t=ue(22,t,null,e),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function Iu(t,e,a){return pn(e,t.child,null,a),t=Gu(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function zf(t,e,a){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),iu(t.return,e,a)}function Vu(t,e,a,n,i){var u=t.memoizedState;u===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:i}:(u.isBackwards=e,u.rendering=null,u.renderingStartTime=0,u.last=n,u.tail=a,u.tailMode=i)}function Df(t,e,a){var n=e.pendingProps,i=n.revealOrder,u=n.tail;if(Lt(t,e,n.children,a),n=Ot.current,(n&2)!==0)n=n&1|2,e.flags|=128;else{if(t!==null&&(t.flags&128)!==0)t:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&zf(t,a,e);else if(t.tag===19)zf(t,a,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;t.sibling===null;){if(t.return===null||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}switch(j(Ot,n),i){case"forwards":for(a=e.child,i=null;a!==null;)t=a.alternate,t!==null&&_s(t)===null&&(i=a),a=a.sibling;a=i,a===null?(i=e.child,e.child=null):(i=a.sibling,a.sibling=null),Vu(e,!1,i,a,u);break;case"backwards":for(a=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&_s(t)===null){e.child=i;break}t=i.sibling,i.sibling=a,a=i,i=t}Vu(e,!0,a,null,u);break;case"together":Vu(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Xe(t,e,a){if(t!==null&&(e.dependencies=t.dependencies),ha|=e.lanes,(a&e.childLanes)===0)if(t!==null){if(Wn(t,e,a,!1),(a&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(c(153));if(e.child!==null){for(t=e.child,a=je(t,t.pendingProps),e.child=a,a.return=e;t.sibling!==null;)t=t.sibling,a=a.sibling=je(t,t.pendingProps),a.return=e;a.sibling=null}return e.child}function Xu(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&ss(t)))}function Pg(t,e,a){switch(e.tag){case 3:vt(e,e.stateNode.containerInfo),aa(e,Ct,t.memoizedState.cache),$n();break;case 27:case 5:bi(e);break;case 4:vt(e,e.stateNode.containerInfo);break;case 10:aa(e,e.type,e.memoizedProps.value);break;case 13:var n=e.memoizedState;if(n!==null)return n.dehydrated!==null?(ua(e),e.flags|=128,null):(a&e.child.childLanes)!==0?Of(t,e,a):(ua(e),t=Xe(t,e,a),t!==null?t.sibling:null);ua(e);break;case 19:var i=(t.flags&128)!==0;if(n=(a&e.childLanes)!==0,n||(Wn(t,e,a,!1),n=(a&e.childLanes)!==0),i){if(n)return Df(t,e,a);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),j(Ot,Ot.current),n)break;return null;case 22:case 23:return e.lanes=0,Rf(t,e,a);case 24:aa(e,Ct,t.memoizedState.cache)}return Xe(t,e,a)}function Uf(t,e,a){if(t!==null)if(t.memoizedProps!==e.pendingProps)Nt=!0;else{if(!Xu(t,a)&&(e.flags&128)===0)return Nt=!1,Pg(t,e,a);Nt=(t.flags&131072)!==0}else Nt=!1,ut&&(e.flags&1048576)!==0&&uo(e,ls,e.index);switch(e.lanes=0,e.tag){case 16:t:{t=e.pendingProps;var n=e.elementType,i=n._init;if(n=i(n._payload),e.type=n,typeof n=="function")Pi(n)?(t=La(n,t),e.tag=1,e=wf(null,e,n,t,a)):(e.tag=0,e=ju(null,e,n,t,a));else{if(n!=null){if(i=n.$$typeof,i===Mt){e.tag=11,e=Tf(null,e,n,t,a);break t}else if(i===qt){e.tag=14,e=Ef(null,e,n,t,a);break t}}throw e=Aa(n)||n,Error(c(306,e,""))}}return e;case 0:return ju(t,e,e.type,e.pendingProps,a);case 1:return n=e.type,i=La(n,e.pendingProps),wf(t,e,n,i,a);case 3:t:{if(vt(e,e.stateNode.containerInfo),t===null)throw Error(c(387));n=e.pendingProps;var u=e.memoizedState;i=u.element,hu(t,e),sl(e,n,null,a);var o=e.memoizedState;if(n=o.cache,aa(e,Ct,n),n!==u.cache&&uu(e,[Ct],a,!0),ll(),n=o.element,u.isDehydrated)if(u={element:n,isDehydrated:!1,cache:o.cache},e.updateQueue.baseState=u,e.memoizedState=u,e.flags&256){e=Cf(t,e,n,a);break t}else if(n!==i){i=ge(Error(c(424)),e),Fn(i),e=Cf(t,e,n,a);break t}else{switch(t=e.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(St=Re(t.firstChild),Kt=e,ut=!0,Ua=null,Ce=!0,a=ff(e,null,n,a),e.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if($n(),n===i){e=Xe(t,e,a);break t}Lt(t,e,n,a)}e=e.child}return e;case 26:return As(t,e),t===null?(a=jd(e.type,null,e.pendingProps,null))?e.memoizedState=a:ut||(a=e.type,t=e.pendingProps,n=Ls(K.current).createElement(a),n[Xt]=e,n[$t]=t,Gt(n,a,t),Ut(n),e.stateNode=n):e.memoizedState=jd(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return bi(e),t===null&&ut&&(n=e.stateNode=Nd(e.type,e.pendingProps,K.current),Kt=e,Ce=!0,i=St,va(e.type)?(Ar=i,St=Re(n.firstChild)):St=i),Lt(t,e,e.pendingProps.children,a),As(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&ut&&((i=n=St)&&(n=Mp(n,e.type,e.pendingProps,Ce),n!==null?(e.stateNode=n,Kt=e,St=Re(n.firstChild),Ce=!1,i=!0):i=!1),i||Na(e)),bi(e),i=e.type,u=e.pendingProps,o=t!==null?t.memoizedProps:null,n=u.children,Sr(i,u)?n=null:o!==null&&Sr(i,o)&&(e.flags|=32),e.memoizedState!==null&&(i=bu(t,e,Qg,null,null,a),Ml._currentValue=i),As(t,e),Lt(t,e,n,a),e.child;case 6:return t===null&&ut&&((t=a=St)&&(a=wp(a,e.pendingProps,Ce),a!==null?(e.stateNode=a,Kt=e,St=null,t=!0):t=!1),t||Na(e)),null;case 13:return Of(t,e,a);case 4:return vt(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=pn(e,null,n,a):Lt(t,e,n,a),e.child;case 11:return Tf(t,e,e.type,e.pendingProps,a);case 7:return Lt(t,e,e.pendingProps,a),e.child;case 8:return Lt(t,e,e.pendingProps.children,a),e.child;case 12:return Lt(t,e,e.pendingProps.children,a),e.child;case 10:return n=e.pendingProps,aa(e,e.type,n.value),Lt(t,e,n.children,a),e.child;case 9:return i=e.type._context,n=e.pendingProps.children,Ha(e),i=Qt(i),n=n(i),e.flags|=1,Lt(t,e,n,a),e.child;case 14:return Ef(t,e,e.type,e.pendingProps,a);case 15:return Af(t,e,e.type,e.pendingProps,a);case 19:return Df(t,e,a);case 31:return n=e.pendingProps,a=e.mode,n={mode:n.mode,children:n.children},t===null?(a=Rs(n,a),a.ref=e.ref,e.child=a,a.return=e,e=a):(a=je(t.child,n),a.ref=e.ref,e.child=a,a.return=e,e=a),e;case 22:return Rf(t,e,a);case 24:return Ha(e),n=Qt(Ct),t===null?(i=ou(),i===null&&(i=pt,u=ru(),i.pooledCache=u,u.refCount++,u!==null&&(i.pooledCacheLanes|=a),i=u),e.memoizedState={parent:n,cache:i},du(e),aa(e,Ct,i)):((t.lanes&a)!==0&&(hu(t,e),sl(e,null,null,a),ll()),i=t.memoizedState,u=e.memoizedState,i.parent!==n?(i={parent:n,cache:n},e.memoizedState=i,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=i),aa(e,Ct,n)):(n=u.cache,aa(e,Ct,n),n!==i.cache&&uu(e,[Ct],a,!0))),Lt(t,e,e.pendingProps.children,a),e.child;case 29:throw e.pendingProps}throw Error(c(156,e.tag))}function Qe(t){t.flags|=4}function Nf(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Id(e)){if(e=be.current,e!==null&&((at&4194048)===at?Oe!==null:(at&62914560)!==at&&(at&536870912)===0||e!==Oe))throw al=fu,po;t.flags|=8192}}function xs(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?oc():536870912,t.lanes|=e,Sn|=e)}function dl(t,e){if(!ut)switch(t.tailMode){case"hidden":e=t.tail;for(var a=null;e!==null;)e.alternate!==null&&(a=e),e=e.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function bt(t){var e=t.alternate!==null&&t.alternate.child===t.child,a=0,n=0;if(e)for(var i=t.child;i!==null;)a|=i.lanes|i.childLanes,n|=i.subtreeFlags&65011712,n|=i.flags&65011712,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)a|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=n,t.childLanes=a,e}function tp(t,e,a){var n=e.pendingProps;switch(nu(e),e.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(e),null;case 1:return bt(e),null;case 3:return a=e.stateNode,n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),Ge(Ct),We(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(Jn(e)?Qe(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,oo())),bt(e),null;case 26:return a=e.memoizedState,t===null?(Qe(e),a!==null?(bt(e),Nf(e,a)):(bt(e),e.flags&=-16777217)):a?a!==t.memoizedState?(Qe(e),bt(e),Nf(e,a)):(bt(e),e.flags&=-16777217):(t.memoizedProps!==n&&Qe(e),bt(e),e.flags&=-16777217),null;case 27:jl(e),a=K.current;var i=e.type;if(t!==null&&e.stateNode!=null)t.memoizedProps!==n&&Qe(e);else{if(!n){if(e.stateNode===null)throw Error(c(166));return bt(e),null}t=I.current,Jn(e)?ro(e):(t=Nd(i,n,a),e.stateNode=t,Qe(e))}return bt(e),null;case 5:if(jl(e),a=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==n&&Qe(e);else{if(!n){if(e.stateNode===null)throw Error(c(166));return bt(e),null}if(t=I.current,Jn(e))ro(e);else{switch(i=Ls(K.current),t){case 1:t=i.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:t=i.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":t=i.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":t=i.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":t=i.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof n.is=="string"?i.createElement("select",{is:n.is}):i.createElement("select"),n.multiple?t.multiple=!0:n.size&&(t.size=n.size);break;default:t=typeof n.is=="string"?i.createElement(a,{is:n.is}):i.createElement(a)}}t[Xt]=e,t[$t]=n;t:for(i=e.child;i!==null;){if(i.tag===5||i.tag===6)t.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break t;for(;i.sibling===null;){if(i.return===null||i.return===e)break t;i=i.return}i.sibling.return=i.return,i=i.sibling}e.stateNode=t;t:switch(Gt(t,a,n),a){case"button":case"input":case"select":case"textarea":t=!!n.autoFocus;break t;case"img":t=!0;break t;default:t=!1}t&&Qe(e)}}return bt(e),e.flags&=-16777217,null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==n&&Qe(e);else{if(typeof n!="string"&&e.stateNode===null)throw Error(c(166));if(t=K.current,Jn(e)){if(t=e.stateNode,a=e.memoizedProps,n=null,i=Kt,i!==null)switch(i.tag){case 27:case 5:n=i.memoizedProps}t[Xt]=e,t=!!(t.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||Md(t.nodeValue,a)),t||Na(e)}else t=Ls(t).createTextNode(n),t[Xt]=e,e.stateNode=t}return bt(e),null;case 13:if(n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(i=Jn(e),n!==null&&n.dehydrated!==null){if(t===null){if(!i)throw Error(c(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(c(317));i[Xt]=e}else $n(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;bt(e),i=!1}else i=oo(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),i=!0;if(!i)return e.flags&256?(Ve(e),e):(Ve(e),null)}if(Ve(e),(e.flags&128)!==0)return e.lanes=a,e;if(a=n!==null,t=t!==null&&t.memoizedState!==null,a){n=e.child,i=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(i=n.alternate.memoizedState.cachePool.pool);var u=null;n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(u=n.memoizedState.cachePool.pool),u!==i&&(n.flags|=2048)}return a!==t&&a&&(e.child.flags|=8192),xs(e,e.updateQueue),bt(e),null;case 4:return We(),t===null&&gr(e.stateNode.containerInfo),bt(e),null;case 10:return Ge(e.type),bt(e),null;case 19:if(L(Ot),i=e.memoizedState,i===null)return bt(e),null;if(n=(e.flags&128)!==0,u=i.rendering,u===null)if(n)dl(i,!1);else{if(_t!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(u=_s(t),u!==null){for(e.flags|=128,dl(i,!1),t=u.updateQueue,e.updateQueue=t,xs(e,t),e.subtreeFlags=0,t=a,a=e.child;a!==null;)io(a,t),a=a.sibling;return j(Ot,Ot.current&1|2),e.child}t=t.sibling}i.tail!==null&&we()>Cs&&(e.flags|=128,n=!0,dl(i,!1),e.lanes=4194304)}else{if(!n)if(t=_s(u),t!==null){if(e.flags|=128,n=!0,t=t.updateQueue,e.updateQueue=t,xs(e,t),dl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!u.alternate&&!ut)return bt(e),null}else 2*we()-i.renderingStartTime>Cs&&a!==536870912&&(e.flags|=128,n=!0,dl(i,!1),e.lanes=4194304);i.isBackwards?(u.sibling=e.child,e.child=u):(t=i.last,t!==null?t.sibling=u:e.child=u,i.last=u)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=we(),e.sibling=null,t=Ot.current,j(Ot,n?t&1|2:t&1),e):(bt(e),null);case 22:case 23:return Ve(e),vu(),n=e.memoizedState!==null,t!==null?t.memoizedState!==null!==n&&(e.flags|=8192):n&&(e.flags|=8192),n?(a&536870912)!==0&&(e.flags&128)===0&&(bt(e),e.subtreeFlags&6&&(e.flags|=8192)):bt(e),a=e.updateQueue,a!==null&&xs(e,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),n=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),n!==a&&(e.flags|=2048),t!==null&&L(ja),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),e.memoizedState.cache!==a&&(e.flags|=2048),Ge(Ct),bt(e),null;case 25:return null;case 30:return null}throw Error(c(156,e.tag))}function ep(t,e){switch(nu(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ge(Ct),We(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return jl(e),null;case 13:if(Ve(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(c(340));$n()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return L(Ot),null;case 4:return We(),null;case 10:return Ge(e.type),null;case 22:case 23:return Ve(e),vu(),t!==null&&L(ja),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Ge(Ct),null;case 25:return null;default:return null}}function Bf(t,e){switch(nu(e),e.tag){case 3:Ge(Ct),We();break;case 26:case 27:case 5:jl(e);break;case 4:We();break;case 13:Ve(e);break;case 19:L(Ot);break;case 10:Ge(e.type);break;case 22:case 23:Ve(e),vu(),t!==null&&L(ja);break;case 24:Ge(Ct)}}function hl(t,e){try{var a=e.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var i=n.next;a=i;do{if((a.tag&t)===t){n=void 0;var u=a.create,o=a.inst;n=u(),o.destroy=n}a=a.next}while(a!==i)}}catch(d){gt(e,e.return,d)}}function ca(t,e,a){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var u=i.next;n=u;do{if((n.tag&t)===t){var o=n.inst,d=o.destroy;if(d!==void 0){o.destroy=void 0,i=e;var m=a,E=d;try{E()}catch(w){gt(i,m,w)}}}n=n.next}while(n!==u)}}catch(w){gt(e,e.return,w)}}function Hf(t){var e=t.updateQueue;if(e!==null){var a=t.stateNode;try{To(e,a)}catch(n){gt(t,t.return,n)}}}function jf(t,e,a){a.props=La(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(n){gt(t,e,n)}}function ml(t,e){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var n=t.stateNode;break;case 30:n=t.stateNode;break;default:n=t.stateNode}typeof a=="function"?t.refCleanup=a(n):a.current=n}}catch(i){gt(t,e,i)}}function ze(t,e){var a=t.ref,n=t.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(i){gt(t,e,i)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(i){gt(t,e,i)}else a.current=null}function qf(t){var e=t.type,a=t.memoizedProps,n=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break t;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(i){gt(t,t.return,i)}}function Qu(t,e,a){try{var n=t.stateNode;Tp(n,t.type,a,e),n[$t]=e}catch(i){gt(t,t.return,i)}}function Lf(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&va(t.type)||t.tag===4}function Zu(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||Lf(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&va(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ku(t,e,a){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,e):(e=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,e.appendChild(t),a=a._reactRootContainer,a!=null||e.onclick!==null||(e.onclick=qs));else if(n!==4&&(n===27&&va(t.type)&&(a=t.stateNode,e=null),t=t.child,t!==null))for(Ku(t,e,a),t=t.sibling;t!==null;)Ku(t,e,a),t=t.sibling}function Ms(t,e,a){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?a.insertBefore(t,e):a.appendChild(t);else if(n!==4&&(n===27&&va(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Ms(t,e,a),t=t.sibling;t!==null;)Ms(t,e,a),t=t.sibling}function Yf(t){var e=t.stateNode,a=t.memoizedProps;try{for(var n=t.type,i=e.attributes;i.length;)e.removeAttributeNode(i[0]);Gt(e,n,a),e[Xt]=t,e[$t]=a}catch(u){gt(t,t.return,u)}}var Ze=!1,Et=!1,ku=!1,Gf=typeof WeakSet=="function"?WeakSet:Set,Bt=null;function ap(t,e){if(t=t.containerInfo,yr=Qs,t=$c(t),Zi(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else t:{a=(a=t.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var i=n.anchorOffset,u=n.focusNode;n=n.focusOffset;try{a.nodeType,u.nodeType}catch{a=null;break t}var o=0,d=-1,m=-1,E=0,w=0,U=t,A=null;e:for(;;){for(var R;U!==a||i!==0&&U.nodeType!==3||(d=o+i),U!==u||n!==0&&U.nodeType!==3||(m=o+n),U.nodeType===3&&(o+=U.nodeValue.length),(R=U.firstChild)!==null;)A=U,U=R;for(;;){if(U===t)break e;if(A===a&&++E===i&&(d=o),A===u&&++w===n&&(m=o),(R=U.nextSibling)!==null)break;U=A,A=U.parentNode}U=R}a=d===-1||m===-1?null:{start:d,end:m}}else a=null}a=a||{start:0,end:0}}else a=null;for(br={focusedElem:t,selectionRange:a},Qs=!1,Bt=e;Bt!==null;)if(e=Bt,t=e.child,(e.subtreeFlags&1024)!==0&&t!==null)t.return=e,Bt=t;else for(;Bt!==null;){switch(e=Bt,u=e.alternate,t=e.flags,e.tag){case 0:break;case 11:case 15:break;case 1:if((t&1024)!==0&&u!==null){t=void 0,a=e,i=u.memoizedProps,u=u.memoizedState,n=a.stateNode;try{var Z=La(a.type,i,a.elementType===a.type);t=n.getSnapshotBeforeUpdate(Z,u),n.__reactInternalSnapshotBeforeUpdate=t}catch(V){gt(a,a.return,V)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,a=t.nodeType,a===9)Tr(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Tr(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(c(163))}if(t=e.sibling,t!==null){t.return=e.return,Bt=t;break}Bt=e.return}}function If(t,e,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:oa(t,a),n&4&&hl(5,a);break;case 1:if(oa(t,a),n&4)if(t=a.stateNode,e===null)try{t.componentDidMount()}catch(o){gt(a,a.return,o)}else{var i=La(a.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(i,e,t.__reactInternalSnapshotBeforeUpdate)}catch(o){gt(a,a.return,o)}}n&64&&Hf(a),n&512&&ml(a,a.return);break;case 3:if(oa(t,a),n&64&&(t=a.updateQueue,t!==null)){if(e=null,a.child!==null)switch(a.child.tag){case 27:case 5:e=a.child.stateNode;break;case 1:e=a.child.stateNode}try{To(t,e)}catch(o){gt(a,a.return,o)}}break;case 27:e===null&&n&4&&Yf(a);case 26:case 5:oa(t,a),e===null&&n&4&&qf(a),n&512&&ml(a,a.return);break;case 12:oa(t,a);break;case 13:oa(t,a),n&4&&Qf(t,a),n&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=fp.bind(null,a),Cp(t,a))));break;case 22:if(n=a.memoizedState!==null||Ze,!n){e=e!==null&&e.memoizedState!==null||Et,i=Ze;var u=Et;Ze=n,(Et=e)&&!u?fa(t,a,(a.subtreeFlags&8772)!==0):oa(t,a),Ze=i,Et=u}break;case 30:break;default:oa(t,a)}}function Vf(t){var e=t.alternate;e!==null&&(t.alternate=null,Vf(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&Mi(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var yt=null,Pt=!1;function Ke(t,e,a){for(a=a.child;a!==null;)Xf(t,e,a),a=a.sibling}function Xf(t,e,a){if(le&&typeof le.onCommitFiberUnmount=="function")try{le.onCommitFiberUnmount(Bn,a)}catch{}switch(a.tag){case 26:Et||ze(a,e),Ke(t,e,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Et||ze(a,e);var n=yt,i=Pt;va(a.type)&&(yt=a.stateNode,Pt=!1),Ke(t,e,a),El(a.stateNode),yt=n,Pt=i;break;case 5:Et||ze(a,e);case 6:if(n=yt,i=Pt,yt=null,Ke(t,e,a),yt=n,Pt=i,yt!==null)if(Pt)try{(yt.nodeType===9?yt.body:yt.nodeName==="HTML"?yt.ownerDocument.body:yt).removeChild(a.stateNode)}catch(u){gt(a,e,u)}else try{yt.removeChild(a.stateNode)}catch(u){gt(a,e,u)}break;case 18:yt!==null&&(Pt?(t=yt,Dd(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),zl(t)):Dd(yt,a.stateNode));break;case 4:n=yt,i=Pt,yt=a.stateNode.containerInfo,Pt=!0,Ke(t,e,a),yt=n,Pt=i;break;case 0:case 11:case 14:case 15:Et||ca(2,a,e),Et||ca(4,a,e),Ke(t,e,a);break;case 1:Et||(ze(a,e),n=a.stateNode,typeof n.componentWillUnmount=="function"&&jf(a,e,n)),Ke(t,e,a);break;case 21:Ke(t,e,a);break;case 22:Et=(n=Et)||a.memoizedState!==null,Ke(t,e,a),Et=n;break;default:Ke(t,e,a)}}function Qf(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{zl(t)}catch(a){gt(e,e.return,a)}}function np(t){switch(t.tag){case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new Gf),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new Gf),e;default:throw Error(c(435,t.tag))}}function Ju(t,e){var a=np(t);e.forEach(function(n){var i=dp.bind(null,t,n);a.has(n)||(a.add(n),n.then(i,i))})}function re(t,e){var a=e.deletions;if(a!==null)for(var n=0;n<a.length;n++){var i=a[n],u=t,o=e,d=o;t:for(;d!==null;){switch(d.tag){case 27:if(va(d.type)){yt=d.stateNode,Pt=!1;break t}break;case 5:yt=d.stateNode,Pt=!1;break t;case 3:case 4:yt=d.stateNode.containerInfo,Pt=!0;break t}d=d.return}if(yt===null)throw Error(c(160));Xf(u,o,i),yt=null,Pt=!1,u=i.alternate,u!==null&&(u.return=null),i.return=null}if(e.subtreeFlags&13878)for(e=e.child;e!==null;)Zf(e,t),e=e.sibling}var Ae=null;function Zf(t,e){var a=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:re(e,t),ce(t),n&4&&(ca(3,t,t.return),hl(3,t),ca(5,t,t.return));break;case 1:re(e,t),ce(t),n&512&&(Et||a===null||ze(a,a.return)),n&64&&Ze&&(t=t.updateQueue,t!==null&&(n=t.callbacks,n!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var i=Ae;if(re(e,t),ce(t),n&512&&(Et||a===null||ze(a,a.return)),n&4){var u=a!==null?a.memoizedState:null;if(n=t.memoizedState,a===null)if(n===null)if(t.stateNode===null){t:{n=t.type,a=t.memoizedProps,i=i.ownerDocument||i;e:switch(n){case"title":u=i.getElementsByTagName("title")[0],(!u||u[qn]||u[Xt]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=i.createElement(n),i.head.insertBefore(u,i.querySelector("head > title"))),Gt(u,n,a),u[Xt]=t,Ut(u),n=u;break t;case"link":var o=Yd("link","href",i).get(n+(a.href||""));if(o){for(var d=0;d<o.length;d++)if(u=o[d],u.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&u.getAttribute("rel")===(a.rel==null?null:a.rel)&&u.getAttribute("title")===(a.title==null?null:a.title)&&u.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){o.splice(d,1);break e}}u=i.createElement(n),Gt(u,n,a),i.head.appendChild(u);break;case"meta":if(o=Yd("meta","content",i).get(n+(a.content||""))){for(d=0;d<o.length;d++)if(u=o[d],u.getAttribute("content")===(a.content==null?null:""+a.content)&&u.getAttribute("name")===(a.name==null?null:a.name)&&u.getAttribute("property")===(a.property==null?null:a.property)&&u.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&u.getAttribute("charset")===(a.charSet==null?null:a.charSet)){o.splice(d,1);break e}}u=i.createElement(n),Gt(u,n,a),i.head.appendChild(u);break;default:throw Error(c(468,n))}u[Xt]=t,Ut(u),n=u}t.stateNode=n}else Gd(i,t.type,t.stateNode);else t.stateNode=Ld(i,n,t.memoizedProps);else u!==n?(u===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):u.count--,n===null?Gd(i,t.type,t.stateNode):Ld(i,n,t.memoizedProps)):n===null&&t.stateNode!==null&&Qu(t,t.memoizedProps,a.memoizedProps)}break;case 27:re(e,t),ce(t),n&512&&(Et||a===null||ze(a,a.return)),a!==null&&n&4&&Qu(t,t.memoizedProps,a.memoizedProps);break;case 5:if(re(e,t),ce(t),n&512&&(Et||a===null||ze(a,a.return)),t.flags&32){i=t.stateNode;try{Fa(i,"")}catch(R){gt(t,t.return,R)}}n&4&&t.stateNode!=null&&(i=t.memoizedProps,Qu(t,i,a!==null?a.memoizedProps:i)),n&1024&&(ku=!0);break;case 6:if(re(e,t),ce(t),n&4){if(t.stateNode===null)throw Error(c(162));n=t.memoizedProps,a=t.stateNode;try{a.nodeValue=n}catch(R){gt(t,t.return,R)}}break;case 3:if(Is=null,i=Ae,Ae=Ys(e.containerInfo),re(e,t),Ae=i,ce(t),n&4&&a!==null&&a.memoizedState.isDehydrated)try{zl(e.containerInfo)}catch(R){gt(t,t.return,R)}ku&&(ku=!1,Kf(t));break;case 4:n=Ae,Ae=Ys(t.stateNode.containerInfo),re(e,t),ce(t),Ae=n;break;case 12:re(e,t),ce(t);break;case 13:re(e,t),ce(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(er=we()),n&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,Ju(t,n)));break;case 22:i=t.memoizedState!==null;var m=a!==null&&a.memoizedState!==null,E=Ze,w=Et;if(Ze=E||i,Et=w||m,re(e,t),Et=w,Ze=E,ce(t),n&8192)t:for(e=t.stateNode,e._visibility=i?e._visibility&-2:e._visibility|1,i&&(a===null||m||Ze||Et||Ya(t)),a=null,e=t;;){if(e.tag===5||e.tag===26){if(a===null){m=a=e;try{if(u=m.stateNode,i)o=u.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{d=m.stateNode;var U=m.memoizedProps.style,A=U!=null&&U.hasOwnProperty("display")?U.display:null;d.style.display=A==null||typeof A=="boolean"?"":(""+A).trim()}}catch(R){gt(m,m.return,R)}}}else if(e.tag===6){if(a===null){m=e;try{m.stateNode.nodeValue=i?"":m.memoizedProps}catch(R){gt(m,m.return,R)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break t;for(;e.sibling===null;){if(e.return===null||e.return===t)break t;a===e&&(a=null),e=e.return}a===e&&(a=null),e.sibling.return=e.return,e=e.sibling}n&4&&(n=t.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,Ju(t,a))));break;case 19:re(e,t),ce(t),n&4&&(n=t.updateQueue,n!==null&&(t.updateQueue=null,Ju(t,n)));break;case 30:break;case 21:break;default:re(e,t),ce(t)}}function ce(t){var e=t.flags;if(e&2){try{for(var a,n=t.return;n!==null;){if(Lf(n)){a=n;break}n=n.return}if(a==null)throw Error(c(160));switch(a.tag){case 27:var i=a.stateNode,u=Zu(t);Ms(t,u,i);break;case 5:var o=a.stateNode;a.flags&32&&(Fa(o,""),a.flags&=-33);var d=Zu(t);Ms(t,d,o);break;case 3:case 4:var m=a.stateNode.containerInfo,E=Zu(t);Ku(t,E,m);break;default:throw Error(c(161))}}catch(w){gt(t,t.return,w)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function Kf(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;Kf(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function oa(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)If(t,e.alternate,e),e=e.sibling}function Ya(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:ca(4,e,e.return),Ya(e);break;case 1:ze(e,e.return);var a=e.stateNode;typeof a.componentWillUnmount=="function"&&jf(e,e.return,a),Ya(e);break;case 27:El(e.stateNode);case 26:case 5:ze(e,e.return),Ya(e);break;case 22:e.memoizedState===null&&Ya(e);break;case 30:Ya(e);break;default:Ya(e)}t=t.sibling}}function fa(t,e,a){for(a=a&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var n=e.alternate,i=t,u=e,o=u.flags;switch(u.tag){case 0:case 11:case 15:fa(i,u,a),hl(4,u);break;case 1:if(fa(i,u,a),n=u,i=n.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(E){gt(n,n.return,E)}if(n=u,i=n.updateQueue,i!==null){var d=n.stateNode;try{var m=i.shared.hiddenCallbacks;if(m!==null)for(i.shared.hiddenCallbacks=null,i=0;i<m.length;i++)_o(m[i],d)}catch(E){gt(n,n.return,E)}}a&&o&64&&Hf(u),ml(u,u.return);break;case 27:Yf(u);case 26:case 5:fa(i,u,a),a&&n===null&&o&4&&qf(u),ml(u,u.return);break;case 12:fa(i,u,a);break;case 13:fa(i,u,a),a&&o&4&&Qf(i,u);break;case 22:u.memoizedState===null&&fa(i,u,a),ml(u,u.return);break;case 30:break;default:fa(i,u,a)}e=e.sibling}}function $u(t,e){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&Pn(a))}function Fu(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Pn(t))}function De(t,e,a,n){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)kf(t,e,a,n),e=e.sibling}function kf(t,e,a,n){var i=e.flags;switch(e.tag){case 0:case 11:case 15:De(t,e,a,n),i&2048&&hl(9,e);break;case 1:De(t,e,a,n);break;case 3:De(t,e,a,n),i&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Pn(t)));break;case 12:if(i&2048){De(t,e,a,n),t=e.stateNode;try{var u=e.memoizedProps,o=u.id,d=u.onPostCommit;typeof d=="function"&&d(o,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(m){gt(e,e.return,m)}}else De(t,e,a,n);break;case 13:De(t,e,a,n);break;case 23:break;case 22:u=e.stateNode,o=e.alternate,e.memoizedState!==null?u._visibility&2?De(t,e,a,n):gl(t,e):u._visibility&2?De(t,e,a,n):(u._visibility|=2,vn(t,e,a,n,(e.subtreeFlags&10256)!==0)),i&2048&&$u(o,e);break;case 24:De(t,e,a,n),i&2048&&Fu(e.alternate,e);break;default:De(t,e,a,n)}}function vn(t,e,a,n,i){for(i=i&&(e.subtreeFlags&10256)!==0,e=e.child;e!==null;){var u=t,o=e,d=a,m=n,E=o.flags;switch(o.tag){case 0:case 11:case 15:vn(u,o,d,m,i),hl(8,o);break;case 23:break;case 22:var w=o.stateNode;o.memoizedState!==null?w._visibility&2?vn(u,o,d,m,i):gl(u,o):(w._visibility|=2,vn(u,o,d,m,i)),i&&E&2048&&$u(o.alternate,o);break;case 24:vn(u,o,d,m,i),i&&E&2048&&Fu(o.alternate,o);break;default:vn(u,o,d,m,i)}e=e.sibling}}function gl(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var a=t,n=e,i=n.flags;switch(n.tag){case 22:gl(a,n),i&2048&&$u(n.alternate,n);break;case 24:gl(a,n),i&2048&&Fu(n.alternate,n);break;default:gl(a,n)}e=e.sibling}}var pl=8192;function yn(t){if(t.subtreeFlags&pl)for(t=t.child;t!==null;)Jf(t),t=t.sibling}function Jf(t){switch(t.tag){case 26:yn(t),t.flags&pl&&t.memoizedState!==null&&Ip(Ae,t.memoizedState,t.memoizedProps);break;case 5:yn(t);break;case 3:case 4:var e=Ae;Ae=Ys(t.stateNode.containerInfo),yn(t),Ae=e;break;case 22:t.memoizedState===null&&(e=t.alternate,e!==null&&e.memoizedState!==null?(e=pl,pl=16777216,yn(t),pl=e):yn(t));break;default:yn(t)}}function $f(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function vl(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var a=0;a<e.length;a++){var n=e[a];Bt=n,Wf(n,t)}$f(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ff(t),t=t.sibling}function Ff(t){switch(t.tag){case 0:case 11:case 15:vl(t),t.flags&2048&&ca(9,t,t.return);break;case 3:vl(t);break;case 12:vl(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,ws(t)):vl(t);break;default:vl(t)}}function ws(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var a=0;a<e.length;a++){var n=e[a];Bt=n,Wf(n,t)}$f(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:ca(8,e,e.return),ws(e);break;case 22:a=e.stateNode,a._visibility&2&&(a._visibility&=-3,ws(e));break;default:ws(e)}t=t.sibling}}function Wf(t,e){for(;Bt!==null;){var a=Bt;switch(a.tag){case 0:case 11:case 15:ca(8,a,e);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:Pn(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,Bt=n;else t:for(a=t;Bt!==null;){n=Bt;var i=n.sibling,u=n.return;if(Vf(n),n===a){Bt=null;break t}if(i!==null){i.return=u,Bt=i;break t}Bt=u}}}var lp={getCacheForType:function(t){var e=Qt(Ct),a=e.data.get(t);return a===void 0&&(a=t(),e.data.set(t,a)),a}},sp=typeof WeakMap=="function"?WeakMap:Map,ct=0,pt=null,tt=null,at=0,ot=0,oe=null,da=!1,bn=!1,Wu=!1,ke=0,_t=0,ha=0,Ga=0,Pu=0,Se=0,Sn=0,yl=null,te=null,tr=!1,er=0,Cs=1/0,Os=null,ma=null,Yt=0,ga=null,_n=null,Tn=0,ar=0,nr=null,Pf=null,bl=0,lr=null;function fe(){if((ct&2)!==0&&at!==0)return at&-at;if(C.T!==null){var t=cn;return t!==0?t:fr()}return hc()}function td(){Se===0&&(Se=(at&536870912)===0||ut?cc():536870912);var t=be.current;return t!==null&&(t.flags|=32),Se}function de(t,e,a){(t===pt&&(ot===2||ot===9)||t.cancelPendingCommit!==null)&&(En(t,0),pa(t,at,Se,!1)),jn(t,a),((ct&2)===0||t!==pt)&&(t===pt&&((ct&2)===0&&(Ga|=a),_t===4&&pa(t,at,Se,!1)),Ue(t))}function ed(t,e,a){if((ct&6)!==0)throw Error(c(327));var n=!a&&(e&124)===0&&(e&t.expiredLanes)===0||Hn(t,e),i=n?rp(t,e):ur(t,e,!0),u=n;do{if(i===0){bn&&!n&&pa(t,e,0,!1);break}else{if(a=t.current.alternate,u&&!ip(a)){i=ur(t,e,!1),u=!1;continue}if(i===2){if(u=e,t.errorRecoveryDisabledLanes&u)var o=0;else o=t.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){e=o;t:{var d=t;i=yl;var m=d.current.memoizedState.isDehydrated;if(m&&(En(d,o).flags|=256),o=ur(d,o,!1),o!==2){if(Wu&&!m){d.errorRecoveryDisabledLanes|=u,Ga|=u,i=4;break t}u=te,te=i,u!==null&&(te===null?te=u:te.push.apply(te,u))}i=o}if(u=!1,i!==2)continue}}if(i===1){En(t,0),pa(t,e,0,!0);break}t:{switch(n=t,u=i,u){case 0:case 1:throw Error(c(345));case 4:if((e&4194048)!==e)break;case 6:pa(n,e,Se,!da);break t;case 2:te=null;break;case 3:case 5:break;default:throw Error(c(329))}if((e&62914560)===e&&(i=er+300-we(),10<i)){if(pa(n,e,Se,!da),Gl(n,0,!0)!==0)break t;n.timeoutHandle=Od(ad.bind(null,n,a,te,Os,tr,e,Se,Ga,Sn,da,u,2,-0,0),i);break t}ad(n,a,te,Os,tr,e,Se,Ga,Sn,da,u,0,-0,0)}}break}while(!0);Ue(t)}function ad(t,e,a,n,i,u,o,d,m,E,w,U,A,R){if(t.timeoutHandle=-1,U=e.subtreeFlags,(U&8192||(U&16785408)===16785408)&&(xl={stylesheets:null,count:0,unsuspend:Gp},Jf(e),U=Vp(),U!==null)){t.cancelPendingCommit=U(cd.bind(null,t,e,u,a,n,i,o,d,m,w,1,A,R)),pa(t,u,o,!E);return}cd(t,e,u,a,n,i,o,d,m)}function ip(t){for(var e=t;;){var a=e.tag;if((a===0||a===11||a===15)&&e.flags&16384&&(a=e.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var i=a[n],u=i.getSnapshot;i=i.value;try{if(!ie(u(),i))return!1}catch{return!1}}if(a=e.child,e.subtreeFlags&16384&&a!==null)a.return=e,e=a;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function pa(t,e,a,n){e&=~Pu,e&=~Ga,t.suspendedLanes|=e,t.pingedLanes&=~e,n&&(t.warmLanes|=e),n=t.expirationTimes;for(var i=e;0<i;){var u=31-se(i),o=1<<u;n[u]=-1,i&=~o}a!==0&&fc(t,a,e)}function zs(){return(ct&6)===0?(Sl(0),!1):!0}function sr(){if(tt!==null){if(ot===0)var t=tt.return;else t=tt,Ye=Ba=null,Tu(t),gn=null,ol=0,t=tt;for(;t!==null;)Bf(t.alternate,t),t=t.return;tt=null}}function En(t,e){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,Ap(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),sr(),pt=t,tt=a=je(t.current,null),at=e,ot=0,oe=null,da=!1,bn=Hn(t,e),Wu=!1,Sn=Se=Pu=Ga=ha=_t=0,te=yl=null,tr=!1,(e&8)!==0&&(e|=e&32);var n=t.entangledLanes;if(n!==0)for(t=t.entanglements,n&=e;0<n;){var i=31-se(n),u=1<<i;e|=t[i],n&=~u}return ke=e,Pl(),a}function nd(t,e){F=null,C.H=ys,e===el||e===rs?(e=bo(),ot=3):e===po?(e=bo(),ot=4):ot=e===_f?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,oe=e,tt===null&&(_t=1,Es(t,ge(e,t.current)))}function ld(){var t=C.H;return C.H=ys,t===null?ys:t}function sd(){var t=C.A;return C.A=lp,t}function ir(){_t=4,da||(at&4194048)!==at&&be.current!==null||(bn=!0),(ha&134217727)===0&&(Ga&134217727)===0||pt===null||pa(pt,at,Se,!1)}function ur(t,e,a){var n=ct;ct|=2;var i=ld(),u=sd();(pt!==t||at!==e)&&(Os=null,En(t,e)),e=!1;var o=_t;t:do try{if(ot!==0&&tt!==null){var d=tt,m=oe;switch(ot){case 8:sr(),o=6;break t;case 3:case 2:case 9:case 6:be.current===null&&(e=!0);var E=ot;if(ot=0,oe=null,An(t,d,m,E),a&&bn){o=0;break t}break;default:E=ot,ot=0,oe=null,An(t,d,m,E)}}up(),o=_t;break}catch(w){nd(t,w)}while(!0);return e&&t.shellSuspendCounter++,Ye=Ba=null,ct=n,C.H=i,C.A=u,tt===null&&(pt=null,at=0,Pl()),o}function up(){for(;tt!==null;)id(tt)}function rp(t,e){var a=ct;ct|=2;var n=ld(),i=sd();pt!==t||at!==e?(Os=null,Cs=we()+500,En(t,e)):bn=Hn(t,e);t:do try{if(ot!==0&&tt!==null){e=tt;var u=oe;e:switch(ot){case 1:ot=0,oe=null,An(t,e,u,1);break;case 2:case 9:if(vo(u)){ot=0,oe=null,ud(e);break}e=function(){ot!==2&&ot!==9||pt!==t||(ot=7),Ue(t)},u.then(e,e);break t;case 3:ot=7;break t;case 4:ot=5;break t;case 7:vo(u)?(ot=0,oe=null,ud(e)):(ot=0,oe=null,An(t,e,u,7));break;case 5:var o=null;switch(tt.tag){case 26:o=tt.memoizedState;case 5:case 27:var d=tt;if(!o||Id(o)){ot=0,oe=null;var m=d.sibling;if(m!==null)tt=m;else{var E=d.return;E!==null?(tt=E,Ds(E)):tt=null}break e}}ot=0,oe=null,An(t,e,u,5);break;case 6:ot=0,oe=null,An(t,e,u,6);break;case 8:sr(),_t=6;break t;default:throw Error(c(462))}}cp();break}catch(w){nd(t,w)}while(!0);return Ye=Ba=null,C.H=n,C.A=i,ct=a,tt!==null?0:(pt=null,at=0,Pl(),_t)}function cp(){for(;tt!==null&&!zm();)id(tt)}function id(t){var e=Uf(t.alternate,t,ke);t.memoizedProps=t.pendingProps,e===null?Ds(t):tt=e}function ud(t){var e=t,a=e.alternate;switch(e.tag){case 15:case 0:e=Mf(a,e,e.pendingProps,e.type,void 0,at);break;case 11:e=Mf(a,e,e.pendingProps,e.type.render,e.ref,at);break;case 5:Tu(e);default:Bf(a,e),e=tt=io(e,ke),e=Uf(a,e,ke)}t.memoizedProps=t.pendingProps,e===null?Ds(t):tt=e}function An(t,e,a,n){Ye=Ba=null,Tu(e),gn=null,ol=0;var i=e.return;try{if(Wg(t,i,e,a,at)){_t=1,Es(t,ge(a,t.current)),tt=null;return}}catch(u){if(i!==null)throw tt=i,u;_t=1,Es(t,ge(a,t.current)),tt=null;return}e.flags&32768?(ut||n===1?t=!0:bn||(at&536870912)!==0?t=!1:(da=t=!0,(n===2||n===9||n===3||n===6)&&(n=be.current,n!==null&&n.tag===13&&(n.flags|=16384))),rd(e,t)):Ds(e)}function Ds(t){var e=t;do{if((e.flags&32768)!==0){rd(e,da);return}t=e.return;var a=tp(e.alternate,e,ke);if(a!==null){tt=a;return}if(e=e.sibling,e!==null){tt=e;return}tt=e=t}while(e!==null);_t===0&&(_t=5)}function rd(t,e){do{var a=ep(t.alternate,t);if(a!==null){a.flags&=32767,tt=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!e&&(t=t.sibling,t!==null)){tt=t;return}tt=t=a}while(t!==null);_t=6,tt=null}function cd(t,e,a,n,i,u,o,d,m){t.cancelPendingCommit=null;do Us();while(Yt!==0);if((ct&6)!==0)throw Error(c(327));if(e!==null){if(e===t.current)throw Error(c(177));if(u=e.lanes|e.childLanes,u|=Fi,Gm(t,a,u,o,d,m),t===pt&&(tt=pt=null,at=0),_n=e,ga=t,Tn=a,ar=u,nr=i,Pf=n,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,hp(ql,function(){return md(),null})):(t.callbackNode=null,t.callbackPriority=0),n=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||n){n=C.T,C.T=null,i=q.p,q.p=2,o=ct,ct|=4;try{ap(t,e,a)}finally{ct=o,q.p=i,C.T=n}}Yt=1,od(),fd(),dd()}}function od(){if(Yt===1){Yt=0;var t=ga,e=_n,a=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||a){a=C.T,C.T=null;var n=q.p;q.p=2;var i=ct;ct|=4;try{Zf(e,t);var u=br,o=$c(t.containerInfo),d=u.focusedElem,m=u.selectionRange;if(o!==d&&d&&d.ownerDocument&&Jc(d.ownerDocument.documentElement,d)){if(m!==null&&Zi(d)){var E=m.start,w=m.end;if(w===void 0&&(w=E),"selectionStart"in d)d.selectionStart=E,d.selectionEnd=Math.min(w,d.value.length);else{var U=d.ownerDocument||document,A=U&&U.defaultView||window;if(A.getSelection){var R=A.getSelection(),Z=d.textContent.length,V=Math.min(m.start,Z),ht=m.end===void 0?V:Math.min(m.end,Z);!R.extend&&V>ht&&(o=ht,ht=V,V=o);var b=kc(d,V),p=kc(d,ht);if(b&&p&&(R.rangeCount!==1||R.anchorNode!==b.node||R.anchorOffset!==b.offset||R.focusNode!==p.node||R.focusOffset!==p.offset)){var _=U.createRange();_.setStart(b.node,b.offset),R.removeAllRanges(),V>ht?(R.addRange(_),R.extend(p.node,p.offset)):(_.setEnd(p.node,p.offset),R.addRange(_))}}}}for(U=[],R=d;R=R.parentNode;)R.nodeType===1&&U.push({element:R,left:R.scrollLeft,top:R.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d<U.length;d++){var z=U[d];z.element.scrollLeft=z.left,z.element.scrollTop=z.top}}Qs=!!yr,br=yr=null}finally{ct=i,q.p=n,C.T=a}}t.current=e,Yt=2}}function fd(){if(Yt===2){Yt=0;var t=ga,e=_n,a=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||a){a=C.T,C.T=null;var n=q.p;q.p=2;var i=ct;ct|=4;try{If(t,e.alternate,e)}finally{ct=i,q.p=n,C.T=a}}Yt=3}}function dd(){if(Yt===4||Yt===3){Yt=0,Dm();var t=ga,e=_n,a=Tn,n=Pf;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?Yt=5:(Yt=0,_n=ga=null,hd(t,t.pendingLanes));var i=t.pendingLanes;if(i===0&&(ma=null),Ri(a),e=e.stateNode,le&&typeof le.onCommitFiberRoot=="function")try{le.onCommitFiberRoot(Bn,e,void 0,(e.current.flags&128)===128)}catch{}if(n!==null){e=C.T,i=q.p,q.p=2,C.T=null;try{for(var u=t.onRecoverableError,o=0;o<n.length;o++){var d=n[o];u(d.value,{componentStack:d.stack})}}finally{C.T=e,q.p=i}}(Tn&3)!==0&&Us(),Ue(t),i=t.pendingLanes,(a&4194090)!==0&&(i&42)!==0?t===lr?bl++:(bl=0,lr=t):bl=0,Sl(0)}}function hd(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Pn(e)))}function Us(t){return od(),fd(),dd(),md()}function md(){if(Yt!==5)return!1;var t=ga,e=ar;ar=0;var a=Ri(Tn),n=C.T,i=q.p;try{q.p=32>a?32:a,C.T=null,a=nr,nr=null;var u=ga,o=Tn;if(Yt=0,_n=ga=null,Tn=0,(ct&6)!==0)throw Error(c(331));var d=ct;if(ct|=4,Ff(u.current),kf(u,u.current,o,a),ct=d,Sl(0,!1),le&&typeof le.onPostCommitFiberRoot=="function")try{le.onPostCommitFiberRoot(Bn,u)}catch{}return!0}finally{q.p=i,C.T=n,hd(t,e)}}function gd(t,e,a){e=ge(a,e),e=Hu(t.stateNode,e,2),t=sa(t,e,2),t!==null&&(jn(t,2),Ue(t))}function gt(t,e,a){if(t.tag===3)gd(t,t,a);else for(;e!==null;){if(e.tag===3){gd(e,t,a);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(ma===null||!ma.has(n))){t=ge(a,t),a=bf(2),n=sa(e,a,2),n!==null&&(Sf(a,n,e,t),jn(n,2),Ue(n));break}}e=e.return}}function rr(t,e,a){var n=t.pingCache;if(n===null){n=t.pingCache=new sp;var i=new Set;n.set(e,i)}else i=n.get(e),i===void 0&&(i=new Set,n.set(e,i));i.has(a)||(Wu=!0,i.add(a),t=op.bind(null,t,e,a),e.then(t,t))}function op(t,e,a){var n=t.pingCache;n!==null&&n.delete(e),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,pt===t&&(at&a)===a&&(_t===4||_t===3&&(at&62914560)===at&&300>we()-er?(ct&2)===0&&En(t,0):Pu|=a,Sn===at&&(Sn=0)),Ue(t)}function pd(t,e){e===0&&(e=oc()),t=ln(t,e),t!==null&&(jn(t,e),Ue(t))}function fp(t){var e=t.memoizedState,a=0;e!==null&&(a=e.retryLane),pd(t,a)}function dp(t,e){var a=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(a=i.retryLane);break;case 19:n=t.stateNode;break;case 22:n=t.stateNode._retryCache;break;default:throw Error(c(314))}n!==null&&n.delete(e),pd(t,a)}function hp(t,e){return _i(t,e)}var Ns=null,Rn=null,cr=!1,Bs=!1,or=!1,Ia=0;function Ue(t){t!==Rn&&t.next===null&&(Rn===null?Ns=Rn=t:Rn=Rn.next=t),Bs=!0,cr||(cr=!0,gp())}function Sl(t,e){if(!or&&Bs){or=!0;do for(var a=!1,n=Ns;n!==null;){if(t!==0){var i=n.pendingLanes;if(i===0)var u=0;else{var o=n.suspendedLanes,d=n.pingedLanes;u=(1<<31-se(42|t)+1)-1,u&=i&~(o&~d),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(a=!0,Sd(n,u))}else u=at,u=Gl(n,n===pt?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(u&3)===0||Hn(n,u)||(a=!0,Sd(n,u));n=n.next}while(a);or=!1}}function mp(){vd()}function vd(){Bs=cr=!1;var t=0;Ia!==0&&(Ep()&&(t=Ia),Ia=0);for(var e=we(),a=null,n=Ns;n!==null;){var i=n.next,u=yd(n,e);u===0?(n.next=null,a===null?Ns=i:a.next=i,i===null&&(Rn=a)):(a=n,(t!==0||(u&3)!==0)&&(Bs=!0)),n=i}Sl(t)}function yd(t,e){for(var a=t.suspendedLanes,n=t.pingedLanes,i=t.expirationTimes,u=t.pendingLanes&-62914561;0<u;){var o=31-se(u),d=1<<o,m=i[o];m===-1?((d&a)===0||(d&n)!==0)&&(i[o]=Ym(d,e)):m<=e&&(t.expiredLanes|=d),u&=~d}if(e=pt,a=at,a=Gl(t,t===e?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),n=t.callbackNode,a===0||t===e&&(ot===2||ot===9)||t.cancelPendingCommit!==null)return n!==null&&n!==null&&Ti(n),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||Hn(t,a)){if(e=a&-a,e===t.callbackPriority)return e;switch(n!==null&&Ti(n),Ri(a)){case 2:case 8:a=uc;break;case 32:a=ql;break;case 268435456:a=rc;break;default:a=ql}return n=bd.bind(null,t),a=_i(a,n),t.callbackPriority=e,t.callbackNode=a,e}return n!==null&&n!==null&&Ti(n),t.callbackPriority=2,t.callbackNode=null,2}function bd(t,e){if(Yt!==0&&Yt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Us()&&t.callbackNode!==a)return null;var n=at;return n=Gl(t,t===pt?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),n===0?null:(ed(t,n,e),yd(t,we()),t.callbackNode!=null&&t.callbackNode===a?bd.bind(null,t):null)}function Sd(t,e){if(Us())return null;ed(t,e,!0)}function gp(){Rp(function(){(ct&6)!==0?_i(ic,mp):vd()})}function fr(){return Ia===0&&(Ia=cc()),Ia}function _d(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Zl(""+t)}function Td(t,e){var a=e.ownerDocument.createElement("input");return a.name=e.name,a.value=e.value,t.id&&a.setAttribute("form",t.id),e.parentNode.insertBefore(a,e),t=new FormData(t),a.parentNode.removeChild(a),t}function pp(t,e,a,n,i){if(e==="submit"&&a&&a.stateNode===i){var u=_d((i[$t]||null).action),o=n.submitter;o&&(e=(e=o[$t]||null)?_d(e.formAction):o.getAttribute("formAction"),e!==null&&(u=e,o=null));var d=new $l("action","action",null,n,i);t.push({event:d,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Ia!==0){var m=o?Td(i,o):new FormData(i);zu(a,{pending:!0,data:m,method:i.method,action:u},null,m)}}else typeof u=="function"&&(d.preventDefault(),m=o?Td(i,o):new FormData(i),zu(a,{pending:!0,data:m,method:i.method,action:u},u,m))},currentTarget:i}]})}}for(var dr=0;dr<$i.length;dr++){var hr=$i[dr],vp=hr.toLowerCase(),yp=hr[0].toUpperCase()+hr.slice(1);Ee(vp,"on"+yp)}Ee(Pc,"onAnimationEnd"),Ee(to,"onAnimationIteration"),Ee(eo,"onAnimationStart"),Ee("dblclick","onDoubleClick"),Ee("focusin","onFocus"),Ee("focusout","onBlur"),Ee(Bg,"onTransitionRun"),Ee(Hg,"onTransitionStart"),Ee(jg,"onTransitionCancel"),Ee(ao,"onTransitionEnd"),ka("onMouseEnter",["mouseout","mouseover"]),ka("onMouseLeave",["mouseout","mouseover"]),ka("onPointerEnter",["pointerout","pointerover"]),ka("onPointerLeave",["pointerout","pointerover"]),xa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xa("onBeforeInput",["compositionend","keypress","textInput","paste"]),xa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _l="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(" "),bp=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(_l));function Ed(t,e){e=(e&4)!==0;for(var a=0;a<t.length;a++){var n=t[a],i=n.event;n=n.listeners;t:{var u=void 0;if(e)for(var o=n.length-1;0<=o;o--){var d=n[o],m=d.instance,E=d.currentTarget;if(d=d.listener,m!==u&&i.isPropagationStopped())break t;u=d,i.currentTarget=E;try{u(i)}catch(w){Ts(w)}i.currentTarget=null,u=m}else for(o=0;o<n.length;o++){if(d=n[o],m=d.instance,E=d.currentTarget,d=d.listener,m!==u&&i.isPropagationStopped())break t;u=d,i.currentTarget=E;try{u(i)}catch(w){Ts(w)}i.currentTarget=null,u=m}}}}function et(t,e){var a=e[xi];a===void 0&&(a=e[xi]=new Set);var n=t+"__bubble";a.has(n)||(Ad(e,t,2,!1),a.add(n))}function mr(t,e,a){var n=0;e&&(n|=4),Ad(a,t,n,e)}var Hs="_reactListening"+Math.random().toString(36).slice(2);function gr(t){if(!t[Hs]){t[Hs]=!0,gc.forEach(function(a){a!=="selectionchange"&&(bp.has(a)||mr(a,!1,t),mr(a,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Hs]||(e[Hs]=!0,mr("selectionchange",!1,e))}}function Ad(t,e,a,n){switch(kd(e)){case 2:var i=Zp;break;case 8:i=Kp;break;default:i=Cr}a=i.bind(null,e,a,t),i=void 0,!ji||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),n?i!==void 0?t.addEventListener(e,a,{capture:!0,passive:i}):t.addEventListener(e,a,!0):i!==void 0?t.addEventListener(e,a,{passive:i}):t.addEventListener(e,a,!1)}function pr(t,e,a,n,i){var u=n;if((e&1)===0&&(e&2)===0&&n!==null)t:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var d=n.stateNode.containerInfo;if(d===i)break;if(o===4)for(o=n.return;o!==null;){var m=o.tag;if((m===3||m===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;d!==null;){if(o=Qa(d),o===null)return;if(m=o.tag,m===5||m===6||m===26||m===27){n=u=o;continue t}d=d.parentNode}}n=n.return}Cc(function(){var E=u,w=Bi(a),U=[];t:{var A=no.get(t);if(A!==void 0){var R=$l,Z=t;switch(t){case"keypress":if(kl(a)===0)break t;case"keydown":case"keyup":R=hg;break;case"focusin":Z="focus",R=Gi;break;case"focusout":Z="blur",R=Gi;break;case"beforeblur":case"afterblur":R=Gi;break;case"click":if(a.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":R=Dc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":R=eg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":R=pg;break;case Pc:case to:case eo:R=lg;break;case ao:R=yg;break;case"scroll":case"scrollend":R=Pm;break;case"wheel":R=Sg;break;case"copy":case"cut":case"paste":R=ig;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":R=Nc;break;case"toggle":case"beforetoggle":R=Tg}var V=(e&4)!==0,ht=!V&&(t==="scroll"||t==="scrollend"),b=V?A!==null?A+"Capture":null:A;V=[];for(var p=E,_;p!==null;){var z=p;if(_=z.stateNode,z=z.tag,z!==5&&z!==26&&z!==27||_===null||b===null||(z=Yn(p,b),z!=null&&V.push(Tl(p,z,_))),ht)break;p=p.return}0<V.length&&(A=new R(A,Z,null,a,w),U.push({event:A,listeners:V}))}}if((e&7)===0){t:{if(A=t==="mouseover"||t==="pointerover",R=t==="mouseout"||t==="pointerout",A&&a!==Ni&&(Z=a.relatedTarget||a.fromElement)&&(Qa(Z)||Z[Xa]))break t;if((R||A)&&(A=w.window===w?w:(A=w.ownerDocument)?A.defaultView||A.parentWindow:window,R?(Z=a.relatedTarget||a.toElement,R=E,Z=Z?Qa(Z):null,Z!==null&&(ht=h(Z),V=Z.tag,Z!==ht||V!==5&&V!==27&&V!==6)&&(Z=null)):(R=null,Z=E),R!==Z)){if(V=Dc,z="onMouseLeave",b="onMouseEnter",p="mouse",(t==="pointerout"||t==="pointerover")&&(V=Nc,z="onPointerLeave",b="onPointerEnter",p="pointer"),ht=R==null?A:Ln(R),_=Z==null?A:Ln(Z),A=new V(z,p+"leave",R,a,w),A.target=ht,A.relatedTarget=_,z=null,Qa(w)===E&&(V=new V(b,p+"enter",Z,a,w),V.target=_,V.relatedTarget=ht,z=V),ht=z,R&&Z)e:{for(V=R,b=Z,p=0,_=V;_;_=xn(_))p++;for(_=0,z=b;z;z=xn(z))_++;for(;0<p-_;)V=xn(V),p--;for(;0<_-p;)b=xn(b),_--;for(;p--;){if(V===b||b!==null&&V===b.alternate)break e;V=xn(V),b=xn(b)}V=null}else V=null;R!==null&&Rd(U,A,R,V,!1),Z!==null&&ht!==null&&Rd(U,ht,Z,V,!0)}}t:{if(A=E?Ln(E):window,R=A.nodeName&&A.nodeName.toLowerCase(),R==="select"||R==="input"&&A.type==="file")var Y=Ic;else if(Yc(A))if(Vc)Y=Dg;else{Y=Og;var W=Cg}else R=A.nodeName,!R||R.toLowerCase()!=="input"||A.type!=="checkbox"&&A.type!=="radio"?E&&Ui(E.elementType)&&(Y=Ic):Y=zg;if(Y&&(Y=Y(t,E))){Gc(U,Y,a,w);break t}W&&W(t,A,E),t==="focusout"&&E&&A.type==="number"&&E.memoizedProps.value!=null&&Di(A,"number",A.value)}switch(W=E?Ln(E):window,t){case"focusin":(Yc(W)||W.contentEditable==="true")&&(en=W,Ki=E,kn=null);break;case"focusout":kn=Ki=en=null;break;case"mousedown":ki=!0;break;case"contextmenu":case"mouseup":case"dragend":ki=!1,Fc(U,a,w);break;case"selectionchange":if(Ng)break;case"keydown":case"keyup":Fc(U,a,w)}var G;if(Vi)t:{switch(t){case"compositionstart":var X="onCompositionStart";break t;case"compositionend":X="onCompositionEnd";break t;case"compositionupdate":X="onCompositionUpdate";break t}X=void 0}else tn?qc(t,a)&&(X="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(X="onCompositionStart");X&&(Bc&&a.locale!=="ko"&&(tn||X!=="onCompositionStart"?X==="onCompositionEnd"&&tn&&(G=Oc()):(ea=w,qi="value"in ea?ea.value:ea.textContent,tn=!0)),W=js(E,X),0<W.length&&(X=new Uc(X,t,null,a,w),U.push({event:X,listeners:W}),G?X.data=G:(G=Lc(a),G!==null&&(X.data=G)))),(G=Ag?Rg(t,a):xg(t,a))&&(X=js(E,"onBeforeInput"),0<X.length&&(W=new Uc("onBeforeInput","beforeinput",null,a,w),U.push({event:W,listeners:X}),W.data=G)),pp(U,t,E,a,w)}Ed(U,e)})}function Tl(t,e,a){return{instance:t,listener:e,currentTarget:a}}function js(t,e){for(var a=e+"Capture",n=[];t!==null;){var i=t,u=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||u===null||(i=Yn(t,a),i!=null&&n.unshift(Tl(t,i,u)),i=Yn(t,e),i!=null&&n.push(Tl(t,i,u))),t.tag===3)return n;t=t.return}return[]}function xn(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Rd(t,e,a,n,i){for(var u=e._reactName,o=[];a!==null&&a!==n;){var d=a,m=d.alternate,E=d.stateNode;if(d=d.tag,m!==null&&m===n)break;d!==5&&d!==26&&d!==27||E===null||(m=E,i?(E=Yn(a,u),E!=null&&o.unshift(Tl(a,E,m))):i||(E=Yn(a,u),E!=null&&o.push(Tl(a,E,m)))),a=a.return}o.length!==0&&t.push({event:e,listeners:o})}var Sp=/\r\n?/g,_p=/\u0000|\uFFFD/g;function xd(t){return(typeof t=="string"?t:""+t).replace(Sp,`
`).replace(_p,"")}function Md(t,e){return e=xd(e),xd(t)===e}function qs(){}function dt(t,e,a,n,i,u){switch(a){case"children":typeof n=="string"?e==="body"||e==="textarea"&&n===""||Fa(t,n):(typeof n=="number"||typeof n=="bigint")&&e!=="body"&&Fa(t,""+n);break;case"className":Vl(t,"class",n);break;case"tabIndex":Vl(t,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Vl(t,a,n);break;case"style":Mc(t,n,u);break;case"data":if(e!=="object"){Vl(t,"data",n);break}case"src":case"href":if(n===""&&(e!=="a"||a!=="href")){t.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){t.removeAttribute(a);break}n=Zl(""+n),t.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){t.setAttribute(a,"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 u=="function"&&(a==="formAction"?(e!=="input"&&dt(t,e,"name",i.name,i,null),dt(t,e,"formEncType",i.formEncType,i,null),dt(t,e,"formMethod",i.formMethod,i,null),dt(t,e,"formTarget",i.formTarget,i,null)):(dt(t,e,"encType",i.encType,i,null),dt(t,e,"method",i.method,i,null),dt(t,e,"target",i.target,i,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){t.removeAttribute(a);break}n=Zl(""+n),t.setAttribute(a,n);break;case"onClick":n!=null&&(t.onclick=qs);break;case"onScroll":n!=null&&et("scroll",t);break;case"onScrollEnd":n!=null&&et("scrollend",t);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(i.children!=null)throw Error(c(60));t.innerHTML=a}}break;case"multiple":t.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":t.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){t.removeAttribute("xlink:href");break}a=Zl(""+n),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?t.setAttribute(a,""+n):t.removeAttribute(a);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":n&&typeof n!="function"&&typeof n!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":n===!0?t.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?t.setAttribute(a,n):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?t.setAttribute(a,n):t.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?t.removeAttribute(a):t.setAttribute(a,n);break;case"popover":et("beforetoggle",t),et("toggle",t),Il(t,"popover",n);break;case"xlinkActuate":Be(t,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Be(t,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Be(t,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Be(t,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Be(t,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Be(t,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Be(t,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Be(t,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Be(t,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Il(t,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Fm.get(a)||a,Il(t,a,n))}}function vr(t,e,a,n,i,u){switch(a){case"style":Mc(t,n,u);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(i.children!=null)throw Error(c(60));t.innerHTML=a}}break;case"children":typeof n=="string"?Fa(t,n):(typeof n=="number"||typeof n=="bigint")&&Fa(t,""+n);break;case"onScroll":n!=null&&et("scroll",t);break;case"onScrollEnd":n!=null&&et("scrollend",t);break;case"onClick":n!=null&&(t.onclick=qs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!pc.hasOwnProperty(a))t:{if(a[0]==="o"&&a[1]==="n"&&(i=a.endsWith("Capture"),e=a.slice(2,i?a.length-7:void 0),u=t[$t]||null,u=u!=null?u[a]:null,typeof u=="function"&&t.removeEventListener(e,u,i),typeof n=="function")){typeof u!="function"&&u!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(e,n,i);break t}a in t?t[a]=n:n===!0?t.setAttribute(a,""):Il(t,a,n)}}}function Gt(t,e,a){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":et("error",t),et("load",t);var n=!1,i=!1,u;for(u in a)if(a.hasOwnProperty(u)){var o=a[u];if(o!=null)switch(u){case"src":n=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,e));default:dt(t,e,u,o,a,null)}}i&&dt(t,e,"srcSet",a.srcSet,a,null),n&&dt(t,e,"src",a.src,a,null);return;case"input":et("invalid",t);var d=u=o=i=null,m=null,E=null;for(n in a)if(a.hasOwnProperty(n)){var w=a[n];if(w!=null)switch(n){case"name":i=w;break;case"type":o=w;break;case"checked":m=w;break;case"defaultChecked":E=w;break;case"value":u=w;break;case"defaultValue":d=w;break;case"children":case"dangerouslySetInnerHTML":if(w!=null)throw Error(c(137,e));break;default:dt(t,e,n,w,a,null)}}Ec(t,u,d,m,E,o,i,!1),Xl(t);return;case"select":et("invalid",t),n=o=u=null;for(i in a)if(a.hasOwnProperty(i)&&(d=a[i],d!=null))switch(i){case"value":u=d;break;case"defaultValue":o=d;break;case"multiple":n=d;default:dt(t,e,i,d,a,null)}e=u,a=o,t.multiple=!!n,e!=null?$a(t,!!n,e,!1):a!=null&&$a(t,!!n,a,!0);return;case"textarea":et("invalid",t),u=i=n=null;for(o in a)if(a.hasOwnProperty(o)&&(d=a[o],d!=null))switch(o){case"value":n=d;break;case"defaultValue":i=d;break;case"children":u=d;break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(c(91));break;default:dt(t,e,o,d,a,null)}Rc(t,n,i,u),Xl(t);return;case"option":for(m in a)if(a.hasOwnProperty(m)&&(n=a[m],n!=null))switch(m){case"selected":t.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:dt(t,e,m,n,a,null)}return;case"dialog":et("beforetoggle",t),et("toggle",t),et("cancel",t),et("close",t);break;case"iframe":case"object":et("load",t);break;case"video":case"audio":for(n=0;n<_l.length;n++)et(_l[n],t);break;case"image":et("error",t),et("load",t);break;case"details":et("toggle",t);break;case"embed":case"source":case"link":et("error",t),et("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(E in a)if(a.hasOwnProperty(E)&&(n=a[E],n!=null))switch(E){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,e));default:dt(t,e,E,n,a,null)}return;default:if(Ui(e)){for(w in a)a.hasOwnProperty(w)&&(n=a[w],n!==void 0&&vr(t,e,w,n,a,void 0));return}}for(d in a)a.hasOwnProperty(d)&&(n=a[d],n!=null&&dt(t,e,d,n,a,null))}function Tp(t,e,a,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,u=null,o=null,d=null,m=null,E=null,w=null;for(R in a){var U=a[R];if(a.hasOwnProperty(R)&&U!=null)switch(R){case"checked":break;case"value":break;case"defaultValue":m=U;default:n.hasOwnProperty(R)||dt(t,e,R,null,n,U)}}for(var A in n){var R=n[A];if(U=a[A],n.hasOwnProperty(A)&&(R!=null||U!=null))switch(A){case"type":u=R;break;case"name":i=R;break;case"checked":E=R;break;case"defaultChecked":w=R;break;case"value":o=R;break;case"defaultValue":d=R;break;case"children":case"dangerouslySetInnerHTML":if(R!=null)throw Error(c(137,e));break;default:R!==U&&dt(t,e,A,R,n,U)}}zi(t,o,d,m,E,w,u,i);return;case"select":R=o=d=A=null;for(u in a)if(m=a[u],a.hasOwnProperty(u)&&m!=null)switch(u){case"value":break;case"multiple":R=m;default:n.hasOwnProperty(u)||dt(t,e,u,null,n,m)}for(i in n)if(u=n[i],m=a[i],n.hasOwnProperty(i)&&(u!=null||m!=null))switch(i){case"value":A=u;break;case"defaultValue":d=u;break;case"multiple":o=u;default:u!==m&&dt(t,e,i,u,n,m)}e=d,a=o,n=R,A!=null?$a(t,!!a,A,!1):!!n!=!!a&&(e!=null?$a(t,!!a,e,!0):$a(t,!!a,a?[]:"",!1));return;case"textarea":R=A=null;for(d in a)if(i=a[d],a.hasOwnProperty(d)&&i!=null&&!n.hasOwnProperty(d))switch(d){case"value":break;case"children":break;default:dt(t,e,d,null,n,i)}for(o in n)if(i=n[o],u=a[o],n.hasOwnProperty(o)&&(i!=null||u!=null))switch(o){case"value":A=i;break;case"defaultValue":R=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(c(91));break;default:i!==u&&dt(t,e,o,i,n,u)}Ac(t,A,R);return;case"option":for(var Z in a)if(A=a[Z],a.hasOwnProperty(Z)&&A!=null&&!n.hasOwnProperty(Z))switch(Z){case"selected":t.selected=!1;break;default:dt(t,e,Z,null,n,A)}for(m in n)if(A=n[m],R=a[m],n.hasOwnProperty(m)&&A!==R&&(A!=null||R!=null))switch(m){case"selected":t.selected=A&&typeof A!="function"&&typeof A!="symbol";break;default:dt(t,e,m,A,n,R)}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 V in a)A=a[V],a.hasOwnProperty(V)&&A!=null&&!n.hasOwnProperty(V)&&dt(t,e,V,null,n,A);for(E in n)if(A=n[E],R=a[E],n.hasOwnProperty(E)&&A!==R&&(A!=null||R!=null))switch(E){case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(c(137,e));break;default:dt(t,e,E,A,n,R)}return;default:if(Ui(e)){for(var ht in a)A=a[ht],a.hasOwnProperty(ht)&&A!==void 0&&!n.hasOwnProperty(ht)&&vr(t,e,ht,void 0,n,A);for(w in n)A=n[w],R=a[w],!n.hasOwnProperty(w)||A===R||A===void 0&&R===void 0||vr(t,e,w,A,n,R);return}}for(var b in a)A=a[b],a.hasOwnProperty(b)&&A!=null&&!n.hasOwnProperty(b)&&dt(t,e,b,null,n,A);for(U in n)A=n[U],R=a[U],!n.hasOwnProperty(U)||A===R||A==null&&R==null||dt(t,e,U,A,n,R)}var yr=null,br=null;function Ls(t){return t.nodeType===9?t:t.ownerDocument}function wd(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Cd(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function Sr(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var _r=null;function Ep(){var t=window.event;return t&&t.type==="popstate"?t===_r?!1:(_r=t,!0):(_r=null,!1)}var Od=typeof setTimeout=="function"?setTimeout:void 0,Ap=typeof clearTimeout=="function"?clearTimeout:void 0,zd=typeof Promise=="function"?Promise:void 0,Rp=typeof queueMicrotask=="function"?queueMicrotask:typeof zd<"u"?function(t){return zd.resolve(null).then(t).catch(xp)}:Od;function xp(t){setTimeout(function(){throw t})}function va(t){return t==="head"}function Dd(t,e){var a=e,n=0,i=0;do{var u=a.nextSibling;if(t.removeChild(a),u&&u.nodeType===8)if(a=u.data,a==="/$"){if(0<n&&8>n){a=n;var o=t.ownerDocument;if(a&1&&El(o.documentElement),a&2&&El(o.body),a&4)for(a=o.head,El(a),o=a.firstChild;o;){var d=o.nextSibling,m=o.nodeName;o[qn]||m==="SCRIPT"||m==="STYLE"||m==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=d}}if(i===0){t.removeChild(u),zl(e);return}i--}else a==="$"||a==="$?"||a==="$!"?i++:n=a.charCodeAt(0)-48;else n=0;a=u}while(a);zl(e)}function Tr(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var a=e;switch(e=e.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Tr(a),Mi(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function Mp(t,e,a,n){for(;t.nodeType===1;){var i=a;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!n&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(n){if(!t[qn])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(u=t.getAttribute("rel"),u==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(u!==i.rel||t.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||t.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||t.getAttribute("title")!==(i.title==null?null:i.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(u=t.getAttribute("src"),(u!==(i.src==null?null:i.src)||t.getAttribute("type")!==(i.type==null?null:i.type)||t.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&u&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var u=i.name==null?null:""+i.name;if(i.type==="hidden"&&t.getAttribute("name")===u)return t}else return t;if(t=Re(t.nextSibling),t===null)break}return null}function wp(t,e,a){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Re(t.nextSibling),t===null))return null;return t}function Er(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function Cp(t,e){var a=t.ownerDocument;if(t.data!=="$?"||a.readyState==="complete")e();else{var n=function(){e(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),t._reactRetry=n}}function Re(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="F!"||e==="F")break;if(e==="/$")return null}}return t}var Ar=null;function Ud(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"){if(e===0)return t;e--}else a==="/$"&&e++}t=t.previousSibling}return null}function Nd(t,e,a){switch(e=Ls(a),t){case"html":if(t=e.documentElement,!t)throw Error(c(452));return t;case"head":if(t=e.head,!t)throw Error(c(453));return t;case"body":if(t=e.body,!t)throw Error(c(454));return t;default:throw Error(c(451))}}function El(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);Mi(t)}var _e=new Map,Bd=new Set;function Ys(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Je=q.d;q.d={f:Op,r:zp,D:Dp,C:Up,L:Np,m:Bp,X:jp,S:Hp,M:qp};function Op(){var t=Je.f(),e=zs();return t||e}function zp(t){var e=Za(t);e!==null&&e.tag===5&&e.type==="form"?tf(e):Je.r(t)}var Mn=typeof document>"u"?null:document;function Hd(t,e,a){var n=Mn;if(n&&typeof e=="string"&&e){var i=me(e);i='link[rel="'+t+'"][href="'+i+'"]',typeof a=="string"&&(i+='[crossorigin="'+a+'"]'),Bd.has(i)||(Bd.add(i),t={rel:t,crossOrigin:a,href:e},n.querySelector(i)===null&&(e=n.createElement("link"),Gt(e,"link",t),Ut(e),n.head.appendChild(e)))}}function Dp(t){Je.D(t),Hd("dns-prefetch",t,null)}function Up(t,e){Je.C(t,e),Hd("preconnect",t,e)}function Np(t,e,a){Je.L(t,e,a);var n=Mn;if(n&&t&&e){var i='link[rel="preload"][as="'+me(e)+'"]';e==="image"&&a&&a.imageSrcSet?(i+='[imagesrcset="'+me(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(i+='[imagesizes="'+me(a.imageSizes)+'"]')):i+='[href="'+me(t)+'"]';var u=i;switch(e){case"style":u=wn(t);break;case"script":u=Cn(t)}_e.has(u)||(t=M({rel:"preload",href:e==="image"&&a&&a.imageSrcSet?void 0:t,as:e},a),_e.set(u,t),n.querySelector(i)!==null||e==="style"&&n.querySelector(Al(u))||e==="script"&&n.querySelector(Rl(u))||(e=n.createElement("link"),Gt(e,"link",t),Ut(e),n.head.appendChild(e)))}}function Bp(t,e){Je.m(t,e);var a=Mn;if(a&&t){var n=e&&typeof e.as=="string"?e.as:"script",i='link[rel="modulepreload"][as="'+me(n)+'"][href="'+me(t)+'"]',u=i;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Cn(t)}if(!_e.has(u)&&(t=M({rel:"modulepreload",href:t},e),_e.set(u,t),a.querySelector(i)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Rl(u)))return}n=a.createElement("link"),Gt(n,"link",t),Ut(n),a.head.appendChild(n)}}}function Hp(t,e,a){Je.S(t,e,a);var n=Mn;if(n&&t){var i=Ka(n).hoistableStyles,u=wn(t);e=e||"default";var o=i.get(u);if(!o){var d={loading:0,preload:null};if(o=n.querySelector(Al(u)))d.loading=5;else{t=M({rel:"stylesheet",href:t,"data-precedence":e},a),(a=_e.get(u))&&Rr(t,a);var m=o=n.createElement("link");Ut(m),Gt(m,"link",t),m._p=new Promise(function(E,w){m.onload=E,m.onerror=w}),m.addEventListener("load",function(){d.loading|=1}),m.addEventListener("error",function(){d.loading|=2}),d.loading|=4,Gs(o,e,n)}o={type:"stylesheet",instance:o,count:1,state:d},i.set(u,o)}}}function jp(t,e){Je.X(t,e);var a=Mn;if(a&&t){var n=Ka(a).hoistableScripts,i=Cn(t),u=n.get(i);u||(u=a.querySelector(Rl(i)),u||(t=M({src:t,async:!0},e),(e=_e.get(i))&&xr(t,e),u=a.createElement("script"),Ut(u),Gt(u,"link",t),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},n.set(i,u))}}function qp(t,e){Je.M(t,e);var a=Mn;if(a&&t){var n=Ka(a).hoistableScripts,i=Cn(t),u=n.get(i);u||(u=a.querySelector(Rl(i)),u||(t=M({src:t,async:!0,type:"module"},e),(e=_e.get(i))&&xr(t,e),u=a.createElement("script"),Ut(u),Gt(u,"link",t),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},n.set(i,u))}}function jd(t,e,a,n){var i=(i=K.current)?Ys(i):null;if(!i)throw Error(c(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(e=wn(a.href),a=Ka(i).hoistableStyles,n=a.get(e),n||(n={type:"style",instance:null,count:0,state:null},a.set(e,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=wn(a.href);var u=Ka(i).hoistableStyles,o=u.get(t);if(o||(i=i.ownerDocument||i,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(t,o),(u=i.querySelector(Al(t)))&&!u._p&&(o.instance=u,o.state.loading=5),_e.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},_e.set(t,a),u||Lp(i,t,a,o.state))),e&&n===null)throw Error(c(528,""));return o}if(e&&n!==null)throw Error(c(529,""));return null;case"script":return e=a.async,a=a.src,typeof a=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Cn(a),a=Ka(i).hoistableScripts,n=a.get(e),n||(n={type:"script",instance:null,count:0,state:null},a.set(e,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,t))}}function wn(t){return'href="'+me(t)+'"'}function Al(t){return'link[rel="stylesheet"]['+t+"]"}function qd(t){return M({},t,{"data-precedence":t.precedence,precedence:null})}function Lp(t,e,a,n){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?n.loading=1:(e=t.createElement("link"),n.preload=e,e.addEventListener("load",function(){return n.loading|=1}),e.addEventListener("error",function(){return n.loading|=2}),Gt(e,"link",a),Ut(e),t.head.appendChild(e))}function Cn(t){return'[src="'+me(t)+'"]'}function Rl(t){return"script[async]"+t}function Ld(t,e,a){if(e.count++,e.instance===null)switch(e.type){case"style":var n=t.querySelector('style[data-href~="'+me(a.href)+'"]');if(n)return e.instance=n,Ut(n),n;var i=M({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(t.ownerDocument||t).createElement("style"),Ut(n),Gt(n,"style",i),Gs(n,a.precedence,t),e.instance=n;case"stylesheet":i=wn(a.href);var u=t.querySelector(Al(i));if(u)return e.state.loading|=4,e.instance=u,Ut(u),u;n=qd(a),(i=_e.get(i))&&Rr(n,i),u=(t.ownerDocument||t).createElement("link"),Ut(u);var o=u;return o._p=new Promise(function(d,m){o.onload=d,o.onerror=m}),Gt(u,"link",n),e.state.loading|=4,Gs(u,a.precedence,t),e.instance=u;case"script":return u=Cn(a.src),(i=t.querySelector(Rl(u)))?(e.instance=i,Ut(i),i):(n=a,(i=_e.get(u))&&(n=M({},a),xr(n,i)),t=t.ownerDocument||t,i=t.createElement("script"),Ut(i),Gt(i,"link",n),t.head.appendChild(i),e.instance=i);case"void":return null;default:throw Error(c(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(n=e.instance,e.state.loading|=4,Gs(n,a.precedence,t));return e.instance}function Gs(t,e,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=n.length?n[n.length-1]:null,u=i,o=0;o<n.length;o++){var d=n[o];if(d.dataset.precedence===e)u=d;else if(u!==i)break}u?u.parentNode.insertBefore(t,u.nextSibling):(e=a.nodeType===9?a.head:a,e.insertBefore(t,e.firstChild))}function Rr(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function xr(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var Is=null;function Yd(t,e,a){if(Is===null){var n=new Map,i=Is=new Map;i.set(a,n)}else i=Is,n=i.get(a),n||(n=new Map,i.set(a,n));if(n.has(t))return n;for(n.set(t,null),a=a.getElementsByTagName(t),i=0;i<a.length;i++){var u=a[i];if(!(u[qn]||u[Xt]||t==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var o=u.getAttribute(e)||"";o=t+o;var d=n.get(o);d?d.push(u):n.set(o,[u])}}return n}function Gd(t,e,a){t=t.ownerDocument||t,t.head.insertBefore(a,e==="title"?t.querySelector("head > title"):null)}function Yp(t,e,a){if(a===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Id(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}var xl=null;function Gp(){}function Ip(t,e,a){if(xl===null)throw Error(c(475));var n=xl;if(e.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(e.state.loading&4)===0){if(e.instance===null){var i=wn(a.href),u=t.querySelector(Al(i));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(n.count++,n=Vs.bind(n),t.then(n,n)),e.state.loading|=4,e.instance=u,Ut(u);return}u=t.ownerDocument||t,a=qd(a),(i=_e.get(i))&&Rr(a,i),u=u.createElement("link"),Ut(u);var o=u;o._p=new Promise(function(d,m){o.onload=d,o.onerror=m}),Gt(u,"link",a),e.instance=u}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(e,t),(t=e.state.preload)&&(e.state.loading&3)===0&&(n.count++,e=Vs.bind(n),t.addEventListener("load",e),t.addEventListener("error",e))}}function Vp(){if(xl===null)throw Error(c(475));var t=xl;return t.stylesheets&&t.count===0&&Mr(t,t.stylesheets),0<t.count?function(e){var a=setTimeout(function(){if(t.stylesheets&&Mr(t,t.stylesheets),t.unsuspend){var n=t.unsuspend;t.unsuspend=null,n()}},6e4);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(a)}}:null}function Vs(){if(this.count--,this.count===0){if(this.stylesheets)Mr(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Xs=null;function Mr(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Xs=new Map,e.forEach(Xp,t),Xs=null,Vs.call(t))}function Xp(t,e){if(!(e.state.loading&4)){var a=Xs.get(t);if(a)var n=a.get(null);else{a=new Map,Xs.set(t,a);for(var i=t.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<i.length;u++){var o=i[u];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(a.set(o.dataset.precedence,o),n=o)}n&&a.set(null,n)}i=e.instance,o=i.getAttribute("data-precedence"),u=a.get(o)||n,u===n&&a.set(null,i),a.set(o,i),this.count++,n=Vs.bind(this),i.addEventListener("load",n),i.addEventListener("error",n),u?u.parentNode.insertBefore(i,u.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(i,t.firstChild)),e.state.loading|=4}}var Ml={$$typeof:lt,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function Qp(t,e,a,n,i,u,o,d){this.tag=1,this.containerInfo=t,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=Ei(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ei(0),this.hiddenUpdates=Ei(null),this.identifierPrefix=n,this.onUncaughtError=i,this.onCaughtError=u,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=d,this.incompleteTransitions=new Map}function Vd(t,e,a,n,i,u,o,d,m,E,w,U){return t=new Qp(t,e,a,o,d,m,E,U),e=1,u===!0&&(e|=24),u=ue(3,null,null,e),t.current=u,u.stateNode=t,e=ru(),e.refCount++,t.pooledCache=e,e.refCount++,u.memoizedState={element:n,isDehydrated:a,cache:e},du(u),t}function Xd(t){return t?(t=sn,t):sn}function Qd(t,e,a,n,i,u){i=Xd(i),n.context===null?n.context=i:n.pendingContext=i,n=la(e),n.payload={element:a},u=u===void 0?null:u,u!==null&&(n.callback=u),a=sa(t,n,e),a!==null&&(de(a,t,e),nl(a,t,e))}function Zd(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<e?a:e}}function wr(t,e){Zd(t,e),(t=t.alternate)&&Zd(t,e)}function Kd(t){if(t.tag===13){var e=ln(t,67108864);e!==null&&de(e,t,67108864),wr(t,67108864)}}var Qs=!0;function Zp(t,e,a,n){var i=C.T;C.T=null;var u=q.p;try{q.p=2,Cr(t,e,a,n)}finally{q.p=u,C.T=i}}function Kp(t,e,a,n){var i=C.T;C.T=null;var u=q.p;try{q.p=8,Cr(t,e,a,n)}finally{q.p=u,C.T=i}}function Cr(t,e,a,n){if(Qs){var i=Or(n);if(i===null)pr(t,e,n,Zs,a),Jd(t,n);else if(Jp(i,t,e,a,n))n.stopPropagation();else if(Jd(t,n),e&4&&-1<kp.indexOf(t)){for(;i!==null;){var u=Za(i);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var o=Ra(u.pendingLanes);if(o!==0){var d=u;for(d.pendingLanes|=2,d.entangledLanes|=2;o;){var m=1<<31-se(o);d.entanglements[1]|=m,o&=~m}Ue(u),(ct&6)===0&&(Cs=we()+500,Sl(0))}}break;case 13:d=ln(u,2),d!==null&&de(d,u,2),zs(),wr(u,2)}if(u=Or(n),u===null&&pr(t,e,n,Zs,a),u===i)break;i=u}i!==null&&n.stopPropagation()}else pr(t,e,n,null,a)}}function Or(t){return t=Bi(t),zr(t)}var Zs=null;function zr(t){if(Zs=null,t=Qa(t),t!==null){var e=h(t);if(e===null)t=null;else{var a=e.tag;if(a===13){if(t=v(e),t!==null)return t;t=null}else if(a===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return Zs=t,null}function kd(t){switch(t){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(Um()){case ic:return 2;case uc:return 8;case ql:case Nm:return 32;case rc:return 268435456;default:return 32}default:return 32}}var Dr=!1,ya=null,ba=null,Sa=null,wl=new Map,Cl=new Map,_a=[],kp="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 Jd(t,e){switch(t){case"focusin":case"focusout":ya=null;break;case"dragenter":case"dragleave":ba=null;break;case"mouseover":case"mouseout":Sa=null;break;case"pointerover":case"pointerout":wl.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cl.delete(e.pointerId)}}function Ol(t,e,a,n,i,u){return t===null||t.nativeEvent!==u?(t={blockedOn:e,domEventName:a,eventSystemFlags:n,nativeEvent:u,targetContainers:[i]},e!==null&&(e=Za(e),e!==null&&Kd(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function Jp(t,e,a,n,i){switch(e){case"focusin":return ya=Ol(ya,t,e,a,n,i),!0;case"dragenter":return ba=Ol(ba,t,e,a,n,i),!0;case"mouseover":return Sa=Ol(Sa,t,e,a,n,i),!0;case"pointerover":var u=i.pointerId;return wl.set(u,Ol(wl.get(u)||null,t,e,a,n,i)),!0;case"gotpointercapture":return u=i.pointerId,Cl.set(u,Ol(Cl.get(u)||null,t,e,a,n,i)),!0}return!1}function $d(t){var e=Qa(t.target);if(e!==null){var a=h(e);if(a!==null){if(e=a.tag,e===13){if(e=v(a),e!==null){t.blockedOn=e,Im(t.priority,function(){if(a.tag===13){var n=fe();n=Ai(n);var i=ln(a,n);i!==null&&de(i,a,n),wr(a,n)}});return}}else if(e===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Ks(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var a=Or(t.nativeEvent);if(a===null){a=t.nativeEvent;var n=new a.constructor(a.type,a);Ni=n,a.target.dispatchEvent(n),Ni=null}else return e=Za(a),e!==null&&Kd(e),t.blockedOn=a,!1;e.shift()}return!0}function Fd(t,e,a){Ks(t)&&a.delete(e)}function $p(){Dr=!1,ya!==null&&Ks(ya)&&(ya=null),ba!==null&&Ks(ba)&&(ba=null),Sa!==null&&Ks(Sa)&&(Sa=null),wl.forEach(Fd),Cl.forEach(Fd)}function ks(t,e){t.blockedOn===e&&(t.blockedOn=null,Dr||(Dr=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,$p)))}var Js=null;function Wd(t){Js!==t&&(Js=t,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){Js===t&&(Js=null);for(var e=0;e<t.length;e+=3){var a=t[e],n=t[e+1],i=t[e+2];if(typeof n!="function"){if(zr(n||a)===null)continue;break}var u=Za(a);u!==null&&(t.splice(e,3),e-=3,zu(u,{pending:!0,data:i,method:a.method,action:n},n,i))}}))}function zl(t){function e(m){return ks(m,t)}ya!==null&&ks(ya,t),ba!==null&&ks(ba,t),Sa!==null&&ks(Sa,t),wl.forEach(e),Cl.forEach(e);for(var a=0;a<_a.length;a++){var n=_a[a];n.blockedOn===t&&(n.blockedOn=null)}for(;0<_a.length&&(a=_a[0],a.blockedOn===null);)$d(a),a.blockedOn===null&&_a.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var i=a[n],u=a[n+1],o=i[$t]||null;if(typeof u=="function")o||Wd(a);else if(o){var d=null;if(u&&u.hasAttribute("formAction")){if(i=u,o=u[$t]||null)d=o.formAction;else if(zr(i)!==null)continue}else d=o.action;typeof d=="function"?a[n+1]=d:(a.splice(n,3),n-=3),Wd(a)}}}function Ur(t){this._internalRoot=t}$s.prototype.render=Ur.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(c(409));var a=e.current,n=fe();Qd(a,n,t,e,null,null)},$s.prototype.unmount=Ur.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Qd(t.current,2,null,t,null,null),zs(),e[Xa]=null}};function $s(t){this._internalRoot=t}$s.prototype.unstable_scheduleHydration=function(t){if(t){var e=hc();t={blockedOn:null,target:t,priority:e};for(var a=0;a<_a.length&&e!==0&&e<_a[a].priority;a++);_a.splice(a,0,t),a===0&&$d(t)}};var Pd=s.version;if(Pd!=="19.1.1")throw Error(c(527,Pd,"19.1.1"));q.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(c(188)):(t=Object.keys(t).join(","),Error(c(268,t)));return t=T(e),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var Fp={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fs.isDisabled&&Fs.supportsFiber)try{Bn=Fs.inject(Fp),le=Fs}catch{}}return Ul.createRoot=function(t,e){if(!f(t))throw Error(c(299));var a=!1,n="",i=gf,u=pf,o=vf,d=null;return e!=null&&(e.unstable_strictMode===!0&&(a=!0),e.identifierPrefix!==void 0&&(n=e.identifierPrefix),e.onUncaughtError!==void 0&&(i=e.onUncaughtError),e.onCaughtError!==void 0&&(u=e.onCaughtError),e.onRecoverableError!==void 0&&(o=e.onRecoverableError),e.unstable_transitionCallbacks!==void 0&&(d=e.unstable_transitionCallbacks)),e=Vd(t,1,!1,null,null,a,n,i,u,o,d,null),t[Xa]=e.current,gr(t),new Ur(e)},Ul.hydrateRoot=function(t,e,a){if(!f(t))throw Error(c(299));var n=!1,i="",u=gf,o=pf,d=vf,m=null,E=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(i=a.identifierPrefix),a.onUncaughtError!==void 0&&(u=a.onUncaughtError),a.onCaughtError!==void 0&&(o=a.onCaughtError),a.onRecoverableError!==void 0&&(d=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(m=a.unstable_transitionCallbacks),a.formState!==void 0&&(E=a.formState)),e=Vd(t,1,!0,e,a??null,n,i,u,o,d,m,E),e.context=Xd(null),a=e.current,n=fe(),n=Ai(n),i=la(n),i.callback=null,sa(a,i,n),a=n,e.current.lanes=a,jn(e,a),Ue(e),t[Xa]=e.current,gr(t),new $s(e)},Ul.version="19.1.1",Ul}var ch;function iv(){if(ch)return Hr.exports;ch=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),Hr.exports=sv(),Hr.exports}var uv=iv();const rv=Wr(uv);var cv=l=>Array.from(l).map(r=>r.getModelContext()).sort((r,c)=>(c.priority??0)-(r.priority??0)).reduce((r,c)=>{if(c.system&&(r.system?r.system+=`

${c.system}`:r.system=c.system),c.tools)for(const[f,h]of Object.entries(c.tools)){const v=r.tools?.[f];if(v&&v!==h)throw new Error(`You tried to define a tool with the name ${f}, but it already exists.`);r.tools||(r.tools={}),r.tools[f]=h}return c.config&&(r.config={...r.config,...c.config}),c.callSettings&&(r.callSettings={...r.callSettings,...c.callSettings}),r},{}),ov=class{_providers=new Set;getModelContext(){return cv(this._providers)}registerModelContextProvider(l){this._providers.add(l);const s=l.subscribe?.(()=>{this.notifySubscribers()});return this.notifySubscribers(),()=>{this._providers.delete(l),s?.(),this.notifySubscribers()}}_subscribers=new Set;notifySubscribers(){for(const l of this._subscribers)l()}subscribe(l){return this._subscribers.add(l),()=>this._subscribers.delete(l)}},Yh=class{_contextProvider=new ov;registerModelContextProvider(l){return this._contextProvider.registerModelContextProvider(l)}},Bl=class{_subscribers=new Set;subscribe(l){return this._subscribers.add(l),()=>this._subscribers.delete(l)}waitForUpdate(){return new Promise(l=>{const s=this.subscribe(()=>{s(),l()})})}_notifySubscribers(){const l=[];for(const s of this._subscribers)try{s()}catch(r){l.push(r)}if(l.length>0)throw l.length===1?l[0]:new AggregateError(l)}},fv=l=>l.status.type==="complete",Gh=class extends Bl{isEditing=!0;getAttachmentAccept(){return this.getAttachmentAdapter()?.accept??"*"}_attachments=[];get attachments(){return this._attachments}setAttachments(l){this._attachments=l,this._notifySubscribers()}get isEmpty(){return!this.text.trim()&&!this.attachments.length}_text="";get text(){return this._text}_role="user";get role(){return this._role}_runConfig={};get runConfig(){return this._runConfig}setText(l){this._text!==l&&(this._text=l,this._notifySubscribers())}setRole(l){this._role!==l&&(this._role=l,this._notifySubscribers())}setRunConfig(l){this._runConfig!==l&&(this._runConfig=l,this._notifySubscribers())}_emptyTextAndAttachments(){this._attachments=[],this._text="",this._notifySubscribers()}async _onClearAttachments(){const l=this.getAttachmentAdapter();l&&await Promise.all(this._attachments.map(s=>l.remove(s)))}async reset(){if(this._attachments.length===0&&this._text===""&&this._role==="user"&&Object.keys(this._runConfig).length===0)return;this._role="user",this._runConfig={};const l=this._onClearAttachments();this._emptyTextAndAttachments(),await l}async clearAttachments(){const l=this._onClearAttachments();this.setAttachments([]),await l}async send(){const l=this.getAttachmentAdapter(),s=l&&this.attachments.length>0?Promise.all(this.attachments.map(async f=>fv(f)?f:await l.send(f))):[],r=this.text;this._emptyTextAndAttachments();const c={createdAt:new Date,role:this.role,content:r?[{type:"text",text:r}]:[],attachments:await s,runConfig:this.runConfig,metadata:{custom:{}}};this.handleSend(c),this._notifyEventSubscribers("send")}cancel(){this.handleCancel()}async addAttachment(l){const s=this.getAttachmentAdapter();if(!s)throw new Error("Attachments are not supported");const r=f=>{const h=this._attachments.findIndex(v=>v.id===f.id);h!==-1?this._attachments=[...this._attachments.slice(0,h),f,...this._attachments.slice(h+1)]:(this._attachments=[...this._attachments,f],this._notifyEventSubscribers("attachment_add")),this._notifySubscribers()},c=s.add({file:l});if(Symbol.asyncIterator in c)for await(const f of c)r(f);else r(await c);this._notifyEventSubscribers("attachment_add"),this._notifySubscribers()}async removeAttachment(l){const s=this.getAttachmentAdapter();if(!s)throw new Error("Attachments are not supported");const r=this._attachments.findIndex(f=>f.id===l);if(r===-1)throw new Error("Attachment not found");const c=this._attachments[r];await s.remove(c),this._attachments=[...this._attachments.slice(0,r),...this._attachments.slice(r+1)],this._notifySubscribers()}_eventSubscribers=new Map;_notifyEventSubscribers(l){const s=this._eventSubscribers.get(l);if(s)for(const r of s)r()}unstable_on(l,s){const r=this._eventSubscribers.get(l);return r?r.add(s):this._eventSubscribers.set(l,new Set([s])),()=>{const c=this._eventSubscribers.get(l);c&&c.delete(s)}}},dv=class extends Gh{constructor(l){super(),this.runtime=l,this.connect()}_canCancel=!1;get canCancel(){return this._canCancel}get attachments(){return super.attachments}getAttachmentAdapter(){return this.runtime.adapters?.attachments}connect(){return this.runtime.subscribe(()=>{this.canCancel!==this.runtime.capabilities.cancel&&(this._canCancel=this.runtime.capabilities.cancel,this._notifySubscribers())})}async handleSend(l){this.runtime.append({...l,parentId:this.runtime.messages.at(-1)?.id??null,sourceId:null})}async handleCancel(){this.runtime.cancelRun()}};let Ih=(l,s=21)=>(r=s)=>{let c="",f=r|0;for(;f--;)c+=l[Math.random()*l.length|0];return c};var On=Ih("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7),hv="__optimistic__",mv=()=>`${hv}${On()}`,gv=Object.freeze({type:"running"}),pv=Object.freeze({type:"complete",reason:"unknown"}),vv=Object.freeze({type:"requires-action",reason:"tool-calls"}),yv=(l,s,r)=>l&&s?gv:r?vv:pv,Va={exports:{}},oh;function bv(){if(oh)return Va.exports;oh=1;const l=typeof Buffer<"u",s=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,r=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function c(S,T,y){y==null&&T!==null&&typeof T=="object"&&(y=T,T=void 0),l&&Buffer.isBuffer(S)&&(S=S.toString()),S&&S.charCodeAt(0)===65279&&(S=S.slice(1));const M=JSON.parse(S,T);if(M===null||typeof M!="object")return M;const O=y&&y.protoAction||"error",D=y&&y.constructorAction||"error";if(O==="ignore"&&D==="ignore")return M;if(O!=="ignore"&&D!=="ignore"){if(s.test(S)===!1&&r.test(S)===!1)return M}else if(O!=="ignore"&&D==="ignore"){if(s.test(S)===!1)return M}else if(r.test(S)===!1)return M;return f(M,{protoAction:O,constructorAction:D,safe:y&&y.safe})}function f(S,{protoAction:T="error",constructorAction:y="error",safe:M}={}){let O=[S];for(;O.length;){const D=O;O=[];for(const B of D){if(T!=="ignore"&&Object.prototype.hasOwnProperty.call(B,"__proto__")){if(M===!0)return null;if(T==="error")throw new SyntaxError("Object contains forbidden prototype property");delete B.__proto__}if(y!=="ignore"&&Object.prototype.hasOwnProperty.call(B,"constructor")&&Object.prototype.hasOwnProperty.call(B.constructor,"prototype")){if(M===!0)return null;if(y==="error")throw new SyntaxError("Object contains forbidden prototype property");delete B.constructor}for(const k in B){const nt=B[k];nt&&typeof nt=="object"&&O.push(nt)}}}return S}function h(S,T,y){const{stackTraceLimit:M}=Error;Error.stackTraceLimit=0;try{return c(S,T,y)}finally{Error.stackTraceLimit=M}}function v(S,T){const{stackTraceLimit:y}=Error;Error.stackTraceLimit=0;try{return c(S,T,{safe:!0})}catch{return}finally{Error.stackTraceLimit=y}}return Va.exports=h,Va.exports.default=h,Va.exports.parse=h,Va.exports.safeParse=v,Va.exports.scan=f,Va.exports}var Sv=bv();const fh=Wr(Sv);function _v(l){const s=["ROOT"];let r=-1,c=null;const f=[];let h;function v(){h!==void 0&&(f.push(JSON.parse('"'+h+'"')),h=void 0)}function S(O,D,B){switch(O){case'"':{r=D,s.pop(),s.push(B),s.push("INSIDE_STRING"),v();break}case"f":case"t":case"n":{r=D,c=D,s.pop(),s.push(B),s.push("INSIDE_LITERAL");break}case"-":{s.pop(),s.push(B),s.push("INSIDE_NUMBER"),v();break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{r=D,s.pop(),s.push(B),s.push("INSIDE_NUMBER"),v();break}case"{":{r=D,s.pop(),s.push(B),s.push("INSIDE_OBJECT_START"),v();break}case"[":{r=D,s.pop(),s.push(B),s.push("INSIDE_ARRAY_START"),v();break}}}function T(O,D){switch(O){case",":{s.pop(),s.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{r=D,s.pop(),h=f.pop();break}}}function y(O,D){switch(O){case",":{s.pop(),s.push("INSIDE_ARRAY_AFTER_COMMA"),h=(Number(h)+1).toString();break}case"]":{r=D,s.pop(),h=f.pop();break}}}for(let O=0;O<l.length;O++){const D=l[O];switch(s[s.length-1]){case"ROOT":S(D,O,"FINISH");break;case"INSIDE_OBJECT_START":{switch(D){case'"':{s.pop(),s.push("INSIDE_OBJECT_KEY"),h="";break}case"}":{r=O,s.pop(),h=f.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(D){case'"':{s.pop(),s.push("INSIDE_OBJECT_KEY"),h="";break}}break}case"INSIDE_OBJECT_KEY":{switch(D){case'"':{s.pop(),s.push("INSIDE_OBJECT_AFTER_KEY");break}case"\\":{s.push("INSIDE_STRING_ESCAPE"),h+=D;break}default:{h+=D;break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(D){case":":{s.pop(),s.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{S(D,O,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{T(D,O);break}case"INSIDE_STRING":{switch(D){case'"':{s.pop(),r=O,h=f.pop();break}case"\\":{s.push("INSIDE_STRING_ESCAPE");break}default:r=O}break}case"INSIDE_ARRAY_START":{switch(D){case"]":{r=O,s.pop(),h=f.pop();break}default:{r=O,h="0",S(D,O,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(D){case",":{s.pop(),s.push("INSIDE_ARRAY_AFTER_COMMA"),h=(Number(h)+1).toString();break}case"]":{r=O,s.pop(),h=f.pop();break}default:{r=O;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{S(D,O,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{s.pop(),s[s.length-1]==="INSIDE_STRING"?r=O:s[s.length-1]==="INSIDE_OBJECT_KEY"&&(h+=D);break}case"INSIDE_NUMBER":{switch(D){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{r=O;break}case"e":case"E":case"-":case".":break;case",":{s.pop(),h=f.pop(),s[s.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&y(D,O),s[s.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&T(D,O);break}case"}":{s.pop(),h=f.pop(),s[s.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&T(D,O);break}case"]":{s.pop(),h=f.pop(),s[s.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&y(D,O);break}default:{s.pop(),h=f.pop();break}}break}case"INSIDE_LITERAL":{const k=l.substring(c,O+1);!"false".startsWith(k)&&!"true".startsWith(k)&&!"null".startsWith(k)?(s.pop(),s[s.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?T(D,O):s[s.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&y(D,O)):r=O;break}}}let M=l.slice(0,r+1);for(let O=s.length-1;O>=0;O--)switch(s[O]){case"INSIDE_STRING":{M+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{M+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{M+="]";break}case"INSIDE_LITERAL":{const B=l.substring(c,l.length);"true".startsWith(B)?M+="true".slice(B.length):"false".startsWith(B)?M+="false".slice(B.length):"null".startsWith(B)&&(M+="null".slice(B.length))}}return[M,f]}var Yr=Symbol("aui.parse-partial-json-object.meta"),Vh=l=>{if(l.length===0)return{[Yr]:{state:"partial",partialPath:[]}};try{const s=fh.parse(l);if(typeof s!="object"||s===null)throw new Error("argsText is expected to be an object");return s[Yr]={state:"complete",partialPath:[]},s}catch{try{const[s,r]=_v(l),c=fh.parse(s);if(typeof c!="object"||c===null)throw new Error("argsText is expected to be an object");return c[Yr]={state:"partial",partialPath:r},c}catch{return}}},oi=(l,s,r)=>{const{role:c,id:f,createdAt:h,attachments:v,status:S,metadata:T}=l,y={id:f??s,createdAt:h??new Date},M=typeof l.content=="string"?[{type:"text",text:l.content}]:l.content,O=({image:D,...B})=>D.match(/^data:image\/(png|jpeg|jpg|gif|webp);base64,(.*)$/)?{...B,image:D}:(console.warn("Invalid image data format detected"),null);if(c!=="user"&&v?.length)throw new Error("attachments are only supported for user messages");if(c!=="assistant"&&S)throw new Error("status is only supported for assistant messages");if(c!=="assistant"&&T?.steps)throw new Error("metadata.steps is only supported for assistant messages");switch(c){case"assistant":return{...y,role:c,content:M.map(D=>{const B=D.type;switch(B){case"text":case"reasoning":return D.text.trim().length===0?null:D;case"file":case"source":return D;case"image":return O(D);case"tool-call":{const{parentId:k,...nt}=D,$={...nt,toolCallId:D.toolCallId??"tool-"+On(),...k!==void 0&&{parentId:k}};return D.args?{...$,args:D.args,argsText:JSON.stringify(D.args)}:{...$,args:D.args??Vh(D.argsText??"")??{},argsText:D.argsText??""}}default:{const k=B;throw new Error(`Unsupported assistant message part type: ${k}`)}}}).filter(D=>!!D),status:S??r,metadata:{unstable_state:T?.unstable_state??null,unstable_annotations:T?.unstable_annotations??[],unstable_data:T?.unstable_data??[],custom:T?.custom??{},steps:T?.steps??[]}};case"user":return{...y,role:c,content:M.map(D=>{const B=D.type;switch(B){case"text":case"image":case"audio":case"file":return D;default:{const k=B;throw new Error(`Unsupported user message part type: ${k}`)}}}),attachments:v??[],metadata:{custom:T?.custom??{}}};case"system":if(M.length!==1||M[0].type!=="text")throw new Error("System messages must have exactly one text message part.");return{...y,role:c,content:M,metadata:{custom:T?.custom??{}}};default:{const D=c;throw new Error(`Unknown message role: ${D}`)}}},tc={fromArray:l=>{const s=l.map(r=>oi(r,On(),yv(!1,!1,!1)));return{messages:s.map((r,c)=>({parentId:c>0?s[c-1].id:null,message:r}))}}},ni=l=>l.next?ni(l.next):"current"in l?l:null,Tv=class{constructor(l){this.func=l}_value=null;get value(){return this._value===null&&(this._value=this.func()),this._value}dirty(){this._value=null}},Ev=class{messages=new Map;head=null;root={children:[],next:null};performOp(l,s,r){const c=s.prev??this.root,f=l??this.root;if(!(r==="relink"&&c===f)){if(r!=="link"&&(c.children=c.children.filter(h=>h!==s.current.id),c.next===s)){const h=c.children.at(-1),v=h?this.messages.get(h):null;if(v===void 0)throw new Error("MessageRepository(performOp/cut): Fallback sibling message not found. This is likely an internal bug in assistant-ui.");c.next=v}if(r!=="cut"){for(let h=l;h;h=h.prev)if(h.current.id===s.current.id)throw new Error("MessageRepository(performOp/link): A message with the same id already exists in the parent tree. This error occurs if the same message id is found multiple times. This is likely an internal bug in assistant-ui.");f.children=[...f.children,s.current.id],(ni(s)===this.head||f.next===null)&&(f.next=s),s.prev=l}}}_messages=new Tv(()=>{const l=new Array(this.head?.level??0);for(let s=this.head;s;s=s.prev)l[s.level]=s.current;return l});get headId(){return this.head?.current.id??null}getMessages(){return this._messages.value}addOrUpdateMessage(l,s){const r=this.messages.get(s.id),c=l?this.messages.get(l):null;if(c===void 0)throw new Error("MessageRepository(addOrUpdateMessage): Parent message not found. This is likely an internal bug in assistant-ui.");if(r){r.current=s,this.performOp(c,r,"relink"),this._messages.dirty();return}const f={prev:c,current:s,next:null,children:[],level:c?c.level+1:0};this.messages.set(s.id,f),this.performOp(c,f,"link"),this.head===c&&(this.head=f),this._messages.dirty()}getMessage(l){const s=this.messages.get(l);if(!s)throw new Error("MessageRepository(updateMessage): Message not found. This is likely an internal bug in assistant-ui.");return{parentId:s.prev?.current.id??null,message:s.current}}appendOptimisticMessage(l,s){let r;do r=mv();while(this.messages.has(r));return this.addOrUpdateMessage(l,oi(s,r,{type:"running"})),r}deleteMessage(l,s){const r=this.messages.get(l);if(!r)throw new Error("MessageRepository(deleteMessage): Message not found. This is likely an internal bug in assistant-ui.");const c=s===void 0?r.prev:s===null?null:this.messages.get(s);if(c===void 0)throw new Error("MessageRepository(deleteMessage): Replacement not found. This is likely an internal bug in assistant-ui.");for(const f of r.children){const h=this.messages.get(f);if(!h)throw new Error("MessageRepository(deleteMessage): Child message not found. This is likely an internal bug in assistant-ui.");this.performOp(c,h,"relink")}this.performOp(null,r,"cut"),this.messages.delete(l),this.head===r&&(this.head=ni(c??this.root)),this._messages.dirty()}getBranches(l){const s=this.messages.get(l);if(!s)throw new Error("MessageRepository(getBranches): Message not found. This is likely an internal bug in assistant-ui.");const{children:r}=s.prev??this.root;return r}switchToBranch(l){const s=this.messages.get(l);if(!s)throw new Error("MessageRepository(switchToBranch): Branch not found. This is likely an internal bug in assistant-ui.");const r=s.prev??this.root;r.next=s,this.head=ni(s),this._messages.dirty()}resetHead(l){if(l===null){this.head=null,this._messages.dirty();return}const s=this.messages.get(l);if(!s)throw new Error("MessageRepository(resetHead): Branch not found. This is likely an internal bug in assistant-ui.");this.head=s;for(let r=s;r;r=r.prev)r.prev&&(r.prev.next=r);this._messages.dirty()}clear(){this.messages.clear(),this.head=null,this.root={children:[],next:null},this._messages.dirty()}export(){const l=[];for(const[,s]of this.messages)l.push({message:s.current,parentId:s.prev?.current.id??null});return{headId:this.head?.current.id??null,messages:l}}import({headId:l,messages:s}){for(const{message:r,parentId:c}of s)this.addOrUpdateMessage(c,r);this.resetHead(l??s.at(-1)?.message.id??null)}},fi=class{_subscriptions=new Set;_connection;get isConnected(){return!!this._connection}notifySubscribers(){for(const l of this._subscriptions)l()}_updateConnection(){if(this._subscriptions.size>0){if(this._connection)return;this._connection=this._connect()}else this._connection?.(),this._connection=void 0}subscribe(l){return this._subscriptions.add(l),this._updateConnection(),()=>{this._subscriptions.delete(l),this._updateConnection()}}},Me=Symbol("skip-update"),ec=class extends fi{constructor(l){super(),this.binding=l}get path(){return this.binding.path}_previousStateDirty=!0;_previousState;getState=()=>{if(!this.isConnected||this._previousStateDirty){const l=this.binding.getState();l!==Me&&(this._previousState=l),this._previousStateDirty=!1}if(this._previousState===void 0)throw new Error("Entry not available in the store");return this._previousState};_connect(){const l=()=>{this._previousStateDirty=!0,this.notifySubscribers()};return this.binding.subscribe(l)}},Ws=class{constructor(l,s){this._core=l,this._threadListBinding=s}get path(){return this._core.path}__internal_bindMethods(){this.switchTo=this.switchTo.bind(this),this.rename=this.rename.bind(this),this.archive=this.archive.bind(this),this.unarchive=this.unarchive.bind(this),this.delete=this.delete.bind(this),this.initialize=this.initialize.bind(this),this.generateTitle=this.generateTitle.bind(this),this.subscribe=this.subscribe.bind(this),this.unstable_on=this.unstable_on.bind(this),this.getState=this.getState.bind(this),this.detach=this.detach.bind(this)}getState(){return this._core.getState()}switchTo(){const l=this._core.getState();return this._threadListBinding.switchToThread(l.id)}rename(l){const s=this._core.getState();return this._threadListBinding.rename(s.id,l)}archive(){const l=this._core.getState();return this._threadListBinding.archive(l.id)}unarchive(){const l=this._core.getState();return this._threadListBinding.unarchive(l.id)}delete(){const l=this._core.getState();return this._threadListBinding.delete(l.id)}initialize(){const l=this._core.getState();return this._threadListBinding.initialize(l.id)}generateTitle(){const l=this._core.getState();return this._threadListBinding.generateTitle(l.id)}unstable_on(l,s){let r=this._core.getState().isMain;return this.subscribe(()=>{const c=this._core.getState().isMain;r!==c&&(r=c,!(l==="switched-to"&&!c)&&(l==="switched-away"&&c||s()))})}subscribe(l){return this._core.subscribe(l)}detach(){const l=this._core.getState();this._threadListBinding.detach(l.id)}};function Av(l,s){if(l===void 0&&s===void 0)return!0;if(l===void 0||s===void 0)return!1;for(const r of Object.keys(l)){const c=l[r],f=s[r];if(!Object.is(c,f))return!1}return!0}var xe=class extends fi{constructor(l){super(),this.binding=l;const s=l.getState();if(s===Me)throw new Error("Entry not available in the store");this._previousState=s}get path(){return this.binding.path}_previousState;getState=()=>(this.isConnected||this._syncState(),this._previousState);_syncState(){const l=this.binding.getState();return l===Me||Av(l,this._previousState)?!1:(this._previousState=l,!0)}_connect(){const l=()=>{this._syncState()&&this.notifySubscribers()};return this.binding.subscribe(l)}},ui=Symbol("innerMessage"),ri=l=>l.content.filter(r=>r.type==="text").map(r=>r.text).join(`

`),Xh=class{constructor(l){this._core=l}get path(){return this._core.path}__internal_bindMethods(){this.getState=this.getState.bind(this),this.remove=this.remove.bind(this),this.subscribe=this.subscribe.bind(this)}getState(){return this._core.getState()}subscribe(l){return this._core.subscribe(l)}},Qh=class extends Xh{constructor(l,s){super(l),this._composerApi=s}remove(){const l=this._composerApi.getState();if(!l)throw new Error("Composer is not available");return l.removeAttachment(this.getState().id)}},Rv=class extends Qh{get source(){return"thread-composer"}},xv=class extends Qh{get source(){return"edit-composer"}},Mv=class extends Xh{get source(){return"message"}constructor(l){super(l)}remove(){throw new Error("Message attachments cannot be removed")}},Zh=class extends fi{constructor(l){super(),this.config=l}getState(){return this.config.binding.getState()}outerSubscribe(l){return this.config.binding.subscribe(l)}_connect(){const l=()=>{this.notifySubscribers()};let s=this.config.binding.getState(),r=s?.unstable_on(this.config.event,l);const c=()=>{const h=this.config.binding.getState();h!==s&&(s=h,r?.(),r=this.config.binding.getState()?.unstable_on(this.config.event,l))},f=this.outerSubscribe(c);return()=>{f?.(),r?.()}}},Kh=Object.freeze([]),kh=Object.freeze({}),wv=l=>Object.freeze({type:"thread",isEditing:l?.isEditing??!1,canCancel:l?.canCancel??!1,isEmpty:l?.isEmpty??!0,attachments:l?.attachments??Kh,text:l?.text??"",role:l?.role??"user",runConfig:l?.runConfig??kh,value:l?.text??""}),Cv=l=>Object.freeze({type:"edit",isEditing:l?.isEditing??!1,canCancel:l?.canCancel??!1,isEmpty:l?.isEmpty??!0,text:l?.text??"",role:l?.role??"user",attachments:l?.attachments??Kh,runConfig:l?.runConfig??kh,value:l?.text??""}),Jh=class{constructor(l){this._core=l}get path(){return this._core.path}__internal_bindMethods(){this.setText=this.setText.bind(this),this.setRunConfig=this.setRunConfig.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.addAttachment=this.addAttachment.bind(this),this.reset=this.reset.bind(this),this.clearAttachments=this.clearAttachments.bind(this),this.send=this.send.bind(this),this.cancel=this.cancel.bind(this),this.setRole=this.setRole.bind(this),this.getAttachmentAccept=this.getAttachmentAccept.bind(this),this.getAttachmentByIndex=this.getAttachmentByIndex.bind(this),this.unstable_on=this.unstable_on.bind(this)}setText(l){const s=this._core.getState();if(!s)throw new Error("Composer is not available");s.setText(l)}setRunConfig(l){const s=this._core.getState();if(!s)throw new Error("Composer is not available");s.setRunConfig(l)}addAttachment(l){const s=this._core.getState();if(!s)throw new Error("Composer is not available");return s.addAttachment(l)}reset(){const l=this._core.getState();if(!l)throw new Error("Composer is not available");return l.reset()}clearAttachments(){const l=this._core.getState();if(!l)throw new Error("Composer is not available");return l.clearAttachments()}send(){const l=this._core.getState();if(!l)throw new Error("Composer is not available");l.send()}cancel(){const l=this._core.getState();if(!l)throw new Error("Composer is not available");l.cancel()}setRole(l){const s=this._core.getState();if(!s)throw new Error("Composer is not available");s.setRole(l)}subscribe(l){return this._core.subscribe(l)}_eventSubscriptionSubjects=new Map;unstable_on(l,s){let r=this._eventSubscriptionSubjects.get(l);return r||(r=new Zh({event:l,binding:this._core}),this._eventSubscriptionSubjects.set(l,r)),r.subscribe(s)}getAttachmentAccept(){const l=this._core.getState();if(!l)throw new Error("Composer is not available");return l.getAttachmentAccept()}},Ov=class extends Jh{get path(){return this._core.path}get type(){return"thread"}_getState;constructor(l){const s=new ec({path:l.path,getState:()=>wv(l.getState()),subscribe:r=>l.subscribe(r)});super({path:l.path,getState:()=>l.getState(),subscribe:r=>s.subscribe(r)}),this._getState=s.getState.bind(s)}getState(){return this._getState()}getAttachmentByIndex(l){return new Rv(new xe({path:{...this.path,attachmentSource:"thread-composer",attachmentSelector:{type:"index",index:l},ref:this.path.ref+`${this.path.ref}.attachments[${l}]`},getState:()=>{const r=this.getState().attachments[l];return r?{...r,source:"thread-composer"}:Me},subscribe:s=>this._core.subscribe(s)}),this._core)}},zv=class extends Jh{constructor(l,s){const r=new ec({path:l.path,getState:()=>Cv(l.getState()),subscribe:c=>l.subscribe(c)});super({path:l.path,getState:()=>l.getState(),subscribe:c=>r.subscribe(c)}),this._beginEdit=s,this._getState=r.getState.bind(r)}get path(){return this._core.path}get type(){return"edit"}_getState;__internal_bindMethods(){super.__internal_bindMethods(),this.beginEdit=this.beginEdit.bind(this)}getState(){return this._getState()}beginEdit(){this._beginEdit()}getAttachmentByIndex(l){return new xv(new xe({path:{...this.path,attachmentSource:"edit-composer",attachmentSelector:{type:"index",index:l},ref:this.path.ref+`${this.path.ref}.attachments[${l}]`},getState:()=>{const r=this.getState().attachments[l];return r?{...r,source:"edit-composer"}:Me},subscribe:s=>this._core.subscribe(s)}),this._core)}},Vr={toResponse(l,s){return new Response(Vr.toByteStream(l,s),{headers:s.headers??{}})},fromResponse(l,s){return Vr.fromByteStream(l.body,s)},toByteStream(l,s){return l.pipeThrough(s)},fromByteStream(l,s){return l.pipeThrough(s)}},$h=function(){let l,s;const r=new Promise((c,f)=>{l=c,s=f});if(!l||!s)throw new Error("Failed to create promise");return{promise:r,resolve:l,reject:s}},Dv=()=>{const l=[];let s=!1,r,c;const f=v=>{v.promise||(v.promise=v.reader.read().then(({done:S,value:T})=>{v.promise=void 0,S?(l.splice(l.indexOf(v),1),s&&l.length===0&&r.close()):r.enqueue(T),c?.resolve(),c=void 0}).catch(S=>{console.error(S),l.forEach(T=>{T.reader.cancel()}),l.length=0,r.error(S),c?.reject(S),c=void 0}))};return{readable:new ReadableStream({start(v){r=v},pull(){return c=$h(),l.forEach(v=>{f(v)}),c.promise},cancel(){l.forEach(v=>{v.reader.cancel()}),l.length=0}}),isSealed(){return s},seal(){s=!0,l.length===0&&r.close()},addStream(v){if(s)throw new Error("Cannot add streams after the run callback has settled.");const S={reader:v.getReader()};l.push(S),f(S)},enqueue(v){this.addStream(new ReadableStream({start(S){S.enqueue(v),S.close()}}))}}},dh=class{_controller;_isClosed=!1;constructor(l){this._controller=l}append(l){return this._controller.enqueue({type:"text-delta",path:[],textDelta:l}),this}close(){this._isClosed||(this._isClosed=!0,this._controller.enqueue({type:"part-finish",path:[]}),this._controller.close())}},Fh=l=>new ReadableStream({start(s){return l.start?.(new dh(s))},pull(s){return l.pull?.(new dh(s))},cancel(s){return l.cancel?.(s)}}),hh=()=>{let l;return[Fh({start(r){l=r}}),l]},mh=class{constructor(l){this._controller=l;const s=Fh({start:c=>{this._argsTextController=c}});let r=!1;this._mergeTask=s.pipeTo(new WritableStream({write:c=>{switch(c.type){case"text-delta":r=!0,this._controller.enqueue(c);break;case"part-finish":r||this._controller.enqueue({type:"text-delta",textDelta:"{}",path:[]}),this._controller.enqueue({type:"tool-call-args-text-finish",path:[]});break;default:throw new Error(`Unexpected chunk type: ${c.type}`)}}}))}_isClosed=!1;_mergeTask;get argsText(){return this._argsTextController}_argsTextController;async setResponse(l){this._argsTextController.close(),await Promise.resolve(),this._controller.enqueue({type:"result",path:[],...l.artifact!==void 0?{artifact:l.artifact}:{},result:l.result,isError:l.isError??!1})}async close(){this._isClosed||(this._isClosed=!0,this._argsTextController.close(),await this._mergeTask,this._controller.enqueue({type:"part-finish",path:[]}),this._controller.close())}},Uv=l=>new ReadableStream({start(s){return l.start?.(new mh(s))},pull(s){return l.pull?.(new mh(s))},cancel(s){return l.cancel?.(s)}}),Nv=()=>{let l;return[Uv({start(r){l=r}}),l]},Wh=class{value=-1;up(){return++this.value}},Bv=class extends TransformStream{constructor(l){super({transform(s,r){r.enqueue({...s,path:[l,...s.path]})}})}};(class extends TransformStream{constructor(l){super({transform(s,r){const{path:[c,...f]}=s;if(l!==c)throw new Error(`Path mismatch: expected ${l}, got ${c}`);r.enqueue({...s,path:f})}})}});var Hv=class extends TransformStream{constructor(l){const s=new Wh,r=new Map;super({transform(c,f){c.type==="part-start"&&c.path.length===0&&r.set(s.up(),l.up());const[h,...v]=c.path;if(h===void 0){f.enqueue(c);return}const S=r.get(h);if(S===void 0)throw new Error("Path not found");f.enqueue({...c,path:[S,...v]})}})}},jv=class extends TransformStream{constructor(l,s,r){const[c,f]=Gv();let h;super({start(v){return h=c.pipeTo(new WritableStream({write(S){v.enqueue(S)},abort(S){v.error(S)},close(){v.terminate()}})).catch(S=>{v.error(S)}),l.start?.(f)},transform(v){return l.transform?.(v,f)},async flush(){await l.flush?.(f),f.close(),await h}},s,r)}},qv=class extends TransformStream{constructor(l){super();const s=l(super.readable);Object.defineProperty(this,"readable",{value:s,writable:!1})}},Ph=Ih("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7),Lv=class tm{_state;_parentId;constructor(s){this._state=s||{merger:Dv(),contentCounter:new Wh}}get __internal_isClosed(){return this._state.merger.isSealed()}__internal_getReadable(){return this._state.merger.readable}__internal_subscribeToClose(s){this._state.closeSubscriber=s}_addPart(s,r){this._state.append&&(this._state.append.controller.close(),this._state.append=void 0),this.enqueue({type:"part-start",part:s,path:[]}),this._state.merger.addStream(r.pipeThrough(new Bv(this._state.contentCounter.value)))}merge(s){this._state.merger.addStream(s.pipeThrough(new Hv(this._state.contentCounter)))}appendText(s){this._state.append?.kind!=="text"&&(this._state.append={kind:"text",controller:this.addTextPart()}),this._state.append.controller.append(s)}appendReasoning(s){this._state.append?.kind!=="reasoning"&&(this._state.append={kind:"reasoning",controller:this.addReasoningPart()}),this._state.append.controller.append(s)}addTextPart(){const[s,r]=hh();return this._addPart({type:"text"},s),r}addReasoningPart(){const[s,r]=hh();return this._addPart({type:"reasoning"},s),r}addToolCallPart(s){const r=typeof s=="string"?{toolName:s}:s,c=r.toolName,f=r.toolCallId??Ph(),[h,v]=Nv();return this._addPart({type:"tool-call",toolName:c,toolCallId:f,...this._parentId&&{parentId:this._parentId}},h),r.argsText!==void 0&&(v.argsText.append(r.argsText),v.argsText.close()),r.args!==void 0&&(v.argsText.append(JSON.stringify(r.args)),v.argsText.close()),r.response!==void 0&&v.setResponse(r.response),v}appendSource(s){this._addPart({...s,...this._parentId&&{parentId:this._parentId}},new ReadableStream({start(r){r.enqueue({type:"part-finish",path:[]}),r.close()}}))}appendFile(s){this._addPart(s,new ReadableStream({start(r){r.enqueue({type:"part-finish",path:[]}),r.close()}}))}enqueue(s){this._state.merger.enqueue(s),s.type==="part-start"&&s.path.length===0&&this._state.contentCounter.up()}withParentId(s){const r=new tm(this._state);return r._parentId=s,r}close(){this._state.merger.seal(),this._state.append?.controller?.close(),this._state.closeSubscriber?.()}};function Yv(l){const s=new Lv;let r;try{r=l(s)}catch(c){throw s.__internal_isClosed||(s.enqueue({type:"error",path:[],error:String(c)}),s.close()),c}return r instanceof Promise?(async()=>{try{await r}catch(f){throw s.__internal_isClosed||s.enqueue({type:"error",path:[],error:String(f)}),f}finally{s.__internal_isClosed||s.close()}})():s.__internal_isClosed||s.close(),s.__internal_getReadable()}function Gv(){const{resolve:l,promise:s}=$h();let r;return[Yv(f=>(r=f,r.__internal_subscribeToClose(l),s)),r]}var Iv=class li{_state;constructor(s=null){this._state=s}get state(){return this._state}append(s){this._state=s.reduce((r,c)=>li.apply(r,c),this._state)}static apply(s,r){const c=r.type;switch(c){case"set":return li.updatePath(s,r.path,()=>r.value);case"append-text":return li.updatePath(s,r.path,f=>{if(typeof f!="string")throw new Error(`Expected string at path [${r.path.join(", ")}]`);return f+r.value});default:{const f=c;throw new Error(`Invalid operation type: ${f}`)}}}static updatePath(s,r,c){if(r.length===0)return c(s);if(s??={},typeof s!="object")throw new Error(`Invalid path: [${r.join(", ")}]`);const[f,...h]=r;if(Array.isArray(s)){const S=Number(f);if(isNaN(S))throw new Error(`Expected array index at [${r.join(", ")}]`);if(S>s.length||S<0)throw new Error("Insert array index out of bounds");const T=[...s];return T[S]=this.updatePath(T[S],h,c),T}const v={...s};return v[f]=this.updatePath(v[f],h,c),v}},Vv=()=>({role:"assistant",status:{type:"running"},parts:[],get content(){return this.parts},metadata:{unstable_state:null,unstable_data:[],unstable_annotations:[],steps:[],custom:{}}}),di=(l,s,r)=>{if(l.parts.length===0)throw new Error("No parts available to update.");if(s.path.length!==1)throw new Error("Nested paths are not supported yet.");const c=s.path[0],f=r(l.parts[c]);return{...l,parts:[...l.parts.slice(0,c),f,...l.parts.slice(c+1)],get content(){return this.parts}}},Xv=(l,s)=>{const r=s.part;if(r.type==="text"||r.type==="reasoning"){const c={type:r.type,text:"",status:{type:"running"},...r.parentId&&{parentId:r.parentId}};return{...l,parts:[...l.parts,c],get content(){return this.parts}}}else if(r.type==="tool-call"){const c={type:"tool-call",state:"partial-call",status:{type:"running",isArgsComplete:!1},toolCallId:r.toolCallId,toolName:r.toolName,argsText:"",args:{},...r.parentId&&{parentId:r.parentId}};return{...l,parts:[...l.parts,c],get content(){return this.parts}}}else if(r.type==="source"){const c={type:"source",sourceType:r.sourceType,id:r.id,url:r.url,...r.title?{title:r.title}:void 0,...r.parentId&&{parentId:r.parentId}};return{...l,parts:[...l.parts,c],get content(){return this.parts}}}else if(r.type==="file"){const c={type:"file",mimeType:r.mimeType,data:r.data};return{...l,parts:[...l.parts,c],get content(){return this.parts}}}else throw new Error(`Unsupported part type: ${r.type}`)},Qv=(l,s)=>di(l,s,r=>{if(r.type!=="tool-call")throw new Error("Last is not a tool call");return r.state!=="partial-call"?r:{...r,state:"call"}}),Zv=(l,s)=>di(l,s,r=>({...r,status:{type:"complete",reason:"unknown"}})),Kv=(l,s)=>di(l,s,r=>{if(r.type==="text"||r.type==="reasoning")return{...r,text:r.text+s.textDelta};if(r.type==="tool-call"){const c=r.argsText+s.textDelta,f=Vh(c)??r.args;return{...r,argsText:c,args:f}}else throw new Error("text-delta received but part is neither text nor tool-call")}),kv=(l,s)=>di(l,s,r=>{if(r.type==="tool-call")return{...r,state:"result",...s.artifact!==void 0?{artifact:s.artifact}:{},result:s.result,isError:s.isError??!1,status:{type:"complete",reason:"stop"}};throw new Error("Result chunk received but part is not a tool-call")}),gh=(l,s)=>{if(l.status?.type==="incomplete"&&l.status?.reason==="error")return l;const r=Jv(s);return{...l,status:r}},Jv=l=>l.finishReason==="tool-calls"?{type:"requires-action",reason:"tool-calls"}:l.finishReason==="stop"||l.finishReason==="unknown"?{type:"complete",reason:l.finishReason}:{type:"incomplete",reason:l.finishReason},$v=(l,s)=>({...l,metadata:{...l.metadata,unstable_annotations:[...l.metadata.unstable_annotations,...s.annotations]}}),Fv=(l,s)=>({...l,metadata:{...l.metadata,unstable_data:[...l.metadata.unstable_data,...s.data]}}),Wv=(l,s)=>({...l,metadata:{...l.metadata,steps:[...l.metadata.steps,{state:"started",messageId:s.messageId}]}}),Pv=(l,s)=>{const r=l.metadata.steps.slice(),c=r.length-1;return r.length>0&&r[c]?.state==="started"?r[c]={...r[c],state:"finished",finishReason:s.finishReason,usage:s.usage,isContinued:s.isContinued}:r.push({state:"finished",messageId:Ph(),finishReason:s.finishReason,usage:s.usage,isContinued:s.isContinued}),{...l,metadata:{...l.metadata,steps:r}}},ty=(l,s)=>({...l,status:{type:"incomplete",reason:"error",error:s.error}}),ey=(l,s)=>{const r=new Iv(l.metadata.unstable_state);return r.append(s.operations),{...l,metadata:{...l.metadata,unstable_state:r.state}}},ay=class extends TransformStream{constructor({initialMessage:l}={}){let s=l??Vv();super({transform(r,c){const f=r.type;switch(f){case"part-start":s=Xv(s,r);break;case"tool-call-args-text-finish":s=Qv(s,r);break;case"part-finish":s=Zv(s,r);break;case"text-delta":s=Kv(s,r);break;case"result":s=kv(s,r);break;case"message-finish":s=gh(s,r);break;case"annotations":s=$v(s,r);break;case"data":s=Fv(s,r);break;case"step-start":s=Wv(s,r);break;case"step-finish":s=Pv(s,r);break;case"error":s=ty(s,r);break;case"update-state":s=ey(s,r);break;default:{const h=f;throw new Error(`Unsupported chunk type: ${h}`)}}c.enqueue(s)},flush(r){if(s.status?.type==="running"){const c=s.parts?.at(-1)?.type==="tool-call";s=gh(s,{finishReason:c?"tool-calls":"unknown"}),r.enqueue(s)}}})}},ny=class extends qv{constructor(){super(l=>{const s=new jv({transform(r,c){c.appendText(r)}});return l.pipeThrough(new TextDecoderStream).pipeThrough(s)})}},ly=class si{constructor(s){this.readable=s,this.readable=s}static fromAssistantStream(s){return new si(s.pipeThrough(new ay))}async unstable_result(){let s;for await(const r of this)s=r;return s||{role:"assistant",status:{type:"complete",reason:"unknown"},parts:[],content:[],metadata:{unstable_state:null,unstable_data:[],unstable_annotations:[],steps:[],custom:{}}}}[Symbol.asyncIterator](){const s=this.readable.getReader();return{async next(){const{done:r,value:c}=await s.read();return r?{done:!0,value:void 0}:{done:!1,value:c}}}}tee(){const[s,r]=this.readable.tee();return[new si(s),new si(r)]}},ph=Symbol.for("aui.tool-response"),sy=class Xr{get[ph](){return!0}artifact;result;isError;constructor(s){s.artifact!==void 0&&(this.artifact=s.artifact),this.result=s.result,this.isError=s.isError??!1}static[Symbol.hasInstance](s){return typeof s=="object"&&s!==null&&ph in s}static toResponse(s){return s instanceof Xr?s:new Xr({result:s===void 0?"<no result>":s})}},Qr=class{constructor(l,s,r){this.contentBinding=l,this.messageApi=s,this.threadApi=r}get path(){return this.contentBinding.path}__internal_bindMethods(){this.addToolResult=this.addToolResult.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this)}getState(){return this.contentBinding.getState()}addToolResult(l){const s=this.contentBinding.getState();if(!s)throw new Error("Message part is not available");if(s.type!=="tool-call")throw new Error("Tried to add tool result to non-tool message part");if(!this.messageApi)throw new Error("Message API is not available. This is likely a bug in assistant-ui.");if(!this.threadApi)throw new Error("Thread API is not available");const r=this.messageApi.getState();if(!r)throw new Error("Message is not available");const c=s.toolName,f=s.toolCallId,h=sy.toResponse(l);this.threadApi.getState().addToolResult({messageId:r.id,toolName:c,toolCallId:f,result:h.result,artifact:h.artifact,isError:h.isError})}subscribe(l){return this.contentBinding.subscribe(l)}},ci=class extends fi{constructor(l){super(),this.binding=l}get path(){return this.binding.path}getState(){return this.binding.getState()}outerSubscribe(l){return this.binding.subscribe(l)}_connect(){const l=()=>{this.notifySubscribers()};let s=this.binding.getState(),r=s?.subscribe(l);const c=()=>{const h=this.binding.getState();h!==s&&(s=h,r?.(),r=this.binding.getState()?.subscribe(l),l())},f=this.outerSubscribe(c);return()=>{f?.(),r?.()}}},Ps=Object.freeze({type:"complete"}),iy=(l,s,r)=>{if(l.role!=="assistant")return Ps;if(r.type==="tool-call")return r.result?Ps:l.status;const c=s===Math.max(0,l.content.length-1);return l.status.type==="requires-action"?Ps:c?l.status:Ps},vh=(l,s)=>{const r=l.content[s];if(!r)return Me;const c=iy(l,s,r);return Object.freeze({...r,[ui]:r[ui],status:c})},uy=class{constructor(l,s){this._core=l,this._threadBinding=s,this.composer=new zv(new ci({path:{...this.path,ref:this.path.ref+`${this.path.ref}.composer`,composerSource:"edit"},getState:this._getEditComposerRuntimeCore,subscribe:r=>this._threadBinding.subscribe(r)}),()=>this._threadBinding.getState().beginEdit(this._core.getState().id))}get path(){return this._core.path}__internal_bindMethods(){this.reload=this.reload.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.getMessagePartByIndex=this.getMessagePartByIndex.bind(this),this.getMessagePartByToolCallId=this.getMessagePartByToolCallId.bind(this),this.getAttachmentByIndex=this.getAttachmentByIndex.bind(this),this.unstable_getCopyText=this.unstable_getCopyText.bind(this),this.speak=this.speak.bind(this),this.stopSpeaking=this.stopSpeaking.bind(this),this.submitFeedback=this.submitFeedback.bind(this),this.switchToBranch=this.switchToBranch.bind(this)}composer;_getEditComposerRuntimeCore=()=>this._threadBinding.getState().getEditComposer(this._core.getState().id);getState(){return this._core.getState()}reload(l={}){const s=this._getEditComposerRuntimeCore(),r=s??this._threadBinding.getState().composer,c=s??r,{runConfig:f=c.runConfig}=l,h=this._core.getState();if(h.role!=="assistant")throw new Error("Can only reload assistant messages");this._threadBinding.getState().startRun({parentId:h.parentId,sourceId:h.id,runConfig:f})}speak(){const l=this._core.getState();return this._threadBinding.getState().speak(l.id)}stopSpeaking(){const l=this._core.getState();if(this._threadBinding.getState().speech?.messageId===l.id)this._threadBinding.getState().stopSpeaking();else throw new Error("Message is not being spoken")}submitFeedback({type:l}){const s=this._core.getState();this._threadBinding.getState().submitFeedback({messageId:s.id,type:l})}switchToBranch({position:l,branchId:s}){const r=this._core.getState();if(s&&l)throw new Error("May not specify both branchId and position");if(!s&&!l)throw new Error("Must specify either branchId or position");const f=this._threadBinding.getState().getBranches(r.id);let h=s;if(l==="previous"?h=f[r.branchNumber-2]:l==="next"&&(h=f[r.branchNumber]),!h)throw new Error("Branch not found");this._threadBinding.getState().switchToBranch(h)}unstable_getCopyText(){return ri(this.getState())}subscribe(l){return this._core.subscribe(l)}getMessagePartByIndex(l){if(l<0)throw new Error("Message part index must be >= 0");return new Qr(new xe({path:{...this.path,ref:this.path.ref+`${this.path.ref}.content[${l}]`,messagePartSelector:{type:"index",index:l}},getState:()=>vh(this.getState(),l),subscribe:s=>this._core.subscribe(s)}),this._core,this._threadBinding)}getMessagePartByToolCallId(l){return new Qr(new xe({path:{...this.path,ref:this.path.ref+`${this.path.ref}.content[toolCallId=${JSON.stringify(l)}]`,messagePartSelector:{type:"toolCallId",toolCallId:l}},getState:()=>{const s=this._core.getState(),r=s.content.findIndex(c=>c.type==="tool-call"&&c.toolCallId===l);return r===-1?Me:vh(s,r)},subscribe:s=>this._core.subscribe(s)}),this._core,this._threadBinding)}getAttachmentByIndex(l){return new Mv(new xe({path:{...this.path,ref:this.path.ref+`${this.path.ref}.attachments[${l}]`,attachmentSource:"message",attachmentSelector:{type:"index",index:l}},getState:()=>{const r=this.getState().attachments?.[l];return r?{...r,source:"message"}:Me},subscribe:s=>this._core.subscribe(s)}))}},ry=l=>({parentId:l.parentId??null,sourceId:l.sourceId??null,runConfig:l.runConfig??{},stream:l.stream}),cy=l=>({parentId:l.parentId??null,sourceId:l.sourceId??null,runConfig:l.runConfig??{}}),oy=(l,s)=>typeof s=="string"?{createdAt:new Date,parentId:l.at(-1)?.id??null,sourceId:null,runConfig:{},role:"user",content:[{type:"text",text:s}],attachments:[],metadata:{custom:{}}}:{createdAt:s.createdAt??new Date,parentId:s.parentId??l.at(-1)?.id??null,sourceId:s.sourceId??null,role:s.role??"user",content:s.content,attachments:s.attachments??[],metadata:s.metadata??{custom:{}},runConfig:s.runConfig??{},startRun:s.startRun},fy=(l,s)=>{const r=l.messages.at(-1);return Object.freeze({threadId:s.id,metadata:s,capabilities:l.capabilities,isDisabled:l.isDisabled,isLoading:l.isLoading,isRunning:r?.role!=="assistant"?!1:r.status.type==="running",messages:l.messages,state:l.state,suggestions:l.suggestions,extras:l.extras,speech:l.speech})},dy=class{get path(){return this._threadBinding.path}get __internal_threadBinding(){return this._threadBinding}_threadBinding;constructor(l,s){const r=new xe({path:l.path,getState:()=>fy(l.getState(),s.getState()),subscribe:c=>{const f=l.subscribe(c),h=s.subscribe(c);return()=>{f(),h()}}});this._threadBinding={path:l.path,getState:()=>l.getState(),getStateState:()=>r.getState(),outerSubscribe:c=>l.outerSubscribe(c),subscribe:c=>l.subscribe(c)},this.composer=new Ov(new ci({path:{...this.path,ref:this.path.ref+`${this.path.ref}.composer`,composerSource:"thread"},getState:()=>this._threadBinding.getState().composer,subscribe:c=>this._threadBinding.subscribe(c)}))}__internal_bindMethods(){this.append=this.append.bind(this),this.unstable_resumeRun=this.unstable_resumeRun.bind(this),this.startRun=this.startRun.bind(this),this.cancelRun=this.cancelRun.bind(this),this.stopSpeaking=this.stopSpeaking.bind(this),this.export=this.export.bind(this),this.import=this.import.bind(this),this.reset=this.reset.bind(this),this.getMesssageByIndex=this.getMesssageByIndex.bind(this),this.getMesssageById=this.getMesssageById.bind(this),this.subscribe=this.subscribe.bind(this),this.unstable_on=this.unstable_on.bind(this),this.getModelContext=this.getModelContext.bind(this),this.getModelConfig=this.getModelConfig.bind(this),this.getState=this.getState.bind(this)}composer;getState(){return this._threadBinding.getStateState()}append(l){this._threadBinding.getState().append(oy(this._threadBinding.getState().messages,l))}subscribe(l){return this._threadBinding.subscribe(l)}getModelContext(){return this._threadBinding.getState().getModelContext()}getModelConfig(){return this.getModelContext()}startRun(l){const s=l===null||typeof l=="string"?{parentId:l}:l;return this._threadBinding.getState().startRun(cy(s))}unstable_resumeRun(l){return this._threadBinding.getState().resumeRun(ry(l))}cancelRun(){this._threadBinding.getState().cancelRun()}stopSpeaking(){return this._threadBinding.getState().stopSpeaking()}export(){return this._threadBinding.getState().export()}import(l){this._threadBinding.getState().import(l)}reset(l){this._threadBinding.getState().reset(l)}getMesssageByIndex(l){if(l<0)throw new Error("Message index must be >= 0");return this._getMessageRuntime({...this.path,ref:this.path.ref+`${this.path.ref}.messages[${l}]`,messageSelector:{type:"index",index:l}},()=>{const s=this._threadBinding.getState().messages,r=s[l];if(r)return{message:r,parentId:s[l-1]?.id??null}})}getMesssageById(l){return this._getMessageRuntime({...this.path,ref:this.path.ref+`${this.path.ref}.messages[messageId=${JSON.stringify(l)}]`,messageSelector:{type:"messageId",messageId:l}},()=>this._threadBinding.getState().getMessageById(l))}_getMessageRuntime(l,s){return new uy(new xe({path:l,getState:()=>{const{message:r,parentId:c}=s()??{},{messages:f,speech:h}=this._threadBinding.getState();if(!r||c===void 0)return Me;const v=this._threadBinding.getState(),S=v.getBranches(r.id),T=v.getSubmittedFeedback(r.id);return{...r,[ui]:r[ui],isLast:f.at(-1)?.id===r.id,parentId:c,branchNumber:S.indexOf(r.id)+1,branchCount:S.length,speech:h?.messageId===r.id?h:void 0,submittedFeedback:T}},subscribe:r=>this._threadBinding.subscribe(r)}),this._threadBinding)}_eventSubscriptionSubjects=new Map;unstable_on(l,s){let r=this._eventSubscriptionSubjects.get(l);return r||(r=new Zh({event:l,binding:this._threadBinding}),this._eventSubscriptionSubjects.set(l,r)),r.subscribe(s)}},hy=l=>({mainThreadId:l.mainThreadId,newThread:l.newThreadId,threads:l.threadIds,archivedThreads:l.archivedThreadIds,isLoading:l.isLoading}),ti=(l,s)=>{if(s===void 0)return Me;const r=l.getItemById(s);return r?{id:r.threadId,threadId:r.threadId,remoteId:r.remoteId,externalId:r.externalId,title:r.title,status:r.status,isMain:r.threadId===l.mainThreadId}:Me},my=class{constructor(l,s=dy){this._core=l,this._runtimeFactory=s;const r=new ec({path:{},getState:()=>hy(l),subscribe:c=>l.subscribe(c)});this._getState=r.getState.bind(r),this._mainThreadListItemRuntime=new Ws(new xe({path:{ref:"threadItems[main]",threadSelector:{type:"main"}},getState:()=>ti(this._core,this._core.mainThreadId),subscribe:c=>this._core.subscribe(c)}),this._core),this.main=new s(new ci({path:{ref:"threads.main",threadSelector:{type:"main"}},getState:()=>l.getMainThreadRuntimeCore(),subscribe:c=>l.subscribe(c)}),this._mainThreadListItemRuntime)}_getState;__internal_bindMethods(){this.switchToThread=this.switchToThread.bind(this),this.switchToNewThread=this.switchToNewThread.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.getById=this.getById.bind(this),this.getItemById=this.getItemById.bind(this),this.getItemByIndex=this.getItemByIndex.bind(this),this.getArchivedItemByIndex=this.getArchivedItemByIndex.bind(this)}switchToThread(l){return this._core.switchToThread(l)}switchToNewThread(){return this._core.switchToNewThread()}getState(){return this._getState()}get isLoading(){return this._core.isLoading}subscribe(l){return this._core.subscribe(l)}_mainThreadListItemRuntime;main;get mainItem(){return this._mainThreadListItemRuntime}getById(l){return new this._runtimeFactory(new ci({path:{ref:"threads[threadId="+JSON.stringify(l)+"]",threadSelector:{type:"threadId",threadId:l}},getState:()=>this._core.getThreadRuntimeCore(l),subscribe:s=>this._core.subscribe(s)}),this.mainItem)}getItemByIndex(l){return new Ws(new xe({path:{ref:`threadItems[${l}]`,threadSelector:{type:"index",index:l}},getState:()=>ti(this._core,this._core.threadIds[l]),subscribe:s=>this._core.subscribe(s)}),this._core)}getArchivedItemByIndex(l){return new Ws(new xe({path:{ref:`archivedThreadItems[${l}]`,threadSelector:{type:"archiveIndex",index:l}},getState:()=>ti(this._core,this._core.archivedThreadIds[l]),subscribe:s=>this._core.subscribe(s)}),this._core)}getItemById(l){return new Ws(new xe({path:{ref:`threadItems[threadId=${l}]`,threadSelector:{type:"threadId",threadId:l}},getState:()=>ti(this._core,l),subscribe:s=>this._core.subscribe(s)}),this._core)}},Zr=x.createContext(null),em=({adapters:l,children:s})=>{const r=x.useContext(Zr);return H.jsx(Zr.Provider,{value:{...r,...l},children:s})},gy=()=>x.useContext(Zr),py=class extends Gh{constructor(l,s,{parentId:r,message:c}){super(),this.runtime=l,this.endEditCallback=s,this._parentId=r,this._sourceId=c.id,this._previousText=ri(c),this.setText(this._previousText),this.setRole(c.role),this.setAttachments(c.attachments??[]),this._nonTextParts=c.content.filter(f=>f.type!=="text"),this.setRunConfig({...l.composer.runConfig})}get canCancel(){return!0}getAttachmentAdapter(){return this.runtime.adapters?.attachments}_nonTextParts;_previousText;_parentId;_sourceId;async handleSend(l){ri(l)!==this._previousText&&this.runtime.append({...l,content:[...l.content,...this._nonTextParts],parentId:this._parentId,sourceId:this._sourceId}),this.handleCancel()}handleCancel(){this.endEditCallback(),this._notifySubscribers()}},vy=class{constructor(l){this._contextProvider=l}_subscriptions=new Set;_isInitialized=!1;repository=new Ev;get messages(){return this.repository.getMessages()}get state(){let l;for(const s of this.messages)if(s.role==="assistant"){l=s;break}return l?.metadata.unstable_state??null}composer=new dv(this);getModelContext(){return this._contextProvider.getModelContext()}_editComposers=new Map;getEditComposer(l){return this._editComposers.get(l)}beginEdit(l){if(this._editComposers.has(l))throw new Error("Edit already in progress");this._editComposers.set(l,new py(this,()=>this._editComposers.delete(l),this.repository.getMessage(l))),this._notifySubscribers()}getMessageById(l){return this.repository.getMessage(l)}getBranches(l){return this.repository.getBranches(l)}switchToBranch(l){this.repository.switchToBranch(l),this._notifySubscribers()}_notifySubscribers(){for(const l of this._subscriptions)l()}_notifyEventSubscribers(l){const s=this._eventSubscribers.get(l);if(s)for(const r of s)r()}subscribe(l){return this._subscriptions.add(l),()=>this._subscriptions.delete(l)}_submittedFeedback={};getSubmittedFeedback(l){return this._submittedFeedback[l]}submitFeedback({messageId:l,type:s}){const r=this.adapters?.feedback;if(!r)throw new Error("Feedback adapter not configured");const{message:c}=this.repository.getMessage(l);r.submit({message:c,type:s}),this._submittedFeedback[l]={type:s},this._notifySubscribers()}_stopSpeaking;speech;speak(l){const s=this.adapters?.speech;if(!s)throw new Error("Speech adapter not configured");const{message:r}=this.repository.getMessage(l);this._stopSpeaking?.();const c=s.speak(ri(r)),f=c.subscribe(()=>{c.status.type==="ended"?(this._stopSpeaking=void 0,this.speech=void 0):this.speech={messageId:l,status:c.status},this._notifySubscribers()});this.speech={messageId:l,status:c.status},this._notifySubscribers(),this._stopSpeaking=()=>{c.cancel(),f(),this.speech=void 0,this._stopSpeaking=void 0}}stopSpeaking(){if(!this._stopSpeaking)throw new Error("No message is being spoken");this._stopSpeaking(),this._notifySubscribers()}ensureInitialized(){this._isInitialized||(this._isInitialized=!0,this._notifyEventSubscribers("initialize"))}export(){return this.repository.export()}import(l){this.ensureInitialized(),this.repository.clear(),this.repository.import(l),this._notifySubscribers()}reset(l){this.import(tc.fromArray(l??[]))}_eventSubscribers=new Map;unstable_on(l,s){if(l==="model-context-update")return this._contextProvider.subscribe?.(s)??(()=>{});const r=this._eventSubscribers.get(l);return r?r.add(s):this._eventSubscribers.set(l,new Set([s])),()=>{this._eventSubscribers.get(l).delete(s)}}};function zn(l,s){function r(c){const f=x.useContext(l);if(!c?.optional&&!f)throw new Error(`This component must be used within ${s}.`);return f}return r}function hi(l,s){function r(f){const h=l(f);return h?h[s]:null}function c(f){let h=!1,v;typeof f=="function"?v=f:f&&typeof f=="object"&&(h=!!f.optional,v=f.selector);const S=r({optional:h});return S?v?S(v):S():null}return{[s]:c,[`${s}Store`]:r}}var Fe=l=>{const s=l;s.__isBound||(s.__internal_bindMethods?.(),s.__isBound=!0)};function yy(l,s=by){Fe(l);const r=x.useSyncExternalStore(l.subscribe,()=>s(l.getState()),()=>s(l.getState()));return x.useDebugValue(r),r}var by=l=>l;function Dn(l){function s(r){let c=!1,f;typeof r=="function"?f=r:r&&(c=!!r.optional,f=r.selector);const h=l({optional:c});return h?yy(h,f):null}return s}var am=x.createContext(null),nm=zn(am,"AssistantRuntimeProvider");function Sy(l){const s=nm(l);return s?s.useAssistantRuntime():null}var{useToolUIs:_y,useToolUIsStore:OS}=hi(nm,"useToolUIs");const yh=l=>{let s;const r=new Set,c=(y,M)=>{const O=typeof y=="function"?y(s):y;if(!Object.is(O,s)){const D=s;s=M??(typeof O!="object"||O===null)?O:Object.assign({},s,O),r.forEach(B=>B(s,D))}},f=()=>s,S={setState:c,getState:f,getInitialState:()=>T,subscribe:y=>(r.add(y),()=>r.delete(y))},T=s=l(c,f,S);return S},Ty=(l=>l?yh(l):yh),Ey=l=>l;function Ay(l,s=Ey){const r=$e.useSyncExternalStore(l.subscribe,$e.useCallback(()=>s(l.getState()),[l,s]),$e.useCallback(()=>s(l.getInitialState()),[l,s]));return $e.useDebugValue(r),r}const bh=l=>{const s=Ty(l),r=c=>Ay(s,c);return Object.assign(r,s),r},ee=(l=>l?bh(l):bh);var Ry=()=>ee(l=>{const s=new Map;return Object.freeze({getToolUI:r=>{const f=s.get(r)?.at(-1);return f||null},setToolUI:(r,c)=>{let f=s.get(r);return f||(f=[],s.set(r,f)),f.push(c),l({}),()=>{const h=f.indexOf(c);h!==-1&&f.splice(h,1),h===f.length&&l({})}}})}),lm=x.createContext(null),xy=zn(lm,"AssistantRuntimeProvider");function Un(l){const s=xy(l);return s?s.useThreadRuntime():null}var sm=Dn(Un),Ne=l=>l,im=x.createContext(null),My=zn(im,"a component passed to <ThreadListPrimitive.Items components={...}>");function mi(l){const s=My(l);return s?s.useThreadListItemRuntime():null}var wy=Dn(mi),Cy=l=>{const[s]=x.useState(()=>ee(()=>l));return x.useEffect(()=>{Fe(l),Ne(s).setState(l,!0)},[l,s]),s},um=({runtime:l,children:s})=>{const r=Cy(l),[c]=x.useState(()=>({useThreadListItemRuntime:r}));return H.jsx(im.Provider,{value:c,children:s})},Oy=()=>{const l=new Set;return ee(()=>({isAtBottom:!0,scrollToBottom:()=>{for(const s of l)s()},onScrollToBottom:s=>(l.add(s),()=>{l.delete(s)})}))},rm=x.createContext(null),zy=zn(rm,"ThreadPrimitive.Viewport"),{useThreadViewport:Dy,useThreadViewportStore:cm}=hi(zy,"useThreadViewport"),Uy=()=>{const l=cm({optional:!0}),[s]=x.useState(()=>Oy());return x.useEffect(()=>l?.getState().onScrollToBottom(()=>{s.getState().scrollToBottom()}),[l,s]),x.useEffect(()=>{if(l)return s.subscribe(r=>{l.getState().isAtBottom!==r.isAtBottom&&Ne(l).setState({isAtBottom:r.isAtBottom})})},[s,l]),s},om=({children:l})=>{const s=Uy(),[r]=x.useState(()=>({useThreadViewport:s}));return H.jsx(rm.Provider,{value:r,children:l})},Ny=l=>{const[s]=x.useState(()=>ee(()=>l));return x.useEffect(()=>{Fe(l),Fe(l.composer),Ne(s).setState(l,!0)},[l,s]),s},By=({children:l,listItemRuntime:s,runtime:r})=>{const c=Ny(r),[f]=x.useState(()=>({useThreadRuntime:c}));return H.jsx(um,{runtime:s,children:H.jsx(lm.Provider,{value:f,children:H.jsx(om,{children:l})})})},Hy=l=>{const[s]=x.useState(()=>ee(()=>l));return x.useEffect(()=>{Fe(l),Fe(l.threads),Ne(s).setState(l,!0)},[l,s]),s},jy=()=>x.useMemo(()=>Ry(),[]),qy=l=>l._core?.RenderComponent,Ly=({children:l,runtime:s})=>{const r=Hy(s),c=jy(),[f]=x.useState(()=>({useToolUIs:c,useAssistantRuntime:r})),h=qy(s);return H.jsxs(am.Provider,{value:f,children:[h&&H.jsx(h,{}),H.jsx(By,{runtime:s.thread,listItemRuntime:s.threads.mainItem,children:l})]})},Yy=x.memo(Ly),ac=x.createContext(null),Gy=zn(ac,"a component passed to <MessagePrimitive.Parts components={...}>");function fm(l){const s=Gy(l);return s?s.useMessagePartRuntime():null}var gi=Dn(fm),Sh={type:"complete"},_h={type:"running"},Iy=({children:l,text:s,isRunning:r})=>{const[c]=x.useState(()=>{const f=ee(()=>({status:r?_h:Sh,type:"text",text:s})),h=new Qr({path:{ref:"text",threadSelector:{type:"main"},messageSelector:{type:"messageId",messageId:""},messagePartSelector:{type:"index",index:0}},getState:f.getState,subscribe:f.subscribe});return Fe(h),{useMessagePartRuntime:ee(()=>h),useMessagePart:f}});return x.useEffect(()=>{const f=c.useMessagePart.getState(),h=f.text!==s,v=r?_h:Sh,S=f.status!==v;!h&&!S||Ne(c.useMessagePart).setState({type:"text",text:s,status:v},!0)},[c,r,s]),H.jsx(ac.Provider,{value:c,children:l})},dm=x.createContext(null),hm=zn(dm,"a component passed to <ThreadPrimitive.Messages components={...} />");function pi(l){const s=hm(l);return s?s.useMessageRuntime():null}var Hl=Dn(pi),Vy=l=>pi(l)?.composer??null,Xy=Dn(Vy),{useMessageUtils:zS,useMessageUtilsStore:Qy}=hi(hm,"useMessageUtils");function nc(l){const s=pi({optional:!0}),r=Un(l);return s?s.composer:r?.composer??null}var Zy=Dn(nc),Th=(l,s)=>s===void 0?l.status?.type==="requires-action"&&l.status.reason==="tool-calls"&&l.content.every(r=>r.type!=="tool-call"||!!r.result):l.status?.type==="requires-action"&&l.status.reason==="tool-calls"&&l.content.every(r=>r.type!=="tool-call"||!!r.result||!s.includes(r.toolName)),Gr=class extends Error{name="AbortError";detach;constructor(l,s){super(s),this.detach=l}},Ky=class extends vy{capabilities={switchToBranch:!0,edit:!0,reload:!0,cancel:!0,unstable_copy:!0,speech:!1,attachments:!1,feedback:!1};abortController=null;isDisabled=!1;_isLoading=!1;get isLoading(){return this._isLoading}_suggestions=[];_suggestionsController=null;get suggestions(){return this._suggestions}get adapters(){return this._options.adapters}constructor(l,s){super(l),this.__internal_setOptions(s)}_options;_lastRunConfig={};get extras(){}__internal_setOptions(l){if(this._options===l)return;this._options=l;let s=!1;const r=l.adapters?.speech!==void 0;this.capabilities.speech!==r&&(this.capabilities.speech=r,s=!0);const c=l.adapters?.attachments!==void 0;this.capabilities.attachments!==c&&(this.capabilities.attachments=c,s=!0);const f=l.adapters?.feedback!==void 0;this.capabilities.feedback!==f&&(this.capabilities.feedback=f,s=!0),s&&this._notifySubscribers()}_loadPromise;__internal_load(){if(this._loadPromise)return this._loadPromise;const l=this.adapters.history?.load()??Promise.resolve(null);return this._isLoading=!0,this._notifySubscribers(),this._loadPromise=l.then(s=>{if(!s)return;this.repository.import(s),this._notifySubscribers();const r=this.adapters.history?.resume?.bind(this.adapters.history);s.unstable_resume&&r&&this.startRun({parentId:this.repository.headId,sourceId:this.repository.headId,runConfig:this._lastRunConfig},r)}).finally(()=>{this._isLoading=!1,this._notifySubscribers()}),this._loadPromise}async append(l){this.ensureInitialized();const s=oi(l,On(),{type:"complete",reason:"unknown"});this.repository.addOrUpdateMessage(l.parentId,s),this._options.adapters.history?.append({parentId:l.parentId,message:s}),l.startRun??l.role==="user"?await this.startRun({parentId:s.id,sourceId:l.sourceId,runConfig:l.runConfig??{}}):(this.repository.resetHead(s.id),this._notifySubscribers())}resumeRun({stream:l,...s}){return this.startRun(s,l)}async startRun({parentId:l,runConfig:s},r){this.ensureInitialized(),this.repository.resetHead(l);let f={id:On(),role:"assistant",status:{type:"running"},content:[],metadata:{unstable_state:this.state,unstable_annotations:[],unstable_data:[],steps:[],custom:{}},createdAt:new Date};this._notifyEventSubscribers("run-start");try{this._suggestions=[],this._suggestionsController?.abort(),this._suggestionsController=null;do f=await this.performRoundtrip(l,f,s,r),r=void 0;while(Th(f,this._options.unstable_humanToolNames))}finally{this._notifyEventSubscribers("run-end")}this._suggestionsController=new AbortController;const h=this._suggestionsController.signal;if(this.adapters.suggestion&&f.status?.type!=="requires-action"){const v=this.adapters.suggestion?.generate({messages:this.messages});if(Symbol.asyncIterator in v)for await(const S of v){if(h.aborted)break;this._suggestions=S}else{const S=await v;if(h.aborted)return;this._suggestions=S}}}async performRoundtrip(l,s,r,c){const f=this.repository.getMessages();this.abortController?.abort(),this.abortController=new AbortController;const h=s.content,v=s.metadata?.unstable_annotations,S=s.metadata?.unstable_data,T=s.metadata?.steps,y=s.metadata?.custom,M=B=>{const k=B.metadata?.steps,nt=k?[...T??[],...k]:void 0,$=B.metadata?.unstable_annotations,Jt=B.metadata?.unstable_data,zt=$?[...v??[],...$]:void 0,lt=Jt?[...S??[],...Jt]:void 0;s={...s,...B.content?{content:[...h,...B.content??[]]}:void 0,status:B.status??s.status,...B.metadata?{metadata:{...s.metadata,...B.metadata.unstable_state?{unstable_state:B.metadata.unstable_state}:void 0,...zt?{unstable_annotations:zt}:void 0,...lt?{unstable_data:lt}:void 0,...nt?{steps:nt}:void 0,...B.metadata?.custom?{custom:{...y??{},...B.metadata.custom}}:void 0}}:void 0},this.repository.addOrUpdateMessage(l,s),this._notifySubscribers()},O=this._options.maxSteps??2;if((s.metadata?.steps?.length??0)>=O)return M({status:{type:"incomplete",reason:"tool-calls"}}),s;M({status:{type:"running"}});try{this._lastRunConfig=r??{};const B=this.getModelContext();c=c??this.adapters.chatModel.run.bind(this.adapters.chatModel);const k=this.abortController.signal,nt=c({messages:f,runConfig:this._lastRunConfig,abortSignal:k,context:B,config:B,unstable_assistantMessageId:s.id,unstable_getMessage(){return s}});if(Symbol.asyncIterator in nt)for await(const $ of nt){if(k.aborted){M({status:{type:"incomplete",reason:"cancelled"}});break}M($)}else M(await nt);s.status.type==="running"&&M({status:{type:"complete",reason:"unknown"}})}catch(B){if(B instanceof Gr)M({status:{type:"incomplete",reason:"cancelled"}});else throw M({status:{type:"incomplete",reason:"error",error:B instanceof Error?B.message:`[${typeof B}] ${new String(B).toString()}`}}),B}finally{this.abortController=null,(s.status.type==="complete"||s.status.type==="incomplete")&&await this._options.adapters.history?.append({parentId:l,message:s})}return s}detach(){const l=new Gr(!0);this.abortController?.abort(l),this.abortController=null}cancelRun(){const l=new Gr(!1);this.abortController?.abort(l),this.abortController=null}addToolResult({messageId:l,toolCallId:s,result:r,isError:c,artifact:f}){const h=this.repository.getMessage(l),{parentId:v}=h;let{message:S}=h;if(S.role!=="assistant")throw new Error("Tried to add tool result to non-assistant message");let T=!1,y=!1;const M=S.content.map(O=>O.type!=="tool-call"||O.toolCallId!==s?O:(y=!0,O.result||(T=!0),{...O,result:r,artifact:f,isError:c}));if(!y)throw new Error("Tried to add tool result to non-existing tool call");S={...S,content:M},this.repository.addOrUpdateMessage(v,S),T&&Th(S,this._options.unstable_humanToolNames)&&this.performRoundtrip(v,S,this._lastRunConfig)}},Eh=Object.freeze([]),ky=class extends Bl{_mainThread;constructor(l){super(),this._mainThread=l()}get isLoading(){return!1}getMainThreadRuntimeCore(){return this._mainThread}get newThreadId(){throw new Error("Method not implemented.")}get threadIds(){throw Eh}get archivedThreadIds(){throw Eh}get mainThreadId(){return"__DEFAULT_ID__"}getThreadRuntimeCore(){throw new Error("Method not implemented.")}getLoadThreadsPromise(){throw new Error("Method not implemented.")}getItemById(l){if(l===this.mainThreadId)return{status:"regular",threadId:this.mainThreadId,remoteId:this.mainThreadId,externalId:void 0,title:void 0,isMain:!0};throw new Error("Method not implemented")}async switchToThread(){throw new Error("Method not implemented.")}switchToNewThread(){throw new Error("Method not implemented.")}rename(){throw new Error("Method not implemented.")}archive(){throw new Error("Method not implemented.")}detach(){throw new Error("Method not implemented.")}unarchive(){throw new Error("Method not implemented.")}delete(){throw new Error("Method not implemented.")}initialize(){throw new Error("Method not implemented.")}generateTitle(){throw new Error("Method not implemented.")}},Jy=class extends Yh{threads;Provider=void 0;_options;constructor(l,s){super(),this._options=l,this.threads=new ky(()=>new Ky(this._contextProvider,this._options)),s&&this.threads.getMainThreadRuntimeCore().import(tc.fromArray(s))}},Ah=l=>{try{const r=l.split(".")[1];if(!r)throw new Error("Invalid JWT format");let c=r.replace(/-/g,"+").replace(/_/g,"/");for(;c.length%4!==0;)c+="=";const f=atob(c),v=JSON.parse(f).exp;if(!v||typeof v!="number")throw new Error('JWT does not contain a valid "exp" field');return v*1e3}catch(s){throw new Error("Unable to determine the token expiry: "+s)}},mm=class{strategy="jwt";cachedToken=null;tokenExpiry=null;#t;constructor(l){this.#t=l}async getAuthHeaders(){const l=Date.now();if(this.cachedToken&&this.tokenExpiry&&this.tokenExpiry-l>30*1e3)return{Authorization:`Bearer ${this.cachedToken}`};const s=await this.#t();return s?(this.cachedToken=s,this.tokenExpiry=Ah(s),{Authorization:`Bearer ${s}`}):!1}readAuthHeaders(l){const s=l.get("Authorization");if(!s)return;const[r,c]=s.split(" ");if(r!=="Bearer"||!c)throw new Error("Invalid auth header received");this.cachedToken=c,this.tokenExpiry=Ah(c)}},$y=class{strategy="api-key";#t;#e;#a;constructor(l,s,r){this.#t=l,this.#e=s,this.#a=r}async getAuthHeaders(){return{Authorization:`Bearer ${this.#t}`,"Aui-User-Id":this.#e,"Aui-Workspace-Id":this.#a}}readAuthHeaders(){}},ei="aui:refresh_token",Fy=class{strategy="anon";baseUrl;jwtStrategy;constructor(l){this.baseUrl=l,this.jwtStrategy=new mm(async()=>{const s=Date.now(),r=localStorage.getItem(ei),c=r?JSON.parse(r):void 0;if(c)if(new Date(c.expires_at).getTime()-s>30*1e3){const y=await fetch(`${this.baseUrl}/v1/auth/tokens/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:c.token})});if(y.ok){const M=await y.json(),{access_token:O,refresh_token:D}=M;return D&&localStorage.setItem(ei,JSON.stringify(D)),O}}else localStorage.removeItem(ei);const f=await fetch(`${this.baseUrl}/v1/auth/tokens/anonymous`,{method:"POST"});if(!f.ok)return null;const h=await f.json(),{access_token:v,refresh_token:S}=h;return!v||!S?null:(localStorage.setItem(ei,JSON.stringify(S)),v)})}async getAuthHeaders(){return this.jwtStrategy.getAuthHeaders()}readAuthHeaders(l){this.jwtStrategy.readAuthHeaders(l)}},Wy=class extends Error{constructor(l){super(l),this.name="APIError"}},Py=class{_auth;_baseUrl;constructor(l){if("authToken"in l)this._baseUrl=l.baseUrl,this._auth=new mm(l.authToken);else if("apiKey"in l)this._baseUrl="https://backend.assistant-api.com",this._auth=new $y(l.apiKey,l.userId,l.workspaceId);else if("anonymous"in l)this._baseUrl=l.baseUrl,this._auth=new Fy(l.baseUrl);else throw new Error("Invalid configuration: Must provide authToken, apiKey, or anonymous configuration")}async initializeAuth(){return!!this._auth.getAuthHeaders()}async makeRawRequest(l,s={}){const r=await this._auth.getAuthHeaders();if(!r)throw new Error("Authorization failed");const c={...r,...s.headers,"Content-Type":"application/json"},f=new URLSearchParams;if(s.query)for(const[S,T]of Object.entries(s.query))T!==!1&&(T===!0?f.set(S,"true"):f.set(S,T.toString()));const h=new URL(`${this._baseUrl}/v1${l}`);h.search=f.toString();const v=await fetch(h,{method:s.method??"GET",headers:c,body:s.body?JSON.stringify(s.body):null});if(this._auth.readAuthHeaders(v.headers),!v.ok){const S=await v.text();try{const T=JSON.parse(S);throw new Wy(T.message)}catch{throw new Error(`Request failed with status ${v.status}, ${S}`)}}return v}async makeRequest(l,s={}){return(await this.makeRawRequest(l,s)).json()}},tb=class{constructor(l){this.cloud=l}async create(){return this.cloud.makeRequest("/auth/tokens",{method:"POST"})}},eb=class{constructor(l){this.cloud=l}__internal_getAssistantOptions(l){return{api:this.cloud._baseUrl+"/v1/runs/stream",headers:async()=>{const s=await this.cloud._auth.getAuthHeaders();if(!s)throw new Error("Authorization failed");return{...s,Accept:"text/plain"}},body:{assistant_id:l,response_format:"vercel-ai-data-stream/v1",thread_id:"unstable_todo"}}}async stream(l){const s=await this.cloud.makeRawRequest("/runs/stream",{method:"POST",headers:{Accept:"text/plain"},body:l});return Vr.fromResponse(s,new ny)}},ab=class{constructor(l){this.cloud=l}async list(l,s){return this.cloud.makeRequest(`/threads/${encodeURIComponent(l)}/messages`,{query:s})}async create(l,s){return this.cloud.makeRequest(`/threads/${encodeURIComponent(l)}/messages`,{method:"POST",body:s})}},nb=class{constructor(l){this.cloud=l,this.messages=new ab(l)}messages;async list(l){return this.cloud.makeRequest("/threads",{query:l})}async create(l){return this.cloud.makeRequest("/threads",{method:"POST",body:l})}async update(l,s){return this.cloud.makeRequest(`/threads/${encodeURIComponent(l)}`,{method:"PUT",body:s})}async delete(l){return this.cloud.makeRequest(`/threads/${encodeURIComponent(l)}`,{method:"DELETE"})}},lb=class{constructor(l){this.cloud=l}async pdfToImages(l){return this.cloud.makeRequest("/files/pdf-to-images",{method:"POST",body:l})}async generatePresignedUploadUrl(l){return this.cloud.makeRequest("/files/attachments/generate-presigned-upload-url",{method:"POST",body:l})}},sb=class{threads;auth;runs;files;constructor(l){const s=new Py(l);this.threads=new nb(s),this.auth={tokens:new tb(s)},this.runs=new eb(s),this.files=new lb(s)}};function Kr(l,s=0){return s>100?!1:l===null||typeof l=="string"||typeof l=="boolean"?!0:typeof l=="number"?!Number.isNaN(l)&&Number.isFinite(l):Array.isArray(l)?l.every(r=>Kr(r,s+1)):typeof l=="object"?Object.entries(l).every(([r,c])=>typeof r=="string"&&Kr(c,s+1)):!1}var ib=l=>({role:l.role,content:l.content.map(s=>{const r=s.type;switch(r){case"text":return{type:"text",text:s.text};case"reasoning":return{type:"reasoning",text:s.text};case"source":return{type:"source",sourceType:s.sourceType,id:s.id,url:s.url,...s.title?{title:s.title}:void 0};case"tool-call":return Kr(s.result)||console.warn("tool-call result is not JSON! "+JSON.stringify(s)),{type:"tool-call",toolCallId:s.toolCallId,toolName:s.toolName,...JSON.stringify(s.args)===s.argsText?{args:s.args}:{argsText:s.argsText},...s.result?{result:s.result}:{},...s.isError?{isError:!0}:{}};default:{const c=r;throw new Error(`Message part type not supported by aui/v0: ${c}`)}}}),metadata:l.metadata,...l.status?{status:l.status?.type==="running"?{type:"incomplete",reason:"cancelled"}:l.status}:void 0}),ub=l=>{const s=l.content,r=oi({id:l.id,createdAt:l.created_at,...s},l.id,{type:"complete",reason:"unknown"});return{parentId:l.parent_id,message:r}},rb=class{constructor(l,s){this.parent=l,this.formatAdapter=s}async append(l){const s=this.formatAdapter.encode(l),r=this.formatAdapter.getId(l.message);return this.parent._appendWithFormat(l.parentId,r,this.formatAdapter.format,s)}async load(){return this.parent._loadWithFormat(this.formatAdapter.format,l=>this.formatAdapter.decode(l))}},cb=class{constructor(l,s){this.cloudRef=l,this.threadListItemRuntime=s}_getIdForLocalId={};withFormat(l){return new rb(this,l)}async append({parentId:l,message:s}){const{remoteId:r}=await this.threadListItemRuntime.initialize(),c=this.cloudRef.current.threads.messages.create(r,{parent_id:l?await this._getIdForLocalId[l]??l:null,format:"aui/v0",content:ib(s)}).then(({message_id:f})=>(this._getIdForLocalId[s.id]=f,f));return this._getIdForLocalId[s.id]=c,c.then(()=>{})}async load(){const l=this.threadListItemRuntime.getState().remoteId;if(!l)return{messages:[]};const{messages:s}=await this.cloudRef.current.threads.messages.list(l,{format:"aui/v0"});return{messages:s.filter(c=>c.format==="aui/v0").map(ub).reverse()}}async _appendWithFormat(l,s,r,c){const{remoteId:f}=await this.threadListItemRuntime.initialize(),h=this.cloudRef.current.threads.messages.create(f,{parent_id:l?await this._getIdForLocalId[l]??l:null,format:r,content:c}).then(({message_id:v})=>(this._getIdForLocalId[s]=v,v));return this._getIdForLocalId[s]=h,h.then(()=>{})}async _loadWithFormat(l,s){const r=this.threadListItemRuntime.getState().remoteId;if(!r)return{messages:[]};const{messages:c}=await this.cloudRef.current.threads.messages.list(r,{format:l});return{messages:c.filter(f=>f.format===l).map(f=>s({id:f.id,parent_id:f.parent_id,format:f.format,content:f.content})).reverse()}}},ob=l=>{const s=mi(),[r]=x.useState(()=>new cb(l,s));return r},fb=class{list(){return Promise.resolve({threads:[]})}rename(){return Promise.resolve()}archive(){return Promise.resolve()}unarchive(){return Promise.resolve()}delete(){return Promise.resolve()}initialize(l){return Promise.resolve({remoteId:l,externalId:void 0})}generateTitle(){return Promise.resolve(new ReadableStream)}},db={},Rh=typeof process<"u"&&db?.NEXT_PUBLIC_ASSISTANT_BASE_URL,xh=Rh?new sb({baseUrl:Rh,anonymous:!0}):void 0,hb=l=>{const s=x.useRef(l);x.useEffect(()=>{s.current=l},[l]);const r=x.useCallback(function({children:h}){const v=ob({get current(){return s.current.cloud??xh}}),S=x.useMemo(()=>({history:v}),[v]);return H.jsx(em,{adapters:S,children:h})},[]),c=l.cloud??xh;return c?{list:async()=>{const{threads:f}=await c.threads.list();return{threads:f.map(h=>({status:h.is_archived?"archived":"regular",remoteId:h.id,title:h.title,externalId:h.external_id??void 0}))}},initialize:async()=>{const h=await(l.create?.()??Promise.resolve()),v=h?h.externalId:void 0,{thread_id:S}=await c.threads.create({last_message_at:new Date,external_id:v});return{externalId:v,remoteId:S}},rename:async(f,h)=>c.threads.update(f,{title:h}),archive:async f=>c.threads.update(f,{is_archived:!0}),unarchive:async f=>c.threads.update(f,{is_archived:!1}),delete:async f=>(await l.delete?.(f),c.threads.delete(f)),generateTitle:async(f,h)=>c.runs.stream({thread_id:f,assistant_id:"system/thread_title",messages:h}),unstable_Provider:r}:new fb},mb=(l,{initialMessages:s,...r})=>{const{modelContext:c,...f}=gy()??{},h=x.useMemo(()=>({...r,adapters:{...f,...r.adapters,chatModel:l}}),[l,r,f]),[v]=x.useState(()=>new Jy(h,s));return x.useEffect(()=>()=>{v.threads.getMainThreadRuntimeCore().detach()},[v]),x.useEffect(()=>{v.threads.getMainThreadRuntimeCore().__internal_setOptions(h),v.threads.getMainThreadRuntimeCore().__internal_load()},[v,h]),x.useEffect(()=>{if(c)return v.registerModelContextProvider(c)},[c,v]),x.useMemo(()=>new gm(v),[v])},gb=(l,{cloud:s,...r}={})=>{const c=hb({cloud:s});return xb({runtimeHook:function(){return mb(l,r)},adapter:c})},gm=class{constructor(l){this._core=l,this.threads=new my(l.threads),this._thread=this.threads.main}threads;get threadList(){return this.threads}_thread;__internal_bindMethods(){this.switchToNewThread=this.switchToNewThread.bind(this),this.switchToThread=this.switchToThread.bind(this),this.registerModelContextProvider=this.registerModelContextProvider.bind(this),this.registerModelConfigProvider=this.registerModelConfigProvider.bind(this),this.reset=this.reset.bind(this)}get thread(){return this._thread}switchToNewThread(){return this._core.threads.switchToNewThread()}switchToThread(l){return this._core.threads.switchToThread(l)}registerModelContextProvider(l){return this._core.registerModelContextProvider(l)}registerModelConfigProvider(l){return this.registerModelContextProvider(l)}reset({initialMessages:l}={}){return this._core.threads.getMainThreadRuntimeCore().import(tc.fromArray(l??[]))}};function vi(l){const s=x.useRef(l);return x.useEffect(()=>{s.current=l}),x.useMemo(()=>(...r)=>s.current?.(...r),[])}var pb=x.createContext(null);function vb(l){const s=x.useContext(pb);if(!l?.optional&&!s)throw new Error("This component must be used within a SmoothContextProvider.");return s}var{useSmoothStatus:DS,useSmoothStatusStore:yb}=hi(vb,"useSmoothStatus"),bb=class{constructor(l,s){this.currentText=l,this.setText=s}animationFrameId=null;lastUpdateTime=Date.now();targetText="";start(){this.animationFrameId===null&&(this.lastUpdateTime=Date.now(),this.animate())}stop(){this.animationFrameId!==null&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}animate=()=>{const l=Date.now();let r=l-this.lastUpdateTime;const c=this.targetText.length-this.currentText.length,f=Math.min(5,250/c);let h=0;for(;r>=f&&h<c;)h++,r-=f;h!==c?this.animationFrameId=requestAnimationFrame(this.animate):this.animationFrameId=null,h!==0&&(this.currentText=this.targetText.slice(0,this.currentText.length+h),this.lastUpdateTime=l-r,this.setText(this.currentText))}},Ir=Object.freeze({type:"running"}),Sb=(l,s=!1)=>{const{text:r}=l,c=Hl({optional:!0,selector:M=>M.id}),f=x.useRef(c),[h,v]=x.useState(r),S=yb({optional:!0}),T=vi(M=>{if(v(M),S){const O=h!==M||l.status.type==="running"?Ir:l.status;Ne(S).setState(O,!0)}});x.useEffect(()=>{if(S){const M=h!==r||l.status.type==="running"?Ir:l.status;Ne(S).setState(M,!0)}},[S,r,h,l.status]);const[y]=x.useState(new bb(r,T));return x.useEffect(()=>{if(!s){y.stop();return}if(f.current!==c||!r.startsWith(y.targetText)){f.current=c,T(r),y.currentText=r,y.targetText=r,y.stop();return}y.targetText=r,y.start()},[T,y,c,s,r]),x.useEffect(()=>()=>{y.stop()},[y]),x.useMemo(()=>s?{type:"text",text:h,status:r===h?l.status:Ir}:l,[s,h,l,r])},_b=class extends Bl{useRuntimeHook;instances=new Map;useAliveThreadsKeysChanged=ee(()=>({}));constructor(l){super(),this.useRuntimeHook=ee(()=>({useRuntime:l}))}startThreadRuntime(l){return this.instances.has(l)||(this.instances.set(l,{}),this.useAliveThreadsKeysChanged.setState({},!0)),new Promise((s,r)=>{const c=()=>{const h=this.instances.get(l);if(!h)f(),r(new Error("Thread was deleted before runtime was started"));else if(h.runtime)f(),s(h.runtime);else return},f=this.subscribe(c);c()})}getThreadRuntimeCore(l){const s=this.instances.get(l);if(s)return s.runtime}stopThreadRuntime(l){this.instances.delete(l),this.useAliveThreadsKeysChanged.setState({},!0)}setRuntimeHook(l){this.useRuntimeHook.getState().useRuntime!==l&&this.useRuntimeHook.setState({useRuntime:l},!0)}_InnerActiveThreadProvider=()=>{const{id:l}=wy(),{useRuntime:s}=this.useRuntimeHook(),r=s(),c=r.thread.__internal_threadBinding,f=x.useCallback(()=>{const S=this.instances.get(l);if(!S)throw new Error("Thread not found. This is a bug in assistant-ui.");S.runtime=c.getState(),h&&this._notifySubscribers()},[l,c]),h=x.useRef(!1);h.current||f(),x.useEffect(()=>(h.current=!0,f(),c.outerSubscribe(f)),[c,f]);const v=mi();return x.useEffect(()=>r.threads.main.unstable_on("initialize",()=>{if(v.getState().status==="new"){v.initialize();const S=r.thread.unstable_on("run-end",()=>{S(),v.generateTitle()})}}),[r,v]),null};_OuterActiveThreadProvider=x.memo(({threadId:l,provider:s})=>{const r=Sy(),c=x.useMemo(()=>r.threads.getItemById(l),[r,l]);return H.jsx(um,{runtime:c,children:H.jsx(s,{children:H.jsx(this._InnerActiveThreadProvider,{})})})});__internal_RenderThreadRuntimes=({provider:l})=>(this.useAliveThreadsKeysChanged(),Array.from(this.instances.keys()).map(s=>H.jsx(this._OuterActiveThreadProvider,{threadId:s,provider:l},s)))},jt=new Error("This is the empty thread, a placeholder for the main thread. You cannot perform any actions on this thread instance. This error is probably because you tried to call a thread method in your render function. Call the method inside a `useEffect` hook instead."),Tb={getMessageById(){},getBranches(){return[]},switchToBranch(){throw jt},append(){throw jt},startRun(){throw jt},resumeRun(){throw jt},cancelRun(){throw jt},addToolResult(){throw jt},speak(){throw jt},stopSpeaking(){throw jt},getSubmittedFeedback(){},submitFeedback(){throw jt},getModelContext(){return{}},composer:{attachments:[],getAttachmentAccept(){return"*"},async addAttachment(){throw jt},async removeAttachment(){throw jt},isEditing:!1,canCancel:!1,isEmpty:!0,text:"",setText(){throw jt},role:"user",setRole(){throw jt},runConfig:{},setRunConfig(){throw jt},async reset(){},async clearAttachments(){},send(){throw jt},cancel(){},subscribe(){return()=>{}},unstable_on(){return()=>{}}},getEditComposer(){},beginEdit(){throw jt},speech:void 0,capabilities:{switchToBranch:!1,edit:!1,reload:!1,cancel:!1,unstable_copy:!1,speech:!1,attachments:!1,feedback:!1},isDisabled:!0,isLoading:!1,messages:[],state:null,suggestions:[],extras:void 0,subscribe(){return()=>{}},import(){throw jt},export(){return{messages:[]}},reset(){throw jt},unstable_on(){return()=>{}}},Mh=(l,s,r)=>r.reduce((c,f)=>f?.(c,s)??c,l),Eb=class extends Bl{_pendingTransforms=[];_baseValue;_cachedValue;constructor(l){super(),this._baseValue=l,this._cachedValue=l}_updateState(){this._cachedValue=this._pendingTransforms.reduce((l,s)=>Mh(l,s.task,[s.loading,s.optimistic]),this._baseValue),this._notifySubscribers()}get baseValue(){return this._baseValue}get value(){return this._cachedValue}update(l){this._baseValue=l,this._updateState()}async optimisticUpdate(l){const s=l.execute(),r={...l,task:s};try{this._pendingTransforms.push(r),this._updateState();const c=await s;return this._baseValue=Mh(this._baseValue,c,[l.optimistic,l.then]),c}finally{const c=this._pendingTransforms.indexOf(r);c>-1&&this._pendingTransforms.splice(c,1),this._updateState()}}};var ii=(l,s)=>{const r=l.threadIdMap[s];if(r!==void 0)return l.threadData[r]},ai=(l,s,r)=>{const c=ii(l,s);if(!c)return l;const{threadId:f,remoteId:h,status:v}=c;if(v===r)return l;const S={...l};switch(v){case"new":S.newThreadId=void 0;break;case"regular":S.threadIds=S.threadIds.filter(T=>T!==f);break;case"archived":S.archivedThreadIds=S.archivedThreadIds.filter(T=>T!==f);break;default:{const T=v;throw new Error(`Unsupported state: ${T}`)}}switch(r){case"regular":S.threadIds=[f,...S.threadIds];break;case"archived":S.archivedThreadIds=[f,...S.archivedThreadIds];break;case"deleted":S.threadData=Object.fromEntries(Object.entries(S.threadData).filter(([T])=>T!==f)),S.threadIdMap=Object.fromEntries(Object.entries(S.threadIdMap).filter(([T])=>T!==f&&T!==h));break;default:{const T=r;throw new Error(`Unsupported state: ${T}`)}}return r!=="deleted"&&(S.threadData={...S.threadData,[f]:{...c,status:r}}),S},Ab=class extends Bl{constructor(l,s){super(),this.contextProvider=s,this._state.subscribe(()=>this._notifySubscribers()),this._hookManager=new _b(l.runtimeHook),this.useProvider=ee(()=>({Provider:l.adapter.unstable_Provider??x.Fragment})),this.__internal_setOptions(l),this.switchToNewThread()}_options;_hookManager;_loadThreadsPromise;_mainThreadId;_state=new Eb({isLoading:!1,newThreadId:void 0,threadIds:[],archivedThreadIds:[],threadIdMap:{},threadData:{}});getLoadThreadsPromise(){return this._loadThreadsPromise||(this._loadThreadsPromise=this._state.optimisticUpdate({execute:()=>this._options.adapter.list(),loading:l=>({...l,isLoading:!0}),then:(l,s)=>{const r=[],c=[],f={},h={};for(const v of s.threads){switch(v.status){case"regular":r.push(v.remoteId);break;case"archived":c.push(v.remoteId);break;default:{const T=v.status;throw new Error(`Unsupported state: ${T}`)}}const S=v.remoteId;f[v.remoteId]=S,h[S]={threadId:v.remoteId,remoteId:v.remoteId,externalId:v.externalId,status:v.status,title:v.title,initializeTask:Promise.resolve({remoteId:v.remoteId,externalId:v.externalId})}}return{...l,threadIds:r,archivedThreadIds:c,threadIdMap:{...l.threadIdMap,...f},threadData:{...l.threadData,...h}}}}).then(()=>{})),this._loadThreadsPromise}useProvider;__internal_setOptions(l){if(this._options===l)return;this._options=l;const s=l.adapter.unstable_Provider??x.Fragment;s!==this.useProvider.getState().Provider&&this.useProvider.setState({Provider:s},!0),this._hookManager.setRuntimeHook(l.runtimeHook)}__internal_load(){this.getLoadThreadsPromise()}get isLoading(){return this._state.value.isLoading}get threadIds(){return this._state.value.threadIds}get archivedThreadIds(){return this._state.value.archivedThreadIds}get newThreadId(){return this._state.value.newThreadId}get mainThreadId(){return this._mainThreadId}getMainThreadRuntimeCore(){const l=this._hookManager.getThreadRuntimeCore(this._mainThreadId);return l||Tb}getThreadRuntimeCore(l){const s=this.getItemById(l);if(!s)throw new Error("Thread not found");const r=this._hookManager.getThreadRuntimeCore(s.threadId);if(!r)throw new Error("Thread not found");return r}getItemById(l){return ii(this._state.value,l)}async switchToThread(l){const s=this.getItemById(l);if(!s)throw new Error("Thread not found");if(this._mainThreadId===s.threadId)return;const r=this._hookManager.startThreadRuntime(s.threadId);this.mainThreadId!==void 0?await r:r.then(()=>this._notifySubscribers()),s.status==="archived"&&await this.unarchive(s.threadId),this._mainThreadId=s.threadId,this._notifySubscribers()}async switchToNewThread(){for(;this._state.baseValue.newThreadId!==void 0&&this._state.value.newThreadId===void 0;)await this._state.waitForUpdate();const l=this._state.value;let s=this._state.value.newThreadId;if(s===void 0){do s=`__LOCALID_${On()}`;while(l.threadIdMap[s]);const r=s;this._state.update({...l,newThreadId:s,threadIdMap:{...l.threadIdMap,[s]:r},threadData:{...l.threadData,[s]:{status:"new",threadId:s}}})}return this.switchToThread(s)}initialize=async l=>{if(this._state.value.newThreadId!==l){const s=this.getItemById(l);if(!s)throw new Error("Thread not found");if(s.status==="new")throw new Error("Unexpected new state");return s.initializeTask}return this._state.optimisticUpdate({execute:()=>this._options.adapter.initialize(l),optimistic:s=>ai(s,l,"regular"),loading:(s,r)=>{const c=l;return{...s,threadData:{...s.threadData,[c]:{...s.threadData[c],initializeTask:r}}}},then:(s,{remoteId:r,externalId:c})=>{const f=ii(s,l);if(!f)return s;const h=l;return{...s,threadIdMap:{...s.threadIdMap,[r]:h},threadData:{...s.threadData,[h]:{...f,initializeTask:Promise.resolve({remoteId:r,externalId:c}),remoteId:r,externalId:c}}}}})};generateTitle=async l=>{const s=this.getItemById(l);if(!s)throw new Error("Thread not found");if(s.status==="new")throw new Error("Thread is not yet initialized");const{remoteId:r}=await s.initializeTask,c=this._hookManager.getThreadRuntimeCore(s.threadId);if(!c)return;const f=c.messages,h=await this._options.adapter.generateTitle(r,f),v=ly.fromAssistantStream(h);for await(const S of v){const T=S.parts.filter(M=>M.type==="text")[0]?.text,y=this._state.baseValue;this._state.update({...y,threadData:{...y.threadData,[s.threadId]:{...s,title:T}}})}};rename(l,s){const r=this.getItemById(l);if(!r)throw new Error("Thread not found");if(r.status==="new")throw new Error("Thread is not yet initialized");return this._state.optimisticUpdate({execute:async()=>{const{remoteId:c}=await r.initializeTask;return this._options.adapter.rename(c,s)},optimistic:c=>{const f=ii(c,l);return f?{...c,threadData:{...c.threadData,[f.threadId]:{...f,title:s}}}:c}})}async _ensureThreadIsNotMain(l){if(l===this.newThreadId)throw new Error("Cannot ensure new thread is not main");l===this._mainThreadId&&await this.switchToNewThread()}async archive(l){const s=this.getItemById(l);if(!s)throw new Error("Thread not found");if(s.status!=="regular")throw new Error("Thread is not yet initialized or already archived");return this._state.optimisticUpdate({execute:async()=>{await this._ensureThreadIsNotMain(s.threadId);const{remoteId:r}=await s.initializeTask;return this._options.adapter.archive(r)},optimistic:r=>ai(r,s.threadId,"archived")})}unarchive(l){const s=this.getItemById(l);if(!s)throw new Error("Thread not found");if(s.status!=="archived")throw new Error("Thread is not archived");return this._state.optimisticUpdate({execute:async()=>{try{const{remoteId:r}=await s.initializeTask;return await this._options.adapter.unarchive(r)}catch(r){throw await this._ensureThreadIsNotMain(s.threadId),r}},optimistic:r=>ai(r,s.threadId,"regular")})}async delete(l){const s=this.getItemById(l);if(!s)throw new Error("Thread not found");if(s.status!=="regular"&&s.status!=="archived")throw new Error("Thread is not yet initialized");return this._state.optimisticUpdate({execute:async()=>{await this._ensureThreadIsNotMain(s.threadId);const{remoteId:r}=await s.initializeTask;return await this._options.adapter.delete(r)},optimistic:r=>ai(r,s.threadId,"deleted")})}async detach(l){const s=this.getItemById(l);if(!s)throw new Error("Thread not found");if(s.status!=="regular"&&s.status!=="archived")throw new Error("Thread is not yet initialized");await this._ensureThreadIsNotMain(s.threadId),this._hookManager.stopThreadRuntime(s.threadId)}useBoundIds=ee(()=>[]);__internal_RenderComponent=()=>{const l=x.useId();x.useEffect(()=>(this.useBoundIds.setState(f=>[...f,l],!0),()=>{this.useBoundIds.setState(f=>f.filter(h=>h!==l),!0)}),[l]);const s=this.useBoundIds(),{Provider:r}=this.useProvider(),c={modelContext:this.contextProvider};return(s.length===0||s[0]===l)&&H.jsx(em,{adapters:c,children:H.jsx(this._hookManager.__internal_RenderThreadRuntimes,{provider:r})})}},Rb=class extends Yh{threads;constructor(l){super(),this.threads=new Ab(l,this._contextProvider)}get RenderComponent(){return this.threads.__internal_RenderComponent}},xb=l=>{const[s]=x.useState(()=>new Rb(l));return x.useEffect(()=>{s.threads.__internal_setOptions(l),s.threads.__internal_load()},[s,l]),x.useMemo(()=>new gm(s),[s])};function wh(l,s){if(typeof l=="function")return l(s);l!=null&&(l.current=s)}function pm(...l){return s=>{let r=!1;const c=l.map(f=>{const h=wh(f,s);return!r&&typeof h=="function"&&(r=!0),h});if(r)return()=>{for(let f=0;f<c.length;f++){const h=c[f];typeof h=="function"?h():wh(l[f],null)}}}}function yi(...l){return x.useCallback(pm(...l),l)}Lh();function vm(l){const s=wb(l),r=x.forwardRef((c,f)=>{const{children:h,...v}=c,S=x.Children.toArray(h),T=S.find(Ob);if(T){const y=T.props.children,M=S.map(O=>O===T?x.Children.count(y)>1?x.Children.only(null):x.isValidElement(y)?y.props.children:null:O);return H.jsx(s,{...v,ref:f,children:x.isValidElement(y)?x.cloneElement(y,void 0,M):null})}return H.jsx(s,{...v,ref:f,children:h})});return r.displayName=`${l}.Slot`,r}var Mb=vm("Slot");function wb(l){const s=x.forwardRef((r,c)=>{const{children:f,...h}=r;if(x.isValidElement(f)){const v=Db(f),S=zb(h,f.props);return f.type!==x.Fragment&&(S.ref=c?pm(c,v):v),x.cloneElement(f,S)}return x.Children.count(f)>1?x.Children.only(null):null});return s.displayName=`${l}.SlotClone`,s}var Cb=Symbol("radix.slottable");function Ob(l){return x.isValidElement(l)&&typeof l.type=="function"&&"__radixId"in l.type&&l.type.__radixId===Cb}function zb(l,s){const r={...s};for(const c in s){const f=l[c],h=s[c];/^on[A-Z]/.test(c)?f&&h?r[c]=(...S)=>{const T=h(...S);return f(...S),T}:f&&(r[c]=f):c==="style"?r[c]={...f,...h}:c==="className"&&(r[c]=[f,h].filter(Boolean).join(" "))}return{...l,...r}}function Db(l){let s=Object.getOwnPropertyDescriptor(l.props,"ref")?.get,r=s&&"isReactWarning"in s&&s.isReactWarning;return r?l.ref:(s=Object.getOwnPropertyDescriptor(l,"ref")?.get,r=s&&"isReactWarning"in s&&s.isReactWarning,r?l.props.ref:l.props.ref||l.ref)}var Ub=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Nn=Ub.reduce((l,s)=>{const r=vm(`Primitive.${s}`),c=x.forwardRef((f,h)=>{const{asChild:v,...S}=f,T=v?r:s;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),H.jsx(T,{...S,ref:h})});return c.displayName=`Primitive.${s}`,{...l,[s]:c}},{}),Nb=l=>{const s=r=>{const c=l.map(f=>f.subscribe(r));return()=>{for(const f of c)f()}};return r=>{const c=()=>r(...l.map(f=>f.getState()));return x.useSyncExternalStore(s,c,c)}},Bb=(l,s)=>x.useMemo(()=>Nb(l),l)(s);function Nl(l,s,{checkForDefaultPrevented:r=!0}={}){return function(f){if(l?.(f),r===!1||!f.defaultPrevented)return s?.(f)}}var Hb=(l,s,r=[])=>{const c=x.forwardRef((f,h)=>{const v={},S={};Object.keys(f).forEach(y=>{r.includes(y)?v[y]=f[y]:S[y]=f[y]});const T=s(v)??void 0;return H.jsx(Nn.button,{type:"button",...S,ref:h,disabled:S.disabled||!T,onClick:Nl(S.onClick,T)})});return c.displayName=l,c};function jb(l,s=globalThis?.document){const r=vi(l);x.useEffect(()=>{const c=f=>{f.key==="Escape"&&r(f)};return s.addEventListener("keydown",c,{capture:!0}),()=>s.removeEventListener("keydown",c,{capture:!0})},[r,s])}var lc=l=>{const s=x.useRef(void 0);return x.useCallback(c=>{s.current&&s.current(),c&&(s.current=l(c))},[l])},qb=()=>{const l=Qy(),s=x.useCallback(r=>{const c=l.getState().setIsHovering,f=()=>{c(!0)},h=()=>{c(!1)};return r.addEventListener("mouseenter",f),r.addEventListener("mouseleave",h),()=>{r.removeEventListener("mouseenter",f),r.removeEventListener("mouseleave",h),c(!1)}},[l]);return lc(s)},kr=x.forwardRef((l,s)=>{const r=qb(),c=yi(s,r);return H.jsx(Nn.div,{...l,ref:c})});kr.displayName="MessagePrimitive.Root";var Lb=l=>{const[s]=x.useState(()=>ee(()=>l));return x.useEffect(()=>{Fe(l),Ne(s).setState(l,!0)},[l,s]),s},Yb=({runtime:l,children:s})=>{const r=Lb(l),[c]=x.useState(()=>({useMessagePartRuntime:r}));return H.jsx(ac.Provider,{value:c,children:s})},Gb=()=>gi(s=>{if(s.type!=="text"&&s.type!=="reasoning")throw new Error("MessagePartText can only be used inside text or reasoning message parts.");return s}),ym=x.forwardRef(({smooth:l=!0,component:s="span",...r},c)=>{const{text:f,status:h}=Sb(Gb(),l);return H.jsx(s,{"data-status":h.type,...r,ref:c,children:f})});ym.displayName="MessagePartPrimitive.Text";var Ib=()=>gi(s=>{if(s.type!=="image")throw new Error("MessagePartImage can only be used inside image message parts.");return s}),bm=x.forwardRef((l,s)=>{const{image:r}=Ib();return H.jsx(Nn.img,{src:r,...l,ref:s})});bm.displayName="MessagePartPrimitive.Image";var Sm=({children:l})=>gi(r=>r.status.type==="running")?l:null;Sm.displayName="MessagePartPrimitive.InProgress";const Ch=l=>Symbol.iterator in l,Oh=l=>"entries"in l,zh=(l,s)=>{const r=l instanceof Map?l:new Map(l.entries()),c=s instanceof Map?s:new Map(s.entries());if(r.size!==c.size)return!1;for(const[f,h]of r)if(!c.has(f)||!Object.is(h,c.get(f)))return!1;return!0},Vb=(l,s)=>{const r=l[Symbol.iterator](),c=s[Symbol.iterator]();let f=r.next(),h=c.next();for(;!f.done&&!h.done;){if(!Object.is(f.value,h.value))return!1;f=r.next(),h=c.next()}return!!f.done&&!!h.done};function Xb(l,s){return Object.is(l,s)?!0:typeof l!="object"||l===null||typeof s!="object"||s===null||Object.getPrototypeOf(l)!==Object.getPrototypeOf(s)?!1:Ch(l)&&Ch(s)?Oh(l)&&Oh(s)?zh(l,s):Vb(l,s):zh({entries:()=>Object.entries(l)},{entries:()=>Object.entries(s)})}function Qb(l){const s=$e.useRef(void 0);return r=>{const c=l(r);return Xb(s.current,c)?s.current:s.current=c}}var Zb=l=>{const s=[];let r=-1;for(let c=0;c<l.length;c++)l[c]==="tool-call"?r===-1&&(r=c):(r!==-1&&(s.push({type:"toolGroup",startIndex:r,endIndex:c-1}),r=-1),s.push({type:"single",index:c}));return r!==-1&&s.push({type:"toolGroup",startIndex:r,endIndex:l.length-1}),s},Kb=()=>{const l=Hl(Qb(s=>s.content.map(r=>r.type)));return x.useMemo(()=>l.length===0?[]:Zb(l),[l])},kb=({Fallback:l,...s})=>{const r=_y(c=>c.getToolUI(s.toolName))??l;return r?H.jsx(r,{...s}):null},Ea={Text:()=>H.jsxs("p",{style:{whiteSpace:"pre-line"},children:[H.jsx(ym,{}),H.jsx(Sm,{children:H.jsx("span",{style:{fontFamily:"revert"},children:" ●"})})]}),Reasoning:()=>null,Source:()=>null,Image:()=>H.jsx(bm,{}),File:()=>null,Unstable_Audio:()=>null,ToolGroup:({children:l})=>l},Jb=({components:{Text:l=Ea.Text,Reasoning:s=Ea.Reasoning,Image:r=Ea.Image,Source:c=Ea.Source,File:f=Ea.File,Unstable_Audio:h=Ea.Unstable_Audio,tools:v={}}={}})=>{const S=fm(),T=gi(),y=T.type;if(y==="tool-call"){const M=D=>S.addToolResult(D);if("Override"in v)return H.jsx(v.Override,{...T,addResult:M});const O=v.by_name?.[T.toolName]??v.Fallback;return H.jsx(kb,{...T,Fallback:O,addResult:M})}if(T.status.type==="requires-action")throw new Error("Encountered unexpected requires-action status");switch(y){case"text":return H.jsx(l,{...T});case"reasoning":return H.jsx(s,{...T});case"source":return H.jsx(c,{...T});case"image":return H.jsx(r,{...T});case"file":return H.jsx(f,{...T});case"audio":return H.jsx(h,{...T});default:const M=y;throw new Error(`Unknown message part type: ${M}`)}},Jr=x.memo(({index:l,components:s})=>{const r=pi(),c=x.useMemo(()=>r.getMessagePartByIndex(l),[r,l]);return H.jsx(Yb,{runtime:c,children:H.jsx(Jb,{components:s})})},(l,s)=>l.index===s.index&&l.components?.Text===s.components?.Text&&l.components?.Reasoning===s.components?.Reasoning&&l.components?.Source===s.components?.Source&&l.components?.Image===s.components?.Image&&l.components?.File===s.components?.File&&l.components?.Unstable_Audio===s.components?.Unstable_Audio&&l.components?.tools===s.components?.tools&&l.components?.ToolGroup===s.components?.ToolGroup);Jr.displayName="MessagePrimitive.PartByIndex";var $b=Object.freeze({type:"complete"}),Fb=({status:l,component:s})=>H.jsx(Iy,{text:"",isRunning:l.type==="running",children:H.jsx(s,{type:"text",text:"",status:l})}),Wb=({components:l})=>{const s=Hl(r=>r.status)??$b;return l?.Empty?H.jsx(l.Empty,{status:s}):H.jsx(Fb,{status:s,component:l?.Text??Ea.Text})},Pb=x.memo(Wb,(l,s)=>l.components?.Empty===s.components?.Empty&&l.components?.Text===s.components?.Text),$r=({components:l})=>{const s=Hl(f=>f.content.length),r=Kb(),c=x.useMemo(()=>s===0?H.jsx(Pb,{components:l}):r.map(f=>{if(f.type==="single")return H.jsx(Jr,{index:f.index,components:l},f.index);{const h=l.ToolGroup??Ea.ToolGroup;return H.jsx(h,{startIndex:f.startIndex,endIndex:f.endIndex,children:Array.from({length:f.endIndex-f.startIndex+1},(v,S)=>H.jsx(Jr,{index:f.startIndex+S,components:l},S))},f.startIndex)}}),[r,l,s]);return H.jsx(H.Fragment,{children:c})};$r.displayName="MessagePrimitive.Parts";var _m=()=>{const l=nc(),s=Un(),r=Bb([s,l],(f,h)=>f.isRunning||!h.isEditing||h.isEmpty),c=x.useCallback(()=>{l.send()},[l]);return r?null:c},tS=Hb("ComposerPrimitive.Send",_m),Tm=x.forwardRef(({onSubmit:l,...s},r)=>{const c=_m(),f=h=>{h.preventDefault(),c&&c()};return H.jsx(Nn.form,{...s,ref:r,onSubmit:Nl(l,f)})});Tm.displayName="ComposerPrimitive.Root";function Fr(){return Fr=Object.assign?Object.assign.bind():function(l){for(var s=1;s<arguments.length;s++){var r=arguments[s];for(var c in r)({}).hasOwnProperty.call(r,c)&&(l[c]=r[c])}return l},Fr.apply(null,arguments)}function eS(l,s){if(l==null)return{};var r={};for(var c in l)if({}.hasOwnProperty.call(l,c)){if(s.indexOf(c)!==-1)continue;r[c]=l[c]}return r}var aS=x.useLayoutEffect,nS=function(s){var r=$e.useRef(s);return aS(function(){r.current=s}),r},Dh=function(s,r){if(typeof s=="function"){s(r);return}s.current=r},lS=function(s,r){var c=$e.useRef();return $e.useCallback(function(f){s.current=f,c.current&&Dh(c.current,null),c.current=r,r&&Dh(r,f)},[r])},Uh={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},sS=function(s){Object.keys(Uh).forEach(function(r){s.style.setProperty(r,Uh[r],"important")})},Nh=sS,kt=null,Bh=function(s,r){var c=s.scrollHeight;return r.sizingStyle.boxSizing==="border-box"?c+r.borderSize:c-r.paddingSize};function iS(l,s,r,c){r===void 0&&(r=1),c===void 0&&(c=1/0),kt||(kt=document.createElement("textarea"),kt.setAttribute("tabindex","-1"),kt.setAttribute("aria-hidden","true"),Nh(kt)),kt.parentNode===null&&document.body.appendChild(kt);var f=l.paddingSize,h=l.borderSize,v=l.sizingStyle,S=v.boxSizing;Object.keys(v).forEach(function(D){var B=D;kt.style[B]=v[B]}),Nh(kt),kt.value=s;var T=Bh(kt,l);kt.value=s,T=Bh(kt,l),kt.value="x";var y=kt.scrollHeight-f,M=y*r;S==="border-box"&&(M=M+f+h),T=Math.max(M,T);var O=y*c;return S==="border-box"&&(O=O+f+h),T=Math.min(O,T),[T,y]}var Hh=function(){},uS=function(s,r){return s.reduce(function(c,f){return c[f]=r[f],c},{})},rS=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],cS=!!document.documentElement.currentStyle,oS=function(s){var r=window.getComputedStyle(s);if(r===null)return null;var c=uS(rS,r),f=c.boxSizing;if(f==="")return null;cS&&f==="border-box"&&(c.width=parseFloat(c.width)+parseFloat(c.borderRightWidth)+parseFloat(c.borderLeftWidth)+parseFloat(c.paddingRight)+parseFloat(c.paddingLeft)+"px");var h=parseFloat(c.paddingBottom)+parseFloat(c.paddingTop),v=parseFloat(c.borderBottomWidth)+parseFloat(c.borderTopWidth);return{sizingStyle:c,paddingSize:h,borderSize:v}},fS=oS;function sc(l,s,r){var c=nS(r);x.useLayoutEffect(function(){var f=function(v){return c.current(v)};if(l)return l.addEventListener(s,f),function(){return l.removeEventListener(s,f)}},[])}var dS=function(s,r){sc(document.body,"reset",function(c){s.current.form===c.target&&r(c)})},hS=function(s){sc(window,"resize",s)},mS=function(s){sc(document.fonts,"loadingdone",s)},gS=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],pS=function(s,r){var c=s.cacheMeasurements,f=s.maxRows,h=s.minRows,v=s.onChange,S=v===void 0?Hh:v,T=s.onHeightChange,y=T===void 0?Hh:T,M=eS(s,gS),O=M.value!==void 0,D=x.useRef(null),B=lS(D,r),k=x.useRef(0),nt=x.useRef(),$=function(){var lt=D.current,Mt=c&&nt.current?nt.current:fS(lt);if(Mt){nt.current=Mt;var P=iS(Mt,lt.value||lt.placeholder||"x",h,f),At=P[0],qt=P[1];k.current!==At&&(k.current=At,lt.style.setProperty("height",At+"px","important"),y(At,{rowHeight:qt}))}},Jt=function(lt){O||$(),S(lt)};return x.useLayoutEffect($),dS(D,function(){if(!O){var zt=D.current.value;requestAnimationFrame(function(){var lt=D.current;lt&&zt!==lt.value&&$()})}}),hS($),mS($),x.createElement("textarea",Fr({},M,{onChange:Jt,ref:B}))},vS=x.forwardRef(pS),Em=l=>{const s=vi(l),r=Dy(c=>c.onScrollToBottom);x.useEffect(()=>r(s),[r,s])},Am=x.forwardRef(({autoFocus:l=!1,asChild:s,disabled:r,onChange:c,onKeyDown:f,onPaste:h,submitOnEnter:v=!0,cancelOnEscape:S=!0,unstable_focusOnRunStart:T=!0,unstable_focusOnScrollToBottom:y=!0,unstable_focusOnThreadSwitched:M=!0,addAttachmentOnPaste:O=!0,...D},B)=>{const k=mi(),nt=Un(),$=nc(),Jt=Zy(rt=>rt.isEditing?rt.text:""),zt=s?Mb:vS,lt=!!(sm(rt=>rt.isDisabled)||r),Mt=x.useRef(null),P=yi(B,Mt);jb(rt=>{S&&$.getState().canCancel&&($.cancel(),rt.preventDefault())});const At=rt=>{if(!(lt||!v)&&!rt.nativeEvent.isComposing&&rt.key==="Enter"&&rt.shiftKey===!1){const{isRunning:ae}=nt.getState();ae||(rt.preventDefault(),Mt.current?.closest("form")?.requestSubmit())}},qt=async rt=>{if(!O)return;const ae=nt.getState().capabilities,wt=Array.from(rt.clipboardData?.files||[]);if(ae.attachments&&wt.length>0)try{rt.preventDefault(),await Promise.all(wt.map(Te=>$.addAttachment(Te)))}catch(Te){console.error("Error adding attachment:",Te)}},It=l&&!lt,Dt=x.useCallback(()=>{const rt=Mt.current;!rt||!It||(rt.focus({preventScroll:!0}),rt.setSelectionRange(rt.value.length,rt.value.length))},[It]);return x.useEffect(()=>Dt(),[Dt]),Em(()=>{$.type==="thread"&&y&&Dt()}),x.useEffect(()=>{if(!($.type!=="thread"||!T))return nt.unstable_on("run-start",Dt)},[T,Dt,$,nt]),x.useEffect(()=>{if(!($.type!=="thread"||!M))return k.unstable_on("switched-to",Dt)},[M,Dt,$,k]),H.jsx(zt,{name:"input",value:Jt,...D,ref:P,disabled:lt,onChange:Nl(c,rt=>{if($.getState().isEditing)return $.setText(rt.target.value)}),onKeyDown:Nl(f,At),onPaste:Nl(h,qt)})});Am.displayName="ComposerPrimitive.Input";var Rm=x.forwardRef((l,s)=>H.jsx(Nn.div,{...l,ref:s}));Rm.displayName="ThreadPrimitive.Root";var yS=l=>{const s=vi(l),r=x.useCallback(c=>{const f=new ResizeObserver(()=>{s()}),h=new MutationObserver(()=>{s()});return f.observe(c),h.observe(c,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),()=>{f.disconnect(),h.disconnect()}},[s]);return lc(r)},bS=({autoScroll:l=!0})=>{const s=x.useRef(null),r=cm(),c=x.useRef(0),f=x.useRef(!1),h=x.useCallback(O=>{const D=s.current;!D||!l||(f.current=!0,D.scrollTo({top:D.scrollHeight,behavior:O}))},[l]),v=()=>{const O=s.current;if(!O)return;const D=r.getState().isAtBottom,B=O.scrollHeight-O.scrollTop<=O.clientHeight+1;!B&&c.current<O.scrollTop||(B&&(f.current=!1),B!==D&&Ne(r).setState({isAtBottom:B})),c.current=O.scrollTop},S=yS(()=>{(f.current||r.getState().isAtBottom)&&h("instant"),v()}),T=lc(O=>(O.addEventListener("scroll",v),()=>{O.removeEventListener("scroll",v)}));Em(()=>{h("auto")});const y=Un();return x.useEffect(()=>y.unstable_on("run-start",()=>h("auto")),[h,y]),yi(S,T,s)},xm=x.forwardRef(({autoScroll:l,children:s,...r},c)=>{const f=bS({autoScroll:l}),h=yi(c,f);return H.jsx(Nn.div,{...r,ref:h,children:s})});xm.displayName="ThreadPrimitive.ViewportScrollable";var Mm=x.forwardRef((l,s)=>H.jsx(om,{children:H.jsx(xm,{...l,ref:s})}));Mm.displayName="ThreadPrimitive.Viewport";var SS=()=>ee(l=>({isCopied:!1,setIsCopied:s=>{l({isCopied:s})},isHovering:!1,setIsHovering:s=>{l({isHovering:s})}})),_S=l=>{const[s]=x.useState(()=>ee(()=>l));return x.useEffect(()=>{Fe(l),Ne(s).setState(l,!0)},[l,s]),s},TS=()=>{const[l]=x.useState(()=>SS());return l},ES=({runtime:l,children:s})=>{const r=_S(l),c=TS(),[f]=x.useState(()=>({useMessageRuntime:r,useMessageUtils:c}));return H.jsx(dm.Provider,{value:f,children:s})},wm=(l,s)=>l.Message===s.Message&&l.EditComposer===s.EditComposer&&l.UserEditComposer===s.UserEditComposer&&l.AssistantEditComposer===s.AssistantEditComposer&&l.SystemEditComposer===s.SystemEditComposer&&l.UserMessage===s.UserMessage&&l.AssistantMessage===s.AssistantMessage&&l.SystemMessage===s.SystemMessage,AS=()=>null,RS=(l,s,r)=>{switch(s){case"user":return r?l.UserEditComposer??l.EditComposer??l.UserMessage??l.Message:l.UserMessage??l.Message;case"assistant":return r?l.AssistantEditComposer??l.EditComposer??l.AssistantMessage??l.Message:l.AssistantMessage??l.Message;case"system":return r?l.SystemEditComposer??l.EditComposer??l.SystemMessage??l.Message:l.SystemMessage??AS;default:const c=s;throw new Error(`Unknown message role: ${c}`)}},xS=({components:l})=>{const s=Hl(f=>f.role),r=Xy(f=>f.isEditing),c=RS(l,s,r);return H.jsx(c,{})},Cm=x.memo(({index:l,components:s})=>{const r=Un(),c=x.useMemo(()=>r.getMesssageByIndex(l),[r,l]);return H.jsx(ES,{runtime:c,children:H.jsx(xS,{components:s})})},(l,s)=>l.index===s.index&&wm(l.components,s.components));Cm.displayName="ThreadPrimitive.MessageByIndex";var Om=({components:l})=>{const s=sm(c=>c.messages.length);return x.useMemo(()=>s===0?null:Array.from({length:s},(c,f)=>H.jsx(Cm,{index:f,components:l},f)),[s,l])};Om.displayName="ThreadPrimitive.Messages";var MS=x.memo(Om,(l,s)=>wm(l.components,s.components));function jh(l){return typeof l=="string"?l:Array.isArray(l)?l.map(s=>typeof s=="string"?s:s?.text??s?.content??"").filter(Boolean).join(`
`):l&&typeof l=="object"&&"text"in l?l.text:""}function wS(l){return l.replace(/<think>[\s\S]*?<\/think>/g,"").trim()}function CS(){const l=gb({async run({messages:s,abortSignal:r}){const c=s.map(S=>({role:S.role,content:jh(S.content)})),f=await fetch("/api/assistant/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:c}),signal:r});if(!f.ok)throw new Error(await f.text());const h=await f.json(),v=wS(typeof h.content=="string"?h.content:jh(h.content));return{role:h.role??"assistant",content:[{type:"text",text:v}]}}});return H.jsx(Yy,{runtime:l,children:H.jsx("div",{style:{height:"70vh",maxWidth:960,margin:"0 auto"},children:H.jsx(Rm,{className:"aui-root aui-thread-root",style:{height:"100%"},children:H.jsxs(Mm,{className:"aui-thread-viewport",children:[H.jsx(MS,{components:{AssistantMessage:()=>H.jsx(kr,{className:"aui-assistant-message-root",children:H.jsx("div",{className:"aui-assistant-message-content",children:H.jsx($r,{})})}),UserMessage:()=>H.jsx(kr,{className:"aui-user-message-root",children:H.jsx("div",{className:"aui-user-message-content",children:H.jsx($r,{})})})}}),H.jsx("div",{className:"aui-thread-viewport-footer",children:H.jsxs(Tm,{className:"aui-composer-root",children:[H.jsx(Am,{className:"aui-composer-input",rows:1,placeholder:"Напиши сообщение…"}),H.jsx(tS,{children:"Send"})]})})]})})})})}const qh=document.getElementById("assistant-root")||document.getElementById("root");qh&&rv.createRoot(qh).render(H.jsx($e.StrictMode,{children:H.jsx(CS,{})}));
