@convex-dev/agent-playground
Version:
A dashboard for the Convex Agent component.
224 lines • 522 kB
JavaScript
var Z1=Object.defineProperty;var W1=(n,a,s)=>a in n?Z1(n,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[a]=s;var sl=(n,a,s)=>W1(n,typeof a!="symbol"?a+"":a,s);function J1(n,a){for(var s=0;s<a.length;s++){const i=a[s];if(typeof i!="string"&&!Array.isArray(i)){for(const l in i)if(l!=="default"&&!(l in n)){const u=Object.getOwnPropertyDescriptor(i,l);u&&Object.defineProperty(n,l,u.get?u:{enumerable:!0,get:()=>i[l]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function s(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function i(l){if(l.ep)return;l.ep=!0;const u=s(l);fetch(l.href,u)}})();function Nv(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var yf={exports:{}},yi={};/**
* @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 Kp;function eS(){if(Kp)return yi;Kp=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function s(i,l,u){var d=null;if(u!==void 0&&(d=""+u),l.key!==void 0&&(d=""+l.key),"key"in l){u={};for(var h in l)h!=="key"&&(u[h]=l[h])}else u=l;return l=u.ref,{$$typeof:n,type:i,key:d,ref:l!==void 0?l:null,props:u}}return yi.Fragment=a,yi.jsx=s,yi.jsxs=s,yi}var Fp;function tS(){return Fp||(Fp=1,yf.exports=eS()),yf.exports}var y=tS(),vf={exports:{}},be={};/**
* @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 Zp;function nS(){if(Zp)return be;Zp=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),T=Symbol.iterator;function S(A){return A===null||typeof A!="object"?null:(A=T&&A[T]||A["@@iterator"],typeof A=="function"?A:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,E={};function C(A,H,W){this.props=A,this.context=H,this.refs=E,this.updater=W||w}C.prototype.isReactComponent={},C.prototype.setState=function(A,H){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,H,"setState")},C.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function j(){}j.prototype=C.prototype;function M(A,H,W){this.props=A,this.context=H,this.refs=E,this.updater=W||w}var _=M.prototype=new j;_.constructor=M,N(_,C.prototype),_.isPureReactComponent=!0;var z=Array.isArray,k={H:null,A:null,T:null,S:null,V:null},$=Object.prototype.hasOwnProperty;function I(A,H,W,F,te,ue){return W=ue.ref,{$$typeof:n,type:A,key:H,ref:W!==void 0?W:null,props:ue}}function ae(A,H){return I(A.type,H,void 0,void 0,void 0,A.props)}function le(A){return typeof A=="object"&&A!==null&&A.$$typeof===n}function he(A){var H={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(W){return H[W]})}var de=/\/+/g;function ee(A,H){return typeof A=="object"&&A!==null&&A.key!=null?he(""+A.key):H.toString(36)}function me(){}function Z(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(me,me):(A.status="pending",A.then(function(H){A.status==="pending"&&(A.status="fulfilled",A.value=H)},function(H){A.status==="pending"&&(A.status="rejected",A.reason=H)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function se(A,H,W,F,te){var ue=typeof A;(ue==="undefined"||ue==="boolean")&&(A=null);var oe=!1;if(A===null)oe=!0;else switch(ue){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(A.$$typeof){case n:case a:oe=!0;break;case v:return oe=A._init,se(oe(A._payload),H,W,F,te)}}if(oe)return te=te(A),oe=F===""?"."+ee(A,0):F,z(te)?(W="",oe!=null&&(W=oe.replace(de,"$&/")+"/"),se(te,H,W,"",function(je){return je})):te!=null&&(le(te)&&(te=ae(te,W+(te.key==null||A&&A.key===te.key?"":(""+te.key).replace(de,"$&/")+"/")+oe)),H.push(te)),1;oe=0;var re=F===""?".":F+":";if(z(A))for(var fe=0;fe<A.length;fe++)F=A[fe],ue=re+ee(F,fe),oe+=se(F,H,W,ue,te);else if(fe=S(A),typeof fe=="function")for(A=fe.call(A),fe=0;!(F=A.next()).done;)F=F.value,ue=re+ee(F,fe++),oe+=se(F,H,W,ue,te);else if(ue==="object"){if(typeof A.then=="function")return se(Z(A),H,W,F,te);throw H=String(A),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return oe}function L(A,H,W){if(A==null)return A;var F=[],te=0;return se(A,F,"","",function(ue){return H.call(W,ue,te++)}),F}function Y(A){if(A._status===-1){var H=A._result;H=H(),H.then(function(W){(A._status===0||A._status===-1)&&(A._status=1,A._result=W)},function(W){(A._status===0||A._status===-1)&&(A._status=2,A._result=W)}),A._status===-1&&(A._status=0,A._result=H)}if(A._status===1)return A._result.default;throw A._result}var K=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)};function J(){}return be.Children={map:L,forEach:function(A,H,W){L(A,function(){H.apply(this,arguments)},W)},count:function(A){var H=0;return L(A,function(){H++}),H},toArray:function(A){return L(A,function(H){return H})||[]},only:function(A){if(!le(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},be.Component=C,be.Fragment=s,be.Profiler=l,be.PureComponent=M,be.StrictMode=i,be.Suspense=m,be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,be.__COMPILER_RUNTIME={__proto__:null,c:function(A){return k.H.useMemoCache(A)}},be.cache=function(A){return function(){return A.apply(null,arguments)}},be.cloneElement=function(A,H,W){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var F=N({},A.props),te=A.key,ue=void 0;if(H!=null)for(oe in H.ref!==void 0&&(ue=void 0),H.key!==void 0&&(te=""+H.key),H)!$.call(H,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&H.ref===void 0||(F[oe]=H[oe]);var oe=arguments.length-2;if(oe===1)F.children=W;else if(1<oe){for(var re=Array(oe),fe=0;fe<oe;fe++)re[fe]=arguments[fe+2];F.children=re}return I(A.type,te,void 0,void 0,ue,F)},be.createContext=function(A){return A={$$typeof:d,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:u,_context:A},A},be.createElement=function(A,H,W){var F,te={},ue=null;if(H!=null)for(F in H.key!==void 0&&(ue=""+H.key),H)$.call(H,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(te[F]=H[F]);var oe=arguments.length-2;if(oe===1)te.children=W;else if(1<oe){for(var re=Array(oe),fe=0;fe<oe;fe++)re[fe]=arguments[fe+2];te.children=re}if(A&&A.defaultProps)for(F in oe=A.defaultProps,oe)te[F]===void 0&&(te[F]=oe[F]);return I(A,ue,void 0,void 0,null,te)},be.createRef=function(){return{current:null}},be.forwardRef=function(A){return{$$typeof:h,render:A}},be.isValidElement=le,be.lazy=function(A){return{$$typeof:v,_payload:{_status:-1,_result:A},_init:Y}},be.memo=function(A,H){return{$$typeof:g,type:A,compare:H===void 0?null:H}},be.startTransition=function(A){var H=k.T,W={};k.T=W;try{var F=A(),te=k.S;te!==null&&te(W,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(J,K)}catch(ue){K(ue)}finally{k.T=H}},be.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()},be.use=function(A){return k.H.use(A)},be.useActionState=function(A,H,W){return k.H.useActionState(A,H,W)},be.useCallback=function(A,H){return k.H.useCallback(A,H)},be.useContext=function(A){return k.H.useContext(A)},be.useDebugValue=function(){},be.useDeferredValue=function(A,H){return k.H.useDeferredValue(A,H)},be.useEffect=function(A,H,W){var F=k.H;if(typeof W=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return F.useEffect(A,H)},be.useId=function(){return k.H.useId()},be.useImperativeHandle=function(A,H,W){return k.H.useImperativeHandle(A,H,W)},be.useInsertionEffect=function(A,H){return k.H.useInsertionEffect(A,H)},be.useLayoutEffect=function(A,H){return k.H.useLayoutEffect(A,H)},be.useMemo=function(A,H){return k.H.useMemo(A,H)},be.useOptimistic=function(A,H){return k.H.useOptimistic(A,H)},be.useReducer=function(A,H,W){return k.H.useReducer(A,H,W)},be.useRef=function(A){return k.H.useRef(A)},be.useState=function(A){return k.H.useState(A)},be.useSyncExternalStore=function(A,H,W){return k.H.useSyncExternalStore(A,H,W)},be.useTransition=function(){return k.H.useTransition()},be.version="19.1.0",be}var Wp;function vd(){return Wp||(Wp=1,vf.exports=nS()),vf.exports}var x=vd();const ne=Nv(x),bd=J1({__proto__:null,default:ne},[x]);var bf={exports:{}},vi={},xf={exports:{}},wf={};/**
* @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 Jp;function aS(){return Jp||(Jp=1,function(n){function a(L,Y){var K=L.length;L.push(Y);e:for(;0<K;){var J=K-1>>>1,A=L[J];if(0<l(A,Y))L[J]=Y,L[K]=A,K=J;else break e}}function s(L){return L.length===0?null:L[0]}function i(L){if(L.length===0)return null;var Y=L[0],K=L.pop();if(K!==Y){L[0]=K;e:for(var J=0,A=L.length,H=A>>>1;J<H;){var W=2*(J+1)-1,F=L[W],te=W+1,ue=L[te];if(0>l(F,K))te<A&&0>l(ue,F)?(L[J]=ue,L[te]=K,J=te):(L[J]=F,L[W]=K,J=W);else if(te<A&&0>l(ue,K))L[J]=ue,L[te]=K,J=te;else break e}}return Y}function l(L,Y){var K=L.sortIndex-Y.sortIndex;return K!==0?K:L.id-Y.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var d=Date,h=d.now();n.unstable_now=function(){return d.now()-h}}var m=[],g=[],v=1,T=null,S=3,w=!1,N=!1,E=!1,C=!1,j=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function z(L){for(var Y=s(g);Y!==null;){if(Y.callback===null)i(g);else if(Y.startTime<=L)i(g),Y.sortIndex=Y.expirationTime,a(m,Y);else break;Y=s(g)}}function k(L){if(E=!1,z(L),!N)if(s(m)!==null)N=!0,$||($=!0,ee());else{var Y=s(g);Y!==null&&se(k,Y.startTime-L)}}var $=!1,I=-1,ae=5,le=-1;function he(){return C?!0:!(n.unstable_now()-le<ae)}function de(){if(C=!1,$){var L=n.unstable_now();le=L;var Y=!0;try{e:{N=!1,E&&(E=!1,M(I),I=-1),w=!0;var K=S;try{t:{for(z(L),T=s(m);T!==null&&!(T.expirationTime>L&&he());){var J=T.callback;if(typeof J=="function"){T.callback=null,S=T.priorityLevel;var A=J(T.expirationTime<=L);if(L=n.unstable_now(),typeof A=="function"){T.callback=A,z(L),Y=!0;break t}T===s(m)&&i(m),z(L)}else i(m);T=s(m)}if(T!==null)Y=!0;else{var H=s(g);H!==null&&se(k,H.startTime-L),Y=!1}}break e}finally{T=null,S=K,w=!1}Y=void 0}}finally{Y?ee():$=!1}}}var ee;if(typeof _=="function")ee=function(){_(de)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,Z=me.port2;me.port1.onmessage=de,ee=function(){Z.postMessage(null)}}else ee=function(){j(de,0)};function se(L,Y){I=j(function(){L(n.unstable_now())},Y)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(L){L.callback=null},n.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ae=0<L?Math.floor(1e3/L):5},n.unstable_getCurrentPriorityLevel=function(){return S},n.unstable_next=function(L){switch(S){case 1:case 2:case 3:var Y=3;break;default:Y=S}var K=S;S=Y;try{return L()}finally{S=K}},n.unstable_requestPaint=function(){C=!0},n.unstable_runWithPriority=function(L,Y){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var K=S;S=L;try{return Y()}finally{S=K}},n.unstable_scheduleCallback=function(L,Y,K){var J=n.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?J+K:J):K=J,L){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=K+A,L={id:v++,callback:Y,priorityLevel:L,startTime:K,expirationTime:A,sortIndex:-1},K>J?(L.sortIndex=K,a(g,L),s(m)===null&&L===s(g)&&(E?(M(I),I=-1):E=!0,se(k,K-J))):(L.sortIndex=A,a(m,L),N||w||(N=!0,$||($=!0,ee()))),L},n.unstable_shouldYield=he,n.unstable_wrapCallback=function(L){var Y=S;return function(){var K=S;S=Y;try{return L.apply(this,arguments)}finally{S=K}}}}(wf)),wf}var ey;function rS(){return ey||(ey=1,xf.exports=aS()),xf.exports}var Sf={exports:{}},Ct={};/**
* @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 ty;function sS(){if(ty)return Ct;ty=1;var n=vd();function a(m){var g="https://react.dev/errors/"+m;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)g+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+m+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var i={d:{f:s,r:function(){throw Error(a(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},l=Symbol.for("react.portal");function u(m,g,v){var T=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:T==null?null:""+T,children:m,containerInfo:g,implementation:v}}var d=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(m,g){if(m==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Ct.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Ct.createPortal=function(m,g){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(a(299));return u(m,g,null,v)},Ct.flushSync=function(m){var g=d.T,v=i.p;try{if(d.T=null,i.p=2,m)return m()}finally{d.T=g,i.p=v,i.d.f()}},Ct.preconnect=function(m,g){typeof m=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,i.d.C(m,g))},Ct.prefetchDNS=function(m){typeof m=="string"&&i.d.D(m)},Ct.preinit=function(m,g){if(typeof m=="string"&&g&&typeof g.as=="string"){var v=g.as,T=h(v,g.crossOrigin),S=typeof g.integrity=="string"?g.integrity:void 0,w=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;v==="style"?i.d.S(m,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:T,integrity:S,fetchPriority:w}):v==="script"&&i.d.X(m,{crossOrigin:T,integrity:S,fetchPriority:w,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Ct.preinitModule=function(m,g){if(typeof m=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var v=h(g.as,g.crossOrigin);i.d.M(m,{crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&i.d.M(m)},Ct.preload=function(m,g){if(typeof m=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var v=g.as,T=h(v,g.crossOrigin);i.d.L(m,v,{crossOrigin:T,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Ct.preloadModule=function(m,g){if(typeof m=="string")if(g){var v=h(g.as,g.crossOrigin);i.d.m(m,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else i.d.m(m)},Ct.requestFormReset=function(m){i.d.r(m)},Ct.unstable_batchedUpdates=function(m,g){return m(g)},Ct.useFormState=function(m,g,v){return d.H.useFormState(m,g,v)},Ct.useFormStatus=function(){return d.H.useHostTransitionStatus()},Ct.version="19.1.0",Ct}var ny;function Av(){if(ny)return Sf.exports;ny=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Sf.exports=sS(),Sf.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 ay;function iS(){if(ay)return vi;ay=1;var n=rS(),a=vd(),s=Av();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function d(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(u(e)!==e)throw Error(i(188))}function m(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(i(188));return t!==e?null:e}for(var r=e,o=t;;){var c=r.return;if(c===null)break;var f=c.alternate;if(f===null){if(o=c.return,o!==null){r=o;continue}break}if(c.child===f.child){for(f=c.child;f;){if(f===r)return h(c),e;if(f===o)return h(c),t;f=f.sibling}throw Error(i(188))}if(r.return!==o.return)r=c,o=f;else{for(var b=!1,R=c.child;R;){if(R===r){b=!0,r=c,o=f;break}if(R===o){b=!0,o=c,r=f;break}R=R.sibling}if(!b){for(R=f.child;R;){if(R===r){b=!0,r=f,o=c;break}if(R===o){b=!0,o=f,r=c;break}R=R.sibling}if(!b)throw Error(i(189))}}if(r.alternate!==o)throw Error(i(190))}if(r.tag!==3)throw Error(i(188));return r.stateNode.current===r?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,T=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),M=Symbol.for("react.consumer"),_=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),he=Symbol.for("react.memo_cache_sentinel"),de=Symbol.iterator;function ee(e){return e===null||typeof e!="object"?null:(e=de&&e[de]||e["@@iterator"],typeof e=="function"?e:null)}var me=Symbol.for("react.client.reference");function Z(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case N:return"Fragment";case C:return"Profiler";case E:return"StrictMode";case k:return"Suspense";case $:return"SuspenseList";case le:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case _:return(e.displayName||"Context")+".Provider";case M:return(e._context.displayName||"Context")+".Consumer";case z:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case I:return t=e.displayName||null,t!==null?t:Z(e.type)||"Memo";case ae:t=e._payload,e=e._init;try{return Z(e(t))}catch{}}return null}var se=Array.isArray,L=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},J=[],A=-1;function H(e){return{current:e}}function W(e){0>A||(e.current=J[A],J[A]=null,A--)}function F(e,t){A++,J[A]=e.current,e.current=t}var te=H(null),ue=H(null),oe=H(null),re=H(null);function fe(e,t){switch(F(oe,t),F(ue,e),F(te,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Tp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Tp(t),e=Ep(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}W(te),F(te,e)}function je(){W(te),W(ue),W(oe)}function Ae(e){e.memoizedState!==null&&F(re,e);var t=te.current,r=Ep(t,e.type);t!==r&&(F(ue,e),F(te,r))}function we(e){ue.current===e&&(W(te),W(ue)),re.current===e&&(W(re),di._currentValue=K)}var Re=Object.prototype.hasOwnProperty,nt=n.unstable_scheduleCallback,Tt=n.unstable_cancelCallback,Bn=n.unstable_shouldYield,bn=n.unstable_requestPaint,ut=n.unstable_now,Va=n.unstable_getCurrentPriorityLevel,Pn=n.unstable_ImmediatePriority,bs=n.unstable_UserBlockingPriority,xn=n.unstable_NormalPriority,Qi=n.unstable_LowPriority,wn=n.unstable_IdlePriority,rc=n.log,sc=n.unstable_setDisableYieldValue,ft=null,at=null;function Sn(e){if(typeof rc=="function"&&sc(e),at&&typeof at.setStrictMode=="function")try{at.setStrictMode(ft,e)}catch{}}var Nt=Math.clz32?Math.clz32:Gi,mr=Math.log,ic=Math.LN2;function Gi(e){return e>>>=0,e===0?32:31-(mr(e)/ic|0)|0}var oa=256,cn=4194304;function Tn(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function un(e,t,r){var o=e.pendingLanes;if(o===0)return 0;var c=0,f=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var R=o&134217727;return R!==0?(o=R&~f,o!==0?c=Tn(o):(b&=R,b!==0?c=Tn(b):r||(r=R&~e,r!==0&&(c=Tn(r))))):(R=o&~f,R!==0?c=Tn(R):b!==0?c=Tn(b):r||(r=o&~e,r!==0&&(c=Tn(r)))),c===0?0:t!==0&&t!==c&&(t&f)===0&&(f=c&-c,r=t&-t,f>=r||f===32&&(r&4194048)!==0)?t:c}function Ia(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function oc(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function xs(){var e=oa;return oa<<=1,(oa&4194048)===0&&(oa=256),e}function ws(){var e=cn;return cn<<=1,(cn&62914560)===0&&(cn=4194304),e}function Ss(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Vn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function En(e,t,r,o,c,f){var b=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var R=e.entanglements,O=e.expirationTimes,B=e.hiddenUpdates;for(r=b&~r;0<r;){var Q=31-Nt(r),X=1<<Q;R[Q]=0,O[Q]=-1;var P=B[Q];if(P!==null)for(B[Q]=null,Q=0;Q<P.length;Q++){var V=P[Q];V!==null&&(V.lane&=-536870913)}r&=~X}o!==0&&$i(e,o,0),f!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=f&~(b&~t))}function $i(e,t,r){e.pendingLanes|=t,e.suspendedLanes&=~t;var o=31-Nt(t);e.entangledLanes|=t,e.entanglements[o]=e.entanglements[o]|1073741824|r&4194090}function ve(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var o=31-Nt(r),c=1<<o;c&t|e[o]&t&&(e[o]|=t),r&=~c}}function Me(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ze(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function jt(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:Hp(e.type))}function Bt(e,t){var r=Y.p;try{return Y.p=e,t()}finally{Y.p=r}}var yt=Math.random().toString(36).slice(2),$e="__reactFiber$"+yt,Ye="__reactProps$"+yt,At="__reactContainer$"+yt,lc="__reactEvents$"+yt,Vx="__reactListeners$"+yt,Ix="__reactHandles$"+yt,fh="__reactResources$"+yt,Ts="__reactMarker$"+yt;function cc(e){delete e[$e],delete e[Ye],delete e[lc],delete e[Vx],delete e[Ix]}function gr(e){var t=e[$e];if(t)return t;for(var r=e.parentNode;r;){if(t=r[At]||r[$e]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Ap(e);e!==null;){if(r=e[$e])return r;e=Ap(e)}return t}e=r,r=e.parentNode}return null}function pr(e){if(e=e[$e]||e[At]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Es(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function yr(e){var t=e[fh];return t||(t=e[fh]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function dt(e){e[Ts]=!0}var dh=new Set,hh={};function Ha(e,t){vr(e,t),vr(e+"Capture",t)}function vr(e,t){for(hh[e]=t,e=0;e<t.length;e++)dh.add(t[e])}var Hx=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]*$"),mh={},gh={};function Yx(e){return Re.call(gh,e)?!0:Re.call(mh,e)?!1:Hx.test(e)?gh[e]=!0:(mh[e]=!0,!1)}function Xi(e,t,r){if(Yx(t))if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var o=t.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+r)}}function Ki(e,t,r){if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+r)}}function In(e,t,r,o){if(o===null)e.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(t,r,""+o)}}var uc,ph;function br(e){if(uc===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);uc=t&&t[1]||"",ph=-1<r.stack.indexOf(`
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
`+uc+e+ph}var fc=!1;function dc(e,t){if(!e||fc)return"";fc=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(t){var X=function(){throw Error()};if(Object.defineProperty(X.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(X,[])}catch(V){var P=V}Reflect.construct(e,[],X)}else{try{X.call()}catch(V){P=V}e.call(X.prototype)}}else{try{throw Error()}catch(V){P=V}(X=e())&&typeof X.catch=="function"&&X.catch(function(){})}}catch(V){if(V&&P&&typeof V.stack=="string")return[V.stack,P.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=o.DetermineComponentFrameRoot(),b=f[0],R=f[1];if(b&&R){var O=b.split(`
`),B=R.split(`
`);for(c=o=0;o<O.length&&!O[o].includes("DetermineComponentFrameRoot");)o++;for(;c<B.length&&!B[c].includes("DetermineComponentFrameRoot");)c++;if(o===O.length||c===B.length)for(o=O.length-1,c=B.length-1;1<=o&&0<=c&&O[o]!==B[c];)c--;for(;1<=o&&0<=c;o--,c--)if(O[o]!==B[c]){if(o!==1||c!==1)do if(o--,c--,0>c||O[o]!==B[c]){var Q=`
`+O[o].replace(" at new "," at ");return e.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",e.displayName)),Q}while(1<=o&&0<=c);break}}}finally{fc=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?br(r):""}function Qx(e){switch(e.tag){case 26:case 27:case 5:return br(e.type);case 16:return br("Lazy");case 13:return br("Suspense");case 19:return br("SuspenseList");case 0:case 15:return dc(e.type,!1);case 11:return dc(e.type.render,!1);case 1:return dc(e.type,!0);case 31:return br("Activity");default:return""}}function yh(e){try{var t="";do t+=Qx(e),e=e.return;while(e);return t}catch(r){return`
Error generating stack: `+r.message+`
`+r.stack}}function Zt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Gx(e){var t=vh(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),o=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,f=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(b){o=""+b,f.call(this,b)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return o},setValue:function(b){o=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Fi(e){e._valueTracker||(e._valueTracker=Gx(e))}function bh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),o="";return e&&(o=vh(e)?e.checked?"true":"false":e.value),e=o,e!==r?(t.setValue(e),!0):!1}function Zi(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var $x=/[\n"\\]/g;function Wt(e){return e.replace($x,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function hc(e,t,r,o,c,f,b,R){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Zt(t)):e.value!==""+Zt(t)&&(e.value=""+Zt(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?mc(e,b,Zt(t)):r!=null?mc(e,b,Zt(r)):o!=null&&e.removeAttribute("value"),c==null&&f!=null&&(e.defaultChecked=!!f),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?e.name=""+Zt(R):e.removeAttribute("name")}function xh(e,t,r,o,c,f,b,R){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||r!=null){if(!(f!=="submit"&&f!=="reset"||t!=null))return;r=r!=null?""+Zt(r):"",t=t!=null?""+Zt(t):r,R||t===e.value||(e.value=t),e.defaultValue=t}o=o??c,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=R?e.checked:!!o,e.defaultChecked=!!o,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b)}function mc(e,t,r){t==="number"&&Zi(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function xr(e,t,r,o){if(e=e.options,t){t={};for(var c=0;c<r.length;c++)t["$"+r[c]]=!0;for(r=0;r<e.length;r++)c=t.hasOwnProperty("$"+e[r].value),e[r].selected!==c&&(e[r].selected=c),c&&o&&(e[r].defaultSelected=!0)}else{for(r=""+Zt(r),t=null,c=0;c<e.length;c++){if(e[c].value===r){e[c].selected=!0,o&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function wh(e,t,r){if(t!=null&&(t=""+Zt(t),t!==e.value&&(e.value=t),r==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=r!=null?""+Zt(r):""}function Sh(e,t,r,o){if(t==null){if(o!=null){if(r!=null)throw Error(i(92));if(se(o)){if(1<o.length)throw Error(i(93));o=o[0]}r=o}r==null&&(r=""),t=r}r=Zt(t),e.defaultValue=r,o=e.textContent,o===r&&o!==""&&o!==null&&(e.value=o)}function wr(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Xx=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 Th(e,t,r){var o=t.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?o?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":o?e.setProperty(t,r):typeof r!="number"||r===0||Xx.has(t)?t==="float"?e.cssFloat=r:e[t]=(""+r).trim():e[t]=r+"px"}function Eh(e,t,r){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,r!=null){for(var o in r)!r.hasOwnProperty(o)||t!=null&&t.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var c in t)o=t[c],t.hasOwnProperty(c)&&r[c]!==o&&Th(e,c,o)}else for(var f in t)t.hasOwnProperty(f)&&Th(e,f,t[f])}function gc(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Kx=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"]]),Fx=/^[\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 Wi(e){return Fx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var pc=null;function yc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sr=null,Tr=null;function Ch(e){var t=pr(e);if(t&&(e=t.stateNode)){var r=e[Ye]||null;e:switch(e=t.stateNode,t.type){case"input":if(hc(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+Wt(""+t)+'"][type="radio"]'),t=0;t<r.length;t++){var o=r[t];if(o!==e&&o.form===e.form){var c=o[Ye]||null;if(!c)throw Error(i(90));hc(o,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<r.length;t++)o=r[t],o.form===e.form&&bh(o)}break e;case"textarea":wh(e,r.value,r.defaultValue);break e;case"select":t=r.value,t!=null&&xr(e,!!r.multiple,t,!1)}}}var vc=!1;function Rh(e,t,r){if(vc)return e(t,r);vc=!0;try{var o=e(t);return o}finally{if(vc=!1,(Sr!==null||Tr!==null)&&(Uo(),Sr&&(t=Sr,e=Tr,Tr=Sr=null,Ch(t),e)))for(t=0;t<e.length;t++)Ch(e[t])}}function Cs(e,t){var r=e.stateNode;if(r===null)return null;var o=r[Ye]||null;if(o===null)return null;r=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(i(231,t,typeof r));return r}var Hn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bc=!1;if(Hn)try{var Rs={};Object.defineProperty(Rs,"passive",{get:function(){bc=!0}}),window.addEventListener("test",Rs,Rs),window.removeEventListener("test",Rs,Rs)}catch{bc=!1}var la=null,xc=null,Ji=null;function Nh(){if(Ji)return Ji;var e,t=xc,r=t.length,o,c="value"in la?la.value:la.textContent,f=c.length;for(e=0;e<r&&t[e]===c[e];e++);var b=r-e;for(o=1;o<=b&&t[r-o]===c[f-o];o++);return Ji=c.slice(e,1<o?1-o:void 0)}function eo(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function to(){return!0}function Ah(){return!1}function Dt(e){function t(r,o,c,f,b){this._reactName=r,this._targetInst=c,this.type=o,this.nativeEvent=f,this.target=b,this.currentTarget=null;for(var R in e)e.hasOwnProperty(R)&&(r=e[R],this[R]=r?r(f):f[R]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?to:Ah,this.isPropagationStopped=Ah,this}return v(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=to)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=to)},persist:function(){},isPersistent:to}),t}var Ya={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},no=Dt(Ya),Ns=v({},Ya,{view:0,detail:0}),Zx=Dt(Ns),wc,Sc,As,ao=v({},Ns,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ec,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==As&&(As&&e.type==="mousemove"?(wc=e.screenX-As.screenX,Sc=e.screenY-As.screenY):Sc=wc=0,As=e),wc)},movementY:function(e){return"movementY"in e?e.movementY:Sc}}),Oh=Dt(ao),Wx=v({},ao,{dataTransfer:0}),Jx=Dt(Wx),ew=v({},Ns,{relatedTarget:0}),Tc=Dt(ew),tw=v({},Ya,{animationName:0,elapsedTime:0,pseudoElement:0}),nw=Dt(tw),aw=v({},Ya,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),rw=Dt(aw),sw=v({},Ya,{data:0}),Mh=Dt(sw),iw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ow={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"},lw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function cw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=lw[e])?!!t[e]:!1}function Ec(){return cw}var uw=v({},Ns,{key:function(e){if(e.key){var t=iw[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=eo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ow[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ec,charCode:function(e){return e.type==="keypress"?eo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?eo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),fw=Dt(uw),dw=v({},ao,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_h=Dt(dw),hw=v({},Ns,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ec}),mw=Dt(hw),gw=v({},Ya,{propertyName:0,elapsedTime:0,pseudoElement:0}),pw=Dt(gw),yw=v({},ao,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),vw=Dt(yw),bw=v({},Ya,{newState:0,oldState:0}),xw=Dt(bw),ww=[9,13,27,32],Cc=Hn&&"CompositionEvent"in window,Os=null;Hn&&"documentMode"in document&&(Os=document.documentMode);var Sw=Hn&&"TextEvent"in window&&!Os,jh=Hn&&(!Cc||Os&&8<Os&&11>=Os),Dh=" ",kh=!1;function Lh(e,t){switch(e){case"keyup":return ww.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Er=!1;function Tw(e,t){switch(e){case"compositionend":return qh(t);case"keypress":return t.which!==32?null:(kh=!0,Dh);case"textInput":return e=t.data,e===Dh&&kh?null:e;default:return null}}function Ew(e,t){if(Er)return e==="compositionend"||!Cc&&Lh(e,t)?(e=Nh(),Ji=xc=la=null,Er=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return jh&&t.locale!=="ko"?null:t.data;default:return null}}var Cw={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 zh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Cw[e.type]:t==="textarea"}function Uh(e,t,r,o){Sr?Tr?Tr.push(o):Tr=[o]:Sr=o,t=Yo(t,"onChange"),0<t.length&&(r=new no("onChange","change",null,r,o),e.push({event:r,listeners:t}))}var Ms=null,_s=null;function Rw(e){vp(e,0)}function ro(e){var t=Es(e);if(bh(t))return e}function Bh(e,t){if(e==="change")return t}var Ph=!1;if(Hn){var Rc;if(Hn){var Nc="oninput"in document;if(!Nc){var Vh=document.createElement("div");Vh.setAttribute("oninput","return;"),Nc=typeof Vh.oninput=="function"}Rc=Nc}else Rc=!1;Ph=Rc&&(!document.documentMode||9<document.documentMode)}function Ih(){Ms&&(Ms.detachEvent("onpropertychange",Hh),_s=Ms=null)}function Hh(e){if(e.propertyName==="value"&&ro(_s)){var t=[];Uh(t,_s,e,yc(e)),Rh(Rw,t)}}function Nw(e,t,r){e==="focusin"?(Ih(),Ms=t,_s=r,Ms.attachEvent("onpropertychange",Hh)):e==="focusout"&&Ih()}function Aw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ro(_s)}function Ow(e,t){if(e==="click")return ro(t)}function Mw(e,t){if(e==="input"||e==="change")return ro(t)}function _w(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pt=typeof Object.is=="function"?Object.is:_w;function js(e,t){if(Pt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;for(o=0;o<r.length;o++){var c=r[o];if(!Re.call(t,c)||!Pt(e[c],t[c]))return!1}return!0}function Yh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Qh(e,t){var r=Yh(e);e=0;for(var o;r;){if(r.nodeType===3){if(o=e+r.textContent.length,e<=t&&o>=t)return{node:r,offset:t-e};e=o}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Yh(r)}}function Gh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Gh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $h(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Zi(e.document);t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Zi(e.document)}return t}function Ac(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var jw=Hn&&"documentMode"in document&&11>=document.documentMode,Cr=null,Oc=null,Ds=null,Mc=!1;function Xh(e,t,r){var o=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Mc||Cr==null||Cr!==Zi(o)||(o=Cr,"selectionStart"in o&&Ac(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Ds&&js(Ds,o)||(Ds=o,o=Yo(Oc,"onSelect"),0<o.length&&(t=new no("onSelect","select",null,t,r),e.push({event:t,listeners:o}),t.target=Cr)))}function Qa(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Rr={animationend:Qa("Animation","AnimationEnd"),animationiteration:Qa("Animation","AnimationIteration"),animationstart:Qa("Animation","AnimationStart"),transitionrun:Qa("Transition","TransitionRun"),transitionstart:Qa("Transition","TransitionStart"),transitioncancel:Qa("Transition","TransitionCancel"),transitionend:Qa("Transition","TransitionEnd")},_c={},Kh={};Hn&&(Kh=document.createElement("div").style,"AnimationEvent"in window||(delete Rr.animationend.animation,delete Rr.animationiteration.animation,delete Rr.animationstart.animation),"TransitionEvent"in window||delete Rr.transitionend.transition);function Ga(e){if(_c[e])return _c[e];if(!Rr[e])return e;var t=Rr[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Kh)return _c[e]=t[r];return e}var Fh=Ga("animationend"),Zh=Ga("animationiteration"),Wh=Ga("animationstart"),Dw=Ga("transitionrun"),kw=Ga("transitionstart"),Lw=Ga("transitioncancel"),Jh=Ga("transitionend"),em=new Map,jc="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(" ");jc.push("scrollEnd");function fn(e,t){em.set(e,t),Ha(t,[e])}var tm=new WeakMap;function Jt(e,t){if(typeof e=="object"&&e!==null){var r=tm.get(e);return r!==void 0?r:(t={value:e,source:t,stack:yh(t)},tm.set(e,t),t)}return{value:e,source:t,stack:yh(t)}}var en=[],Nr=0,Dc=0;function so(){for(var e=Nr,t=Dc=Nr=0;t<e;){var r=en[t];en[t++]=null;var o=en[t];en[t++]=null;var c=en[t];en[t++]=null;var f=en[t];if(en[t++]=null,o!==null&&c!==null){var b=o.pending;b===null?c.next=c:(c.next=b.next,b.next=c),o.pending=c}f!==0&&nm(r,c,f)}}function io(e,t,r,o){en[Nr++]=e,en[Nr++]=t,en[Nr++]=r,en[Nr++]=o,Dc|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function kc(e,t,r,o){return io(e,t,r,o),oo(e)}function Ar(e,t){return io(e,null,null,t),oo(e)}function nm(e,t,r){e.lanes|=r;var o=e.alternate;o!==null&&(o.lanes|=r);for(var c=!1,f=e.return;f!==null;)f.childLanes|=r,o=f.alternate,o!==null&&(o.childLanes|=r),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(c=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,c&&t!==null&&(c=31-Nt(r),e=f.hiddenUpdates,o=e[c],o===null?e[c]=[t]:o.push(t),t.lane=r|536870912),f):null}function oo(e){if(50<ri)throw ri=0,Pu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Or={};function qw(e,t,r,o){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vt(e,t,r,o){return new qw(e,t,r,o)}function Lc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Yn(e,t){var r=e.alternate;return r===null?(r=Vt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function am(e,t){e.flags&=65011714;var r=e.alternate;return r===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,t=r.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function lo(e,t,r,o,c,f){var b=0;if(o=e,typeof e=="function")Lc(e)&&(b=1);else if(typeof e=="string")b=U1(e,r,te.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case le:return e=Vt(31,r,t,c),e.elementType=le,e.lanes=f,e;case N:return $a(r.children,c,f,t);case E:b=8,c|=24;break;case C:return e=Vt(12,r,t,c|2),e.elementType=C,e.lanes=f,e;case k:return e=Vt(13,r,t,c),e.elementType=k,e.lanes=f,e;case $:return e=Vt(19,r,t,c),e.elementType=$,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case j:case _:b=10;break e;case M:b=9;break e;case z:b=11;break e;case I:b=14;break e;case ae:b=16,o=null;break e}b=29,r=Error(i(130,e===null?"null":typeof e,"")),o=null}return t=Vt(b,r,t,c),t.elementType=e,t.type=o,t.lanes=f,t}function $a(e,t,r,o){return e=Vt(7,e,o,t),e.lanes=r,e}function qc(e,t,r){return e=Vt(6,e,null,t),e.lanes=r,e}function zc(e,t,r){return t=Vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Mr=[],_r=0,co=null,uo=0,tn=[],nn=0,Xa=null,Qn=1,Gn="";function Ka(e,t){Mr[_r++]=uo,Mr[_r++]=co,co=e,uo=t}function rm(e,t,r){tn[nn++]=Qn,tn[nn++]=Gn,tn[nn++]=Xa,Xa=e;var o=Qn;e=Gn;var c=32-Nt(o)-1;o&=~(1<<c),r+=1;var f=32-Nt(t)+c;if(30<f){var b=c-c%5;f=(o&(1<<b)-1).toString(32),o>>=b,c-=b,Qn=1<<32-Nt(t)+c|r<<c|o,Gn=f+e}else Qn=1<<f|r<<c|o,Gn=e}function Uc(e){e.return!==null&&(Ka(e,1),rm(e,1,0))}function Bc(e){for(;e===co;)co=Mr[--_r],Mr[_r]=null,uo=Mr[--_r],Mr[_r]=null;for(;e===Xa;)Xa=tn[--nn],tn[nn]=null,Gn=tn[--nn],tn[nn]=null,Qn=tn[--nn],tn[nn]=null}var Ot=null,Ze=null,De=!1,Fa=null,Cn=!1,Pc=Error(i(519));function Za(e){var t=Error(i(418,""));throw qs(Jt(t,e)),Pc}function sm(e){var t=e.stateNode,r=e.type,o=e.memoizedProps;switch(t[$e]=e,t[Ye]=o,r){case"dialog":Ce("cancel",t),Ce("close",t);break;case"iframe":case"object":case"embed":Ce("load",t);break;case"video":case"audio":for(r=0;r<ii.length;r++)Ce(ii[r],t);break;case"source":Ce("error",t);break;case"img":case"image":case"link":Ce("error",t),Ce("load",t);break;case"details":Ce("toggle",t);break;case"input":Ce("invalid",t),xh(t,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0),Fi(t);break;case"select":Ce("invalid",t);break;case"textarea":Ce("invalid",t),Sh(t,o.value,o.defaultValue,o.children),Fi(t)}r=o.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||t.textContent===""+r||o.suppressHydrationWarning===!0||Sp(t.textContent,r)?(o.popover!=null&&(Ce("beforetoggle",t),Ce("toggle",t)),o.onScroll!=null&&Ce("scroll",t),o.onScrollEnd!=null&&Ce("scrollend",t),o.onClick!=null&&(t.onclick=Qo),t=!0):t=!1,t||Za(e)}function im(e){for(Ot=e.return;Ot;)switch(Ot.tag){case 5:case 13:Cn=!1;return;case 27:case 3:Cn=!0;return;default:Ot=Ot.return}}function ks(e){if(e!==Ot)return!1;if(!De)return im(e),De=!0,!1;var t=e.tag,r;if((r=t!==3&&t!==27)&&((r=t===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||nf(e.type,e.memoizedProps)),r=!r),r&&Ze&&Za(e),im(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(r=e.data,r==="/$"){if(t===0){Ze=hn(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++;e=e.nextSibling}Ze=null}}else t===27?(t=Ze,Ea(e.type)?(e=of,of=null,Ze=e):Ze=t):Ze=Ot?hn(e.stateNode.nextSibling):null;return!0}function Ls(){Ze=Ot=null,De=!1}function om(){var e=Fa;return e!==null&&(qt===null?qt=e:qt.push.apply(qt,e),Fa=null),e}function qs(e){Fa===null?Fa=[e]:Fa.push(e)}var Vc=H(null),Wa=null,$n=null;function ca(e,t,r){F(Vc,t._currentValue),t._currentValue=r}function Xn(e){e._currentValue=Vc.current,W(Vc)}function Ic(e,t,r){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===r)break;e=e.return}}function Hc(e,t,r,o){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var f=c.dependencies;if(f!==null){var b=c.child;f=f.firstContext;e:for(;f!==null;){var R=f;f=c;for(var O=0;O<t.length;O++)if(R.context===t[O]){f.lanes|=r,R=f.alternate,R!==null&&(R.lanes|=r),Ic(f.return,r,e),o||(b=null);break e}f=R.next}}else if(c.tag===18){if(b=c.return,b===null)throw Error(i(341));b.lanes|=r,f=b.alternate,f!==null&&(f.lanes|=r),Ic(b,r,e),b=null}else b=c.child;if(b!==null)b.return=c;else for(b=c;b!==null;){if(b===e){b=null;break}if(c=b.sibling,c!==null){c.return=b.return,b=c;break}b=b.return}c=b}}function zs(e,t,r,o){e=null;for(var c=t,f=!1;c!==null;){if(!f){if((c.flags&524288)!==0)f=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var b=c.alternate;if(b===null)throw Error(i(387));if(b=b.memoizedProps,b!==null){var R=c.type;Pt(c.pendingProps.value,b.value)||(e!==null?e.push(R):e=[R])}}else if(c===re.current){if(b=c.alternate,b===null)throw Error(i(387));b.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(di):e=[di])}c=c.return}e!==null&&Hc(t,e,r,o),t.flags|=262144}function fo(e){for(e=e.firstContext;e!==null;){if(!Pt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ja(e){Wa=e,$n=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Et(e){return lm(Wa,e)}function ho(e,t){return Wa===null&&Ja(e),lm(e,t)}function lm(e,t){var r=t._currentValue;if(t={context:t,memoizedValue:r,next:null},$n===null){if(e===null)throw Error(i(308));$n=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else $n=$n.next=t;return r}var zw=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(r,o){e.push(o)}};this.abort=function(){t.aborted=!0,e.forEach(function(r){return r()})}},Uw=n.unstable_scheduleCallback,Bw=n.unstable_NormalPriority,ot={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Yc(){return{controller:new zw,data:new Map,refCount:0}}function Us(e){e.refCount--,e.refCount===0&&Uw(Bw,function(){e.controller.abort()})}var Bs=null,Qc=0,jr=0,Dr=null;function Pw(e,t){if(Bs===null){var r=Bs=[];Qc=0,jr=$u(),Dr={status:"pending",value:void 0,then:function(o){r.push(o)}}}return Qc++,t.then(cm,cm),t}function cm(){if(--Qc===0&&Bs!==null){Dr!==null&&(Dr.status="fulfilled");var e=Bs;Bs=null,jr=0,Dr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Vw(e,t){var r=[],o={status:"pending",value:null,reason:null,then:function(c){r.push(c)}};return e.then(function(){o.status="fulfilled",o.value=t;for(var c=0;c<r.length;c++)(0,r[c])(t)},function(c){for(o.status="rejected",o.reason=c,c=0;c<r.length;c++)(0,r[c])(void 0)}),o}var um=L.S;L.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&Pw(e,t),um!==null&&um(e,t)};var er=H(null);function Gc(){var e=er.current;return e!==null?e:Qe.pooledCache}function mo(e,t){t===null?F(er,er.current):F(er,t.pool)}function fm(){var e=Gc();return e===null?null:{parent:ot._currentValue,pool:e}}var Ps=Error(i(460)),dm=Error(i(474)),go=Error(i(542)),$c={then:function(){}};function hm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function po(){}function mm(e,t,r){switch(r=e[r],r===void 0?e.push(t):r!==t&&(t.then(po,po),t=r),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,pm(e),e;default:if(typeof t.status=="string")t.then(po,po);else{if(e=Qe,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(o){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=o}},function(o){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=o}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,pm(e),e}throw Vs=t,Ps}}var Vs=null;function gm(){if(Vs===null)throw Error(i(459));var e=Vs;return Vs=null,e}function pm(e){if(e===Ps||e===go)throw Error(i(483))}var ua=!1;function Xc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function fa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function da(e,t,r){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(ke&2)!==0){var c=o.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),o.pending=t,t=oo(e),nm(e,null,r),t}return io(e,o,t,r),oo(e)}function Is(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194048)!==0)){var o=t.lanes;o&=e.pendingLanes,r|=o,t.lanes=r,ve(e,r)}}function Fc(e,t){var r=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,r===o)){var c=null,f=null;if(r=r.firstBaseUpdate,r!==null){do{var b={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};f===null?c=f=b:f=f.next=b,r=r.next}while(r!==null);f===null?c=f=t:f=f.next=t}else c=f=t;r={baseState:o.baseState,firstBaseUpdate:c,lastBaseUpdate:f,shared:o.shared,callbacks:o.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}var Zc=!1;function Hs(){if(Zc){var e=Dr;if(e!==null)throw e}}function Ys(e,t,r,o){Zc=!1;var c=e.updateQueue;ua=!1;var f=c.firstBaseUpdate,b=c.lastBaseUpdate,R=c.shared.pending;if(R!==null){c.shared.pending=null;var O=R,B=O.next;O.next=null,b===null?f=B:b.next=B,b=O;var Q=e.alternate;Q!==null&&(Q=Q.updateQueue,R=Q.lastBaseUpdate,R!==b&&(R===null?Q.firstBaseUpdate=B:R.next=B,Q.lastBaseUpdate=O))}if(f!==null){var X=c.baseState;b=0,Q=B=O=null,R=f;do{var P=R.lane&-536870913,V=P!==R.lane;if(V?(Oe&P)===P:(o&P)===P){P!==0&&P===jr&&(Zc=!0),Q!==null&&(Q=Q.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var ye=e,ge=R;P=t;var Pe=r;switch(ge.tag){case 1:if(ye=ge.payload,typeof ye=="function"){X=ye.call(Pe,X,P);break e}X=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=ge.payload,P=typeof ye=="function"?ye.call(Pe,X,P):ye,P==null)break e;X=v({},X,P);break e;case 2:ua=!0}}P=R.callback,P!==null&&(e.flags|=64,V&&(e.flags|=8192),V=c.callbacks,V===null?c.callbacks=[P]:V.push(P))}else V={lane:P,tag:R.tag,payload:R.payload,callback:R.callback,next:null},Q===null?(B=Q=V,O=X):Q=Q.next=V,b|=P;if(R=R.next,R===null){if(R=c.shared.pending,R===null)break;V=R,R=V.next,V.next=null,c.lastBaseUpdate=V,c.shared.pending=null}}while(!0);Q===null&&(O=X),c.baseState=O,c.firstBaseUpdate=B,c.lastBaseUpdate=Q,f===null&&(c.shared.lanes=0),xa|=b,e.lanes=b,e.memoizedState=X}}function ym(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function vm(e,t){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)ym(r[e],t)}var kr=H(null),yo=H(0);function bm(e,t){e=ta,F(yo,e),F(kr,t),ta=e|t.baseLanes}function Wc(){F(yo,ta),F(kr,kr.current)}function Jc(){ta=yo.current,W(kr),W(yo)}var ha=0,Se=null,Ue=null,rt=null,vo=!1,Lr=!1,tr=!1,bo=0,Qs=0,qr=null,Iw=0;function et(){throw Error(i(321))}function eu(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Pt(e[r],t[r]))return!1;return!0}function tu(e,t,r,o,c,f){return ha=f,Se=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,L.H=e===null||e.memoizedState===null?ng:ag,tr=!1,f=r(o,c),tr=!1,Lr&&(f=wm(t,r,o,c)),xm(e),f}function xm(e){L.H=Co;var t=Ue!==null&&Ue.next!==null;if(ha=0,rt=Ue=Se=null,vo=!1,Qs=0,qr=null,t)throw Error(i(300));e===null||ht||(e=e.dependencies,e!==null&&fo(e)&&(ht=!0))}function wm(e,t,r,o){Se=e;var c=0;do{if(Lr&&(qr=null),Qs=0,Lr=!1,25<=c)throw Error(i(301));if(c+=1,rt=Ue=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}L.H=Kw,f=t(r,o)}while(Lr);return f}function Hw(){var e=L.H,t=e.useState()[0];return t=typeof t.then=="function"?Gs(t):t,e=e.useState()[0],(Ue!==null?Ue.memoizedState:null)!==e&&(Se.flags|=1024),t}function nu(){var e=bo!==0;return bo=0,e}function au(e,t,r){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r}function ru(e){if(vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}vo=!1}ha=0,rt=Ue=Se=null,Lr=!1,Qs=bo=0,qr=null}function kt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rt===null?Se.memoizedState=rt=e:rt=rt.next=e,rt}function st(){if(Ue===null){var e=Se.alternate;e=e!==null?e.memoizedState:null}else e=Ue.next;var t=rt===null?Se.memoizedState:rt.next;if(t!==null)rt=t,Ue=e;else{if(e===null)throw Se.alternate===null?Error(i(467)):Error(i(310));Ue=e,e={memoizedState:Ue.memoizedState,baseState:Ue.baseState,baseQueue:Ue.baseQueue,queue:Ue.queue,next:null},rt===null?Se.memoizedState=rt=e:rt=rt.next=e}return rt}function su(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Gs(e){var t=Qs;return Qs+=1,qr===null&&(qr=[]),e=mm(qr,e,t),t=Se,(rt===null?t.memoizedState:rt.next)===null&&(t=t.alternate,L.H=t===null||t.memoizedState===null?ng:ag),e}function xo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Gs(e);if(e.$$typeof===_)return Et(e)}throw Error(i(438,String(e)))}function iu(e){var t=null,r=Se.updateQueue;if(r!==null&&(t=r.memoCache),t==null){var o=Se.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(t={data:o.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),r===null&&(r=su(),Se.updateQueue=r),r.memoCache=t,r=t.data[t.index],r===void 0)for(r=t.data[t.index]=Array(e),o=0;o<e;o++)r[o]=he;return t.index++,r}function Kn(e,t){return typeof t=="function"?t(e):t}function wo(e){var t=st();return ou(t,Ue,e)}function ou(e,t,r){var o=e.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=r;var c=e.baseQueue,f=o.pending;if(f!==null){if(c!==null){var b=c.next;c.next=f.next,f.next=b}t.baseQueue=c=f,o.pending=null}if(f=e.baseState,c===null)e.memoizedState=f;else{t=c.next;var R=b=null,O=null,B=t,Q=!1;do{var X=B.lane&-536870913;if(X!==B.lane?(Oe&X)===X:(ha&X)===X){var P=B.revertLane;if(P===0)O!==null&&(O=O.next={lane:0,revertLane:0,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),X===jr&&(Q=!0);else if((ha&P)===P){B=B.next,P===jr&&(Q=!0);continue}else X={lane:0,revertLane:B.revertLane,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},O===null?(R=O=X,b=f):O=O.next=X,Se.lanes|=P,xa|=P;X=B.action,tr&&r(f,X),f=B.hasEagerState?B.eagerState:r(f,X)}else P={lane:X,revertLane:B.revertLane,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},O===null?(R=O=P,b=f):O=O.next=P,Se.lanes|=X,xa|=X;B=B.next}while(B!==null&&B!==t);if(O===null?b=f:O.next=R,!Pt(f,e.memoizedState)&&(ht=!0,Q&&(r=Dr,r!==null)))throw r;e.memoizedState=f,e.baseState=b,e.baseQueue=O,o.lastRenderedState=f}return c===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function lu(e){var t=st(),r=t.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=e;var o=r.dispatch,c=r.pending,f=t.memoizedState;if(c!==null){r.pending=null;var b=c=c.next;do f=e(f,b.action),b=b.next;while(b!==c);Pt(f,t.memoizedState)||(ht=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),r.lastRenderedState=f}return[f,o]}function Sm(e,t,r){var o=Se,c=st(),f=De;if(f){if(r===void 0)throw Error(i(407));r=r()}else r=t();var b=!Pt((Ue||c).memoizedState,r);b&&(c.memoizedState=r,ht=!0),c=c.queue;var R=Cm.bind(null,o,c,e);if($s(2048,8,R,[e]),c.getSnapshot!==t||b||rt!==null&&rt.memoizedState.tag&1){if(o.flags|=2048,zr(9,So(),Em.bind(null,o,c,r,t),null),Qe===null)throw Error(i(349));f||(ha&124)!==0||Tm(o,t,r)}return r}function Tm(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Se.updateQueue,t===null?(t=su(),Se.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Em(e,t,r,o){t.value=r,t.getSnapshot=o,Rm(t)&&Nm(e)}function Cm(e,t,r){return r(function(){Rm(t)&&Nm(e)})}function Rm(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Pt(e,r)}catch{return!0}}function Nm(e){var t=Ar(e,2);t!==null&&Gt(t,e,2)}function cu(e){var t=kt();if(typeof e=="function"){var r=e;if(e=r(),tr){Sn(!0);try{r()}finally{Sn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:e},t}function Am(e,t,r,o){return e.baseState=r,ou(e,Ue,typeof o=="function"?o:Kn)}function Yw(e,t,r,o,c){if(Eo(e))throw Error(i(485));if(e=t.action,e!==null){var f={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){f.listeners.push(b)}};L.T!==null?r(!0):f.isTransition=!1,o(f),r=t.pending,r===null?(f.next=t.pending=f,Om(t,f)):(f.next=r.next,t.pending=r.next=f)}}function Om(e,t){var r=t.action,o=t.payload,c=e.state;if(t.isTransition){var f=L.T,b={};L.T=b;try{var R=r(c,o),O=L.S;O!==null&&O(b,R),Mm(e,t,R)}catch(B){uu(e,t,B)}finally{L.T=f}}else try{f=r(c,o),Mm(e,t,f)}catch(B){uu(e,t,B)}}function Mm(e,t,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(o){_m(e,t,o)},function(o){return uu(e,t,o)}):_m(e,t,r)}function _m(e,t,r){t.status="fulfilled",t.value=r,jm(t),e.state=r,t=e.pending,t!==null&&(r=t.next,r===t?e.pending=null:(r=r.next,t.next=r,Om(e,r)))}function uu(e,t,r){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do t.status="rejected",t.reason=r,jm(t),t=t.next;while(t!==o)}e.action=null}function jm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Dm(e,t){return t}function km(e,t){if(De){var r=Qe.formState;if(r!==null){e:{var o=Se;if(De){if(Ze){t:{for(var c=Ze,f=Cn;c.nodeType!==8;){if(!f){c=null;break t}if(c=hn(c.nextSibling),c===null){c=null;break t}}f=c.data,c=f==="F!"||f==="F"?c:null}if(c){Ze=hn(c.nextSibling),o=c.data==="F!";break e}}Za(o)}o=!1}o&&(t=r[0])}}return r=kt(),r.memoizedState=r.baseState=t,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dm,lastRenderedState:t},r.queue=o,r=Jm.bind(null,Se,o),o.dispatch=r,o=cu(!1),f=gu.bind(null,Se,!1,o.queue),o=kt(),c={state:t,dispatch:null,action:e,pending:null},o.queue=c,r=Yw.bind(null,Se,c,f,r),c.dispatch=r,o.memoizedState=e,[t,r,!1]}function Lm(e){var t=st();return qm(t,Ue,e)}function qm(e,t,r){if(t=ou(e,t,Dm)[0],e=wo(Kn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var o=Gs(t)}catch(b){throw b===Ps?go:b}else o=t;t=st();var c=t.queue,f=c.dispatch;return r!==t.memoizedState&&(Se.flags|=2048,zr(9,So(),Qw.bind(null,c,r),null)),[o,f,e]}function Qw(e,t){e.action=t}function zm(e){var t=st(),r=Ue;if(r!==null)return qm(t,r,e);st(),t=t.memoizedState,r=st();var o=r.queue.dispatch;return r.memoizedState=e,[t,o,!1]}function zr(e,t,r,o){return e={tag:e,create:r,deps:o,inst:t,next:null},t=Se.updateQueue,t===null&&(t=su(),Se.updateQueue=t),r=t.lastEffect,r===null?t.lastEffect=e.next=e:(o=r.next,r.next=e,e.next=o,t.lastEffect=e),e}function So(){return{destroy:void 0,resource:void 0}}function Um(){return st().memoizedState}function To(e,t,r,o){var c=kt();o=o===void 0?null:o,Se.flags|=e,c.memoizedState=zr(1|t,So(),r,o)}function $s(e,t,r,o){var c=st();o=o===void 0?null:o;var f=c.memoizedState.inst;Ue!==null&&o!==null&&eu(o,Ue.memoizedState.deps)?c.memoizedState=zr(t,f,r,o):(Se.flags|=e,c.memoizedState=zr(1|t,f,r,o))}function Bm(e,t){To(8390656,8,e,t)}function Pm(e,t){$s(2048,8,e,t)}function Vm(e,t){return $s(4,2,e,t)}function Im(e,t){return $s(4,4,e,t)}function Hm(e,t){if(typeof t=="function"){e=e();var r=t(e);return function(){typeof r=="function"?r():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ym(e,t,r){r=r!=null?r.concat([e]):null,$s(4,4,Hm.bind(null,t,e),r)}function fu(){}function Qm(e,t){var r=st();t=t===void 0?null:t;var o=r.memoizedState;return t!==null&&eu(t,o[1])?o[0]:(r.memoizedState=[e,t],e)}function Gm(e,t){var r=st();t=t===void 0?null:t;var o=r.memoizedState;if(t!==null&&eu(t,o[1]))return o[0];if(o=e(),tr){Sn(!0);try{e()}finally{Sn(!1)}}return r.memoizedState=[o,t],o}function du(e,t,r){return r===void 0||(ha&1073741824)!==0?e.memoizedState=t:(e.memoizedState=r,e=Kg(),Se.lanes|=e,xa|=e,r)}function $m(e,t,r,o){return Pt(r,t)?r:kr.current!==null?(e=du(e,r,o),Pt(e,t)||(ht=!0),e):(ha&42)===0?(ht=!0,e.memoizedState=r):(e=Kg(),Se.lanes|=e,xa|=e,t)}function Xm(e,t,r,o,c){var f=Y.p;Y.p=f!==0&&8>f?f:8;var b=L.T,R={};L.T=R,gu(e,!1,t,r);try{var O=c(),B=L.S;if(B!==null&&B(R,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var Q=Vw(O,o);Xs(e,t,Q,Qt(e))}else Xs(e,t,o,Qt(e))}catch(X){Xs(e,t,{then:function(){},status:"rejected",reason:X},Qt())}finally{Y.p=f,L.T=b}}function Gw(){}function hu(e,t,r,o){if(e.tag!==5)throw Error(i(476));var c=Km(e).queue;Xm(e,c,t,K,r===null?Gw:function(){return Fm(e),r(o)})}function Km(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:K},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:r},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Fm(e){var t=Km(e).next.queue;Xs(e,t,{},Qt())}function mu(){return Et(di)}function Zm(){return st().memoizedState}function Wm(){return st().memoizedState}function $w(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=Qt();e=fa(r);var o=da(t,e,r);o!==null&&(Gt(o,t,r),Is(o,t,r)),t={cache:Yc()},e.payload=t;return}t=t.return}}function Xw(e,t,r){var o=Qt();r={lane:o,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null},Eo(e)?eg(t,r):(r=kc(e,t,r,o),r!==null&&(Gt(r,e,o),tg(r,t,o)))}function Jm(e,t,r){var o=Qt();Xs(e,t,r,o)}function Xs(e,t,r,o){var c={lane:o,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null};if(Eo(e))eg(t,c);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var b=t.lastRenderedState,R=f(b,r);if(c.hasEagerState=!0,c.eagerState=R,Pt(R,b))return io(e,t,c,0),Qe===null&&so(),!1}catch{}finally{}if(r=kc(e,t,c,o),r!==null)return Gt(r,e,o),tg(r,t,o),!0}return!1}function gu(e,t,r,o){if(o={lane:2,revertLane:$u(),action:o,hasEagerState:!1,eagerState:null,next:null},Eo(e)){if(t)throw Error(i(479))}else t=kc(e,r,o,2),t!==null&&Gt(t,e,2)}function Eo(e){var t=e.alternate;return e===Se||t!==null&&t===Se}function eg(e,t){Lr=vo=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function tg(e,t,r){if((r&4194048)!==0){var o=t.lanes;o&=e.pendingLanes,r|=o,t.lanes=r,ve(e,r)}}var Co={readContext:Et,use:xo,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useLayoutEffect:et,useInsertionEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useSyncExternalStore:et,useId:et,useHostTransitionStatus:et,useFormState:et,useActionState:et,useOptimistic:et,useMemoCache:et,useCacheRefresh:et},ng={readContext:Et,use:xo,useCallback:function(e,t){return kt().memoizedState=[e,t===void 0?null:t],e},useContext:Et,useEffect:Bm,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,To(4194308,4,Hm.bind(null,t,e),r)},useLayoutEffect:function(e,t){return To(4194308,4,e,t)},useInsertionEffect:function(e,t){To(4,2,e,t)},useMemo:function(e,t){var r=kt();t=t===void 0?null:t;var o=e();if(tr){Sn(!0);try{e()}finally{Sn(!1)}}return r.memoizedState=[o,t],o},useReducer:function(e,t,r){var o=kt();if(r!==void 0){var c=r(t);if(tr){Sn(!0);try{r(t)}finally{Sn(!1)}}}else c=t;return o.memoizedState=o.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},o.queue=e,e=e.dispatch=Xw.bind(null,Se,e),[o.memoizedState,e]},useRef:function(e){var t=kt();return e={current:e},t.memoizedState=e},useState:function(e){e=cu(e);var t=e.queue,r=Jm.bind(null,Se,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:fu,useDeferredValue:function(e,t){var r=kt();return du(r,e,t)},useTransition:function(){var e=cu(!1);return e=Xm.bind(null,Se,e.queue,!0,!1),kt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var o=Se,c=kt();if(De){if(r===void 0)throw Error(i(407));r=r()}else{if(r=t(),Qe===null)throw Error(i(349));(Oe&124)!==0||Tm(o,t,r)}c.memoizedState=r;var f={value:r,getSnapshot:t};return c.queue=f,Bm(Cm.bind(null,o,f,e),[e]),o.flags|=2048,zr(9,So(),Em.bind(null,o,f,r,t),null),r},useId:function(){var e=kt(),t=Qe.identifierPrefix;if(De){var r=Gn,o=Qn;r=(o&~(1<<32-Nt(o)-1)).toString(32)+r,t="«"+t+"R"+r,r=bo++,0<r&&(t+="H"+r.toString(32)),t+="»"}else r=Iw++,t="«"+t+"r"+r.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:mu,useFormState:km,useActionState:km,useOptimistic:function(e){var t=kt();t.memoizedState=t.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=r,t=gu.bind(null,Se,!0,r),r.dispatch=t,[e,t]},useMemoCache:iu,useCacheRefresh:function(){return kt().memoizedState=$w.bind(null,Se)}},ag={readContext:Et,use:xo,useCallback:Qm,useContext:Et,useEffect:Pm,useImperativeHandle:Ym,useInsertionEffect:Vm,useLayoutEffect:Im,useMemo:Gm,useReducer:wo,useRef:Um,useState:function(){return wo(Kn)},useDebugValue:fu,useDeferredValue:function(e,t){var r=st();return $m(r,Ue.memoizedState,e,t)},useTransition:function(){var e=wo(Kn)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Gs(e),t]},useSyncExternalStore:Sm,useId:Zm,useHostTransitionStatus:mu,useFormState:Lm,useActionState:Lm,useOptimistic:function(e,t){var r=st();return Am(r,Ue,e,t)},useMemoCache:iu,useCacheRefresh:Wm},Kw={readContext:Et,use:xo,useCallback:Qm,useContext:Et,useEffect:Pm,useImperativeHandle:Ym,useInsertionEffect:Vm,useLayoutEffect:Im,useMemo:Gm,useReducer:lu,useRef:Um,useState:function(){return lu(Kn)},useDebugValue:fu,useDeferredValue:function(e,t){var r=st();return Ue===null?du(r,e,t):$m(r,Ue.memoizedState,e,t)},useTransition:function(){var e=lu(Kn)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Gs(e),t]},useSyncExternalStore:Sm,useId:Zm,useHostTransitionStatus:mu,useFormState:zm,useActionState:zm,useOptimistic:function(e,t){var r=st();return Ue!==null?Am(r,Ue,e,t):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:iu,useCacheRefresh:Wm},Ur=null,Ks=0;function Ro(e){var t=Ks;return Ks+=1,Ur===null&&(Ur=[]),mm(Ur,e,t)}function Fs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function No(e,t){throw t.$$typeof===T?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function rg(e){var t=e._init;return t(e._payload)}function sg(e){function t(q,D){if(e){var U=q.deletions;U===null?(q.deletions=[D],q.flags|=16):U.push(D)}}function r(q,D){if(!e)return null;for(;D!==null;)t(q,D),D=D.sibling;return null}function o(q){for(var D=new Map;q!==null;)q.key!==null?D.set(q.key,q):D.set(q.index,q),q=q.sibling;return D}function c(q,D){return q=Yn(q,D),q.index=0,q.sibling=null,q}function f(q,D,U){return q.index=U,e?(U=q.alternate,U!==null?(U=U.index,U<D?(q.flags|=67108866,D):U):(q.flags|=67108866,D)):(q.flags|=1048576,D)}function b(q){return e&&q.alternate===null&&(q.flags|=67108866),q}function R(q,D,U,G){return D===null||D.tag!==6?(D=qc(U,q.mode,G),D.return=q,D):(D=c(D,U),D.return=q,D)}function O(q,D,U,G){var ie=U.type;return ie===N?Q(q,D,U.props.children,G,U.key):D!==null&&(D.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===ae&&rg(ie)===D.type)?(D=c(D,U.props),Fs(D,U),D.return=q,D):(D=lo(U.type,U.key,U.props,null,q.mode,G),Fs(D,U),D.return=q,D)}function B(q,D,U,G){return D===null||D.tag!==4||D.stateNode.containerInfo!==U.containerInfo||D.stateNode.implementation!==U.implementation?(D=zc(U,q.mode,G),D.return=q,D):(D=c(D,U.children||[]),D.return=q,D)}function Q(q,D,U,G,ie){return D===null||D.tag!==7?(D=$a(U,q.mode,G,ie),D.return=q,D):(D=c(D,U),D.return=q,D)}function X(q,D,U){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return D=qc(""+D,q.mode,U),D.return=q,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case S:return U=lo(D.type,D.key,D.props,null,q.mode,U),Fs(U,D),U.return=q,U;case w:return D=zc(D,q.mode,U),D.return=q,D;case ae:var G=D._init;return D=G(D._payload),X(q,D,U)}if(se(D)||ee(D))return D=$a(D,q.mode,U,null),D.return=q,D;if(typeof D.then=="function")return X(q,Ro(D),U);if(D.$$typeof===_)return X(q,ho(q,D),U);No(q,D)}return null}function P(q,D,U,G){var ie=D!==null?D.key:null;if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return ie!==null?null:R(q,D,""+U,G);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case S:return U.key===ie?O(q,D,U,G):null;case w:return U.key===ie?B(q,D,U,G):null;case ae:return ie=U._init,U=ie(U._payload),P(q,D,U,G)}if(se(U)||ee(U))return ie!==null?null:Q(q,D,U,G,null);if(typeof U.then=="function")return P(q,D,Ro(U),G);if(U.$$typeof===_)return P(q,D,ho(q,U),G);No(q,U)}return null}function V(q,D,U,G,ie){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return q=q.get(U)||null,R(D,q,""+G,ie);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case S:return q=q.get(G.key===null?U:G.key)||null,O(D,q,G,ie);case w:return q=q.get(G.key===null?U:G.key)||null,B(D,q,G,ie);case ae:var Te=G._init;return G=Te(G._payload),V(q,D,U,G,ie)}if(se(G)||ee(G))return q=q.get(U)||null,Q(D,q,G,ie,null);if(typeof G.then=="function")return V(q,D,U,Ro(G),ie);if(G.$$typeof===_)return V(q,D,U,ho(D,G),ie);No(D,G)}return null}function ye(q,D,U,G){for(var ie=null,Te=null,ce=D,pe=D=0,gt=null;ce!==null&&pe<U.length;pe++){ce.index>pe?(gt=ce,ce=null):gt=ce.sibling;var _e=P(q,ce,U[pe],G);if(_e===null){ce===null&&(ce=gt);break}e&&ce&&_e.alternate===null&&t(q,ce),D=f(_e,D,pe),Te===null?ie=_e:Te.sibling=_e,Te=_e,ce=gt}if(pe===U.length)return r(q,ce),De&&Ka(q,pe),ie;if(ce===null){for(;pe<U.length;pe++)ce=X(q,U[pe],G),ce!==null&&(D=f(ce,D,pe),Te===null?ie=ce:Te.sibling=ce,Te=ce);return De&&Ka(q,pe),ie}for(ce=o(ce);pe<U.length;pe++)gt=V(ce,q,pe,U[pe],G),gt!==null&&(e&>.alternate!==null&&ce.delete(gt.key===null?pe:gt.key),D=f(gt,D,pe),Te===null?ie=gt:Te.sibling=gt,Te=gt);return e&&ce.forEach(function(Oa){return t(q,Oa)}),De&&Ka(q,pe),ie}function ge(q,D,U,G){if(U==null)throw Error(i(151));for(var ie=null,Te=null,ce=D,pe=D=0,gt=null,_e=U.next();ce!==null&&!_e.done;pe++,_e=U.next()){ce.index>pe?(gt=ce,ce=null):gt=ce.sibling;var Oa=P(q,ce,_e.value,G);if(Oa===null){ce===null&&(ce=gt);break}e&&ce&&Oa.alternate===null&&t(q,ce),D=f(Oa,D,pe),Te===null?ie=Oa:Te.sibling=Oa,Te=Oa,ce=gt}if(_e.done)return r(q,ce),De&&Ka(q,pe),ie;if(ce===null){for(;!_e.done;pe++,_e=U.next())_e=X(q,_e.value,G),_e!==null&&(D=f(_e,D,pe),Te===null?ie=_e:Te.sibling=_e,Te=_e);return De&&Ka(q,pe),ie}for(ce=o(ce);!_e.done;pe++,_e=U.next())_e=V(ce,q,pe,_e.value,G),_e!==null&&(e&&_e.alternate!==null&&ce.delete(_e.key===null?pe:_e.key),D=f(_e,D,pe),Te===null?ie=_e:Te.sibling=_e,Te=_e);return e&&ce.forEach(function(F1){return t(q,F1)}),De&&Ka(q,pe),ie}function Pe(q,D,U,G){if(typeof U=="object"&&U!==null&&U.type===N&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case S:e:{for(var ie=U.key;D!==null;){if(D.key===ie){if(ie=U.type,ie===N){if(D.tag===7){r(q,D.sibling),G=c(D,U.props.children),G.return=q,q=G;break e}}else if(D.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===ae&&rg(ie)===D.type){r(q,D.sibling),G=c(D,U.props),Fs(G,U),G.return=q,q=G;break e}r(q,D);break}else t(q,D);D=D.sibling}U.type===N?(G=$a(U.props.children,q.mode,G,U.key),G.return=q,q=G):(G=lo(U.type,U.key,U.props,null,q.mode,G),Fs(G,U),G.return=q,q=G)}return b(q);case w:e:{for(ie=U.key;D!==null;){if(D.key===ie)if(D.tag===4&&D.stateNode.containerInfo===U.containerInfo&&D.stateNode.implementation===U.implementation){r(q,D.sibling),G=c(D,U.children||[]),G.return=q,q=G;break e}else{r(q,D);break}else t(q,D);D=D.sibling}G=zc(U,q.mode,G),G.return=q,q=G}return b(q);case ae:return ie=U._init,U=ie(U._payload),Pe(q,D,U,G)}if(se(U))return ye(q,D,U,G);if(ee(U)){if(ie=ee(U),typeof ie!="function")throw Error(i(150));return U=ie.call(U),ge(q,D,U,G)}if(typeof U.then=="function")return Pe(q,D,Ro(U),G);if(U.$$typeof===_)return Pe(q,D,ho(q,U),G);No(q,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,D!==null&&D.tag===6?(r(q,D.sibling),G=c(D,U),G.return=q,q=G):(r(q,D),G=qc(U,q.mode,G),G.return=q,q=G),b(q)):r(q,D)}return function(q,D,U,G){try{Ks=0;var ie=Pe(q,D,U,G);return Ur=null,ie}catch(ce){if(ce===Ps||ce===go)throw ce;var Te=Vt(29,ce,null,q.mode);return Te.lanes=G,Te.return=q,Te}finally{}}}var Br=sg(!0),ig=sg(!1),an=H(null),Rn=null;function ma(e){var t=e.alternate;F(lt,lt.current&1),F(an,e),Rn===null&&(t===null||kr.current!==null||t.memoizedState!==null)&&(Rn=e)}function og(e){if(e.tag===22){if(F(lt,lt.current),F(an,e),Rn===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(Rn=e)}}else ga()}function ga(){F(lt,lt.current),F(an,an.current)}function Fn(e){W(an),Rn===e&&(Rn=null),W(lt)}var lt=H(0);function Ao(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||sf(r)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function pu(e,t,r,o){t=e.memoizedState,r=r(o,t),r=r==null?t:v({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var yu={enqueueSetState:function(e,t,r){e=e._reactInternals;var o=Qt(),c=fa(o);c.payload=t,r!=null&&(c.callback=r),t=da(e,c,o),t!==null&&(Gt(t,e,o),Is(t,e,o))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var o=Qt(),c=fa(o);c.tag=1,c.payload=t,r!=null&&(c.callback=r),t=da(e,c,o),t!==null&&(Gt(t,e,o),Is(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Qt(),o=fa(r);o.tag=2,t!=null&&(o.callback=t),t=da(e,o,r),t!==null&&(Gt(t,e,r),Is(t,e,r))}};function lg(e,t,r,o,c,f,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,f,b):t.prototype&&t.prototype.isPureReactComponent?!js(r,o)||!js(c,f):!0}function cg(e,t,r,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,o),t.state!==e&&yu.enqueueReplaceState(t,t.state,null)}function nr(e,t){var r=t;if("ref"in t){r={};for(var o in t)o!=="ref"&&(r[o]=t[o])}if(e=e.defaultProps){r===t&&(r=v({},r));for(var c in e)r[c]===void 0&&(r[c]=e[c])}return r}var Oo=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function ug(e){Oo(e)}function fg(e){console.error(e)}function dg(e){Oo(e)}function Mo(e,t){try{var r=e.onUncaughtError;r(t.value,{componentStack:t.stack})}catch(o){setTimeout(function(){throw o})}}function hg(e,t,r){try{var o=e.onCaughtError;o(r.value,{componentStack:r.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function vu(e,t,r){return r=fa(r),r.tag=3,r.payload={element:null},r.callback=function(){Mo(e,t)},r}function mg(e){return e=fa(e),e.tag=3,e}function gg(e,t,r,o){var c=r.type.getDerivedStateFromError;if(typeof c=="function"){var f=o.value;e.payload=function(){return c(f)},e.callback=function(){hg(t,r,o)}}var b=r.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){hg(t,r,o),typeof c!="function"&&(wa===null?wa=new Set([this]):wa.add(this));var R=o.stack;this.componentDidCatch(o.value,{componentStack:R!==null?R:""})})}function Fw(e,t,r,o,c){if(r.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(t=r.alternate,t!==null&&zs(t,r,c,!0),r=an.current,r!==null){switch(r.tag){case 13:return Rn===null?Iu():r.alternate===null&&We===0&&(We=3),r.flags&=-257,r.flags|=65536,r.lanes=c,o===$c?r.flags|=16384:(t=r.updateQueue,t===null?r.updateQueue=new Set([o]):t.add(o),Yu(e,o,c)),!1;case 22:return r.flags|=65536,o===$c?r.flags|=16384:(t=r.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([o])},r.updateQueue=t):(r=t.retryQueue,r===null?t.retryQueue=new Set([o]):r.add(o)),Yu(e,o,c)),!1}throw Error(i(435,r.tag))}return Yu(e,o,c),Iu(),!1}if(De)return t=an.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,o!==Pc&&(e=Error(i(422),{cause:o}),qs(Jt(e,r)))):(o!==Pc&&(t=Error(i(423),{cause:o}),qs(Jt(t,r))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,o=Jt(o,r),c=vu(e.stateNode,o,c),Fc(e,c),We!==4&&(We=2)),!1;var f=Error(i(520),{cause:o});if(f=Jt(f,r),ai===null?ai=[f]:ai.push(f),We!==4&&(We=2),t===null)return!0;o=Jt(o,r),r=t;do{switch(r.tag){case 3:return r.flags|=65536,e=c&-c,r.lanes|=e,e=vu(r.stateNode,o,e),Fc(r,e),!1;case 1:if(t=r.type,f=r.stateNode,(r.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(wa===null||!wa.has(f))))return r.flags|=65536,c&=-c,r.lanes|=c,c=mg(c),gg(c,e,r,o),Fc(r,c),!1}r=r.return}while(r!==null);return!1}var pg=Error(i(461)),ht=!1;function vt(e,t,r,o){t.child=e===null?ig(t,null,r,o):Br(t,e.child,r,o)}function yg(e,t,r,o,c){r=r.render;var f=t.ref;if("ref"in o){var b={};for(var R in o)R!=="ref"&&(b[R]=o[R])}else b=o;return Ja(t),o=tu(e,t,r,b,f,c),R=nu(),e!==null&&!ht?(au(e,t,c),Zn(e,t,c)):(De&&R&&Uc(t),t.flags|=1,vt(e,t,o,c),t.child)}function vg(e,t,r,o,c){if(e===null){var f=r.type;return typeof f=="function"&&!Lc(f)&&f.defaultProps===void 0&&r.compare===null?(t.tag=15,t.type=f,bg(e,t,f,o,c)):(e=lo(r.type,null,o,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Ru(e,c)){var b=f.memoizedProps;if(r=r.compare,r=r!==null?r:js,r(b,o)&&e.ref===t.ref)return Zn(e,t,c)}return t.flags|=1,e=Yn(f,o),e.ref=t.ref,e.return=t,t.child=e}function bg(e,t,r,o,c){if(e!==null){var f=e.memoizedProps;if(js(f,o)&&e.ref===t.ref)if(ht=!1,t.pendingProps=o=f,Ru(e,c))(e.flags&131072)!==0&&(ht=!0);else return t.lanes=e.lanes,Zn(e,t,c)}return bu(e,t,r,o,c)}function xg(e,t,r){var o=t.pendingProps,c=o.children,f=e!==null?e.memoizedState:null;if(o.mode==="hidden"){if((t.flags&128)!==0){if(o=f!==null?f.baseLanes|r:r,e!==null){for(c=t.child=e.child,f=0;c!==null;)f=f|c.lanes|c.childLanes,c=c.sibling;t.childLanes=f&~o}else t.childLanes=0,t.child=null;return wg(e,t,o,r)}if((r&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&mo(t,f!==null?f.cachePool:null),f!==null?bm(t,f):Wc(),og(t);else return t.lanes=t.childLanes=536870912,wg(e,t,f!==null?f.baseLanes|r:r,r)}else f!==null?(mo(t,f.cachePool),bm(t,f),ga(),t.memoizedState=null):(e!==null&&mo(t,null),Wc(),ga());return vt(e,t,c,r),t.child}function wg(e,t,r,o){var c=Gc();return c=c===null?null:{parent:ot._currentValue,pool:c},t.memoizedState={baseLanes:r,cachePool:c},e!==null&&mo(t,null),Wc(),og(t),e!==null&&zs(e,t,o,!0),null}function _o(e,t){var r=t.ref;if(r===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(i(284));(e===null||e.ref!==r)&&(t.flags|=4194816)}}function bu(e,t,r,o,c){return Ja(t),r=tu(e,t,r,o,void 0,c),o=nu(),e!==null&&!ht?(au(e,t,c),Zn(e,t,c)):(De&&o&&Uc(t),t.flags|=1,vt(e,t,r,c),t.child)}function Sg(e,t,r,o,c,f){return Ja(t),t.updateQueue=null,r=wm(t,o,r,c),xm(e),o=nu(),e!==null&&!ht?(au(e,t,f),Zn(e,t,f)):(De&&o&&Uc(t),t.flags|=1,vt(e,t,r,f),t.child)}function Tg(e,t,r,o,c){if(Ja(t),t.stateNode===null){var f=Or,b=r.contextType;typeof b=="object"&&b!==null&&(f=Et(b)),f=new r(o,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=yu,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=o,f.state=t.memoizedState,f.refs={},Xc(t),b=r.contextType,f.context=typeof b=="object"&&b!==null?Et(b):Or,f.state=t.memoizedState,b=r.getDerivedStateFromProps,typeof b=="function"&&(pu(t,r,b,o),f.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(b=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),b!==f.state&&yu.enqueueReplaceState(f,f.state,null),Ys(t,o,f,c),Hs(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),o=!0}else if(e===null){f=t.stateNode;var R=t.memoizedProps,O=nr(r,R);f.props=O;var B=f.context,Q=r.contextType;b=Or,typeof Q=="object"&&Q!==null&&(b=Et(Q));var X=r.getDerivedStateFromProps;Q=typeof X=="function"||typeof f.getSnapshotBeforeUpdate=="function",R=t.pendingProps!==R,Q||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(R||B!==b)&&cg(t,f,o,b),ua=!1;var P=t.memoizedState;f.state=P,Ys(t,o,f,c),Hs(),B=t.memoizedState,R||P!==B||ua?(typeof X=="function"&&(pu(t,r,X,o),B=t.memoizedState),(O=ua||lg(t,r,O,o,P,B,b))?(Q||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=B),f.props=o,f.state=B,f.context=b,o=O):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{f=t.stateNode,Kc(e,t),b=t.memoizedProps,Q=nr(r,b),f.props=Q,X=t.pendingProps,P=f.context,B=r.contextType,O=Or,typeof B=="object"&&B!==null&&(O=Et(B)),R=r.getDerivedStateFromProps,(B=typeof R=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(b!==X||P!==O)&&cg(t,f,o,O),ua=!1,P=t.memoizedState,f.state=P,Ys(t,o,f,c),Hs();var V=t.memoizedState;b!==X||P!==V||ua||e!==null&&e.dependencies!==null&&fo(e.dependencies)?(typeof R=="function"&&(pu(t,r,R,o),V=t.memoizedState),(Q=ua||lg(t,r,Q,o,P,V,O)||e!==null&&e.dependencies!==null&&fo(e.dependencies))?(B||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(o,V,O),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(o,V,O)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=V),f.props=o,f.state=V,f.context=O,o=Q):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),o=!1)}return f=o,_o(e,t),o=(t.flags&128)!==0,f||o?(f=t.stateNode,r=o&&typeof r.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&o?(t.child=Br(t,e.child,null,c),t.child=Br(t,null,r,c)):vt(e,t,r,c),t.memoizedState=f.state,e=t.child):e=Zn(e,t,c),e}function Eg(e,t,r,o){return Ls(),t.flags|=256,vt(e,t,r,o),t.child}var xu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function wu(e){return{baseLanes:e,cachePool:fm()}}function Su(e,t,r){return e=e!==null?e.childLanes&~r:0,t&&(e|=rn),e}function Cg(e,t,r){var o=t.pendingProps,c=!1,f=(t.flags&128)!==0,b;if((b=f)||(b=e!==null&&e.memoizedState===null?!1:(lt.current&2)!==0),b&&(c=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(De){if(c?ma(t):ga(),De){var R=Ze,O;if(O=R){e:{for(O=R,R=Cn;O.nodeType!==8;){if(!R){R=null;break e}if(O=hn(O.nextSibling),O===null){R=null;break e}}R=O}R!==null?(t.memoizedState={dehydrated:R,treeContext:Xa!==null?{id:Qn,overflow:Gn}:null,retryLane:536870912,hydrationErrors:null},O=Vt(18,null,null,0),O.stateNode=R,O.return=t,t.child=O,Ot=t,Ze=null,O=!0):O=!1}O||Za(t)}if(R=t.memoizedState,R!==null&&(R=R.dehydrated,R!==null))return sf(R)?t.lanes=32:t.lanes=536870912,null;Fn(t)}return R=o.children,o=o.fallback,c?(ga(),c=t.mode,R=jo({mode:"hidden",children:R},c),o=$a(o,c,r,null),R.return=t,o.return=t,R.sibling=o,t.child=R,c=t.child,c.memoizedState=wu(r),c.childLanes=Su(e,b,r),t.memoizedState=xu,o):(ma(t),Tu(t,R))}if(O=e.memoizedState,O!==null&&(R=O.dehydrated,R!==null)){if(f)t.flags&256?(ma(t),t.flags&=-257,t=Eu(e,t,r)):t.memoizedState!==null?(ga(),t.child=e.child,t.flags|=128,t=null):(ga(),c=o.fallback,R=t.mode,o=jo({mode:"visible",children:o.children},R),c=$a(c,R,r,null),c.flags|=2,o.return=t,c.return=t,o.sibling=c,t.child=o,Br(t,e.child,null,r),o=t.child,o.memoizedState=wu(r),o.childLanes=Su(e,b,r),t.memoizedState=xu,t=c);else if(ma(t),sf(R)){if(b=R.nextSibling&&R.nextSibling.dataset,b)var B=b.dgst;b=B,o=Error(i(419)),o.stack="",o.digest=b,qs({value:o,source:null,stack:null}),t=Eu(e,t,r)}else if(ht||zs(e,t,r,!1),b=(r&e.childLanes)!==0,ht||b){if(b=Qe,b!==null&&(o=r&-r,o=(o&42)!==0?1:Me(o),o=(o&(b.suspendedLanes|r))!==0?0:o,o!==0&&o!==O.retryLane))throw O.retryLane=o,Ar(e,o),Gt(b,e,o),pg;R.data==="$?"||Iu(),t=Eu(e,t,r)}else R.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=O.treeContext,Ze=hn(R.nextSibling),Ot=t,De=!0,Fa=null,Cn=!1,e!==null&&(tn[nn++]=Qn,tn[nn++]=Gn,tn[nn++]=Xa,Qn=e.id,Gn=e.overflow,Xa=t),t=Tu(t,o.children),t.flags|=4096);return t}return c?(ga(),c=o.fallback,R=t.mode,O=e.child,B=O.sibling,o=Yn(O,{mode:"hidden",children:o.children}),o.subtreeFlags=O.subtreeFlags&65011712,B!==null?c=Yn(B,c):(c=$a(c,R,r,null),c.flags|=2),c.return=t,o.return=t,o.sibling=c,t.child=o,o=c,c=t.child,R=e.child.memoizedState,R===null?R=wu(r):(O=R.cachePool,O!==null?(B=ot._currentValue,O=O.parent!==B?{parent:B,pool:B}:O):O=fm(),R={baseLanes:R.baseLanes|r,cachePool:O}),c.memoizedState=R,c.childLanes=Su(e,b,r),t.memoizedState=xu,o):(ma(t),r=e.child,e=r.sibling,r=Yn(r,{mode:"visible",children:o.children}),r.return=t,r.sibling=null,e!==null&&(b=t.deletions,b===null?(t.deletions=[e],t.flags|=16):b.push(e)),t.child=r,t.memoizedState=null,r)}function Tu(e,t){return t=jo({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function jo(e,t){return e=Vt(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Eu(e,t,r){return Br(t,e.child,null,r),e=Tu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Rg(e,t,r){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),Ic(e.return,t,r)}function Cu(e,t,r,o,c){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:r,tailMode:c}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=o,f.tail=r,f.tailMode=c)}function Ng(e,t,r){var o=t.pendingProps,c=o.revealOrder,f=o.tail;if(vt(e,t,o.children,r),o=lt.current,(o&2)!==0)o=o&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Rg(e,r,t);else if(e.tag===19)Rg(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}o&=1}switch(F(lt,o),c){case"forwards":for(r=t.child,c=null;r!==null;)e=r.alternate,e!==null&&Ao(e)===null&&(c=r),r=r.sibling;r=c,r===null?(c=t.child,t.child=null):(c=r.sibling,r.sibling=null),Cu(t,!1,c,r,f);break;case"backwards":for(r=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Ao(e)===null){t.child=c;break}e=c.sibling,c.sibling=r,r=c,c=e}Cu(t,!0,r,null,f);break;case"together":Cu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Zn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),xa|=t.lanes,(r&t.childLanes)===0)if(e!==null){if(zs(e,t,r,!1),(r&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,r=Yn(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Yn(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Ru(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&fo(e)))}function Zw(e,t,r){switch(t.tag){case 3:fe(t,t.stateNode.containerInfo),ca(t,ot,e.memoizedState.cache),Ls();break;case 27:case 5:Ae(t);break;case 4:fe(t,t.stateNode.containerInfo);break;case 10:ca(t,t.type,t.memoizedProps.value);break;case 13:var o=t.memoizedState;if(o!==null)return o.dehydrated!==null?(ma(t),t.flags|=128,null):(r&t.child.childLanes)!==0?Cg(e,t,r):(ma(t),e=Zn(e,t,r),e!==null?e.sibling:null);ma(t);break;case 19:var c=(e.flags&128)!==0;if(o=(r&t.childLanes)!==0,o||(zs(e,t,r,!1),o=(r&t.childLanes)!==0),c){if(o)return Ng(e,t,r);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),F(lt,lt.current),o)break;return null;case 22:case 23:return t.lanes=0,xg(e,t,r);case 24:ca(t,ot,e.memoizedState.cache)}return Zn(e,t,r)}function Ag(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps)ht=!0;else{if(!Ru(e,r)&&(t.flags&128)===0)return ht=!1,Zw(e,t,r);ht=(e.flags&131072)!==0}else ht=!1,De&&(t.flags&1048576)!==0&&rm(t,uo,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var o=t.elementType,c=o._init;if(o=c(o._payload),t.type=o,typeof o=="function")Lc(o)?(e=nr(o,e),t.tag=1,t=Tg(null,t,o,e,r)):(t.tag=0,t=bu(null,t,o,e,r));else{if(o!=null){if(c=o.$$typeof,c===z){t.tag=11,t=yg(null,t,o,e,r);break e}else if(c===I){t.tag=14,t=vg(null,t,o,e,r);break e}}throw t=Z(o)||o,Error(i(306,t,""))}}return t;case 0:return bu(e,t,t.type,t.pendingProps,r);case 1:return o=t.type,c=nr(o,t.pendingProps),Tg(e,t,o,c,r);case 3:e:{if(fe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));o=t.pendingProps;var f=t.memoizedState;c=f.element,Kc(e,t),Ys(t,o,null,r);var b=t.memoizedState;if(o=b.cache,ca(t,ot,o),o!==f.cache&&Hc(t,[ot],r,!0),Hs(),o=b.element,f.isDehydrated)if(f={element:o,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=Eg(e,t,o,r);break e}else if(o!==c){c=Jt(Error(i(424)),t),qs(c),t=Eg(e,t,o,r);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ze=hn(e.firstChild),Ot=t,De=!0,Fa=null,Cn=!0,r=ig(t,null,o,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(Ls(),o===c){t=Zn(e,t,r);break e}vt(e,t,o,r)}t=t.child}return t;case 26:return _o(e,t),e===null?(r=jp(t.type,null,t.pendingProps,null))?t.memoizedState=r:De||(r=t.type,e=t.pendingProps,o=Go(oe.current).createElement(r),o[$e]=t,o[Ye]=e,xt(o,r,e),dt(o),t.stateNode=o):t.memoizedState=jp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ae(t),e===null&&De&&(o=t.stateNode=Op(t.type,t.pendingProps,oe.current),Ot=t,Cn=!0,c=Ze,Ea(t.type)?(of=c,Ze=hn(o.firstChild)):Ze=c),vt(e,t,t.pendingProps.children,r),_o(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&De&&((c=o=Ze)&&(o=C1(o,t.type,t.pendingProps,Cn),o!==null?(t.stateNode=o,Ot=t,Ze=hn(o.firstChild),Cn=!1,c=!0):c=!1),c||Za(t)),Ae(t),c=t.type,f=t.pendingProps,b=e!==null?e.memoizedProps:null,o=f.children,nf(c,f)?o=null:b!==null&&nf(c,b)&&(t.flags|=32),t.memoizedState!==null&&(c=tu(e,t,Hw,null,null,r),di._currentValue=c),_o(e,t),vt(e,t,o,r),t.child;case 6:return e===null&&De&&((e=r=Ze)&&(r=R1(r,t.pendingProps,Cn),r!==null?(t.stateNode=r,Ot=t,Ze=null,e=!0):e=!1),e||Za(t)),null;case 13:return Cg(e,t,r);case 4:return fe(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=Br(t,null,o,r):vt(e,t,o,r),t.child;case 11:return yg(e,t,t.type,t.pendingProps,r);case 7:return vt(e,t,t.pendingProps,r),t.child;case 8:return vt(e,t,t.pendingProps.children,r),t.child;case 12:return vt(e,t,t.pendingProps.children,r),t.child;case 10:return o=t.pendingProps,ca(t,t.type,o.value),vt(e,t,o.children,r),t.child;case 9:return c=t.type._context,o=t.pendingProps.children,Ja(t),c=Et(c),o=o(c),t.flags|=1,vt(e,t,o,r),t.child;case 14:return vg(e,t,t.type,t.pendingProps,r);case 15:return bg(e,t,t.type,t.pendingProps,r);case 19:return Ng(e,t,r);case 31:return o=t.pendingProps,r=t.mode,o={mode:o.mode,children:o.children},e===null?(r=jo(o,r),r.ref=t.ref,t.child=r,r.return=t,t=r):(r=Yn(e.child,o),r.ref=t.ref,t.child=r,r.return=t,t=r),t;case 22:return xg(e,t,r);case 24:return Ja(t),o=Et(ot),e===null?(c=Gc(),c===null&&(c=Qe,f=Yc(),c.pooledCache=f,f.refCount++,f!==null&&(c.pooledCacheLanes|=r),c=f),t.memoizedState={parent:o,cache:c},Xc(t),ca(t,ot,c)):((e.lanes&r)!==0&&(Kc(e,t),Ys(t,null,null,r),Hs()),c=e.memoizedState,f=t.memoizedState,c.parent!==o?(c={parent:o,cache:o},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),ca(t,ot,o)):(o=f.cache,ca(t,ot,o),o!==c.cache&&Hc(t,[ot],r,!0))),vt(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Wn(e){e.flags|=4}function Og(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!zp(t)){if(t=an.current,t!==null&&((Oe&4194048)===Oe?Rn!==null:(Oe&62914560)!==Oe&&(Oe&536870912)===0||t!==Rn))throw Vs=$c,dm;e.flags|=8192}}function Do(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ws():536870912,e.lanes|=t,Hr|=t)}function Zs(e,t){if(!De)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function Fe(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,o=0;if(t)for(var c=e.child;c!==null;)r|=c.lanes|c.childLanes,o|=c.subtreeFlags&65011712,o|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)r|=c.lanes|c.childLanes,o|=c.subtreeFlags,o|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=o,e.childLanes=r,t}function Ww(e,t,r){var o=t.pendingProps;switch(Bc(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fe(t),null;case 1:return Fe(t),null;case 3:return r=t.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),Xn(ot),je(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ks(t)?Wn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,om())),Fe(t),null;case 26:return r=t.memoizedState,e===null?(Wn(t),r!==null?(Fe(t),Og(t,r)):(Fe(t),t.flags&=-16777217)):r?r!==e.memoizedState?(Wn(t),Fe(t),Og(t,r)):(Fe(t),t.flags&=-16777217):(e.memoizedProps!==o&&Wn(t),Fe(t),t.flags&=-16777217),null;case 27:we(t),r=oe.current;var c=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==o&&Wn(t);else{if(!o){if(t.stateNode===null)throw Error(i(166));return Fe(t),null}e=te.current,ks(t)?sm(t):(e=Op(c,o,r),t.stateNode=e,Wn(t))}return Fe(t),null;case 5:if(we(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&Wn(t);else{if(!o){if(t.stateNode===null)throw Error(i(166));return Fe(t),null}if(e=te.current,ks(t))sm(t);else{switch(c=Go(oe.current),e){case 1:e=c.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:e=c.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":e=c.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":e=c.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":e=c.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof o.is=="string"?c.createElement("select",{is:o.is}):c.createElement("select"),o.multiple?e.multiple=!0:o.size&&(e.size=o.size);break;default:e=typeof o.is=="string"?c.createElement(r,{is:o.is}):c.createElement(r)}}e[$e]=t,e[Ye]=o;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)e.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=e;e:switch(xt(e,r,o),r){case"button":case"input":case"select":case"textarea":e=!!o.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Wn(t)}}return Fe(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==o&&Wn(t);else{if(typeof o!="string"&&t.stateNode===null)throw Error(i(166));if(e=oe.current,ks(t)){if(e=t.stateNode,r=t.memoizedProps,o=null,c=Ot,c!==null)switch(c.tag){case 27:case 5:o=c.memoizedProps}e[$e]=t,e=!!(e.nodeValue===r||o!==null&&o.suppressHydrationWarning===!0||Sp(e.nodeValue,r)),e||Za(t)}else e=Go(e).createTextNode(o),e[$e]=t,t.stateNode=e}return Fe(t),null;case 13:if(o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=ks(t),o!==null&&o.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[$e]=t}else Ls(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Fe(t),c=!1}else c=om(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Fn(t),t):(Fn(t),null)}if(Fn(t),(t.flags&128)!==0)return t.lanes=r,t;if(r=o!==null,e=e!==null&&e.memoizedState!==null,r){o=t.child,c=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(c=o.alternate.memoizedState.cachePool.pool);var f=null;o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),f!==c&&(o.flags|=2048)}return r!==e&&r&&(t.child.flags|=8192),Do(t,t.updateQueue),Fe(t),null;case 4:return je(),e===null&&Zu(t.stateNode.containerInfo),Fe(t),null;case 10:return Xn(t.type),Fe(t),null;case 19:if(W(lt),c=t.memoizedState,c===null)return Fe(t),null;if(o=(t.flags&128)!==0,f=c.rendering,f===null)if(o)Zs(c,!1);else{if(We!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=Ao(e),f!==null){for(t.flags|=128,Zs(c,!1),e=f.updateQueue,t.updateQueue=e,Do(t,e),t.subtreeFlags=0,e=r,r=t.child;r!==null;)am(r,e),r=r.sibling;return F(lt,lt.current&1|2),t.child}e=e.sibling}c.tail!==null&&ut()>qo&&(t.flags|=128,o=!0,Zs(c,!1),t.lanes=4194304)}else{if(!o)if(e=Ao(f),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Do(t,e),Zs(c,!0),c.tail===null&&c.tailMode==="hidden"&&!f.alternate&&!De)return Fe(t),null}else 2*ut()-c.renderingStartTime>qo&&r!==536870912&&(t.flags|=128,o=!0,Zs(c,!1),t.lanes=4194304);c.isBackwards?(f.sibling=t.child,t.child=f):(e=c.last,e!==null?e.sibling=f:t.child=f,c.last=f)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=ut(),t.sibling=null,e=lt.current,F(lt,o?e&1|2:e&1),t):(Fe(t),null);case 22:case 23:return Fn(t),Jc(),o=t.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(t.flags|=8192):o&&(t.flags|=8192),o?(r&536870912)!==0&&(t.flags&128)===0&&(Fe(t),t.subtreeFlags&6&&(t.flags|=8192)):Fe(t),r=t.updateQueue,r!==null&&Do(t,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),o=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),o!==r&&(t.flags|=2048),e!==null&&W(er),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Xn(ot),Fe(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Jw(e,t){switch(Bc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xn(ot),je(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return we(t),null;case 13:if(Fn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ls()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return W(lt),null;case 4:return je(),null;case 10:return Xn(t.type),null;case 22:case 23:return Fn(t),Jc(),e!==null&&W(er),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Xn(ot),null;case 25:return null;default:return null}}function Mg(e,t){switch(Bc(t),t.tag){case 3:Xn(ot),je();break;case 26:case 27:case 5:we(t);break;case 4:je();break;case 13:Fn(t);break;case 19:W(lt);break;case 10:Xn(t.type);break;case 22:case 23:Fn(t),Jc(),e!==null&&W(er);break;case 24:Xn(ot)}}function Ws(e,t){try{var r=t.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var c=o.next;r=c;do{if((r.tag&e)===e){o=void 0;var f=r.create,b=r.inst;o=f(),b.destroy=o}r=r.next}while(r!==c)}}catch(R){Ie(t,t.return,R)}}function pa(e,t,r){try{var o=t.updateQueue,c=o!==null?o.lastEffect:null;if(c!==null){var f=c.next;o=f;do{if((o.tag&e)===e){var b=o.inst,R=b.destroy;if(R!==void 0){b.destroy=void 0,c=t;var O=r,B=R;try{B()}catch(Q){Ie(c,O,Q)}}}o=o.next}while(o!==f)}}catch(Q){Ie(t,t.return,Q)}}function _g(e){var t=e.updateQueue;if(t!==null){var r=e.stateNode;try{vm(t,r)}catch(o){Ie(e,e.return,o)}}}function jg(e,t,r){r.props=nr(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(o){Ie(e,t,o)}}function Js(e,t){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof r=="function"?e.refCleanup=r(o):r.current=o}}catch(c){Ie(e,t,c)}}function Nn(e,t){var r=e.ref,o=e.refCleanup;if(r!==null)if(typeof o=="function")try{o()}catch(c){Ie(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(c){Ie(e,t,c)}else r.current=null}function Dg(e){var t=e.type,r=e.memoizedProps,o=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":r.autoFocus&&o.focus();break e;case"img":r.src?o.src=r.src:r.srcSet&&(o.srcset=r.srcSet)}}catch(c){Ie(e,e.return,c)}}function Nu(e,t,r){try{var o=e.stateNode;x1(o,e.type,r,t),o[Ye]=t}catch(c){Ie(e,e.return,c)}}function kg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ea(e.type)||e.tag===4}function Au(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||kg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ea(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ou(e,t,r){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,t):(t=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,t.appendChild(e),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Qo));else if(o!==4&&(o===27&&Ea(e.type)&&(r=e.stateNode,t=null),e=e.child,e!==null))for(Ou(e,t,r),e=e.sibling;e!==null;)Ou(e,t,r),e=e.sibling}function ko(e,t,r){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(o!==4&&(o===27&&Ea(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(ko(e,t,r),e=e.sibling;e!==null;)ko(e,t,r),e=e.sibling}function Lg(e){var t=e.stateNode,r=e.memoizedProps;try{for(var o=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);xt(t,o,r),t[$e]=e,t[Ye]=r}catch(f){Ie(e,e.return,f)}}var Jn=!1,tt=!1,Mu=!1,qg=typeof WeakSet=="function"?WeakSet:Set,mt=null;function e1(e,t){if(e=e.containerInfo,ef=Wo,e=$h(e),Ac(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var o=r.getSelection&&r.getSelection();if(o&&o.rangeCount!==0){r=o.anchorNode;var c=o.anchorOffset,f=o.focusNode;o=o.focusOffset;try{r.nodeType,f.nodeType}catch{r=null;break e}var b=0,R=-1,O=-1,B=0,Q=0,X=e,P=null;t:for(;;){for(var V;X!==r||c!==0&&X.nodeType!==3||(R=b+c),X!==f||o!==0&&X.nodeType!==3||(O=b+o),X.nodeType===3&&(b+=X.nodeValue.length),(V=X.firstChild)!==null;)P=X,X=V;for(;;){if(X===e)break t;if(P===r&&++B===c&&(R=b),P===f&&++Q===o&&(O=b),(V=X.nextSibling)!==null)break;X=P,P=X.parentNode}X=V}r=R===-1||O===-1?null:{start:R,end:O}}else r=null}r=r||{start:0,end:0}}else r=null;for(tf={focusedElem:e,selectionRange:r},Wo=!1,mt=t;mt!==null;)if(t=mt,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,mt=e;else for(;mt!==null;){switch(t=mt,f=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,r=t,c=f.memoizedProps,f=f.memoizedState,o=r.stateNode;try{var ye=nr(r.type,c,r.elementType===r.type);e=o.getSnapshotBeforeUpdate(ye,f),o.__reactInternalSnapshotBeforeUpdate=e}catch(ge){Ie(r,r.return,ge)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,r=e.nodeType,r===9)rf(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":rf(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,mt=e;break}mt=t.return}}function zg(e,t,r){var o=r.flags;switch(r.tag){case 0:case 11:case 15:ya(e,r),o&4&&Ws(5,r);break;case 1:if(ya(e,r),o&4)if(e=r.stateNode,t===null)try{e.componentDidMount()}catch(b){Ie(r,r.return,b)}else{var c=nr(r.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Ie(r,r.return,b)}}o&64&&_g(r),o&512&&Js(r,r.return);break;case 3:if(ya(e,r),o&64&&(e=r.updateQueue,e!==null)){if(t=null,r.child!==null)switch(r.child.tag){case 27:case 5:t=r.child.stateNode;break;case 1:t=r.child.stateNode}try{vm(e,t)}catch(b){Ie(r,r.return,b)}}break;case 27:t===null&&o&4&&Lg(r);case 26:case 5:ya(e,r),t===null&&o&4&&Dg(r),o&512&&Js(r,r.return);break;case 12:ya(e,r);break;case 13:ya(e,r),o&4&&Pg(e,r),o&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=c1.bind(null,r),N1(e,r))));break;case 22:if(o=r.memoizedState!==null||Jn,!o){t=t!==null&&t.memoizedState!==null||tt,c=Jn;var f=tt;Jn=o,(tt=t)&&!f?va(e,r,(r.subtreeFlags&8772)!==0):ya(e,r),Jn=c,tt=f}break;case 30:break;default:ya(e,r)}}function Ug(e){var t=e.alternate;t!==null&&(e.alternate=null,Ug(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&cc(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Xe=null,Lt=!1;function ea(e,t,r){for(r=r.child;r!==null;)Bg(e,t,r),r=r.sibling}function Bg(e,t,r){if(at&&typeof at.onCommitFiberUnmount=="function")try{at.onCommitFiberUnmount(ft,r)}catch{}switch(r.tag){case 26:tt||Nn(r,t),ea(e,t,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:tt||Nn(r,t);var o=Xe,c=Lt;Ea(r.type)&&(Xe=r.stateNode,Lt=!1),ea(e,t,r),li(r.stateNode),Xe=o,Lt=c;break;case 5:tt||Nn(r,t);case 6:if(o=Xe,c=Lt,Xe=null,ea(e,t,r),Xe=o,Lt=c,Xe!==null)if(Lt)try{(Xe.nodeType===9?Xe.body:Xe.nodeName==="HTML"?Xe.ownerDocument.body:Xe).removeChild(r.stateNode)}catch(f){Ie(r,t,f)}else try{Xe.removeChild(r.stateNode)}catch(f){Ie(r,t,f)}break;case 18:Xe!==null&&(Lt?(e=Xe,Np(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),pi(e)):Np(Xe,r.stateNode));break;case 4:o=Xe,c=Lt,Xe=r.stateNode.containerInfo,Lt=!0,ea(e,t,r),Xe=o,Lt=c;break;case 0:case 11:case 14:case 15:tt||pa(2,r,t),tt||pa(4,r,t),ea(e,t,r);break;case 1:tt||(Nn(r,t),o=r.stateNode,typeof o.componentWillUnmount=="function"&&jg(r,t,o)),ea(e,t,r);break;case 21:ea(e,t,r);break;case 22:tt=(o=tt)||r.memoizedState!==null,ea(e,t,r),tt=o;break;default:ea(e,t,r)}}function Pg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{pi(e)}catch(r){Ie(t,t.return,r)}}function t1(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new qg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new qg),t;default:throw Error(i(435,e.tag))}}function _u(e,t){var r=t1(e);t.forEach(function(o){var c=u1.bind(null,e,o);r.has(o)||(r.add(o),o.then(c,c))})}function It(e,t){var r=t.deletions;if(r!==null)for(var o=0;o<r.length;o++){var c=r[o],f=e,b=t,R=b;e:for(;R!==null;){switch(R.tag){case 27:if(Ea(R.type)){Xe=R.stateNode,Lt=!1;break e}break;case 5:Xe=R.stateNode,Lt=!1;break e;case 3:case 4:Xe=R.stateNode.containerInfo,Lt=!0;break e}R=R.return}if(Xe===null)throw Error(i(160));Bg(f,b,c),Xe=null,Lt=!1,f=c.alternate,f!==null&&(f.return=null),c.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)Vg(t,e),t=t.sibling}var dn=null;function Vg(e,t){var r=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:It(t,e),Ht(e),o&4&&(pa(3,e,e.return),Ws(3,e),pa(5,e,e.return));break;case 1:It(t,e),Ht(e),o&512&&(tt||r===null||Nn(r,r.return)),o&64&&Jn&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?o:r.concat(o))));break;case 26:var c=dn;if(It(t,e),Ht(e),o&512&&(tt||r===null||Nn(r,r.return)),o&4){var f=r!==null?r.memoizedState:null;if(o=e.memoizedState,r===null)if(o===null)if(e.stateNode===null){e:{o=e.type,r=e.memoizedProps,c=c.ownerDocument||c;t:switch(o){case"title":f=c.getElementsByTagName("title")[0],(!f||f[Ts]||f[$e]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=c.createElement(o),c.head.insertBefore(f,c.querySelector("head > title"))),xt(f,o,r),f[$e]=e,dt(f),o=f;break e;case"link":var b=Lp("link","href",c).get(o+(r.href||""));if(b){for(var R=0;R<b.length;R++)if(f=b[R],f.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&f.getAttribute("rel")===(r.rel==null?null:r.rel)&&f.getAttribute("title")===(r.title==null?null:r.title)&&f.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){b.splice(R,1);break t}}f=c.createElement(o),xt(f,o,r),c.head.appendChild(f);break;case"meta":if(b=Lp("meta","content",c).get(o+(r.content||""))){for(R=0;R<b.length;R++)if(f=b[R],f.getAttribute("content")===(r.content==null?null:""+r.content)&&f.getAttribute("name")===(r.name==null?null:r.name)&&f.getAttribute("property")===(r.property==null?null:r.property)&&f.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&f.getAttribute("charset")===(r.charSet==null?null:r.charSet)){b.splice(R,1);break t}}f=c.createElement(o),xt(f,o,r),c.head.appendChild(f);break;default:throw Error(i(468,o))}f[$e]=e,dt(f),o=f}e.stateNode=o}else qp(c,e.type,e.stateNode);else e.stateNode=kp(c,o,e.memoizedProps);else f!==o?(f===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):f.count--,o===null?qp(c,e.type,e.stateNode):kp(c,o,e.memoizedProps)):o===null&&e.stateNode!==null&&Nu(e,e.memoizedProps,r.memoizedProps)}break;case 27:It(t,e),Ht(e),o&512&&(tt||r===null||Nn(r,r.return)),r!==null&&o&4&&Nu(e,e.memoizedProps,r.memoizedProps);break;case 5:if(It(t,e),Ht(e),o&512&&(tt||r===null||Nn(r,r.return)),e.flags&32){c=e.stateNode;try{wr(c,"")}catch(V){Ie(e,e.return,V)}}o&4&&e.stateNode!=null&&(c=e.memoizedProps,Nu(e,c,r!==null?r.memoizedProps:c)),o&1024&&(Mu=!0);break;case 6:if(It(t,e),Ht(e),o&4){if(e.stateNode===null)throw Error(i(162));o=e.memoizedProps,r=e.stateNode;try{r.nodeValue=o}catch(V){Ie(e,e.return,V)}}break;case 3:if(Ko=null,c=dn,dn=$o(t.containerInfo),It(t,e),dn=c,Ht(e),o&4&&r!==null&&r.memoizedState.isDehydrated)try{pi(t.containerInfo)}catch(V){Ie(e,e.return,V)}Mu&&(Mu=!1,Ig(e));break;case 4:o=dn,dn=$o(e.stateNode.containerInfo),It(t,e),Ht(e),dn=o;break;case 12:It(t,e),Ht(e);break;case 13:It(t,e),Ht(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(zu=ut()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,_u(e,o)));break;case 22:c=e.memoizedState!==null;var O=r!==null&&r.memoizedState!==null,B=Jn,Q=tt;if(Jn=B||c,tt=Q||O,It(t,e),tt=Q,Jn=B,Ht(e),o&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(r===null||O||Jn||tt||ar(e)),r=null,t=e;;){if(t.tag===5||t.tag===26){if(r===null){O=r=t;try{if(f=O.stateNode,c)b=f.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{R=O.stateNode;var X=O.memoizedProps.style,P=X!=null&&X.hasOwnProperty("display")?X.display:null;R.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(V){Ie(O,O.return,V)}}}else if(t.tag===6){if(r===null){O=t;try{O.stateNode.nodeValue=c?"":O.memoizedProps}catch(V){Ie(O,O.return,V)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;r===t&&(r=null),t=t.return}r===t&&(r=null),t.sibling.return=t.return,t=t.sibling}o&4&&(o=e.updateQueue,o!==null&&(r=o.retryQueue,r!==null&&(o.retryQueue=null,_u(e,r))));break;case 19:It(t,e),Ht(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,_u(e,o)));break;case 30:break;case 21:break;default:It(t,e),Ht(e)}}function Ht(e){var t=e.flags;if(t&2){try{for(var r,o=e.return;o!==null;){if(kg(o)){r=o;break}o=o.return}if(r==null)throw Error(i(160));switch(r.tag){case 27:var c=r.stateNode,f=Au(e);ko(e,f,c);break;case 5:var b=r.stateNode;r.flags&32&&(wr(b,""),r.flags&=-33);var R=Au(e);ko(e,R,b);break;case 3:case 4:var O=r.stateNode.containerInfo,B=Au(e);Ou(e,B,O);break;default:throw Error(i(161))}}catch(Q){Ie(e,e.return,Q)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ig(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ig(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ya(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)zg(e,t.alternate,t),t=t.sibling}function ar(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:pa(4,t,t.return),ar(t);break;case 1:Nn(t,t.return);var r=t.stateNode;typeof r.componentWillUnmount=="function"&&jg(t,t.return,r),ar(t);break;case 27:li(t.stateNode);case 26:case 5:Nn(t,t.return),ar(t);break;case 22:t.memoizedState===null&&ar(t);break;case 30:ar(t);break;default:ar(t)}e=e.sibling}}function va(e,t,r){for(r=r&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var o=t.alternate,c=e,f=t,b=f.flags;switch(f.tag){case 0:case 11:case 15:va(c,f,r),Ws(4,f);break;case 1:if(va(c,f,r),o=f,c=o.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(B){Ie(o,o.return,B)}if(o=f,c=o.updateQueue,c!==null){var R=o.stateNode;try{var O=c.shared.hiddenCallbacks;if(O!==null)for(c.shared.hiddenCallbacks=null,c=0;c<O.length;c++)ym(O[c],R)}catch(B){Ie(o,o.return,B)}}r&&b&64&&_g(f),Js(f,f.return);break;case 27:Lg(f);case 26:case 5:va(c,f,r),r&&o===null&&b&4&&Dg(f),Js(f,f.return);break;case 12:va(c,f,r);break;case 13:va(c,f,r),r&&b&4&&Pg(c,f);break;case 22:f.memoizedState===null&&va(c,f,r),Js(f,f.return);break;case 30:break;default:va(c,f,r)}t=t.sibling}}function ju(e,t){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&Us(r))}function Du(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Us(e))}function An(e,t,r,o){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Hg(e,t,r,o),t=t.sibling}function Hg(e,t,r,o){var c=t.flags;switch(t.tag){case 0:case 11:case 15:An(e,t,r,o),c&2048&&Ws(9,t);break;case 1:An(e,t,r,o);break;case 3:An(e,t,r,o),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Us(e)));break;case 12:if(c&2048){An(e,t,r,o),e=t.stateNode;try{var f=t.memoizedProps,b=f.id,R=f.onPostCommit;typeof R=="function"&&R(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(O){Ie(t,t.return,O)}}else An(e,t,r,o);break;case 13:An(e,t,r,o);break;case 23:break;case 22:f=t.stateNode,b=t.alternate,t.memoizedState!==null?f._visibility&2?An(e,t,r,o):ei(e,t):f._visibility&2?An(e,t,r,o):(f._visibility|=2,Pr(e,t,r,o,(t.subtreeFlags&10256)!==0)),c&2048&&ju(b,t);break;case 24:An(e,t,r,o),c&2048&&Du(t.alternate,t);break;default:An(e,t,r,o)}}function Pr(e,t,r,o,c){for(c=c&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var f=e,b=t,R=r,O=o,B=b.flags;switch(b.tag){case 0:case 11:case 15:Pr(f,b,R,O,c),Ws(8,b);break;case 23:break;case 22:var Q=b.stateNode;b.memoizedState!==null?Q._visibility&2?Pr(f,b,R,O,c):ei(f,b):(Q._visibility|=2,Pr(f,b,R,O,c)),c&&B&2048&&ju(b.alternate,b);break;case 24:Pr(f,b,R,O,c),c&&B&2048&&Du(b.alternate,b);break;default:Pr(f,b,R,O,c)}t=t.sibling}}function ei(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var r=e,o=t,c=o.flags;switch(o.tag){case 22:ei(r,o),c&2048&&ju(o.alternate,o);break;case 24:ei(r,o),c&2048&&Du(o.alternate,o);break;default:ei(r,o)}t=t.sibling}}var ti=8192;function Vr(e){if(e.subtreeFlags&ti)for(e=e.child;e!==null;)Yg(e),e=e.sibling}function Yg(e){switch(e.tag){case 26:Vr(e),e.flags&ti&&e.memoizedState!==null&&P1(dn,e.memoizedState,e.memoizedProps);break;case 5:Vr(e);break;case 3:case 4:var t=dn;dn=$o(e.stateNode.containerInfo),Vr(e),dn=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=ti,ti=16777216,Vr(e),ti=t):Vr(e));break;default:Vr(e)}}function Qg(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ni(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var o=t[r];mt=o,$g(o,e)}Qg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Gg(e),e=e.sibling}function Gg(e){switch(e.tag){case 0:case 11:case 15:ni(e),e.flags&2048&&pa(9,e,e.return);break;case 3:ni(e);break;case 12:ni(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Lo(e)):ni(e);break;default:ni(e)}}function Lo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var o=t[r];mt=o,$g(o,e)}Qg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:pa(8,t,t.return),Lo(t);break;case 22:r=t.stateNode,r._visibility&2&&(r._visibility&=-3,Lo(t));break;default:Lo(t)}e=e.sibling}}function $g(e,t){for(;mt!==null;){var r=mt;switch(r.tag){case 0:case 11:case 15:pa(8,r,t);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var o=r.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:Us(r.memoizedState.cache)}if(o=r.child,o!==null)o.return=r,mt=o;else e:for(r=e;mt!==null;){o=mt;var c=o.sibling,f=o.return;if(Ug(o),o===r){mt=null;break e}if(c!==null){c.return=f,mt=c;break e}mt=f}}}var n1={getCacheForType:function(e){var t=Et(ot),r=t.data.get(e);return r===void 0&&(r=e(),t.data.set(e,r)),r}},a1=typeof WeakMap=="function"?WeakMap:Map,ke=0,Qe=null,Ee=null,Oe=0,Le=0,Yt=null,ba=!1,Ir=!1,ku=!1,ta=0,We=0,xa=0,rr=0,Lu=0,rn=0,Hr=0,ai=null,qt=null,qu=!1,zu=0,qo=1/0,zo=null,wa=null,bt=0,Sa=null,Yr=null,Qr=0,Uu=0,Bu=null,Xg=null,ri=0,Pu=null;function Qt(){if((ke&2)!==0&&Oe!==0)return Oe&-Oe;if(L.T!==null){var e=jr;return e!==0?e:$u()}return jt()}function Kg(){rn===0&&(rn=(Oe&536870912)===0||De?xs():536870912);var e=an.current;return e!==null&&(e.flags|=32),rn}function Gt(e,t,r){(e===Qe&&(Le===2||Le===9)||e.cancelPendingCommit!==null)&&(Gr(e,0),Ta(e,Oe,rn,!1)),Vn(e,r),((ke&2)===0||e!==Qe)&&(e===Qe&&((ke&2)===0&&(rr|=r),We===4&&Ta(e,Oe,rn,!1)),On(e))}function Fg(e,t,r){if((ke&6)!==0)throw Error(i(327));var o=!r&&(t&124)===0&&(t&e.expiredLanes)===0||Ia(e,t),c=o?i1(e,t):Hu(e,t,!0),f=o;do{if(c===0){Ir&&!o&&Ta(e,t,0,!1);break}else{if(r=e.current.alternate,f&&!r1(r)){c=Hu(e,t,!1),f=!1;continue}if(c===2){if(f=t,e.errorRecoveryDisabledLanes&f)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var R=e;c=ai;var O=R.current.memoizedState.isDehydrated;if(O&&(Gr(R,b).flags|=256),b=Hu(R,b,!1),b!==2){if(ku&&!O){R.errorRecoveryDisabledLanes|=f,rr|=f,c=4;break e}f=qt,qt=c,f!==null&&(qt===null?qt=f:qt.push.apply(qt,f))}c=b}if(f=!1,c!==2)continue}}if(c===1){Gr(e,0),Ta(e,t,0,!0);break}e:{switch(o=e,f=c,f){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Ta(o,t,rn,!ba);break e;case 2:qt=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=zu+300-ut(),10<c)){if(Ta(o,t,rn,!ba),un(o,0,!0)!==0)break e;o.timeoutHandle=Cp(Zg.bind(null,o,r,qt,zo,qu,t,rn,rr,Hr,ba,f,2,-0,0),c);break e}Zg(o,r,qt,zo,qu,t,rn,rr,Hr,ba,f,0,-0,0)}}break}while(!0);On(e)}function Zg(e,t,r,o,c,f,b,R,O,B,Q,X,P,V){if(e.timeoutHandle=-1,X=t.subtreeFlags,(X&8192||(X&16785408)===16785408)&&(fi={stylesheets:null,count:0,unsuspend:B1},Yg(t),X=V1(),X!==null)){e.cancelPendingCommit=X(rp.bind(null,e,t,f,r,o,c,b,R,O,Q,1,P,V)),Ta(e,f,b,!B);return}rp(e,t,f,r,o,c,b,R,O)}function r1(e){for(var t=e;;){var r=t.tag;if((r===0||r===11||r===15)&&t.flags&16384&&(r=t.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var o=0;o<r.length;o++){var c=r[o],f=c.getSnapshot;c=c.value;try{if(!Pt(f(),c))return!1}catch{return!1}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ta(e,t,r,o){t&=~Lu,t&=~rr,e.suspendedLanes|=t,e.pingedLanes&=~t,o&&(e.warmLanes|=t),o=e.expirationTimes;for(var c=t;0<c;){var f=31-Nt(c),b=1<<f;o[f]=-1,c&=~b}r!==0&&$i(e,r,t)}function Uo(){return(ke&6)===0?(si(0),!1):!0}function Vu(){if(Ee!==null){if(Le===0)var e=Ee.return;else e=Ee,$n=Wa=null,ru(e),Ur=null,Ks=0,e=Ee;for(;e!==null;)Mg(e.alternate,e),e=e.return;Ee=null}}function Gr(e,t){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,S1(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),Vu(),Qe=e,Ee=r=Yn(e.current,null),Oe=t,Le=0,Yt=null,ba=!1,Ir=Ia(e,t),ku=!1,Hr=rn=Lu=rr=xa=We=0,qt=ai=null,qu=!1,(t&8)!==0&&(t|=t&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=t;0<o;){var c=31-Nt(o),f=1<<c;t|=e[c],o&=~f}return ta=t,so(),r}function Wg(e,t){Se=null,L.H=Co,t===Ps||t===go?(t=gm(),Le=3):t===dm?(t=gm(),Le=4):Le=t===pg?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Yt=t,Ee===null&&(We=1,Mo(e,Jt(t,e.current)))}function Jg(){var e=L.H;return L.H=Co,e===null?Co:e}function ep(){var e=L.A;return L.A=n1,e}function Iu(){We=4,ba||(Oe&4194048)!==Oe&&an.current!==null||(Ir=!0),(xa&134217727)===0&&(rr&134217727)===0||Qe===null||Ta(Qe,Oe,rn,!1)}function Hu(e,t,r){var o=ke;ke|=2;var c=Jg(),f=ep();(Qe!==e||Oe!==t)&&(zo=null,Gr(e,t)),t=!1;var b=We;e:do try{if(Le!==0&&Ee!==null){var R=Ee,O=Yt;switch(Le){case 8:Vu(),b=6;break e;case 3:case 2:case 9:case 6:an.current===null&&(t=!0);var B=Le;if(Le=0,Yt=null,$r(e,R,O,B),r&&Ir){b=0;break e}break;default:B=Le,Le=0,Yt=null,$r(e,R,O,B)}}s1(),b=We;break}catch(Q){Wg(e,Q)}while(!0);return t&&e.shellSuspendCounter++,$n=Wa=null,ke=o,L.H=c,L.A=f,Ee===null&&(Qe=null,Oe=0,so()),b}function s1(){for(;Ee!==null;)tp(Ee)}function i1(e,t){var r=ke;ke|=2;var o=Jg(),c=ep();Qe!==e||Oe!==t?(zo=null,qo=ut()+500,Gr(e,t)):Ir=Ia(e,t);e:do try{if(Le!==0&&Ee!==null){t=Ee;var f=Yt;t:switch(Le){case 1:Le=0,Yt=null,$r(e,t,f,1);break;case 2:case 9:if(hm(f)){Le=0,Yt=null,np(t);break}t=function(){Le!==2&&Le!==9||Qe!==e||(Le=7),On(e)},f.then(t,t);break e;case 3:Le=7;break e;case 4:Le=5;break e;case 7:hm(f)?(Le=0,Yt=null,np(t)):(Le=0,Yt=null,$r(e,t,f,7));break;case 5:var b=null;switch(Ee.tag){case 26:b=Ee.memoizedState;case 5:case 27:var R=Ee;if(!b||zp(b)){Le=0,Yt=null;var O=R.sibling;if(O!==null)Ee=O;else{var B=R.return;B!==null?(Ee=B,Bo(B)):Ee=null}break t}}Le=0,Yt=null,$r(e,t,f,5);break;case 6:Le=0,Yt=null,$r(e,t,f,6);break;case 8:Vu(),We=6;break e;default:throw Error(i(462))}}o1();break}catch(Q){Wg(e,Q)}while(!0);return $n=Wa=null,L.H=o,L.A=c,ke=r,Ee!==null?0:(Qe=null,Oe=0,so(),We)}function o1(){for(;Ee!==null&&!Bn();)tp(Ee)}function tp(e){var t=Ag(e.alternate,e,ta);e.memoizedProps=e.pendingProps,t===null?Bo(e):Ee=t}function np(e){var t=e,r=t.alternate;switch(t.tag){case 15:case 0:t=Sg(r,t,t.pendingProps,t.type,void 0,Oe);break;case 11:t=Sg(r,t,t.pendingProps,t.type.render,t.ref,Oe);break;case 5:ru(t);default:Mg(r,t),t=Ee=am(t,ta),t=Ag(r,t,ta)}e.memoizedProps=e.pendingProps,t===null?Bo(e):Ee=t}function $r(e,t,r,o){$n=Wa=null,ru(t),Ur=null,Ks=0;var c=t.return;try{if(Fw(e,c,t,r,Oe)){We=1,Mo(e,Jt(r,e.current)),Ee=null;return}}catch(f){if(c!==null)throw Ee=c,f;We=1,Mo(e,Jt(r,e.current)),Ee=null;return}t.flags&32768?(De||o===1?e=!0:Ir||(Oe&536870912)!==0?e=!1:(ba=e=!0,(o===2||o===9||o===3||o===6)&&(o=an.current,o!==null&&o.tag===13&&(o.flags|=16384))),ap(t,e)):Bo(t)}function Bo(e){var t=e;do{if((t.flags&32768)!==0){ap(t,ba);return}e=t.return;var r=Ww(t.alternate,t,ta);if(r!==null){Ee=r;return}if(t=t.sibling,t!==null){Ee=t;return}Ee=t=e}while(t!==null);We===0&&(We=5)}function ap(e,t){do{var r=Jw(e.alternate,e);if(r!==null){r.flags&=32767,Ee=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!t&&(e=e.sibling,e!==null)){Ee=e;return}Ee=e=r}while(e!==null);We=6,Ee=null}function rp(e,t,r,o,c,f,b,R,O){e.cancelPendingCommit=null;do Po();while(bt!==0);if((ke&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(f=t.lanes|t.childLanes,f|=Dc,En(e,r,f,b,R,O),e===Qe&&(Ee=Qe=null,Oe=0),Yr=t,Sa=e,Qr=r,Uu=f,Bu=c,Xg=o,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,f1(xn,function(){return cp(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||o){o=L.T,L.T=null,c=Y.p,Y.p=2,b=ke,ke|=4;try{e1(e,t,r)}finally{ke=b,Y.p=c,L.T=o}}bt=1,sp(),ip(),op()}}function sp(){if(bt===1){bt=0;var e=Sa,t=Yr,r=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||r){r=L.T,L.T=null;var o=Y.p;Y.p=2;var c=ke;ke|=4;try{Vg(t,e);var f=tf,b=$h(e.containerInfo),R=f.focusedElem,O=f.selectionRange;if(b!==R&&R&&R.ownerDocument&&Gh(R.ownerDocument.documentElement,R)){if(O!==null&&Ac(R)){var B=O.start,Q=O.end;if(Q===void 0&&(Q=B),"selectionStart"in R)R.selectionStart=B,R.selectionEnd=Math.min(Q,R.value.length);else{var X=R.ownerDocument||document,P=X&&X.defaultView||window;if(P.getSelection){var V=P.getSelection(),ye=R.textContent.length,ge=Math.min(O.start,ye),Pe=O.end===void 0?ge:Math.min(O.end,ye);!V.extend&&ge>Pe&&(b=Pe,Pe=ge,ge=b);var q=Qh(R,ge),D=Qh(R,Pe);if(q&&D&&(V.rangeCount!==1||V.anchorNode!==q.node||V.anchorOffset!==q.offset||V.focusNode!==D.node||V.focusOffset!==D.offset)){var U=X.createRange();U.setStart(q.node,q.offset),V.removeAllRanges(),ge>Pe?(V.addRange(U),V.extend(D.node,D.offset)):(U.setEnd(D.node,D.offset),V.addRange(U))}}}}for(X=[],V=R;V=V.parentNode;)V.nodeType===1&&X.push({element:V,left:V.scrollLeft,top:V.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<X.length;R++){var G=X[R];G.element.scrollLeft=G.left,G.element.scrollTop=G.top}}Wo=!!ef,tf=ef=null}finally{ke=c,Y.p=o,L.T=r}}e.current=t,bt=2}}function ip(){if(bt===2){bt=0;var e=Sa,t=Yr,r=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||r){r=L.T,L.T=null;var o=Y.p;Y.p=2;var c=ke;ke|=4;try{zg(e,t.alternate,t)}finally{ke=c,Y.p=o,L.T=r}}bt=3}}function op(){if(bt===4||bt===3){bt=0,bn();var e=Sa,t=Yr,r=Qr,o=Xg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?bt=5:(bt=0,Yr=Sa=null,lp(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(wa=null),ze(r),t=t.stateNode,at&&typeof at.onCommitFiberRoot=="function")try{at.onCommitFiberRoot(ft,t,void 0,(t.current.flags&128)===128)}catch{}if(o!==null){t=L.T,c=Y.p,Y.p=2,L.T=null;try{for(var f=e.onRecoverableError,b=0;b<o.length;b++){var R=o[b];f(R.value,{componentStack:R.stack})}}finally{L.T=t,Y.p=c}}(Qr&3)!==0&&Po(),On(e),c=e.pendingLanes,(r&4194090)!==0&&(c&42)!==0?e===Pu?ri++:(ri=0,Pu=e):ri=0,si(0)}}function lp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Us(t)))}function Po(e){return sp(),ip(),op(),cp()}function cp(){if(bt!==5)return!1;var e=Sa,t=Uu;Uu=0;var r=ze(Qr),o=L.T,c=Y.p;try{Y.p=32>r?32:r,L.T=null,r=Bu,Bu=null;var f=Sa,b=Qr;if(bt=0,Yr=Sa=null,Qr=0,(ke&6)!==0)throw Error(i(331));var R=ke;if(ke|=4,Gg(f.current),Hg(f,f.current,b,r),ke=R,si(0,!1),at&&typeof at.onPostCommitFiberRoot=="function")try{at.onPostCommitFiberRoot(ft,f)}catch{}return!0}finally{Y.p=c,L.T=o,lp(e,t)}}function up(e,t,r){t=Jt(r,t),t=vu(e.stateNode,t,2),e=da(e,t,2),e!==null&&(Vn(e,2),On(e))}function Ie(e,t,r){if(e.tag===3)up(e,e,r);else for(;t!==null;){if(t.tag===3){up(t,e,r);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(wa===null||!wa.has(o))){e=Jt(r,e),r=mg(2),o=da(t,r,2),o!==null&&(gg(r,o,t,e),Vn(o,2),On(o));break}}t=t.return}}function Yu(e,t,r){var o=e.pingCache;if(o===null){o=e.pingCache=new a1;var c=new Set;o.set(t,c)}else c=o.get(t),c===void 0&&(c=new Set,o.set(t,c));c.has(r)||(ku=!0,c.add(r),e=l1.bind(null,e,t,r),t.then(e,e))}function l1(e,t,r){var o=e.pingCache;o!==null&&o.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,Qe===e&&(Oe&r)===r&&(We===4||We===3&&(Oe&62914560)===Oe&&300>ut()-zu?(ke&2)===0&&Gr(e,0):Lu|=r,Hr===Oe&&(Hr=0)),On(e)}function fp(e,t){t===0&&(t=ws()),e=Ar(e,t),e!==null&&(Vn(e,t),On(e))}function c1(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),fp(e,r)}function u1(e,t){var r=0;switch(e.tag){case 13:var o=e.stateNode,c=e.memoizedState;c!==null&&(r=c.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(i(314))}o!==null&&o.delete(t),fp(e,r)}function f1(e,t){return nt(e,t)}var Vo=null,Xr=null,Qu=!1,Io=!1,Gu=!1,sr=0;function On(e){e!==Xr&&e.next===null&&(Xr===null?Vo=Xr=e:Xr=Xr.next=e),Io=!0,Qu||(Qu=!0,h1())}function si(e,t){if(!Gu&&Io){Gu=!0;do for(var r=!1,o=Vo;o!==null;){if(e!==0){var c=o.pendingLanes;if(c===0)var f=0;else{var b=o.suspendedLanes,R=o.pingedLanes;f=(1<<31-Nt(42|e)+1)-1,f&=c&~(b&~R),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(r=!0,gp(o,f))}else f=Oe,f=un(o,o===Qe?f:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(f&3)===0||Ia(o,f)||(r=!0,gp(o,f));o=o.next}while(r);Gu=!1}}function d1(){dp()}function dp(){Io=Qu=!1;var e=0;sr!==0&&(w1()&&(e=sr),sr=0);for(var t=ut(),r=null,o=Vo;o!==null;){var c=o.next,f=hp(o,t);f===0?(o.next=null,r===null?Vo=c:r.next=c,c===null&&(Xr=r)):(r=o,(e!==0||(f&3)!==0)&&(Io=!0)),o=c}si(e)}function hp(e,t){for(var r=e.suspendedLanes,o=e.pingedLanes,c=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var b=31-Nt(f),R=1<<b,O=c[b];O===-1?((R&r)===0||(R&o)!==0)&&(c[b]=oc(R,t)):O<=t&&(e.expiredLanes|=R),f&=~R}if(t=Qe,r=Oe,r=un(e,e===t?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,r===0||e===t&&(Le===2||Le===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&Tt(o),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||Ia(e,r)){if(t=r&-r,t===e.callbackPriority)return t;switch(o!==null&&Tt(o),ze(r)){case 2:case 8:r=bs;break;case 32:r=xn;break;case 268435456:r=wn;break;default:r=xn}return o=mp.bind(null,e),r=nt(r,o),e.callbackPriority=t,e.callbackNode=r,t}return o!==null&&o!==null&&Tt(o),e.callbackPriority=2,e.callbackNode=null,2}function mp(e,t){if(bt!==0&&bt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(Po()&&e.callbackNode!==r)return null;var o=Oe;return o=un(e,e===Qe?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(Fg(e,o,t),hp(e,ut()),e.callbackNode!=null&&e.callbackNode===r?mp.bind(null,e):null)}function gp(e,t){if(Po())return null;Fg(e,t,!0)}function h1(){T1(function(){(ke&6)!==0?nt(Pn,d1):dp()})}function $u(){return sr===0&&(sr=xs()),sr}function pp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Wi(""+e)}function yp(e,t){var r=t.ownerDocument.createElement("input");return r.name=t.name,r.value=t.value,e.id&&r.setAttribute("form",e.id),t.parentNode.insertBefore(r,t),e=new FormData(e),r.parentNode.removeChild(r),e}function m1(e,t,r,o,c){if(t==="submit"&&r&&r.stateNode===c){var f=pp((c[Ye]||null).action),b=o.submitter;b&&(t=(t=b[Ye]||null)?pp(t.formAction):b.getAttribute("formAction"),t!==null&&(f=t,b=null));var R=new no("action","action",null,o,c);e.push({event:R,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(sr!==0){var O=b?yp(c,b):new FormData(c);hu(r,{pending:!0,data:O,method:c.method,action:f},null,O)}}else typeof f=="function"&&(R.preventDefault(),O=b?yp(c,b):new FormData(c),hu(r,{pending:!0,data:O,method:c.method,action:f},f,O))},currentTarget:c}]})}}for(var Xu=0;Xu<jc.length;Xu++){var Ku=jc[Xu],g1=Ku.toLowerCase(),p1=Ku[0].toUpperCase()+Ku.slice(1);fn(g1,"on"+p1)}fn(Fh,"onAnimationEnd"),fn(Zh,"onAnimationIteration"),fn(Wh,"onAnimationStart"),fn("dblclick","onDoubleClick"),fn("focusin","onFocus"),fn("focusout","onBlur"),fn(Dw,"onTransitionRun"),fn(kw,"onTransitionStart"),fn(Lw,"onTransitionCancel"),fn(Jh,"onTransitionEnd"),vr("onMouseEnter",["mouseout","mouseover"]),vr("onMouseLeave",["mouseout","mouseover"]),vr("onPointerEnter",["pointerout","pointerover"]),vr("onPointerLeave",["pointerout","pointerover"]),Ha("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ha("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ha("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ha("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ha("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ha("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ii="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(" "),y1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ii));function vp(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var o=e[r],c=o.event;o=o.listeners;e:{var f=void 0;if(t)for(var b=o.length-1;0<=b;b--){var R=o[b],O=R.instance,B=R.currentTarget;if(R=R.listener,O!==f&&c.isPropagationStopped())break e;f=R,c.currentTarget=B;try{f(c)}catch(Q){Oo(Q)}c.currentTarget=null,f=O}else for(b=0;b<o.length;b++){if(R=o[b],O=R.instance,B=R.currentTarget,R=R.listener,O!==f&&c.isPropagationStopped())break e;f=R,c.currentTarget=B;try{f(c)}catch(Q){Oo(Q)}c.currentTarget=null,f=O}}}}function Ce(e,t){var r=t[lc];r===void 0&&(r=t[lc]=new Set);var o=e+"__bubble";r.has(o)||(bp(t,e,2,!1),r.add(o))}function Fu(e,t,r){var o=0;t&&(o|=4),bp(r,e,o,t)}var Ho="_reactListening"+Math.random().toString(36).slice(2);function Zu(e){if(!e[Ho]){e[Ho]=!0,dh.forEach(function(r){r!=="selectionchange"&&(y1.has(r)||Fu(r,!1,e),Fu(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ho]||(t[Ho]=!0,Fu("selectionchange",!1,t))}}function bp(e,t,r,o){switch(Hp(t)){case 2:var c=Y1;break;case 8:c=Q1;break;default:c=df}r=c.bind(null,t,r,e),c=void 0,!bc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),o?c!==void 0?e.addEventListener(t,r,{capture:!0,passive:c}):e.addEventListener(t,r,!0):c!==void 0?e.addEventListener(t,r,{passive:c}):e.addEventListener(t,r,!1)}function Wu(e,t,r,o,c){var f=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var b=o.tag;if(b===3||b===4){var R=o.stateNode.containerInfo;if(R===c)break;if(b===4)for(b=o.return;b!==null;){var O=b.tag;if((O===3||O===4)&&b.stateNode.containerInfo===c)return;b=b.return}for(;R!==null;){if(b=gr(R),b===null)return;if(O=b.tag,O===5||O===6||O===26||O===27){o=f=b;continue e}R=R.parentNode}}o=o.return}Rh(function(){var B=f,Q=yc(r),X=[];e:{var P=em.get(e);if(P!==void 0){var V=no,ye=e;switch(e){case"keypress":if(eo(r)===0)break e;case"keydown":case"keyup":V=fw;break;case"focusin":ye="focus",V=Tc;break;case"focusout":ye="blur",V=Tc;break;case"beforeblur":case"afterblur":V=Tc;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":V=Oh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":V=Jx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":V=mw;break;case Fh:case Zh:case Wh:V=nw;break;case Jh:V=pw;break;case"scroll":case"scrollend":V=Zx;break;case"wheel":V=vw;break;case"copy":case"cut":case"paste":V=rw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":V=_h;break;case"toggle":case"beforetoggle":V=xw}var ge=(t&4)!==0,Pe=!ge&&(e==="scroll"||e==="scrollend"),q=ge?P!==null?P+"Capture":null:P;ge=[];for(var D=B,U;D!==null;){var G=D;if(U=G.stateNode,G=G.tag,G!==5&&G!==26&&G!==27||U===null||q===null||(G=Cs(D,q),G!=null&&ge.push(oi(D,G,U))),Pe)break;D=D.return}0<ge.length&&(P=new V(P,ye,null,r,Q),X.push({event:P,listeners:ge}))}}if((t&7)===0){e:{if(P=e==="mouseover"||e==="pointerover",V=e==="mouseout"||e==="pointerout",P&&r!==pc&&(ye=r.relatedTarget||r.fromElement)&&(gr(ye)||ye[At]))break e;if((V||P)&&(P=Q.window===Q?Q:(P=Q.ownerDocument)?P.defaultView||P.parentWindow:window,V?(ye=r.relatedTarget||r.toElement,V=B,ye=ye?gr(ye):null,ye!==null&&(Pe=u(ye),ge=ye.tag,ye!==Pe||ge!==5&&ge!==27&&ge!==6)&&(ye=null)):(V=null,ye=B),V!==ye)){if(ge=Oh,G="onMouseLeave",q="onMouseEnter",D="mouse",(e==="pointerout"||e==="pointerover")&&(ge=_h,G="onPointerLeave",q="onPointerEnter",D="pointer"),Pe=V==null?P:Es(V),U=ye==null?P:Es(ye),P=new ge(G,D+"leave",V,r,Q),P.target=Pe,P.relatedTarget=U,G=null,gr(Q)===B&&(ge=new ge(q,D+"enter",ye,r,Q),ge.target=U,ge.relatedTarget=Pe,G=ge),Pe=G,V&&ye)t:{for(ge=V,q=ye,D=0,U=ge;U;U=Kr(U))D++;for(U=0,G=q;G;G=Kr(G))U++;for(;0<D-U;)ge=Kr(ge),D--;for(;0<U-D;)q=Kr(q),U--;for(;D--;){if(ge===q||q!==null&&ge===q.alternate)break t;ge=Kr(ge),q=Kr(q)}ge=null}else ge=null;V!==null&&xp(X,P,V,ge,!1),ye!==null&&Pe!==null&&xp(X,Pe,ye,ge,!0)}}e:{if(P=B?Es(B):window,V=P.nodeName&&P.nodeName.toLowerCase(),V==="select"||V==="input"&&P.type==="file")var ie=Bh;else if(zh(P))if(Ph)ie=Mw;else{ie=Aw;var Te=Nw}else V=P.nodeName,!V||V.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?B&&gc(B.elementType)&&(ie=Bh):ie=Ow;if(ie&&(ie=ie(e,B))){Uh(X,ie,r,Q);break e}Te&&Te(e,P,B),e==="focusout"&&B&&P.type==="number"&&B.memoizedProps.value!=null&&mc(P,"number",P.value)}switch(Te=B?Es(B):window,e){case"focusin":(zh(Te)||Te.contentEditable==="true")&&(Cr=Te,Oc=B,Ds=null);break;case"focusout":Ds=Oc=Cr=null;break;case"mousedown":Mc=!0;break;case"contextmenu":case"mouseup":case"dragend":Mc=!1,Xh(X,r,Q);break;case"selectionchange":if(jw)break;case"keydown":case"keyup":Xh(X,r,Q)}var ce;if(Cc)e:{switch(e){case"compositionstart":var pe="onCompositionStart";break e;case"compositionend":pe="onCompositionEnd";break e;case"compositionupdate":pe="onCompositionUpdate";break e}pe=void 0}else Er?Lh(e,r)&&(pe="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(pe="onCompositionStart");pe&&(jh&&r.locale!=="ko"&&(Er||pe!=="onCompositionStart"?pe==="onCompositionEnd"&&Er&&(ce=Nh()):(la=Q,xc="value"in la?la.value:la.textContent,Er=!0)),Te=Yo(B,pe),0<Te.length&&(pe=new Mh(pe,e,null,r,Q),X.push({event:pe,listeners:Te}),ce?pe.data=ce:(ce=qh(r),ce!==null&&(pe.data=ce)))),(ce=Sw?Tw(e,r):Ew(e,r))&&(pe=Yo(B,"onBeforeInput"),0<pe.length&&(Te=new Mh("onBeforeInput","beforeinput",null,r,Q),X.push({event:Te,listeners:pe}),Te.data=ce)),m1(X,e,B,r,Q)}vp(X,t)})}function oi(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Yo(e,t){for(var r=t+"Capture",o=[];e!==null;){var c=e,f=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||f===null||(c=Cs(e,r),c!=null&&o.unshift(oi(e,c,f)),c=Cs(e,t),c!=null&&o.push(oi(e,c,f))),e.tag===3)return o;e=e.return}return[]}function Kr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function xp(e,t,r,o,c){for(var f=t._reactName,b=[];r!==null&&r!==o;){var R=r,O=R.alternate,B=R.stateNode;if(R=R.tag,O!==null&&O===o)break;R!==5&&R!==26&&R!==27||B===null||(O=B,c?(B=Cs(r,f),B!=null&&b.unshift(oi(r,B,O))):c||(B=Cs(r,f),B!=null&&b.push(oi(r,B,O)))),r=r.return}b.length!==0&&e.push({event:t,listeners:b})}var v1=/\r\n?/g,b1=/\u0000|\uFFFD/g;function wp(e){return(typeof e=="string"?e:""+e).replace(v1,`
`).replace(b1,"")}function Sp(e,t){return t=wp(t),wp(e)===t}function Qo(){}function Be(e,t,r,o,c,f){switch(r){case"children":typeof o=="string"?t==="body"||t==="textarea"&&o===""||wr(e,o):(typeof o=="number"||typeof o=="bigint")&&t!=="body"&&wr(e,""+o);break;case"className":Ki(e,"class",o);break;case"tabIndex":Ki(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Ki(e,r,o);break;case"style":Eh(e,o,f);break;case"data":if(t!=="object"){Ki(e,"data",o);break}case"src":case"href":if(o===""&&(t!=="a"||r!=="href")){e.removeAttribute(r);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(r);break}o=Wi(""+o),e.setAttribute(r,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(r,"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 f=="function"&&(r==="formAction"?(t!=="input"&&Be(e,t,"name",c.name,c,null),Be(e,t,"formEncType",c.formEncType,c,null),Be(e,t,"formMethod",c.formMethod,c,null),Be(e,t,"formTarget",c.formTarget,c,null)):(Be(e,t,"encType",c.encType,c,null),Be(e,t,"method",c.method,c,null),Be(e,t,"target",c.target,c,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(r);break}o=Wi(""+o),e.setAttribute(r,o);break;case"onClick":o!=null&&(e.onclick=Qo);break;case"onScroll":o!=null&&Ce("scroll",e);break;case"onScrollEnd":o!=null&&Ce("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(i(61));if(r=o.__html,r!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=r}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}r=Wi(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(r,""+o):e.removeAttribute(r);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":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":o===!0?e.setAttribute(r,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(r,o):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(r,o):e.removeAttribute(r);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(r):e.setAttribute(r,o);break;case"popover":Ce("beforetoggle",e),Ce("toggle",e),Xi(e,"popover",o);break;case"xlinkActuate":In(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":In(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":In(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":In(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":In(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":In(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":In(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":In(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":In(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Xi(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=Kx.get(r)||r,Xi(e,r,o))}}function Ju(e,t,r,o,c,f){switch(r){case"style":Eh(e,o,f);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(i(61));if(r=o.__html,r!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=r}}break;case"children":typeof o=="string"?wr(e,o):(typeof o=="number"||typeof o=="bigint")&&wr(e,""+o);break;case"onScroll":o!=null&&Ce("scroll",e);break;case"onScrollEnd":o!=null&&Ce("scrollend",e);break;case"onClick":o!=null&&(e.onclick=Qo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!hh.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(c=r.endsWith("Capture"),t=r.slice(2,c?r.length-7:void 0),f=e[Ye]||null,f=f!=null?f[r]:null,typeof f=="function"&&e.removeEventListener(t,f,c),typeof o=="function")){typeof f!="function"&&f!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(t,o,c);break e}r in e?e[r]=o:o===!0?e.setAttribute(r,""):Xi(e,r,o)}}}function xt(e,t,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ce("error",e),Ce("load",e);var o=!1,c=!1,f;for(f in r)if(r.hasOwnProperty(f)){var b=r[f];if(b!=null)switch(f){case"src":o=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Be(e,t,f,b,r,null)}}c&&Be(e,t,"srcSet",r.srcSet,r,null),o&&Be(e,t,"src",r.src,r,null);return;case"input":Ce("invalid",e);var R=f=b=c=null,O=null,B=null;for(o in r)if(r.hasOwnProperty(o)){var Q=r[o];if(Q!=null)switch(o){case"name":c=Q;break;case"type":b=Q;break;case"checked":O=Q;break;case"defaultChecked":B=Q;break;case"value":f=Q;break;case"defaultValue":R=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(i(137,t));break;default:Be(e,t,o,Q,r,null)}}xh(e,f,R,O,B,b,c,!1),Fi(e);return;case"select":Ce("invalid",e),o=b=f=null;for(c in r)if(r.hasOwnProperty(c)&&(R=r[c],R!=null))switch(c){case"value":f=R;break;case"defaultValue":b=R;break;case"multiple":o=R;default:Be(e,t,c,R,r,null)}t=f,r=b,e.multiple=!!o,t!=null?xr(e,!!o,t,!1):r!=null&&xr(e,!!o,r,!0);return;case"textarea":Ce("invalid",e),f=c=o=null;for(b in r)if(r.hasOwnProperty(b)&&(R=r[b],R!=null))switch(b){case"value":o=R;break;case"defaultValue":c=R;break;case"children":f=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(i(91));break;default:Be(e,t,b,R,r,null)}Sh(e,o,c,f),Fi(e);return;case"option":for(O in r)if(r.hasOwnProperty(O)&&(o=r[O],o!=null))switch(O){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:Be(e,t,O,o,r,null)}return;case"dialog":Ce("beforetoggle",e),Ce("toggle",e),Ce("cancel",e),Ce("close",e);break;case"iframe":case"object":Ce("load",e);break;case"video":case"audio":for(o=0;o<ii.length;o++)Ce(ii[o],e);break;case"image":Ce("error",e),Ce("load",e);break;case"details":Ce("toggle",e);break;case"embed":case"source":case"link":Ce("error",e),Ce("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(B in r)if(r.hasOwnProperty(B)&&(o=r[B],o!=null))switch(B){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Be(e,t,B,o,r,null)}return;default:if(gc(t)){for(Q in r)r.hasOwnProperty(Q)&&(o=r[Q],o!==void 0&&Ju(e,t,Q,o,r,void 0));return}}for(R in r)r.hasOwnProperty(R)&&(o=r[R],o!=null&&Be(e,t,R,o,r,null))}function x1(e,t,r,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,f=null,b=null,R=null,O=null,B=null,Q=null;for(V in r){var X=r[V];if(r.hasOwnProperty(V)&&X!=null)switch(V){case"checked":break;case"value":break;case"defaultValue":O=X;default:o.hasOwnProperty(V)||Be(e,t,V,null,o,X)}}for(var P in o){var V=o[P];if(X=r[P],o.hasOwnProperty(P)&&(V!=null||X!=null))switch(P){case"type":f=V;break;case"name":c=V;break;case"checked":B=V;break;case"defaultChecked":Q=V;break;case"value":b=V;break;case"defaultValue":R=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(i(137,t));break;default:V!==X&&Be(e,t,P,V,o,X)}}hc(e,b,R,O,B,Q,f,c);return;case"select":V=b=R=P=null;for(f in r)if(O=r[f],r.hasOwnProperty(f)&&O!=null)switch(f){case"value":break;case"multiple":V=O;default:o.hasOwnProperty(f)||Be(e,t,f,null,o,O)}for(c in o)if(f=o[c],O=r[c],o.hasOwnProperty(c)&&(f!=null||O!=null))switch(c){case"value":P=f;break;case"defaultValue":R=f;break;case"multiple":b=f;default:f!==O&&Be(e,t,c,f,o,O)}t=R,r=b,o=V,P!=null?xr(e,!!r,P,!1):!!o!=!!r&&(t!=null?xr(e,!!r,t,!0):xr(e,!!r,r?[]:"",!1));return;case"textarea":V=P=null;for(R in r)if(c=r[R],r.hasOwnProperty(R)&&c!=null&&!o.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:Be(e,t,R,null,o,c)}for(b in o)if(c=o[b],f=r[b],o.hasOwnProperty(b)&&(c!=null||f!=null))switch(b){case"value":P=c;break;case"defaultValue":V=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==f&&Be(e,t,b,c,o,f)}wh(e,P,V);return;case"option":for(var ye in r)if(P=r[ye],r.hasOwnProperty(ye)&&P!=null&&!o.hasOwnProperty(ye))switch(ye){case"selected":e.selected=!1;break;default:Be(e,t,ye,null,o,P)}for(O in o)if(P=o[O],V=r[O],o.hasOwnProperty(O)&&P!==V&&(P!=null||V!=null))switch(O){case"selected":e.selected=P&&typeof P!="function"&&typeof P!="symbol";break;default:Be(e,t,O,P,o,V)}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 ge in r)P=r[ge],r.hasOwnProperty(ge)&&P!=null&&!o.hasOwnProperty(ge)&&Be(e,t,ge,null,o,P);for(B in o)if(P=o[B],V=r[B],o.hasOwnProperty(B)&&P!==V&&(P!=null||V!=null))switch(B){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(i(137,t));break;default:Be(e,t,B,P,o,V)}return;default:if(gc(t)){for(var Pe in r)P=r[Pe],r.hasOwnProperty(Pe)&&P!==void 0&&!o.hasOwnProperty(Pe)&&Ju(e,t,Pe,void 0,o,P);for(Q in o)P=o[Q],V=r[Q],!o.hasOwnProperty(Q)||P===V||P===void 0&&V===void 0||Ju(e,t,Q,P,o,V);return}}for(var q in r)P=r[q],r.hasOwnProperty(q)&&P!=null&&!o.hasOwnProperty(q)&&Be(e,t,q,null,o,P);for(X in o)P=o[X],V=r[X],!o.hasOwnProperty(X)||P===V||P==null&&V==null||Be(e,t,X,P,o,V)}var ef=null,tf=null;function Go(e){return e.nodeType===9?e:e.ownerDocument}function Tp(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ep(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function nf(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var af=null;function w1(){var e=window.event;return e&&e.type==="popstate"?e===af?!1:(af=e,!0):(af=null,!1)}var Cp=typeof setTimeout=="function"?setTimeout:void 0,S1=typeof clearTimeout=="function"?clearTimeout:void 0,Rp=typeof Promise=="function"?Promise:void 0,T1=typeof queueMicrotask=="function"?queueMicrotask:typeof Rp<"u"?function(e){return Rp.resolve(null).then(e).catch(E1)}:Cp;function E1(e){setTimeout(function(){throw e})}function Ea(e){return e==="head"}function Np(e,t){var r=t,o=0,c=0;do{var f=r.nextSibling;if(e.removeChild(r),f&&f.nodeType===8)if(r=f.data,r==="/$"){if(0<o&&8>o){r=o;var b=e.ownerDocument;if(r&1&&li(b.documentElement),r&2&&li(b.body),r&4)for(r=b.head,li(r),b=r.firstChild;b;){var R=b.nextSibling,O=b.nodeName;b[Ts]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&b.rel.toLowerCase()==="stylesheet"||r.removeChild(b),b=R}}if(c===0){e.removeChild(f),pi(t);return}c--}else r==="$"||r==="$?"||r==="$!"?c++:o=r.charCodeAt(0)-48;else o=0;r=f}while(r);pi(t)}function rf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var r=t;switch(t=t.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":rf(r),cc(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function C1(e,t,r,o){for(;e.nodeType===1;){var c=r;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[Ts])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=hn(e.nextSibling),e===null)break}return null}function R1(e,t,r){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=hn(e.nextSibling),e===null))return null;return e}function sf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function N1(e,t){var r=e.ownerDocument;if(e.data!=="$?"||r.readyState==="complete")t();else{var o=function(){t(),r.removeEventListener("DOMContentLoaded",o)};r.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function hn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var of=null;function Ap(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}function Op(e,t,r){switch(t=Go(r),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function li(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);cc(e)}var sn=new Map,Mp=new Set;function $o(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var na=Y.d;Y.d={f:A1,r:O1,D:M1,C:_1,L:j1,m:D1,X:L1,S:k1,M:q1};function A1(){var e=na.f(),t=Uo();return e||t}function O1(e){var t=pr(e);t!==null&&t.tag===5&&t.type==="form"?Fm(t):na.r(e)}var Fr=typeof document>"u"?null:document;function _p(e,t,r){var o=Fr;if(o&&typeof t=="string"&&t){var c=Wt(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof r=="string"&&(c+='[crossorigin="'+r+'"]'),Mp.has(c)||(Mp.add(c),e={rel:e,crossOrigin:r,href:t},o.querySelector(c)===null&&(t=o.createElement("link"),xt(t,"link",e),dt(t),o.head.appendChild(t)))}}function M1(e){na.D(e),_p("dns-prefetch",e,null)}function _1(e,t){na.C(e,t),_p("preconnect",e,t)}function j1(e,t,r){na.L(e,t,r);var o=Fr;if(o&&e&&t){var c='link[rel="preload"][as="'+Wt(t)+'"]';t==="image"&&r&&r.imageSrcSet?(c+='[imagesrcset="'+Wt(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(c+='[imagesizes="'+Wt(r.imageSizes)+'"]')):c+='[href="'+Wt(e)+'"]';var f=c;switch(t){case"style":f=Zr(e);break;case"script":f=Wr(e)}sn.has(f)||(e=v({rel:"preload",href:t==="image"&&r&&r.imageSrcSet?void 0:e,as:t},r),sn.set(f,e),o.querySelector(c)!==null||t==="style"&&o.querySelector(ci(f))||t==="script"&&o.querySelector(ui(f))||(t=o.createElement("link"),xt(t,"link",e),dt(t),o.head.appendChild(t)))}}function D1(e,t){na.m(e,t);var r=Fr;if(r&&e){var o=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+Wt(o)+'"][href="'+Wt(e)+'"]',f=c;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Wr(e)}if(!sn.has(f)&&(e=v({rel:"modulepreload",href:e},t),sn.set(f,e),r.querySelector(c)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(ui(f)))return}o=r.createElement("link"),xt(o,"link",e),dt(o),r.head.appendChild(o)}}}function k1(e,t,r){na.S(e,t,r);var o=Fr;if(o&&e){var c=yr(o).hoistableStyles,f=Zr(e);t=t||"default";var b=c.get(f);if(!b){var R={loading:0,preload:null};if(b=o.querySelector(ci(f)))R.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},r),(r=sn.get(f))&&lf(e,r);var O=b=o.createElement("link");dt(O),xt(O,"link",e),O._p=new Promise(function(B,Q){O.onload=B,O.onerror=Q}),O.addEventListener("load",function(){R.loading|=1}),O.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Xo(b,t,o)}b={type:"stylesheet",instance:b,count:1,state:R},c.set(f,b)}}}function L1(e,t){na.X(e,t);var r=Fr;if(r&&e){var o=yr(r).hoistableScripts,c=Wr(e),f=o.get(c);f||(f=r.querySelector(ui(c)),f||(e=v({src:e,async:!0},t),(t=sn.get(c))&&cf(e,t),f=r.createElement("script"),dt(f),xt(f,"link",e),r.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},o.set(c,f))}}function q1(e,t){na.M(e,t);var r=Fr;if(r&&e){var o=yr(r).hoistableScripts,c=Wr(e),f=o.get(c);f||(f=r.querySelector(ui(c)),f||(e=v({src:e,async:!0,type:"module"},t),(t=sn.get(c))&&cf(e,t),f=r.createElement("script"),dt(f),xt(f,"link",e),r.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},o.set(c,f))}}function jp(e,t,r,o){var c=(c=oe.current)?$o(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(t=Zr(r.href),r=yr(c).hoistableStyles,o=r.get(t),o||(o={type:"style",instance:null,count:0,state:null},r.set(t,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=Zr(r.href);var f=yr(c).hoistableStyles,b=f.get(e);if(b||(c=c.ownerDocument||c,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,b),(f=c.querySelector(ci(e)))&&!f._p&&(b.instance=f,b.state.loading=5),sn.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},sn.set(e,r),f||z1(c,e,r,b.state))),t&&o===null)throw Error(i(528,""));return b}if(t&&o!==null)throw Error(i(529,""));return null;case"script":return t=r.async,r=r.src,typeof r=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Wr(r),r=yr(c).hoistableScripts,o=r.get(t),o||(o={type:"script",instance:null,count:0,state:null},r.set(t,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Zr(e){return'href="'+Wt(e)+'"'}function ci(e){return'link[rel="stylesheet"]['+e+"]"}function Dp(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function z1(e,t,r,o){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?o.loading=1:(t=e.createElement("link"),o.preload=t,t.addEventListener("load",function(){return o.loading|=1}),t.addEventListener("error",function(){return o.loading|=2}),xt(t,"link",r),dt(t),e.head.appendChild(t))}function Wr(e){return'[src="'+Wt(e)+'"]'}function ui(e){return"script[async]"+e}function kp(e,t,r){if(t.count++,t.instance===null)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+Wt(r.href)+'"]');if(o)return t.instance=o,dt(o),o;var c=v({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),dt(o),xt(o,"style",c),Xo(o,r.precedence,e),t.instance=o;case"stylesheet":c=Zr(r.href);var f=e.querySelector(ci(c));if(f)return t.state.loading|=4,t.instance=f,dt(f),f;o=Dp(r),(c=sn.get(c))&&lf(o,c),f=(e.ownerDocument||e).createElement("link"),dt(f);var b=f;return b._p=new Promise(function(R,O){b.onload=R,b.onerror=O}),xt(f,"link",o),t.state.loading|=4,Xo(f,r.precedence,e),t.instance=f;case"script":return f=Wr(r.src),(c=e.querySelector(ui(f)))?(t.instance=c,dt(c),c):(o=r,(c=sn.get(f))&&(o=v({},r),cf(o,c)),e=e.ownerDocument||e,c=e.createElement("script"),dt(c),xt(c,"link",o),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(o=t.instance,t.state.loading|=4,Xo(o,r.precedence,e));return t.instance}function Xo(e,t,r){for(var o=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=o.length?o[o.length-1]:null,f=c,b=0;b<o.length;b++){var R=o[b];if(R.dataset.precedence===t)f=R;else if(f!==c)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=r.nodeType===9?r.head:r,t.insertBefore(e,t.firstChild))}function lf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function cf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ko=null;function Lp(e,t,r){if(Ko===null){var o=new Map,c=Ko=new Map;c.set(r,o)}else c=Ko,o=c.get(r),o||(o=new Map,c.set(r,o));if(o.has(e))return o;for(o.set(e,null),r=r.getElementsByTagName(e),c=0;c<r.length;c++){var f=r[c];if(!(f[Ts]||f[$e]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var b=f.getAttribute(t)||"";b=e+b;var R=o.get(b);R?R.push(f):o.set(b,[f])}}return o}function qp(e,t,r){e=e.ownerDocument||e,e.head.insertBefore(r,t==="title"?e.querySelector("head > title"):null)}function U1(e,t,r){if(r===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function zp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}var fi=null;function B1(){}function P1(e,t,r){if(fi===null)throw Error(i(475));var o=fi;if(t.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var c=Zr(r.href),f=e.querySelector(ci(c));if(f){e=f._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(o.count++,o=Fo.bind(o),e.then(o,o)),t.state.loading|=4,t.instance=f,dt(f);return}f=e.ownerDocument||e,r=Dp(r),(c=sn.get(c))&&lf(r,c),f=f.createElement("link"),dt(f);var b=f;b._p=new Promise(function(R,O){b.onload=R,b.onerror=O}),xt(f,"link",r),t.instance=f}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(t,e),(e=t.state.preload)&&(t.state.loading&3)===0&&(o.count++,t=Fo.bind(o),e.addEventListener("load",t),e.addEventListener("error",t))}}function V1(){if(fi===null)throw Error(i(475));var e=fi;return e.stylesheets&&e.count===0&&uf(e,e.stylesheets),0<e.count?function(t){var r=setTimeout(function(){if(e.stylesheets&&uf(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(r)}}:null}function Fo(){if(this.count--,this.count===0){if(this.stylesheets)uf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zo=null;function uf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zo=new Map,t.forEach(I1,e),Zo=null,Fo.call(e))}function I1(e,t){if(!(t.state.loading&4)){var r=Zo.get(e);if(r)var o=r.get(null);else{r=new Map,Zo.set(e,r);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<c.length;f++){var b=c[f];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(r.set(b.dataset.precedence,b),o=b)}o&&r.set(null,o)}c=t.instance,b=c.getAttribute("data-precedence"),f=r.get(b)||o,f===o&&r.set(null,c),r.set(b,c),this.count++,o=Fo.bind(this),c.addEventListener("load",o),c.addEventListener("error",o),f?f.parentNode.insertBefore(c,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var di={$$typeof:_,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function H1(e,t,r,o,c,f,b,R){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ss(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ss(0),this.hiddenUpdates=Ss(null),this.identifierPrefix=o,this.onUncaughtError=c,this.onCaughtError=f,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function Up(e,t,r,o,c,f,b,R,O,B,Q,X){return e=new H1(e,t,r,b,R,O,B,X),t=1,f===!0&&(t|=24),f=Vt(3,null,null,t),e.current=f,f.stateNode=e,t=Yc(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:o,isDehydrated:r,cache:t},Xc(f),e}function Bp(e){return e?(e=Or,e):Or}function Pp(e,t,r,o,c,f){c=Bp(c),o.context===null?o.context=c:o.pendingContext=c,o=fa(t),o.payload={element:r},f=f===void 0?null:f,f!==null&&(o.callback=f),r=da(e,o,t),r!==null&&(Gt(r,e,t),Is(r,e,t))}function Vp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function ff(e,t){Vp(e,t),(e=e.alternate)&&Vp(e,t)}function Ip(e){if(e.tag===13){var t=Ar(e,67108864);t!==null&&Gt(t,e,67108864),ff(e,67108864)}}var Wo=!0;function Y1(e,t,r,o){var c=L.T;L.T=null;var f=Y.p;try{Y.p=2,df(e,t,r,o)}finally{Y.p=f,L.T=c}}function Q1(e,t,r,o){var c=L.T;L.T=null;var f=Y.p;try{Y.p=8,df(e,t,r,o)}finally{Y.p=f,L.T=c}}function df(e,t,r,o){if(Wo){var c=hf(o);if(c===null)Wu(e,t,o,Jo,r),Yp(e,o);else if($1(c,e,t,r,o))o.stopPropagation();else if(Yp(e,o),t&4&&-1<G1.indexOf(e)){for(;c!==null;){var f=pr(c);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var b=Tn(f.pendingLanes);if(b!==0){var R=f;for(R.pendingLanes|=2,R.entangledLanes|=2;b;){var O=1<<31-Nt(b);R.entanglements[1]|=O,b&=~O}On(f),(ke&6)===0&&(qo=ut()+500,si(0))}}break;case 13:R=Ar(f,2),R!==null&&Gt(R,f,2),Uo(),ff(f,2)}if(f=hf(o),f===null&&Wu(e,t,o,Jo,r),f===c)break;c=f}c!==null&&o.stopPropagation()}else Wu(e,t,o,null,r)}}function hf(e){return e=yc(e),mf(e)}var Jo=null;function mf(e){if(Jo=null,e=gr(e),e!==null){var t=u(e);if(t===null)e=null;else{var r=t.tag;if(r===13){if(e=d(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Jo=e,null}function Hp(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Va()){case Pn:return 2;case bs:return 8;case xn:case Qi:return 32;case wn:return 268435456;default:return 32}default:return 32}}var gf=!1,Ca=null,Ra=null,Na=null,hi=new Map,mi=new Map,Aa=[],G1="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 Yp(e,t){switch(e){case"focusin":case"focusout":Ca=null;break;case"dragenter":case"dragleave":Ra=null;break;case"mouseover":case"mouseout":Na=null;break;case"pointerover":case"pointerout":hi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":mi.delete(t.pointerId)}}function gi(e,t,r,o,c,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:r,eventSystemFlags:o,nativeEvent:f,targetContainers:[c]},t!==null&&(t=pr(t),t!==null&&Ip(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function $1(e,t,r,o,c){switch(t){case"focusin":return Ca=gi(Ca,e,t,r,o,c),!0;case"dragenter":return Ra=gi(Ra,e,t,r,o,c),!0;case"mouseover":return Na=gi(Na,e,t,r,o,c),!0;case"pointerover":var f=c.pointerId;return hi.set(f,gi(hi.get(f)||null,e,t,r,o,c)),!0;case"gotpointercapture":return f=c.pointerId,mi.set(f,gi(mi.get(f)||null,e,t,r,o,c)),!0}return!1}function Qp(e){var t=gr(e.target);if(t!==null){var r=u(t);if(r!==null){if(t=r.tag,t===13){if(t=d(r),t!==null){e.blockedOn=t,Bt(e.priority,function(){if(r.tag===13){var o=Qt();o=Me(o);var c=Ar(r,o);c!==null&&Gt(c,r,o),ff(r,o)}});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function el(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=hf(e.nativeEvent);if(r===null){r=e.nativeEvent;var o=new r.constructor(r.type,r);pc=o,r.target.dispatchEvent(o),pc=null}else return t=pr(r),t!==null&&Ip(t),e.blockedOn=r,!1;t.shift()}return!0}function Gp(e,t,r){el(e)&&r.delete(t)}function X1(){gf=!1,Ca!==null&&el(Ca)&&(Ca=null),Ra!==null&&el(Ra)&&(Ra=null),Na!==null&&el(Na)&&(Na=null),hi.forEach(Gp),mi.forEach(Gp)}function tl(e,t){e.blockedOn===t&&(e.blockedOn=null,gf||(gf=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,X1)))}var nl=null;function $p(e){nl!==e&&(nl=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){nl===e&&(nl=null);for(var t=0;t<e.length;t+=3){var r=e[t],o=e[t+1],c=e[t+2];if(typeof o!="function"){if(mf(o||r)===null)continue;break}var f=pr(r);f!==null&&(e.splice(t,3),t-=3,hu(f,{pending:!0,data:c,method:r.method,action:o},o,c))}}))}function pi(e){function t(O){return tl(O,e)}Ca!==null&&tl(Ca,e),Ra!==null&&tl(Ra,e),Na!==null&&tl(Na,e),hi.forEach(t),mi.forEach(t);for(var r=0;r<Aa.length;r++){var o=Aa[r];o.blockedOn===e&&(o.blockedOn=null)}for(;0<Aa.length&&(r=Aa[0],r.blockedOn===null);)Qp(r),r.blockedOn===null&&Aa.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(o=0;o<r.length;o+=3){var c=r[o],f=r[o+1],b=c[Ye]||null;if(typeof f=="function")b||$p(r);else if(b){var R=null;if(f&&f.hasAttribute("formAction")){if(c=f,b=f[Ye]||null)R=b.formAction;else if(mf(c)!==null)continue}else R=b.action;typeof R=="function"?r[o+1]=R:(r.splice(o,3),o-=3),$p(r)}}}function pf(e){this._internalRoot=e}al.prototype.render=pf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var r=t.current,o=Qt();Pp(r,o,e,t,null,null)},al.prototype.unmount=pf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Pp(e.current,2,null,e,null,null),Uo(),t[At]=null}};function al(e){this._internalRoot=e}al.prototype.unstable_scheduleHydration=function(e){if(e){var t=jt();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Aa.length&&t!==0&&t<Aa[r].priority;r++);Aa.splice(r,0,e),r===0&&Qp(e)}};var Xp=a.version;if(Xp!=="19.1.0")throw Error(i(527,Xp,"19.1.0"));Y.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=m(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var K1={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var rl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rl.isDisabled&&rl.supportsFiber)try{ft=rl.inject(K1),at=rl}catch{}}return vi.createRoot=function(e,t){if(!l(e))throw Error(i(299));var r=!1,o="",c=ug,f=fg,b=dg,R=null;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(b=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(R=t.unstable_transitionCallbacks)),t=Up(e,1,!1,null,null,r,o,c,f,b,R,null),e[At]=t.current,Zu(e),new pf(t)},vi.hydrateRoot=function(e,t,r){if(!l(e))throw Error(i(299));var o=!1,c="",f=ug,b=fg,R=dg,O=null,B=null;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(f=r.onUncaughtError),r.onCaughtError!==void 0&&(b=r.onCaughtError),r.onRecoverableError!==void 0&&(R=r.onRecoverableError),r.unstable_transitionCallbacks!==void 0&&(O=r.unstable_transitionCallbacks),r.formState!==void 0&&(B=r.formState)),t=Up(e,1,!0,t,r??null,o,c,f,b,R,O,B),t.context=Bp(null),r=t.current,o=Qt(),o=Me(o),c=fa(o),c.callback=null,da(r,c,o),r=o,t.current.lanes=r,Vn(t,r),On(t),e[At]=t.current,Zu(e),new al(t)},vi.version="19.1.0",vi}var ry;function oS(){if(ry)return bf.exports;ry=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),bf.exports=iS(),bf.exports}var lS=oS();const cS=1,uS=1e6;let Tf=0;function fS(){return Tf=(Tf+1)%Number.MAX_SAFE_INTEGER,Tf.toString()}const Ef=new Map,sy=n=>{if(Ef.has(n))return;const a=setTimeout(()=>{Ef.delete(n),Ri({type:"REMOVE_TOAST",toastId:n})},uS);Ef.set(n,a)},dS=(n,a)=>{switch(a.type){case"ADD_TOAST":return{...n,toasts:[a.toast,...n.toasts].slice(0,cS)};case"UPDATE_TOAST":return{...n,toasts:n.toasts.map(s=>s.id===a.toast.id?{...s,...a.toast}:s)};case"DISMISS_TOAST":{const{toastId:s}=a;return s?sy(s):n.toasts.forEach(i=>{sy(i.id)}),{...n,toasts:n.toasts.map(i=>i.id===s||s===void 0?{...i,open:!1}:i)}}case"REMOVE_TOAST":return a.toastId===void 0?{...n,toasts:[]}:{...n,toasts:n.toasts.filter(s=>s.id!==a.toastId)}}},bl=[];let xl={toasts:[]};function Ri(n){xl=dS(xl,n),bl.forEach(a=>{a(xl)})}function hS({...n}){const a=fS(),s=l=>Ri({type:"UPDATE_TOAST",toast:{...l,id:a}}),i=()=>Ri({type:"DISMISS_TOAST",toastId:a});return Ri({type:"ADD_TOAST",toast:{...n,id:a,open:!0,onOpenChange:l=>{l||i()}}}),{id:a,dismiss:i,update:s}}function xd(){const[n,a]=x.useState(xl);return x.useEffect(()=>(bl.push(a),()=>{const s=bl.indexOf(a);s>-1&&bl.splice(s,1)}),[n]),{...n,toast:hS,dismiss:s=>Ri({type:"DISMISS_TOAST",toastId:s})}}var hs=Av();const Ov=Nv(hs);function Ne(n,a,{checkForDefaultPrevented:s=!0}={}){return function(l){if(n==null||n(l),s===!1||!l.defaultPrevented)return a==null?void 0:a(l)}}function iy(n,a){if(typeof n=="function")return n(a);n!=null&&(n.current=a)}function Mv(...n){return a=>{let s=!1;const i=n.map(l=>{const u=iy(l,a);return!s&&typeof u=="function"&&(s=!0),u});if(s)return()=>{for(let l=0;l<i.length;l++){const u=i[l];typeof u=="function"?u():iy(n[l],null)}}}}function Je(...n){return x.useCallback(Mv(...n),n)}function Vi(n,a=[]){let s=[];function i(u,d){const h=x.createContext(d),m=s.length;s=[...s,d];const g=T=>{var j;const{scope:S,children:w,...N}=T,E=((j=S==null?void 0:S[n])==null?void 0:j[m])||h,C=x.useMemo(()=>N,Object.values(N));return y.jsx(E.Provider,{value:C,children:w})};g.displayName=u+"Provider";function v(T,S){var E;const w=((E=S==null?void 0:S[n])==null?void 0:E[m])||h,N=x.useContext(w);if(N)return N;if(d!==void 0)return d;throw new Error(`\`${T}\` must be used within \`${u}\``)}return[g,v]}const l=()=>{const u=s.map(d=>x.createContext(d));return function(h){const m=(h==null?void 0:h[n])||u;return x.useMemo(()=>({[`__scope${n}`]:{...h,[n]:m}}),[h,m])}};return l.scopeName=n,[i,mS(l,...a)]}function mS(...n){const a=n[0];if(n.length===1)return a;const s=()=>{const i=n.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(u){const d=i.reduce((h,{useScope:m,scopeName:g})=>{const T=m(u)[`__scope${g}`];return{...h,...T}},{});return x.useMemo(()=>({[`__scope${a.scopeName}`]:d}),[d])}};return s.scopeName=a.scopeName,s}function Oi(n){const a=pS(n),s=x.forwardRef((i,l)=>{const{children:u,...d}=i,h=x.Children.toArray(u),m=h.find(vS);if(m){const g=m.props.children,v=h.map(T=>T===m?x.Children.count(g)>1?x.Children.only(null):x.isValidElement(g)?g.props.children:null:T);return y.jsx(a,{...d,ref:l,children:x.isValidElement(g)?x.cloneElement(g,void 0,v):null})}return y.jsx(a,{...d,ref:l,children:u})});return s.displayName=`${n}.Slot`,s}var gS=Oi("Slot");function pS(n){const a=x.forwardRef((s,i)=>{const{children:l,...u}=s;if(x.isValidElement(l)){const d=xS(l),h=bS(u,l.props);return l.type!==x.Fragment&&(h.ref=i?Mv(i,d):d),x.cloneElement(l,h)}return x.Children.count(l)>1?x.Children.only(null):null});return a.displayName=`${n}.SlotClone`,a}var _v=Symbol("radix.slottable");function yS(n){const a=({children:s})=>y.jsx(y.Fragment,{children:s});return a.displayName=`${n}.Slottable`,a.__radixId=_v,a}function vS(n){return x.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===_v}function bS(n,a){const s={...a};for(const i in a){const l=n[i],u=a[i];/^on[A-Z]/.test(i)?l&&u?s[i]=(...h)=>{const m=u(...h);return l(...h),m}:l&&(s[i]=l):i==="style"?s[i]={...l,...u}:i==="className"&&(s[i]=[l,u].filter(Boolean).join(" "))}return{...n,...s}}function xS(n){var i,l;let a=(i=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:i.get,s=a&&"isReactWarning"in a&&a.isReactWarning;return s?n.ref:(a=(l=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:l.get,s=a&&"isReactWarning"in a&&a.isReactWarning,s?n.props.ref:n.props.ref||n.ref)}function jv(n){const a=n+"CollectionProvider",[s,i]=Vi(a),[l,u]=s(a,{collectionRef:{current:null},itemMap:new Map}),d=E=>{const{scope:C,children:j}=E,M=ne.useRef(null),_=ne.useRef(new Map).current;return y.jsx(l,{scope:C,itemMap:_,collectionRef:M,children:j})};d.displayName=a;const h=n+"CollectionSlot",m=Oi(h),g=ne.forwardRef((E,C)=>{const{scope:j,children:M}=E,_=u(h,j),z=Je(C,_.collectionRef);return y.jsx(m,{ref:z,children:M})});g.displayName=h;const v=n+"CollectionItemSlot",T="data-radix-collection-item",S=Oi(v),w=ne.forwardRef((E,C)=>{const{scope:j,children:M,..._}=E,z=ne.useRef(null),k=Je(C,z),$=u(v,j);return ne.useEffect(()=>($.itemMap.set(z,{ref:z,..._}),()=>void $.itemMap.delete(z))),y.jsx(S,{[T]:"",ref:k,children:M})});w.displayName=v;function N(E){const C=u(n+"CollectionConsumer",E);return ne.useCallback(()=>{const M=C.collectionRef.current;if(!M)return[];const _=Array.from(M.querySelectorAll(`[${T}]`));return Array.from(C.itemMap.values()).sort(($,I)=>_.indexOf($.ref.current)-_.indexOf(I.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:d,Slot:g,ItemSlot:w},N,i]}var wS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ve=wS.reduce((n,a)=>{const s=Oi(`Primitive.${a}`),i=x.forwardRef((l,u)=>{const{asChild:d,...h}=l,m=d?s:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(m,{...h,ref:u})});return i.displayName=`Primitive.${a}`,{...n,[a]:i}},{});function Dv(n,a){n&&hs.flushSync(()=>n.dispatchEvent(a))}function pn(n){const a=x.useRef(n);return x.useEffect(()=>{a.current=n}),x.useMemo(()=>(...s)=>{var i;return(i=a.current)==null?void 0:i.call(a,...s)},[])}function SS(n,a=globalThis==null?void 0:globalThis.document){const s=pn(n);x.useEffect(()=>{const i=l=>{l.key==="Escape"&&s(l)};return a.addEventListener("keydown",i,{capture:!0}),()=>a.removeEventListener("keydown",i,{capture:!0})},[s,a])}var TS="DismissableLayer",Qf="dismissableLayer.update",ES="dismissableLayer.pointerDownOutside",CS="dismissableLayer.focusOutside",oy,kv=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Bl=x.forwardRef((n,a)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,onDismiss:h,...m}=n,g=x.useContext(kv),[v,T]=x.useState(null),S=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,w]=x.useState({}),N=Je(a,I=>T(I)),E=Array.from(g.layers),[C]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),j=E.indexOf(C),M=v?E.indexOf(v):-1,_=g.layersWithOutsidePointerEventsDisabled.size>0,z=M>=j,k=NS(I=>{const ae=I.target,le=[...g.branches].some(he=>he.contains(ae));!z||le||(l==null||l(I),d==null||d(I),I.defaultPrevented||h==null||h())},S),$=AS(I=>{const ae=I.target;[...g.branches].some(he=>he.contains(ae))||(u==null||u(I),d==null||d(I),I.defaultPrevented||h==null||h())},S);return SS(I=>{M===g.layers.size-1&&(i==null||i(I),!I.defaultPrevented&&h&&(I.preventDefault(),h()))},S),x.useEffect(()=>{if(v)return s&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(oy=S.body.style.pointerEvents,S.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(v)),g.layers.add(v),ly(),()=>{s&&g.layersWithOutsidePointerEventsDisabled.size===1&&(S.body.style.pointerEvents=oy)}},[v,S,s,g]),x.useEffect(()=>()=>{v&&(g.layers.delete(v),g.layersWithOutsidePointerEventsDisabled.delete(v),ly())},[v,g]),x.useEffect(()=>{const I=()=>w({});return document.addEventListener(Qf,I),()=>document.removeEventListener(Qf,I)},[]),y.jsx(Ve.div,{...m,ref:N,style:{pointerEvents:_?z?"auto":"none":void 0,...n.style},onFocusCapture:Ne(n.onFocusCapture,$.onFocusCapture),onBlurCapture:Ne(n.onBlurCapture,$.onBlurCapture),onPointerDownCapture:Ne(n.onPointerDownCapture,k.onPointerDownCapture)})});Bl.displayName=TS;var RS="DismissableLayerBranch",Lv=x.forwardRef((n,a)=>{const s=x.useContext(kv),i=x.useRef(null),l=Je(a,i);return x.useEffect(()=>{const u=i.current;if(u)return s.branches.add(u),()=>{s.branches.delete(u)}},[s.branches]),y.jsx(Ve.div,{...n,ref:l})});Lv.displayName=RS;function NS(n,a=globalThis==null?void 0:globalThis.document){const s=pn(n),i=x.useRef(!1),l=x.useRef(()=>{});return x.useEffect(()=>{const u=h=>{if(h.target&&!i.current){let m=function(){qv(ES,s,g,{discrete:!0})};const g={originalEvent:h};h.pointerType==="touch"?(a.removeEventListener("click",l.current),l.current=m,a.addEventListener("click",l.current,{once:!0})):m()}else a.removeEventListener("click",l.current);i.current=!1},d=window.setTimeout(()=>{a.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(d),a.removeEventListener("pointerdown",u),a.removeEventListener("click",l.current)}},[a,s]),{onPointerDownCapture:()=>i.current=!0}}function AS(n,a=globalThis==null?void 0:globalThis.document){const s=pn(n),i=x.useRef(!1);return x.useEffect(()=>{const l=u=>{u.target&&!i.current&&qv(CS,s,{originalEvent:u},{discrete:!1})};return a.addEventListener("focusin",l),()=>a.removeEventListener("focusin",l)},[a,s]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function ly(){const n=new CustomEvent(Qf);document.dispatchEvent(n)}function qv(n,a,s,{discrete:i}){const l=s.originalEvent.target,u=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:s});a&&l.addEventListener(n,a,{once:!0}),i?Dv(l,u):l.dispatchEvent(u)}var OS=Bl,MS=Lv,wt=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},_S="Portal",wd=x.forwardRef((n,a)=>{var h;const{container:s,...i}=n,[l,u]=x.useState(!1);wt(()=>u(!0),[]);const d=s||l&&((h=globalThis==null?void 0:globalThis.document)==null?void 0:h.body);return d?Ov.createPortal(y.jsx(Ve.div,{...i,ref:a}),d):null});wd.displayName=_S;function jS(n,a){return x.useReducer((s,i)=>a[s][i]??s,n)}var Sd=n=>{const{present:a,children:s}=n,i=DS(a),l=typeof s=="function"?s({present:i.isPresent}):x.Children.only(s),u=Je(i.ref,kS(l));return typeof s=="function"||i.isPresent?x.cloneElement(l,{ref:u}):null};Sd.displayName="Presence";function DS(n){const[a,s]=x.useState(),i=x.useRef(null),l=x.useRef(n),u=x.useRef("none"),d=n?"mounted":"unmounted",[h,m]=jS(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const g=il(i.current);u.current=h==="mounted"?g:"none"},[h]),wt(()=>{const g=i.current,v=l.current;if(v!==n){const S=u.current,w=il(g);n?m("MOUNT"):w==="none"||(g==null?void 0:g.display)==="none"?m("UNMOUNT"):m(v&&S!==w?"ANIMATION_OUT":"UNMOUNT"),l.current=n}},[n,m]),wt(()=>{if(a){let g;const v=a.ownerDocument.defaultView??window,T=w=>{const E=il(i.current).includes(w.animationName);if(w.target===a&&E&&(m("ANIMATION_END"),!l.current)){const C=a.style.animationFillMode;a.style.animationFillMode="forwards",g=v.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=C)})}},S=w=>{w.target===a&&(u.current=il(i.current))};return a.addEventListener("animationstart",S),a.addEventListener("animationcancel",T),a.addEventListener("animationend",T),()=>{v.clearTimeout(g),a.removeEventListener("animationstart",S),a.removeEventListener("animationcancel",T),a.removeEventListener("animationend",T)}}else m("ANIMATION_END")},[a,m]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:x.useCallback(g=>{i.current=g?getComputedStyle(g):null,s(g)},[])}}function il(n){return(n==null?void 0:n.animationName)||"none"}function kS(n){var i,l;let a=(i=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:i.get,s=a&&"isReactWarning"in a&&a.isReactWarning;return s?n.ref:(a=(l=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:l.get,s=a&&"isReactWarning"in a&&a.isReactWarning,s?n.props.ref:n.props.ref||n.ref)}var LS=bd[" useInsertionEffect ".trim().toString()]||wt;function Gf({prop:n,defaultProp:a,onChange:s=()=>{},caller:i}){const[l,u,d]=qS({defaultProp:a,onChange:s}),h=n!==void 0,m=h?n:l;{const v=x.useRef(n!==void 0);x.useEffect(()=>{const T=v.current;T!==h&&console.warn(`${i} is changing from ${T?"controlled":"uncontrolled"} to ${h?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),v.current=h},[h,i])}const g=x.useCallback(v=>{var T;if(h){const S=zS(v)?v(n):v;S!==n&&((T=d.current)==null||T.call(d,S))}else u(v)},[h,n,u,d]);return[m,g]}function qS({defaultProp:n,onChange:a}){const[s,i]=x.useState(n),l=x.useRef(s),u=x.useRef(a);return LS(()=>{u.current=a},[a]),x.useEffect(()=>{var d;l.current!==s&&((d=u.current)==null||d.call(u,s),l.current=s)},[s,l]),[s,i,u]}function zS(n){return typeof n=="function"}var zv=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),US="VisuallyHidden",Pl=x.forwardRef((n,a)=>y.jsx(Ve.span,{...n,ref:a,style:{...zv,...n.style}}));Pl.displayName=US;var BS=Pl,Td="ToastProvider",[Ed,PS,VS]=jv("Toast"),[Uv,D_]=Vi("Toast",[VS]),[IS,Vl]=Uv(Td),Bv=n=>{const{__scopeToast:a,label:s="Notification",duration:i=5e3,swipeDirection:l="right",swipeThreshold:u=50,children:d}=n,[h,m]=x.useState(null),[g,v]=x.useState(0),T=x.useRef(!1),S=x.useRef(!1);return s.trim()||console.error(`Invalid prop \`label\` supplied to \`${Td}\`. Expected non-empty \`string\`.`),y.jsx(Ed.Provider,{scope:a,children:y.jsx(IS,{scope:a,label:s,duration:i,swipeDirection:l,swipeThreshold:u,toastCount:g,viewport:h,onViewportChange:m,onToastAdd:x.useCallback(()=>v(w=>w+1),[]),onToastRemove:x.useCallback(()=>v(w=>w-1),[]),isFocusedToastEscapeKeyDownRef:T,isClosePausedRef:S,children:d})})};Bv.displayName=Td;var Pv="ToastViewport",HS=["F8"],$f="toast.viewportPause",Xf="toast.viewportResume",Vv=x.forwardRef((n,a)=>{const{__scopeToast:s,hotkey:i=HS,label:l="Notifications ({hotkey})",...u}=n,d=Vl(Pv,s),h=PS(s),m=x.useRef(null),g=x.useRef(null),v=x.useRef(null),T=x.useRef(null),S=Je(a,T,d.onViewportChange),w=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),N=d.toastCount>0;x.useEffect(()=>{const C=j=>{var _;i.length!==0&&i.every(z=>j[z]||j.code===z)&&((_=T.current)==null||_.focus())};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[i]),x.useEffect(()=>{const C=m.current,j=T.current;if(N&&C&&j){const M=()=>{if(!d.isClosePausedRef.current){const $=new CustomEvent($f);j.dispatchEvent($),d.isClosePausedRef.current=!0}},_=()=>{if(d.isClosePausedRef.current){const $=new CustomEvent(Xf);j.dispatchEvent($),d.isClosePausedRef.current=!1}},z=$=>{!C.contains($.relatedTarget)&&_()},k=()=>{C.contains(document.activeElement)||_()};return C.addEventListener("focusin",M),C.addEventListener("focusout",z),C.addEventListener("pointermove",M),C.addEventListener("pointerleave",k),window.addEventListener("blur",M),window.addEventListener("focus",_),()=>{C.removeEventListener("focusin",M),C.removeEventListener("focusout",z),C.removeEventListener("pointermove",M),C.removeEventListener("pointerleave",k),window.removeEventListener("blur",M),window.removeEventListener("focus",_)}}},[N,d.isClosePausedRef]);const E=x.useCallback(({tabbingDirection:C})=>{const M=h().map(_=>{const z=_.ref.current,k=[z,...nT(z)];return C==="forwards"?k:k.reverse()});return(C==="forwards"?M.reverse():M).flat()},[h]);return x.useEffect(()=>{const C=T.current;if(C){const j=M=>{var k,$,I;const _=M.altKey||M.ctrlKey||M.metaKey;if(M.key==="Tab"&&!_){const ae=document.activeElement,le=M.shiftKey;if(M.target===C&&le){(k=g.current)==null||k.focus();return}const ee=E({tabbingDirection:le?"backwards":"forwards"}),me=ee.findIndex(Z=>Z===ae);Cf(ee.slice(me+1))?M.preventDefault():le?($=g.current)==null||$.focus():(I=v.current)==null||I.focus()}};return C.addEventListener("keydown",j),()=>C.removeEventListener("keydown",j)}},[h,E]),y.jsxs(MS,{ref:m,role:"region","aria-label":l.replace("{hotkey}",w),tabIndex:-1,style:{pointerEvents:N?void 0:"none"},children:[N&&y.jsx(Kf,{ref:g,onFocusFromOutsideViewport:()=>{const C=E({tabbingDirection:"forwards"});Cf(C)}}),y.jsx(Ed.Slot,{scope:s,children:y.jsx(Ve.ol,{tabIndex:-1,...u,ref:S})}),N&&y.jsx(Kf,{ref:v,onFocusFromOutsideViewport:()=>{const C=E({tabbingDirection:"backwards"});Cf(C)}})]})});Vv.displayName=Pv;var Iv="ToastFocusProxy",Kf=x.forwardRef((n,a)=>{const{__scopeToast:s,onFocusFromOutsideViewport:i,...l}=n,u=Vl(Iv,s);return y.jsx(Pl,{"aria-hidden":!0,tabIndex:0,...l,ref:a,style:{position:"fixed"},onFocus:d=>{var g;const h=d.relatedTarget;!((g=u.viewport)!=null&&g.contains(h))&&i()}})});Kf.displayName=Iv;var Ii="Toast",YS="toast.swipeStart",QS="toast.swipeMove",GS="toast.swipeCancel",$S="toast.swipeEnd",Hv=x.forwardRef((n,a)=>{const{forceMount:s,open:i,defaultOpen:l,onOpenChange:u,...d}=n,[h,m]=Gf({prop:i,defaultProp:l??!0,onChange:u,caller:Ii});return y.jsx(Sd,{present:s||h,children:y.jsx(FS,{open:h,...d,ref:a,onClose:()=>m(!1),onPause:pn(n.onPause),onResume:pn(n.onResume),onSwipeStart:Ne(n.onSwipeStart,g=>{g.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ne(n.onSwipeMove,g=>{const{x:v,y:T}=g.detail.delta;g.currentTarget.setAttribute("data-swipe","move"),g.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${v}px`),g.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${T}px`)}),onSwipeCancel:Ne(n.onSwipeCancel,g=>{g.currentTarget.setAttribute("data-swipe","cancel"),g.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),g.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),g.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),g.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ne(n.onSwipeEnd,g=>{const{x:v,y:T}=g.detail.delta;g.currentTarget.setAttribute("data-swipe","end"),g.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),g.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),g.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${v}px`),g.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${T}px`),m(!1)})})})});Hv.displayName=Ii;var[XS,KS]=Uv(Ii,{onClose(){}}),FS=x.forwardRef((n,a)=>{const{__scopeToast:s,type:i="foreground",duration:l,open:u,onClose:d,onEscapeKeyDown:h,onPause:m,onResume:g,onSwipeStart:v,onSwipeMove:T,onSwipeCancel:S,onSwipeEnd:w,...N}=n,E=Vl(Ii,s),[C,j]=x.useState(null),M=Je(a,Z=>j(Z)),_=x.useRef(null),z=x.useRef(null),k=l||E.duration,$=x.useRef(0),I=x.useRef(k),ae=x.useRef(0),{onToastAdd:le,onToastRemove:he}=E,de=pn(()=>{var se;(C==null?void 0:C.contains(document.activeElement))&&((se=E.viewport)==null||se.focus()),d()}),ee=x.useCallback(Z=>{!Z||Z===1/0||(window.clearTimeout(ae.current),$.current=new Date().getTime(),ae.current=window.setTimeout(de,Z))},[de]);x.useEffect(()=>{const Z=E.viewport;if(Z){const se=()=>{ee(I.current),g==null||g()},L=()=>{const Y=new Date().getTime()-$.current;I.current=I.current-Y,window.clearTimeout(ae.current),m==null||m()};return Z.addEventListener($f,L),Z.addEventListener(Xf,se),()=>{Z.removeEventListener($f,L),Z.removeEventListener(Xf,se)}}},[E.viewport,k,m,g,ee]),x.useEffect(()=>{u&&!E.isClosePausedRef.current&&ee(k)},[u,k,E.isClosePausedRef,ee]),x.useEffect(()=>(le(),()=>he()),[le,he]);const me=x.useMemo(()=>C?Fv(C):null,[C]);return E.viewport?y.jsxs(y.Fragment,{children:[me&&y.jsx(ZS,{__scopeToast:s,role:"status","aria-live":i==="foreground"?"assertive":"polite","aria-atomic":!0,children:me}),y.jsx(XS,{scope:s,onClose:de,children:hs.createPortal(y.jsx(Ed.ItemSlot,{scope:s,children:y.jsx(OS,{asChild:!0,onEscapeKeyDown:Ne(h,()=>{E.isFocusedToastEscapeKeyDownRef.current||de(),E.isFocusedToastEscapeKeyDownRef.current=!1}),children:y.jsx(Ve.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":u?"open":"closed","data-swipe-direction":E.swipeDirection,...N,ref:M,style:{userSelect:"none",touchAction:"none",...n.style},onKeyDown:Ne(n.onKeyDown,Z=>{Z.key==="Escape"&&(h==null||h(Z.nativeEvent),Z.nativeEvent.defaultPrevented||(E.isFocusedToastEscapeKeyDownRef.current=!0,de()))}),onPointerDown:Ne(n.onPointerDown,Z=>{Z.button===0&&(_.current={x:Z.clientX,y:Z.clientY})}),onPointerMove:Ne(n.onPointerMove,Z=>{if(!_.current)return;const se=Z.clientX-_.current.x,L=Z.clientY-_.current.y,Y=!!z.current,K=["left","right"].includes(E.swipeDirection),J=["left","up"].includes(E.swipeDirection)?Math.min:Math.max,A=K?J(0,se):0,H=K?0:J(0,L),W=Z.pointerType==="touch"?10:2,F={x:A,y:H},te={originalEvent:Z,delta:F};Y?(z.current=F,ol(QS,T,te,{discrete:!1})):cy(F,E.swipeDirection,W)?(z.current=F,ol(YS,v,te,{discrete:!1}),Z.target.setPointerCapture(Z.pointerId)):(Math.abs(se)>W||Math.abs(L)>W)&&(_.current=null)}),onPointerUp:Ne(n.onPointerUp,Z=>{const se=z.current,L=Z.target;if(L.hasPointerCapture(Z.pointerId)&&L.releasePointerCapture(Z.pointerId),z.current=null,_.current=null,se){const Y=Z.currentTarget,K={originalEvent:Z,delta:se};cy(se,E.swipeDirection,E.swipeThreshold)?ol($S,w,K,{discrete:!0}):ol(GS,S,K,{discrete:!0}),Y.addEventListener("click",J=>J.preventDefault(),{once:!0})}})})})}),E.viewport)})]}):null}),ZS=n=>{const{__scopeToast:a,children:s,...i}=n,l=Vl(Ii,a),[u,d]=x.useState(!1),[h,m]=x.useState(!1);return eT(()=>d(!0)),x.useEffect(()=>{const g=window.setTimeout(()=>m(!0),1e3);return()=>window.clearTimeout(g)},[]),h?null:y.jsx(wd,{asChild:!0,children:y.jsx(Pl,{...i,children:u&&y.jsxs(y.Fragment,{children:[l.label," ",s]})})})},WS="ToastTitle",Yv=x.forwardRef((n,a)=>{const{__scopeToast:s,...i}=n;return y.jsx(Ve.div,{...i,ref:a})});Yv.displayName=WS;var JS="ToastDescription",Qv=x.forwardRef((n,a)=>{const{__scopeToast:s,...i}=n;return y.jsx(Ve.div,{...i,ref:a})});Qv.displayName=JS;var Gv="ToastAction",$v=x.forwardRef((n,a)=>{const{altText:s,...i}=n;return s.trim()?y.jsx(Kv,{altText:s,asChild:!0,children:y.jsx(Cd,{...i,ref:a})}):(console.error(`Invalid prop \`altText\` supplied to \`${Gv}\`. Expected non-empty \`string\`.`),null)});$v.displayName=Gv;var Xv="ToastClose",Cd=x.forwardRef((n,a)=>{const{__scopeToast:s,...i}=n,l=KS(Xv,s);return y.jsx(Kv,{asChild:!0,children:y.jsx(Ve.button,{type:"button",...i,ref:a,onClick:Ne(n.onClick,l.onClose)})})});Cd.displayName=Xv;var Kv=x.forwardRef((n,a)=>{const{__scopeToast:s,altText:i,...l}=n;return y.jsx(Ve.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":i||void 0,...l,ref:a})});function Fv(n){const a=[];return Array.from(n.childNodes).forEach(i=>{if(i.nodeType===i.TEXT_NODE&&i.textContent&&a.push(i.textContent),tT(i)){const l=i.ariaHidden||i.hidden||i.style.display==="none",u=i.dataset.radixToastAnnounceExclude==="";if(!l)if(u){const d=i.dataset.radixToastAnnounceAlt;d&&a.push(d)}else a.push(...Fv(i))}}),a}function ol(n,a,s,{discrete:i}){const l=s.originalEvent.currentTarget,u=new CustomEvent(n,{bubbles:!0,cancelable:!0,detail:s});a&&l.addEventListener(n,a,{once:!0}),i?Dv(l,u):l.dispatchEvent(u)}var cy=(n,a,s=0)=>{const i=Math.abs(n.x),l=Math.abs(n.y),u=i>l;return a==="left"||a==="right"?u&&i>s:!u&&l>s};function eT(n=()=>{}){const a=pn(n);wt(()=>{let s=0,i=0;return s=window.requestAnimationFrame(()=>i=window.requestAnimationFrame(a)),()=>{window.cancelAnimationFrame(s),window.cancelAnimationFrame(i)}},[a])}function tT(n){return n.nodeType===n.ELEMENT_NODE}function nT(n){const a=[],s=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const l=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||l?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)a.push(s.currentNode);return a}function Cf(n){const a=document.activeElement;return n.some(s=>s===a?!0:(s.focus(),document.activeElement!==a))}var aT=Bv,Zv=Vv,Wv=Hv,Jv=Yv,e0=Qv,t0=$v,n0=Cd;function a0(n){var a,s,i="";if(typeof n=="string"||typeof n=="number")i+=n;else if(typeof n=="object")if(Array.isArray(n)){var l=n.length;for(a=0;a<l;a++)n[a]&&(s=a0(n[a]))&&(i&&(i+=" "),i+=s)}else for(s in n)n[s]&&(i&&(i+=" "),i+=s);return i}function r0(){for(var n,a,s=0,i="",l=arguments.length;s<l;s++)(n=arguments[s])&&(a=a0(n))&&(i&&(i+=" "),i+=a);return i}const uy=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,fy=r0,s0=(n,a)=>s=>{var i;if((a==null?void 0:a.variants)==null)return fy(n,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:l,defaultVariants:u}=a,d=Object.keys(l).map(g=>{const v=s==null?void 0:s[g],T=u==null?void 0:u[g];if(v===null)return null;const S=uy(v)||uy(T);return l[g][S]}),h=s&&Object.entries(s).reduce((g,v)=>{let[T,S]=v;return S===void 0||(g[T]=S),g},{}),m=a==null||(i=a.compoundVariants)===null||i===void 0?void 0:i.reduce((g,v)=>{let{class:T,className:S,...w}=v;return Object.entries(w).every(N=>{let[E,C]=N;return Array.isArray(C)?C.includes({...u,...h}[E]):{...u,...h}[E]===C})?[...g,T,S]:g},[]);return fy(n,d,m,s==null?void 0:s.class,s==null?void 0:s.className)};/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const rT=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),i0=(...n)=>n.filter((a,s,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===s).join(" ").trim();/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var sT={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const iT=x.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:s=2,absoluteStrokeWidth:i,className:l="",children:u,iconNode:d,...h},m)=>x.createElement("svg",{ref:m,...sT,width:a,height:a,stroke:n,strokeWidth:i?Number(s)*24/Number(a):s,className:i0("lucide",l),...h},[...d.map(([g,v])=>x.createElement(g,v)),...Array.isArray(u)?u:[u]]));/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zn=(n,a)=>{const s=x.forwardRef(({className:i,...l},u)=>x.createElement(iT,{ref:u,iconNode:a,className:i0(`lucide-${rT(n)}`,i),...l}));return s.displayName=`${n}`,s};/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const oT=zn("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lT=zn("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const cT=zn("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Il=zn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Rd=zn("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ll=zn("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const uT=zn("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fT=zn("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const dT=zn("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const hT=zn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Nd="-",mT=n=>{const a=pT(n),{conflictingClassGroups:s,conflictingClassGroupModifiers:i}=n;return{getClassGroupId:d=>{const h=d.split(Nd);return h[0]===""&&h.length!==1&&h.shift(),o0(h,a)||gT(d)},getConflictingClassGroupIds:(d,h)=>{const m=s[d]||[];return h&&i[d]?[...m,...i[d]]:m}}},o0=(n,a)=>{var d;if(n.length===0)return a.classGroupId;const s=n[0],i=a.nextPart.get(s),l=i?o0(n.slice(1),i):void 0;if(l)return l;if(a.validators.length===0)return;const u=n.join(Nd);return(d=a.validators.find(({validator:h})=>h(u)))==null?void 0:d.classGroupId},dy=/^\[(.+)\]$/,gT=n=>{if(dy.test(n)){const a=dy.exec(n)[1],s=a==null?void 0:a.substring(0,a.indexOf(":"));if(s)return"arbitrary.."+s}},pT=n=>{const{theme:a,prefix:s}=n,i={nextPart:new Map,validators:[]};return vT(Object.entries(n.classGroups),s).forEach(([u,d])=>{Ff(d,i,u,a)}),i},Ff=(n,a,s,i)=>{n.forEach(l=>{if(typeof l=="string"){const u=l===""?a:hy(a,l);u.classGroupId=s;return}if(typeof l=="function"){if(yT(l)){Ff(l(i),a,s,i);return}a.validators.push({validator:l,classGroupId:s});return}Object.entries(l).forEach(([u,d])=>{Ff(d,hy(a,u),s,i)})})},hy=(n,a)=>{let s=n;return a.split(Nd).forEach(i=>{s.nextPart.has(i)||s.nextPart.set(i,{nextPart:new Map,validators:[]}),s=s.nextPart.get(i)}),s},yT=n=>n.isThemeGetter,vT=(n,a)=>a?n.map(([s,i])=>{const l=i.map(u=>typeof u=="string"?a+u:typeof u=="object"?Object.fromEntries(Object.entries(u).map(([d,h])=>[a+d,h])):u);return[s,l]}):n,bT=n=>{if(n<1)return{get:()=>{},set:()=>{}};let a=0,s=new Map,i=new Map;const l=(u,d)=>{s.set(u,d),a++,a>n&&(a=0,i=s,s=new Map)};return{get(u){let d=s.get(u);if(d!==void 0)return d;if((d=i.get(u))!==void 0)return l(u,d),d},set(u,d){s.has(u)?s.set(u,d):l(u,d)}}},l0="!",xT=n=>{const{separator:a,experimentalParseClassName:s}=n,i=a.length===1,l=a[0],u=a.length,d=h=>{const m=[];let g=0,v=0,T;for(let C=0;C<h.length;C++){let j=h[C];if(g===0){if(j===l&&(i||h.slice(C,C+u)===a)){m.push(h.slice(v,C)),v=C+u;continue}if(j==="/"){T=C;continue}}j==="["?g++:j==="]"&&g--}const S=m.length===0?h:h.substring(v),w=S.startsWith(l0),N=w?S.substring(1):S,E=T&&T>v?T-v:void 0;return{modifiers:m,hasImportantModifier:w,baseClassName:N,maybePostfixModifierPosition:E}};return s?h=>s({className:h,parseClassName:d}):d},wT=n=>{if(n.length<=1)return n;const a=[];let s=[];return n.forEach(i=>{i[0]==="["?(a.push(...s.sort(),i),s=[]):s.push(i)}),a.push(...s.sort()),a},ST=n=>({cache:bT(n.cacheSize),parseClassName:xT(n),...mT(n)}),TT=/\s+/,ET=(n,a)=>{const{parseClassName:s,getClassGroupId:i,getConflictingClassGroupIds:l}=a,u=[],d=n.trim().split(TT);let h="";for(let m=d.length-1;m>=0;m-=1){const g=d[m],{modifiers:v,hasImportantModifier:T,baseClassName:S,maybePostfixModifierPosition:w}=s(g);let N=!!w,E=i(N?S.substring(0,w):S);if(!E){if(!N){h=g+(h.length>0?" "+h:h);continue}if(E=i(S),!E){h=g+(h.length>0?" "+h:h);continue}N=!1}const C=wT(v).join(":"),j=T?C+l0:C,M=j+E;if(u.includes(M))continue;u.push(M);const _=l(E,N);for(let z=0;z<_.length;++z){const k=_[z];u.push(j+k)}h=g+(h.length>0?" "+h:h)}return h};function CT(){let n=0,a,s,i="";for(;n<arguments.length;)(a=arguments[n++])&&(s=c0(a))&&(i&&(i+=" "),i+=s);return i}const c0=n=>{if(typeof n=="string")return n;let a,s="";for(let i=0;i<n.length;i++)n[i]&&(a=c0(n[i]))&&(s&&(s+=" "),s+=a);return s};function RT(n,...a){let s,i,l,u=d;function d(m){const g=a.reduce((v,T)=>T(v),n());return s=ST(g),i=s.cache.get,l=s.cache.set,u=h,h(m)}function h(m){const g=i(m);if(g)return g;const v=ET(m,s);return l(m,v),v}return function(){return u(CT.apply(null,arguments))}}const Ge=n=>{const a=s=>s[n]||[];return a.isThemeGetter=!0,a},u0=/^\[(?:([a-z-]+):)?(.+)\]$/i,NT=/^\d+\/\d+$/,AT=new Set(["px","full","screen"]),OT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,MT=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,_T=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,jT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,DT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,aa=n=>is(n)||AT.has(n)||NT.test(n),Ma=n=>ms(n,"length",VT),is=n=>!!n&&!Number.isNaN(Number(n)),Rf=n=>ms(n,"number",is),bi=n=>!!n&&Number.isInteger(Number(n)),kT=n=>n.endsWith("%")&&is(n.slice(0,-1)),xe=n=>u0.test(n),_a=n=>OT.test(n),LT=new Set(["length","size","percentage"]),qT=n=>ms(n,LT,f0),zT=n=>ms(n,"position",f0),UT=new Set(["image","url"]),BT=n=>ms(n,UT,HT),PT=n=>ms(n,"",IT),xi=()=>!0,ms=(n,a,s)=>{const i=u0.exec(n);return i?i[1]?typeof a=="string"?i[1]===a:a.has(i[1]):s(i[2]):!1},VT=n=>MT.test(n)&&!_T.test(n),f0=()=>!1,IT=n=>jT.test(n),HT=n=>DT.test(n),YT=()=>{const n=Ge("colors"),a=Ge("spacing"),s=Ge("blur"),i=Ge("brightness"),l=Ge("borderColor"),u=Ge("borderRadius"),d=Ge("borderSpacing"),h=Ge("borderWidth"),m=Ge("contrast"),g=Ge("grayscale"),v=Ge("hueRotate"),T=Ge("invert"),S=Ge("gap"),w=Ge("gradientColorStops"),N=Ge("gradientColorStopPositions"),E=Ge("inset"),C=Ge("margin"),j=Ge("opacity"),M=Ge("padding"),_=Ge("saturate"),z=Ge("scale"),k=Ge("sepia"),$=Ge("skew"),I=Ge("space"),ae=Ge("translate"),le=()=>["auto","contain","none"],he=()=>["auto","hidden","clip","visible","scroll"],de=()=>["auto",xe,a],ee=()=>[xe,a],me=()=>["",aa,Ma],Z=()=>["auto",is,xe],se=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],L=()=>["solid","dashed","dotted","double","none"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>["start","end","center","between","around","evenly","stretch"],J=()=>["","0",xe],A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[is,xe];return{cacheSize:500,separator:":",theme:{colors:[xi],spacing:[aa,Ma],blur:["none","",_a,xe],brightness:H(),borderColor:[n],borderRadius:["none","","full",_a,xe],borderSpacing:ee(),borderWidth:me(),contrast:H(),grayscale:J(),hueRotate:H(),invert:J(),gap:ee(),gradientColorStops:[n],gradientColorStopPositions:[kT,Ma],inset:de(),margin:de(),opacity:H(),padding:ee(),saturate:H(),scale:H(),sepia:J(),skew:H(),space:ee(),translate:ee()},classGroups:{aspect:[{aspect:["auto","square","video",xe]}],container:["container"],columns:[{columns:[_a]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...se(),xe]}],overflow:[{overflow:he()}],"overflow-x":[{"overflow-x":he()}],"overflow-y":[{"overflow-y":he()}],overscroll:[{overscroll:le()}],"overscroll-x":[{"overscroll-x":le()}],"overscroll-y":[{"overscroll-y":le()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[E]}],"inset-x":[{"inset-x":[E]}],"inset-y":[{"inset-y":[E]}],start:[{start:[E]}],end:[{end:[E]}],top:[{top:[E]}],right:[{right:[E]}],bottom:[{bottom:[E]}],left:[{left:[E]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",bi,xe]}],basis:[{basis:de()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",xe]}],grow:[{grow:J()}],shrink:[{shrink:J()}],order:[{order:["first","last","none",bi,xe]}],"grid-cols":[{"grid-cols":[xi]}],"col-start-end":[{col:["auto",{span:["full",bi,xe]},xe]}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":[xi]}],"row-start-end":[{row:["auto",{span:[bi,xe]},xe]}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",xe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",xe]}],gap:[{gap:[S]}],"gap-x":[{"gap-x":[S]}],"gap-y":[{"gap-y":[S]}],"justify-content":[{justify:["normal",...K()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...K(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...K(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[M]}],px:[{px:[M]}],py:[{py:[M]}],ps:[{ps:[M]}],pe:[{pe:[M]}],pt:[{pt:[M]}],pr:[{pr:[M]}],pb:[{pb:[M]}],pl:[{pl:[M]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[I]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[I]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",xe,a]}],"min-w":[{"min-w":[xe,a,"min","max","fit"]}],"max-w":[{"max-w":[xe,a,"none","full","min","max","fit","prose",{screen:[_a]},_a]}],h:[{h:[xe,a,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[xe,a,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[xe,a,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[xe,a,"auto","min","max","fit"]}],"font-size":[{text:["base",_a,Ma]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Rf]}],"font-family":[{font:[xi]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",xe]}],"line-clamp":[{"line-clamp":["none",is,Rf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",aa,xe]}],"list-image":[{"list-image":["none",xe]}],"list-style-type":[{list:["none","disc","decimal",xe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[j]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[j]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...L(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",aa,Ma]}],"underline-offset":[{"underline-offset":["auto",aa,xe]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ee()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[j]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...se(),zT]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",qT]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},BT]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[N]}],"gradient-via-pos":[{via:[N]}],"gradient-to-pos":[{to:[N]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[u]}],"rounded-s":[{"rounded-s":[u]}],"rounded-e":[{"rounded-e":[u]}],"rounded-t":[{"rounded-t":[u]}],"rounded-r":[{"rounded-r":[u]}],"rounded-b":[{"rounded-b":[u]}],"rounded-l":[{"rounded-l":[u]}],"rounded-ss":[{"rounded-ss":[u]}],"rounded-se":[{"rounded-se":[u]}],"rounded-ee":[{"rounded-ee":[u]}],"rounded-es":[{"rounded-es":[u]}],"rounded-tl":[{"rounded-tl":[u]}],"rounded-tr":[{"rounded-tr":[u]}],"rounded-br":[{"rounded-br":[u]}],"rounded-bl":[{"rounded-bl":[u]}],"border-w":[{border:[h]}],"border-w-x":[{"border-x":[h]}],"border-w-y":[{"border-y":[h]}],"border-w-s":[{"border-s":[h]}],"border-w-e":[{"border-e":[h]}],"border-w-t":[{"border-t":[h]}],"border-w-r":[{"border-r":[h]}],"border-w-b":[{"border-b":[h]}],"border-w-l":[{"border-l":[h]}],"border-opacity":[{"border-opacity":[j]}],"border-style":[{border:[...L(),"hidden"]}],"divide-x":[{"divide-x":[h]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[h]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[j]}],"divide-style":[{divide:L()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...L()]}],"outline-offset":[{"outline-offset":[aa,xe]}],"outline-w":[{outline:[aa,Ma]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[j]}],"ring-offset-w":[{"ring-offset":[aa,Ma]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",_a,PT]}],"shadow-color":[{shadow:[xi]}],opacity:[{opacity:[j]}],"mix-blend":[{"mix-blend":[...Y(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Y()}],filter:[{filter:["","none"]}],blur:[{blur:[s]}],brightness:[{brightness:[i]}],contrast:[{contrast:[m]}],"drop-shadow":[{"drop-shadow":["","none",_a,xe]}],grayscale:[{grayscale:[g]}],"hue-rotate":[{"hue-rotate":[v]}],invert:[{invert:[T]}],saturate:[{saturate:[_]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[s]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"backdrop-contrast":[{"backdrop-contrast":[m]}],"backdrop-grayscale":[{"backdrop-grayscale":[g]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[v]}],"backdrop-invert":[{"backdrop-invert":[T]}],"backdrop-opacity":[{"backdrop-opacity":[j]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-x":[{"border-spacing-x":[d]}],"border-spacing-y":[{"border-spacing-y":[d]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",xe]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",xe]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",xe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[z]}],"scale-x":[{"scale-x":[z]}],"scale-y":[{"scale-y":[z]}],rotate:[{rotate:[bi,xe]}],"translate-x":[{"translate-x":[ae]}],"translate-y":[{"translate-y":[ae]}],"skew-x":[{"skew-x":[$]}],"skew-y":[{"skew-y":[$]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",xe]}],accent:[{accent:["auto",n]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",xe]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ee()}],"scroll-mx":[{"scroll-mx":ee()}],"scroll-my":[{"scroll-my":ee()}],"scroll-ms":[{"scroll-ms":ee()}],"scroll-me":[{"scroll-me":ee()}],"scroll-mt":[{"scroll-mt":ee()}],"scroll-mr":[{"scroll-mr":ee()}],"scroll-mb":[{"scroll-mb":ee()}],"scroll-ml":[{"scroll-ml":ee()}],"scroll-p":[{"scroll-p":ee()}],"scroll-px":[{"scroll-px":ee()}],"scroll-py":[{"scroll-py":ee()}],"scroll-ps":[{"scroll-ps":ee()}],"scroll-pe":[{"scroll-pe":ee()}],"scroll-pt":[{"scroll-pt":ee()}],"scroll-pr":[{"scroll-pr":ee()}],"scroll-pb":[{"scroll-pb":ee()}],"scroll-pl":[{"scroll-pl":ee()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",xe]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[aa,Ma,Rf]}],stroke:[{stroke:[n,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},QT=RT(YT);function St(...n){return QT(r0(n))}const GT=aT,d0=x.forwardRef(({className:n,...a},s)=>y.jsx(Zv,{ref:s,className:St("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",n),...a}));d0.displayName=Zv.displayName;const $T=s0("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),h0=x.forwardRef(({className:n,variant:a,...s},i)=>y.jsx(Wv,{ref:i,className:St($T({variant:a}),n),...s}));h0.displayName=Wv.displayName;const XT=x.forwardRef(({className:n,...a},s)=>y.jsx(t0,{ref:s,className:St("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",n),...a}));XT.displayName=t0.displayName;const m0=x.forwardRef(({className:n,...a},s)=>y.jsx(n0,{ref:s,className:St("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",n),"toast-close":"",...a,children:y.jsx(hT,{className:"h-4 w-4"})}));m0.displayName=n0.displayName;const g0=x.forwardRef(({className:n,...a},s)=>y.jsx(Jv,{ref:s,className:St("text-sm font-semibold",n),...a}));g0.displayName=Jv.displayName;const p0=x.forwardRef(({className:n,...a},s)=>y.jsx(e0,{ref:s,className:St("text-sm opacity-90",n),...a}));p0.displayName=e0.displayName;function KT(){const{toasts:n}=xd();return y.jsxs(GT,{children:[n.map(function({id:a,title:s,description:i,action:l,...u}){return y.jsxs(h0,{...u,children:[y.jsxs("div",{className:"grid gap-1",children:[s&&y.jsx(g0,{children:s}),i&&y.jsx(p0,{children:i})]}),l,y.jsx(m0,{})]},a)}),y.jsx(d0,{})]})}var FT=n=>{switch(n){case"success":return JT;case"info":return tE;case"warning":return eE;case"error":return nE;default:return null}},ZT=Array(12).fill(0),WT=({visible:n,className:a})=>ne.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":n},ne.createElement("div",{className:"sonner-spinner"},ZT.map((s,i)=>ne.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),JT=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),eE=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),tE=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),nE=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),aE=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ne.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ne.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),rE=()=>{let[n,a]=ne.useState(document.hidden);return ne.useEffect(()=>{let s=()=>{a(document.hidden)};return document.addEventListener("visibilitychange",s),()=>window.removeEventListener("visibilitychange",s)},[]),n},Zf=1,sE=class{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{let a=this.subscribers.indexOf(n);this.subscribers.splice(a,1)}),this.publish=n=>{this.subscribers.forEach(a=>a(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var a;let{message:s,...i}=n,l=typeof(n==null?void 0:n.id)=="number"||((a=n.id)==null?void 0:a.length)>0?n.id:Zf++,u=this.toasts.find(h=>h.id===l),d=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),u?this.toasts=this.toasts.map(h=>h.id===l?(this.publish({...h,...n,id:l,title:s}),{...h,...n,id:l,dismissible:d,title:s}):h):this.addToast({title:s,...i,dismissible:d,id:l}),l},this.dismiss=n=>(this.dismissedToasts.add(n),n||this.toasts.forEach(a=>{this.subscribers.forEach(s=>s({id:a.id,dismiss:!0}))}),this.subscribers.forEach(a=>a({id:n,dismiss:!0})),n),this.message=(n,a)=>this.create({...a,message:n}),this.error=(n,a)=>this.create({...a,message:n,type:"error"}),this.success=(n,a)=>this.create({...a,type:"success",message:n}),this.info=(n,a)=>this.create({...a,type:"info",message:n}),this.warning=(n,a)=>this.create({...a,type:"warning",message:n}),this.loading=(n,a)=>this.create({...a,type:"loading",message:n}),this.promise=(n,a)=>{if(!a)return;let s;a.loading!==void 0&&(s=this.create({...a,promise:n,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));let i=n instanceof Promise?n:n(),l=s!==void 0,u,d=i.then(async m=>{if(u=["resolve",m],ne.isValidElement(m))l=!1,this.create({id:s,type:"default",message:m});else if(oE(m)&&!m.ok){l=!1;let g=typeof a.error=="function"?await a.error(`HTTP error! status: ${m.status}`):a.error,v=typeof a.description=="function"?await a.description(`HTTP error! status: ${m.status}`):a.description;this.create({id:s,type:"error",message:g,description:v})}else if(a.success!==void 0){l=!1;let g=typeof a.success=="function"?await a.success(m):a.success,v=typeof a.description=="function"?await a.description(m):a.description;this.create({id:s,type:"success",message:g,description:v})}}).catch(async m=>{if(u=["reject",m],a.error!==void 0){l=!1;let g=typeof a.error=="function"?await a.error(m):a.error,v=typeof a.description=="function"?await a.description(m):a.description;this.create({id:s,type:"error",message:g,description:v})}}).finally(()=>{var m;l&&(this.dismiss(s),s=void 0),(m=a.finally)==null||m.call(a)}),h=()=>new Promise((m,g)=>d.then(()=>u[0]==="reject"?g(u[1]):m(u[1])).catch(g));return typeof s!="string"&&typeof s!="number"?{unwrap:h}:Object.assign(s,{unwrap:h})},this.custom=(n,a)=>{let s=(a==null?void 0:a.id)||Zf++;return this.create({jsx:n(s),id:s,...a}),s},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},zt=new sE,iE=(n,a)=>{let s=(a==null?void 0:a.id)||Zf++;return zt.addToast({title:n,...a,id:s}),s},oE=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",lE=iE,cE=()=>zt.toasts,uE=()=>zt.getActiveToasts(),fE=Object.assign(lE,{success:zt.success,info:zt.info,warning:zt.warning,error:zt.error,custom:zt.custom,message:zt.message,promise:zt.promise,dismiss:zt.dismiss,loading:zt.loading},{getHistory:cE,getToasts:uE});function dE(n,{insertAt:a}={}){if(typeof document>"u")return;let s=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",a==="top"&&s.firstChild?s.insertBefore(i,s.firstChild):s.appendChild(i),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(document.createTextNode(n))}dE(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
`);function cl(n){return n.label!==void 0}var hE=3,mE="32px",gE="16px",my=4e3,pE=356,yE=14,vE=20,bE=200;function mn(...n){return n.filter(Boolean).join(" ")}function xE(n){let[a,s]=n.split("-"),i=[];return a&&i.push(a),s&&i.push(s),i}var wE=n=>{var a,s,i,l,u,d,h,m,g,v,T;let{invert:S,toast:w,unstyled:N,interacting:E,setHeights:C,visibleToasts:j,heights:M,index:_,toasts:z,expanded:k,removeToast:$,defaultRichColors:I,closeButton:ae,style:le,cancelButtonStyle:he,actionButtonStyle:de,className:ee="",descriptionClassName:me="",duration:Z,position:se,gap:L,loadingIcon:Y,expandByDefault:K,classNames:J,icons:A,closeButtonAriaLabel:H="Close toast",pauseWhenPageIsHidden:W}=n,[F,te]=ne.useState(null),[ue,oe]=ne.useState(null),[re,fe]=ne.useState(!1),[je,Ae]=ne.useState(!1),[we,Re]=ne.useState(!1),[nt,Tt]=ne.useState(!1),[Bn,bn]=ne.useState(!1),[ut,Va]=ne.useState(0),[Pn,bs]=ne.useState(0),xn=ne.useRef(w.duration||Z||my),Qi=ne.useRef(null),wn=ne.useRef(null),rc=_===0,sc=_+1<=j,ft=w.type,at=w.dismissible!==!1,Sn=w.className||"",Nt=w.descriptionClassName||"",mr=ne.useMemo(()=>M.findIndex(ve=>ve.toastId===w.id)||0,[M,w.id]),ic=ne.useMemo(()=>{var ve;return(ve=w.closeButton)!=null?ve:ae},[w.closeButton,ae]),Gi=ne.useMemo(()=>w.duration||Z||my,[w.duration,Z]),oa=ne.useRef(0),cn=ne.useRef(0),Tn=ne.useRef(0),un=ne.useRef(null),[Ia,oc]=se.split("-"),xs=ne.useMemo(()=>M.reduce((ve,Me,ze)=>ze>=mr?ve:ve+Me.height,0),[M,mr]),ws=rE(),Ss=w.invert||S,Vn=ft==="loading";cn.current=ne.useMemo(()=>mr*L+xs,[mr,xs]),ne.useEffect(()=>{xn.current=Gi},[Gi]),ne.useEffect(()=>{fe(!0)},[]),ne.useEffect(()=>{let ve=wn.current;if(ve){let Me=ve.getBoundingClientRect().height;return bs(Me),C(ze=>[{toastId:w.id,height:Me,position:w.position},...ze]),()=>C(ze=>ze.filter(jt=>jt.toastId!==w.id))}},[C,w.id]),ne.useLayoutEffect(()=>{if(!re)return;let ve=wn.current,Me=ve.style.height;ve.style.height="auto";let ze=ve.getBoundingClientRect().height;ve.style.height=Me,bs(ze),C(jt=>jt.find(Bt=>Bt.toastId===w.id)?jt.map(Bt=>Bt.toastId===w.id?{...Bt,height:ze}:Bt):[{toastId:w.id,height:ze,position:w.position},...jt])},[re,w.title,w.description,C,w.id]);let En=ne.useCallback(()=>{Ae(!0),Va(cn.current),C(ve=>ve.filter(Me=>Me.toastId!==w.id)),setTimeout(()=>{$(w)},bE)},[w,$,C,cn]);ne.useEffect(()=>{if(w.promise&&ft==="loading"||w.duration===1/0||w.type==="loading")return;let ve;return k||E||W&&ws?(()=>{if(Tn.current<oa.current){let Me=new Date().getTime()-oa.current;xn.current=xn.current-Me}Tn.current=new Date().getTime()})():xn.current!==1/0&&(oa.current=new Date().getTime(),ve=setTimeout(()=>{var Me;(Me=w.onAutoClose)==null||Me.call(w,w),En()},xn.current)),()=>clearTimeout(ve)},[k,E,w,ft,W,ws,En]),ne.useEffect(()=>{w.delete&&En()},[En,w.delete]);function $i(){var ve,Me,ze;return A!=null&&A.loading?ne.createElement("div",{className:mn(J==null?void 0:J.loader,(ve=w==null?void 0:w.classNames)==null?void 0:ve.loader,"sonner-loader"),"data-visible":ft==="loading"},A.loading):Y?ne.createElement("div",{className:mn(J==null?void 0:J.loader,(Me=w==null?void 0:w.classNames)==null?void 0:Me.loader,"sonner-loader"),"data-visible":ft==="loading"},Y):ne.createElement(WT,{className:mn(J==null?void 0:J.loader,(ze=w==null?void 0:w.classNames)==null?void 0:ze.loader),visible:ft==="loading"})}return ne.createElement("li",{tabIndex:0,ref:wn,className:mn(ee,Sn,J==null?void 0:J.toast,(a=w==null?void 0:w.classNames)==null?void 0:a.toast,J==null?void 0:J.default,J==null?void 0:J[ft],(s=w==null?void 0:w.classNames)==null?void 0:s[ft]),"data-sonner-toast":"","data-rich-colors":(i=w.richColors)!=null?i:I,"data-styled":!(w.jsx||w.unstyled||N),"data-mounted":re,"data-promise":!!w.promise,"data-swiped":Bn,"data-removed":je,"data-visible":sc,"data-y-position":Ia,"data-x-position":oc,"data-index":_,"data-front":rc,"data-swiping":we,"data-dismissible":at,"data-type":ft,"data-invert":Ss,"data-swipe-out":nt,"data-swipe-direction":ue,"data-expanded":!!(k||K&&re),style:{"--index":_,"--toasts-before":_,"--z-index":z.length-_,"--offset":`${je?ut:cn.current}px`,"--initial-height":K?"auto":`${Pn}px`,...le,...w.style},onDragEnd:()=>{Re(!1),te(null),un.current=null},onPointerDown:ve=>{Vn||!at||(Qi.current=new Date,Va(cn.current),ve.target.setPointerCapture(ve.pointerId),ve.target.tagName!=="BUTTON"&&(Re(!0),un.current={x:ve.clientX,y:ve.clientY}))},onPointerUp:()=>{var ve,Me,ze,jt;if(nt||!at)return;un.current=null;let Bt=Number(((ve=wn.current)==null?void 0:ve.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),yt=Number(((Me=wn.current)==null?void 0:Me.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),$e=new Date().getTime()-((ze=Qi.current)==null?void 0:ze.getTime()),Ye=F==="x"?Bt:yt,At=Math.abs(Ye)/$e;if(Math.abs(Ye)>=vE||At>.11){Va(cn.current),(jt=w.onDismiss)==null||jt.call(w,w),oe(F==="x"?Bt>0?"right":"left":yt>0?"down":"up"),En(),Tt(!0),bn(!1);return}Re(!1),te(null)},onPointerMove:ve=>{var Me,ze,jt,Bt;if(!un.current||!at||((Me=window.getSelection())==null?void 0:Me.toString().length)>0)return;let yt=ve.clientY-un.current.y,$e=ve.clientX-un.current.x,Ye=(ze=n.swipeDirections)!=null?ze:xE(se);!F&&(Math.abs($e)>1||Math.abs(yt)>1)&&te(Math.abs($e)>Math.abs(yt)?"x":"y");let At={x:0,y:0};F==="y"?(Ye.includes("top")||Ye.includes("bottom"))&&(Ye.includes("top")&&yt<0||Ye.includes("bottom")&&yt>0)&&(At.y=yt):F==="x"&&(Ye.includes("left")||Ye.includes("right"))&&(Ye.includes("left")&&$e<0||Ye.includes("right")&&$e>0)&&(At.x=$e),(Math.abs(At.x)>0||Math.abs(At.y)>0)&&bn(!0),(jt=wn.current)==null||jt.style.setProperty("--swipe-amount-x",`${At.x}px`),(Bt=wn.current)==null||Bt.style.setProperty("--swipe-amount-y",`${At.y}px`)}},ic&&!w.jsx?ne.createElement("button",{"aria-label":H,"data-disabled":Vn,"data-close-button":!0,onClick:Vn||!at?()=>{}:()=>{var ve;En(),(ve=w.onDismiss)==null||ve.call(w,w)},className:mn(J==null?void 0:J.closeButton,(l=w==null?void 0:w.classNames)==null?void 0:l.closeButton)},(u=A==null?void 0:A.close)!=null?u:aE):null,w.jsx||x.isValidElement(w.title)?w.jsx?w.jsx:typeof w.title=="function"?w.title():w.title:ne.createElement(ne.Fragment,null,ft||w.icon||w.promise?ne.createElement("div",{"data-icon":"",className:mn(J==null?void 0:J.icon,(d=w==null?void 0:w.classNames)==null?void 0:d.icon)},w.promise||w.type==="loading"&&!w.icon?w.icon||$i():null,w.type!=="loading"?w.icon||(A==null?void 0:A[ft])||FT(ft):null):null,ne.createElement("div",{"data-content":"",className:mn(J==null?void 0:J.content,(h=w==null?void 0:w.classNames)==null?void 0:h.content)},ne.createElement("div",{"data-title":"",className:mn(J==null?void 0:J.title,(m=w==null?void 0:w.classNames)==null?void 0:m.title)},typeof w.title=="function"?w.title():w.title),w.description?ne.createElement("div",{"data-description":"",className:mn(me,Nt,J==null?void 0:J.description,(g=w==null?void 0:w.classNames)==null?void 0:g.description)},typeof w.description=="function"?w.description():w.description):null),x.isValidElement(w.cancel)?w.cancel:w.cancel&&cl(w.cancel)?ne.createElement("button",{"data-button":!0,"data-cancel":!0,style:w.cancelButtonStyle||he,onClick:ve=>{var Me,ze;cl(w.cancel)&&at&&((ze=(Me=w.cancel).onClick)==null||ze.call(Me,ve),En())},className:mn(J==null?void 0:J.cancelButton,(v=w==null?void 0:w.classNames)==null?void 0:v.cancelButton)},w.cancel.label):null,x.isValidElement(w.action)?w.action:w.action&&cl(w.action)?ne.createElement("button",{"data-button":!0,"data-action":!0,style:w.actionButtonStyle||de,onClick:ve=>{var Me,ze;cl(w.action)&&((ze=(Me=w.action).onClick)==null||ze.call(Me,ve),!ve.defaultPrevented&&En())},className:mn(J==null?void 0:J.actionButton,(T=w==null?void 0:w.classNames)==null?void 0:T.actionButton)},w.action.label):null))};function gy(){if(typeof window>"u"||typeof document>"u")return"ltr";let n=document.documentElement.getAttribute("dir");return n==="auto"||!n?window.getComputedStyle(document.documentElement).direction:n}function SE(n,a){let s={};return[n,a].forEach((i,l)=>{let u=l===1,d=u?"--mobile-offset":"--offset",h=u?gE:mE;function m(g){["top","right","bottom","left"].forEach(v=>{s[`${d}-${v}`]=typeof g=="number"?`${g}px`:g})}typeof i=="number"||typeof i=="string"?m(i):typeof i=="object"?["top","right","bottom","left"].forEach(g=>{i[g]===void 0?s[`${d}-${g}`]=h:s[`${d}-${g}`]=typeof i[g]=="number"?`${i[g]}px`:i[g]}):m(h)}),s}var TE=x.forwardRef(function(n,a){let{invert:s,position:i="bottom-right",hotkey:l=["altKey","KeyT"],expand:u,closeButton:d,className:h,offset:m,mobileOffset:g,theme:v="light",richColors:T,duration:S,style:w,visibleToasts:N=hE,toastOptions:E,dir:C=gy(),gap:j=yE,loadingIcon:M,icons:_,containerAriaLabel:z="Notifications",pauseWhenPageIsHidden:k}=n,[$,I]=ne.useState([]),ae=ne.useMemo(()=>Array.from(new Set([i].concat($.filter(W=>W.position).map(W=>W.position)))),[$,i]),[le,he]=ne.useState([]),[de,ee]=ne.useState(!1),[me,Z]=ne.useState(!1),[se,L]=ne.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Y=ne.useRef(null),K=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),J=ne.useRef(null),A=ne.useRef(!1),H=ne.useCallback(W=>{I(F=>{var te;return(te=F.find(ue=>ue.id===W.id))!=null&&te.delete||zt.dismiss(W.id),F.filter(({id:ue})=>ue!==W.id)})},[]);return ne.useEffect(()=>zt.subscribe(W=>{if(W.dismiss){I(F=>F.map(te=>te.id===W.id?{...te,delete:!0}:te));return}setTimeout(()=>{Ov.flushSync(()=>{I(F=>{let te=F.findIndex(ue=>ue.id===W.id);return te!==-1?[...F.slice(0,te),{...F[te],...W},...F.slice(te+1)]:[W,...F]})})})}),[]),ne.useEffect(()=>{if(v!=="system"){L(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),typeof window>"u")return;let W=window.matchMedia("(prefers-color-scheme: dark)");try{W.addEventListener("change",({matches:F})=>{L(F?"dark":"light")})}catch{W.addListener(({matches:te})=>{try{L(te?"dark":"light")}catch(ue){console.error(ue)}})}},[v]),ne.useEffect(()=>{$.length<=1&&ee(!1)},[$]),ne.useEffect(()=>{let W=F=>{var te,ue;l.every(oe=>F[oe]||F.code===oe)&&(ee(!0),(te=Y.current)==null||te.focus()),F.code==="Escape"&&(document.activeElement===Y.current||(ue=Y.current)!=null&&ue.contains(document.activeElement))&&ee(!1)};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[l]),ne.useEffect(()=>{if(Y.current)return()=>{J.current&&(J.current.focus({preventScroll:!0}),J.current=null,A.current=!1)}},[Y.current]),ne.createElement("section",{ref:a,"aria-label":`${z} ${K}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},ae.map((W,F)=>{var te;let[ue,oe]=W.split("-");return $.length?ne.createElement("ol",{key:W,dir:C==="auto"?gy():C,tabIndex:-1,ref:Y,className:h,"data-sonner-toaster":!0,"data-theme":se,"data-y-position":ue,"data-lifted":de&&$.length>1&&!u,"data-x-position":oe,style:{"--front-toast-height":`${((te=le[0])==null?void 0:te.height)||0}px`,"--width":`${pE}px`,"--gap":`${j}px`,...w,...SE(m,g)},onBlur:re=>{A.current&&!re.currentTarget.contains(re.relatedTarget)&&(A.current=!1,J.current&&(J.current.focus({preventScroll:!0}),J.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||A.current||(A.current=!0,J.current=re.relatedTarget)},onMouseEnter:()=>ee(!0),onMouseMove:()=>ee(!0),onMouseLeave:()=>{me||ee(!1)},onDragEnd:()=>ee(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||Z(!0)},onPointerUp:()=>Z(!1)},$.filter(re=>!re.position&&F===0||re.position===W).map((re,fe)=>{var je,Ae;return ne.createElement(wE,{key:re.id,icons:_,index:fe,toast:re,defaultRichColors:T,duration:(je=E==null?void 0:E.duration)!=null?je:S,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:s,visibleToasts:N,closeButton:(Ae=E==null?void 0:E.closeButton)!=null?Ae:d,interacting:me,position:W,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,removeToast:H,toasts:$.filter(we=>we.position==re.position),heights:le.filter(we=>we.position==re.position),setHeights:he,expandByDefault:u,gap:j,loadingIcon:M,expanded:de,pauseWhenPageIsHidden:k,swipeDirections:n.swipeDirections})})):null}))});const EE=({...n})=>y.jsx(TE,{theme:"system",className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...n});var CE=bd[" useId ".trim().toString()]||(()=>{}),RE=0;function Ad(n){const[a,s]=x.useState(CE());return wt(()=>{s(i=>i??String(RE++))},[n]),a?`radix-${a}`:""}const NE=["top","right","bottom","left"],qa=Math.min,Xt=Math.max,Cl=Math.round,ul=Math.floor,Ln=n=>({x:n,y:n}),AE={left:"right",right:"left",bottom:"top",top:"bottom"},OE={start:"end",end:"start"};function Wf(n,a,s){return Xt(n,qa(a,s))}function sa(n,a){return typeof n=="function"?n(a):n}function ia(n){return n.split("-")[0]}function gs(n){return n.split("-")[1]}function Od(n){return n==="x"?"y":"x"}function Md(n){return n==="y"?"height":"width"}const ME=new Set(["top","bottom"]);function kn(n){return ME.has(ia(n))?"y":"x"}function _d(n){return Od(kn(n))}function _E(n,a,s){s===void 0&&(s=!1);const i=gs(n),l=_d(n),u=Md(l);let d=l==="x"?i===(s?"end":"start")?"right":"left":i==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(d=Rl(d)),[d,Rl(d)]}function jE(n){const a=Rl(n);return[Jf(n),a,Jf(a)]}function Jf(n){return n.replace(/start|end/g,a=>OE[a])}const py=["left","right"],yy=["right","left"],DE=["top","bottom"],kE=["bottom","top"];function LE(n,a,s){switch(n){case"top":case"bottom":return s?a?yy:py:a?py:yy;case"left":case"right":return a?DE:kE;default:return[]}}function qE(n,a,s,i){const l=gs(n);let u=LE(ia(n),s==="start",i);return l&&(u=u.map(d=>d+"-"+l),a&&(u=u.concat(u.map(Jf)))),u}function Rl(n){return n.replace(/left|right|bottom|top/g,a=>AE[a])}function zE(n){return{top:0,right:0,bottom:0,left:0,...n}}function y0(n){return typeof n!="number"?zE(n):{top:n,right:n,bottom:n,left:n}}function Nl(n){const{x:a,y:s,width:i,height:l}=n;return{width:i,height:l,top:s,left:a,right:a+i,bottom:s+l,x:a,y:s}}function vy(n,a,s){let{reference:i,floating:l}=n;const u=kn(a),d=_d(a),h=Md(d),m=ia(a),g=u==="y",v=i.x+i.width/2-l.width/2,T=i.y+i.height/2-l.height/2,S=i[h]/2-l[h]/2;let w;switch(m){case"top":w={x:v,y:i.y-l.height};break;case"bottom":w={x:v,y:i.y+i.height};break;case"right":w={x:i.x+i.width,y:T};break;case"left":w={x:i.x-l.width,y:T};break;default:w={x:i.x,y:i.y}}switch(gs(a)){case"start":w[d]-=S*(s&&g?-1:1);break;case"end":w[d]+=S*(s&&g?-1:1);break}return w}const UE=async(n,a,s)=>{const{placement:i="bottom",strategy:l="absolute",middleware:u=[],platform:d}=s,h=u.filter(Boolean),m=await(d.isRTL==null?void 0:d.isRTL(a));let g=await d.getElementRects({reference:n,floating:a,strategy:l}),{x:v,y:T}=vy(g,i,m),S=i,w={},N=0;for(let E=0;E<h.length;E++){const{name:C,fn:j}=h[E],{x:M,y:_,data:z,reset:k}=await j({x:v,y:T,initialPlacement:i,placement:S,strategy:l,middlewareData:w,rects:g,platform:d,elements:{reference:n,floating:a}});v=M??v,T=_??T,w={...w,[C]:{...w[C],...z}},k&&N<=50&&(N++,typeof k=="object"&&(k.placement&&(S=k.placement),k.rects&&(g=k.rects===!0?await d.getElementRects({reference:n,floating:a,strategy:l}):k.rects),{x:v,y:T}=vy(g,S,m)),E=-1)}return{x:v,y:T,placement:S,strategy:l,middlewareData:w}};async function Mi(n,a){var s;a===void 0&&(a={});const{x:i,y:l,platform:u,rects:d,elements:h,strategy:m}=n,{boundary:g="clippingAncestors",rootBoundary:v="viewport",elementContext:T="floating",altBoundary:S=!1,padding:w=0}=sa(a,n),N=y0(w),C=h[S?T==="floating"?"reference":"floating":T],j=Nl(await u.getClippingRect({element:(s=await(u.isElement==null?void 0:u.isElement(C)))==null||s?C:C.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(h.floating)),boundary:g,rootBoundary:v,strategy:m})),M=T==="floating"?{x:i,y:l,width:d.floating.width,height:d.floating.height}:d.reference,_=await(u.getOffsetParent==null?void 0:u.getOffsetParent(h.floating)),z=await(u.isElement==null?void 0:u.isElement(_))?await(u.getScale==null?void 0:u.getScale(_))||{x:1,y:1}:{x:1,y:1},k=Nl(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:M,offsetParent:_,strategy:m}):M);return{top:(j.top-k.top+N.top)/z.y,bottom:(k.bottom-j.bottom+N.bottom)/z.y,left:(j.left-k.left+N.left)/z.x,right:(k.right-j.right+N.right)/z.x}}const BE=n=>({name:"arrow",options:n,async fn(a){const{x:s,y:i,placement:l,rects:u,platform:d,elements:h,middlewareData:m}=a,{element:g,padding:v=0}=sa(n,a)||{};if(g==null)return{};const T=y0(v),S={x:s,y:i},w=_d(l),N=Md(w),E=await d.getDimensions(g),C=w==="y",j=C?"top":"left",M=C?"bottom":"right",_=C?"clientHeight":"clientWidth",z=u.reference[N]+u.reference[w]-S[w]-u.floating[N],k=S[w]-u.reference[w],$=await(d.getOffsetParent==null?void 0:d.getOffsetParent(g));let I=$?$[_]:0;(!I||!await(d.isElement==null?void 0:d.isElement($)))&&(I=h.floating[_]||u.floating[N]);const ae=z/2-k/2,le=I/2-E[N]/2-1,he=qa(T[j],le),de=qa(T[M],le),ee=he,me=I-E[N]-de,Z=I/2-E[N]/2+ae,se=Wf(ee,Z,me),L=!m.arrow&&gs(l)!=null&&Z!==se&&u.reference[N]/2-(Z<ee?he:de)-E[N]/2<0,Y=L?Z<ee?Z-ee:Z-me:0;return{[w]:S[w]+Y,data:{[w]:se,centerOffset:Z-se-Y,...L&&{alignmentOffset:Y}},reset:L}}}),PE=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(a){var s,i;const{placement:l,middlewareData:u,rects:d,initialPlacement:h,platform:m,elements:g}=a,{mainAxis:v=!0,crossAxis:T=!0,fallbackPlacements:S,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:N="none",flipAlignment:E=!0,...C}=sa(n,a);if((s=u.arrow)!=null&&s.alignmentOffset)return{};const j=ia(l),M=kn(h),_=ia(h)===h,z=await(m.isRTL==null?void 0:m.isRTL(g.floating)),k=S||(_||!E?[Rl(h)]:jE(h)),$=N!=="none";!S&&$&&k.push(...qE(h,E,N,z));const I=[h,...k],ae=await Mi(a,C),le=[];let he=((i=u.flip)==null?void 0:i.overflows)||[];if(v&&le.push(ae[j]),T){const Z=_E(l,d,z);le.push(ae[Z[0]],ae[Z[1]])}if(he=[...he,{placement:l,overflows:le}],!le.every(Z=>Z<=0)){var de,ee;const Z=(((de=u.flip)==null?void 0:de.index)||0)+1,se=I[Z];if(se&&(!(T==="alignment"?M!==kn(se):!1)||he.every(K=>K.overflows[0]>0&&kn(K.placement)===M)))return{data:{index:Z,overflows:he},reset:{placement:se}};let L=(ee=he.filter(Y=>Y.overflows[0]<=0).sort((Y,K)=>Y.overflows[1]-K.overflows[1])[0])==null?void 0:ee.placement;if(!L)switch(w){case"bestFit":{var me;const Y=(me=he.filter(K=>{if($){const J=kn(K.placement);return J===M||J==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(J=>J>0).reduce((J,A)=>J+A,0)]).sort((K,J)=>K[1]-J[1])[0])==null?void 0:me[0];Y&&(L=Y);break}case"initialPlacement":L=h;break}if(l!==L)return{reset:{placement:L}}}return{}}}};function by(n,a){return{top:n.top-a.height,right:n.right-a.width,bottom:n.bottom-a.height,left:n.left-a.width}}function xy(n){return NE.some(a=>n[a]>=0)}const VE=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(a){const{rects:s}=a,{strategy:i="referenceHidden",...l}=sa(n,a);switch(i){case"referenceHidden":{const u=await Mi(a,{...l,elementContext:"reference"}),d=by(u,s.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:xy(d)}}}case"escaped":{const u=await Mi(a,{...l,altBoundary:!0}),d=by(u,s.floating);return{data:{escapedOffsets:d,escaped:xy(d)}}}default:return{}}}}},v0=new Set(["left","top"]);async function IE(n,a){const{placement:s,platform:i,elements:l}=n,u=await(i.isRTL==null?void 0:i.isRTL(l.floating)),d=ia(s),h=gs(s),m=kn(s)==="y",g=v0.has(d)?-1:1,v=u&&m?-1:1,T=sa(a,n);let{mainAxis:S,crossAxis:w,alignmentAxis:N}=typeof T=="number"?{mainAxis:T,crossAxis:0,alignmentAxis:null}:{mainAxis:T.mainAxis||0,crossAxis:T.crossAxis||0,alignmentAxis:T.alignmentAxis};return h&&typeof N=="number"&&(w=h==="end"?N*-1:N),m?{x:w*v,y:S*g}:{x:S*g,y:w*v}}const HE=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(a){var s,i;const{x:l,y:u,placement:d,middlewareData:h}=a,m=await IE(a,n);return d===((s=h.offset)==null?void 0:s.placement)&&(i=h.arrow)!=null&&i.alignmentOffset?{}:{x:l+m.x,y:u+m.y,data:{...m,placement:d}}}}},YE=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(a){const{x:s,y:i,placement:l}=a,{mainAxis:u=!0,crossAxis:d=!1,limiter:h={fn:C=>{let{x:j,y:M}=C;return{x:j,y:M}}},...m}=sa(n,a),g={x:s,y:i},v=await Mi(a,m),T=kn(ia(l)),S=Od(T);let w=g[S],N=g[T];if(u){const C=S==="y"?"top":"left",j=S==="y"?"bottom":"right",M=w+v[C],_=w-v[j];w=Wf(M,w,_)}if(d){const C=T==="y"?"top":"left",j=T==="y"?"bottom":"right",M=N+v[C],_=N-v[j];N=Wf(M,N,_)}const E=h.fn({...a,[S]:w,[T]:N});return{...E,data:{x:E.x-s,y:E.y-i,enabled:{[S]:u,[T]:d}}}}}},QE=function(n){return n===void 0&&(n={}),{options:n,fn(a){const{x:s,y:i,placement:l,rects:u,middlewareData:d}=a,{offset:h=0,mainAxis:m=!0,crossAxis:g=!0}=sa(n,a),v={x:s,y:i},T=kn(l),S=Od(T);let w=v[S],N=v[T];const E=sa(h,a),C=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(m){const _=S==="y"?"height":"width",z=u.reference[S]-u.floating[_]+C.mainAxis,k=u.reference[S]+u.reference[_]-C.mainAxis;w<z?w=z:w>k&&(w=k)}if(g){var j,M;const _=S==="y"?"width":"height",z=v0.has(ia(l)),k=u.reference[T]-u.floating[_]+(z&&((j=d.offset)==null?void 0:j[T])||0)+(z?0:C.crossAxis),$=u.reference[T]+u.reference[_]+(z?0:((M=d.offset)==null?void 0:M[T])||0)-(z?C.crossAxis:0);N<k?N=k:N>$&&(N=$)}return{[S]:w,[T]:N}}}},GE=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(a){var s,i;const{placement:l,rects:u,platform:d,elements:h}=a,{apply:m=()=>{},...g}=sa(n,a),v=await Mi(a,g),T=ia(l),S=gs(l),w=kn(l)==="y",{width:N,height:E}=u.floating;let C,j;T==="top"||T==="bottom"?(C=T,j=S===(await(d.isRTL==null?void 0:d.isRTL(h.floating))?"start":"end")?"left":"right"):(j=T,C=S==="end"?"top":"bottom");const M=E-v.top-v.bottom,_=N-v.left-v.right,z=qa(E-v[C],M),k=qa(N-v[j],_),$=!a.middlewareData.shift;let I=z,ae=k;if((s=a.middlewareData.shift)!=null&&s.enabled.x&&(ae=_),(i=a.middlewareData.shift)!=null&&i.enabled.y&&(I=M),$&&!S){const he=Xt(v.left,0),de=Xt(v.right,0),ee=Xt(v.top,0),me=Xt(v.bottom,0);w?ae=N-2*(he!==0||de!==0?he+de:Xt(v.left,v.right)):I=E-2*(ee!==0||me!==0?ee+me:Xt(v.top,v.bottom))}await m({...a,availableWidth:ae,availableHeight:I});const le=await d.getDimensions(h.floating);return N!==le.width||E!==le.height?{reset:{rects:!0}}:{}}}};function Hl(){return typeof window<"u"}function ps(n){return b0(n)?(n.nodeName||"").toLowerCase():"#document"}function Kt(n){var a;return(n==null||(a=n.ownerDocument)==null?void 0:a.defaultView)||window}function Un(n){var a;return(a=(b0(n)?n.ownerDocument:n.document)||window.document)==null?void 0:a.documentElement}function b0(n){return Hl()?n instanceof Node||n instanceof Kt(n).Node:!1}function yn(n){return Hl()?n instanceof Element||n instanceof Kt(n).Element:!1}function qn(n){return Hl()?n instanceof HTMLElement||n instanceof Kt(n).HTMLElement:!1}function wy(n){return!Hl()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Kt(n).ShadowRoot}const $E=new Set(["inline","contents"]);function Hi(n){const{overflow:a,overflowX:s,overflowY:i,display:l}=vn(n);return/auto|scroll|overlay|hidden|clip/.test(a+i+s)&&!$E.has(l)}const XE=new Set(["table","td","th"]);function KE(n){return XE.has(ps(n))}const FE=[":popover-open",":modal"];function Yl(n){return FE.some(a=>{try{return n.matches(a)}catch{return!1}})}const ZE=["transform","translate","scale","rotate","perspective"],WE=["transform","translate","scale","rotate","perspective","filter"],JE=["paint","layout","strict","content"];function jd(n){const a=Dd(),s=yn(n)?vn(n):n;return ZE.some(i=>s[i]?s[i]!=="none":!1)||(s.containerType?s.containerType!=="normal":!1)||!a&&(s.backdropFilter?s.backdropFilter!=="none":!1)||!a&&(s.filter?s.filter!=="none":!1)||WE.some(i=>(s.willChange||"").includes(i))||JE.some(i=>(s.contain||"").includes(i))}function eC(n){let a=za(n);for(;qn(a)&&!cs(a);){if(jd(a))return a;if(Yl(a))return null;a=za(a)}return null}function Dd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const tC=new Set(["html","body","#document"]);function cs(n){return tC.has(ps(n))}function vn(n){return Kt(n).getComputedStyle(n)}function Ql(n){return yn(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function za(n){if(ps(n)==="html")return n;const a=n.assignedSlot||n.parentNode||wy(n)&&n.host||Un(n);return wy(a)?a.host:a}function x0(n){const a=za(n);return cs(a)?n.ownerDocument?n.ownerDocument.body:n.body:qn(a)&&Hi(a)?a:x0(a)}function _i(n,a,s){var i;a===void 0&&(a=[]),s===void 0&&(s=!0);const l=x0(n),u=l===((i=n.ownerDocument)==null?void 0:i.body),d=Kt(l);if(u){const h=ed(d);return a.concat(d,d.visualViewport||[],Hi(l)?l:[],h&&s?_i(h):[])}return a.concat(l,_i(l,[],s))}function ed(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function w0(n){const a=vn(n);let s=parseFloat(a.width)||0,i=parseFloat(a.height)||0;const l=qn(n),u=l?n.offsetWidth:s,d=l?n.offsetHeight:i,h=Cl(s)!==u||Cl(i)!==d;return h&&(s=u,i=d),{width:s,height:i,$:h}}function kd(n){return yn(n)?n:n.contextElement}function os(n){const a=kd(n);if(!qn(a))return Ln(1);const s=a.getBoundingClientRect(),{width:i,height:l,$:u}=w0(a);let d=(u?Cl(s.width):s.width)/i,h=(u?Cl(s.height):s.height)/l;return(!d||!Number.isFinite(d))&&(d=1),(!h||!Number.isFinite(h))&&(h=1),{x:d,y:h}}const nC=Ln(0);function S0(n){const a=Kt(n);return!Dd()||!a.visualViewport?nC:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function aC(n,a,s){return a===void 0&&(a=!1),!s||a&&s!==Kt(n)?!1:a}function ur(n,a,s,i){a===void 0&&(a=!1),s===void 0&&(s=!1);const l=n.getBoundingClientRect(),u=kd(n);let d=Ln(1);a&&(i?yn(i)&&(d=os(i)):d=os(n));const h=aC(u,s,i)?S0(u):Ln(0);let m=(l.left+h.x)/d.x,g=(l.top+h.y)/d.y,v=l.width/d.x,T=l.height/d.y;if(u){const S=Kt(u),w=i&&yn(i)?Kt(i):i;let N=S,E=ed(N);for(;E&&i&&w!==N;){const C=os(E),j=E.getBoundingClientRect(),M=vn(E),_=j.left+(E.clientLeft+parseFloat(M.paddingLeft))*C.x,z=j.top+(E.clientTop+parseFloat(M.paddingTop))*C.y;m*=C.x,g*=C.y,v*=C.x,T*=C.y,m+=_,g+=z,N=Kt(E),E=ed(N)}}return Nl({width:v,height:T,x:m,y:g})}function Ld(n,a){const s=Ql(n).scrollLeft;return a?a.left+s:ur(Un(n)).left+s}function T0(n,a,s){s===void 0&&(s=!1);const i=n.getBoundingClientRect(),l=i.left+a.scrollLeft-(s?0:Ld(n,i)),u=i.top+a.scrollTop;return{x:l,y:u}}function rC(n){let{elements:a,rect:s,offsetParent:i,strategy:l}=n;const u=l==="fixed",d=Un(i),h=a?Yl(a.floating):!1;if(i===d||h&&u)return s;let m={scrollLeft:0,scrollTop:0},g=Ln(1);const v=Ln(0),T=qn(i);if((T||!T&&!u)&&((ps(i)!=="body"||Hi(d))&&(m=Ql(i)),qn(i))){const w=ur(i);g=os(i),v.x=w.x+i.clientLeft,v.y=w.y+i.clientTop}const S=d&&!T&&!u?T0(d,m,!0):Ln(0);return{width:s.width*g.x,height:s.height*g.y,x:s.x*g.x-m.scrollLeft*g.x+v.x+S.x,y:s.y*g.y-m.scrollTop*g.y+v.y+S.y}}function sC(n){return Array.from(n.getClientRects())}function iC(n){const a=Un(n),s=Ql(n),i=n.ownerDocument.body,l=Xt(a.scrollWidth,a.clientWidth,i.scrollWidth,i.clientWidth),u=Xt(a.scrollHeight,a.clientHeight,i.scrollHeight,i.clientHeight);let d=-s.scrollLeft+Ld(n);const h=-s.scrollTop;return vn(i).direction==="rtl"&&(d+=Xt(a.clientWidth,i.clientWidth)-l),{width:l,height:u,x:d,y:h}}function oC(n,a){const s=Kt(n),i=Un(n),l=s.visualViewport;let u=i.clientWidth,d=i.clientHeight,h=0,m=0;if(l){u=l.width,d=l.height;const g=Dd();(!g||g&&a==="fixed")&&(h=l.offsetLeft,m=l.offsetTop)}return{width:u,height:d,x:h,y:m}}const lC=new Set(["absolute","fixed"]);function cC(n,a){const s=ur(n,!0,a==="fixed"),i=s.top+n.clientTop,l=s.left+n.clientLeft,u=qn(n)?os(n):Ln(1),d=n.clientWidth*u.x,h=n.clientHeight*u.y,m=l*u.x,g=i*u.y;return{width:d,height:h,x:m,y:g}}function Sy(n,a,s){let i;if(a==="viewport")i=oC(n,s);else if(a==="document")i=iC(Un(n));else if(yn(a))i=cC(a,s);else{const l=S0(n);i={x:a.x-l.x,y:a.y-l.y,width:a.width,height:a.height}}return Nl(i)}function E0(n,a){const s=za(n);return s===a||!yn(s)||cs(s)?!1:vn(s).position==="fixed"||E0(s,a)}function uC(n,a){const s=a.get(n);if(s)return s;let i=_i(n,[],!1).filter(h=>yn(h)&&ps(h)!=="body"),l=null;const u=vn(n).position==="fixed";let d=u?za(n):n;for(;yn(d)&&!cs(d);){const h=vn(d),m=jd(d);!m&&h.position==="fixed"&&(l=null),(u?!m&&!l:!m&&h.position==="static"&&!!l&&lC.has(l.position)||Hi(d)&&!m&&E0(n,d))?i=i.filter(v=>v!==d):l=h,d=za(d)}return a.set(n,i),i}function fC(n){let{element:a,boundary:s,rootBoundary:i,strategy:l}=n;const d=[...s==="clippingAncestors"?Yl(a)?[]:uC(a,this._c):[].concat(s),i],h=d[0],m=d.reduce((g,v)=>{const T=Sy(a,v,l);return g.top=Xt(T.top,g.top),g.right=qa(T.right,g.right),g.bottom=qa(T.bottom,g.bottom),g.left=Xt(T.left,g.left),g},Sy(a,h,l));return{width:m.right-m.left,height:m.bottom-m.top,x:m.left,y:m.top}}function dC(n){const{width:a,height:s}=w0(n);return{width:a,height:s}}function hC(n,a,s){const i=qn(a),l=Un(a),u=s==="fixed",d=ur(n,!0,u,a);let h={scrollLeft:0,scrollTop:0};const m=Ln(0);function g(){m.x=Ld(l)}if(i||!i&&!u)if((ps(a)!=="body"||Hi(l))&&(h=Ql(a)),i){const w=ur(a,!0,u,a);m.x=w.x+a.clientLeft,m.y=w.y+a.clientTop}else l&&g();u&&!i&&l&&g();const v=l&&!i&&!u?T0(l,h):Ln(0),T=d.left+h.scrollLeft-m.x-v.x,S=d.top+h.scrollTop-m.y-v.y;return{x:T,y:S,width:d.width,height:d.height}}function Nf(n){return vn(n).position==="static"}function Ty(n,a){if(!qn(n)||vn(n).position==="fixed")return null;if(a)return a(n);let s=n.offsetParent;return Un(n)===s&&(s=s.ownerDocument.body),s}function C0(n,a){const s=Kt(n);if(Yl(n))return s;if(!qn(n)){let l=za(n);for(;l&&!cs(l);){if(yn(l)&&!Nf(l))return l;l=za(l)}return s}let i=Ty(n,a);for(;i&&KE(i)&&Nf(i);)i=Ty(i,a);return i&&cs(i)&&Nf(i)&&!jd(i)?s:i||eC(n)||s}const mC=async function(n){const a=this.getOffsetParent||C0,s=this.getDimensions,i=await s(n.floating);return{reference:hC(n.reference,await a(n.floating),n.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function gC(n){return vn(n).direction==="rtl"}const pC={convertOffsetParentRelativeRectToViewportRelativeRect:rC,getDocumentElement:Un,getClippingRect:fC,getOffsetParent:C0,getElementRects:mC,getClientRects:sC,getDimensions:dC,getScale:os,isElement:yn,isRTL:gC};function R0(n,a){return n.x===a.x&&n.y===a.y&&n.width===a.width&&n.height===a.height}function yC(n,a){let s=null,i;const l=Un(n);function u(){var h;clearTimeout(i),(h=s)==null||h.disconnect(),s=null}function d(h,m){h===void 0&&(h=!1),m===void 0&&(m=1),u();const g=n.getBoundingClientRect(),{left:v,top:T,width:S,height:w}=g;if(h||a(),!S||!w)return;const N=ul(T),E=ul(l.clientWidth-(v+S)),C=ul(l.clientHeight-(T+w)),j=ul(v),_={rootMargin:-N+"px "+-E+"px "+-C+"px "+-j+"px",threshold:Xt(0,qa(1,m))||1};let z=!0;function k($){const I=$[0].intersectionRatio;if(I!==m){if(!z)return d();I?d(!1,I):i=setTimeout(()=>{d(!1,1e-7)},1e3)}I===1&&!R0(g,n.getBoundingClientRect())&&d(),z=!1}try{s=new IntersectionObserver(k,{..._,root:l.ownerDocument})}catch{s=new IntersectionObserver(k,_)}s.observe(n)}return d(!0),u}function vC(n,a,s,i){i===void 0&&(i={});const{ancestorScroll:l=!0,ancestorResize:u=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:m=!1}=i,g=kd(n),v=l||u?[...g?_i(g):[],..._i(a)]:[];v.forEach(j=>{l&&j.addEventListener("scroll",s,{passive:!0}),u&&j.addEventListener("resize",s)});const T=g&&h?yC(g,s):null;let S=-1,w=null;d&&(w=new ResizeObserver(j=>{let[M]=j;M&&M.target===g&&w&&(w.unobserve(a),cancelAnimationFrame(S),S=requestAnimationFrame(()=>{var _;(_=w)==null||_.observe(a)})),s()}),g&&!m&&w.observe(g),w.observe(a));let N,E=m?ur(n):null;m&&C();function C(){const j=ur(n);E&&!R0(E,j)&&s(),E=j,N=requestAnimationFrame(C)}return s(),()=>{var j;v.forEach(M=>{l&&M.removeEventListener("scroll",s),u&&M.removeEventListener("resize",s)}),T==null||T(),(j=w)==null||j.disconnect(),w=null,m&&cancelAnimationFrame(N)}}const bC=HE,xC=YE,wC=PE,SC=GE,TC=VE,Ey=BE,EC=QE,CC=(n,a,s)=>{const i=new Map,l={platform:pC,...s},u={...l.platform,_c:i};return UE(n,a,{...l,platform:u})};var RC=typeof document<"u",NC=function(){},wl=RC?x.useLayoutEffect:NC;function Al(n,a){if(n===a)return!0;if(typeof n!=typeof a)return!1;if(typeof n=="function"&&n.toString()===a.toString())return!0;let s,i,l;if(n&&a&&typeof n=="object"){if(Array.isArray(n)){if(s=n.length,s!==a.length)return!1;for(i=s;i--!==0;)if(!Al(n[i],a[i]))return!1;return!0}if(l=Object.keys(n),s=l.length,s!==Object.keys(a).length)return!1;for(i=s;i--!==0;)if(!{}.hasOwnProperty.call(a,l[i]))return!1;for(i=s;i--!==0;){const u=l[i];if(!(u==="_owner"&&n.$$typeof)&&!Al(n[u],a[u]))return!1}return!0}return n!==n&&a!==a}function N0(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Cy(n,a){const s=N0(n);return Math.round(a*s)/s}function Af(n){const a=x.useRef(n);return wl(()=>{a.current=n}),a}function AC(n){n===void 0&&(n={});const{placement:a="bottom",strategy:s="absolute",middleware:i=[],platform:l,elements:{reference:u,floating:d}={},transform:h=!0,whileElementsMounted:m,open:g}=n,[v,T]=x.useState({x:0,y:0,strategy:s,placement:a,middlewareData:{},isPositioned:!1}),[S,w]=x.useState(i);Al(S,i)||w(i);const[N,E]=x.useState(null),[C,j]=x.useState(null),M=x.useCallback(K=>{K!==$.current&&($.current=K,E(K))},[]),_=x.useCallback(K=>{K!==I.current&&(I.current=K,j(K))},[]),z=u||N,k=d||C,$=x.useRef(null),I=x.useRef(null),ae=x.useRef(v),le=m!=null,he=Af(m),de=Af(l),ee=Af(g),me=x.useCallback(()=>{if(!$.current||!I.current)return;const K={placement:a,strategy:s,middleware:S};de.current&&(K.platform=de.current),CC($.current,I.current,K).then(J=>{const A={...J,isPositioned:ee.current!==!1};Z.current&&!Al(ae.current,A)&&(ae.current=A,hs.flushSync(()=>{T(A)}))})},[S,a,s,de,ee]);wl(()=>{g===!1&&ae.current.isPositioned&&(ae.current.isPositioned=!1,T(K=>({...K,isPositioned:!1})))},[g]);const Z=x.useRef(!1);wl(()=>(Z.current=!0,()=>{Z.current=!1}),[]),wl(()=>{if(z&&($.current=z),k&&(I.current=k),z&&k){if(he.current)return he.current(z,k,me);me()}},[z,k,me,he,le]);const se=x.useMemo(()=>({reference:$,floating:I,setReference:M,setFloating:_}),[M,_]),L=x.useMemo(()=>({reference:z,floating:k}),[z,k]),Y=x.useMemo(()=>{const K={position:s,left:0,top:0};if(!L.floating)return K;const J=Cy(L.floating,v.x),A=Cy(L.floating,v.y);return h?{...K,transform:"translate("+J+"px, "+A+"px)",...N0(L.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:J,top:A}},[s,h,L.floating,v.x,v.y]);return x.useMemo(()=>({...v,update:me,refs:se,elements:L,floatingStyles:Y}),[v,me,se,L,Y])}const OC=n=>{function a(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:n,fn(s){const{element:i,padding:l}=typeof n=="function"?n(s):n;return i&&a(i)?i.current!=null?Ey({element:i.current,padding:l}).fn(s):{}:i?Ey({element:i,padding:l}).fn(s):{}}}},MC=(n,a)=>({...bC(n),options:[n,a]}),_C=(n,a)=>({...xC(n),options:[n,a]}),jC=(n,a)=>({...EC(n),options:[n,a]}),DC=(n,a)=>({...wC(n),options:[n,a]}),kC=(n,a)=>({...SC(n),options:[n,a]}),LC=(n,a)=>({...TC(n),options:[n,a]}),qC=(n,a)=>({...OC(n),options:[n,a]});var zC="Arrow",A0=x.forwardRef((n,a)=>{const{children:s,width:i=10,height:l=5,...u}=n;return y.jsx(Ve.svg,{...u,ref:a,width:i,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?s:y.jsx("polygon",{points:"0,0 30,0 15,10"})})});A0.displayName=zC;var UC=A0;function BC(n){const[a,s]=x.useState(void 0);return wt(()=>{if(n){s({width:n.offsetWidth,height:n.offsetHeight});const i=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const u=l[0];let d,h;if("borderBoxSize"in u){const m=u.borderBoxSize,g=Array.isArray(m)?m[0]:m;d=g.inlineSize,h=g.blockSize}else d=n.offsetWidth,h=n.offsetHeight;s({width:d,height:h})});return i.observe(n,{box:"border-box"}),()=>i.unobserve(n)}else s(void 0)},[n]),a}var qd="Popper",[O0,Gl]=Vi(qd),[PC,M0]=O0(qd),_0=n=>{const{__scopePopper:a,children:s}=n,[i,l]=x.useState(null);return y.jsx(PC,{scope:a,anchor:i,onAnchorChange:l,children:s})};_0.displayName=qd;var j0="PopperAnchor",D0=x.forwardRef((n,a)=>{const{__scopePopper:s,virtualRef:i,...l}=n,u=M0(j0,s),d=x.useRef(null),h=Je(a,d);return x.useEffect(()=>{u.onAnchorChange((i==null?void 0:i.current)||d.current)}),i?null:y.jsx(Ve.div,{...l,ref:h})});D0.displayName=j0;var zd="PopperContent",[VC,IC]=O0(zd),k0=x.forwardRef((n,a)=>{var re,fe,je,Ae,we,Re;const{__scopePopper:s,side:i="bottom",sideOffset:l=0,align:u="center",alignOffset:d=0,arrowPadding:h=0,avoidCollisions:m=!0,collisionBoundary:g=[],collisionPadding:v=0,sticky:T="partial",hideWhenDetached:S=!1,updatePositionStrategy:w="optimized",onPlaced:N,...E}=n,C=M0(zd,s),[j,M]=x.useState(null),_=Je(a,nt=>M(nt)),[z,k]=x.useState(null),$=BC(z),I=($==null?void 0:$.width)??0,ae=($==null?void 0:$.height)??0,le=i+(u!=="center"?"-"+u:""),he=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},de=Array.isArray(g)?g:[g],ee=de.length>0,me={padding:he,boundary:de.filter(YC),altBoundary:ee},{refs:Z,floatingStyles:se,placement:L,isPositioned:Y,middlewareData:K}=AC({strategy:"fixed",placement:le,whileElementsMounted:(...nt)=>vC(...nt,{animationFrame:w==="always"}),elements:{reference:C.anchor},middleware:[MC({mainAxis:l+ae,alignmentAxis:d}),m&&_C({mainAxis:!0,crossAxis:!1,limiter:T==="partial"?jC():void 0,...me}),m&&DC({...me}),kC({...me,apply:({elements:nt,rects:Tt,availableWidth:Bn,availableHeight:bn})=>{const{width:ut,height:Va}=Tt.reference,Pn=nt.floating.style;Pn.setProperty("--radix-popper-available-width",`${Bn}px`),Pn.setProperty("--radix-popper-available-height",`${bn}px`),Pn.setProperty("--radix-popper-anchor-width",`${ut}px`),Pn.setProperty("--radix-popper-anchor-height",`${Va}px`)}}),z&&qC({element:z,padding:h}),QC({arrowWidth:I,arrowHeight:ae}),S&&LC({strategy:"referenceHidden",...me})]}),[J,A]=z0(L),H=pn(N);wt(()=>{Y&&(H==null||H())},[Y,H]);const W=(re=K.arrow)==null?void 0:re.x,F=(fe=K.arrow)==null?void 0:fe.y,te=((je=K.arrow)==null?void 0:je.centerOffset)!==0,[ue,oe]=x.useState();return wt(()=>{j&&oe(window.getComputedStyle(j).zIndex)},[j]),y.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...se,transform:Y?se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(Ae=K.transformOrigin)==null?void 0:Ae.x,(we=K.transformOrigin)==null?void 0:we.y].join(" "),...((Re=K.hide)==null?void 0:Re.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:y.jsx(VC,{scope:s,placedSide:J,onArrowChange:k,arrowX:W,arrowY:F,shouldHideArrow:te,children:y.jsx(Ve.div,{"data-side":J,"data-align":A,...E,ref:_,style:{...E.style,animation:Y?void 0:"none"}})})})});k0.displayName=zd;var L0="PopperArrow",HC={top:"bottom",right:"left",bottom:"top",left:"right"},q0=x.forwardRef(function(a,s){const{__scopePopper:i,...l}=a,u=IC(L0,i),d=HC[u.placedSide];return y.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:y.jsx(UC,{...l,ref:s,style:{...l.style,display:"block"}})})});q0.displayName=L0;function YC(n){return n!==null}var QC=n=>({name:"transformOrigin",options:n,fn(a){var C,j,M;const{placement:s,rects:i,middlewareData:l}=a,d=((C=l.arrow)==null?void 0:C.centerOffset)!==0,h=d?0:n.arrowWidth,m=d?0:n.arrowHeight,[g,v]=z0(s),T={start:"0%",center:"50%",end:"100%"}[v],S=(((j=l.arrow)==null?void 0:j.x)??0)+h/2,w=(((M=l.arrow)==null?void 0:M.y)??0)+m/2;let N="",E="";return g==="bottom"?(N=d?T:`${S}px`,E=`${-m}px`):g==="top"?(N=d?T:`${S}px`,E=`${i.floating.height+m}px`):g==="right"?(N=`${-m}px`,E=d?T:`${w}px`):g==="left"&&(N=`${i.floating.width+m}px`,E=d?T:`${w}px`),{data:{x:N,y:E}}}});function z0(n){const[a,s="center"]=n.split("-");return[a,s]}var GC=_0,U0=D0,B0=k0,P0=q0,[$l,k_]=Vi("Tooltip",[Gl]),Ud=Gl(),V0="TooltipProvider",$C=700,Ry="tooltip.open",[XC,I0]=$l(V0),H0=n=>{const{__scopeTooltip:a,delayDuration:s=$C,skipDelayDuration:i=300,disableHoverableContent:l=!1,children:u}=n,d=x.useRef(!0),h=x.useRef(!1),m=x.useRef(0);return x.useEffect(()=>{const g=m.current;return()=>window.clearTimeout(g)},[]),y.jsx(XC,{scope:a,isOpenDelayedRef:d,delayDuration:s,onOpen:x.useCallback(()=>{window.clearTimeout(m.current),d.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>d.current=!0,i)},[i]),isPointerInTransitRef:h,onPointerInTransitChange:x.useCallback(g=>{h.current=g},[]),disableHoverableContent:l,children:u})};H0.displayName=V0;var Y0="Tooltip",[L_,Xl]=$l(Y0),td="TooltipTrigger",KC=x.forwardRef((n,a)=>{const{__scopeTooltip:s,...i}=n,l=Xl(td,s),u=I0(td,s),d=Ud(s),h=x.useRef(null),m=Je(a,h,l.onTriggerChange),g=x.useRef(!1),v=x.useRef(!1),T=x.useCallback(()=>g.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",T),[T]),y.jsx(U0,{asChild:!0,...d,children:y.jsx(Ve.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...i,ref:m,onPointerMove:Ne(n.onPointerMove,S=>{S.pointerType!=="touch"&&!v.current&&!u.isPointerInTransitRef.current&&(l.onTriggerEnter(),v.current=!0)}),onPointerLeave:Ne(n.onPointerLeave,()=>{l.onTriggerLeave(),v.current=!1}),onPointerDown:Ne(n.onPointerDown,()=>{l.open&&l.onClose(),g.current=!0,document.addEventListener("pointerup",T,{once:!0})}),onFocus:Ne(n.onFocus,()=>{g.current||l.onOpen()}),onBlur:Ne(n.onBlur,l.onClose),onClick:Ne(n.onClick,l.onClose)})})});KC.displayName=td;var FC="TooltipPortal",[q_,ZC]=$l(FC,{forceMount:void 0}),us="TooltipContent",Q0=x.forwardRef((n,a)=>{const s=ZC(us,n.__scopeTooltip),{forceMount:i=s.forceMount,side:l="top",...u}=n,d=Xl(us,n.__scopeTooltip);return y.jsx(Sd,{present:i||d.open,children:d.disableHoverableContent?y.jsx(G0,{side:l,...u,ref:a}):y.jsx(WC,{side:l,...u,ref:a})})}),WC=x.forwardRef((n,a)=>{const s=Xl(us,n.__scopeTooltip),i=I0(us,n.__scopeTooltip),l=x.useRef(null),u=Je(a,l),[d,h]=x.useState(null),{trigger:m,onClose:g}=s,v=l.current,{onPointerInTransitChange:T}=i,S=x.useCallback(()=>{h(null),T(!1)},[T]),w=x.useCallback((N,E)=>{const C=N.currentTarget,j={x:N.clientX,y:N.clientY},M=a2(j,C.getBoundingClientRect()),_=r2(j,M),z=s2(E.getBoundingClientRect()),k=o2([..._,...z]);h(k),T(!0)},[T]);return x.useEffect(()=>()=>S(),[S]),x.useEffect(()=>{if(m&&v){const N=C=>w(C,v),E=C=>w(C,m);return m.addEventListener("pointerleave",N),v.addEventListener("pointerleave",E),()=>{m.removeEventListener("pointerleave",N),v.removeEventListener("pointerleave",E)}}},[m,v,w,S]),x.useEffect(()=>{if(d){const N=E=>{const C=E.target,j={x:E.clientX,y:E.clientY},M=(m==null?void 0:m.contains(C))||(v==null?void 0:v.contains(C)),_=!i2(j,d);M?S():_&&(S(),g())};return document.addEventListener("pointermove",N),()=>document.removeEventListener("pointermove",N)}},[m,v,d,g,S]),y.jsx(G0,{...n,ref:u})}),[JC,e2]=$l(Y0,{isInside:!1}),t2=yS("TooltipContent"),G0=x.forwardRef((n,a)=>{const{__scopeTooltip:s,children:i,"aria-label":l,onEscapeKeyDown:u,onPointerDownOutside:d,...h}=n,m=Xl(us,s),g=Ud(s),{onClose:v}=m;return x.useEffect(()=>(document.addEventListener(Ry,v),()=>document.removeEventListener(Ry,v)),[v]),x.useEffect(()=>{if(m.trigger){const T=S=>{const w=S.target;w!=null&&w.contains(m.trigger)&&v()};return window.addEventListener("scroll",T,{capture:!0}),()=>window.removeEventListener("scroll",T,{capture:!0})}},[m.trigger,v]),y.jsx(Bl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:T=>T.preventDefault(),onDismiss:v,children:y.jsxs(B0,{"data-state":m.stateAttribute,...g,...h,ref:a,style:{...h.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[y.jsx(t2,{children:i}),y.jsx(JC,{scope:s,isInside:!0,children:y.jsx(BS,{id:m.contentId,role:"tooltip",children:l||i})})]})})});Q0.displayName=us;var $0="TooltipArrow",n2=x.forwardRef((n,a)=>{const{__scopeTooltip:s,...i}=n,l=Ud(s);return e2($0,s).isInside?null:y.jsx(P0,{...l,...i,ref:a})});n2.displayName=$0;function a2(n,a){const s=Math.abs(a.top-n.y),i=Math.abs(a.bottom-n.y),l=Math.abs(a.right-n.x),u=Math.abs(a.left-n.x);switch(Math.min(s,i,l,u)){case u:return"left";case l:return"right";case s:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function r2(n,a,s=5){const i=[];switch(a){case"top":i.push({x:n.x-s,y:n.y+s},{x:n.x+s,y:n.y+s});break;case"bottom":i.push({x:n.x-s,y:n.y-s},{x:n.x+s,y:n.y-s});break;case"left":i.push({x:n.x+s,y:n.y-s},{x:n.x+s,y:n.y+s});break;case"right":i.push({x:n.x-s,y:n.y-s},{x:n.x-s,y:n.y+s});break}return i}function s2(n){const{top:a,right:s,bottom:i,left:l}=n;return[{x:l,y:a},{x:s,y:a},{x:s,y:i},{x:l,y:i}]}function i2(n,a){const{x:s,y:i}=n;let l=!1;for(let u=0,d=a.length-1;u<a.length;d=u++){const h=a[u],m=a[d],g=h.x,v=h.y,T=m.x,S=m.y;v>i!=S>i&&s<(T-g)*(i-v)/(S-v)+g&&(l=!l)}return l}function o2(n){const a=n.slice();return a.sort((s,i)=>s.x<i.x?-1:s.x>i.x?1:s.y<i.y?-1:s.y>i.y?1:0),l2(a)}function l2(n){if(n.length<=1)return n.slice();const a=[];for(let i=0;i<n.length;i++){const l=n[i];for(;a.length>=2;){const u=a[a.length-1],d=a[a.length-2];if((u.x-d.x)*(l.y-d.y)>=(u.y-d.y)*(l.x-d.x))a.pop();else break}a.push(l)}a.pop();const s=[];for(let i=n.length-1;i>=0;i--){const l=n[i];for(;s.length>=2;){const u=s[s.length-1],d=s[s.length-2];if((u.x-d.x)*(l.y-d.y)>=(u.y-d.y)*(l.x-d.x))s.pop();else break}s.push(l)}return s.pop(),a.length===1&&s.length===1&&a[0].x===s[0].x&&a[0].y===s[0].y?a:a.concat(s)}var c2=H0,X0=Q0;const u2=c2,f2=x.forwardRef(({className:n,sideOffset:a=4,...s},i)=>y.jsx(X0,{ref:i,sideOffset:a,className:St("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n),...s}));f2.displayName=X0.displayName;/**
* @remix-run/router v1.23.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function ji(){return ji=Object.assign?Object.assign.bind():function(n){for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])}return n},ji.apply(this,arguments)}var La;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})(La||(La={}));const Ny="popstate";function d2(n){n===void 0&&(n={});function a(i,l){let{pathname:u,search:d,hash:h}=i.location;return nd("",{pathname:u,search:d,hash:h},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function s(i,l){return typeof l=="string"?l:F0(l)}return m2(a,s,null,n)}function ct(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function K0(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function h2(){return Math.random().toString(36).substr(2,8)}function Ay(n,a){return{usr:n.state,key:n.key,idx:a}}function nd(n,a,s,i){return s===void 0&&(s=null),ji({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof a=="string"?ys(a):a,{state:s,key:a&&a.key||i||h2()})}function F0(n){let{pathname:a="/",search:s="",hash:i=""}=n;return s&&s!=="?"&&(a+=s.charAt(0)==="?"?s:"?"+s),i&&i!=="#"&&(a+=i.charAt(0)==="#"?i:"#"+i),a}function ys(n){let a={};if(n){let s=n.indexOf("#");s>=0&&(a.hash=n.substr(s),n=n.substr(0,s));let i=n.indexOf("?");i>=0&&(a.search=n.substr(i),n=n.substr(0,i)),n&&(a.pathname=n)}return a}function m2(n,a,s,i){i===void 0&&(i={});let{window:l=document.defaultView,v5Compat:u=!1}=i,d=l.history,h=La.Pop,m=null,g=v();g==null&&(g=0,d.replaceState(ji({},d.state,{idx:g}),""));function v(){return(d.state||{idx:null}).idx}function T(){h=La.Pop;let C=v(),j=C==null?null:C-g;g=C,m&&m({action:h,location:E.location,delta:j})}function S(C,j){h=La.Push;let M=nd(E.location,C,j);g=v()+1;let _=Ay(M,g),z=E.createHref(M);try{d.pushState(_,"",z)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;l.location.assign(z)}u&&m&&m({action:h,location:E.location,delta:1})}function w(C,j){h=La.Replace;let M=nd(E.location,C,j);g=v();let _=Ay(M,g),z=E.createHref(M);d.replaceState(_,"",z),u&&m&&m({action:h,location:E.location,delta:0})}function N(C){let j=l.location.origin!=="null"?l.location.origin:l.location.href,M=typeof C=="string"?C:F0(C);return M=M.replace(/ $/,"%20"),ct(j,"No window.location.(origin|href) available to create URL for href: "+M),new URL(M,j)}let E={get action(){return h},get location(){return n(l,d)},listen(C){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(Ny,T),m=C,()=>{l.removeEventListener(Ny,T),m=null}},createHref(C){return a(l,C)},createURL:N,encodeLocation(C){let j=N(C);return{pathname:j.pathname,search:j.search,hash:j.hash}},push:S,replace:w,go(C){return d.go(C)}};return E}var Oy;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(Oy||(Oy={}));function g2(n,a,s){return s===void 0&&(s="/"),p2(n,a,s)}function p2(n,a,s,i){let l=typeof a=="string"?ys(a):a,u=J0(l.pathname||"/",s);if(u==null)return null;let d=Z0(n);y2(d);let h=null;for(let m=0;h==null&&m<d.length;++m){let g=O2(u);h=R2(d[m],g)}return h}function Z0(n,a,s,i){a===void 0&&(a=[]),s===void 0&&(s=[]),i===void 0&&(i="");let l=(u,d,h)=>{let m={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:d,route:u};m.relativePath.startsWith("/")&&(ct(m.relativePath.startsWith(i),'Absolute route path "'+m.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),m.relativePath=m.relativePath.slice(i.length));let g=lr([i,m.relativePath]),v=s.concat(m);u.children&&u.children.length>0&&(ct(u.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),Z0(u.children,a,v,g)),!(u.path==null&&!u.index)&&a.push({path:g,score:E2(g,u.index),routesMeta:v})};return n.forEach((u,d)=>{var h;if(u.path===""||!((h=u.path)!=null&&h.includes("?")))l(u,d);else for(let m of W0(u.path))l(u,d,m)}),a}function W0(n){let a=n.split("/");if(a.length===0)return[];let[s,...i]=a,l=s.endsWith("?"),u=s.replace(/\?$/,"");if(i.length===0)return l?[u,""]:[u];let d=W0(i.join("/")),h=[];return h.push(...d.map(m=>m===""?u:[u,m].join("/"))),l&&h.push(...d),h.map(m=>n.startsWith("/")&&m===""?"/":m)}function y2(n){n.sort((a,s)=>a.score!==s.score?s.score-a.score:C2(a.routesMeta.map(i=>i.childrenIndex),s.routesMeta.map(i=>i.childrenIndex)))}const v2=/^:[\w-]+$/,b2=3,x2=2,w2=1,S2=10,T2=-2,My=n=>n==="*";function E2(n,a){let s=n.split("/"),i=s.length;return s.some(My)&&(i+=T2),a&&(i+=x2),s.filter(l=>!My(l)).reduce((l,u)=>l+(v2.test(u)?b2:u===""?w2:S2),i)}function C2(n,a){return n.length===a.length&&n.slice(0,-1).every((i,l)=>i===a[l])?n[n.length-1]-a[a.length-1]:0}function R2(n,a,s){let{routesMeta:i}=n,l={},u="/",d=[];for(let h=0;h<i.length;++h){let m=i[h],g=h===i.length-1,v=u==="/"?a:a.slice(u.length)||"/",T=N2({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},v),S=m.route;if(!T)return null;Object.assign(l,T.params),d.push({params:l,pathname:lr([u,T.pathname]),pathnameBase:L2(lr([u,T.pathnameBase])),route:S}),T.pathnameBase!=="/"&&(u=lr([u,T.pathnameBase]))}return d}function N2(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[s,i]=A2(n.path,n.caseSensitive,n.end),l=a.match(s);if(!l)return null;let u=l[0],d=u.replace(/(.)\/+$/,"$1"),h=l.slice(1);return{params:i.reduce((g,v,T)=>{let{paramName:S,isOptional:w}=v;if(S==="*"){let E=h[T]||"";d=u.slice(0,u.length-E.length).replace(/(.)\/+$/,"$1")}const N=h[T];return w&&!N?g[S]=void 0:g[S]=(N||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:d,pattern:n}}function A2(n,a,s){a===void 0&&(a=!1),s===void 0&&(s=!0),K0(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let i=[],l="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,h,m)=>(i.push({paramName:h,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(i.push({paramName:"*"}),l+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?l+="\\/*$":n!==""&&n!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,a?void 0:"i"),i]}function O2(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return K0(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+a+").")),n}}function J0(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let s=a.endsWith("/")?a.length-1:a.length,i=n.charAt(s);return i&&i!=="/"?null:n.slice(s)||"/"}function M2(n,a){a===void 0&&(a="/");let{pathname:s,search:i="",hash:l=""}=typeof n=="string"?ys(n):n;return{pathname:s?s.startsWith("/")?s:_2(s,a):a,search:q2(i),hash:z2(l)}}function _2(n,a){let s=a.replace(/\/+$/,"").split("/");return n.split("/").forEach(l=>{l===".."?s.length>1&&s.pop():l!=="."&&s.push(l)}),s.length>1?s.join("/"):"/"}function Of(n,a,s,i){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+s+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function j2(n){return n.filter((a,s)=>s===0||a.route.path&&a.route.path.length>0)}function D2(n,a){let s=j2(n);return a?s.map((i,l)=>l===s.length-1?i.pathname:i.pathnameBase):s.map(i=>i.pathnameBase)}function k2(n,a,s,i){i===void 0&&(i=!1);let l;typeof n=="string"?l=ys(n):(l=ji({},n),ct(!l.pathname||!l.pathname.includes("?"),Of("?","pathname","search",l)),ct(!l.pathname||!l.pathname.includes("#"),Of("#","pathname","hash",l)),ct(!l.search||!l.search.includes("#"),Of("#","search","hash",l)));let u=n===""||l.pathname==="",d=u?"/":l.pathname,h;if(d==null)h=s;else{let T=a.length-1;if(!i&&d.startsWith("..")){let S=d.split("/");for(;S[0]==="..";)S.shift(),T-=1;l.pathname=S.join("/")}h=T>=0?a[T]:"/"}let m=M2(l,h),g=d&&d!=="/"&&d.endsWith("/"),v=(u||d===".")&&s.endsWith("/");return!m.pathname.endsWith("/")&&(g||v)&&(m.pathname+="/"),m}const lr=n=>n.join("/").replace(/\/\/+/g,"/"),L2=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),q2=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,z2=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function U2(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const eb=["post","put","patch","delete"];new Set(eb);const B2=["get",...eb];new Set(B2);/**
* React Router v6.30.1
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Di(){return Di=Object.assign?Object.assign.bind():function(n){for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])}return n},Di.apply(this,arguments)}const Bd=x.createContext(null),P2=x.createContext(null),Kl=x.createContext(null),Fl=x.createContext(null),hr=x.createContext({outlet:null,matches:[],isDataRoute:!1}),tb=x.createContext(null);function Zl(){return x.useContext(Fl)!=null}function Pd(){return Zl()||ct(!1),x.useContext(Fl).location}function nb(n){x.useContext(Kl).static||x.useLayoutEffect(n)}function ab(){let{isDataRoute:n}=x.useContext(hr);return n?J2():V2()}function V2(){Zl()||ct(!1);let n=x.useContext(Bd),{basename:a,future:s,navigator:i}=x.useContext(Kl),{matches:l}=x.useContext(hr),{pathname:u}=Pd(),d=JSON.stringify(D2(l,s.v7_relativeSplatPath)),h=x.useRef(!1);return nb(()=>{h.current=!0}),x.useCallback(function(g,v){if(v===void 0&&(v={}),!h.current)return;if(typeof g=="number"){i.go(g);return}let T=k2(g,JSON.parse(d),u,v.relative==="path");n==null&&a!=="/"&&(T.pathname=T.pathname==="/"?a:lr([a,T.pathname])),(v.replace?i.replace:i.push)(T,v.state,v)},[a,i,d,u,n])}function rb(){let{matches:n}=x.useContext(hr),a=n[n.length-1];return a?a.params:{}}function I2(n,a){return H2(n,a)}function H2(n,a,s,i){Zl()||ct(!1);let{navigator:l}=x.useContext(Kl),{matches:u}=x.useContext(hr),d=u[u.length-1],h=d?d.params:{};d&&d.pathname;let m=d?d.pathnameBase:"/";d&&d.route;let g=Pd(),v;if(a){var T;let C=typeof a=="string"?ys(a):a;m==="/"||(T=C.pathname)!=null&&T.startsWith(m)||ct(!1),v=C}else v=g;let S=v.pathname||"/",w=S;if(m!=="/"){let C=m.replace(/^\//,"").split("/");w="/"+S.replace(/^\//,"").split("/").slice(C.length).join("/")}let N=g2(n,{pathname:w}),E=X2(N&&N.map(C=>Object.assign({},C,{params:Object.assign({},h,C.params),pathname:lr([m,l.encodeLocation?l.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?m:lr([m,l.encodeLocation?l.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),u,s,i);return a&&E?x.createElement(Fl.Provider,{value:{location:Di({pathname:"/",search:"",hash:"",state:null,key:"default"},v),navigationType:La.Pop}},E):E}function Y2(){let n=W2(),a=U2(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),s=n instanceof Error?n.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},a),s?x.createElement("pre",{style:l},s):null,null)}const Q2=x.createElement(Y2,null);class G2 extends x.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,s){return s.location!==a.location||s.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:s.error,location:s.location,revalidation:a.revalidation||s.revalidation}}componentDidCatch(a,s){console.error("React Router caught the following error during render",a,s)}render(){return this.state.error!==void 0?x.createElement(hr.Provider,{value:this.props.routeContext},x.createElement(tb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function $2(n){let{routeContext:a,match:s,children:i}=n,l=x.useContext(Bd);return l&&l.static&&l.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=s.route.id),x.createElement(hr.Provider,{value:a},i)}function X2(n,a,s,i){var l;if(a===void 0&&(a=[]),s===void 0&&(s=null),i===void 0&&(i=null),n==null){var u;if(!s)return null;if(s.errors)n=s.matches;else if((u=i)!=null&&u.v7_partialHydration&&a.length===0&&!s.initialized&&s.matches.length>0)n=s.matches;else return null}let d=n,h=(l=s)==null?void 0:l.errors;if(h!=null){let v=d.findIndex(T=>T.route.id&&(h==null?void 0:h[T.route.id])!==void 0);v>=0||ct(!1),d=d.slice(0,Math.min(d.length,v+1))}let m=!1,g=-1;if(s&&i&&i.v7_partialHydration)for(let v=0;v<d.length;v++){let T=d[v];if((T.route.HydrateFallback||T.route.hydrateFallbackElement)&&(g=v),T.route.id){let{loaderData:S,errors:w}=s,N=T.route.loader&&S[T.route.id]===void 0&&(!w||w[T.route.id]===void 0);if(T.route.lazy||N){m=!0,g>=0?d=d.slice(0,g+1):d=[d[0]];break}}}return d.reduceRight((v,T,S)=>{let w,N=!1,E=null,C=null;s&&(w=h&&T.route.id?h[T.route.id]:void 0,E=T.route.errorElement||Q2,m&&(g<0&&S===0?(eR("route-fallback"),N=!0,C=null):g===S&&(N=!0,C=T.route.hydrateFallbackElement||null)));let j=a.concat(d.slice(0,S+1)),M=()=>{let _;return w?_=E:N?_=C:T.route.Component?_=x.createElement(T.route.Component,null):T.route.element?_=T.route.element:_=v,x.createElement($2,{match:T,routeContext:{outlet:v,matches:j,isDataRoute:s!=null},children:_})};return s&&(T.route.ErrorBoundary||T.route.errorElement||S===0)?x.createElement(G2,{location:s.location,revalidation:s.revalidation,component:E,error:w,children:M(),routeContext:{outlet:null,matches:j,isDataRoute:!0}}):M()},null)}var sb=function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n}(sb||{}),ib=function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n}(ib||{});function K2(n){let a=x.useContext(Bd);return a||ct(!1),a}function F2(n){let a=x.useContext(P2);return a||ct(!1),a}function Z2(n){let a=x.useContext(hr);return a||ct(!1),a}function ob(n){let a=Z2(),s=a.matches[a.matches.length-1];return s.route.id||ct(!1),s.route.id}function W2(){var n;let a=x.useContext(tb),s=F2(),i=ob();return a!==void 0?a:(n=s.errors)==null?void 0:n[i]}function J2(){let{router:n}=K2(sb.UseNavigateStable),a=ob(ib.UseNavigateStable),s=x.useRef(!1);return nb(()=>{s.current=!0}),x.useCallback(function(l,u){u===void 0&&(u={}),s.current&&(typeof l=="number"?n.navigate(l):n.navigate(l,Di({fromRouteId:a},u)))},[n,a])}const _y={};function eR(n,a,s){_y[n]||(_y[n]=!0)}function tR(n,a){n==null||n.v7_startTransition,n==null||n.v7_relativeSplatPath}function Ti(n){ct(!1)}function nR(n){let{basename:a="/",children:s=null,location:i,navigationType:l=La.Pop,navigator:u,static:d=!1,future:h}=n;Zl()&&ct(!1);let m=a.replace(/^\/*/,"/"),g=x.useMemo(()=>({basename:m,navigator:u,static:d,future:Di({v7_relativeSplatPath:!1},h)}),[m,h,u,d]);typeof i=="string"&&(i=ys(i));let{pathname:v="/",search:T="",hash:S="",state:w=null,key:N="default"}=i,E=x.useMemo(()=>{let C=J0(v,m);return C==null?null:{location:{pathname:C,search:T,hash:S,state:w,key:N},navigationType:l}},[m,v,T,S,w,N,l]);return E==null?null:x.createElement(Kl.Provider,{value:g},x.createElement(Fl.Provider,{children:s,value:E}))}function aR(n){let{children:a,location:s}=n;return I2(ad(a),s)}new Promise(()=>{});function ad(n,a){a===void 0&&(a=[]);let s=[];return x.Children.forEach(n,(i,l)=>{if(!x.isValidElement(i))return;let u=[...a,l];if(i.type===x.Fragment){s.push.apply(s,ad(i.props.children,u));return}i.type!==Ti&&ct(!1),!i.props.index||!i.props.children||ct(!1);let d={id:i.props.id||u.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(d.children=ad(i.props.children,u)),s.push(d)}),s}/**
* React Router DOM v6.30.1
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/const rR="6";try{window.__reactRouterVersion=rR}catch{}const sR="startTransition",jy=bd[sR];function iR(n){let{basename:a,children:s,future:i,window:l}=n,u=x.useRef();u.current==null&&(u.current=d2({window:l,v5Compat:!0}));let d=u.current,[h,m]=x.useState({action:d.action,location:d.location}),{v7_startTransition:g}=i||{},v=x.useCallback(T=>{g&&jy?jy(()=>m(T)):m(T)},[m,g]);return x.useLayoutEffect(()=>d.listen(v),[d,v]),x.useEffect(()=>tR(i),[i]),x.createElement(nR,{basename:a,children:s,location:h.location,navigationType:h.action,navigator:d,future:i})}var Dy;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(Dy||(Dy={}));var ky;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(ky||(ky={}));const oR=s0("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Mt=x.forwardRef(({className:n,variant:a,size:s,asChild:i=!1,...l},u)=>{const d=i?gS:"button";return y.jsx(d,{className:St(oR({variant:a,size:s,className:n})),ref:u,...l})});Mt.displayName="Button";function Vd(n,a){if(n==null)return{};var s={},i=Object.keys(n),l,u;for(u=0;u<i.length;u++)l=i[u],!(a.indexOf(l)>=0)&&(s[l]=n[l]);return s}var lR=["color"],cR=x.forwardRef(function(n,a){var s=n.color,i=s===void 0?"currentColor":s,l=Vd(n,lR);return x.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l,{ref:a}),x.createElement("path",{d:"M12.5 3L2.5 3.00002C1.67157 3.00002 1 3.6716 1 4.50002V9.50003C1 10.3285 1.67157 11 2.5 11H7.50003C7.63264 11 7.75982 11.0527 7.85358 11.1465L10 13.2929V11.5C10 11.2239 10.2239 11 10.5 11H12.5C13.3284 11 14 10.3285 14 9.50003V4.5C14 3.67157 13.3284 3 12.5 3ZM2.49999 2.00002L12.5 2C13.8807 2 15 3.11929 15 4.5V9.50003C15 10.8807 13.8807 12 12.5 12H11V14.5C11 14.7022 10.8782 14.8845 10.6913 14.9619C10.5045 15.0393 10.2894 14.9965 10.1464 14.8536L7.29292 12H2.5C1.11929 12 0 10.8807 0 9.50003V4.50002C0 3.11931 1.11928 2.00003 2.49999 2.00002Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),uR=["color"],fR=x.forwardRef(function(n,a){var s=n.color,i=s===void 0?"currentColor":s,l=Vd(n,uR);return x.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l,{ref:a}),x.createElement("path",{d:"M8.69667 0.0403541C8.90859 0.131038 9.03106 0.354857 8.99316 0.582235L8.0902 6.00001H12.5C12.6893 6.00001 12.8625 6.10701 12.9472 6.27641C13.0319 6.4458 13.0136 6.6485 12.8999 6.80001L6.89997 14.8C6.76167 14.9844 6.51521 15.0503 6.30328 14.9597C6.09135 14.869 5.96888 14.6452 6.00678 14.4178L6.90974 9H2.49999C2.31061 9 2.13748 8.893 2.05278 8.72361C1.96809 8.55422 1.98636 8.35151 2.09999 8.2L8.09997 0.200038C8.23828 0.0156255 8.48474 -0.0503301 8.69667 0.0403541ZM3.49999 8.00001H7.49997C7.64695 8.00001 7.78648 8.06467 7.88148 8.17682C7.97648 8.28896 8.01733 8.43723 7.99317 8.5822L7.33027 12.5596L11.5 7.00001H7.49997C7.353 7.00001 7.21347 6.93534 7.11846 6.8232C7.02346 6.71105 6.98261 6.56279 7.00678 6.41781L7.66968 2.44042L3.49999 8.00001Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),dR=["color"],hR=x.forwardRef(function(n,a){var s=n.color,i=s===void 0?"currentColor":s,l=Vd(n,dR);return x.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l,{ref:a}),x.createElement("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))});const Ly="npm i @convex-dev/agent-playground",qy=`import { definePlaygroundAPI } from "@convex-dev/agent-playground";
import { components } from "./_generated/api";
import { weatherAgent, fashionAgent } from "./example";
export const {
isApiKeyValid,
listAgents,
listUsers,
listThreads,
listMessages,
createThread,
generateText,
fetchPromptContext,
} = definePlaygroundAPI(components.agent, {
agents: [weatherAgent, fashionAgent],
});`,zy="npx convex run --component agent apiKeys:issue",Uy="npx @convex-dev/agent-playground",mR=()=>{const n=ab(),{toast:a}=xd(),s=i=>{navigator.clipboard.writeText(i),a({title:"Copied to clipboard!",duration:2e3})};return y.jsxs("div",{className:"min-h-screen antialiased",style:{backgroundColor:"#F9F7EE"},children:[y.jsx("header",{style:{backgroundColor:"#F9F7EE"},children:y.jsx("div",{className:"container mx-auto px-2 py-4",children:y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("div",{className:"flex items-center",children:y.jsx("img",{src:"/convexlogo.png",alt:"Convex",className:"h-3.5 w-auto"})}),y.jsx("div",{className:"flex items-center",children:y.jsx("nav",{className:"hidden md:flex",children:y.jsx("a",{href:"https://github.com/get-convex/agent#installation",className:"neutral-800 hover:text-gray-900",children:"Readme"})})})]})})}),y.jsxs("div",{className:"container mx-auto px-4 py-2",children:[y.jsxs("div",{className:"text-center mb-10",children:[y.jsx("h1",{className:"text-4xl font-bold mb-6 text-gray-900",children:"Agent Playground"}),y.jsxs("p",{className:"text-lg text-gray-600 max-w-3xl mx-auto leading-relaxed",children:["A powerful playground for experimenting with"," ",y.jsx("a",{href:"https://convex.dev/components/agent",className:"text-violet-900 hover:text-violet-950 font-normal hover:underline",children:"@convex-dev/agent"}),". Test your agents, browse threads, and explore message interactions in real-time."]}),y.jsx(Mt,{size:"lg",className:"mt-10 text-base px-10 py-3 bg-gray-800 hover:bg-gray-900 text-white rounded-full shadow-sm focus:ring-1 focus:ring-[#B02A5B] hover:shadow-[0_0_20px_rgba(176,42,91,0.3)] border-2 border-[#B02A5B]",onClick:()=>n("/play"),children:"Launch Playground"})]}),y.jsx("div",{className:"flex flex-col items-center mb-10",children:y.jsxs("div",{className:"grid md:grid-cols-3 gap-8 max-w-6xl",children:[y.jsxs("div",{className:"bg-white rounded-lg p-4 border text-left",style:{borderColor:"#E5E7EB"},children:[y.jsxs("div",{className:"flex items-center mb-4",children:[y.jsx("div",{className:"w-8 h-8 bg-orange-500 rounded-lg flex items-center justify-center mr-4 shadow-sm",children:y.jsx(cR,{className:"w-4 h-4 text-white"})}),y.jsx("h3",{className:"text-lg features-title text-gray-900",children:"Thread Management"})]}),y.jsx("p",{className:"text-gray-600 leading-relaxed",children:"Browse and manage user threads with ease"})]}),y.jsxs("div",{className:"bg-white rounded-lg p-4 border text-left",style:{borderColor:"#E5E7EB"},children:[y.jsxs("div",{className:"flex items-center mb-4",children:[y.jsx("div",{className:"w-8 h-8 bg-purple-600 rounded-lg flex items-center justify-center mr-4 shadow-sm",children:y.jsx(hR,{className:"w-4 h-4 text-white"})}),y.jsx("h3",{className:"text-lg features-title text-gray-900",children:"Message Analysis"})]}),y.jsx("p",{className:"text-gray-600 leading-relaxed",children:"View detailed message metadata and tool call information"})]}),y.jsxs("div",{className:"bg-white rounded-lg p-4 border text-left",style:{borderColor:"#E5E7EB"},children:[y.jsxs("div",{className:"flex items-center mb-4",children:[y.jsx("div",{className:"w-8 h-8 bg-yellow-500 rounded-lg flex items-center justify-center mr-4 shadow-sm",children:y.jsx(fR,{className:"w-4 h-4 text-white"})}),y.jsx("h3",{className:"text-lg features-title text-gray-900",children:"Context Experimentation"})]}),y.jsx("p",{className:"text-gray-600 leading-relaxed",children:"Test different context options and message interactions"})]})]})})]}),y.jsx("div",{className:"w-full bg-white border-t border-b mb-20",style:{borderColor:"#E5E7EB"},children:y.jsx("div",{className:"max-w-6xl mx-auto py-8",children:y.jsx("img",{src:"/screenshot.png",alt:"Agent Playground",className:"w-full h-auto rounded-xl"})})}),y.jsx("div",{className:"container mx-auto px-4",children:y.jsxs("div",{className:"max-w-4xl mx-auto",children:[y.jsxs("div",{className:"text-center mb-12",children:[y.jsx("h2",{className:"text-4xl font-bold mb-4 text-gray-900",children:"Getting Started"}),y.jsxs("p",{className:"text-lg text-gray-600",children:["Set up your agent playground in minutes with these simple steps. If you don't yet have a Convex project with the Agent component, check out the"," ",y.jsx("a",{href:"https://docs.convex.dev/agents",className:"text-violet-900 hover:text-violet-950 font-normal hover:underline",children:"Agent docs"})]})]}),y.jsxs("div",{className:"space-y-10",children:[y.jsxs("div",{children:[y.jsxs("div",{className:"flex items-center mb-4",children:[y.jsx("div",{className:"w-8 h-8 bg-gray-900 text-white rounded-full flex items-center justify-center text-sm font-semibold mr-4",children:"1"}),y.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:"Install the Package"})]}),y.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[y.jsx("div",{className:"bg-gray-50 px-4 py-3 border-b border-gray-200",children:y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx("div",{className:"w-3 h-3 bg-red-400 rounded-full"}),y.jsx("div",{className:"w-3 h-3 bg-yellow-400 rounded-full"}),y.jsx("div",{className:"w-3 h-3 bg-green-400 rounded-full"})]}),y.jsx("div",{className:"text-sm text-gray-500",children:"Terminal"}),y.jsx(Mt,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 hover:bg-gray-200",onClick:()=>s(Ly),children:y.jsx(ll,{className:"w-3 h-3"})})]})}),y.jsx("div",{className:"p-4",children:y.jsx("pre",{className:"text-sm text-gray-800",children:y.jsx("code",{children:Ly})})})]})]}),y.jsxs("div",{children:[y.jsxs("div",{className:"flex items-center mb-4",children:[y.jsx("div",{className:"w-8 h-8 bg-gray-900 text-white rounded-full flex items-center justify-center text-sm font-semibold mr-4",children:"2"}),y.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:"Set Up Your Playground API"})]}),y.jsxs("p",{className:"text-gray-600 mb-4",children:["Create a new file"," ",y.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded text-sm",children:"convex/playground.ts"})," ","with:"]}),y.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[y.jsx("div",{className:"bg-gray-50 px-4 py-3 border-b border-gray-200",children:y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx("div",{className:"w-3 h-3 bg-red-400 rounded-full"}),y.jsx("div",{className:"w-3 h-3 bg-yellow-400 rounded-full"}),y.jsx("div",{className:"w-3 h-3 bg-green-400 rounded-full"})]}),y.jsx("div",{className:"text-sm text-gray-500",children:"convex/playground.ts"}),y.jsx(Mt,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 hover:bg-gray-200",onClick:()=>s(qy),children:y.jsx(ll,{className:"w-3 h-3"})})]})}),y.jsx("div",{className:"p-4 overflow-x-auto",children:y.jsx("pre",{className:"text-sm text-gray-800",children:y.jsx("code",{children:qy})})})]})]}),y.jsxs("div",{children:[y.jsxs("div",{className:"flex items-center mb-4",children:[y.jsx("div",{className:"w-8 h-8 bg-gray-900 text-white rounded-full flex items-center justify-center text-sm font-semibold mr-4",children:"3"}),y.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:"Generate an API Key"})]}),y.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[y.jsx("div",{className:"bg-gray-50 px-4 py-3 border-b border-gray-200",children:y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx("div",{className:"w-3 h-3 bg-red-400 rounded-full"}),y.jsx("div",{className:"w-3 h-3 bg-yellow-400 rounded-full"}),y.jsx("div",{className:"w-3 h-3 bg-green-400 rounded-full"})]}),y.jsx("div",{className:"text-sm text-gray-500",children:"Terminal"}),y.jsx(Mt,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 hover:bg-gray-200",onClick:()=>s(zy),children:y.jsx(ll,{className:"w-3 h-3"})})]})}),y.jsx("div",{className:"p-4",children:y.jsx("pre",{className:"text-sm text-gray-800",children:y.jsx("code",{children:zy})})})]})]}),y.jsxs("div",{children:[y.jsxs("div",{className:"flex items-center mb-4",children:[y.jsx("div",{className:"w-8 h-8 bg-gray-900 text-white rounded-full flex items-center justify-center text-sm font-semibold mr-4",children:"4"}),y.jsx("h3",{className:"text-xl font-normal text-gray-900",children:"Launch the Playground"})]}),y.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[y.jsx("div",{className:"bg-gray-50 px-4 py-3 border-b border-gray-200",children:y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx("div",{className:"w-3 h-3 bg-red-400 rounded-full"}),y.jsx("div",{className:"w-3 h-3 bg-yellow-400 rounded-full"}),y.jsx("div",{className:"w-3 h-3 bg-green-400 rounded-full"})]}),y.jsx("div",{className:"text-sm text-gray-500",children:"Terminal"}),y.jsx(Mt,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 hover:bg-gray-200",onClick:()=>s(Uy),children:y.jsx(ll,{className:"w-3 h-3"})})]})}),y.jsx("div",{className:"p-4",children:y.jsx("pre",{className:"text-sm text-gray-800",children:y.jsx("code",{children:Uy})})})]})]})]}),y.jsx("div",{className:"mt-16 text-center",children:y.jsx(Mt,{size:"lg",className:"text-base px-10 py-4 bg-gray-800 hover:bg-gray-900 text-white rounded-full shadow-sm focus:ring-1 focus:ring-[#B02A5B] hover:shadow-[0_0_20px_rgba(176,42,91,0.3)] border-2 border-[#B02A5B]",onClick:()=>n("/play"),children:"Try the Playground Now"})})]})}),y.jsx("footer",{className:"bg-black mt-20",children:y.jsx("div",{className:"container mx-auto px-4 py-8",children:y.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between",children:[y.jsxs("div",{className:"text-white text-sm",children:[y.jsx("a",{href:"https://convex.dev",className:"text-white hover:text-orange-500 font-medium",children:"Convex"})," ","Agent Playground"]}),y.jsxs("div",{className:"flex items-center space-x-6 mt-4 md:mt-0",children:[y.jsx("a",{href:"https://github.com/get-convex/agent#installation",className:"text-white hover:text-gray-300 text-sm",children:"Readme"}),y.jsx("a",{href:"https://convex.dev/components/agent",className:"text-white hover:text-gray-300 text-sm",children:"Components"})]})]})})})]})},gR=()=>{const n=Pd();return x.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",n.pathname)},[n.pathname]),y.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:y.jsxs("div",{className:"text-center",children:[y.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),y.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),y.jsx("a",{href:"/",className:"text-blue-500 hover:text-blue-700 underline",children:"Return to Home"})]})})};var jn=[],ln=[],pR=Uint8Array,Mf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Jr=0,yR=Mf.length;Jr<yR;++Jr)jn[Jr]=Mf[Jr],ln[Mf.charCodeAt(Jr)]=Jr;ln[45]=62;ln[95]=63;function vR(n){var a=n.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var s=n.indexOf("=");s===-1&&(s=a);var i=s===a?0:4-s%4;return[s,i]}function bR(n,a,s){return(a+s)*3/4-s}function ki(n){var a,s=vR(n),i=s[0],l=s[1],u=new pR(bR(n,i,l)),d=0,h=l>0?i-4:i,m;for(m=0;m<h;m+=4)a=ln[n.charCodeAt(m)]<<18|ln[n.charCodeAt(m+1)]<<12|ln[n.charCodeAt(m+2)]<<6|ln[n.charCodeAt(m+3)],u[d++]=a>>16&255,u[d++]=a>>8&255,u[d++]=a&255;return l===2&&(a=ln[n.charCodeAt(m)]<<2|ln[n.charCodeAt(m+1)]>>4,u[d++]=a&255),l===1&&(a=ln[n.charCodeAt(m)]<<10|ln[n.charCodeAt(m+1)]<<4|ln[n.charCodeAt(m+2)]>>2,u[d++]=a>>8&255,u[d++]=a&255),u}function xR(n){return jn[n>>18&63]+jn[n>>12&63]+jn[n>>6&63]+jn[n&63]}function wR(n,a,s){for(var i,l=[],u=a;u<s;u+=3)i=(n[u]<<16&16711680)+(n[u+1]<<8&65280)+(n[u+2]&255),l.push(xR(i));return l.join("")}function Li(n){for(var a,s=n.length,i=s%3,l=[],u=16383,d=0,h=s-i;d<h;d+=u)l.push(wR(n,d,d+u>h?h:d+u));return i===1?(a=n[s-1],l.push(jn[a>>2]+jn[a<<4&63]+"==")):i===2&&(a=(n[s-2]<<8)+n[s-1],l.push(jn[a>>10]+jn[a>>4&63]+jn[a<<2&63]+"=")),l.join("")}function ra(n){if(n===void 0)return{};if(!lb(n))throw new Error(`The arguments to a Convex function must be an object. Received: ${n}`);return n}function SR(n){if(typeof n>"u")throw new Error("Client created with undefined deployment address. If you used an environment variable, check that it's set.");if(typeof n!="string")throw new Error(`Invalid deployment address: found ${n}".`);if(!(n.startsWith("http:")||n.startsWith("https:")))throw new Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${n}".`);try{new URL(n)}catch{throw new Error(`Invalid deployment address: "${n}" is not a valid URL. If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}if(n.endsWith(".convex.site"))throw new Error(`Invalid deployment address: "${n}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}function lb(n){var l;const a=typeof n=="object",s=Object.getPrototypeOf(n),i=s===null||s===Object.prototype||((l=s==null?void 0:s.constructor)==null?void 0:l.name)==="Object";return a&&i}const cb=!0,fs=BigInt("-9223372036854775808"),Id=BigInt("9223372036854775807"),rd=BigInt("0"),TR=BigInt("8"),ER=BigInt("256");function ub(n){return Number.isNaN(n)||!Number.isFinite(n)||Object.is(n,-0)}function CR(n){n<rd&&(n-=fs+fs);let a=n.toString(16);a.length%2===1&&(a="0"+a);const s=new Uint8Array(new ArrayBuffer(8));let i=0;for(const l of a.match(/.{2}/g).reverse())s.set([parseInt(l,16)],i++),n>>=TR;return Li(s)}function RR(n){const a=ki(n);if(a.byteLength!==8)throw new Error(`Received ${a.byteLength} bytes, expected 8 for $integer`);let s=rd,i=rd;for(const l of a)s+=BigInt(l)*ER**i,i++;return s>Id&&(s+=fs+fs),s}function NR(n){if(n<fs||Id<n)throw new Error(`BigInt ${n} does not fit into a 64-bit signed integer.`);const a=new ArrayBuffer(8);return new DataView(a).setBigInt64(0,n,!0),Li(new Uint8Array(a))}function AR(n){const a=ki(n);if(a.byteLength!==8)throw new Error(`Received ${a.byteLength} bytes, expected 8 for $integer`);return new DataView(a.buffer).getBigInt64(0,!0)}const OR=DataView.prototype.setBigInt64?NR:CR,MR=DataView.prototype.getBigInt64?AR:RR,By=1024;function fb(n){if(n.length>By)throw new Error(`Field name ${n} exceeds maximum field name length ${By}.`);if(n.startsWith("$"))throw new Error(`Field name ${n} starts with a '$', which is reserved.`);for(let a=0;a<n.length;a+=1){const s=n.charCodeAt(a);if(s<32||s>=127)throw new Error(`Field name ${n} has invalid character '${n[a]}': Field names can only contain non-control ASCII characters`)}}function ds(n){if(n===null||typeof n=="boolean"||typeof n=="number"||typeof n=="string")return n;if(Array.isArray(n))return n.map(i=>ds(i));if(typeof n!="object")throw new Error(`Unexpected type of ${n}`);const a=Object.entries(n);if(a.length===1){const i=a[0][0];if(i==="$bytes"){if(typeof n.$bytes!="string")throw new Error(`Malformed $bytes field on ${n}`);return ki(n.$bytes).buffer}if(i==="$integer"){if(typeof n.$integer!="string")throw new Error(`Malformed $integer field on ${n}`);return MR(n.$integer)}if(i==="$float"){if(typeof n.$float!="string")throw new Error(`Malformed $float field on ${n}`);const l=ki(n.$float);if(l.byteLength!==8)throw new Error(`Received ${l.byteLength} bytes, expected 8 for $float`);const d=new DataView(l.buffer).getFloat64(0,cb);if(!ub(d))throw new Error(`Float ${d} should be encoded as a number`);return d}if(i==="$set")throw new Error("Received a Set which is no longer supported as a Convex type.");if(i==="$map")throw new Error("Received a Map which is no longer supported as a Convex type.")}const s={};for(const[i,l]of Object.entries(n))fb(i),s[i]=ds(l);return s}function Ni(n){return JSON.stringify(n,(a,s)=>s===void 0?"undefined":typeof s=="bigint"?`${s.toString()}n`:s)}function sd(n,a,s,i){var d;if(n===void 0){const h=s&&` (present at path ${s} in original object ${Ni(a)})`;throw new Error(`undefined is not a valid Convex value${h}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(n===null)return n;if(typeof n=="bigint"){if(n<fs||Id<n)throw new Error(`BigInt ${n} does not fit into a 64-bit signed integer.`);return{$integer:OR(n)}}if(typeof n=="number")if(ub(n)){const h=new ArrayBuffer(8);return new DataView(h).setFloat64(0,n,cb),{$float:Li(new Uint8Array(h))}}else return n;if(typeof n=="boolean"||typeof n=="string")return n;if(n instanceof ArrayBuffer)return{$bytes:Li(new Uint8Array(n))};if(Array.isArray(n))return n.map((h,m)=>sd(h,a,s+`[${m}]`));if(n instanceof Set)throw new Error(_f(s,"Set",[...n],a));if(n instanceof Map)throw new Error(_f(s,"Map",[...n],a));if(!lb(n)){const h=(d=n==null?void 0:n.constructor)==null?void 0:d.name,m=h?`${h} `:"";throw new Error(_f(s,m,n,a))}const l={},u=Object.entries(n);u.sort(([h,m],[g,v])=>h===g?0:h<g?-1:1);for(const[h,m]of u)m!==void 0&&(fb(h),l[h]=sd(m,a,s+`.${h}`));return l}function _f(n,a,s,i){return n?`${a}${Ni(s)} is not a supported Convex type (present at path ${n} in original object ${Ni(i)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${a}${Ni(s)} is not a supported Convex type.`}function _t(n){return sd(n,n,"")}var _R=Object.defineProperty,jR=(n,a,s)=>a in n?_R(n,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[a]=s,Ke=(n,a,s)=>jR(n,typeof a!="symbol"?a+"":a,s);class Ft{constructor({isOptional:a}){Ke(this,"type"),Ke(this,"fieldPaths"),Ke(this,"isOptional"),Ke(this,"isConvexValidator"),this.isOptional=a,this.isConvexValidator=!0}get optional(){return this.isOptional==="optional"}}class Hd extends Ft{constructor({isOptional:a,tableName:s}){if(super({isOptional:a}),Ke(this,"tableName"),Ke(this,"kind","id"),typeof s!="string")throw new Error("v.id(tableName) requires a string");this.tableName=s}get json(){return{type:"id",tableName:this.tableName}}asOptional(){return new Hd({isOptional:"optional",tableName:this.tableName})}}class Ol extends Ft{constructor(){super(...arguments),Ke(this,"kind","float64")}get json(){return{type:"number"}}asOptional(){return new Ol({isOptional:"optional"})}}class Ml extends Ft{constructor(){super(...arguments),Ke(this,"kind","int64")}get json(){return{type:"bigint"}}asOptional(){return new Ml({isOptional:"optional"})}}class Yd extends Ft{constructor(){super(...arguments),Ke(this,"kind","boolean")}get json(){return{type:this.kind}}asOptional(){return new Yd({isOptional:"optional"})}}class Qd extends Ft{constructor(){super(...arguments),Ke(this,"kind","bytes")}get json(){return{type:this.kind}}asOptional(){return new Qd({isOptional:"optional"})}}class Gd extends Ft{constructor(){super(...arguments),Ke(this,"kind","string")}get json(){return{type:this.kind}}asOptional(){return new Gd({isOptional:"optional"})}}class $d extends Ft{constructor(){super(...arguments),Ke(this,"kind","null")}get json(){return{type:this.kind}}asOptional(){return new $d({isOptional:"optional"})}}class Xd extends Ft{constructor(){super(...arguments),Ke(this,"kind","any")}get json(){return{type:this.kind}}asOptional(){return new Xd({isOptional:"optional"})}}class Kd extends Ft{constructor({isOptional:a,fields:s}){super({isOptional:a}),Ke(this,"fields"),Ke(this,"kind","object"),globalThis.Object.values(s).forEach(i=>{if(!i.isConvexValidator)throw new Error("v.object() entries must be valiators")}),this.fields=s}get json(){return{type:this.kind,value:globalThis.Object.fromEntries(globalThis.Object.entries(this.fields).map(([a,s])=>[a,{fieldType:s.json,optional:s.isOptional==="optional"}]))}}asOptional(){return new Kd({isOptional:"optional",fields:this.fields})}}class Fd extends Ft{constructor({isOptional:a,value:s}){if(super({isOptional:a}),Ke(this,"value"),Ke(this,"kind","literal"),typeof s!="string"&&typeof s!="boolean"&&typeof s!="number"&&typeof s!="bigint")throw new Error("v.literal(value) must be a string, number, or boolean");this.value=s}get json(){return{type:this.kind,value:_t(this.value)}}asOptional(){return new Fd({isOptional:"optional",value:this.value})}}class Zd extends Ft{constructor({isOptional:a,element:s}){super({isOptional:a}),Ke(this,"element"),Ke(this,"kind","array"),this.element=s}get json(){return{type:this.kind,value:this.element.json}}asOptional(){return new Zd({isOptional:"optional",element:this.element})}}class Wd extends Ft{constructor({isOptional:a,key:s,value:i}){if(super({isOptional:a}),Ke(this,"key"),Ke(this,"value"),Ke(this,"kind","record"),s.isOptional==="optional")throw new Error("Record validator cannot have optional keys");if(i.isOptional==="optional")throw new Error("Record validator cannot have optional values");if(!s.isConvexValidator||!i.isConvexValidator)throw new Error("Key and value of v.record() but be validators");this.key=s,this.value=i}get json(){return{type:this.kind,keys:this.key.json,values:{fieldType:this.value.json,optional:!1}}}asOptional(){return new Wd({isOptional:"optional",key:this.key,value:this.value})}}class Jd extends Ft{constructor({isOptional:a,members:s}){super({isOptional:a}),Ke(this,"members"),Ke(this,"kind","union"),s.forEach(i=>{if(!i.isConvexValidator)throw new Error("All members of v.union() must be validators")}),this.members=s}get json(){return{type:this.kind,value:this.members.map(a=>a.json)}}asOptional(){return new Jd({isOptional:"optional",members:this.members})}}function DR(n){return!!n.isConvexValidator}const p={id:n=>new Hd({isOptional:"required",tableName:n}),null:()=>new $d({isOptional:"required"}),number:()=>new Ol({isOptional:"required"}),float64:()=>new Ol({isOptional:"required"}),bigint:()=>new Ml({isOptional:"required"}),int64:()=>new Ml({isOptional:"required"}),boolean:()=>new Yd({isOptional:"required"}),string:()=>new Gd({isOptional:"required"}),bytes:()=>new Qd({isOptional:"required"}),literal:n=>new Fd({isOptional:"required",value:n}),array:n=>new Zd({isOptional:"required",element:n}),object:n=>new Kd({isOptional:"required",fields:n}),record:(n,a)=>new Wd({isOptional:"required",key:n,value:a}),union:(...n)=>new Jd({isOptional:"required",members:n}),any:()=>new Xd({isOptional:"required"}),optional:n=>n.asOptional()};var kR=Object.defineProperty,LR=(n,a,s)=>a in n?kR(n,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[a]=s,jf=(n,a,s)=>LR(n,typeof a!="symbol"?a+"":a,s),Py,Vy;const qR=Symbol.for("ConvexError");class qi extends(Vy=Error,Py=qR,Vy){constructor(a){super(typeof a=="string"?a:Ni(a)),jf(this,"name","ConvexError"),jf(this,"data"),jf(this,Py,!0),this.data=a}}const Iy="1.25.4";var zR=Object.defineProperty,UR=(n,a,s)=>a in n?zR(n,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[a]=s,Hy=(n,a,s)=>UR(n,typeof a!="symbol"?a+"":a,s);const BR="color:rgb(0, 145, 255)";function db(n){switch(n){case"query":return"Q";case"mutation":return"M";case"action":return"A";case"any":return"?"}}class hb{constructor(a){Hy(this,"_onLogLineFuncs"),Hy(this,"_verbose"),this._onLogLineFuncs={},this._verbose=a.verbose}addLogLineListener(a){let s=Math.random().toString(36).substring(2,15);for(let i=0;i<10&&this._onLogLineFuncs[s]!==void 0;i++)s=Math.random().toString(36).substring(2,15);return this._onLogLineFuncs[s]=a,()=>{delete this._onLogLineFuncs[s]}}logVerbose(...a){if(this._verbose)for(const s of Object.values(this._onLogLineFuncs))s("debug",`${new Date().toISOString()}`,...a)}log(...a){for(const s of Object.values(this._onLogLineFuncs))s("info",...a)}warn(...a){for(const s of Object.values(this._onLogLineFuncs))s("warn",...a)}error(...a){for(const s of Object.values(this._onLogLineFuncs))s("error",...a)}}function mb(n){const a=new hb(n);return a.addLogLineListener((s,...i)=>{switch(s){case"debug":console.debug(...i);break;case"info":console.log(...i);break;case"warn":console.warn(...i);break;case"error":console.error(...i);break;default:console.log(...i)}}),a}function gb(n){return new hb(n)}function _l(n,a,s,i,l){const u=db(s);if(typeof l=="object"&&(l=`ConvexError ${JSON.stringify(l.errorData,null,2)}`),a==="info"){const d=l.match(/^\[.*?\] /);if(d===null){n.error(`[CONVEX ${u}(${i})] Could not parse console.log`);return}const h=l.slice(1,d[0].length-2),m=l.slice(d[0].length);n.log(`%c[CONVEX ${u}(${i})] [${h}]`,BR,m)}else n.error(`[CONVEX ${u}(${i})] ${l}`)}function PR(n,a){const s=`[CONVEX FATAL ERROR] ${a}`;return n.error(s),new Error(s)}function ss(n,a,s){return`[CONVEX ${db(n)}(${a})] ${s.errorMessage}
Called by client`}function id(n,a){return a.data=n.errorData,a}function jl(n){const a=n.split(":");let s,i;return a.length===1?(s=a[0],i="default"):(s=a.slice(0,a.length-1).join(":"),i=a[a.length-1]),s.endsWith(".js")&&(s=s.slice(0,-3)),`${s}:${i}`}function cr(n,a){return JSON.stringify({udfPath:jl(n),args:_t(a)})}var VR=Object.defineProperty,IR=(n,a,s)=>a in n?VR(n,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[a]=s,Mn=(n,a,s)=>IR(n,typeof a!="symbol"?a+"":a,s);class HR{constructor(){Mn(this,"nextQueryId"),Mn(this,"querySetVersion"),Mn(this,"querySet"),Mn(this,"queryIdToToken"),Mn(this,"identityVersion"),Mn(this,"auth"),Mn(this,"outstandingQueriesOlderThanRestart"),Mn(this,"outstandingAuthOlderThanRestart"),Mn(this,"paused"),Mn(this,"pendingQuerySetModifications"),this.nextQueryId=0,this.querySetVersion=0,this.identityVersion=0,this.querySet=new Map,this.queryIdToToken=new Map,this.outstandingQueriesOlderThanRestart=new Set,this.outstandingAuthOlderThanRestart=!1,this.paused=!1,this.pendingQuerySetModifications=new Map}hasSyncedPastLastReconnect(){return this.outstandingQueriesOlderThanRestart.size===0&&!this.outstandingAuthOlderThanRestart}markAuthCompletion(){this.outstandingAuthOlderThanRestart=!1}subscribe(a,s,i,l){const u=jl(a),d=cr(u,s),h=this.querySet.get(d);if(h!==void 0)return h.numSubscribers+=1,{queryToken:d,modification:null,unsubscribe:()=>this.removeSubscriber(d)};{const m=this.nextQueryId++,g={id:m,canonicalizedUdfPath:u,args:s,numSubscribers:1,journal:i,componentPath:l};this.querySet.set(d,g),this.queryIdToToken.set(m,d);const v=this.querySetVersion,T=this.querySetVersion+1,S={type:"Add",queryId:m,udfPath:u,args:[_t(s)],journal:i,componentPath:l};return this.paused?this.pendingQuerySetModifications.set(m,S):this.querySetVersion=T,{queryToken:d,modification:{type:"ModifyQuerySet",baseVersion:v,newVersion:T,modifications:[S]},unsubscribe:()=>this.removeSubscriber(d)}}}transition(a){for(const s of a.modifications)switch(s.type){case"QueryUpdated":case"QueryFailed":{this.outstandingQueriesOlderThanRestart.delete(s.queryId);const i=s.journal;if(i!==void 0){const l=this.queryIdToToken.get(s.queryId);l!==void 0&&(this.querySet.get(l).journal=i)}break}case"QueryRemoved":{this.outstandingQueriesOlderThanRestart.delete(s.queryId);break}default:throw new Error(`Invalid modification ${s.type}`)}}queryId(a,s){const i=jl(a),l=cr(i,s),u=this.querySet.get(l);return u!==void 0?u.id:null}isCurrentOrNewerAuthVersion(a){return a>=this.identityVersion}setAuth(a){this.auth={tokenType:"User",value:a};const s=this.identityVersion;return this.paused||(this.identityVersion=s+1),{type:"Authenticate",baseVersion:s,...this.auth}}setAdminAuth(a,s){const i={tokenType:"Admin",value:a,impersonating:s};this.auth=i;const l=this.identityVersion;return this.paused||(this.identityVersion=l+1),{type:"Authenticate",baseVersion:l,...i}}clearAuth(){this.auth=void 0,this.markAuthCompletion();const a=this.identityVersion;return this.paused||(this.identityVersion=a+1),{type:"Authenticate",tokenType:"None",baseVersion:a}}hasAuth(){return!!this.auth}isNewAuth(a){var s;return((s=this.auth)==null?void 0:s.value)!==a}queryPath(a){const s=this.queryIdToToken.get(a);return s?this.querySet.get(s).canonicalizedUdfPath:null}queryArgs(a){const s=this.queryIdToToken.get(a);return s?this.querySet.get(s).args:null}queryToken(a){return this.queryIdToToken.get(a)??null}queryJournal(a){var s;return(s=this.querySet.get(a))==null?void 0:s.journal}restart(a){this.unpause(),this.outstandingQueriesOlderThanRestart.clear();const s=[];for(const u of this.querySet.values()){const d={type:"Add",queryId:u.id,udfPath:u.canonicalizedUdfPath,args:[_t(u.args)],journal:u.journal,componentPath:u.componentPath};s.push(d),a.has(u.id)||this.outstandingQueriesOlderThanRestart.add(u.id)}this.querySetVersion=1;const i={type:"ModifyQuerySet",baseVersion:0,newVersion:1,modifications:s};if(!this.auth)return this.identityVersion=0,[i,void 0];this.outstandingAuthOlderThanRestart=!0;const l={type:"Authenticate",baseVersion:0,...this.auth};return this.identityVersion=1,[i,l]}pause(){this.paused=!0}resume(){const a=this.pendingQuerySetModifications.size>0?{type:"ModifyQuerySet",baseVersion:this.querySetVersion,newVersion:++this.querySetVersion,modifications:Array.from(this.pendingQuerySetModifications.values())}:void 0,s=this.auth!==void 0?{type:"Authenticate",baseVersion:this.identityVersion++,...this.auth}:void 0;return this.unpause(),[a,s]}unpause(){this.paused=!1,this.pendingQuerySetModifications.clear()}removeSubscriber(a){const s=this.querySet.get(a);if(s.numSubscribers>1)return s.numSubscribers-=1,null;{this.querySet.delete(a),this.queryIdToToken.delete(s.id),this.outstandingQueriesOlderThanRestart.delete(s.id);const i=this.querySetVersion,l=this.querySetVersion+1,u={type:"Remove",queryId:s.id};return this.paused?this.pendingQuerySetModifications.has(s.id)?this.pendingQuerySetModifications.delete(s.id):this.pendingQuerySetModifications.set(s.id,u):this.querySetVersion=l,{type:"ModifyQuerySet",baseVersion:i,newVersion:l,modifications:[u]}}}}var YR=Object.defineProperty,QR=(n,a,s)=>a in n?YR(n,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[a]=s,fl=(n,a,s)=>QR(n,typeof a!="symbol"?a+"":a,s);class GR{constructor(a,s){this.logger=a,this.markConnectionStateDirty=s,fl(this,"inflightRequests"),fl(this,"requestsOlderThanRestart"),fl(this,"inflightMutationsCount",0),fl(this,"inflightActionsCount",0),this.inflightRequests=new Map,this.requestsOlderThanRestart=new Set}request(a,s){const i=new Promise(l=>{const u=s?"Requested":"NotSent";this.inflightRequests.set(a.requestId,{message:a,status:{status:u,requestedAt:new Date,onResult:l}}),a.type==="Mutation"?this.inflightMutationsCount++:a.type==="Action"&&this.inflightActionsCount++});return this.markConnectionStateDirty(),i}onResponse(a){const s=this.inflightRequests.get(a.requestId);if(s===void 0||s.status.status==="Completed")return null;const i=s.message.type==="Mutation"?"mutation":"action",l=s.message.udfPath;for(const m of a.logLines)_l(this.logger,"info",i,l,m);const u=s.status;let d,h;if(a.success)d={success:!0,logLines:a.logLines,value:ds(a.result)},h=()=>u.onResult(d);else{const m=a.result,{errorData:g}=a;_l(this.logger,"error",i,l,m),d={success:!1,errorMessage:m,errorData:g!==void 0?ds(g):void 0,logLines:a.logLines},h=()=>u.onResult(d)}return a.type==="ActionResponse"||!a.success?(h(),this.inflightRequests.delete(a.requestId),this.requestsOlderThanRestart.delete(a.requestId),s.message.type==="Action"?this.inflightActionsCount--:s.message.type==="Mutation"&&this.inflightMutationsCount--,this.markConnectionStateDirty(),{requestId:a.requestId,result:d}):(s.status={status:"Completed",result:d,ts:a.ts,onResolve:h},null)}removeCompleted(a){const s=new Map;for(const[i,l]of this.inflightRequests.entries()){const u=l.status;u.status==="Completed"&&u.ts.lessThanOrEqual(a)&&(u.onResolve(),s.set(i,u.result),l.message.type==="Mutation"?this.inflightMutationsCount--:l.message.type==="Action"&&this.inflightActionsCount--,this.inflightRequests.delete(i),this.requestsOlderThanRestart.delete(i))}return s.size>0&&this.markConnectionStateDirty(),s}restart(){this.requestsOlderThanRestart=new Set(this.inflightRequests.keys());const a=[];for(const[s,i]of this.inflightRequests){if(i.status.status==="NotSent"){i.status.status="Requested",a.push(i.message);continue}if(i.message.type==="Mutation")a.push(i.message);else if(i.message.type==="Action"){if(this.inflightRequests.delete(s),this.requestsOlderThanRestart.delete(s),this.inflightActionsCount--,i.status.status==="Completed")throw new Error("Action should never be in 'Completed' state");i.status.onResult({success:!1,errorMessage:"Connection lost while action was in flight",logLines:[]})}}return this.markConnectionStateDirty(),a}resume(){const a=[];for(const[,s]of this.inflightRequests)if(s.status.status==="NotSent"){s.status.status="Requested",a.push(s.message);continue}return a}hasIncompleteRequests(){for(const a of this.inflightRequests.values())if(a.status.status==="Requested")return!0;return!1}hasInflightRequests(){return this.inflightRequests.size>0}hasSyncedPastLastReconnect(){return this.requestsOlderThanRestart.size===0}timeOfOldestInflightRequest(){if(this.inflightRequests.size===0)return null;let a=Date.now();for(const s of this.inflightRequests.values())s.status.status!=="Completed"&&s.status.requestedAt.getTime()<a&&(a=s.status.requestedAt.getTime());return new Date(a)}inflightMutations(){return this.inflightMutationsCount}inflightActions(){return this.inflightActionsCount}}const zi=Symbol.for("functionName"),$R=Symbol.for("toReferencePath");function XR(n){return n[$R]??null}function KR(n){return n.startsWith("function://")}function FR(n){let a;if(typeof n=="string")KR(n)?a={functionHandle:n}:a={name:n};else if(n[zi])a={name:n[zi]};else{const s=XR(n);if(!s)throw new Error(`${n} is not a functionReference`);a={reference:s}}return a}function pt(n){const a=FR(n);if(a.name===void 0)throw a.functionHandle!==void 0?new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${a.functionHandle}`):a.reference!==void 0?new Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${a.reference}`):new Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(a)}`);if(typeof n=="string")return n;const s=n[zi];if(!s)throw new Error(`${n} is not a functionReference`);return s}function pb(n){return{[zi]:n}}function yb(n=[]){const a={get(s,i){if(typeof i=="string"){const l=[...n,i];return yb(l)}else if(i===zi){if(n.length<2){const d=["api",...n].join(".");throw new Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${d}\``)}const l=n.slice(0,-1).join("/"),u=n[n.length-1];return u==="default"?l:l+":"+u}else return i===Symbol.toStringTag?"FunctionReference":void 0}};return new Proxy({},a)}const vb=yb();var ZR=Object.defineProperty,WR=(n,a,s)=>a in n?ZR(n,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[a]=s,Dl=(n,a,s)=>WR(n,typeof a!="symbol"?a+"":a,s);class Ui{constructor(a){Dl(this,"queryResults"),Dl(this,"modifiedQueries"),this.queryResults=a,this.modifiedQueries=[]}getQuery(a,...s){const i=ra(s[0]),l=pt(a),u=this.queryResults.get(cr(l,i));if(u!==void 0)return Ui.queryValue(u.result)}getAllQueries(a){const s=[],i=pt(a);for(const l of this.queryResults.values())l.udfPath===jl(i)&&s.push({args:l.args,value:Ui.queryValue(l.result)});return s}setQuery(a,s,i){const l=ra(s),u=pt(a),d=cr(u,l);let h;i===void 0?h=void 0:h={success:!0,value:i,logLines:[]};const m={udfPath:u,args:l,result:h};this.queryResults.set(d,m),this.modifiedQueries.push(d)}static queryValue(a){if(a!==void 0)return a.success?a.value:void 0}}class JR{constructor(){Dl(this,"queryResults"),Dl(this,"optimisticUpdates"),this.queryResults=new Map,this.optimisticUpdates=[]}ingestQueryResultsFromServer(a,s){this.optimisticUpdates=this.optimisticUpdates.filter(d=>!s.has(d.mutationId));const i=this.queryResults;this.queryResults=new Map(a);const l=new Ui(this.queryResults);for(const d of this.optimisticUpdates)d.update(l);const u=[];for(const[d,h]of this.queryResults){const m=i.get(d);(m===void 0||m.result!==h.result)&&u.push(d)}return u}applyOptimisticUpdate(a,s){this.optimisticUpdates.push({update:a,mutationId:s});const i=new Ui(this.queryResults);return a(i),i.modifiedQueries}rawQueryResult(a){return this.queryResults.get(a)}queryResult(a){const s=this.queryResults.get(a);if(s===void 0)return;const i=s.result;if(i!==void 0){if(i.success)return i.value;throw i.errorData!==void 0?id(i,new qi(ss("query",s.udfPath,i))):new Error(ss("query",s.udfPath,i))}}hasQueryResult(a){return this.queryResults.get(a)!==void 0}queryLogs(a){var i;const s=this.queryResults.get(a);return(i=s==null?void 0:s.result)==null?void 0:i.logLines}}var eN=Object.defineProperty,tN=(n,a,s)=>a in n?eN(n,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[a]=s,Df=(n,a,s)=>tN(n,typeof a!="symbol"?a+"":a,s);class $t{constructor(a,s){Df(this,"low"),Df(this,"high"),Df(this,"__isUnsignedLong__"),this.low=a|0,this.high=s|0,this.__isUnsignedLong__=!0}static isLong(a){return(a&&a.__isUnsignedLong__)===!0}static fromBytesLE(a){return new $t(a[0]|a[1]<<8|a[2]<<16|a[3]<<24,a[4]|a[5]<<8|a[6]<<16|a[7]<<24)}toBytesLE(){const a=this.high,s=this.low;return[s&255,s>>>8&255,s>>>16&255,s>>>24,a&255,a>>>8&255,a>>>16&255,a>>>24]}static fromNumber(a){return isNaN(a)||a<0?Yy:a>=nN?aN:new $t(a%Ai|0,a/Ai|0)}toString(){return(BigInt(this.high)*BigInt(Ai)+BigInt(this.low)).toString()}equals(a){return $t.isLong(a)||(a=$t.fromValue(a)),this.high>>>31===1&&a.high>>>31===1?!1:this.high===a.high&&this.low===a.low}notEquals(a){return!this.equals(a)}comp(a){return $t.isLong(a)||(a=$t.fromValue(a)),this.equals(a)?0:a.high>>>0>this.high>>>0||a.high===this.high&&a.low>>>0>this.low>>>0?-1:1}lessThanOrEqual(a){return this.comp(a)<=0}static fromValue(a){return typeof a=="number"?$t.fromNumber(a):new $t(a.low,a.high)}}const Yy=new $t(0,0),Qy=65536,Ai=Qy*Qy,nN=Ai*Ai,aN=new $t(-1,-1);var rN=Object.defineProperty,sN=(n,a,s)=>a in n?rN(n,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[a]=s,dl=(n,a,s)=>sN(n,typeof a!="symbol"?a+"":a,s);class Gy{constructor(a,s){dl(this,"version"),dl(this,"remoteQuerySet"),dl(this,"queryPath"),dl(this,"logger"),this.version={querySet:0,ts:$t.fromNumber(0),identity:0},this.remoteQuerySet=new Map,this.queryPath=a,this.logger=s}transition(a){const s=a.startVersion;if(this.version.querySet!==s.querySet||this.version.ts.notEquals(s.ts)||this.version.identity!==s.identity)throw new Error(`Invalid start version: ${s.ts.toString()}:${s.querySet}`);for(const i of a.modifications)switch(i.type){case"QueryUpdated":{const l=this.queryPath(i.queryId);if(l)for(const d of i.logLines)_l(this.logger,"info","query",l,d);const u=ds(i.value??null);this.remoteQuerySet.set(i.queryId,{success:!0,value:u,logLines:i.logLines});break}case"QueryFailed":{const l=this.queryPath(i.queryId);if(l)for(const d of i.logLines)_l(this.logger,"info","query",l,d);const{errorData:u}=i;this.remoteQuerySet.set(i.queryId,{success:!1,errorMessage:i.errorMessage,errorData:u!==void 0?ds(u):void 0,logLines:i.logLines});break}case"QueryRemoved":{this.remoteQuerySet.delete(i.queryId);break}default:throw new Error(`Invalid modification ${i.type}`)}this.version=a.endVersion}remoteQueryResults(){return this.remoteQuerySet}timestamp(){return this.version.ts}}function kf(n){const a=ki(n);return $t.fromBytesLE(Array.from(a))}function iN(n){const a=new Uint8Array(n.toBytesLE());return Li(a)}function oN(n){switch(n.type){case"FatalError":case"AuthError":case"ActionResponse":case"Ping":return{...n};case"MutationResponse":return n.success?{...n,ts:kf(n.ts)}:{...n};case"Transition":return{...n,startVersion:{...n.startVersion,ts:kf(n.startVersion.ts)},endVersion:{...n.endVersion,ts:kf(n.endVersion.ts)}}}}function lN(n){switch(n.type){case"Authenticate":case"ModifyQuerySet":case"Mutation":case"Action":case"Event":return{...n};case"Connect":return n.maxObservedTimestamp!==void 0?{...n,maxObservedTimestamp:iN(n.maxObservedTimestamp)}:{...n,maxObservedTimestamp:void 0}}}var cN=Object.defineProperty,uN=(n,a,s)=>a in n?cN(n,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[a]=s,Rt=(n,a,s)=>uN(n,typeof a!="symbol"?a+"":a,s);const fN=1e3,dN=1001,hN=1005,mN=4040,bb={InternalServerError:{timeout:1e3},SubscriptionsWorkerFullError:{timeout:3e3},TooManyConcurrentRequests:{timeout:3e3},CommitterFullError:{timeout:3e3},AwsTooManyRequestsException:{timeout:3e3},ExecuteFullError:{timeout:3e3},SystemTimeoutError:{timeout:3e3},ExpiredInQueue:{timeout:3e3},VectorIndexesUnavailable:{timeout:1e3},SearchIndexesUnavailable:{timeout:1e3},VectorIndexTooLarge:{timeout:3e3},SearchIndexTooLarge:{timeout:3e3},TooManyWritesInTimePeriod:{timeout:3e3}};function gN(n){if(n===void 0)return"Unknown";for(const a of Object.keys(bb))if(n.startsWith(a))return a;return"Unknown"}class pN{constructor(a,s,i,l,u){this.markConnectionStateDirty=u,Rt(this,"socket"),Rt(this,"connectionCount"),Rt(this,"_hasEverConnected",!1),Rt(this,"lastCloseReason"),Rt(this,"defaultInitialBackoff"),Rt(this,"maxBackoff"),Rt(this,"retries"),Rt(this,"serverInactivityThreshold"),Rt(this,"reconnectDueToServerInactivityTimeout"),Rt(this,"uri"),Rt(this,"onOpen"),Rt(this,"onResume"),Rt(this,"onMessage"),Rt(this,"webSocketConstructor"),Rt(this,"logger"),Rt(this,"onServerDisconnectError"),this.webSocketConstructor=i,this.socket={state:"disconnected"},this.connectionCount=0,this.lastCloseReason="InitialConnect",this.defaultInitialBackoff=1e3,this.maxBackoff=16e3,this.retries=0,this.serverInactivityThreshold=3e4,this.reconnectDueToServerInactivityTimeout=null,this.uri=a,this.onOpen=s.onOpen,this.onResume=s.onResume,this.onMessage=s.onMessage,this.onServerDisconnectError=s.onServerDisconnectError,this.logger=l,this.connect()}setSocketState(a){this.socket=a,this._logVerbose(`socket state changed: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}`),this.markConnectionStateDirty()}connect(){if(this.socket.state==="terminated")return;if(this.socket.state!=="disconnected"&&this.socket.state!=="stopped")throw new Error("Didn't start connection from disconnected state: "+this.socket.state);const a=new this.webSocketConstructor(this.uri);this._logVerbose("constructed WebSocket"),this.setSocketState({state:"connecting",ws:a,paused:"no"}),this.resetServerInactivityTimeout(),a.onopen=()=>{if(this.logger.logVerbose("begin ws.onopen"),this.socket.state!=="connecting")throw new Error("onopen called with socket not in connecting state");this.setSocketState({state:"ready",ws:a,paused:this.socket.paused==="yes"?"uninitialized":"no"}),this.resetServerInactivityTimeout(),this.socket.paused==="no"&&(this._hasEverConnected=!0,this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason})),this.lastCloseReason!=="InitialConnect"&&this.logger.log("WebSocket reconnected"),this.connectionCount+=1,this.lastCloseReason=null},a.onerror=s=>{const i=s.message;this.logger.log(`WebSocket error: ${i}`)},a.onmessage=s=>{this.resetServerInactivityTimeout();const i=oN(JSON.parse(s.data));this._logVerbose(`received ws message with type ${i.type}`),this.onMessage(i).hasSyncedPastLastReconnect&&(this.retries=0,this.markConnectionStateDirty())},a.onclose=s=>{if(this._logVerbose("begin ws.onclose"),this.lastCloseReason===null&&(this.lastCloseReason=s.reason??"OnCloseInvoked"),s.code!==fN&&s.code!==dN&&s.code!==hN&&s.code!==mN){let l=`WebSocket closed with code ${s.code}`;s.reason&&(l+=`: ${s.reason}`),this.logger.log(l),this.onServerDisconnectError&&s.reason&&this.onServerDisconnectError(l)}const i=gN(s.reason);this.scheduleReconnect(i)}}socketState(){return this.socket.state}sendMessage(a){const s={type:a.type,...a.type==="Authenticate"&&a.tokenType==="User"?{value:`...${a.value.slice(-7)}`}:{}};if(this.socket.state==="ready"&&this.socket.paused==="no"){const i=lN(a),l=JSON.stringify(i);try{this.socket.ws.send(l)}catch(u){this.logger.log(`Failed to send message on WebSocket, reconnecting: ${u}`),this.closeAndReconnect("FailedToSendMessage")}return this._logVerbose(`sent message with type ${a.type}: ${JSON.stringify(s)}`),!0}return this._logVerbose(`message not sent (socket state: ${this.socket.state}, paused: ${"paused"in this.socket?this.socket.paused:void 0}): ${JSON.stringify(s)}`),!1}resetServerInactivityTimeout(){this.socket.state!=="terminated"&&(this.reconnectDueToServerInactivityTimeout!==null&&(clearTimeout(this.reconnectDueToServerInactivityTimeout),this.reconnectDueToServerInactivityTimeout=null),this.reconnectDueToServerInactivityTimeout=setTimeout(()=>{this.closeAndReconnect("InactiveServer")},this.serverInactivityThreshold))}scheduleReconnect(a){this.socket={state:"disconnected"};const s=this.nextBackoff(a);this.markConnectionStateDirty(),this.logger.log(`Attempting reconnect in ${s}ms`),setTimeout(()=>this.connect(),s)}closeAndReconnect(a){switch(this._logVerbose(`begin closeAndReconnect with reason ${a}`),this.socket.state){case"disconnected":case"terminated":case"stopped":return;case"connecting":case"ready":{this.lastCloseReason=a,this.close(),this.scheduleReconnect("client");return}default:this.socket}}close(){switch(this.socket.state){case"disconnected":case"terminated":case"stopped":return Promise.resolve();case"connecting":{const a=this.socket.ws;return new Promise(s=>{a.onclose=()=>{this._logVerbose("Closed after connecting"),s()},a.onopen=()=>{this._logVerbose("Opened after connecting"),a.close()}})}case"ready":{this._logVerbose("ws.close called");const a=this.socket.ws,s=new Promise(i=>{a.onclose=()=>{i()}});return a.close(),s}default:return this.socket,Promise.resolve()}}terminate(){switch(this.reconnectDueToServerInactivityTimeout&&clearTimeout(this.reconnectDueToServerInactivityTimeout),this.socket.state){case"terminated":case"stopped":case"disconnected":case"connecting":case"ready":{const a=this.close();return this.setSocketState({state:"terminated"}),a}default:throw this.socket,new Error(`Invalid websocket state: ${this.socket.state}`)}}stop(){switch(this.socket.state){case"terminated":return Promise.resolve();case"connecting":case"stopped":case"disconnected":case"ready":{const a=this.close();return this.socket={state:"stopped"},a}default:return this.socket,Promise.resolve()}}tryRestart(){switch(this.socket.state){case"stopped":break;case"terminated":case"connecting":case"ready":case"disconnected":this.logger.logVerbose("Restart called without stopping first");return;default:this.socket}this.connect()}pause(){switch(this.socket.state){case"disconnected":case"stopped":case"terminated":return;case"connecting":case"ready":{this.socket={...this.socket,paused:"yes"};return}default:{this.socket;return}}}resume(){switch(this.socket.state){case"connecting":this.socket={...this.socket,paused:"no"};return;case"ready":this.socket.paused==="uninitialized"?(this.socket={...this.socket,paused:"no"},this.onOpen({connectionCount:this.connectionCount,lastCloseReason:this.lastCloseReason})):this.socket.paused==="yes"&&(this.socket={...this.socket,paused:"no"},this.onResume());return;case"terminated":case"stopped":case"disconnected":return;default:this.socket}this.connect()}connectionState(){return{isConnected:this.socket.state==="ready",hasEverConnected:this._hasEverConnected,connectionCount:this.connectionCount,connectionRetries:this.retries}}_logVerbose(a){this.logger.logVerbose(a)}nextBackoff(a){const i=(a==="client"?100:a==="Unknown"?this.defaultInitialBackoff:bb[a].timeout)*Math.pow(2,this.retries);this.retries+=1;const l=Math.min(i,this.maxBackoff),u=l*(Math.random()-.5);return l+u}}function yN(){return vN()}function vN(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{const a=Math.random()*16|0;return(n==="x"?a:a&3|8).toString(16)})}class Ei extends Error{}Ei.prototype.name="InvalidTokenError";function bN(n){return decodeURIComponent(atob(n).replace(/(.)/g,(a,s)=>{let i=s.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}function xN(n){let a=n.replace(/-/g,"+").replace(/_/g,"/");switch(a.length%4){case 0:break;case 2:a+="==";break;case 3:a+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return bN(a)}catch{return atob(a)}}function wN(n,a){if(typeof n!="string")throw new Ei("Invalid token specified: must be a string");a||(a={});const s=a.header===!0?0:1,i=n.split(".")[s];if(typeof i!="string")throw new Ei(`Invalid token specified: missing part #${s+1}`);let l;try{l=xN(i)}catch(u){throw new Ei(`Invalid token specified: invalid base64 for part #${s+1} (${u.message})`)}try{return JSON.parse(l)}catch(u){throw new Ei(`Invalid token specified: invalid json for part #${s+1} (${u.message})`)}}var SN=Object.defineProperty,TN=(n,a,s)=>a in n?SN(n,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[a]=s,on=(n,a,s)=>TN(n,typeof a!="symbol"?a+"":a,s);const EN=20*24*60*60*1e3,$y=2;class CN{constructor(a,s,i){on(this,"authState",{state:"noAuth"}),on(this,"configVersion",0),on(this,"syncState"),on(this,"authenticate"),on(this,"stopSocket"),on(this,"tryRestartSocket"),on(this,"pauseSocket"),on(this,"resumeSocket"),on(this,"clearAuth"),on(this,"logger"),on(this,"refreshTokenLeewaySeconds"),on(this,"tokenConfirmationAttempts",0),this.syncState=a,this.authenticate=s.authenticate,this.stopSocket=s.stopSocket,this.tryRestartSocket=s.tryRestartSocket,this.pauseSocket=s.pauseSocket,this.resumeSocket=s.resumeSocket,this.clearAuth=s.clearAuth,this.logger=i.logger,this.refreshTokenLeewaySeconds=i.refreshTokenLeewaySeconds}async setConfig(a,s){this.resetAuthState(),this._logVerbose("pausing WS for auth token fetch"),this.pauseSocket();const i=await this.fetchTokenAndGuardAgainstRace(a,{forceRefreshToken:!1});i.isFromOutdatedConfig||(i.value?(this.setAuthState({state:"waitingForServerConfirmationOfCachedToken",config:{fetchToken:a,onAuthChange:s},hasRetried:!1}),this.authenticate(i.value)):(this.setAuthState({state:"initialRefetch",config:{fetchToken:a,onAuthChange:s}}),await this.refetchToken()),this._logVerbose("resuming WS after auth token fetch"),this.resumeSocket())}onTransition(a){if(this.syncState.isCurrentOrNewerAuthVersion(a.endVersion.identity)&&!(a.endVersion.identity<=a.startVersion.identity)){if(this.authState.state==="waitingForServerConfirmationOfCachedToken"){this._logVerbose("server confirmed auth token is valid"),this.refetchToken(),this.authState.config.onAuthChange(!0);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this._logVerbose("server confirmed new auth token is valid"),this.scheduleTokenRefetch(this.authState.token),this.tokenConfirmationAttempts=0,this.authState.hadAuth||this.authState.config.onAuthChange(!0))}}onAuthError(a){if(a.authUpdateAttempted===!1&&(this.authState.state==="waitingForServerConfirmationOfFreshToken"||this.authState.state==="waitingForServerConfirmationOfCachedToken")){this._logVerbose("ignoring non-auth token expired error");return}const{baseVersion:s}=a;if(!this.syncState.isCurrentOrNewerAuthVersion(s+1)){this._logVerbose("ignoring auth error for previous auth attempt");return}this.tryToReauthenticate(a)}async tryToReauthenticate(a){if(this._logVerbose(`attempting to reauthenticate: ${a.error}`),this.authState.state==="noAuth"||this.authState.state==="waitingForServerConfirmationOfFreshToken"&&this.tokenConfirmationAttempts>=$y){this.logger.error(`Failed to authenticate: "${a.error}", check your server auth config`),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.authState.state!=="noAuth"&&this.setAndReportAuthFailed(this.authState.config.onAuthChange);return}this.authState.state==="waitingForServerConfirmationOfFreshToken"&&(this.tokenConfirmationAttempts++,this._logVerbose(`retrying reauthentication, ${$y-this.tokenConfirmationAttempts} attempts remaining`)),await this.stopSocket();const s=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});s.isFromOutdatedConfig||(s.value&&this.syncState.isNewAuth(s.value)?(this.authenticate(s.value),this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",config:this.authState.config,token:s.value,hadAuth:this.authState.state==="notRefetching"||this.authState.state==="waitingForScheduledRefetch"})):(this._logVerbose("reauthentication failed, could not fetch a new token"),this.syncState.hasAuth()&&this.syncState.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this.tryRestartSocket())}async refetchToken(){if(this.authState.state==="noAuth")return;this._logVerbose("refetching auth token");const a=await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken,{forceRefreshToken:!0});a.isFromOutdatedConfig||(a.value?this.syncState.isNewAuth(a.value)?(this.setAuthState({state:"waitingForServerConfirmationOfFreshToken",hadAuth:this.syncState.hasAuth(),token:a.value,config:this.authState.config}),this.authenticate(a.value)):this.setAuthState({state:"notRefetching",config:this.authState.config}):(this._logVerbose("refetching token failed"),this.syncState.hasAuth()&&this.clearAuth(),this.setAndReportAuthFailed(this.authState.config.onAuthChange)),this._logVerbose("restarting WS after auth token fetch (if currently stopped)"),this.tryRestartSocket())}scheduleTokenRefetch(a){if(this.authState.state==="noAuth")return;const s=this.decodeToken(a);if(!s){this.logger.error("Auth token is not a valid JWT, cannot refetch the token");return}const{iat:i,exp:l}=s;if(!i||!l){this.logger.error("Auth token does not have required fields, cannot refetch the token");return}const u=l-i;if(u<=2){this.logger.error("Auth token does not live long enough, cannot refetch the token");return}let d=Math.min(EN,(u-this.refreshTokenLeewaySeconds)*1e3);d<=0&&(this.logger.warn(`Refetching auth token immediately, configured leeway ${this.refreshTokenLeewaySeconds}s is larger than the token's lifetime ${u}s`),d=0);const h=setTimeout(()=>{this._logVerbose("running scheduled token refetch"),this.refetchToken()},d);this.setAuthState({state:"waitingForScheduledRefetch",refetchTokenTimeoutId:h,config:this.authState.config}),this._logVerbose(`scheduled preemptive auth token refetching in ${d}ms`)}async fetchTokenAndGuardAgainstRace(a,s){const i=++this.configVersion;this._logVerbose(`fetching token with config version ${i}`);const l=await a(s);return this.configVersion!==i?(this._logVerbose(`stale config version, expected ${i}, got ${this.configVersion}`),{isFromOutdatedConfig:!0}):{isFromOutdatedConfig:!1,value:l}}stop(){this.resetAuthState(),this.configVersion++,this._logVerbose(`config version bumped to ${this.configVersion}`)}setAndReportAuthFailed(a){a(!1),this.resetAuthState()}resetAuthState(){this.setAuthState({state:"noAuth"})}setAuthState(a){const s=a.state==="waitingForServerConfirmationOfFreshToken"?{hadAuth:a.hadAuth,state:a.state,token:`...${a.token.slice(-7)}`}:{state:a.state};switch(this._logVerbose(`setting auth state to ${JSON.stringify(s)}`),a.state){case"waitingForScheduledRefetch":case"notRefetching":case"noAuth":this.tokenConfirmationAttempts=0;break}this.authState.state==="waitingForScheduledRefetch"&&(clearTimeout(this.authState.refetchTokenTimeoutId),this.syncState.markAuthCompletion()),this.authState=a}decodeToken(a){try{return wN(a)}catch(s){return this._logVerbose(`Error decoding token: ${s instanceof Error?s.message:"Unknown error"}`),null}}_logVerbose(a){this.logger.logVerbose(`${a} [v${this.configVersion}]`)}}const RN=["convexClientConstructed","convexWebSocketOpen","convexFirstMessageReceived"];function NN(n,a){const s={sessionId:a};typeof performance>"u"||!performance.mark||performance.mark(n,{detail:s})}function AN(n){let a=n.name.slice(6);return a=a.charAt(0).toLowerCase()+a.slice(1),{name:a,startTime:n.startTime}}function ON(n){if(typeof performance>"u"||!performance.getEntriesByName)return[];const a=[];for(const s of RN){const i=performance.getEntriesByName(s).filter(l=>l.entryType==="mark").filter(l=>l.detail.sessionId===n);a.push(...i)}return a.map(AN)}var MN=Object.defineProperty,_N=(n,a,s)=>a in n?MN(n,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[a]=s,it=(n,a,s)=>_N(n,typeof a!="symbol"?a+"":a,s);class jN{constructor(a,s,i){if(it(this,"address"),it(this,"state"),it(this,"requestManager"),it(this,"webSocketManager"),it(this,"authenticationManager"),it(this,"remoteQuerySet"),it(this,"optimisticQueryResults"),it(this,"_transitionHandlerCounter",0),it(this,"_nextRequestId"),it(this,"_onTransitionFns",new Map),it(this,"_sessionId"),it(this,"firstMessageReceived",!1),it(this,"debug"),it(this,"logger"),it(this,"maxObservedTimestamp"),it(this,"connectionStateSubscribers",new Map),it(this,"nextConnectionStateSubscriberId",0),it(this,"_lastPublishedConnectionState"),it(this,"markConnectionStateDirty",()=>{Promise.resolve().then(()=>{const S=this.connectionState();if(JSON.stringify(S)!==JSON.stringify(this._lastPublishedConnectionState)){this._lastPublishedConnectionState=S;for(const w of this.connectionStateSubscribers.values())w(S)}})}),it(this,"mark",S=>{this.debug&&NN(S,this.sessionId)}),typeof a=="object")throw new Error("Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly.");(i==null?void 0:i.skipConvexDeploymentUrlCheck)!==!0&&SR(a),i={...i};const l=i.authRefreshTokenLeewaySeconds??2;let u=i.webSocketConstructor;if(!u&&typeof WebSocket>"u")throw new Error("No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient");u=u||WebSocket,this.debug=i.reportDebugInfoToConvex??!1,this.address=a,this.logger=i.logger===!1?gb({verbose:i.verbose??!1}):i.logger!==!0&&i.logger?i.logger:mb({verbose:i.verbose??!1});const d=a.search("://");if(d===-1)throw new Error("Provided address was not an absolute URL.");const h=a.substring(d+3),m=a.substring(0,d);let g;if(m==="http")g="ws";else if(m==="https")g="wss";else throw new Error(`Unknown parent protocol ${m}`);const v=`${g}://${h}/api/${Iy}/sync`;this.state=new HR,this.remoteQuerySet=new Gy(S=>this.state.queryPath(S),this.logger),this.requestManager=new GR(this.logger,this.markConnectionStateDirty),this.authenticationManager=new CN(this.state,{authenticate:S=>{const w=this.state.setAuth(S);return this.webSocketManager.sendMessage(w),w.baseVersion},stopSocket:()=>this.webSocketManager.stop(),tryRestartSocket:()=>this.webSocketManager.tryRestart(),pauseSocket:()=>{this.webSocketManager.pause(),this.state.pause()},resumeSocket:()=>this.webSocketManager.resume(),clearAuth:()=>{this.clearAuth()}},{logger:this.logger,refreshTokenLeewaySeconds:l}),this.optimisticQueryResults=new JR,this.addOnTransitionHandler(S=>{s(S.queries.map(w=>w.token))}),this._nextRequestId=0,this._sessionId=yN();const{unsavedChangesWarning:T}=i;if(typeof window>"u"||typeof window.addEventListener>"u"){if(T===!0)throw new Error("unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.")}else T!==!1&&window.addEventListener("beforeunload",S=>{if(this.requestManager.hasIncompleteRequests()){S.preventDefault();const w="Are you sure you want to leave? Your changes may not be saved.";return(S||window.event).returnValue=w,w}});this.webSocketManager=new pN(v,{onOpen:S=>{this.mark("convexWebSocketOpen"),this.webSocketManager.sendMessage({...S,type:"Connect",sessionId:this._sessionId,maxObservedTimestamp:this.maxObservedTimestamp});const w=new Set(this.remoteQuerySet.remoteQueryResults().keys());this.remoteQuerySet=new Gy(C=>this.state.queryPath(C),this.logger);const[N,E]=this.state.restart(w);E&&this.webSocketManager.sendMessage(E),this.webSocketManager.sendMessage(N);for(const C of this.requestManager.restart())this.webSocketManager.sendMessage(C)},onResume:()=>{const[S,w]=this.state.resume();w&&this.webSocketManager.sendMessage(w),S&&this.webSocketManager.sendMessage(S);for(const N of this.requestManager.resume())this.webSocketManager.sendMessage(N)},onMessage:S=>{switch(this.firstMessageReceived||(this.firstMessageReceived=!0,this.mark("convexFirstMessageReceived"),this.reportMarks()),S.type){case"Transition":{this.observedTimestamp(S.endVersion.ts),this.authenticationManager.onTransition(S),this.remoteQuerySet.transition(S),this.state.transition(S);const w=this.requestManager.removeCompleted(this.remoteQuerySet.timestamp());this.notifyOnQueryResultChanges(w);break}case"MutationResponse":{S.success&&this.observedTimestamp(S.ts);const w=this.requestManager.onResponse(S);w!==null&&this.notifyOnQueryResultChanges(new Map([[w.requestId,w.result]]));break}case"ActionResponse":{this.requestManager.onResponse(S);break}case"AuthError":{this.authenticationManager.onAuthError(S);break}case"FatalError":{const w=PR(this.logger,S.error);throw this.webSocketManager.terminate(),w}}return{hasSyncedPastLastReconnect:this.hasSyncedPastLastReconnect()}},onServerDisconnectError:i.onServerDisconnectError},u,this.logger,this.markConnectionStateDirty),this.mark("convexClientConstructed")}hasSyncedPastLastReconnect(){return this.requestManager.hasSyncedPastLastReconnect()||this.state.hasSyncedPastLastReconnect()}observedTimestamp(a){(this.maxObservedTimestamp===void 0||this.maxObservedTimestamp.lessThanOrEqual(a))&&(this.maxObservedTimestamp=a)}getMaxObservedTimestamp(){return this.maxObservedTimestamp}notifyOnQueryResultChanges(a){const s=this.remoteQuerySet.remoteQueryResults(),i=new Map;for(const[u,d]of s){const h=this.state.queryToken(u);if(h!==null){const m={result:d,udfPath:this.state.queryPath(u),args:this.state.queryArgs(u)};i.set(h,m)}}const l=this.optimisticQueryResults.ingestQueryResultsFromServer(i,new Set(a.keys()));this.handleTransition({queries:l.map(u=>{const d=this.optimisticQueryResults.rawQueryResult(u);return{token:u,modification:{kind:"Updated",result:d.result}}}),reflectedMutations:Array.from(a).map(([u,d])=>({requestId:u,result:d})),timestamp:this.remoteQuerySet.timestamp()})}handleTransition(a){for(const s of this._onTransitionFns.values())s(a)}addOnTransitionHandler(a){const s=this._transitionHandlerCounter++;return this._onTransitionFns.set(s,a),()=>this._onTransitionFns.delete(s)}setAuth(a,s){this.authenticationManager.setConfig(a,s)}hasAuth(){return this.state.hasAuth()}setAdminAuth(a,s){const i=this.state.setAdminAuth(a,s);this.webSocketManager.sendMessage(i)}clearAuth(){const a=this.state.clearAuth();this.webSocketManager.sendMessage(a)}subscribe(a,s,i){const l=ra(s),{modification:u,queryToken:d,unsubscribe:h}=this.state.subscribe(a,l,i==null?void 0:i.journal,i==null?void 0:i.componentPath);return u!==null&&this.webSocketManager.sendMessage(u),{queryToken:d,unsubscribe:()=>{const m=h();m&&this.webSocketManager.sendMessage(m)}}}localQueryResult(a,s){const i=ra(s),l=cr(a,i);return this.optimisticQueryResults.queryResult(l)}localQueryResultByToken(a){return this.optimisticQueryResults.queryResult(a)}hasLocalQueryResultByToken(a){return this.optimisticQueryResults.hasQueryResult(a)}localQueryLogs(a,s){const i=ra(s),l=cr(a,i);return this.optimisticQueryResults.queryLogs(l)}queryJournal(a,s){const i=ra(s),l=cr(a,i);return this.state.queryJournal(l)}connectionState(){const a=this.webSocketManager.connectionState();return{hasInflightRequests:this.requestManager.hasInflightRequests(),isWebSocketConnected:a.isConnected,hasEverConnected:a.hasEverConnected,connectionCount:a.connectionCount,connectionRetries:a.connectionRetries,timeOfOldestInflightRequest:this.requestManager.timeOfOldestInflightRequest(),inflightMutations:this.requestManager.inflightMutations(),inflightActions:this.requestManager.inflightActions()}}subscribeToConnectionState(a){const s=this.nextConnectionStateSubscriberId++;return this.connectionStateSubscribers.set(s,a),()=>{this.connectionStateSubscribers.delete(s)}}async mutation(a,s,i){const l=await this.mutationInternal(a,s,i);if(!l.success)throw l.errorData!==void 0?id(l,new qi(ss("mutation",a,l))):new Error(ss("mutation",a,l));return l.value}async mutationInternal(a,s,i,l){const{mutationPromise:u}=this.enqueueMutation(a,s,i,l);return u}enqueueMutation(a,s,i,l){const u=ra(s);this.tryReportLongDisconnect();const d=this.nextRequestId;if(this._nextRequestId++,i!==void 0){const v=i.optimisticUpdate;if(v!==void 0){const T=N=>{v(N,u)instanceof Promise&&this.logger.warn("Optimistic update handler returned a Promise. Optimistic updates should be synchronous.")},w=this.optimisticQueryResults.applyOptimisticUpdate(T,d).map(N=>{const E=this.localQueryResultByToken(N);return{token:N,modification:{kind:"Updated",result:E===void 0?void 0:{success:!0,value:E,logLines:[]}}}});this.handleTransition({queries:w,reflectedMutations:[],timestamp:this.remoteQuerySet.timestamp()})}}const h={type:"Mutation",requestId:d,udfPath:a,componentPath:l,args:[_t(u)]},m=this.webSocketManager.sendMessage(h),g=this.requestManager.request(h,m);return{requestId:d,mutationPromise:g}}async action(a,s){const i=await this.actionInternal(a,s);if(!i.success)throw i.errorData!==void 0?id(i,new qi(ss("action",a,i))):new Error(ss("action",a,i));return i.value}async actionInternal(a,s,i){const l=ra(s),u=this.nextRequestId;this._nextRequestId++,this.tryReportLongDisconnect();const d={type:"Action",requestId:u,udfPath:a,componentPath:i,args:[_t(l)]},h=this.webSocketManager.sendMessage(d);return this.requestManager.request(d,h)}async close(){return this.authenticationManager.stop(),this.webSocketManager.terminate()}get url(){return this.address}get nextRequestId(){return this._nextRequestId}get sessionId(){return this._sessionId}reportMarks(){if(this.debug){const a=ON(this.sessionId);this.webSocketManager.sendMessage({type:"Event",eventType:"ClientConnect",event:a})}}tryReportLongDisconnect(){if(!this.debug)return;const a=this.connectionState().timeOfOldestInflightRequest;if(a===null||Date.now()-a.getTime()<=60*1e3)return;const s=`${this.address}/api/debug_event`;fetch(s,{method:"POST",headers:{"Content-Type":"application/json","Convex-Client":`npm-${Iy}`},body:JSON.stringify({event:"LongWebsocketDisconnect"})}).then(i=>{i.ok||this.logger.warn("Analytics request failed with response:",i.body)}).catch(i=>{this.logger.warn("Analytics response failed with error:",i)})}}function DN({getCurrentValue:n,subscribe:a}){const[s,i]=x.useState(()=>({getCurrentValue:n,subscribe:a,value:n()}));let l=s.value;return(s.getCurrentValue!==n||s.subscribe!==a)&&(l=n(),i({getCurrentValue:n,subscribe:a,value:l})),x.useEffect(()=>{let u=!1;const d=()=>{u||i(m=>{if(m.getCurrentValue!==n||m.subscribe!==a)return m;const g=n();return m.value===g?m:{...m,value:g}})},h=a(d);return d(),()=>{u=!0,h()}},[n,a]),l}var kN=Object.defineProperty,LN=(n,a,s)=>a in n?kN(n,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[a]=s,ja=(n,a,s)=>LN(n,typeof a!="symbol"?a+"":a,s);if(typeof ne>"u")throw new Error("Required dependency 'react' not found");function qN(n,a){return function(s){return a.action(n,s)}}class zN{constructor(a,s){if(ja(this,"address"),ja(this,"cachedSync"),ja(this,"listeners"),ja(this,"options"),ja(this,"closed",!1),ja(this,"_logger"),ja(this,"adminAuth"),ja(this,"fakeUserIdentity"),a===void 0)throw new Error("No address provided to ConvexReactClient.\nIf trying to deploy to production, make sure to follow all the instructions found at https://docs.convex.dev/production/hosting/\nIf running locally, make sure to run `convex dev` and ensure the .env.local file is populated.");if(typeof a!="string")throw new Error(`ConvexReactClient requires a URL like 'https://happy-otter-123.convex.cloud', received something of type ${typeof a} instead.`);if(!a.includes("://"))throw new Error("Provided address was not an absolute URL.");this.address=a,this.listeners=new Map,this._logger=(s==null?void 0:s.logger)===!1?gb({verbose:(s==null?void 0:s.verbose)??!1}):(s==null?void 0:s.logger)!==!0&&(s!=null&&s.logger)?s.logger:mb({verbose:(s==null?void 0:s.verbose)??!1}),this.options={...s,logger:this._logger}}get url(){return this.address}get sync(){if(this.closed)throw new Error("ConvexReactClient has already been closed.");return this.cachedSync?this.cachedSync:(this.cachedSync=new jN(this.address,a=>this.transition(a),this.options),this.adminAuth&&this.cachedSync.setAdminAuth(this.adminAuth,this.fakeUserIdentity),this.cachedSync)}setAuth(a,s){if(typeof a=="string")throw new Error("Passing a string to ConvexReactClient.setAuth is no longer supported, please upgrade to passing in an async function to handle reauthentication.");this.sync.setAuth(a,s??(()=>{}))}clearAuth(){this.sync.clearAuth()}setAdminAuth(a,s){if(this.adminAuth=a,this.fakeUserIdentity=s,this.closed)throw new Error("ConvexReactClient has already been closed.");this.cachedSync&&this.sync.setAdminAuth(a,s)}watchQuery(a,...s){const[i,l]=s,u=pt(a);return{onUpdate:d=>{const{queryToken:h,unsubscribe:m}=this.sync.subscribe(u,i,l),g=this.listeners.get(h);return g!==void 0?g.add(d):this.listeners.set(h,new Set([d])),()=>{if(this.closed)return;const v=this.listeners.get(h);v.delete(d),v.size===0&&this.listeners.delete(h),m()}},localQueryResult:()=>{if(this.cachedSync)return this.cachedSync.localQueryResult(u,i)},localQueryLogs:()=>{if(this.cachedSync)return this.cachedSync.localQueryLogs(u,i)},journal:()=>{if(this.cachedSync)return this.cachedSync.queryJournal(u,i)}}}mutation(a,...s){const[i,l]=s,u=pt(a);return this.sync.mutation(u,i,l)}action(a,...s){const i=pt(a);return this.sync.action(i,...s)}query(a,...s){const i=this.watchQuery(a,...s),l=i.localQueryResult();return l!==void 0?Promise.resolve(l):new Promise((u,d)=>{const h=i.onUpdate(()=>{h();try{u(i.localQueryResult())}catch(m){d(m)}})})}connectionState(){return this.sync.connectionState()}subscribeToConnectionState(a){return this.sync.subscribeToConnectionState(a)}get logger(){return this._logger}async close(){if(this.closed=!0,this.listeners=new Map,this.cachedSync){const a=this.cachedSync;this.cachedSync=void 0,await a.close()}}transition(a){for(const s of a){const i=this.listeners.get(s);if(i)for(const l of i)l()}}}const eh=ne.createContext(void 0);function Wl(){return x.useContext(eh)}const UN=({client:n,children:a})=>ne.createElement(eh.Provider,{value:n},a);function od(n,...a){const s=a[0]==="skip",i=a[0]==="skip"?{}:ra(a[0]),l=typeof n=="string"?pb(n):n,u=pt(l),d=x.useMemo(()=>s?{}:{query:{query:l,args:i}},[JSON.stringify(_t(i)),u,s]),m=th(d).query;if(m instanceof Error)throw m;return m}function Xy(n){const a=x.useContext(eh),s=typeof n=="string"?pb(n):n;if(a===void 0)throw new Error("Could not find Convex client! `useAction` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");return x.useMemo(()=>qN(s,a),[a,pt(s)])}var BN=Object.defineProperty,PN=(n,a,s)=>a in n?BN(n,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[a]=s,Lf=(n,a,s)=>PN(n,typeof a!="symbol"?a+"":a,s);class VN{constructor(a){Lf(this,"createWatch"),Lf(this,"queries"),Lf(this,"listeners"),this.createWatch=a,this.queries={},this.listeners=new Set}setQueries(a){for(const s of Object.keys(a)){const{query:i,args:l}=a[s];if(pt(i),this.queries[s]===void 0)this.addQuery(s,i,l);else{const u=this.queries[s];(pt(i)!==pt(u.query)||JSON.stringify(_t(l))!==JSON.stringify(_t(u.args)))&&(this.removeQuery(s),this.addQuery(s,i,l))}}for(const s of Object.keys(this.queries))a[s]===void 0&&this.removeQuery(s)}subscribe(a){return this.listeners.add(a),()=>{this.listeners.delete(a)}}getLocalResults(a){const s={};for(const i of Object.keys(a)){const{query:l,args:u}=a[i];pt(l);const d=this.createWatch(l,u);let h;try{h=d.localQueryResult()}catch(m){if(m instanceof Error)h=m;else throw m}s[i]=h}return s}setCreateWatch(a){this.createWatch=a;for(const s of Object.keys(this.queries)){const{query:i,args:l,watch:u}=this.queries[s],d=u.journal();this.removeQuery(s),this.addQuery(s,i,l,d)}}destroy(){for(const a of Object.keys(this.queries))this.removeQuery(a);this.listeners=new Set}addQuery(a,s,i,l){if(this.queries[a]!==void 0)throw new Error(`Tried to add a new query with identifier ${a} when it already exists.`);const u=this.createWatch(s,i,l),d=u.onUpdate(()=>this.notifyListeners());this.queries[a]={query:s,args:i,watch:u,unsubscribe:d}}removeQuery(a){const s=this.queries[a];if(s===void 0)throw new Error(`No query found with identifier ${a}.`);s.unsubscribe(),delete this.queries[a]}notifyListeners(){for(const a of this.listeners)a()}}function th(n){const a=Wl();if(a===void 0)throw new Error("Could not find Convex client! `useQuery` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app");const s=x.useMemo(()=>(i,l,u)=>a.watchQuery(i,l,{journal:u}),[a]);return IN(n,s)}function IN(n,a){const[s]=x.useState(()=>new VN(a));s.createWatch!==a&&s.setCreateWatch(a),x.useEffect(()=>()=>s.destroy(),[s]);const i=x.useMemo(()=>({getCurrentValue:()=>s.getLocalResults(n),subscribe:l=>(s.setQueries(n),s.subscribe(l))}),[s,n]);return DN(i)}var HN=Object.defineProperty,YN=(n,a,s)=>a in n?HN(n,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[a]=s,or=(n,a,s)=>YN(n,typeof a!="symbol"?a+"":a,s);class Ky{constructor(a){or(this,"indexes"),or(this,"searchIndexes"),or(this,"vectorIndexes"),or(this,"validator"),this.indexes=[],this.searchIndexes=[],this.vectorIndexes=[],this.validator=a}" indexes"(){return this.indexes}index(a,s){return this.indexes.push({indexDescriptor:a,fields:s}),this}searchIndex(a,s){return this.searchIndexes.push({indexDescriptor:a,searchField:s.searchField,filterFields:s.filterFields||[]}),this}vectorIndex(a,s){return this.vectorIndexes.push({indexDescriptor:a,vectorField:s.vectorField,dimensions:s.dimensions,filterFields:s.filterFields||[]}),this}self(){return this}export(){const a=this.validator.json;if(typeof a!="object")throw new Error("Invalid validator: please make sure that the parameter of `defineTable` is valid (see https://docs.convex.dev/database/schemas)");return{indexes:this.indexes,searchIndexes:this.searchIndexes,vectorIndexes:this.vectorIndexes,documentType:a}}}function _n(n){return DR(n)?new Ky(n):new Ky(p.object(n))}class QN{constructor(a,s){or(this,"tables"),or(this,"strictTableNameTypes"),or(this,"schemaValidation"),this.tables=a,this.schemaValidation=(s==null?void 0:s.schemaValidation)===void 0?!0:s.schemaValidation}export(){return JSON.stringify({tables:Object.entries(this.tables).map(([a,s])=>{const{indexes:i,searchIndexes:l,vectorIndexes:u,documentType:d}=s.export();return{tableName:a,indexes:i,searchIndexes:l,vectorIndexes:u,documentType:d}}),schemaValidation:this.schemaValidation})}}function xb(n,a){return new QN(n,a)}xb({_scheduled_functions:_n({name:p.string(),args:p.array(p.any()),scheduledTime:p.float64(),completedTime:p.optional(p.float64()),state:p.union(p.object({kind:p.literal("pending")}),p.object({kind:p.literal("inProgress")}),p.object({kind:p.literal("success")}),p.object({kind:p.literal("failed"),error:p.string()}),p.object({kind:p.literal("canceled")}))}),_storage:_n({sha256:p.string(),size:p.float64(),contentType:p.optional(p.string())})});const Fy="playground_api_key",Zy="playground_api_path",Wy=`npx convex run --component agent apiKeys:issue '{name:"..."}'`,GN=`
import { definePlaygroundAPI } from "@convex-dev/agent/playground";
import { components } from "./_generated/api";
import { weatherAgent, fashionAgent } from "./example";
export const {
isApiKeyValid,
listAgents,
listUsers,
listThreads,
listMessages,
createThread,
generateText,
fetchPromptContext,
} = definePlaygroundAPI(components.agent, { agents: [weatherAgent, fashionAgent] });
`;function $N(n){return n.trim().split("/").reduce((a,s)=>a[s],vb)}function Jy({children:n}){const{url:a}=rb(),s=x.useMemo(()=>{if(a)try{return decodeURIComponent(a).replace(/\/$/,"")}catch(I){return console.error("Error decoding url",a,I),null}return null},[a]),[i,l]=x.useState(()=>{const I=sessionStorage.getItem(`${Fy}-${a}`);return I||""}),[u,d]=x.useState(!!i),[h,m]=x.useState(i||""),[g,v]=x.useState(()=>{const I=sessionStorage.getItem(`${Zy}-${a}`);return I||"playground"}),[T,S]=x.useState(g),[w,N]=x.useState(!1),[E,C]=x.useState(null),j=Wl(),[M,_]=x.useState(null);x.useEffect(()=>{if(!T)return;const I=$N(T);j.query(I.isApiKeyValid,{apiKey:h}).then(ae=>{sessionStorage.setItem(`${Zy}-${a}`,T),v(T),ae?(d(!0),C(null)):(d(!1),C("Invalid API key for this playground path.")),_(!0)}).catch(ae=>{j.connectionState().isWebSocketConnected?v(""):_(!1),C(`Invalid playground path (could not find isApiKeyValid).
Please check the path and try again.
e.g. if you exported the API in convex/foo/playground.ts, it would be foo/playground.
The code there should be:
`+GN)})},[h,T,j,a]);const z=async I=>{I.preventDefault(),u&&(sessionStorage.setItem(`${Fy}-${a}`,h),l(h))},k=()=>{navigator.clipboard.writeText(Wy),N(!0),setTimeout(()=>N(!1),1200)};if(!i||!g||!u)return y.jsx("div",{className:"fixed inset-0 flex py-8 items-start justify-center bg-black bg-opacity-60 z-50",children:y.jsxs("form",{onSubmit:z,className:"bg-white rounded-xl shadow-2xl p-8 flex flex-col gap-6 w-full max-w-4xl border border-muted min-h-[600px]",children:[y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx("h2",{className:"text-2xl font-bold mb-1 text-foreground",children:"Configure the playground"}),y.jsxs("p",{className:"text-sm text-muted-foreground",children:["Convex cloud deployment URL:"," ",s||"No deployment URL found"]}),M===!1&&y.jsx("div",{className:"text-red-600 text-sm font-medium mt-2",children:"Backend is not connected. Please check your internet connection, or the Convex deployment URL in the environment variables / sessionStorage."}),y.jsxs("h3",{className:"text-xl font-bold mb-1 text-foreground",children:["API Path ",g?"✅ ":"❌ "]}),y.jsx("label",{className:"text-sm font-medium text-foreground",children:"Playground API Path"}),y.jsx("input",{className:"border border-input rounded-lg px-4 py-2 text-base font-mono bg-muted focus:outline-none focus:ring-2 focus:ring-blue-500 transition w-full min-w-0",type:"text",autoComplete:"username",id:"agent-playground-api-path",value:T,onChange:I=>S(I.target.value.trim()),placeholder:"playground"}),y.jsxs("span",{className:"text-xs text-muted-foreground",children:["Where you exported the playground api with definePlaygroundAPI. Usually ",y.jsx("code",{children:"playground"}),"."]})]}),y.jsxs("h3",{className:"text-xl font-bold mb-1 text-foreground",children:["API Key ",u?"✅ ":"❌ "]}),y.jsxs("div",{className:"text-muted-foreground text-sm mb-2",children:["To use the Playground, you need an API key. After setting up the agent in your app, run this command in your project directory (CLI or Convex dashboard):",y.jsxs("div",{className:"relative my-3",children:[y.jsx("pre",{className:"bg-gray-900 text-white rounded-md p-3 pr-14 text-xs overflow-x-auto border border-gray-800 font-mono select-all",children:Wy}),y.jsx("button",{type:"button",onClick:k,className:"absolute top-2 right-2 bg-gray-800 hover:bg-gray-700 text-white rounded px-2 py-1 text-xs flex items-center gap-1 shadow",tabIndex:-1,"aria-label":"Copy command",children:w?y.jsx("span",{children:"Copied!"}):y.jsxs(y.Fragment,{children:[y.jsxs("svg",{width:"16",height:"16",fill:"none",viewBox:"0 0 24 24",children:[y.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",fill:"#fff",fillOpacity:"0.1",stroke:"#fff",strokeWidth:"2"}),y.jsx("rect",{x:"3",y:"3",width:"13",height:"13",rx:"2",fill:"#fff",fillOpacity:"0.2",stroke:"#fff",strokeWidth:"2"})]}),"Copy"]})})]}),y.jsx("span",{className:"block mt-2",children:"Paste the resulting API key below."})]}),y.jsx("input",{className:"border border-input rounded-lg px-4 py-3 text-base font-mono bg-muted focus:outline-none focus:ring-2 focus:ring-blue-500 transition w-full min-w-0",type:"password",autoComplete:"current-password",name:"api-key",id:"agent-playground-api-key",value:h,onChange:I=>m(I.target.value.trim().replace(/^['"]|['"]$/g,"").trim()),placeholder:"API Key",autoFocus:!0}),E&&y.jsx("div",{className:"text-red-600 text-sm font-medium mt-2",children:y.jsx("pre",{className:"bg-gray-900 text-white rounded-md p-3 pr-14 text-xs overflow-x-auto border border-gray-800 font-mono select-all",children:E})}),y.jsx(Mt,{type:"submit",variant:"default",className:"bg-blue-500 text-white rounded-lg px-4 py-2 transition-colors hover:bg-blue-600",disabled:!g||!u,children:"Submit"})]})});const $=g.trim().split("/").reduce((I,ae)=>I[ae],vb);return n(i,$)}const ev="playground_deployment_url";function qf(n){try{const a=new URL(n);return a.protocol==="http:"||a.protocol==="https:"}catch{return!1}}function tv({children:n}){const a=ab(),{url:s}=rb(),i=x.useMemo(()=>{if(s)try{return decodeURIComponent(s).replace(/\/$/,"")}catch(k){return console.error("Error decoding url",s,k),null}return null},[s]),[l,u]=x.useState(()=>i||(localStorage.getItem(ev)??""));x.useEffect(()=>{i&&u(i)},[i]);const[d,h]=x.useState(null),[m,g]=x.useState(null),[v,T]=x.useState(!1),[S,w]=x.useState(!1),[N,E]=x.useState(!1),C=async k=>{if(!N){if(E(!0),!k){w(!1),h(null),g(null),T(!1);return}if(!qf(k)){w(!1),h(null),g(null),T(!1);return}T(!0),h(null),g(null);try{const $=await fetch(k+"/instance_name");if(!$.ok)throw new Error("Invalid response");const I=await $.text();h(I),g(null),T(!1),w(!0),localStorage.setItem(ev,k)}catch{h(null),g("Could not validate deployment URL. Please check the URL and try again."),T(!1),w(!1)}finally{E(!1)}}};x.useEffect(()=>{if(!i){w(!1);return}C(i)},[i]),x.useEffect(()=>{if(!i||S)return;const k=setInterval(()=>{C(i)},3e3);return()=>clearInterval(k)},[i,S]);const j=k=>{u(k.target.value.trim())},M=()=>{l&&qf(l)&&a(`/play/${encodeURIComponent(l.replace(/\/$/,""))}`)},_=k=>{k.key==="Enter"&&l&&qf(l)&&a(`/play/${encodeURIComponent(l.replace(/\/$/,""))}`)},z=x.useMemo(()=>S&&i?new zN(i):null,[S,i]);return!i||!S||!z?y.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-60 z-50",children:y.jsxs("div",{className:"bg-white rounded-xl shadow-2xl p-8 flex flex-col gap-6 border border-muted",style:{minWidth:750,maxWidth:"90vw",width:750},children:[y.jsx("h2",{className:"text-2xl font-bold mb-1 text-foreground",children:"Configure Convex Deployment"}),y.jsxs("p",{className:"text-sm text-foreground",children:["To use the Playground, you first must have a running Convex project to connect the Playground to. See the docs for more details: https://docs.convex.dev/agents",y.jsx("br",{}),"The Deployment URL is usually found in .env.local and is the URL of your Convex deployment, usually ending with .cloud."]}),y.jsx("label",{className:"text-sm font-medium text-foreground",children:"Deployment URL"}),y.jsx("input",{className:"border border-input rounded-lg px-4 py-2 text-base font-mono bg-muted focus:outline-none focus:ring-2 focus:ring-blue-500 transition w-full min-w-0",type:"text",value:l,onChange:j,onBlur:M,onKeyDown:_,placeholder:"https://<your-convex>.cloud",autoFocus:!0}),y.jsx("div",{style:{minHeight:"2.5em"},className:"flex items-center",children:v?y.jsx("div",{className:"text-blue-700 text-sm font-medium break-words whitespace-pre-wrap bg-blue-50 rounded p-3 border border-blue-200",style:{wordBreak:"break-word",maxWidth:"100%"},children:"Validating..."}):d?y.jsxs("div",{className:"text-green-700 text-sm",children:["Instance: ",d]}):m?y.jsx("div",{className:"text-red-600 text-sm font-medium break-words whitespace-pre-wrap bg-red-50 rounded p-3 border border-red-200",style:{wordBreak:"break-word",maxWidth:"100%"},children:m}):""})]})}):y.jsx(UN,{client:z,children:n})}function nv(n,[a,s]){return Math.min(s,Math.max(a,n))}var XN=x.createContext(void 0);function KN(n){const a=x.useContext(XN);return n||a||"ltr"}var zf=0;function FN(){x.useEffect(()=>{const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",n[0]??av()),document.body.insertAdjacentElement("beforeend",n[1]??av()),zf++,()=>{zf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),zf--}},[])}function av(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}var Uf="focusScope.autoFocusOnMount",Bf="focusScope.autoFocusOnUnmount",rv={bubbles:!1,cancelable:!0},ZN="FocusScope",wb=x.forwardRef((n,a)=>{const{loop:s=!1,trapped:i=!1,onMountAutoFocus:l,onUnmountAutoFocus:u,...d}=n,[h,m]=x.useState(null),g=pn(l),v=pn(u),T=x.useRef(null),S=Je(a,E=>m(E)),w=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(i){let E=function(_){if(w.paused||!h)return;const z=_.target;h.contains(z)?T.current=z:ka(T.current,{select:!0})},C=function(_){if(w.paused||!h)return;const z=_.relatedTarget;z!==null&&(h.contains(z)||ka(T.current,{select:!0}))},j=function(_){if(document.activeElement===document.body)for(const k of _)k.removedNodes.length>0&&ka(h)};document.addEventListener("focusin",E),document.addEventListener("focusout",C);const M=new MutationObserver(j);return h&&M.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",C),M.disconnect()}}},[i,h,w.paused]),x.useEffect(()=>{if(h){iv.add(w);const E=document.activeElement;if(!h.contains(E)){const j=new CustomEvent(Uf,rv);h.addEventListener(Uf,g),h.dispatchEvent(j),j.defaultPrevented||(WN(aA(Sb(h)),{select:!0}),document.activeElement===E&&ka(h))}return()=>{h.removeEventListener(Uf,g),setTimeout(()=>{const j=new CustomEvent(Bf,rv);h.addEventListener(Bf,v),h.dispatchEvent(j),j.defaultPrevented||ka(E??document.body,{select:!0}),h.removeEventListener(Bf,v),iv.remove(w)},0)}}},[h,g,v,w]);const N=x.useCallback(E=>{if(!s&&!i||w.paused)return;const C=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,j=document.activeElement;if(C&&j){const M=E.currentTarget,[_,z]=JN(M);_&&z?!E.shiftKey&&j===z?(E.preventDefault(),s&&ka(_,{select:!0})):E.shiftKey&&j===_&&(E.preventDefault(),s&&ka(z,{select:!0})):j===M&&E.preventDefault()}},[s,i,w.paused]);return y.jsx(Ve.div,{tabIndex:-1,...d,ref:S,onKeyDown:N})});wb.displayName=ZN;function WN(n,{select:a=!1}={}){const s=document.activeElement;for(const i of n)if(ka(i,{select:a}),document.activeElement!==s)return}function JN(n){const a=Sb(n),s=sv(a,n),i=sv(a.reverse(),n);return[s,i]}function Sb(n){const a=[],s=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const l=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||l?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)a.push(s.currentNode);return a}function sv(n,a){for(const s of n)if(!eA(s,{upTo:a}))return s}function eA(n,{upTo:a}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(a!==void 0&&n===a)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}function tA(n){return n instanceof HTMLInputElement&&"select"in n}function ka(n,{select:a=!1}={}){if(n&&n.focus){const s=document.activeElement;n.focus({preventScroll:!0}),n!==s&&tA(n)&&a&&n.select()}}var iv=nA();function nA(){let n=[];return{add(a){const s=n[0];a!==s&&(s==null||s.pause()),n=ov(n,a),n.unshift(a)},remove(a){var s;n=ov(n,a),(s=n[0])==null||s.resume()}}}function ov(n,a){const s=[...n],i=s.indexOf(a);return i!==-1&&s.splice(i,1),s}function aA(n){return n.filter(a=>a.tagName!=="A")}function rA(n){const a=x.useRef({value:n,previous:n});return x.useMemo(()=>(a.current.value!==n&&(a.current.previous=a.current.value,a.current.value=n),a.current.previous),[n])}var sA=function(n){if(typeof document>"u")return null;var a=Array.isArray(n)?n[0]:n;return a.ownerDocument.body},es=new WeakMap,hl=new WeakMap,ml={},Pf=0,Tb=function(n){return n&&(n.host||Tb(n.parentNode))},iA=function(n,a){return a.map(function(s){if(n.contains(s))return s;var i=Tb(s);return i&&n.contains(i)?i:(console.error("aria-hidden",s,"in not contained inside",n,". Doing nothing"),null)}).filter(function(s){return!!s})},oA=function(n,a,s,i){var l=iA(a,Array.isArray(n)?n:[n]);ml[s]||(ml[s]=new WeakMap);var u=ml[s],d=[],h=new Set,m=new Set(l),g=function(T){!T||h.has(T)||(h.add(T),g(T.parentNode))};l.forEach(g);var v=function(T){!T||m.has(T)||Array.prototype.forEach.call(T.children,function(S){if(h.has(S))v(S);else try{var w=S.getAttribute(i),N=w!==null&&w!=="false",E=(es.get(S)||0)+1,C=(u.get(S)||0)+1;es.set(S,E),u.set(S,C),d.push(S),E===1&&N&&hl.set(S,!0),C===1&&S.setAttribute(s,"true"),N||S.setAttribute(i,"true")}catch(j){console.error("aria-hidden: cannot operate on ",S,j)}})};return v(a),h.clear(),Pf++,function(){d.forEach(function(T){var S=es.get(T)-1,w=u.get(T)-1;es.set(T,S),u.set(T,w),S||(hl.has(T)||T.removeAttribute(i),hl.delete(T)),w||T.removeAttribute(s)}),Pf--,Pf||(es=new WeakMap,es=new WeakMap,hl=new WeakMap,ml={})}},lA=function(n,a,s){s===void 0&&(s="data-aria-hidden");var i=Array.from(Array.isArray(n)?n:[n]),l=sA(n);return l?(i.push.apply(i,Array.from(l.querySelectorAll("[aria-live], script"))),oA(i,l,s,"aria-hidden")):function(){return null}},Dn=function(){return Dn=Object.assign||function(a){for(var s,i=1,l=arguments.length;i<l;i++){s=arguments[i];for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(a[u]=s[u])}return a},Dn.apply(this,arguments)};function Eb(n,a){var s={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.indexOf(i)<0&&(s[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,i=Object.getOwnPropertySymbols(n);l<i.length;l++)a.indexOf(i[l])<0&&Object.prototype.propertyIsEnumerable.call(n,i[l])&&(s[i[l]]=n[i[l]]);return s}function cA(n,a,s){if(s||arguments.length===2)for(var i=0,l=a.length,u;i<l;i++)(u||!(i in a))&&(u||(u=Array.prototype.slice.call(a,0,i)),u[i]=a[i]);return n.concat(u||Array.prototype.slice.call(a))}var Sl="right-scroll-bar-position",Tl="width-before-scroll-bar",uA="with-scroll-bars-hidden",fA="--removed-body-scroll-bar-size";function Vf(n,a){return typeof n=="function"?n(a):n&&(n.current=a),n}function dA(n,a){var s=x.useState(function(){return{value:n,callback:a,facade:{get current(){return s.value},set current(i){var l=s.value;l!==i&&(s.value=i,s.callback(i,l))}}}})[0];return s.callback=a,s.facade}var hA=typeof window<"u"?x.useLayoutEffect:x.useEffect,lv=new WeakMap;function mA(n,a){var s=dA(null,function(i){return n.forEach(function(l){return Vf(l,i)})});return hA(function(){var i=lv.get(s);if(i){var l=new Set(i),u=new Set(n),d=s.current;l.forEach(function(h){u.has(h)||Vf(h,null)}),u.forEach(function(h){l.has(h)||Vf(h,d)})}lv.set(s,n)},[n]),s}function gA(n){return n}function pA(n,a){a===void 0&&(a=gA);var s=[],i=!1,l={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:n},useMedium:function(u){var d=a(u,i);return s.push(d),function(){s=s.filter(function(h){return h!==d})}},assignSyncMedium:function(u){for(i=!0;s.length;){var d=s;s=[],d.forEach(u)}s={push:function(h){return u(h)},filter:function(){return s}}},assignMedium:function(u){i=!0;var d=[];if(s.length){var h=s;s=[],h.forEach(u),d=s}var m=function(){var v=d;d=[],v.forEach(u)},g=function(){return Promise.resolve().then(m)};g(),s={push:function(v){d.push(v),g()},filter:function(v){return d=d.filter(v),s}}}};return l}function yA(n){n===void 0&&(n={});var a=pA(null);return a.options=Dn({async:!0,ssr:!1},n),a}var Cb=function(n){var a=n.sideCar,s=Eb(n,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=a.read();if(!i)throw new Error("Sidecar medium not found");return x.createElement(i,Dn({},s))};Cb.isSideCarExport=!0;function vA(n,a){return n.useMedium(a),Cb}var Rb=yA(),If=function(){},Jl=x.forwardRef(function(n,a){var s=x.useRef(null),i=x.useState({onScrollCapture:If,onWheelCapture:If,onTouchMoveCapture:If}),l=i[0],u=i[1],d=n.forwardProps,h=n.children,m=n.className,g=n.removeScrollBar,v=n.enabled,T=n.shards,S=n.sideCar,w=n.noRelative,N=n.noIsolation,E=n.inert,C=n.allowPinchZoom,j=n.as,M=j===void 0?"div":j,_=n.gapMode,z=Eb(n,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=S,$=mA([s,a]),I=Dn(Dn({},z),l);return x.createElement(x.Fragment,null,v&&x.createElement(k,{sideCar:Rb,removeScrollBar:g,shards:T,noRelative:w,noIsolation:N,inert:E,setCallbacks:u,allowPinchZoom:!!C,lockRef:s,gapMode:_}),d?x.cloneElement(x.Children.only(h),Dn(Dn({},I),{ref:$})):x.createElement(M,Dn({},I,{className:m,ref:$}),h))});Jl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Jl.classNames={fullWidth:Tl,zeroRight:Sl};var bA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function xA(){if(!document)return null;var n=document.createElement("style");n.type="text/css";var a=bA();return a&&n.setAttribute("nonce",a),n}function wA(n,a){n.styleSheet?n.styleSheet.cssText=a:n.appendChild(document.createTextNode(a))}function SA(n){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(n)}var TA=function(){var n=0,a=null;return{add:function(s){n==0&&(a=xA())&&(wA(a,s),SA(a)),n++},remove:function(){n--,!n&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},EA=function(){var n=TA();return function(a,s){x.useEffect(function(){return n.add(a),function(){n.remove()}},[a&&s])}},Nb=function(){var n=EA(),a=function(s){var i=s.styles,l=s.dynamic;return n(i,l),null};return a},CA={left:0,top:0,right:0,gap:0},Hf=function(n){return parseInt(n||"",10)||0},RA=function(n){var a=window.getComputedStyle(document.body),s=a[n==="padding"?"paddingLeft":"marginLeft"],i=a[n==="padding"?"paddingTop":"marginTop"],l=a[n==="padding"?"paddingRight":"marginRight"];return[Hf(s),Hf(i),Hf(l)]},NA=function(n){if(n===void 0&&(n="margin"),typeof window>"u")return CA;var a=RA(n),s=document.documentElement.clientWidth,i=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,i-s+a[2]-a[0])}},AA=Nb(),ls="data-scroll-locked",OA=function(n,a,s,i){var l=n.left,u=n.top,d=n.right,h=n.gap;return s===void 0&&(s="margin"),`
.`.concat(uA,` {
overflow: hidden `).concat(i,`;
padding-right: `).concat(h,"px ").concat(i,`;
}
body[`).concat(ls,`] {
overflow: hidden `).concat(i,`;
overscroll-behavior: contain;
`).concat([a&&"position: relative ".concat(i,";"),s==="margin"&&`
padding-left: `.concat(l,`px;
padding-top: `).concat(u,`px;
padding-right: `).concat(d,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(h,"px ").concat(i,`;
`),s==="padding"&&"padding-right: ".concat(h,"px ").concat(i,";")].filter(Boolean).join(""),`
}
.`).concat(Sl,` {
right: `).concat(h,"px ").concat(i,`;
}
.`).concat(Tl,` {
margin-right: `).concat(h,"px ").concat(i,`;
}
.`).concat(Sl," .").concat(Sl,` {
right: 0 `).concat(i,`;
}
.`).concat(Tl," .").concat(Tl,` {
margin-right: 0 `).concat(i,`;
}
body[`).concat(ls,`] {
`).concat(fA,": ").concat(h,`px;
}
`)},cv=function(){var n=parseInt(document.body.getAttribute(ls)||"0",10);return isFinite(n)?n:0},MA=function(){x.useEffect(function(){return document.body.setAttribute(ls,(cv()+1).toString()),function(){var n=cv()-1;n<=0?document.body.removeAttribute(ls):document.body.setAttribute(ls,n.toString())}},[])},_A=function(n){var a=n.noRelative,s=n.noImportant,i=n.gapMode,l=i===void 0?"margin":i;MA();var u=x.useMemo(function(){return NA(l)},[l]);return x.createElement(AA,{styles:OA(u,!a,l,s?"":"!important")})},ld=!1;if(typeof window<"u")try{var gl=Object.defineProperty({},"passive",{get:function(){return ld=!0,!0}});window.addEventListener("test",gl,gl),window.removeEventListener("test",gl,gl)}catch{ld=!1}var ts=ld?{passive:!1}:!1,jA=function(n){return n.tagName==="TEXTAREA"},Ab=function(n,a){if(!(n instanceof Element))return!1;var s=window.getComputedStyle(n);return s[a]!=="hidden"&&!(s.overflowY===s.overflowX&&!jA(n)&&s[a]==="visible")},DA=function(n){return Ab(n,"overflowY")},kA=function(n){return Ab(n,"overflowX")},uv=function(n,a){var s=a.ownerDocument,i=a;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var l=Ob(n,i);if(l){var u=Mb(n,i),d=u[1],h=u[2];if(d>h)return!0}i=i.parentNode}while(i&&i!==s.body);return!1},LA=function(n){var a=n.scrollTop,s=n.scrollHeight,i=n.clientHeight;return[a,s,i]},qA=function(n){var a=n.scrollLeft,s=n.scrollWidth,i=n.clientWidth;return[a,s,i]},Ob=function(n,a){return n==="v"?DA(a):kA(a)},Mb=function(n,a){return n==="v"?LA(a):qA(a)},zA=function(n,a){return n==="h"&&a==="rtl"?-1:1},UA=function(n,a,s,i,l){var u=zA(n,window.getComputedStyle(a).direction),d=u*i,h=s.target,m=a.contains(h),g=!1,v=d>0,T=0,S=0;do{if(!h)break;var w=Mb(n,h),N=w[0],E=w[1],C=w[2],j=E-C-u*N;(N||j)&&Ob(n,h)&&(T+=j,S+=N);var M=h.parentNode;h=M&&M.nodeType===Node.DOCUMENT_FRAGMENT_NODE?M.host:M}while(!m&&h!==document.body||m&&(a.contains(h)||a===h));return(v&&Math.abs(T)<1||!v&&Math.abs(S)<1)&&(g=!0),g},pl=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},fv=function(n){return[n.deltaX,n.deltaY]},dv=function(n){return n&&"current"in n?n.current:n},BA=function(n,a){return n[0]===a[0]&&n[1]===a[1]},PA=function(n){return`
.block-interactivity-`.concat(n,` {pointer-events: none;}
.allow-interactivity-`).concat(n,` {pointer-events: all;}
`)},VA=0,ns=[];function IA(n){var a=x.useRef([]),s=x.useRef([0,0]),i=x.useRef(),l=x.useState(VA++)[0],u=x.useState(Nb)[0],d=x.useRef(n);x.useEffect(function(){d.current=n},[n]),x.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(l));var E=cA([n.lockRef.current],(n.shards||[]).map(dv),!0).filter(Boolean);return E.forEach(function(C){return C.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),E.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(l))})}}},[n.inert,n.lockRef.current,n.shards]);var h=x.useCallback(function(E,C){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!d.current.allowPinchZoom;var j=pl(E),M=s.current,_="deltaX"in E?E.deltaX:M[0]-j[0],z="deltaY"in E?E.deltaY:M[1]-j[1],k,$=E.target,I=Math.abs(_)>Math.abs(z)?"h":"v";if("touches"in E&&I==="h"&&$.type==="range")return!1;var ae=uv(I,$);if(!ae)return!0;if(ae?k=I:(k=I==="v"?"h":"v",ae=uv(I,$)),!ae)return!1;if(!i.current&&"changedTouches"in E&&(_||z)&&(i.current=k),!k)return!0;var le=i.current||k;return UA(le,C,E,le==="h"?_:z)},[]),m=x.useCallback(function(E){var C=E;if(!(!ns.length||ns[ns.length-1]!==u)){var j="deltaY"in C?fv(C):pl(C),M=a.current.filter(function(k){return k.name===C.type&&(k.target===C.target||C.target===k.shadowParent)&&BA(k.delta,j)})[0];if(M&&M.should){C.cancelable&&C.preventDefault();return}if(!M){var _=(d.current.shards||[]).map(dv).filter(Boolean).filter(function(k){return k.contains(C.target)}),z=_.length>0?h(C,_[0]):!d.current.noIsolation;z&&C.cancelable&&C.preventDefault()}}},[]),g=x.useCallback(function(E,C,j,M){var _={name:E,delta:C,target:j,should:M,shadowParent:HA(j)};a.current.push(_),setTimeout(function(){a.current=a.current.filter(function(z){return z!==_})},1)},[]),v=x.useCallback(function(E){s.current=pl(E),i.current=void 0},[]),T=x.useCallback(function(E){g(E.type,fv(E),E.target,h(E,n.lockRef.current))},[]),S=x.useCallback(function(E){g(E.type,pl(E),E.target,h(E,n.lockRef.current))},[]);x.useEffect(function(){return ns.push(u),n.setCallbacks({onScrollCapture:T,onWheelCapture:T,onTouchMoveCapture:S}),document.addEventListener("wheel",m,ts),document.addEventListener("touchmove",m,ts),document.addEventListener("touchstart",v,ts),function(){ns=ns.filter(function(E){return E!==u}),document.removeEventListener("wheel",m,ts),document.removeEventListener("touchmove",m,ts),document.removeEventListener("touchstart",v,ts)}},[]);var w=n.removeScrollBar,N=n.inert;return x.createElement(x.Fragment,null,N?x.createElement(u,{styles:PA(l)}):null,w?x.createElement(_A,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function HA(n){for(var a=null;n!==null;)n instanceof ShadowRoot&&(a=n.host,n=n.host),n=n.parentNode;return a}const YA=vA(Rb,IA);var _b=x.forwardRef(function(n,a){return x.createElement(Jl,Dn({},n,{ref:a,sideCar:YA}))});_b.classNames=Jl.classNames;var QA=[" ","Enter","ArrowUp","ArrowDown"],GA=[" ","Enter"],fr="Select",[ec,tc,$A]=jv(fr),[vs,z_]=Vi(fr,[$A,Gl]),nc=Gl(),[XA,Ba]=vs(fr),[KA,FA]=vs(fr),jb=n=>{const{__scopeSelect:a,children:s,open:i,defaultOpen:l,onOpenChange:u,value:d,defaultValue:h,onValueChange:m,dir:g,name:v,autoComplete:T,disabled:S,required:w,form:N}=n,E=nc(a),[C,j]=x.useState(null),[M,_]=x.useState(null),[z,k]=x.useState(!1),$=KN(g),[I,ae]=Gf({prop:i,defaultProp:l??!1,onChange:u,caller:fr}),[le,he]=Gf({prop:d,defaultProp:h,onChange:m,caller:fr}),de=x.useRef(null),ee=C?N||!!C.closest("form"):!0,[me,Z]=x.useState(new Set),se=Array.from(me).map(L=>L.props.value).join(";");return y.jsx(GC,{...E,children:y.jsxs(XA,{required:w,scope:a,trigger:C,onTriggerChange:j,valueNode:M,onValueNodeChange:_,valueNodeHasChildren:z,onValueNodeHasChildrenChange:k,contentId:Ad(),value:le,onValueChange:he,open:I,onOpenChange:ae,dir:$,triggerPointerDownPosRef:de,disabled:S,children:[y.jsx(ec.Provider,{scope:a,children:y.jsx(KA,{scope:n.__scopeSelect,onNativeOptionAdd:x.useCallback(L=>{Z(Y=>new Set(Y).add(L))},[]),onNativeOptionRemove:x.useCallback(L=>{Z(Y=>{const K=new Set(Y);return K.delete(L),K})},[]),children:s})}),ee?y.jsxs(nx,{"aria-hidden":!0,required:w,tabIndex:-1,name:v,autoComplete:T,value:le,onChange:L=>he(L.target.value),disabled:S,form:N,children:[le===void 0?y.jsx("option",{value:""}):null,Array.from(me)]},se):null]})})};jb.displayName=fr;var Db="SelectTrigger",kb=x.forwardRef((n,a)=>{const{__scopeSelect:s,disabled:i=!1,...l}=n,u=nc(s),d=Ba(Db,s),h=d.disabled||i,m=Je(a,d.onTriggerChange),g=tc(s),v=x.useRef("touch"),[T,S,w]=rx(E=>{const C=g().filter(_=>!_.disabled),j=C.find(_=>_.value===d.value),M=sx(C,E,j);M!==void 0&&d.onValueChange(M.value)}),N=E=>{h||(d.onOpenChange(!0),w()),E&&(d.triggerPointerDownPosRef.current={x:Math.round(E.pageX),y:Math.round(E.pageY)})};return y.jsx(U0,{asChild:!0,...u,children:y.jsx(Ve.button,{type:"button",role:"combobox","aria-controls":d.contentId,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:h,"data-disabled":h?"":void 0,"data-placeholder":ax(d.value)?"":void 0,...l,ref:m,onClick:Ne(l.onClick,E=>{E.currentTarget.focus(),v.current!=="mouse"&&N(E)}),onPointerDown:Ne(l.onPointerDown,E=>{v.current=E.pointerType;const C=E.target;C.hasPointerCapture(E.pointerId)&&C.releasePointerCapture(E.pointerId),E.button===0&&E.ctrlKey===!1&&E.pointerType==="mouse"&&(N(E),E.preventDefault())}),onKeyDown:Ne(l.onKeyDown,E=>{const C=T.current!=="";!(E.ctrlKey||E.altKey||E.metaKey)&&E.key.length===1&&S(E.key),!(C&&E.key===" ")&&QA.includes(E.key)&&(N(),E.preventDefault())})})})});kb.displayName=Db;var Lb="SelectValue",qb=x.forwardRef((n,a)=>{const{__scopeSelect:s,className:i,style:l,children:u,placeholder:d="",...h}=n,m=Ba(Lb,s),{onValueNodeHasChildrenChange:g}=m,v=u!==void 0,T=Je(a,m.onValueNodeChange);return wt(()=>{g(v)},[g,v]),y.jsx(Ve.span,{...h,ref:T,style:{pointerEvents:"none"},children:ax(m.value)?y.jsx(y.Fragment,{children:d}):u})});qb.displayName=Lb;var ZA="SelectIcon",zb=x.forwardRef((n,a)=>{const{__scopeSelect:s,children:i,...l}=n;return y.jsx(Ve.span,{"aria-hidden":!0,...l,ref:a,children:i||"▼"})});zb.displayName=ZA;var WA="SelectPortal",Ub=n=>y.jsx(wd,{asChild:!0,...n});Ub.displayName=WA;var dr="SelectContent",Bb=x.forwardRef((n,a)=>{const s=Ba(dr,n.__scopeSelect),[i,l]=x.useState();if(wt(()=>{l(new DocumentFragment)},[]),!s.open){const u=i;return u?hs.createPortal(y.jsx(Pb,{scope:n.__scopeSelect,children:y.jsx(ec.Slot,{scope:n.__scopeSelect,children:y.jsx("div",{children:n.children})})}),u):null}return y.jsx(Vb,{...n,ref:a})});Bb.displayName=dr;var gn=10,[Pb,Pa]=vs(dr),JA="SelectContentImpl",eO=Oi("SelectContent.RemoveScroll"),Vb=x.forwardRef((n,a)=>{const{__scopeSelect:s,position:i="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,side:h,sideOffset:m,align:g,alignOffset:v,arrowPadding:T,collisionBoundary:S,collisionPadding:w,sticky:N,hideWhenDetached:E,avoidCollisions:C,...j}=n,M=Ba(dr,s),[_,z]=x.useState(null),[k,$]=x.useState(null),I=Je(a,re=>z(re)),[ae,le]=x.useState(null),[he,de]=x.useState(null),ee=tc(s),[me,Z]=x.useState(!1),se=x.useRef(!1);x.useEffect(()=>{if(_)return lA(_)},[_]),FN();const L=x.useCallback(re=>{const[fe,...je]=ee().map(Re=>Re.ref.current),[Ae]=je.slice(-1),we=document.activeElement;for(const Re of re)if(Re===we||(Re==null||Re.scrollIntoView({block:"nearest"}),Re===fe&&k&&(k.scrollTop=0),Re===Ae&&k&&(k.scrollTop=k.scrollHeight),Re==null||Re.focus(),document.activeElement!==we))return},[ee,k]),Y=x.useCallback(()=>L([ae,_]),[L,ae,_]);x.useEffect(()=>{me&&Y()},[me,Y]);const{onOpenChange:K,triggerPointerDownPosRef:J}=M;x.useEffect(()=>{if(_){let re={x:0,y:0};const fe=Ae=>{var we,Re;re={x:Math.abs(Math.round(Ae.pageX)-(((we=J.current)==null?void 0:we.x)??0)),y:Math.abs(Math.round(Ae.pageY)-(((Re=J.current)==null?void 0:Re.y)??0))}},je=Ae=>{re.x<=10&&re.y<=10?Ae.preventDefault():_.contains(Ae.target)||K(!1),document.removeEventListener("pointermove",fe),J.current=null};return J.current!==null&&(document.addEventListener("pointermove",fe),document.addEventListener("pointerup",je,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",fe),document.removeEventListener("pointerup",je,{capture:!0})}}},[_,K,J]),x.useEffect(()=>{const re=()=>K(!1);return window.addEventListener("blur",re),window.addEventListener("resize",re),()=>{window.removeEventListener("blur",re),window.removeEventListener("resize",re)}},[K]);const[A,H]=rx(re=>{const fe=ee().filter(we=>!we.disabled),je=fe.find(we=>we.ref.current===document.activeElement),Ae=sx(fe,re,je);Ae&&setTimeout(()=>Ae.ref.current.focus())}),W=x.useCallback((re,fe,je)=>{const Ae=!se.current&&!je;(M.value!==void 0&&M.value===fe||Ae)&&(le(re),Ae&&(se.current=!0))},[M.value]),F=x.useCallback(()=>_==null?void 0:_.focus(),[_]),te=x.useCallback((re,fe,je)=>{const Ae=!se.current&&!je;(M.value!==void 0&&M.value===fe||Ae)&&de(re)},[M.value]),ue=i==="popper"?cd:Ib,oe=ue===cd?{side:h,sideOffset:m,align:g,alignOffset:v,arrowPadding:T,collisionBoundary:S,collisionPadding:w,sticky:N,hideWhenDetached:E,avoidCollisions:C}:{};return y.jsx(Pb,{scope:s,content:_,viewport:k,onViewportChange:$,itemRefCallback:W,selectedItem:ae,onItemLeave:F,itemTextRefCallback:te,focusSelectedItem:Y,selectedItemText:he,position:i,isPositioned:me,searchRef:A,children:y.jsx(_b,{as:eO,allowPinchZoom:!0,children:y.jsx(wb,{asChild:!0,trapped:M.open,onMountAutoFocus:re=>{re.preventDefault()},onUnmountAutoFocus:Ne(l,re=>{var fe;(fe=M.trigger)==null||fe.focus({preventScroll:!0}),re.preventDefault()}),children:y.jsx(Bl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:re=>re.preventDefault(),onDismiss:()=>M.onOpenChange(!1),children:y.jsx(ue,{role:"listbox",id:M.contentId,"data-state":M.open?"open":"closed",dir:M.dir,onContextMenu:re=>re.preventDefault(),...j,...oe,onPlaced:()=>Z(!0),ref:I,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:Ne(j.onKeyDown,re=>{const fe=re.ctrlKey||re.altKey||re.metaKey;if(re.key==="Tab"&&re.preventDefault(),!fe&&re.key.length===1&&H(re.key),["ArrowUp","ArrowDown","Home","End"].includes(re.key)){let Ae=ee().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(re.key)&&(Ae=Ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(re.key)){const we=re.target,Re=Ae.indexOf(we);Ae=Ae.slice(Re+1)}setTimeout(()=>L(Ae)),re.preventDefault()}})})})})})})});Vb.displayName=JA;var tO="SelectItemAlignedPosition",Ib=x.forwardRef((n,a)=>{const{__scopeSelect:s,onPlaced:i,...l}=n,u=Ba(dr,s),d=Pa(dr,s),[h,m]=x.useState(null),[g,v]=x.useState(null),T=Je(a,I=>v(I)),S=tc(s),w=x.useRef(!1),N=x.useRef(!0),{viewport:E,selectedItem:C,selectedItemText:j,focusSelectedItem:M}=d,_=x.useCallback(()=>{if(u.trigger&&u.valueNode&&h&&g&&E&&C&&j){const I=u.trigger.getBoundingClientRect(),ae=g.getBoundingClientRect(),le=u.valueNode.getBoundingClientRect(),he=j.getBoundingClientRect();if(u.dir!=="rtl"){const we=he.left-ae.left,Re=le.left-we,nt=I.left-Re,Tt=I.width+nt,Bn=Math.max(Tt,ae.width),bn=window.innerWidth-gn,ut=nv(Re,[gn,Math.max(gn,bn-Bn)]);h.style.minWidth=Tt+"px",h.style.left=ut+"px"}else{const we=ae.right-he.right,Re=window.innerWidth-le.right-we,nt=window.innerWidth-I.right-Re,Tt=I.width+nt,Bn=Math.max(Tt,ae.width),bn=window.innerWidth-gn,ut=nv(Re,[gn,Math.max(gn,bn-Bn)]);h.style.minWidth=Tt+"px",h.style.right=ut+"px"}const de=S(),ee=window.innerHeight-gn*2,me=E.scrollHeight,Z=window.getComputedStyle(g),se=parseInt(Z.borderTopWidth,10),L=parseInt(Z.paddingTop,10),Y=parseInt(Z.borderBottomWidth,10),K=parseInt(Z.paddingBottom,10),J=se+L+me+K+Y,A=Math.min(C.offsetHeight*5,J),H=window.getComputedStyle(E),W=parseInt(H.paddingTop,10),F=parseInt(H.paddingBottom,10),te=I.top+I.height/2-gn,ue=ee-te,oe=C.offsetHeight/2,re=C.offsetTop+oe,fe=se+L+re,je=J-fe;if(fe<=te){const we=de.length>0&&C===de[de.length-1].ref.current;h.style.bottom="0px";const Re=g.clientHeight-E.offsetTop-E.offsetHeight,nt=Math.max(ue,oe+(we?F:0)+Re+Y),Tt=fe+nt;h.style.height=Tt+"px"}else{const we=de.length>0&&C===de[0].ref.current;h.style.top="0px";const nt=Math.max(te,se+E.offsetTop+(we?W:0)+oe)+je;h.style.height=nt+"px",E.scrollTop=fe-te+E.offsetTop}h.style.margin=`${gn}px 0`,h.style.minHeight=A+"px",h.style.maxHeight=ee+"px",i==null||i(),requestAnimationFrame(()=>w.current=!0)}},[S,u.trigger,u.valueNode,h,g,E,C,j,u.dir,i]);wt(()=>_(),[_]);const[z,k]=x.useState();wt(()=>{g&&k(window.getComputedStyle(g).zIndex)},[g]);const $=x.useCallback(I=>{I&&N.current===!0&&(_(),M==null||M(),N.current=!1)},[_,M]);return y.jsx(aO,{scope:s,contentWrapper:h,shouldExpandOnScrollRef:w,onScrollButtonChange:$,children:y.jsx("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:z},children:y.jsx(Ve.div,{...l,ref:T,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});Ib.displayName=tO;var nO="SelectPopperPosition",cd=x.forwardRef((n,a)=>{const{__scopeSelect:s,align:i="start",collisionPadding:l=gn,...u}=n,d=nc(s);return y.jsx(B0,{...d,...u,ref:a,align:i,collisionPadding:l,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});cd.displayName=nO;var[aO,nh]=vs(dr,{}),ud="SelectViewport",Hb=x.forwardRef((n,a)=>{const{__scopeSelect:s,nonce:i,...l}=n,u=Pa(ud,s),d=nh(ud,s),h=Je(a,u.onViewportChange),m=x.useRef(0);return y.jsxs(y.Fragment,{children:[y.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),y.jsx(ec.Slot,{scope:s,children:y.jsx(Ve.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:h,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:Ne(l.onScroll,g=>{const v=g.currentTarget,{contentWrapper:T,shouldExpandOnScrollRef:S}=d;if(S!=null&&S.current&&T){const w=Math.abs(m.current-v.scrollTop);if(w>0){const N=window.innerHeight-gn*2,E=parseFloat(T.style.minHeight),C=parseFloat(T.style.height),j=Math.max(E,C);if(j<N){const M=j+w,_=Math.min(N,M),z=M-_;T.style.height=_+"px",T.style.bottom==="0px"&&(v.scrollTop=z>0?z:0,T.style.justifyContent="flex-end")}}}m.current=v.scrollTop})})})]})});Hb.displayName=ud;var Yb="SelectGroup",[rO,sO]=vs(Yb),iO=x.forwardRef((n,a)=>{const{__scopeSelect:s,...i}=n,l=Ad();return y.jsx(rO,{scope:s,id:l,children:y.jsx(Ve.div,{role:"group","aria-labelledby":l,...i,ref:a})})});iO.displayName=Yb;var Qb="SelectLabel",Gb=x.forwardRef((n,a)=>{const{__scopeSelect:s,...i}=n,l=sO(Qb,s);return y.jsx(Ve.div,{id:l.id,...i,ref:a})});Gb.displayName=Qb;var kl="SelectItem",[oO,$b]=vs(kl),Xb=x.forwardRef((n,a)=>{const{__scopeSelect:s,value:i,disabled:l=!1,textValue:u,...d}=n,h=Ba(kl,s),m=Pa(kl,s),g=h.value===i,[v,T]=x.useState(u??""),[S,w]=x.useState(!1),N=Je(a,M=>{var _;return(_=m.itemRefCallback)==null?void 0:_.call(m,M,i,l)}),E=Ad(),C=x.useRef("touch"),j=()=>{l||(h.onValueChange(i),h.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return y.jsx(oO,{scope:s,value:i,disabled:l,textId:E,isSelected:g,onItemTextChange:x.useCallback(M=>{T(_=>_||((M==null?void 0:M.textContent)??"").trim())},[]),children:y.jsx(ec.ItemSlot,{scope:s,value:i,disabled:l,textValue:v,children:y.jsx(Ve.div,{role:"option","aria-labelledby":E,"data-highlighted":S?"":void 0,"aria-selected":g&&S,"data-state":g?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...d,ref:N,onFocus:Ne(d.onFocus,()=>w(!0)),onBlur:Ne(d.onBlur,()=>w(!1)),onClick:Ne(d.onClick,()=>{C.current!=="mouse"&&j()}),onPointerUp:Ne(d.onPointerUp,()=>{C.current==="mouse"&&j()}),onPointerDown:Ne(d.onPointerDown,M=>{C.current=M.pointerType}),onPointerMove:Ne(d.onPointerMove,M=>{var _;C.current=M.pointerType,l?(_=m.onItemLeave)==null||_.call(m):C.current==="mouse"&&M.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ne(d.onPointerLeave,M=>{var _;M.currentTarget===document.activeElement&&((_=m.onItemLeave)==null||_.call(m))}),onKeyDown:Ne(d.onKeyDown,M=>{var z;((z=m.searchRef)==null?void 0:z.current)!==""&&M.key===" "||(GA.includes(M.key)&&j(),M.key===" "&&M.preventDefault())})})})})});Xb.displayName=kl;var Ci="SelectItemText",Kb=x.forwardRef((n,a)=>{const{__scopeSelect:s,className:i,style:l,...u}=n,d=Ba(Ci,s),h=Pa(Ci,s),m=$b(Ci,s),g=FA(Ci,s),[v,T]=x.useState(null),S=Je(a,j=>T(j),m.onItemTextChange,j=>{var M;return(M=h.itemTextRefCallback)==null?void 0:M.call(h,j,m.value,m.disabled)}),w=v==null?void 0:v.textContent,N=x.useMemo(()=>y.jsx("option",{value:m.value,disabled:m.disabled,children:w},m.value),[m.disabled,m.value,w]),{onNativeOptionAdd:E,onNativeOptionRemove:C}=g;return wt(()=>(E(N),()=>C(N)),[E,C,N]),y.jsxs(y.Fragment,{children:[y.jsx(Ve.span,{id:m.textId,...u,ref:S}),m.isSelected&&d.valueNode&&!d.valueNodeHasChildren?hs.createPortal(u.children,d.valueNode):null]})});Kb.displayName=Ci;var Fb="SelectItemIndicator",Zb=x.forwardRef((n,a)=>{const{__scopeSelect:s,...i}=n;return $b(Fb,s).isSelected?y.jsx(Ve.span,{"aria-hidden":!0,...i,ref:a}):null});Zb.displayName=Fb;var fd="SelectScrollUpButton",Wb=x.forwardRef((n,a)=>{const s=Pa(fd,n.__scopeSelect),i=nh(fd,n.__scopeSelect),[l,u]=x.useState(!1),d=Je(a,i.onScrollButtonChange);return wt(()=>{if(s.viewport&&s.isPositioned){let h=function(){const g=m.scrollTop>0;u(g)};const m=s.viewport;return h(),m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)}},[s.viewport,s.isPositioned]),l?y.jsx(ex,{...n,ref:d,onAutoScroll:()=>{const{viewport:h,selectedItem:m}=s;h&&m&&(h.scrollTop=h.scrollTop-m.offsetHeight)}}):null});Wb.displayName=fd;var dd="SelectScrollDownButton",Jb=x.forwardRef((n,a)=>{const s=Pa(dd,n.__scopeSelect),i=nh(dd,n.__scopeSelect),[l,u]=x.useState(!1),d=Je(a,i.onScrollButtonChange);return wt(()=>{if(s.viewport&&s.isPositioned){let h=function(){const g=m.scrollHeight-m.clientHeight,v=Math.ceil(m.scrollTop)<g;u(v)};const m=s.viewport;return h(),m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)}},[s.viewport,s.isPositioned]),l?y.jsx(ex,{...n,ref:d,onAutoScroll:()=>{const{viewport:h,selectedItem:m}=s;h&&m&&(h.scrollTop=h.scrollTop+m.offsetHeight)}}):null});Jb.displayName=dd;var ex=x.forwardRef((n,a)=>{const{__scopeSelect:s,onAutoScroll:i,...l}=n,u=Pa("SelectScrollButton",s),d=x.useRef(null),h=tc(s),m=x.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return x.useEffect(()=>()=>m(),[m]),wt(()=>{var v;const g=h().find(T=>T.ref.current===document.activeElement);(v=g==null?void 0:g.ref.current)==null||v.scrollIntoView({block:"nearest"})},[h]),y.jsx(Ve.div,{"aria-hidden":!0,...l,ref:a,style:{flexShrink:0,...l.style},onPointerDown:Ne(l.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(i,50))}),onPointerMove:Ne(l.onPointerMove,()=>{var g;(g=u.onItemLeave)==null||g.call(u),d.current===null&&(d.current=window.setInterval(i,50))}),onPointerLeave:Ne(l.onPointerLeave,()=>{m()})})}),lO="SelectSeparator",tx=x.forwardRef((n,a)=>{const{__scopeSelect:s,...i}=n;return y.jsx(Ve.div,{"aria-hidden":!0,...i,ref:a})});tx.displayName=lO;var hd="SelectArrow",cO=x.forwardRef((n,a)=>{const{__scopeSelect:s,...i}=n,l=nc(s),u=Ba(hd,s),d=Pa(hd,s);return u.open&&d.position==="popper"?y.jsx(P0,{...l,...i,ref:a}):null});cO.displayName=hd;var uO="SelectBubbleInput",nx=x.forwardRef(({__scopeSelect:n,value:a,...s},i)=>{const l=x.useRef(null),u=Je(i,l),d=rA(a);return x.useEffect(()=>{const h=l.current;if(!h)return;const m=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(m,"value").set;if(d!==a&&v){const T=new Event("change",{bubbles:!0});v.call(h,a),h.dispatchEvent(T)}},[d,a]),y.jsx(Ve.select,{...s,style:{...zv,...s.style},ref:u,defaultValue:a})});nx.displayName=uO;function ax(n){return n===""||n===void 0}function rx(n){const a=pn(n),s=x.useRef(""),i=x.useRef(0),l=x.useCallback(d=>{const h=s.current+d;a(h),function m(g){s.current=g,window.clearTimeout(i.current),g!==""&&(i.current=window.setTimeout(()=>m(""),1e3))}(h)},[a]),u=x.useCallback(()=>{s.current="",window.clearTimeout(i.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(i.current),[]),[s,l,u]}function sx(n,a,s){const l=a.length>1&&Array.from(a).every(g=>g===a[0])?a[0]:a,u=s?n.indexOf(s):-1;let d=fO(n,Math.max(u,0));l.length===1&&(d=d.filter(g=>g!==s));const m=d.find(g=>g.textValue.toLowerCase().startsWith(l.toLowerCase()));return m!==s?m:void 0}function fO(n,a){return n.map((s,i)=>n[(a+i)%n.length])}var dO=jb,ix=kb,hO=qb,mO=zb,gO=Ub,ox=Bb,pO=Hb,lx=Gb,cx=Xb,yO=Kb,vO=Zb,ux=Wb,fx=Jb,dx=tx;const hx=dO,mx=hO,ah=x.forwardRef(({className:n,children:a,...s},i)=>y.jsxs(ix,{ref:i,className:St("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",n),...s,children:[a,y.jsx(mO,{asChild:!0,children:y.jsx(Il,{className:"h-4 w-4 opacity-50"})})]}));ah.displayName=ix.displayName;const gx=x.forwardRef(({className:n,...a},s)=>y.jsx(ux,{ref:s,className:St("flex cursor-default items-center justify-center py-1",n),...a,children:y.jsx(Rd,{className:"h-4 w-4"})}));gx.displayName=ux.displayName;const px=x.forwardRef(({className:n,...a},s)=>y.jsx(fx,{ref:s,className:St("flex cursor-default items-center justify-center py-1",n),...a,children:y.jsx(Il,{className:"h-4 w-4"})}));px.displayName=fx.displayName;const rh=x.forwardRef(({className:n,children:a,position:s="popper",...i},l)=>y.jsx(gO,{children:y.jsxs(ox,{ref:l,className:St("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:s,...i,children:[y.jsx(gx,{}),y.jsx(pO,{className:St("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),y.jsx(px,{})]})}));rh.displayName=ox.displayName;const bO=x.forwardRef(({className:n,...a},s)=>y.jsx(lx,{ref:s,className:St("py-1.5 pl-8 pr-2 text-sm font-semibold",n),...a}));bO.displayName=lx.displayName;const Ll=x.forwardRef(({className:n,children:a,...s},i)=>y.jsxs(cx,{ref:i,className:St("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...s,children:[y.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:y.jsx(vO,{children:y.jsx(cT,{className:"h-4 w-4"})})}),y.jsx(yO,{children:a})]}));Ll.displayName=cx.displayName;const xO=x.forwardRef(({className:n,...a},s)=>y.jsx(dx,{ref:s,className:St("-mx-1 my-1 h-px bg-muted",n),...a}));xO.displayName=dx.displayName;function He(n){const a=Object.prototype.toString.call(n);return n instanceof Date||typeof n=="object"&&a==="[object Date]"?new n.constructor(+n):typeof n=="number"||a==="[object Number]"||typeof n=="string"||a==="[object String]"?new Date(n):new Date(NaN)}function Ua(n,a){return n instanceof Date?new n.constructor(a):new Date(a)}const yx=6048e5,wO=864e5,yl=43200,hv=1440;let SO={};function Yi(){return SO}function Bi(n,a){var h,m,g,v;const s=Yi(),i=(a==null?void 0:a.weekStartsOn)??((m=(h=a==null?void 0:a.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??s.weekStartsOn??((v=(g=s.locale)==null?void 0:g.options)==null?void 0:v.weekStartsOn)??0,l=He(n),u=l.getDay(),d=(u<i?7:0)+u-i;return l.setDate(l.getDate()-d),l.setHours(0,0,0,0),l}function ql(n){return Bi(n,{weekStartsOn:1})}function vx(n){const a=He(n),s=a.getFullYear(),i=Ua(n,0);i.setFullYear(s+1,0,4),i.setHours(0,0,0,0);const l=ql(i),u=Ua(n,0);u.setFullYear(s,0,4),u.setHours(0,0,0,0);const d=ql(u);return a.getTime()>=l.getTime()?s+1:a.getTime()>=d.getTime()?s:s-1}function mv(n){const a=He(n);return a.setHours(0,0,0,0),a}function zl(n){const a=He(n),s=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()));return s.setUTCFullYear(a.getFullYear()),+n-+s}function TO(n,a){const s=mv(n),i=mv(a),l=+s-zl(s),u=+i-zl(i);return Math.round((l-u)/wO)}function EO(n){const a=vx(n),s=Ua(n,0);return s.setFullYear(a,0,4),s.setHours(0,0,0,0),ql(s)}function El(n,a){const s=He(n),i=He(a),l=s.getTime()-i.getTime();return l<0?-1:l>0?1:l}function CO(n){return Ua(n,Date.now())}function RO(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function NO(n){if(!RO(n)&&typeof n!="number")return!1;const a=He(n);return!isNaN(Number(a))}function AO(n,a){const s=He(n),i=He(a),l=s.getFullYear()-i.getFullYear(),u=s.getMonth()-i.getMonth();return l*12+u}function OO(n){return a=>{const i=(n?Math[n]:Math.trunc)(a);return i===0?0:i}}function MO(n,a){return+He(n)-+He(a)}function _O(n){const a=He(n);return a.setHours(23,59,59,999),a}function jO(n){const a=He(n),s=a.getMonth();return a.setFullYear(a.getFullYear(),s+1,0),a.setHours(23,59,59,999),a}function DO(n){const a=He(n);return+_O(a)==+jO(a)}function kO(n,a){const s=He(n),i=He(a),l=El(s,i),u=Math.abs(AO(s,i));let d;if(u<1)d=0;else{s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-l*u);let h=El(s,i)===-l;DO(He(n))&&u===1&&El(n,i)===1&&(h=!1),d=l*(u-Number(h))}return d===0?0:d}function LO(n,a,s){const i=MO(n,a)/1e3;return OO(s==null?void 0:s.roundingMethod)(i)}function qO(n){const a=He(n),s=Ua(n,0);return s.setFullYear(a.getFullYear(),0,1),s.setHours(0,0,0,0),s}const zO={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},UO=(n,a,s)=>{let i;const l=zO[n];return typeof l=="string"?i=l:a===1?i=l.one:i=l.other.replace("{{count}}",a.toString()),s!=null&&s.addSuffix?s.comparison&&s.comparison>0?"in "+i:i+" ago":i};function Yf(n){return(a={})=>{const s=a.width?String(a.width):n.defaultWidth;return n.formats[s]||n.formats[n.defaultWidth]}}const BO={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},PO={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},VO={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},IO={date:Yf({formats:BO,defaultWidth:"full"}),time:Yf({formats:PO,defaultWidth:"full"}),dateTime:Yf({formats:VO,defaultWidth:"full"})},HO={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},YO=(n,a,s,i)=>HO[n];function wi(n){return(a,s)=>{const i=s!=null&&s.context?String(s.context):"standalone";let l;if(i==="formatting"&&n.formattingValues){const d=n.defaultFormattingWidth||n.defaultWidth,h=s!=null&&s.width?String(s.width):d;l=n.formattingValues[h]||n.formattingValues[d]}else{const d=n.defaultWidth,h=s!=null&&s.width?String(s.width):n.defaultWidth;l=n.values[h]||n.values[d]}const u=n.argumentCallback?n.argumentCallback(a):a;return l[u]}}const QO={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},GO={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},$O={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},XO={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},KO={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},FO={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ZO=(n,a)=>{const s=Number(n),i=s%100;if(i>20||i<10)switch(i%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},WO={ordinalNumber:ZO,era:wi({values:QO,defaultWidth:"wide"}),quarter:wi({values:GO,defaultWidth:"wide",argumentCallback:n=>n-1}),month:wi({values:$O,defaultWidth:"wide"}),day:wi({values:XO,defaultWidth:"wide"}),dayPeriod:wi({values:KO,defaultWidth:"wide",formattingValues:FO,defaultFormattingWidth:"wide"})};function Si(n){return(a,s={})=>{const i=s.width,l=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],u=a.match(l);if(!u)return null;const d=u[0],h=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],m=Array.isArray(h)?eM(h,T=>T.test(d)):JO(h,T=>T.test(d));let g;g=n.valueCallback?n.valueCallback(m):m,g=s.valueCallback?s.valueCallback(g):g;const v=a.slice(d.length);return{value:g,rest:v}}}function JO(n,a){for(const s in n)if(Object.prototype.hasOwnProperty.call(n,s)&&a(n[s]))return s}function eM(n,a){for(let s=0;s<n.length;s++)if(a(n[s]))return s}function tM(n){return(a,s={})=>{const i=a.match(n.matchPattern);if(!i)return null;const l=i[0],u=a.match(n.parsePattern);if(!u)return null;let d=n.valueCallback?n.valueCallback(u[0]):u[0];d=s.valueCallback?s.valueCallback(d):d;const h=a.slice(l.length);return{value:d,rest:h}}}const nM=/^(\d+)(th|st|nd|rd)?/i,aM=/\d+/i,rM={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},sM={any:[/^b/i,/^(a|c)/i]},iM={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},oM={any:[/1/i,/2/i,/3/i,/4/i]},lM={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},cM={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},uM={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},fM={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},dM={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},hM={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},mM={ordinalNumber:tM({matchPattern:nM,parsePattern:aM,valueCallback:n=>parseInt(n,10)}),era:Si({matchPatterns:rM,defaultMatchWidth:"wide",parsePatterns:sM,defaultParseWidth:"any"}),quarter:Si({matchPatterns:iM,defaultMatchWidth:"wide",parsePatterns:oM,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Si({matchPatterns:lM,defaultMatchWidth:"wide",parsePatterns:cM,defaultParseWidth:"any"}),day:Si({matchPatterns:uM,defaultMatchWidth:"wide",parsePatterns:fM,defaultParseWidth:"any"}),dayPeriod:Si({matchPatterns:dM,defaultMatchWidth:"any",parsePatterns:hM,defaultParseWidth:"any"})},bx={code:"en-US",formatDistance:UO,formatLong:IO,formatRelative:YO,localize:WO,match:mM,options:{weekStartsOn:0,firstWeekContainsDate:1}};function gM(n){const a=He(n);return TO(a,qO(a))+1}function pM(n){const a=He(n),s=+ql(a)-+EO(a);return Math.round(s/yx)+1}function xx(n,a){var v,T,S,w;const s=He(n),i=s.getFullYear(),l=Yi(),u=(a==null?void 0:a.firstWeekContainsDate)??((T=(v=a==null?void 0:a.locale)==null?void 0:v.options)==null?void 0:T.firstWeekContainsDate)??l.firstWeekContainsDate??((w=(S=l.locale)==null?void 0:S.options)==null?void 0:w.firstWeekContainsDate)??1,d=Ua(n,0);d.setFullYear(i+1,0,u),d.setHours(0,0,0,0);const h=Bi(d,a),m=Ua(n,0);m.setFullYear(i,0,u),m.setHours(0,0,0,0);const g=Bi(m,a);return s.getTime()>=h.getTime()?i+1:s.getTime()>=g.getTime()?i:i-1}function yM(n,a){var h,m,g,v;const s=Yi(),i=(a==null?void 0:a.firstWeekContainsDate)??((m=(h=a==null?void 0:a.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??s.firstWeekContainsDate??((v=(g=s.locale)==null?void 0:g.options)==null?void 0:v.firstWeekContainsDate)??1,l=xx(n,a),u=Ua(n,0);return u.setFullYear(l,0,i),u.setHours(0,0,0,0),Bi(u,a)}function vM(n,a){const s=He(n),i=+Bi(s,a)-+yM(s,a);return Math.round(i/yx)+1}function qe(n,a){const s=n<0?"-":"",i=Math.abs(n).toString().padStart(a,"0");return s+i}const Da={y(n,a){const s=n.getFullYear(),i=s>0?s:1-s;return qe(a==="yy"?i%100:i,a.length)},M(n,a){const s=n.getMonth();return a==="M"?String(s+1):qe(s+1,2)},d(n,a){return qe(n.getDate(),a.length)},a(n,a){const s=n.getHours()/12>=1?"pm":"am";switch(a){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];case"aaaa":default:return s==="am"?"a.m.":"p.m."}},h(n,a){return qe(n.getHours()%12||12,a.length)},H(n,a){return qe(n.getHours(),a.length)},m(n,a){return qe(n.getMinutes(),a.length)},s(n,a){return qe(n.getSeconds(),a.length)},S(n,a){const s=a.length,i=n.getMilliseconds(),l=Math.trunc(i*Math.pow(10,s-3));return qe(l,a.length)}},as={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},gv={G:function(n,a,s){const i=n.getFullYear()>0?1:0;switch(a){case"G":case"GG":case"GGG":return s.era(i,{width:"abbreviated"});case"GGGGG":return s.era(i,{width:"narrow"});case"GGGG":default:return s.era(i,{width:"wide"})}},y:function(n,a,s){if(a==="yo"){const i=n.getFullYear(),l=i>0?i:1-i;return s.ordinalNumber(l,{unit:"year"})}return Da.y(n,a)},Y:function(n,a,s,i){const l=xx(n,i),u=l>0?l:1-l;if(a==="YY"){const d=u%100;return qe(d,2)}return a==="Yo"?s.ordinalNumber(u,{unit:"year"}):qe(u,a.length)},R:function(n,a){const s=vx(n);return qe(s,a.length)},u:function(n,a){const s=n.getFullYear();return qe(s,a.length)},Q:function(n,a,s){const i=Math.ceil((n.getMonth()+1)/3);switch(a){case"Q":return String(i);case"QQ":return qe(i,2);case"Qo":return s.ordinalNumber(i,{unit:"quarter"});case"QQQ":return s.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,a,s){const i=Math.ceil((n.getMonth()+1)/3);switch(a){case"q":return String(i);case"qq":return qe(i,2);case"qo":return s.ordinalNumber(i,{unit:"quarter"});case"qqq":return s.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,a,s){const i=n.getMonth();switch(a){case"M":case"MM":return Da.M(n,a);case"Mo":return s.ordinalNumber(i+1,{unit:"month"});case"MMM":return s.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(i,{width:"wide",context:"formatting"})}},L:function(n,a,s){const i=n.getMonth();switch(a){case"L":return String(i+1);case"LL":return qe(i+1,2);case"Lo":return s.ordinalNumber(i+1,{unit:"month"});case"LLL":return s.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(i,{width:"wide",context:"standalone"})}},w:function(n,a,s,i){const l=vM(n,i);return a==="wo"?s.ordinalNumber(l,{unit:"week"}):qe(l,a.length)},I:function(n,a,s){const i=pM(n);return a==="Io"?s.ordinalNumber(i,{unit:"week"}):qe(i,a.length)},d:function(n,a,s){return a==="do"?s.ordinalNumber(n.getDate(),{unit:"date"}):Da.d(n,a)},D:function(n,a,s){const i=gM(n);return a==="Do"?s.ordinalNumber(i,{unit:"dayOfYear"}):qe(i,a.length)},E:function(n,a,s){const i=n.getDay();switch(a){case"E":case"EE":case"EEE":return s.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(i,{width:"short",context:"formatting"});case"EEEE":default:return s.day(i,{width:"wide",context:"formatting"})}},e:function(n,a,s,i){const l=n.getDay(),u=(l-i.weekStartsOn+8)%7||7;switch(a){case"e":return String(u);case"ee":return qe(u,2);case"eo":return s.ordinalNumber(u,{unit:"day"});case"eee":return s.day(l,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(l,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(l,{width:"short",context:"formatting"});case"eeee":default:return s.day(l,{width:"wide",context:"formatting"})}},c:function(n,a,s,i){const l=n.getDay(),u=(l-i.weekStartsOn+8)%7||7;switch(a){case"c":return String(u);case"cc":return qe(u,a.length);case"co":return s.ordinalNumber(u,{unit:"day"});case"ccc":return s.day(l,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(l,{width:"narrow",context:"standalone"});case"cccccc":return s.day(l,{width:"short",context:"standalone"});case"cccc":default:return s.day(l,{width:"wide",context:"standalone"})}},i:function(n,a,s){const i=n.getDay(),l=i===0?7:i;switch(a){case"i":return String(l);case"ii":return qe(l,a.length);case"io":return s.ordinalNumber(l,{unit:"day"});case"iii":return s.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(i,{width:"short",context:"formatting"});case"iiii":default:return s.day(i,{width:"wide",context:"formatting"})}},a:function(n,a,s){const l=n.getHours()/12>=1?"pm":"am";switch(a){case"a":case"aa":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(n,a,s){const i=n.getHours();let l;switch(i===12?l=as.noon:i===0?l=as.midnight:l=i/12>=1?"pm":"am",a){case"b":case"bb":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(n,a,s){const i=n.getHours();let l;switch(i>=17?l=as.evening:i>=12?l=as.afternoon:i>=4?l=as.morning:l=as.night,a){case"B":case"BB":case"BBB":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(n,a,s){if(a==="ho"){let i=n.getHours()%12;return i===0&&(i=12),s.ordinalNumber(i,{unit:"hour"})}return Da.h(n,a)},H:function(n,a,s){return a==="Ho"?s.ordinalNumber(n.getHours(),{unit:"hour"}):Da.H(n,a)},K:function(n,a,s){const i=n.getHours()%12;return a==="Ko"?s.ordinalNumber(i,{unit:"hour"}):qe(i,a.length)},k:function(n,a,s){let i=n.getHours();return i===0&&(i=24),a==="ko"?s.ordinalNumber(i,{unit:"hour"}):qe(i,a.length)},m:function(n,a,s){return a==="mo"?s.ordinalNumber(n.getMinutes(),{unit:"minute"}):Da.m(n,a)},s:function(n,a,s){return a==="so"?s.ordinalNumber(n.getSeconds(),{unit:"second"}):Da.s(n,a)},S:function(n,a){return Da.S(n,a)},X:function(n,a,s){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(a){case"X":return yv(i);case"XXXX":case"XX":return ir(i);case"XXXXX":case"XXX":default:return ir(i,":")}},x:function(n,a,s){const i=n.getTimezoneOffset();switch(a){case"x":return yv(i);case"xxxx":case"xx":return ir(i);case"xxxxx":case"xxx":default:return ir(i,":")}},O:function(n,a,s){const i=n.getTimezoneOffset();switch(a){case"O":case"OO":case"OOO":return"GMT"+pv(i,":");case"OOOO":default:return"GMT"+ir(i,":")}},z:function(n,a,s){const i=n.getTimezoneOffset();switch(a){case"z":case"zz":case"zzz":return"GMT"+pv(i,":");case"zzzz":default:return"GMT"+ir(i,":")}},t:function(n,a,s){const i=Math.trunc(n.getTime()/1e3);return qe(i,a.length)},T:function(n,a,s){const i=n.getTime();return qe(i,a.length)}};function pv(n,a=""){const s=n>0?"-":"+",i=Math.abs(n),l=Math.trunc(i/60),u=i%60;return u===0?s+String(l):s+String(l)+a+qe(u,2)}function yv(n,a){return n%60===0?(n>0?"-":"+")+qe(Math.abs(n)/60,2):ir(n,a)}function ir(n,a=""){const s=n>0?"-":"+",i=Math.abs(n),l=qe(Math.trunc(i/60),2),u=qe(i%60,2);return s+l+a+u}const vv=(n,a)=>{switch(n){case"P":return a.date({width:"short"});case"PP":return a.date({width:"medium"});case"PPP":return a.date({width:"long"});case"PPPP":default:return a.date({width:"full"})}},wx=(n,a)=>{switch(n){case"p":return a.time({width:"short"});case"pp":return a.time({width:"medium"});case"ppp":return a.time({width:"long"});case"pppp":default:return a.time({width:"full"})}},bM=(n,a)=>{const s=n.match(/(P+)(p+)?/)||[],i=s[1],l=s[2];if(!l)return vv(n,a);let u;switch(i){case"P":u=a.dateTime({width:"short"});break;case"PP":u=a.dateTime({width:"medium"});break;case"PPP":u=a.dateTime({width:"long"});break;case"PPPP":default:u=a.dateTime({width:"full"});break}return u.replace("{{date}}",vv(i,a)).replace("{{time}}",wx(l,a))},xM={p:wx,P:bM},wM=/^D+$/,SM=/^Y+$/,TM=["D","DD","YY","YYYY"];function EM(n){return wM.test(n)}function CM(n){return SM.test(n)}function RM(n,a,s){const i=NM(n,a,s);if(console.warn(i),TM.includes(n))throw new RangeError(i)}function NM(n,a,s){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${a}\`) for formatting ${i} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const AM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,OM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,MM=/^'([^]*?)'?$/,_M=/''/g,jM=/[a-zA-Z]/;function bv(n,a,s){var v,T,S,w;const i=Yi(),l=i.locale??bx,u=i.firstWeekContainsDate??((T=(v=i.locale)==null?void 0:v.options)==null?void 0:T.firstWeekContainsDate)??1,d=i.weekStartsOn??((w=(S=i.locale)==null?void 0:S.options)==null?void 0:w.weekStartsOn)??0,h=He(n);if(!NO(h))throw new RangeError("Invalid time value");let m=a.match(OM).map(N=>{const E=N[0];if(E==="p"||E==="P"){const C=xM[E];return C(N,l.formatLong)}return N}).join("").match(AM).map(N=>{if(N==="''")return{isToken:!1,value:"'"};const E=N[0];if(E==="'")return{isToken:!1,value:DM(N)};if(gv[E])return{isToken:!0,value:N};if(E.match(jM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+E+"`");return{isToken:!1,value:N}});l.localize.preprocessor&&(m=l.localize.preprocessor(h,m));const g={firstWeekContainsDate:u,weekStartsOn:d,locale:l};return m.map(N=>{if(!N.isToken)return N.value;const E=N.value;(CM(E)||EM(E))&&RM(E,a,String(n));const C=gv[E[0]];return C(h,E,l.localize,g)}).join("")}function DM(n){const a=n.match(MM);return a?a[1].replace(_M,"'"):n}function kM(n,a,s){const i=Yi(),l=(s==null?void 0:s.locale)??i.locale??bx,u=2520,d=El(n,a);if(isNaN(d))throw new RangeError("Invalid time value");const h=Object.assign({},s,{addSuffix:s==null?void 0:s.addSuffix,comparison:d});let m,g;d>0?(m=He(a),g=He(n)):(m=He(n),g=He(a));const v=LO(g,m),T=(zl(g)-zl(m))/1e3,S=Math.round((v-T)/60);let w;if(S<2)return s!=null&&s.includeSeconds?v<5?l.formatDistance("lessThanXSeconds",5,h):v<10?l.formatDistance("lessThanXSeconds",10,h):v<20?l.formatDistance("lessThanXSeconds",20,h):v<40?l.formatDistance("halfAMinute",0,h):v<60?l.formatDistance("lessThanXMinutes",1,h):l.formatDistance("xMinutes",1,h):S===0?l.formatDistance("lessThanXMinutes",1,h):l.formatDistance("xMinutes",S,h);if(S<45)return l.formatDistance("xMinutes",S,h);if(S<90)return l.formatDistance("aboutXHours",1,h);if(S<hv){const N=Math.round(S/60);return l.formatDistance("aboutXHours",N,h)}else{if(S<u)return l.formatDistance("xDays",1,h);if(S<yl){const N=Math.round(S/hv);return l.formatDistance("xDays",N,h)}else if(S<yl*2)return w=Math.round(S/yl),l.formatDistance("aboutXMonths",w,h)}if(w=kO(g,m),w<12){const N=Math.round(S/yl);return l.formatDistance("xMonths",N,h)}else{const N=w%12,E=Math.trunc(w/12);return N<3?l.formatDistance("aboutXYears",E,h):N<9?l.formatDistance("overXYears",E,h):l.formatDistance("almostXYears",E+1,h)}}function Sx(n,a){return kM(n,CO(n),a)}const LM=({thread:n,isSelected:a,onClick:s})=>{const i=new Date(n._creationTime),l=new Date(n.lastMessageAt??n._creationTime),u=bv(l,"MMM d, yyyy"),d=Sx(l,{addSuffix:!0});return y.jsxs("div",{className:`p-3 border-b cursor-pointer transition-colors ${a?"bg-secondary":"hover:bg-muted"}`,onClick:s,children:[y.jsxs("div",{className:"flex justify-between items-start",children:[y.jsx("h3",{className:"font-medium text-sm",children:n.title??n.lastAgentName??n._id}),y.jsx("span",{className:"text-xs text-muted-foreground",children:d})]}),y.jsx("p",{className:"text-xs text-foreground/80 mt-1",children:n.summary}),y.jsx("p",{className:"text-xs text-muted-foreground mt-2 truncate",children:n.latestMessage}),y.jsxs("div",{className:"flex justify-between mt-2 text-xs text-muted-foreground",children:[y.jsxs("span",{children:["Created: ",bv(i,"MMM d")]}),y.jsxs("span",{children:["Updated: ",u]})]})]})},qM=({threads:n,selectedThreadId:a,onSelectThread:s,onLoadMore:i})=>y.jsxs("div",{className:"flex flex-col h-full",children:[y.jsx("div",{className:"flex-grow overflow-y-auto",children:n.map(l=>y.jsx(LM,{thread:l,isSelected:l._id===a,onClick:()=>s(l)},l._id))}),y.jsxs(Mt,{variant:"outline",className:"m-3 flex items-center justify-center gap-2",onClick:i,children:[y.jsx(oT,{size:16}),"Load More"]})]}),zM=({users:n,threads:a,selectedUserId:s,selectedThreadId:i,onSelectUserId:l,onSelectThread:u,onLoadMoreThreads:d,canLoadMoreThreads:h})=>y.jsxs("div",{className:"flex flex-col h-full border-r",children:[y.jsx("div",{className:"panel-header",children:y.jsxs(hx,{value:s||"no user",onValueChange:m=>l(m==="no user"?void 0:m),children:[y.jsx(ah,{children:y.jsx(mx,{placeholder:"Select a user"})}),y.jsxs(rh,{children:[y.jsx(Ll,{value:"no user",children:"No user"},"no user"),n.map(m=>y.jsx(Ll,{value:m._id,children:m.name},m._id))]})]})}),y.jsxs("div",{className:"panel-content",children:[y.jsx(qM,{threads:a,selectedThreadId:i,onSelectThread:u,onLoadMore:()=>d(10)}),h&&y.jsx(Mt,{variant:"outline",onClick:()=>d(10),children:"Load More"})]})]}),UM=({user:n,message:a,isSelected:s,onClick:i,onSelectToolCall:l,selectedToolCallId:u})=>{var T,S,w,N;const[d,h]=x.useState(null),m=new Date(a._creationTime),g=Sx(m,{addSuffix:!0}),v=(E,C)=>{C.stopPropagation(),h(d===E?null:E)};return y.jsxs("div",{className:`p-4 border-b cursor-pointer ${a.status==="failed"?"bg-red-100 border-red-400 text-red-800":s?"bg-secondary":"hover:bg-muted/50"}`,onClick:i,children:[y.jsxs("div",{className:"flex justify-between items-start mb-2",children:[y.jsx("div",{className:"flex items-center gap-2",children:((T=a.message)==null?void 0:T.role)==="user"?y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"w-6 h-6 flex items-center justify-center rounded-full bg-primary text-primary-foreground",children:y.jsx(fT,{size:14})}),y.jsx("span",{className:"font-medium",children:(n==null?void 0:n.name)??"User"})]}):y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"w-6 h-6 flex items-center justify-center rounded-full bg-ai text-white",children:y.jsx(lT,{size:14})}),y.jsx("span",{className:"font-medium text-ai",children:a.agentName})]})}),y.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[y.jsx("span",{children:g}),((S=a.usage)==null?void 0:S.totalTokens)&&y.jsxs("span",{className:"bg-secondary px-2 py-0.5 rounded-full",children:[a.usage.totalTokens," tokens"]})]})]}),a.text&&y.jsx("div",{className:((w=a.message)==null?void 0:w.role)==="user"?"message-bubble-user":"message-bubble-agent",children:a.text.split(`
`).map((E,C)=>y.jsx("div",{children:E},C))}),y.jsx("div",{className:"ml-6 mt-2",children:(N=a.message)==null?void 0:N.parts.map((E,C)=>{switch(E.type){case"tool-invocation":{const j=E.toolInvocation,M=d===j.toolCallId;return y.jsxs("div",{className:`tool-call-bubble mt-2 ${M?"bg-secondary border border-primary/30 rounded-lg":""}`,children:[y.jsxs("div",{className:"flex items-center gap-2 p-2 cursor-pointer",onClick:_=>v(j.toolCallId,_),children:[y.jsx("div",{className:"w-5 h-5 flex items-center justify-center rounded-full bg-muted-foreground text-muted",children:y.jsx(dT,{size:12})}),y.jsx("span",{className:"font-medium text-sm",children:j.toolName}),y.jsx(Mt,{variant:"ghost",size:"sm",className:"p-0 h-5 w-5 ml-auto",onClick:_=>{_.stopPropagation(),v(j.toolCallId,_)},children:M?y.jsx(Rd,{size:14}):y.jsx(Il,{size:14})})]}),M&&y.jsxs("div",{className:"mt-2 text-sm p-2",children:[y.jsxs("div",{className:"mb-2",children:[y.jsx("div",{className:"font-medium mb-1",children:"Arguments:"}),y.jsx("pre",{className:"bg-secondary p-2 rounded-md overflow-x-auto text-xs",children:JSON.stringify(j.args,null,2)})]}),j.state==="result"&&y.jsxs("div",{children:[y.jsx("div",{className:"font-medium mb-1",children:"Return Value:"}),y.jsx("pre",{className:"bg-secondary p-2 rounded-md overflow-x-auto text-xs",children:JSON.stringify(j.result,null,2)})]})]})]},j.toolCallId+" "+C)}case"reasoning":return y.jsx("div",{children:E.reasoning},a._id+" reasoning "+C);case"source":return y.jsx("div",{children:y.jsx("a",{href:E.source.url,target:"_blank",children:E.source.title??E.source.url})},a._id+" source "+C);case"file":return E.mimeType.startsWith("image/")?E.data.startsWith("http")?y.jsx("div",{className:"mt-2",children:y.jsx("img",{src:E.data,className:"rounded-lg max-w-full max-h-[300px]"})},a._id+" file "+C):y.jsx("div",{className:"mt-2",children:y.jsx("img",{src:URL.createObjectURL(new Blob([E.data],{type:E.mimeType})),className:"rounded-lg max-w-full max-h-[300px]"})},C):y.jsxs("a",{className:"mt-2",href:E.data,target:"_blank",children:[y.jsx(uT,{size:14}),y.jsx("span",{children:E.mimeType})]},C)}})})]})};function sh(n,a){return Object.fromEntries(Object.entries(n).filter(([s])=>!a.includes(s)))}function BM(n,a,s){if(typeof(s==null?void 0:s.initialNumItems)!="number"||s.initialNumItems<=0)throw new Error(`\`options.initialNumItems\` must be a positive number. Received \`${s==null?void 0:s.initialNumItems}\`.`);const i=a==="skip",l=i?{}:a,u=pt(n),d=x.useMemo(()=>()=>({query:n,args:l,nextPageKey:1,pageKeys:i?[]:[0],queries:i?{}:{0:{query:n,args:{...l,paginationOpts:{numItems:s.initialNumItems,cursor:null}}}},ongoingSplits:{},skip:i}),[JSON.stringify(_t(l)),u,s.initialNumItems,i]),[h,m]=x.useState(d);let g=h;(i!==h.skip||pt(n)!==pt(h.query)||JSON.stringify(_t(l))!==JSON.stringify(_t(h.args)))&&(g=d(),m(g));const T=Wl().logger,S=th(g.queries),[w,N]=x.useMemo(()=>{var M,_;let C;const j=[];for(const z of g.pageKeys){if(C=S[z],C===void 0)break;if(C instanceof Error){if(C.message.includes("InvalidCursor")||C instanceof qi&&typeof C.data=="object"&&((M=C.data)==null?void 0:M.isConvexSystemError)===!0&&((_=C.data)==null?void 0:_.paginationError)==="InvalidCursor")return T.warn("usePaginatedQuery hit error, resetting pagination state: "+C.message),m(d),[[],void 0];throw C}const k=g.ongoingSplits[z];if(k!==void 0?S[k[0]]!==void 0&&S[k[1]]!==void 0&&m(VM(z)):C.splitCursor&&(C.pageStatus==="SplitRecommended"||C.pageStatus==="SplitRequired"||C.page.length>s.initialNumItems)&&m(PM(z,C.splitCursor,C.continueCursor)),C.pageStatus==="SplitRequired")return[j,void 0];j.push(...C.page)}return[j,C]},[S,g.pageKeys,g.ongoingSplits,s.initialNumItems,d,T]),E=x.useMemo(()=>{if(N===void 0&&g.pageKeys.length<=1)return{status:"LoadingFirstPage",isLoading:!0,loadMore:M=>{}};if(N===void 0||g.ongoingSplits[g.pageKeys.at(-1)]!==void 0)return{status:"LoadingMore",isLoading:!0,loadMore:M=>{}};if(N.isDone)return{status:"Exhausted",isLoading:!1,loadMore:M=>{}};const C=N.continueCursor;let j=!1;return{status:"CanLoadMore",isLoading:!1,loadMore:M=>{j||(j=!0,m(_=>{let z=_.nextPageKey;const k={..._.queries};let $=_.ongoingSplits;const I=_.pageKeys.at(-1),ae=z;return k[ae]={query:_.query,args:{..._.args,paginationOpts:{...k[I].args.paginationOpts,endCursor:C}}},z++,$={...$,[I]:[ae,z]},k[z]={query:_.query,args:{..._.args,paginationOpts:{numItems:M,cursor:C}}},z++,{..._,nextPageKey:z,queries:k,ongoingSplits:$}}))}}},[N,g.nextPageKey]);return{results:w,...E}}function PM(n,a,s){return i=>{const l={...i.queries},u=i.nextPageKey,d=i.nextPageKey+1,h=i.nextPageKey+2;l[u]={query:i.query,args:{...i.args,paginationOpts:{...i.queries[n].args.paginationOpts,endCursor:a}}},l[d]={query:i.query,args:{...i.args,paginationOpts:{...i.queries[n].args.paginationOpts,cursor:a,endCursor:s}}};const m={...i.ongoingSplits};return m[n]=[u,d],{...i,nextPageKey:h,queries:l,ongoingSplits:m}}}function VM(n){return a=>{const s=a.ongoingSplits[n];if(s===void 0)return a;const i={...a.queries};delete i[n];const l={...a.ongoingSplits};delete l[n];let u=a.pageKeys.slice();const d=a.pageKeys.findIndex(h=>h===n);return d>=0&&(u=[...a.pageKeys.slice(0,d),...s,...a.pageKeys.slice(d+1)]),{...a,queries:i,pageKeys:u,ongoingSplits:l}}}function IM(n){return{...n,content:HM(n.content)}}function HM(n){return typeof n=="string"?n:n.map(a=>{switch(a.type){case"image":return{...a,image:xv(a.image)};case"file":return{...a,data:xv(a.data)};default:return a}})}function YM(n){if(typeof n=="string")return n.match(/^data:\w+\/\w+;base64/)?n.split(";")[0].split(":")[1]:"text/plain";if(n.byteLength<4)return"application/octet-stream";const s=[...new Uint8Array(n.slice(0,12))].map(l=>l.toString(16).padStart(2,"0")).join(""),i=l=>s.startsWith(l.toLowerCase());return i("89504e47")?"image/png":i("ffd8ffdb")||i("ffd8ffe0")||i("ffd8ffee")||i("ffd8ffe1")?"image/jpeg":i("47494638")?"image/gif":i("424d")?"image/bmp":i("52494646")&&s.substr(16,8)==="57454250"?"image/webp":i("49492a00")?"image/tiff":i("3c737667")||i("3c3f786d")?"image/svg+xml":i("494433")?"audio/mpeg":i("000001ba")||i("000001b3")?"video/mpeg":i("1a45dfa3")?"video/webm":i("00000018")&&s.substr(16,8)==="66747970"?"video/mp4":i("4f676753")?"audio/ogg":i("25504446")?"application/pdf":i("504b0304")||i("504b0506")||i("504b0708")?"application/zip":i("52617221")?"application/x-rar-compressed":i("7f454c46")?"application/x-elf":i("1f8b08")?"application/gzip":i("425a68")?"application/x-bzip2":i("3c3f786d6c")?"application/xml":"application/octet-stream"}function QM(n){return typeof n=="string"||n instanceof ArrayBuffer?n:n instanceof URL?n.toString():n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength)}function xv(n){return typeof n=="string"&&(n.startsWith("http://")||n.startsWith("https://"))?new URL(n):n}function wv(n){const a=QM(n.type==="image"?n.image:n.data);return{type:"file",data:a instanceof ArrayBuffer?GM(a):a,mimeType:n.mimeType??YM(a)}}function GM(n){return Buffer.from(n).toString("base64")}function $M(n){const a=[];let s;for(const i of n){const l=i.message&&IM(i.message),u=i.text??"",d=l==null?void 0:l.content,h=d&&typeof d!="string"?d:[];if(!l)continue;const m={id:i._id,createdAt:new Date(i._creationTime),order:i.order,stepOrder:i.stepOrder,status:i.streaming?"streaming":i.status,key:`${i.threadId}-${i.order}-${i.stepOrder}`};if(l.role==="system")a.push({...m,role:"system",content:u,agentName:i.agentName,parts:[{type:"text",text:u}]});else if(l.role==="user"){const g=[];u&&g.push({type:"text",text:u}),h.forEach(v=>{switch(v.type){case"file":case"image":g.push(wv(v));break}}),a.push({...m,role:"user",content:i.text??"",parts:g})}else{if(l.role==="tool"&&!s){console.warn("Tool message without preceding assistant message.. skipping",i);continue}s?s.status=i.streaming?"streaming":i.status:(s={...m,role:"assistant",agentName:i.agentName,content:"",parts:[]},a.push(s)),s.id=i._id,i.reasoning&&s.parts.push({type:"reasoning",reasoning:i.reasoning,details:i.reasoningDetails??[]}),i.text&&(s.parts.push({type:"text",text:i.text}),s.content+=i.text);for(const g of i.sources??[])s.parts.push({type:"source",source:g});for(const g of h)switch(g.type){case"file":case"image":s.parts.push(wv(g));break;case"tool-call":s.parts.push({type:"step-start"}),s.parts.push({type:"tool-invocation",toolInvocation:{state:"call",step:s.parts.filter(v=>v.type==="tool-invocation").length,toolCallId:g.toolCallId,toolName:g.toolName,args:g.args}});break;case"tool-result":{const v=s.parts.find(S=>S.type==="tool-invocation"&&S.toolInvocation.toolCallId===g.toolCallId),T={state:"result",toolCallId:g.toolCallId,toolName:g.toolName,args:v==null?void 0:v.toolInvocation.args,result:g.result,step:(v==null?void 0:v.toolInvocation.step)??s.parts.filter(S=>S.type==="tool-invocation").length};v?v.toolInvocation=T:(console.warn("Tool result without preceding tool call.. adding anyways",g),s.parts.push({type:"tool-invocation",toolInvocation:T}));break}}}!i.tool&&s&&s.parts.length>0&&(s=void 0)}return a}function XM(n,a,s,i){const l=[];let u=!1;for(const h of a){const m=i.filter(S=>S.streamId===h.streamId),g=s.find(S=>S.streamId===h.streamId),[v,T]=KM(n,h,g,m);l.push(v),T&&(u=!0)}for(const{streamId:h}of s)l.find(m=>m.streamId===h)||(u=!0);return[l.map(h=>h.messages).flat().sort((h,m)=>h.order-m.order||h.stepOrder-m.stepOrder),l,u]}function KM(n,a,s,i){var T;let l=!1,u=(s==null?void 0:s.cursor)??0,d=[];for(const S of i.sort((w,N)=>w.start-N.start)){if(S.parts.length===0){console.warn(`Got delta with no parts: ${JSON.stringify(S)}`);continue}if(u!==S.start)if(u>=S.end){console.debug(`Got duplicate delta for stream ${S.streamId} at ${S.start}`);continue}else if(u<S.start){console.warn(`Got delta for stream ${S.streamId} that has a gap ${u} -> ${S.start}`);continue}else throw new Error(`Got unexpected delta for stream ${S.streamId}: delta: ${S.start} -> ${S.end} existing cursor: ${u}`);l=!0,u=S.end,d.push(...S.parts)}if(s&&s.messages.length>0&&!l){const S=s.messages.at(-1);md(a.status)!==S.status&&(l=!0)}if(!l)return[s??{streamId:a.streamId,cursor:u,messages:[]},!1];const h=(s==null?void 0:s.messages)??[];let m;if(h.length>0){const S=h.at(-1);m={...S,message:FM(S.message),status:md(a.status)}}else{const S=Tv(n,a,d[0],h.length);d=d.slice(1),m=S}const g={streamId:a.streamId,cursor:u,messages:[...h.slice(0,-1),m]};let v=Sv(m);for(const S of d){let w;if((S.type==="source"||S.type==="tool-result")!==(m.message.role==="tool")){m=Tv(n,a,S,g.messages.length),v=Sv(m),g.messages.push(m);continue}switch(S.type){case"text-delta":m.text=(m.text??"")+S.textDelta,(v==null?void 0:v.type)==="text"?v.text=(v.text??"")+S.textDelta:w={type:"text",text:S.textDelta};break;case"tool-call-streaming-start":m.tool=!0,w={type:"tool-call",toolCallId:S.toolCallId,toolName:S.toolName,args:""};break;case"tool-call-delta":{if(m.tool=!0,(v==null?void 0:v.type)!=="tool-call")throw new Error("Expected last content to be a tool call");if(typeof v.args!="string")throw new Error("Expected args to be a string");v.args=(v.args??"")+S.argsTextDelta}break;case"tool-call":m.tool=!0,w=S;break;case"reasoning":m.reasoning=(m.reasoning??"")+S.textDelta,(v==null?void 0:v.type)==="reasoning"?v.text=(v.text??"")+S.textDelta:w={type:"reasoning",text:S.textDelta};break;case"source":m.sources||(m.sources=[]),m.sources.push(S.source);break;case"tool-result":w=S;break;default:console.warn(`Received unexpected part: ${JSON.stringify(S)}`);break}if(w){if(m.message.content||(m.message.content=[]),!Array.isArray((T=m.message)==null?void 0:T.content))throw new Error("Expected message content to be an array");m.message.content.push(w),v=w}}return[g,!0]}function FM(n){return n&&{...n,content:Array.isArray(n.content)?[...n.content]:n.content}}function Sv(n){var a;if(Array.isArray((a=n.message)==null?void 0:a.content))return n.message.content.at(-1)}function md(n){switch(n){case"streaming":return"pending";case"finished":return"success";case"aborted":return"failed";default:return"pending"}}function Tv(n,a,s,i){const{streamId:l,...u}=a,d={...u,_id:`${l}-${i}`,_creationTime:Date.now(),status:md(a.status),threadId:n,tool:!1};switch(s.type){case"text-delta":return{...d,message:{role:"assistant",content:[{type:"text",text:s.textDelta}]},text:s.textDelta};case"tool-call-streaming-start":return{...d,tool:!0,message:{role:"assistant",content:[{type:"tool-call",toolName:s.toolName,toolCallId:s.toolCallId,args:""}]}};case"reasoning":return{...d,message:{role:"assistant",content:[{type:"reasoning",text:s.textDelta}]},reasoning:s.textDelta};case"source":return console.warn("Received source part first??"),{...d,tool:!0,message:{role:"tool",content:[]},sources:[s.source]};case"tool-call":return{...d,tool:!0,message:{role:"assistant",content:[s]}};case"tool-call-delta":return console.warn("Received tool call delta part first??"),{...d,tool:!0,message:{role:"assistant",content:[{type:"tool-call",toolCallId:s.toolCallId,toolName:s.toolName,args:s.argsTextDelta}]}};case"tool-result":return{...d,tool:!0,message:{role:"tool",content:[s]}};default:throw new Error(`Unexpected part type: ${JSON.stringify(s)}`)}}function ZM(n,a,s){var d;const i=BM(n,a,{initialNumItems:s.initialNumItems}),l=WM(n,!s.stream||a==="skip"||i.status==="LoadingFirstPage"?"skip":{...a,startOrder:(d=i.results.at(-1))==null?void 0:d.order});return x.useMemo(()=>{const h=(l==null?void 0:l.map(m=>({...m,streaming:!m.status||m.status==="pending"})))??[];return{...i,results:i.results.map(m=>({...m,streaming:!1})).concat(h).sort((m,g)=>m.order===g.order?m.stepOrder-g.stepOrder:m.order-g.order).filter((m,g,v)=>!v[g-1]||m.order!==v[g-1].order||m.stepOrder!==v[g-1].stepOrder)}},[i,l])}function WM(n,a){const[s,i]=x.useState([]),l=x.useRef(0),u=a==="skip"?a:sh(a,["startOrder"]);a!=="skip"&&!l.current&&a.startOrder&&(l.current=a.startOrder);const d=od(n,u==="skip"?u:{...u,paginationOpts:{cursor:null,numItems:0},streamArgs:{kind:"list",startOrder:l.current}}),h=x.useMemo(()=>{if(!(d!=null&&d.streams))return[];if(d.streams.kind!=="list")throw new Error("Expected list streams");return d.streams.messages.map(({streamId:w})=>{const N=s.find(C=>C.streamId===w),E=(N==null?void 0:N.cursor)??0;return{streamId:w,cursor:E}})},[d,s]),m=od(n,u==="skip"||!d?"skip":{...u,paginationOpts:{cursor:null,numItems:0},streamArgs:{kind:"deltas",cursors:h}}),g=a==="skip"?void 0:a.threadId,[v,T,S]=x.useMemo(()=>{var w,N;if(!g)return[void 0,[],!1];if(!d)return[void 0,[],!1];if(m&&((w=m.streams)==null?void 0:w.kind)!=="deltas")throw new Error("Expected deltas streams");return XM(g,d.streams.messages,s,((N=m==null?void 0:m.streams)==null?void 0:N.deltas)??[])},[g,m,s,d]);if(g)return S&&i(T),v}const JM=({users:n,messages:a,selectedMessageId:s,onSelectMessage:i})=>{const[l,u]=x.useState(null),d=x.useRef(null),h=x.useMemo(()=>$M(a).map(T=>{const S=a.find(w=>w._id===T.id)??a.find(w=>w.id===T.id);return T.id=S._id,{...S,message:T}}),[a]),m=v=>{u(l===v?null:v)},g=()=>{var v;(v=d.current)==null||v.scrollIntoView({behavior:"smooth"})};return x.useEffect(()=>{g()},[a]),y.jsxs("div",{className:"flex flex-col min-h-0 h-full overflow-y-auto",children:[h.map(v=>y.jsx(UM,{user:n.find(T=>T._id===v.userId),message:v,isSelected:v._id===s,onClick:()=>{i(v._id),u(null)},onSelectToolCall:m,selectedToolCallId:l},v._id)),y.jsx("div",{ref:d})]})},Ul=x.forwardRef(({className:n,...a},s)=>y.jsx("textarea",{className:St("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),ref:s,...a}));Ul.displayName="Textarea";const gd=({title:n,children:a,defaultOpen:s=!1})=>{const[i,l]=x.useState(s);return y.jsxs("div",{className:"border rounded-md mb-4",children:[y.jsxs(Mt,{variant:"ghost",className:"w-full flex justify-between items-center p-3 text-left",onClick:()=>l(!i),children:[y.jsx("span",{className:"font-medium",children:n}),i?y.jsx(Rd,{size:16}):y.jsx(Il,{size:16})]}),i&&y.jsx("div",{className:"p-3 border-t",children:a})]})};p.string();p.float64();p.float64();p.boolean();p.int64();p.int64();p.any();p.null();p.bytes();p.optional(p.any());class pd extends Error{constructor(s,i,l){const u=`Validator error${l?` for ${l}`:""}: Expected \`${s}\`, got \`${i}\``;super(u);sl(this,"expected");sl(this,"got");sl(this,"path");this.expected=s,this.got=i,this.path=l,this.name="ValidationError"}}function rs(n,a,s){var d,h;let i=!0,l=n.kind,u;if(a===void 0)n.isOptional!=="optional"&&(i=!1);else switch(n.kind){case"null":{a!==null&&(i=!1);break}case"float64":{typeof a!="number"&&(l="number",i=!1);break}case"int64":{typeof a!="bigint"&&(l="bigint",i=!1);break}case"boolean":{typeof a!="boolean"&&(i=!1);break}case"string":{typeof a!="string"&&(i=!1);break}case"bytes":{a instanceof ArrayBuffer||(i=!1);break}case"any":break;case"literal":{a!==n.value&&(i=!1,l=n.value,["string","number","boolean","bigint"].includes(typeof a)&&(u=`"${a}"`));break}case"id":{typeof a!="string"?i=!1:s!=null&&s.db&&(l=`Id<${n.tableName}>`,s.db.normalizeId(n.tableName,a)||(i=!1));break}case"array":{if(!Array.isArray(a)){i=!1;break}for(const[m,g]of a.entries()){const v=`${(s==null?void 0:s._pathPrefix)??""}[${m}]`;if(i=rs(n.element,g,{...s,_pathPrefix:v}),!i){l=n.element.kind;break}}break}case"object":{if(typeof a!="object"||a===null){i=!1;break}const m=Object.getPrototypeOf(a);if(!(m===null||m===Object.prototype||((d=m==null?void 0:m.constructor)==null?void 0:d.name)==="Object")){l=(((h=m==null?void 0:m.constructor)==null?void 0:h.name)??typeof m)||"object",i=!1;break}for(const[v,T]of Object.entries(n.fields))if(i=rs(T,a[v],{...s,_pathPrefix:vl(s,v)}),!i)break;if(!(s!=null&&s.allowUnknownFields)){for(const v of Object.keys(a))if(n.fields[v]===void 0){if(s!=null&&s.throw)throw new pd("nothing",typeof a[v],vl(s,v));i=!1;break}}break}case"union":{i=!1;let m;for(const g of n.members)try{if(rs(g,a,s)){i=!0;break}}catch(v){m=v}if(!i&&m)throw m;break}case"record":{if(typeof a!="object"||a===null){i=!1;break}for(const[m,g]of Object.entries(a)){if(i=rs(n.key,m,{...s,_pathPrefix:vl(s,m)}),!i){l=n.key.kind;break}if(i=rs(n.value,g,{...s,_pathPrefix:vl(s,m)}),!i){l=n.value.kind;break}}break}}if(!i&&(s!=null&&s.throw))throw new pd(l,u??(a===null?"null":typeof a),s==null?void 0:s._pathPrefix);return i}function vl(n,a){return n!=null&&n._pathPrefix?`${n._pathPrefix}.${a}`:a}const yd=({defaultValue:n,onChange:a,validator:s})=>{const[i,l]=x.useState(null),[u,d]=x.useState(null);function h(){l(null),d(null)}const m=g=>{const v=g.target.value;if(v===""){h();return}l(v);try{const T=JSON.parse(v);rs(s,T,{throw:!0})&&(d(null),a==null||a(T))}catch(T){T instanceof pd?d(T.message):d("Invalid JSON")}};return y.jsxs("div",{className:"w-full",children:[y.jsx(Ul,{value:i??JSON.stringify(n,null,2),onChange:m,className:"font-mono text-sm h-72",rows:5}),u&&y.jsx("p",{className:"text-destructive text-sm mt-1",children:u})]})},Tx=(...n)=>p.union(...n.map(p.literal));p.string();p.float64();p.float64();p.boolean();p.int64();p.int64();p.any();p.null();p.bytes();p.optional(p.any());const Ex={model:p.string(),table:p.string(),userId:p.optional(p.string()),threadId:p.optional(p.string()),model_table_userId:p.optional(p.array(p.string())),model_table_threadId:p.optional(p.array(p.string())),vector:p.array(p.number())};p.object(sh(Ex,["model_table_userId","model_table_threadId"]));function e_(n){return _n(Ex).vectorIndex("vector",{vectorField:"vector",dimensions:n,filterFields:["model_table_userId","model_table_threadId"]}).index("model_table_threadId",["model","table","threadId"])}const ih=[128,256,512,768,1024,1408,1536,2048,3072,4096],Cx=ih.map(n=>`embeddings_${n}`),Rx=Tx(...ih);Tx(...Cx);const Ev=p.union(...Cx.map(n=>p.id(n))),t_=Object.fromEntries(ih.map(n=>[`embeddings_${n}`,e_(n)])),Pi=p.record(p.string(),p.record(p.string(),p.any())),Ut=p.optional(Pi),n_=Pi,Nx=Ut,Ax=p.union(p.literal("active"),p.literal("archived")),a_=p.union(p.literal("pending"),p.literal("success"),p.literal("failed"));p.union(p.literal("system"),p.literal("user"),p.literal("assistant"),p.literal("tool"));const Ox=p.object({type:p.literal("text"),text:p.string(),providerOptions:Ut}),r_=p.object({type:p.literal("image"),image:p.union(p.string(),p.bytes()),mimeType:p.optional(p.string()),providerOptions:Ut}),Mx=p.object({type:p.literal("file"),data:p.union(p.string(),p.bytes()),filename:p.optional(p.string()),mimeType:p.string(),providerOptions:Ut}),_x=p.union(p.string(),p.array(p.union(Ox,r_,Mx))),s_=p.object({type:p.literal("reasoning"),text:p.string(),signature:p.optional(p.string()),providerOptions:Ut}),i_=p.object({type:p.literal("redacted-reasoning"),data:p.string(),providerOptions:Ut}),jx=p.array(p.union(p.object({type:p.literal("text"),text:p.string(),signature:p.optional(p.string())}),p.object({type:p.literal("redacted"),data:p.string()}))),Dx=p.object({type:p.literal("tool-call"),toolCallId:p.string(),toolName:p.string(),args:p.any(),providerOptions:Ut}),kx=p.union(p.string(),p.array(p.union(Ox,Mx,s_,i_,Dx))),o_=p.array(p.union(p.object({type:p.literal("text"),text:p.string()}),p.object({type:p.literal("image"),data:p.string(),mimeType:p.optional(p.string())}))),Lx=p.object({type:p.literal("tool-result"),toolCallId:p.string(),toolName:p.string(),result:p.any(),args:p.optional(p.any()),experimental_content:p.optional(o_),isError:p.optional(p.boolean()),providerOptions:Ut}),qx=p.array(Lx);p.union(_x,kx,qx);const l_=p.object({role:p.literal("user"),content:_x,providerOptions:Ut}),c_=p.object({role:p.literal("assistant"),content:kx,providerOptions:Ut}),u_=p.object({role:p.literal("tool"),content:qx,providerOptions:Ut}),f_=p.object({role:p.literal("system"),content:p.string(),providerOptions:Ut}),ac=p.union(l_,c_,u_,f_),oh=p.object({sourceType:p.literal("url"),id:p.string(),url:p.string(),title:p.optional(p.string()),providerOptions:Ut}),d_=p.object({body:p.optional(p.any()),headers:p.optional(p.record(p.string(),p.string())),method:p.optional(p.string()),url:p.optional(p.string())}),h_=p.object({id:p.optional(p.string()),message:ac,fileId:p.optional(p.id("files"))});p.object({id:p.string(),timestamp:p.number(),modelId:p.string(),headers:p.optional(p.record(p.string(),p.string())),messages:p.array(h_),body:p.optional(p.any())});const m_=p.object({id:p.string(),timestamp:p.number(),modelId:p.string(),headers:p.optional(p.record(p.string(),p.string())),body:p.optional(p.any())}),lh=p.union(p.literal("stop"),p.literal("length"),p.literal("content-filter"),p.literal("tool-calls"),p.literal("error"),p.literal("other"),p.literal("unknown")),zx=p.object({promptTokens:p.number(),completionTokens:p.number(),totalTokens:p.number()}),ch=p.union(p.object({type:p.literal("unsupported-setting"),setting:p.string(),details:p.optional(p.string())}),p.object({type:p.literal("unsupported-tool"),tool:p.any(),details:p.optional(p.string())}),p.object({type:p.literal("other"),message:p.string()})),g_=p.object({id:p.optional(p.string()),message:ac,text:p.optional(p.string()),fileIds:p.optional(p.array(p.id("files"))),finishReason:p.optional(lh),model:p.optional(p.string()),provider:p.optional(p.string()),providerMetadata:Nx,sources:p.optional(p.array(oh)),reasoning:p.optional(p.string()),reasoningDetails:p.optional(jx),usage:p.optional(zx),warnings:p.optional(p.array(ch)),error:p.optional(p.string())});p.object({...g_.fields,fileIds:p.optional(p.array(p.string()))});p.object({model:p.string(),dimension:Rx,vectors:p.array(p.union(p.array(p.number()),p.null()))});p.object({request:d_,response:m_,finishReason:lh,usage:p.optional(p.any()),object:p.any(),error:p.optional(p.string()),warnings:p.optional(p.array(ch)),providerMetadata:Nx});const p_=p.object({limit:p.number(),textSearch:p.optional(p.boolean()),vectorSearch:p.optional(p.boolean()),vectorScoreThreshold:p.optional(p.number()),messageRange:p.optional(p.object({before:p.number(),after:p.number()}))}),uh=p.object({excludeToolMessages:p.optional(p.boolean()),recentMessages:p.optional(p.number()),searchOptions:p.optional(p_),searchOtherThreads:p.optional(p.boolean())}),Ux=p.object({saveMessages:p.optional(p.union(p.literal("all"),p.literal("none"),p.literal("promptAndOutput")))}),y_={system:p.optional(p.string()),prompt:p.optional(p.string()),messages:p.optional(p.array(ac)),promptMessageId:p.optional(p.string())},v_={maxTokens:p.optional(p.number()),temperature:p.optional(p.number()),topP:p.optional(p.number()),topK:p.optional(p.number()),presencePenalty:p.optional(p.number()),frequencyPenalty:p.optional(p.number()),seed:p.optional(p.number()),maxRetries:p.optional(p.number()),headers:p.optional(p.record(p.string(),p.string()))},Bx={userId:p.optional(p.string()),threadId:p.optional(p.string()),contextOptions:p.optional(uh),storageOptions:p.optional(Ux),providerOptions:Ut,...v_,...y_};p.object({...Bx,stream:p.optional(p.boolean()),toolChoice:p.optional(p.union(p.literal("auto"),p.literal("none"),p.literal("required"),p.object({type:p.literal("tool"),toolName:p.string()}))),maxSteps:p.optional(p.number()),experimental_continueSteps:p.optional(p.boolean())});p.object(Bx);p.object({vectors:p.array(p.union(p.array(p.number()),p.null())),dimension:Rx,model:p.string()});const Px=p.union(p.object({type:p.literal("text-delta"),textDelta:p.string()}),p.object({type:p.literal("reasoning"),textDelta:p.string()}),p.object({type:p.literal("source"),source:oh}),Dx,p.object({type:p.literal("tool-call-streaming-start"),toolCallId:p.string(),toolName:p.string()}),p.object({type:p.literal("tool-call-delta"),toolCallId:p.string(),toolName:p.string(),argsTextDelta:p.string()}),Lx),b_=p.object({streamId:p.string(),cursor:p.number()});p.optional(p.union(p.object({kind:p.literal("list"),startOrder:p.optional(p.number())}),p.object({kind:p.literal("deltas"),cursors:p.array(b_)})));p.object({streamId:p.string(),status:p.union(p.literal("streaming"),p.literal("finished"),p.literal("aborted")),order:p.number(),stepOrder:p.number(),userId:p.optional(p.string()),agentName:p.optional(p.string()),model:p.optional(p.string()),provider:p.optional(p.string()),providerOptions:p.optional(Pi)});p.object({streamId:p.string(),start:p.number(),end:p.number(),parts:p.array(Px)});const x_=xb({threads:_n({userId:p.optional(p.string()),title:p.optional(p.string()),summary:p.optional(p.string()),status:Ax,defaultSystemPrompt:p.optional(p.string()),parentThreadIds:p.optional(p.array(p.id("threads"))),order:p.optional(p.number())}).index("userId",["userId"]).searchIndex("title",{searchField:"title",filterFields:["userId"]}),messages:_n({id:p.optional(p.string()),userId:p.optional(p.string()),threadId:p.id("threads"),order:p.number(),stepOrder:p.number(),embeddingId:p.optional(Ev),fileIds:p.optional(p.array(p.id("files"))),error:p.optional(p.string()),status:a_,agentName:p.optional(p.string()),model:p.optional(p.string()),provider:p.optional(p.string()),providerOptions:p.optional(Pi),message:p.optional(ac),tool:p.boolean(),text:p.optional(p.string()),usage:p.optional(zx),providerMetadata:p.optional(n_),sources:p.optional(p.array(oh)),reasoning:p.optional(p.string()),reasoningDetails:p.optional(jx),warnings:p.optional(p.array(ch)),finishReason:p.optional(lh),parentMessageId:p.optional(p.id("messages")),stepId:p.optional(p.string()),files:p.optional(p.array(p.any()))}).index("threadId_status_tool_order_stepOrder",["threadId","status","tool","order","stepOrder"]).searchIndex("text_search",{searchField:"text",filterFields:["userId","threadId"]}).index("embeddingId_threadId",["embeddingId","threadId"]),streamingMessages:_n({userId:p.optional(p.string()),agentName:p.optional(p.string()),model:p.optional(p.string()),provider:p.optional(p.string()),providerOptions:p.optional(Pi),threadId:p.id("threads"),order:p.number(),stepOrder:p.number(),state:p.union(p.object({kind:p.literal("streaming"),lastHeartbeat:p.number(),timeoutFnId:p.optional(p.id("_scheduled_functions"))}),p.object({kind:p.literal("finished"),endedAt:p.number(),cleanupFnId:p.optional(p.id("_scheduled_functions"))}),p.object({kind:p.literal("aborted"),reason:p.string()}))}).index("threadId_state_order_stepOrder",["threadId","state.kind","order","stepOrder"]),streamDeltas:_n({streamId:p.id("streamingMessages"),start:p.number(),end:p.number(),parts:p.array(Px)}).index("streamId_start_end",["streamId","start","end"]),memories:_n({threadId:p.optional(p.id("threads")),userId:p.optional(p.string()),memory:p.string(),embeddingId:p.optional(Ev)}).index("threadId",["threadId"]).index("userId",["userId"]).index("embeddingId",["embeddingId"]),files:_n({storageId:p.string(),mimeType:p.string(),filename:p.optional(p.string()),hash:p.string(),refcount:p.number(),lastTouchedAt:p.number()}).index("hash",["hash"]).index("refcount",["refcount"]),...t_,apiKeys:_n({name:p.optional(p.string())}).index("name",["name"])});p.object({_id:p.string(),_creationTime:p.number(),userId:p.optional(p.string()),title:p.optional(p.string()),summary:p.optional(p.string()),status:Ax});p.object({_id:p.string(),_creationTime:p.number(),...sh(x_.tables.messages.validator.fields,["parentMessageId","stepId","files"]),threadId:p.string(),embeddingId:p.optional(p.string()),fileIds:p.optional(p.array(p.string()))});const w_=({agents:n,selectedAgent:a,setSelectedAgent:s,contextOptions:i,setContextOptions:l,storageOptions:u,setStorageOptions:d,onSendMessage:h})=>{const[m,g]=x.useState(""),[v,T]=x.useState(null),[S,w]=x.useState(!1),[N,E]=x.useState(void 0),[C,j]=x.useState(!1),M=()=>{E(void 0),j(!1)},_=k=>{const $=k.target.value!==((a==null?void 0:a.instructions)||"");E($?k.target.value:void 0),j($)},z=async()=>{if(!m.trim()||!a)return fE.error("Please enter a message and select an agent"),Promise.reject();w(!0),T("Sending...");try{const k=await h(m,a.name,i,u,C?N:void 0);return T(u.saveMessages==="none"?null:k??null)}finally{w(!1)}};return y.jsxs(y.Fragment,{children:[v&&y.jsxs("div",{className:"border rounded-md p-3 bg-muted/50",children:[y.jsx("h3",{className:"font-medium mb-2 text-sm",children:"Response:"}),y.jsx("p",{className:"text-sm",children:v})]}),y.jsxs("div",{className:"flex flex-row gap-4 p-4 bg-muted/30 rounded-lg items-start",children:[y.jsx("div",{className:"mb-0 w-full flex flex-col justify-center",children:y.jsx(Ul,{placeholder:"Type your message here...",value:m,onChange:k=>g(k.target.value),onKeyDown:k=>{k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),z().then(()=>{g("")}))},className:"min-h-[100px]"})}),y.jsxs("div",{className:"flex flex-col gap-4 content-around items-stretch min-w-[200px]",children:[y.jsx("div",{className:"flex flex-col",children:y.jsxs(hx,{value:(a==null?void 0:a.name)||"",onValueChange:k=>{const $=n==null?void 0:n.find(I=>I.name===k);$&&s($)},children:[y.jsx(ah,{className:"w-full",children:y.jsx(mx,{placeholder:"Select an agent"})}),y.jsx(rh,{children:n==null?void 0:n.map(k=>y.jsx(Ll,{value:k.name,children:k.name},k.name))})]})}),y.jsx(Mt,{className:"mt-2",onClick:z,disabled:!m.trim()||!a||S,title:m.trim()?a?S?"Sending...":"Send Message":"Please select an agent":"Please enter a message",children:S?"Sending...":"Send Message"})]})]}),y.jsx("div",{className:"px-4 bg-muted/30 rounded-lg",children:y.jsx(gd,{title:"System Prompt",children:y.jsxs("div",{className:"flex flex-row gap-2 items-end relative",children:[y.jsx("div",{className:"w-full",children:y.jsx(Ul,{"aria-label":"System prompt",value:N||(a==null?void 0:a.instructions)||"",onChange:_,placeholder:"System prompt for the agent...",className:"font-mono text-sm h-24",rows:3})}),y.jsx(Mt,{className:`ml-2 mb-1 absolute right-0 ${C?"visible":"invisible"}`,variant:"secondary",onClick:M,disabled:!C,title:"Reset to agent's default prompt",children:"Reset"})]})})}),y.jsx("div",{className:"px-4 bg-muted/30 rounded-lg",children:y.jsx(gd,{title:"Context & Storage Options",children:y.jsxs("div",{className:"flex flex-row gap-4",children:[y.jsxs("div",{className:"w-1/2",children:[y.jsx("label",{className:"block text-sm font-medium mb-1",children:"Context Options"}),y.jsx(yd,{defaultValue:i,onChange:l,validator:uh})]}),y.jsxs("div",{className:"w-1/2",children:[y.jsx("label",{className:"block text-sm font-medium mb-1",children:"Storage Options"}),y.jsx(yd,{defaultValue:u,onChange:d,validator:Ux})]})]})})})]})},S_=({agents:n,users:a,messages:s,selectedMessageId:i,selectedAgent:l,setSelectedAgent:u,onSelectMessage:d,contextOptions:h,setContextOptions:m,storageOptions:g,setStorageOptions:v,onSendMessage:T,selectedThreadTitle:S})=>y.jsxs("div",{className:"flex flex-col h-full",children:[y.jsx("div",{className:"panel-header",children:y.jsx("h2",{className:"font-medium",children:S||"Select a thread"})}),y.jsx("div",{className:"panel-content",children:s.length>0?y.jsx(JM,{users:a,messages:s,selectedMessageId:i,onSelectMessage:d}):y.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:"Select a thread to view messages"})}),y.jsx("div",{className:"border-t",children:y.jsx(w_,{agents:n,selectedAgent:l,setSelectedAgent:u,contextOptions:h,setContextOptions:m,storageOptions:g,setStorageOptions:v,onSendMessage:T})})]}),T_=({messages:n})=>y.jsxs("div",{className:"mt-4",children:[y.jsx("h3",{className:"font-medium mb-2",children:"Context Messages"}),n.length===0?y.jsx("p",{className:"text-muted-foreground text-sm",children:"No context messages available."}):y.jsxs("div",{className:"border rounded-md",children:[y.jsx("div",{className:"p-3 flex items-start gap-3 border-b bg-muted/50",children:y.jsx("div",{className:"flex-grow text-center self-end",children:"Message Text"})}),n.map((a,s)=>{var i,l;return y.jsxs("div",{className:`p-3 flex items-center gap-3 ${s<n.length-1?"border-b":""}`,children:[a.text?y.jsx("div",{className:"flex-grow",children:a.text}):y.jsxs("div",{className:"flex-grow max-w-full overflow-x-auto",children:[y.jsx("span",{className:"text-xs font-medium",children:(i=a.message)==null?void 0:i.role}),y.jsx("br",{}),y.jsx("pre",{className:"text-xs bg-muted overflow-x-auto p-2 rounded-md",children:JSON.stringify((l=a.message)==null?void 0:l.content,null,2)})]}),a.textSearchRank!==void 0||a.vectorSearchRank!==void 0&&y.jsx("div",{className:"flex-shrink-0 w-6 text-center",children:y.jsxs("div",{className:"flex flex-col",children:[a.textSearchRank!==void 0&&y.jsxs("span",{className:"search-rank text-rank",children:["T:",a.textSearchRank]}),a.vectorSearchRank!==void 0&&y.jsxs("span",{className:"search-rank vector-rank",children:["V:",a.vectorSearchRank]})]})})]},s+a._id)})]})]}),E_=({selectedMessage:n,contextMessages:a,contextOptions:s,setContextOptions:i,fetchContextMessages:l})=>{const[u,d]=x.useState(!1);return y.jsxs("div",{className:"flex flex-col h-full border-l",children:[y.jsx("div",{className:"panel-header",children:y.jsx("h2",{className:"font-medium",children:"Message Details"})}),y.jsx("div",{className:"panel-content p-4 overflow-y-auto",children:n?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"mb-6",children:[y.jsx("h3",{className:"font-medium mb-2",children:"Message JSON"}),y.jsx("pre",{className:"bg-muted p-3 rounded-lg overflow-x-auto text-xs",children:JSON.stringify(n,null,2)})]}),y.jsxs("div",{className:"mb-4",children:[y.jsx("label",{className:"block text-sm font-medium mb-1",children:"Context Options"}),y.jsx(gd,{title:"Context Options",children:y.jsx(yd,{defaultValue:s,onChange:i,validator:uh})}),y.jsx(Mt,{className:"w-full",onClick:()=>{d(!0),l(s).finally(()=>{d(!1)})},disabled:u||!n,children:u?"Fetching Context...":"Fetch Context Messages"})]}),(a==null?void 0:a.length)===0&&y.jsx("div",{className:"text-muted-foreground",children:"No context messages found"}),a&&a.length>0&&y.jsx("div",{className:"mb-4",children:y.jsx(T_,{messages:a})})]}):y.jsx("div",{className:"text-muted-foreground",children:"Select a message to view details"})})]})};function Cv(n,a,s){if(typeof(s==null?void 0:s.initialNumItems)!="number"||s.initialNumItems<=0)throw new Error(`\`options.initialNumItems\` must be a positive number. Received \`${s==null?void 0:s.initialNumItems}\`.`);const i=a==="skip",l=i?{}:a,u=pt(n),d=x.useMemo(()=>()=>({query:n,args:l,nextPageKey:1,pageKeys:i?[]:[0],queries:i?{}:{0:{query:n,args:{...l,paginationOpts:{numItems:s.initialNumItems,cursor:null}}}},ongoingSplits:{},skip:i}),[JSON.stringify(_t(l)),u,s.initialNumItems,i]),[h,m]=x.useState(d);let g=h;(i!==h.skip||pt(n)!==pt(h.query)||JSON.stringify(_t(l))!==JSON.stringify(_t(h.args)))&&(g=d(),m(g));const T=Wl().logger,S=th(g.queries),[w,N]=x.useMemo(()=>{var M,_;let C;const j=[];for(const z of g.pageKeys){if(C=S[z],C===void 0)break;if(C instanceof Error){if(C.message.includes("InvalidCursor")||C instanceof qi&&typeof C.data=="object"&&((M=C.data)==null?void 0:M.isConvexSystemError)===!0&&((_=C.data)==null?void 0:_.paginationError)==="InvalidCursor")return T.warn("usePaginatedQuery hit error, resetting pagination state: "+C.message),m(d),[[],void 0];throw C}const k=g.ongoingSplits[z];if(k!==void 0?S[k[0]]!==void 0&&S[k[1]]!==void 0&&m(R_(z)):C.splitCursor&&(C.pageStatus==="SplitRecommended"||C.pageStatus==="SplitRequired"||C.page.length>s.initialNumItems)&&m(C_(z,C.splitCursor,C.continueCursor)),C.pageStatus==="SplitRequired")return[j,void 0];j.push(...C.page)}return[j,C]},[S,g.pageKeys,g.ongoingSplits,s.initialNumItems,d,T]),E=x.useMemo(()=>{if(N===void 0&&g.pageKeys.length<=1)return{status:"LoadingFirstPage",isLoading:!0,loadMore:M=>{}};if(N===void 0||g.ongoingSplits[g.pageKeys.at(-1)]!==void 0)return{status:"LoadingMore",isLoading:!0,loadMore:M=>{}};if(N.isDone)return{status:"Exhausted",isLoading:!1,loadMore:M=>{}};const C=N.continueCursor;let j=!1;return{status:"CanLoadMore",isLoading:!1,loadMore:M=>{j||(j=!0,m(_=>{let z=_.nextPageKey;const k={..._.queries};let $=_.ongoingSplits;const I=_.pageKeys.at(-1),ae=z;return k[ae]={query:_.query,args:{..._.args,paginationOpts:{...k[I].args.paginationOpts,endCursor:C}}},z++,$={...$,[I]:[ae,z]},k[z]={query:_.query,args:{..._.args,paginationOpts:{numItems:M,cursor:C}}},z++,{..._,nextPageKey:z,queries:k,ongoingSplits:$}}))}}},[N,g.nextPageKey]);return{results:w,...E}}function C_(n,a,s){return i=>{const l={...i.queries},u=i.nextPageKey,d=i.nextPageKey+1,h=i.nextPageKey+2;l[u]={query:i.query,args:{...i.args,paginationOpts:{...i.queries[n].args.paginationOpts,endCursor:a}}},l[d]={query:i.query,args:{...i.args,paginationOpts:{...i.queries[n].args.paginationOpts,cursor:a,endCursor:s}}};const m={...i.ongoingSplits};return m[n]=[u,d],{...i,nextPageKey:h,queries:l,ongoingSplits:m}}}function R_(n){return a=>{const s=a.ongoingSplits[n];if(s===void 0)return a;const i={...a.queries};delete i[n];const l={...a.ongoingSplits};delete l[n];let u=a.pageKeys.slice();const d=a.pageKeys.findIndex(h=>h===n);return d>=0&&(u=[...a.pageKeys.slice(0,d),...s,...a.pageKeys.slice(d+1)]),{...a,queries:i,pageKeys:u,ongoingSplits:l}}}const N_={recentMessages:10,excludeToolMessages:!1,searchOtherThreads:!1,searchOptions:{limit:0,textSearch:!0,vectorSearch:!0,messageRange:{before:2,after:1}}},A_={saveMessages:"promptAndOutput"};function Rv({apiKey:n,api:a}){const{toast:s}=xd(),[i,l]=x.useState(),[u,d]=x.useState(),[h,m]=x.useState(),[g,v]=x.useState(),[T,S]=x.useState(null),[w,N]=x.useState(A_),[E,C]=x.useState(N_),j=Cv(a.listUsers,{apiKey:n},{initialNumItems:20}),M=Cv(a.listThreads,{apiKey:n,userId:i},{initialNumItems:20});x.useEffect(()=>{M.results.length>0&&!u&&d(M.results[0]._id)},[M.results,u]);const _=ZM(a.listMessages,u?{apiKey:n,threadId:u}:"skip",{initialNumItems:20});x.useEffect(()=>{_.results.length>0&&!h&&m(_.results[0].id)},[_.results,h]);const z=od(a.listAgents,{apiKey:n,threadId:u,userId:i});x.useEffect(()=>{if(z&&z.length>0&&!g)v(z[0]),z[0].contextOptions&&C(z[0].contextOptions),z[0].storageOptions&&N(z[0].storageOptions);else if(z&&g){const Z=z.find(se=>se.name===g.name);Z?JSON.stringify(g)!==JSON.stringify(Z)&&v(Z):v(void 0)}},[z,g]);const k=Xy(a.generateText),$=Xy(a.fetchPromptContext),I=M.results.find(Z=>Z._id===u),ae=_.results.find(Z=>Z._id===h),le=Z=>{l(Z),d(void 0),m(void 0)},he=Z=>{d(Z._id),m(void 0)},de=Z=>{m(Z);const se=_.results.find(L=>L._id===Z);if(se&&se.agentName&&(g==null?void 0:g.name)!==se.agentName){const L=z==null?void 0:z.find(Y=>Y.name===se.agentName);L&&v(L)}},ee=x.useCallback(async Z=>{if(!ae||!g){s({title:"Select a message and agent first"});return}try{const se=await $({apiKey:n,agentName:g.name,threadId:u,userId:i,messages:ae.message?[ae.message]:[],contextOptions:Z,beforeMessageId:ae._id});S(se)}catch(se){s({title:"Failed to fetch context",description:String(se)})}},[n,$,ae,g,u,i,s]),me=async(Z,se,L,Y,K)=>{if(!u||!i){s({title:"Select a thread and user first"});return}try{const{text:J}=await k({apiKey:n,agentName:se,threadId:u,userId:i,prompt:Z,contextOptions:L,storageOptions:Y,system:K});return J}catch(J){s({title:"Failed to send message",description:String(J)})}};return y.jsxs("div",{className:"h-screen flex flex-col",children:[y.jsx("div",{className:"bg-secondary p-3 border-b",children:y.jsx("h1",{className:"font-bold text-lg",children:"Playground"})}),y.jsxs("div",{className:"flex-grow flex overflow-hidden",children:[y.jsx("div",{className:"w-1/5 h-full",children:y.jsx(zM,{users:j.results,threads:M.results,selectedUserId:i,selectedThreadId:u,onSelectUserId:le,onSelectThread:he,onLoadMoreThreads:M.loadMore,canLoadMoreThreads:M.status==="CanLoadMore"})}),y.jsx("div",{className:"w-2/5 h-full border-x",children:y.jsx(S_,{agents:z,selectedAgent:g,setSelectedAgent:v,users:j.results,messages:_.results,selectedMessageId:h,onSelectMessage:de,contextOptions:E,setContextOptions:C,storageOptions:w,setStorageOptions:N,selectedThreadTitle:I==null?void 0:I.title,onSendMessage:me})}),y.jsx("div",{className:"w-2/5 h-full",children:y.jsx(E_,{selectedMessage:ae??null,contextMessages:T,contextOptions:E,setContextOptions:C,fetchContextMessages:ee})})]})]})}const O_="/";function M_(){return x.useEffect(()=>{const n=sessionStorage.getItem("redirectPath");n&&(window.history.replaceState(null,"",n),sessionStorage.removeItem("redirectPath"))},[]),null}const __=()=>y.jsxs(u2,{children:[y.jsx(M_,{}),y.jsx(KT,{}),y.jsx(EE,{}),y.jsx(iR,{basename:O_,children:y.jsxs(aR,{children:[y.jsx(Ti,{path:"/play/:url",element:y.jsx(tv,{children:y.jsx(Jy,{children:(n,a)=>y.jsx(Rv,{apiKey:n,api:a})})})}),y.jsx(Ti,{path:"/play",element:y.jsx(tv,{children:y.jsx(Jy,{children:(n,a)=>y.jsx(Rv,{apiKey:n,api:a})})})}),y.jsx(Ti,{path:"/",element:y.jsx(mR,{})}),y.jsx(Ti,{path:"*",element:y.jsx(gR,{})})]})})]});lS.createRoot(document.getElementById("root")).render(y.jsx(x.StrictMode,{children:y.jsx(__,{})}));