From a2838f28a70d8bd649112983176b6b8b08b119b1 Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Thu, 4 Jan 2024 23:30:58 +0000 Subject: [PATCH 1/3] thumbnails support --- jhub_apps/service/models.py | 3 ++- jhub_apps/service/service.py | 32 ++++++++++++++++++++++++++++---- jhub_apps/service/utils.py | 12 ++++++++++++ jhub_apps/tests/test_api.py | 16 ++++++++++++---- 4 files changed, 54 insertions(+), 9 deletions(-) diff --git a/jhub_apps/service/models.py b/jhub_apps/service/models.py index 7edd5f51..c2555160 100644 --- a/jhub_apps/service/models.py +++ b/jhub_apps/service/models.py @@ -2,6 +2,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional + from pydantic import BaseModel @@ -51,7 +52,7 @@ class UserOptions(BaseModel): jhub_app: bool display_name: str description: str - thumbnail: typing.Optional[str] = str() + thumbnail: str = None filepath: typing.Optional[str] = str() framework: str = "panel" custom_command: typing.Optional[str] = str() diff --git a/jhub_apps/service/service.py b/jhub_apps/service/service.py index b7953408..56405f8d 100644 --- a/jhub_apps/service/service.py +++ b/jhub_apps/service/service.py @@ -1,8 +1,11 @@ +import typing import dataclasses import os from datetime import timedelta -from fastapi import APIRouter, Depends, status, Request +from fastapi import APIRouter, Depends, status, Request, File, UploadFile, Form, HTTPException +from fastapi.encoders import jsonable_encoder +from pydantic import BaseModel, ValidationError from starlette.responses import RedirectResponse from jhub_apps.service.auth import create_access_token @@ -14,7 +17,8 @@ from fastapi.templating import Jinja2Templates from jhub_apps.hub_client.hub_client import HubClient -from jhub_apps.service.utils import get_conda_envs, get_jupyterhub_config, get_spawner_profiles +from jhub_apps.service.utils import get_conda_envs, get_jupyterhub_config, get_spawner_profiles, \ + encode_file_to_data_url from jhub_apps.spawner.types import FRAMEWORKS app = FastAPI() @@ -62,6 +66,7 @@ async def login(request: Request): authorization_url = os.environ["PUBLIC_HOST"] + "/hub/api/oauth2/authorize?response_type=code&client_id=service-japps" return RedirectResponse(authorization_url, status_code=302) + @router.get("/server/", description="Get all servers") @router.get("/server/{server_name}", description="Get a server by server name") async def get_server(user: User = Depends(get_current_user), server_name=None): @@ -81,12 +86,31 @@ async def get_server(user: User = Depends(get_current_user), server_name=None): return user_servers +class Checker: + def __init__(self, model: BaseModel): + self.model = model + + def __call__(self, data: str = Form(...)): + try: + return self.model.model_validate_json(data) + except ValidationError as e: + raise HTTPException( + detail=jsonable_encoder(e.errors()), + status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, + ) + + @router.post("/server/") async def create_server( - # request: Request, - server: ServerCreation, + server: ServerCreation = Depends(Checker(ServerCreation)), + thumbnail: typing.Optional[UploadFile] = File(...), user: User = Depends(get_current_user), ): + if thumbnail: + thumbnail_contents = await thumbnail.read() + server.user_options.thumbnail = encode_file_to_data_url( + thumbnail.filename, thumbnail_contents + ) hub_client = HubClient() return hub_client.create_server( username=user.name, diff --git a/jhub_apps/service/utils.py b/jhub_apps/service/utils.py index 5c78f605..0e99f160 100644 --- a/jhub_apps/service/utils.py +++ b/jhub_apps/service/utils.py @@ -1,3 +1,4 @@ +import base64 import os from jupyterhub.app import JupyterHub @@ -44,3 +45,14 @@ def get_spawner_profiles(config): raise ValueError( f"Invalid value for config.KubeSpawner.profile_list: {profile_list}" ) + + +def encode_file_to_data_url(filename, file_contents): + """Converts image file to data url to display in browser.""" + base64_encoded = base64.b64encode(file_contents) + filename_ = filename.lower() + mime_type = "image/png" + if filename_.endswith(".jpg") or filename_.endswith(".jpeg"): + mime_type = "image/jpeg" + data_url = f"data:{mime_type};base64,{base64_encoded.decode('utf-8')}" + return data_url diff --git a/jhub_apps/tests/test_api.py b/jhub_apps/tests/test_api.py index 8becd8cd..f357b7f3 100644 --- a/jhub_apps/tests/test_api.py +++ b/jhub_apps/tests/test_api.py @@ -1,4 +1,6 @@ import dataclasses +import io +import json from unittest.mock import patch from jhub_apps.hub_client.hub_client import HubClient @@ -34,16 +36,22 @@ def test_api_get_server(get_user, client): @patch.object(HubClient, "create_server") def test_api_create_server(create_server, client): from jhub_apps.service.models import UserOptions - create_server_response = {"user": "aktech"} create_server.return_value = create_server_response user_options = mock_user_options() - body = {"servername": "panel-app", "user_options": user_options} - response = client.post("/server/", json=body) + thumbnail = b"contents of thumbnail" + in_memory_file = io.BytesIO(thumbnail) + response = client.post( + "/server/", + data={'data': json.dumps({"servername": "panel-app", "user_options": user_options})}, + files={'thumbnail': ('image.jpeg', in_memory_file)} + ) + final_user_options = UserOptions(**user_options) + final_user_options.thumbnail = "data:image/jpeg;base64,Y29udGVudHMgb2YgdGh1bWJuYWls" create_server.assert_called_once_with( username=MOCK_USER.name, servername="panel-app", - user_options=UserOptions(**user_options), + user_options=final_user_options, ) assert response.json() == create_server_response From 24f47e16892f20793f923dea1b7d023dce566f2c Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Fri, 5 Jan 2024 00:25:50 +0000 Subject: [PATCH 2/3] make thumbnails optional --- jhub_apps/service/service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jhub_apps/service/service.py b/jhub_apps/service/service.py index 56405f8d..73638ac4 100644 --- a/jhub_apps/service/service.py +++ b/jhub_apps/service/service.py @@ -103,7 +103,7 @@ def __call__(self, data: str = Form(...)): @router.post("/server/") async def create_server( server: ServerCreation = Depends(Checker(ServerCreation)), - thumbnail: typing.Optional[UploadFile] = File(...), + thumbnail: typing.Optional[UploadFile] = File(None), user: User = Depends(get_current_user), ): if thumbnail: From 0029f8cc869e0ddb8f5bd43a1183a83745cc73fa Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Fri, 5 Jan 2024 01:30:18 +0000 Subject: [PATCH 3/3] use multi form data --- jhub_apps/static/js/index.js | 20 ++++++++++---------- ui/src/pages/home/app-form/app-form.tsx | 8 +++++++- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/jhub_apps/static/js/index.js b/jhub_apps/static/js/index.js index c18cbcf9..706f4293 100644 --- a/jhub_apps/static/js/index.js +++ b/jhub_apps/static/js/index.js @@ -6,7 +6,7 @@ function t0(e,t){for(var n=0;n>>1,C=V[ce];if(0>>1;ceo(J,H))jo(oe,J)?(V[ce]=oe,V[j]=H,ce=j):(V[ce]=J,V[F]=H,ce=F);else if(jo(oe,H))V[ce]=oe,V[j]=H,ce=j;else break e}}return $}function o(V,$){var H=V.sortIndex-$.sortIndex;return H!==0?H:V.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var a=[],u=[],c=1,f=null,h=3,S=!1,p=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(V){for(var $=n(u);$!==null;){if($.callback===null)r(u);else if($.startTime<=V)r(u),$.sortIndex=$.expirationTime,t(a,$);else break;$=n(u)}}function R(V){if(v=!1,m(V),!p)if(n(a)!==null)p=!0,ge(k);else{var $=n(u);$!==null&&we(R,$.startTime-V)}}function k(V,$){p=!1,v&&(v=!1,y(O),O=-1),S=!0;var H=h;try{for(m($),f=n(a);f!==null&&(!(f.expirationTime>$)||V&&!me());){var ce=f.callback;if(typeof ce=="function"){f.callback=null,h=f.priorityLevel;var C=ce(f.expirationTime<=$);$=e.unstable_now(),typeof C=="function"?f.callback=C:f===n(a)&&r(a),m($)}else r(a);f=n(a)}if(f!==null)var b=!0;else{var F=n(u);F!==null&&we(R,F.startTime-$),b=!1}return b}finally{f=null,h=H,S=!1}}var A=!1,N=null,O=-1,Z=5,Y=-1;function me(){return!(e.unstable_now()-YV||125ce?(V.sortIndex=H,t(u,V),n(a)===null&&V===n(u)&&(v?(y(O),O=-1):v=!0,we(R,H-ce))):(V.sortIndex=C,t(a,V),p||S||(p=!0,ge(k))),V},e.unstable_shouldYield=me,e.unstable_wrapCallback=function(V){var $=h;return function(){var H=h;h=$;try{return V.apply(this,arguments)}finally{h=H}}}})(kp);Tp.exports=kp;var C0=Tp.exports;/** + */(function(e){function t(V,$){var H=V.length;V.push($);e:for(;0>>1,E=V[ce];if(0>>1;ceo(X,H))jo(oe,X)?(V[ce]=oe,V[j]=H,ce=j):(V[ce]=X,V[F]=H,ce=F);else if(jo(oe,H))V[ce]=oe,V[j]=H,ce=j;else break e}}return $}function o(V,$){var H=V.sortIndex-$.sortIndex;return H!==0?H:V.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var a=[],u=[],c=1,f=null,h=3,S=!1,p=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(V){for(var $=n(u);$!==null;){if($.callback===null)r(u);else if($.startTime<=V)r(u),$.sortIndex=$.expirationTime,t(a,$);else break;$=n(u)}}function R(V){if(v=!1,m(V),!p)if(n(a)!==null)p=!0,ge(k);else{var $=n(u);$!==null&&we(R,$.startTime-V)}}function k(V,$){p=!1,v&&(v=!1,y(O),O=-1),S=!0;var H=h;try{for(m($),f=n(a);f!==null&&(!(f.expirationTime>$)||V&&!me());){var ce=f.callback;if(typeof ce=="function"){f.callback=null,h=f.priorityLevel;var E=ce(f.expirationTime<=$);$=e.unstable_now(),typeof E=="function"?f.callback=E:f===n(a)&&r(a),m($)}else r(a);f=n(a)}if(f!==null)var b=!0;else{var F=n(u);F!==null&&we(R,F.startTime-$),b=!1}return b}finally{f=null,h=H,S=!1}}var A=!1,N=null,O=-1,Z=5,Y=-1;function me(){return!(e.unstable_now()-YV||125ce?(V.sortIndex=H,t(u,V),n(a)===null&&V===n(u)&&(v?(y(O),O=-1):v=!0,we(R,H-ce))):(V.sortIndex=E,t(a,V),p||S||(p=!0,ge(k))),V},e.unstable_shouldYield=me,e.unstable_wrapCallback=function(V){var $=h;return function(){var H=h;h=$;try{return V.apply(this,arguments)}finally{h=H}}}})(kp);Tp.exports=kp;var C0=Tp.exports;/** * @license React * react-dom.production.min.js * @@ -34,10 +34,10 @@ function t0(e,t){for(var n=0;nl||o[i]!==s[l]){var a=` -`+o[i].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=i&&0<=l);break}}}finally{ha=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Io(e):""}function A0(e){switch(e.tag){case 5:return Io(e.type);case 16:return Io("Lazy");case 13:return Io("Suspense");case 19:return Io("SuspenseList");case 0:case 2:case 15:return e=pa(e.type,!1),e;case 11:return e=pa(e.type.render,!1),e;case 1:return e=pa(e.type,!0),e;default:return""}}function iu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case kr:return"Fragment";case Tr:return"Portal";case ru:return"Profiler";case kc:return"StrictMode";case ou:return"Suspense";case su:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Pp:return(e.displayName||"Context")+".Consumer";case Lp:return(e._context.displayName||"Context")+".Provider";case Nc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ac:return t=e.displayName||null,t!==null?t:iu(e.type)||"Memo";case Cn:t=e._payload,e=e._init;try{return iu(e(t))}catch{}}return null}function L0(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return iu(t);case 8:return t===kc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function zn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function bp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function P0(e){var t=bp(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){r=""+i,s.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ws(e){e._valueTracker||(e._valueTracker=P0(e))}function Fp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=bp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Pi(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}}function lu(e,t){var n=t.checked;return Ie({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function od(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=zn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Dp(e,t){t=t.checked,t!=null&&Tc(e,"checked",t,!1)}function au(e,t){Dp(e,t);var n=zn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?uu(e,t.type,n):t.hasOwnProperty("defaultValue")&&uu(e,t.type,zn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function sd(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function uu(e,t,n){(t!=="number"||Pi(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Vo=Array.isArray;function $r(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Qs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function rs(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ho={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},O0=["Webkit","ms","Moz","O"];Object.keys(Ho).forEach(function(e){O0.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ho[t]=Ho[e]})});function Vp(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ho.hasOwnProperty(e)&&Ho[e]?(""+t).trim():t+"px"}function $p(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Vp(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var b0=Ie({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function du(e,t){if(t){if(b0[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(M(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(M(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(M(61))}if(t.style!=null&&typeof t.style!="object")throw Error(M(62))}}function hu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 pu=null;function Lc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mu=null,jr=null,Br=null;function ad(e){if(e=Cs(e)){if(typeof mu!="function")throw Error(M(280));var t=e.stateNode;t&&(t=Rl(t),mu(e.stateNode,e.type,t))}}function jp(e){jr?Br?Br.push(e):Br=[e]:jr=e}function Bp(){if(jr){var e=jr,t=Br;if(Br=jr=null,ad(e),t)for(e=0;e>>=0,e===0?32:31-(H0(e)/W0|0)|0}var qs=64,Ks=4194304;function $o(e){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:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Di(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,s=e.pingedLanes,i=n&268435455;if(i!==0){var l=i&~o;l!==0?r=$o(l):(s&=i,s!==0&&(r=$o(s)))}else i=n&~o,i!==0?r=$o(i):s!==0&&(r=$o(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,s=t&-t,o>=s||o===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Rs(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Qt(t),e[t]=n}function G0(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Qo),vd=String.fromCharCode(32),gd=!1;function am(e,t){switch(e){case"keyup":return ES.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function um(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Nr=!1;function xS(e,t){switch(e){case"compositionend":return um(t);case"keypress":return t.which!==32?null:(gd=!0,vd);case"textInput":return e=t.data,e===vd&&gd?null:e;default:return null}}function TS(e,t){if(Nr)return e==="compositionend"||!Ic&&am(e,t)?(e=im(),pi=Dc=Ln=null,Nr=!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)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Rd(n)}}function hm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function pm(){for(var e=window,t=Pi();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Pi(e.document)}return t}function Vc(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")}function DS(e){var t=pm(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&hm(n.ownerDocument.documentElement,n)){if(r!==null&&Vc(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,s=Math.min(r.start,o);r=r.end===void 0?s:Math.min(r.end,o),!e.extend&&s>r&&(o=r,r=s,s=o),o=Ed(n,s);var i=Ed(n,r);o&&i&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ar=null,_u=null,Ko=null,Ru=!1;function Cd(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ru||Ar==null||Ar!==Pi(r)||(r=Ar,"selectionStart"in r&&Vc(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ko&&us(Ko,r)||(Ko=r,r=Ii(_u,"onSelect"),0Or||(e.current=Nu[Or],Nu[Or]=null,Or--)}function Ne(e,t){Or++,Nu[Or]=e.current,e.current=t}var Hn={},it=qn(Hn),mt=qn(!1),fr=Hn;function Gr(e,t){var n=e.type.contextTypes;if(!n)return Hn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},s;for(s in n)o[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function yt(e){return e=e.childContextTypes,e!=null}function $i(){Oe(mt),Oe(it)}function Pd(e,t,n){if(it.current!==Hn)throw Error(M(168));Ne(it,t),Ne(mt,n)}function Em(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(M(108,L0(e)||"Unknown",o));return Ie({},n,r)}function ji(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Hn,fr=it.current,Ne(it,e),Ne(mt,mt.current),!0}function Od(e,t,n){var r=e.stateNode;if(!r)throw Error(M(169));n?(e=Em(e,t,fr),r.__reactInternalMemoizedMergedChildContext=e,Oe(mt),Oe(it),Ne(it,e)):Oe(mt),Ne(mt,n)}var un=null,El=!1,Na=!1;function Cm(e){un===null?un=[e]:un.push(e)}function qS(e){El=!0,Cm(e)}function Kn(){if(!Na&&un!==null){Na=!0;var e=0,t=Re;try{var n=un;for(Re=1;e>=i,o-=i,fn=1<<32-Qt(t)+o|n<O?(Z=N,N=null):Z=N.sibling;var Y=h(y,N,m[O],R);if(Y===null){N===null&&(N=Z);break}e&&N&&Y.alternate===null&&t(y,N),d=s(Y,d,O),A===null?k=Y:A.sibling=Y,A=Y,N=Z}if(O===m.length)return n(y,N),Fe&&tr(y,O),k;if(N===null){for(;OO?(Z=N,N=null):Z=N.sibling;var me=h(y,N,Y.value,R);if(me===null){N===null&&(N=Z);break}e&&N&&me.alternate===null&&t(y,N),d=s(me,d,O),A===null?k=me:A.sibling=me,A=me,N=Z}if(Y.done)return n(y,N),Fe&&tr(y,O),k;if(N===null){for(;!Y.done;O++,Y=m.next())Y=f(y,Y.value,R),Y!==null&&(d=s(Y,d,O),A===null?k=Y:A.sibling=Y,A=Y);return Fe&&tr(y,O),k}for(N=r(y,N);!Y.done;O++,Y=m.next())Y=S(N,y,O,Y.value,R),Y!==null&&(e&&Y.alternate!==null&&N.delete(Y.key===null?O:Y.key),d=s(Y,d,O),A===null?k=Y:A.sibling=Y,A=Y);return e&&N.forEach(function(ue){return t(y,ue)}),Fe&&tr(y,O),k}function x(y,d,m,R){if(typeof m=="object"&&m!==null&&m.type===kr&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Hs:e:{for(var k=m.key,A=d;A!==null;){if(A.key===k){if(k=m.type,k===kr){if(A.tag===7){n(y,A.sibling),d=o(A,m.props.children),d.return=y,y=d;break e}}else if(A.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Cn&&Vd(k)===A.type){n(y,A.sibling),d=o(A,m.props),d.ref=To(y,A,m),d.return=y,y=d;break e}n(y,A);break}else t(y,A);A=A.sibling}m.type===kr?(d=cr(m.props.children,y.mode,R,m.key),d.return=y,y=d):(R=Ri(m.type,m.key,m.props,null,y.mode,R),R.ref=To(y,d,m),R.return=y,y=R)}return i(y);case Tr:e:{for(A=m.key;d!==null;){if(d.key===A)if(d.tag===4&&d.stateNode.containerInfo===m.containerInfo&&d.stateNode.implementation===m.implementation){n(y,d.sibling),d=o(d,m.children||[]),d.return=y,y=d;break e}else{n(y,d);break}else t(y,d);d=d.sibling}d=Ma(m,y.mode,R),d.return=y,y=d}return i(y);case Cn:return A=m._init,x(y,d,A(m._payload),R)}if(Vo(m))return p(y,d,m,R);if(_o(m))return v(y,d,m,R);ti(y,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,d!==null&&d.tag===6?(n(y,d.sibling),d=o(d,m),d.return=y,y=d):(n(y,d),d=Da(m,y.mode,R),d.return=y,y=d),i(y)):n(y,d)}return x}var Xr=Om(!0),bm=Om(!1),xs={},nn=qn(xs),hs=qn(xs),ps=qn(xs);function ir(e){if(e===xs)throw Error(M(174));return e}function Kc(e,t){switch(Ne(ps,t),Ne(hs,e),Ne(nn,xs),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:fu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=fu(t,e)}Oe(nn),Ne(nn,t)}function Jr(){Oe(nn),Oe(hs),Oe(ps)}function Fm(e){ir(ps.current);var t=ir(nn.current),n=fu(t,e.type);t!==n&&(Ne(hs,e),Ne(nn,n))}function Gc(e){hs.current===e&&(Oe(nn),Oe(hs))}var Me=qn(0);function qi(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Aa=[];function Yc(){for(var e=0;en?n:4,e(!0);var r=La.transition;La.transition={};try{e(!1),t()}finally{Re=n,La.transition=r}}function Ym(){return Ut().memoizedState}function XS(e,t,n){var r=jn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Xm(e))Jm(t,n);else if(n=Nm(e,t,n,r),n!==null){var o=ut();qt(n,e,r,o),Zm(n,t,r)}}function JS(e,t,n){var r=jn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Xm(e))Jm(t,o);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var i=t.lastRenderedState,l=s(i,n);if(o.hasEagerState=!0,o.eagerState=l,Kt(l,i)){var a=t.interleaved;a===null?(o.next=o,Qc(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=Nm(e,t,o,r),n!==null&&(o=ut(),qt(n,e,r,o),Zm(n,t,r))}}function Xm(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function Jm(e,t){Go=Ki=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Zm(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Oc(e,n)}}var Gi={readContext:Mt,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useInsertionEffect:rt,useLayoutEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useMutableSource:rt,useSyncExternalStore:rt,useId:rt,unstable_isNewReconciler:!1},ZS={readContext:Mt,useCallback:function(e,t){return Xt().memoizedState=[e,t===void 0?null:t],e},useContext:Mt,useEffect:jd,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,gi(4194308,4,Wm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return gi(4194308,4,e,t)},useInsertionEffect:function(e,t){return gi(4,2,e,t)},useMemo:function(e,t){var n=Xt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Xt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=XS.bind(null,Ue,e),[r.memoizedState,e]},useRef:function(e){var t=Xt();return e={current:e},t.memoizedState=e},useState:$d,useDebugValue:tf,useDeferredValue:function(e){return Xt().memoizedState=e},useTransition:function(){var e=$d(!1),t=e[0];return e=YS.bind(null,e[1]),Xt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ue,o=Xt();if(Fe){if(n===void 0)throw Error(M(407));n=n()}else{if(n=t(),Xe===null)throw Error(M(349));hr&30||Um(r,t,n)}o.memoizedState=n;var s={value:n,getSnapshot:t};return o.queue=s,jd(Vm.bind(null,r,s,e),[e]),r.flags|=2048,vs(9,Im.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Xt(),t=Xe.identifierPrefix;if(Fe){var n=dn,r=fn;n=(r&~(1<<32-Qt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ms++,0")&&(a=a.replace("",e.displayName)),a}while(1<=i&&0<=l);break}}}finally{ha=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Io(e):""}function A0(e){switch(e.tag){case 5:return Io(e.type);case 16:return Io("Lazy");case 13:return Io("Suspense");case 19:return Io("SuspenseList");case 0:case 2:case 15:return e=pa(e.type,!1),e;case 11:return e=pa(e.type.render,!1),e;case 1:return e=pa(e.type,!0),e;default:return""}}function iu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case kr:return"Fragment";case Tr:return"Portal";case ru:return"Profiler";case kc:return"StrictMode";case ou:return"Suspense";case su:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Pp:return(e.displayName||"Context")+".Consumer";case Lp:return(e._context.displayName||"Context")+".Provider";case Nc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ac:return t=e.displayName||null,t!==null?t:iu(e.type)||"Memo";case Cn:t=e._payload,e=e._init;try{return iu(e(t))}catch{}}return null}function L0(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return iu(t);case 8:return t===kc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function zn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function bp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function P0(e){var t=bp(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){r=""+i,s.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ws(e){e._valueTracker||(e._valueTracker=P0(e))}function Fp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=bp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Pi(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}}function lu(e,t){var n=t.checked;return Ie({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function od(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=zn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Dp(e,t){t=t.checked,t!=null&&Tc(e,"checked",t,!1)}function au(e,t){Dp(e,t);var n=zn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?uu(e,t.type,n):t.hasOwnProperty("defaultValue")&&uu(e,t.type,zn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function sd(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function uu(e,t,n){(t!=="number"||Pi(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Vo=Array.isArray;function $r(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Qs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function rs(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ho={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},O0=["Webkit","ms","Moz","O"];Object.keys(Ho).forEach(function(e){O0.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ho[t]=Ho[e]})});function Vp(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ho.hasOwnProperty(e)&&Ho[e]?(""+t).trim():t+"px"}function $p(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Vp(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var b0=Ie({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function du(e,t){if(t){if(b0[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(M(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(M(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(M(61))}if(t.style!=null&&typeof t.style!="object")throw Error(M(62))}}function hu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 pu=null;function Lc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mu=null,jr=null,Br=null;function ad(e){if(e=Cs(e)){if(typeof mu!="function")throw Error(M(280));var t=e.stateNode;t&&(t=Rl(t),mu(e.stateNode,e.type,t))}}function jp(e){jr?Br?Br.push(e):Br=[e]:jr=e}function Bp(){if(jr){var e=jr,t=Br;if(Br=jr=null,ad(e),t)for(e=0;e>>=0,e===0?32:31-(H0(e)/W0|0)|0}var qs=64,Ks=4194304;function $o(e){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:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Di(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,s=e.pingedLanes,i=n&268435455;if(i!==0){var l=i&~o;l!==0?r=$o(l):(s&=i,s!==0&&(r=$o(s)))}else i=n&~o,i!==0?r=$o(i):s!==0&&(r=$o(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,s=t&-t,o>=s||o===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Rs(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Qt(t),e[t]=n}function G0(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Qo),vd=String.fromCharCode(32),gd=!1;function am(e,t){switch(e){case"keyup":return ES.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function um(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Nr=!1;function xS(e,t){switch(e){case"compositionend":return um(t);case"keypress":return t.which!==32?null:(gd=!0,vd);case"textInput":return e=t.data,e===vd&&gd?null:e;default:return null}}function TS(e,t){if(Nr)return e==="compositionend"||!Ic&&am(e,t)?(e=im(),pi=Dc=Ln=null,Nr=!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)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Rd(n)}}function hm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function pm(){for(var e=window,t=Pi();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Pi(e.document)}return t}function Vc(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")}function DS(e){var t=pm(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&hm(n.ownerDocument.documentElement,n)){if(r!==null&&Vc(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,s=Math.min(r.start,o);r=r.end===void 0?s:Math.min(r.end,o),!e.extend&&s>r&&(o=r,r=s,s=o),o=Ed(n,s);var i=Ed(n,r);o&&i&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ar=null,_u=null,Ko=null,Ru=!1;function Cd(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ru||Ar==null||Ar!==Pi(r)||(r=Ar,"selectionStart"in r&&Vc(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ko&&us(Ko,r)||(Ko=r,r=Ii(_u,"onSelect"),0Or||(e.current=Nu[Or],Nu[Or]=null,Or--)}function Ne(e,t){Or++,Nu[Or]=e.current,e.current=t}var Hn={},it=qn(Hn),mt=qn(!1),fr=Hn;function Gr(e,t){var n=e.type.contextTypes;if(!n)return Hn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},s;for(s in n)o[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function yt(e){return e=e.childContextTypes,e!=null}function $i(){Oe(mt),Oe(it)}function Pd(e,t,n){if(it.current!==Hn)throw Error(M(168));Ne(it,t),Ne(mt,n)}function Em(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(M(108,L0(e)||"Unknown",o));return Ie({},n,r)}function ji(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Hn,fr=it.current,Ne(it,e),Ne(mt,mt.current),!0}function Od(e,t,n){var r=e.stateNode;if(!r)throw Error(M(169));n?(e=Em(e,t,fr),r.__reactInternalMemoizedMergedChildContext=e,Oe(mt),Oe(it),Ne(it,e)):Oe(mt),Ne(mt,n)}var un=null,El=!1,Na=!1;function Cm(e){un===null?un=[e]:un.push(e)}function qS(e){El=!0,Cm(e)}function Kn(){if(!Na&&un!==null){Na=!0;var e=0,t=Re;try{var n=un;for(Re=1;e>=i,o-=i,fn=1<<32-Qt(t)+o|n<O?(Z=N,N=null):Z=N.sibling;var Y=h(y,N,m[O],R);if(Y===null){N===null&&(N=Z);break}e&&N&&Y.alternate===null&&t(y,N),d=s(Y,d,O),A===null?k=Y:A.sibling=Y,A=Y,N=Z}if(O===m.length)return n(y,N),Fe&&tr(y,O),k;if(N===null){for(;OO?(Z=N,N=null):Z=N.sibling;var me=h(y,N,Y.value,R);if(me===null){N===null&&(N=Z);break}e&&N&&me.alternate===null&&t(y,N),d=s(me,d,O),A===null?k=me:A.sibling=me,A=me,N=Z}if(Y.done)return n(y,N),Fe&&tr(y,O),k;if(N===null){for(;!Y.done;O++,Y=m.next())Y=f(y,Y.value,R),Y!==null&&(d=s(Y,d,O),A===null?k=Y:A.sibling=Y,A=Y);return Fe&&tr(y,O),k}for(N=r(y,N);!Y.done;O++,Y=m.next())Y=S(N,y,O,Y.value,R),Y!==null&&(e&&Y.alternate!==null&&N.delete(Y.key===null?O:Y.key),d=s(Y,d,O),A===null?k=Y:A.sibling=Y,A=Y);return e&&N.forEach(function(ue){return t(y,ue)}),Fe&&tr(y,O),k}function x(y,d,m,R){if(typeof m=="object"&&m!==null&&m.type===kr&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Hs:e:{for(var k=m.key,A=d;A!==null;){if(A.key===k){if(k=m.type,k===kr){if(A.tag===7){n(y,A.sibling),d=o(A,m.props.children),d.return=y,y=d;break e}}else if(A.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Cn&&Vd(k)===A.type){n(y,A.sibling),d=o(A,m.props),d.ref=To(y,A,m),d.return=y,y=d;break e}n(y,A);break}else t(y,A);A=A.sibling}m.type===kr?(d=cr(m.props.children,y.mode,R,m.key),d.return=y,y=d):(R=Ri(m.type,m.key,m.props,null,y.mode,R),R.ref=To(y,d,m),R.return=y,y=R)}return i(y);case Tr:e:{for(A=m.key;d!==null;){if(d.key===A)if(d.tag===4&&d.stateNode.containerInfo===m.containerInfo&&d.stateNode.implementation===m.implementation){n(y,d.sibling),d=o(d,m.children||[]),d.return=y,y=d;break e}else{n(y,d);break}else t(y,d);d=d.sibling}d=Ma(m,y.mode,R),d.return=y,y=d}return i(y);case Cn:return A=m._init,x(y,d,A(m._payload),R)}if(Vo(m))return p(y,d,m,R);if(_o(m))return v(y,d,m,R);ti(y,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,d!==null&&d.tag===6?(n(y,d.sibling),d=o(d,m),d.return=y,y=d):(n(y,d),d=Da(m,y.mode,R),d.return=y,y=d),i(y)):n(y,d)}return x}var Jr=Om(!0),bm=Om(!1),xs={},nn=qn(xs),hs=qn(xs),ps=qn(xs);function ir(e){if(e===xs)throw Error(M(174));return e}function Kc(e,t){switch(Ne(ps,t),Ne(hs,e),Ne(nn,xs),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:fu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=fu(t,e)}Oe(nn),Ne(nn,t)}function Xr(){Oe(nn),Oe(hs),Oe(ps)}function Fm(e){ir(ps.current);var t=ir(nn.current),n=fu(t,e.type);t!==n&&(Ne(hs,e),Ne(nn,n))}function Gc(e){hs.current===e&&(Oe(nn),Oe(hs))}var Me=qn(0);function qi(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Aa=[];function Yc(){for(var e=0;en?n:4,e(!0);var r=La.transition;La.transition={};try{e(!1),t()}finally{Re=n,La.transition=r}}function Ym(){return Ut().memoizedState}function JS(e,t,n){var r=jn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Jm(e))Xm(t,n);else if(n=Nm(e,t,n,r),n!==null){var o=ut();qt(n,e,r,o),Zm(n,t,r)}}function XS(e,t,n){var r=jn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Jm(e))Xm(t,o);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var i=t.lastRenderedState,l=s(i,n);if(o.hasEagerState=!0,o.eagerState=l,Kt(l,i)){var a=t.interleaved;a===null?(o.next=o,Qc(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=Nm(e,t,o,r),n!==null&&(o=ut(),qt(n,e,r,o),Zm(n,t,r))}}function Jm(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function Xm(e,t){Go=Ki=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Zm(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Oc(e,n)}}var Gi={readContext:Mt,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useInsertionEffect:rt,useLayoutEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useMutableSource:rt,useSyncExternalStore:rt,useId:rt,unstable_isNewReconciler:!1},ZS={readContext:Mt,useCallback:function(e,t){return Jt().memoizedState=[e,t===void 0?null:t],e},useContext:Mt,useEffect:jd,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,gi(4194308,4,Wm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return gi(4194308,4,e,t)},useInsertionEffect:function(e,t){return gi(4,2,e,t)},useMemo:function(e,t){var n=Jt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Jt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=JS.bind(null,Ue,e),[r.memoizedState,e]},useRef:function(e){var t=Jt();return e={current:e},t.memoizedState=e},useState:$d,useDebugValue:tf,useDeferredValue:function(e){return Jt().memoizedState=e},useTransition:function(){var e=$d(!1),t=e[0];return e=YS.bind(null,e[1]),Jt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ue,o=Jt();if(Fe){if(n===void 0)throw Error(M(407));n=n()}else{if(n=t(),Je===null)throw Error(M(349));hr&30||Um(r,t,n)}o.memoizedState=n;var s={value:n,getSnapshot:t};return o.queue=s,jd(Vm.bind(null,r,s,e),[e]),r.flags|=2048,vs(9,Im.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Jt(),t=Je.identifierPrefix;if(Fe){var n=dn,r=fn;n=(r&~(1<<32-Qt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ms++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Jt]=t,e[ds]=r,ay(e,t,!1,!1),t.stateNode=e;e:{switch(i=hu(n,r),n){case"dialog":Le("cancel",e),Le("close",e),o=r;break;case"iframe":case"object":case"embed":Le("load",e),o=r;break;case"video":case"audio":for(o=0;oeo&&(t.flags|=128,r=!0,ko(s,!1),t.lanes=4194304)}else{if(!r)if(e=qi(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ko(s,!0),s.tail===null&&s.tailMode==="hidden"&&!i.alternate&&!Fe)return ot(t),null}else 2*Be()-s.renderingStartTime>eo&&n!==1073741824&&(t.flags|=128,r=!0,ko(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(n=s.last,n!==null?n.sibling=i:t.child=i,s.last=i)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Be(),t.sibling=null,n=Me.current,Ne(Me,r?n&1|2:n&1),t):(ot(t),null);case 22:case 23:return af(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Rt&1073741824&&(ot(t),t.subtreeFlags&6&&(t.flags|=8192)):ot(t),null;case 24:return null;case 25:return null}throw Error(M(156,t.tag))}function lw(e,t){switch(jc(t),t.tag){case 1:return yt(t.type)&&$i(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jr(),Oe(mt),Oe(it),Yc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Gc(t),null;case 13:if(Oe(Me),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(M(340));Yr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Oe(Me),null;case 4:return Jr(),null;case 10:return Wc(t.type._context),null;case 22:case 23:return af(),null;case 24:return null;default:return null}}var ri=!1,st=!1,aw=typeof WeakSet=="function"?WeakSet:Set,K=null;function Mr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ve(e,t,r)}else n.current=null}function $u(e,t,n){try{n()}catch(r){Ve(e,t,r)}}var Yd=!1;function uw(e,t){if(Eu=Mi,e=pm(),Vc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var i=0,l=-1,a=-1,u=0,c=0,f=e,h=null;t:for(;;){for(var S;f!==n||o!==0&&f.nodeType!==3||(l=i+o),f!==s||r!==0&&f.nodeType!==3||(a=i+r),f.nodeType===3&&(i+=f.nodeValue.length),(S=f.firstChild)!==null;)h=f,f=S;for(;;){if(f===e)break t;if(h===n&&++u===o&&(l=i),h===s&&++c===r&&(a=i),(S=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=S}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Cu={focusedElem:e,selectionRange:n},Mi=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var v=p.memoizedProps,x=p.memoizedState,y=t.stateNode,d=y.getSnapshotBeforeUpdate(t.elementType===t.type?v:jt(t.type,v),x);y.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(M(163))}}catch(R){Ve(t,t.return,R)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return p=Yd,Yd=!1,p}function Yo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var s=o.destroy;o.destroy=void 0,s!==void 0&&$u(t,n,s)}o=o.next}while(o!==r)}}function Tl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ju(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function fy(e){var t=e.alternate;t!==null&&(e.alternate=null,fy(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Jt],delete t[ds],delete t[ku],delete t[WS],delete t[QS])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function dy(e){return e.tag===5||e.tag===3||e.tag===4}function Xd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dy(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.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 Bu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Vi));else if(r!==4&&(e=e.child,e!==null))for(Bu(e,t,n),e=e.sibling;e!==null;)Bu(e,t,n),e=e.sibling}function zu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(zu(e,t,n),e=e.sibling;e!==null;)zu(e,t,n),e=e.sibling}var Ze=null,zt=!1;function Rn(e,t,n){for(n=n.child;n!==null;)hy(e,t,n),n=n.sibling}function hy(e,t,n){if(tn&&typeof tn.onCommitFiberUnmount=="function")try{tn.onCommitFiberUnmount(gl,n)}catch{}switch(n.tag){case 5:st||Mr(n,t);case 6:var r=Ze,o=zt;Ze=null,Rn(e,t,n),Ze=r,zt=o,Ze!==null&&(zt?(e=Ze,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ze.removeChild(n.stateNode));break;case 18:Ze!==null&&(zt?(e=Ze,n=n.stateNode,e.nodeType===8?ka(e.parentNode,n):e.nodeType===1&&ka(e,n),ls(e)):ka(Ze,n.stateNode));break;case 4:r=Ze,o=zt,Ze=n.stateNode.containerInfo,zt=!0,Rn(e,t,n),Ze=r,zt=o;break;case 0:case 11:case 14:case 15:if(!st&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var s=o,i=s.destroy;s=s.tag,i!==void 0&&(s&2||s&4)&&$u(n,t,i),o=o.next}while(o!==r)}Rn(e,t,n);break;case 1:if(!st&&(Mr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ve(n,t,l)}Rn(e,t,n);break;case 21:Rn(e,t,n);break;case 22:n.mode&1?(st=(r=st)||n.memoizedState!==null,Rn(e,t,n),st=r):Rn(e,t,n);break;default:Rn(e,t,n)}}function Jd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new aw),t.forEach(function(r){var o=gw.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Vt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=i),r&=~s}if(r=o,r=Be()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*fw(r/1960))-r,10e?16:e,Pn===null)var r=!1;else{if(e=Pn,Pn=null,Ji=0,ve&6)throw Error(M(331));var o=ve;for(ve|=4,K=e.current;K!==null;){var s=K,i=s.child;if(K.flags&16){var l=s.deletions;if(l!==null){for(var a=0;aBe()-sf?ur(e,0):of|=n),vt(e,t)}function _y(e,t){t===0&&(e.mode&1?(t=Ks,Ks<<=1,!(Ks&130023424)&&(Ks=4194304)):t=1);var n=ut();e=vn(e,t),e!==null&&(Rs(e,t,n),vt(e,n))}function vw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),_y(e,n)}function gw(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(M(314))}r!==null&&r.delete(t),_y(e,n)}var Ry;Ry=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||mt.current)pt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return pt=!1,sw(e,t,n);pt=!!(e.flags&131072)}else pt=!1,Fe&&t.flags&1048576&&xm(t,zi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Si(e,t),e=t.pendingProps;var o=Gr(t,it.current);Hr(t,n),o=Jc(null,t,r,e,o,n);var s=Zc();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,yt(r)?(s=!0,ji(t)):s=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,qc(t),o.updater=Cl,t.stateNode=o,o._reactInternals=t,bu(t,r,e,n),t=Mu(null,t,r,!0,s,n)):(t.tag=0,Fe&&s&&$c(t),lt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Si(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=ww(r),e=jt(r,e),o){case 0:t=Du(null,t,r,e,n);break e;case 1:t=qd(null,t,r,e,n);break e;case 11:t=Wd(null,t,r,e,n);break e;case 14:t=Qd(null,t,r,jt(r.type,e),n);break e}throw Error(M(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:jt(r,o),Du(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:jt(r,o),qd(e,t,r,o,n);case 3:e:{if(sy(t),e===null)throw Error(M(387));r=t.pendingProps,s=t.memoizedState,o=s.element,Am(e,t),Qi(t,r,null,n);var i=t.memoizedState;if(r=i.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){o=Zr(Error(M(423)),t),t=Kd(e,t,r,n,o);break e}else if(r!==o){o=Zr(Error(M(424)),t),t=Kd(e,t,r,n,o);break e}else for(Et=In(t.stateNode.containerInfo.firstChild),Ct=t,Fe=!0,Ht=null,n=bm(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Yr(),r===o){t=gn(e,t,n);break e}lt(e,t,r,n)}t=t.child}return t;case 5:return Fm(t),e===null&&Lu(t),r=t.type,o=t.pendingProps,s=e!==null?e.memoizedProps:null,i=o.children,xu(r,o)?i=null:s!==null&&xu(r,s)&&(t.flags|=32),oy(e,t),lt(e,t,i,n),t.child;case 6:return e===null&&Lu(t),null;case 13:return iy(e,t,n);case 4:return Kc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Xr(t,null,r,n):lt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:jt(r,o),Wd(e,t,r,o,n);case 7:return lt(e,t,t.pendingProps,n),t.child;case 8:return lt(e,t,t.pendingProps.children,n),t.child;case 12:return lt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value,Ne(Hi,r._currentValue),r._currentValue=i,s!==null)if(Kt(s.value,i)){if(s.children===o.children&&!mt.current){t=gn(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){i=s.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(s.tag===1){a=hn(-1,n&-n),a.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Pu(s.return,n,t),l.lanes|=n;break}a=a.next}}else if(s.tag===10)i=s.type===t.type?null:s.child;else if(s.tag===18){if(i=s.return,i===null)throw Error(M(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Pu(i,n,t),i=s.sibling}else i=s.child;if(i!==null)i.return=s;else for(i=s;i!==null;){if(i===t){i=null;break}if(s=i.sibling,s!==null){s.return=i.return,i=s;break}i=i.return}s=i}lt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Hr(t,n),o=Mt(o),r=r(o),t.flags|=1,lt(e,t,r,n),t.child;case 14:return r=t.type,o=jt(r,t.pendingProps),o=jt(r.type,o),Qd(e,t,r,o,n);case 15:return ny(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:jt(r,o),Si(e,t),t.tag=1,yt(r)?(e=!0,ji(t)):e=!1,Hr(t,n),Pm(t,r,o),bu(t,r,o,n),Mu(null,t,r,!0,e,n);case 19:return ly(e,t,n);case 22:return ry(e,t,n)}throw Error(M(156,t.tag))};function Ey(e,t){return Gp(e,t)}function Sw(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bt(e,t,n,r){return new Sw(e,t,n,r)}function cf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ww(e){if(typeof e=="function")return cf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Nc)return 11;if(e===Ac)return 14}return 2}function Bn(e,t){var n=e.alternate;return n===null?(n=bt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ri(e,t,n,r,o,s){var i=2;if(r=e,typeof e=="function")cf(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case kr:return cr(n.children,o,s,t);case kc:i=8,o|=8;break;case ru:return e=bt(12,n,t,o|2),e.elementType=ru,e.lanes=s,e;case ou:return e=bt(13,n,t,o),e.elementType=ou,e.lanes=s,e;case su:return e=bt(19,n,t,o),e.elementType=su,e.lanes=s,e;case Op:return Nl(n,o,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Lp:i=10;break e;case Pp:i=9;break e;case Nc:i=11;break e;case Ac:i=14;break e;case Cn:i=16,r=null;break e}throw Error(M(130,e==null?e:typeof e,""))}return t=bt(i,n,t,o),t.elementType=e,t.type=r,t.lanes=s,t}function cr(e,t,n,r){return e=bt(7,e,r,t),e.lanes=n,e}function Nl(e,t,n,r){return e=bt(22,e,r,t),e.elementType=Op,e.lanes=n,e.stateNode={isHidden:!1},e}function Da(e,t,n){return e=bt(6,e,null,t),e.lanes=n,e}function Ma(e,t,n){return t=bt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function _w(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ya(0),this.expirationTimes=ya(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ya(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function ff(e,t,n,r,o,s,i,l,a){return e=new _w(e,t,n,l,a),t===1?(t=1,s===!0&&(t|=8)):t=0,s=bt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},qc(s),e}function Rw(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ky)}catch(e){console.error(e)}}ky(),xp.exports=Tt;var Ny=xp.exports;const kw=Sc(Ny);var ih=Ny;tu.createRoot=ih.createRoot,tu.hydrateRoot=ih.hydrateRoot;/** +`+s.stack}return{value:e,source:t,stack:o,digest:null}}function ba(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Fu(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var nw=typeof WeakMap=="function"?WeakMap:Map;function ey(e,t,n){n=hn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ji||(Ji=!0,Hu=r),Fu(e,t)},n}function ty(e,t,n){n=hn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Fu(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Fu(e,t),typeof r!="function"&&($n===null?$n=new Set([this]):$n.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function Bd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new nw;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=yw.bind(null,e,t,n),t.then(e,e))}function zd(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Hd(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=hn(-1,1),t.tag=2,Vn(n,t,1))),n.lanes|=1),e)}var rw=Sn.ReactCurrentOwner,pt=!1;function lt(e,t,n,r){t.child=e===null?bm(t,null,n,r):Jr(t,e.child,n,r)}function Wd(e,t,n,r,o){n=n.render;var s=t.ref;return Hr(t,o),r=Xc(e,t,n,r,s,o),n=Zc(),e!==null&&!pt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,gn(e,t,o)):(Fe&&n&&$c(t),t.flags|=1,lt(e,t,r,o),t.child)}function Qd(e,t,n,r,o){if(e===null){var s=n.type;return typeof s=="function"&&!cf(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,ny(e,t,s,r,o)):(e=Ri(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&o)){var i=s.memoizedProps;if(n=n.compare,n=n!==null?n:us,n(i,r)&&e.ref===t.ref)return gn(e,t,o)}return t.flags|=1,e=Bn(s,r),e.ref=t.ref,e.return=t,t.child=e}function ny(e,t,n,r,o){if(e!==null){var s=e.memoizedProps;if(us(s,r)&&e.ref===t.ref)if(pt=!1,t.pendingProps=r=s,(e.lanes&o)!==0)e.flags&131072&&(pt=!0);else return t.lanes=e.lanes,gn(e,t,o)}return Du(e,t,n,r,o)}function ry(e,t,n){var r=t.pendingProps,o=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ne(Ur,Rt),Rt|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ne(Ur,Rt),Rt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Ne(Ur,Rt),Rt|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Ne(Ur,Rt),Rt|=r;return lt(e,t,o,n),t.child}function oy(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Du(e,t,n,r,o){var s=yt(n)?fr:it.current;return s=Gr(t,s),Hr(t,o),n=Xc(e,t,n,r,s,o),r=Zc(),e!==null&&!pt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,gn(e,t,o)):(Fe&&r&&$c(t),t.flags|=1,lt(e,t,n,o),t.child)}function qd(e,t,n,r,o){if(yt(n)){var s=!0;ji(t)}else s=!1;if(Hr(t,o),t.stateNode===null)Si(e,t),Pm(t,n,r),bu(t,n,r,o),r=!0;else if(e===null){var i=t.stateNode,l=t.memoizedProps;i.props=l;var a=i.context,u=n.contextType;typeof u=="object"&&u!==null?u=Mt(u):(u=yt(n)?fr:it.current,u=Gr(t,u));var c=n.getDerivedStateFromProps,f=typeof c=="function"||typeof i.getSnapshotBeforeUpdate=="function";f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==r||a!==u)&&Id(t,i,r,u),xn=!1;var h=t.memoizedState;i.state=h,Qi(t,r,i,o),a=t.memoizedState,l!==r||h!==a||mt.current||xn?(typeof c=="function"&&(Ou(t,n,c,r),a=t.memoizedState),(l=xn||Ud(t,n,l,r,h,a,u))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),i.props=r,i.state=a,i.context=u,r=l):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Am(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:jt(t.type,l),i.props=u,f=t.pendingProps,h=i.context,a=n.contextType,typeof a=="object"&&a!==null?a=Mt(a):(a=yt(n)?fr:it.current,a=Gr(t,a));var S=n.getDerivedStateFromProps;(c=typeof S=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==f||h!==a)&&Id(t,i,r,a),xn=!1,h=t.memoizedState,i.state=h,Qi(t,r,i,o);var p=t.memoizedState;l!==f||h!==p||mt.current||xn?(typeof S=="function"&&(Ou(t,n,S,r),p=t.memoizedState),(u=xn||Ud(t,n,u,r,h,p,a)||!1)?(c||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,p,a),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,p,a)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),i.props=r,i.state=p,i.context=a,r=u):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Mu(e,t,n,r,s,o)}function Mu(e,t,n,r,o,s){oy(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return o&&Od(t,n,!1),gn(e,t,s);r=t.stateNode,rw.current=t;var l=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=Jr(t,e.child,null,s),t.child=Jr(t,null,l,s)):lt(e,t,l,s),t.memoizedState=r.state,o&&Od(t,n,!0),t.child}function sy(e){var t=e.stateNode;t.pendingContext?Pd(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Pd(e,t.context,!1),Kc(e,t.containerInfo)}function Kd(e,t,n,r,o){return Yr(),Bc(o),t.flags|=256,lt(e,t,n,r),t.child}var Uu={dehydrated:null,treeContext:null,retryLane:0};function Iu(e){return{baseLanes:e,cachePool:null,transitions:null}}function iy(e,t,n){var r=t.pendingProps,o=Me.current,s=!1,i=(t.flags&128)!==0,l;if((l=i)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Ne(Me,o&1),e===null)return Lu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,s?(r=t.mode,s=t.child,i={mode:"hidden",children:i},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=i):s=Nl(i,r,0,null),e=cr(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Iu(n),t.memoizedState=Uu,e):nf(t,i));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return ow(e,t,i,r,l,o,n);if(s){s=r.fallback,i=t.mode,o=e.child,l=o.sibling;var a={mode:"hidden",children:r.children};return!(i&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=Bn(o,a),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?s=Bn(l,s):(s=cr(s,i,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,i=e.child.memoizedState,i=i===null?Iu(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},s.memoizedState=i,s.childLanes=e.childLanes&~n,t.memoizedState=Uu,r}return s=e.child,e=s.sibling,r=Bn(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function nf(e,t){return t=Nl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ni(e,t,n,r){return r!==null&&Bc(r),Jr(t,e.child,null,n),e=nf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ow(e,t,n,r,o,s,i){if(n)return t.flags&256?(t.flags&=-257,r=ba(Error(M(422))),ni(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,o=t.mode,r=Nl({mode:"visible",children:r.children},o,0,null),s=cr(s,o,i,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Jr(t,e.child,null,i),t.child.memoizedState=Iu(i),t.memoizedState=Uu,s);if(!(t.mode&1))return ni(e,t,i,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,s=Error(M(419)),r=ba(s,r,void 0),ni(e,t,i,r)}if(l=(i&e.childLanes)!==0,pt||l){if(r=Je,r!==null){switch(i&-i){case 4:o=2;break;case 16:o=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|i)?0:o,o!==0&&o!==s.retryLane&&(s.retryLane=o,vn(e,o),qt(r,e,o,-1))}return uf(),r=ba(Error(M(421))),ni(e,t,i,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=vw.bind(null,e),o._reactRetry=t,null):(e=s.treeContext,Et=In(o.nextSibling),Ct=t,Fe=!0,Ht=null,e!==null&&(Pt[Ot++]=fn,Pt[Ot++]=dn,Pt[Ot++]=dr,fn=e.id,dn=e.overflow,dr=t),t=nf(t,r.children),t.flags|=4096,t)}function Gd(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Pu(e.return,t,n)}function Fa(e,t,n,r,o){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=o)}function ly(e,t,n){var r=t.pendingProps,o=r.revealOrder,s=r.tail;if(lt(e,t,r.children,n),r=Me.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Gd(e,n,t);else if(e.tag===19)Gd(e,n,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}r&=1}if(Ne(Me,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&qi(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Fa(t,!1,o,n,s);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&qi(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Fa(t,!0,n,null,s);break;case"together":Fa(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Si(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function gn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),pr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(M(153));if(t.child!==null){for(e=t.child,n=Bn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Bn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sw(e,t,n){switch(t.tag){case 3:sy(t),Yr();break;case 5:Fm(t);break;case 1:yt(t.type)&&ji(t);break;case 4:Kc(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Ne(Hi,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ne(Me,Me.current&1),t.flags|=128,null):n&t.child.childLanes?iy(e,t,n):(Ne(Me,Me.current&1),e=gn(e,t,n),e!==null?e.sibling:null);Ne(Me,Me.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ly(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ne(Me,Me.current),r)break;return null;case 22:case 23:return t.lanes=0,ry(e,t,n)}return gn(e,t,n)}var ay,Vu,uy,cy;ay=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Vu=function(){};uy=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,ir(nn.current);var s=null;switch(n){case"input":o=lu(e,o),r=lu(e,r),s=[];break;case"select":o=Ie({},o,{value:void 0}),r=Ie({},r,{value:void 0}),s=[];break;case"textarea":o=cu(e,o),r=cu(e,r),s=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Vi)}du(n,r);var i;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(i in l)l.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ns.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var a=r[u];if(l=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&a!==l&&(a!=null||l!=null))if(u==="style")if(l){for(i in l)!l.hasOwnProperty(i)||a&&a.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in a)a.hasOwnProperty(i)&&l[i]!==a[i]&&(n||(n={}),n[i]=a[i])}else n||(s||(s=[]),s.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(s=s||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(s=s||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ns.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&Le("scroll",e),s||l===a||(s=[])):(s=s||[]).push(u,a))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};cy=function(e,t,n,r){n!==r&&(t.flags|=4)};function ko(e,t){if(!Fe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ot(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function iw(e,t,n){var r=t.pendingProps;switch(jc(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(t),null;case 1:return yt(t.type)&&$i(),ot(t),null;case 3:return r=t.stateNode,Xr(),Oe(mt),Oe(it),Yc(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ei(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ht!==null&&(qu(Ht),Ht=null))),Vu(e,t),ot(t),null;case 5:Gc(t);var o=ir(ps.current);if(n=t.type,e!==null&&t.stateNode!=null)uy(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(M(166));return ot(t),null}if(e=ir(nn.current),ei(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Xt]=t,r[ds]=s,e=(t.mode&1)!==0,n){case"dialog":Le("cancel",r),Le("close",r);break;case"iframe":case"object":case"embed":Le("load",r);break;case"video":case"audio":for(o=0;o<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Xt]=t,e[ds]=r,ay(e,t,!1,!1),t.stateNode=e;e:{switch(i=hu(n,r),n){case"dialog":Le("cancel",e),Le("close",e),o=r;break;case"iframe":case"object":case"embed":Le("load",e),o=r;break;case"video":case"audio":for(o=0;oeo&&(t.flags|=128,r=!0,ko(s,!1),t.lanes=4194304)}else{if(!r)if(e=qi(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ko(s,!0),s.tail===null&&s.tailMode==="hidden"&&!i.alternate&&!Fe)return ot(t),null}else 2*Be()-s.renderingStartTime>eo&&n!==1073741824&&(t.flags|=128,r=!0,ko(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(n=s.last,n!==null?n.sibling=i:t.child=i,s.last=i)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Be(),t.sibling=null,n=Me.current,Ne(Me,r?n&1|2:n&1),t):(ot(t),null);case 22:case 23:return af(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Rt&1073741824&&(ot(t),t.subtreeFlags&6&&(t.flags|=8192)):ot(t),null;case 24:return null;case 25:return null}throw Error(M(156,t.tag))}function lw(e,t){switch(jc(t),t.tag){case 1:return yt(t.type)&&$i(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xr(),Oe(mt),Oe(it),Yc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Gc(t),null;case 13:if(Oe(Me),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(M(340));Yr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Oe(Me),null;case 4:return Xr(),null;case 10:return Wc(t.type._context),null;case 22:case 23:return af(),null;case 24:return null;default:return null}}var ri=!1,st=!1,aw=typeof WeakSet=="function"?WeakSet:Set,K=null;function Mr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ve(e,t,r)}else n.current=null}function $u(e,t,n){try{n()}catch(r){Ve(e,t,r)}}var Yd=!1;function uw(e,t){if(Eu=Mi,e=pm(),Vc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var i=0,l=-1,a=-1,u=0,c=0,f=e,h=null;t:for(;;){for(var S;f!==n||o!==0&&f.nodeType!==3||(l=i+o),f!==s||r!==0&&f.nodeType!==3||(a=i+r),f.nodeType===3&&(i+=f.nodeValue.length),(S=f.firstChild)!==null;)h=f,f=S;for(;;){if(f===e)break t;if(h===n&&++u===o&&(l=i),h===s&&++c===r&&(a=i),(S=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=S}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Cu={focusedElem:e,selectionRange:n},Mi=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var v=p.memoizedProps,x=p.memoizedState,y=t.stateNode,d=y.getSnapshotBeforeUpdate(t.elementType===t.type?v:jt(t.type,v),x);y.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(M(163))}}catch(R){Ve(t,t.return,R)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return p=Yd,Yd=!1,p}function Yo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var s=o.destroy;o.destroy=void 0,s!==void 0&&$u(t,n,s)}o=o.next}while(o!==r)}}function Tl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ju(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function fy(e){var t=e.alternate;t!==null&&(e.alternate=null,fy(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Xt],delete t[ds],delete t[ku],delete t[WS],delete t[QS])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function dy(e){return e.tag===5||e.tag===3||e.tag===4}function Jd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dy(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.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 Bu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Vi));else if(r!==4&&(e=e.child,e!==null))for(Bu(e,t,n),e=e.sibling;e!==null;)Bu(e,t,n),e=e.sibling}function zu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(zu(e,t,n),e=e.sibling;e!==null;)zu(e,t,n),e=e.sibling}var Ze=null,zt=!1;function Rn(e,t,n){for(n=n.child;n!==null;)hy(e,t,n),n=n.sibling}function hy(e,t,n){if(tn&&typeof tn.onCommitFiberUnmount=="function")try{tn.onCommitFiberUnmount(gl,n)}catch{}switch(n.tag){case 5:st||Mr(n,t);case 6:var r=Ze,o=zt;Ze=null,Rn(e,t,n),Ze=r,zt=o,Ze!==null&&(zt?(e=Ze,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ze.removeChild(n.stateNode));break;case 18:Ze!==null&&(zt?(e=Ze,n=n.stateNode,e.nodeType===8?ka(e.parentNode,n):e.nodeType===1&&ka(e,n),ls(e)):ka(Ze,n.stateNode));break;case 4:r=Ze,o=zt,Ze=n.stateNode.containerInfo,zt=!0,Rn(e,t,n),Ze=r,zt=o;break;case 0:case 11:case 14:case 15:if(!st&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var s=o,i=s.destroy;s=s.tag,i!==void 0&&(s&2||s&4)&&$u(n,t,i),o=o.next}while(o!==r)}Rn(e,t,n);break;case 1:if(!st&&(Mr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ve(n,t,l)}Rn(e,t,n);break;case 21:Rn(e,t,n);break;case 22:n.mode&1?(st=(r=st)||n.memoizedState!==null,Rn(e,t,n),st=r):Rn(e,t,n);break;default:Rn(e,t,n)}}function Xd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new aw),t.forEach(function(r){var o=gw.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Vt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=i),r&=~s}if(r=o,r=Be()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*fw(r/1960))-r,10e?16:e,Pn===null)var r=!1;else{if(e=Pn,Pn=null,Xi=0,ve&6)throw Error(M(331));var o=ve;for(ve|=4,K=e.current;K!==null;){var s=K,i=s.child;if(K.flags&16){var l=s.deletions;if(l!==null){for(var a=0;aBe()-sf?ur(e,0):of|=n),vt(e,t)}function _y(e,t){t===0&&(e.mode&1?(t=Ks,Ks<<=1,!(Ks&130023424)&&(Ks=4194304)):t=1);var n=ut();e=vn(e,t),e!==null&&(Rs(e,t,n),vt(e,n))}function vw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),_y(e,n)}function gw(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(M(314))}r!==null&&r.delete(t),_y(e,n)}var Ry;Ry=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||mt.current)pt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return pt=!1,sw(e,t,n);pt=!!(e.flags&131072)}else pt=!1,Fe&&t.flags&1048576&&xm(t,zi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Si(e,t),e=t.pendingProps;var o=Gr(t,it.current);Hr(t,n),o=Xc(null,t,r,e,o,n);var s=Zc();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,yt(r)?(s=!0,ji(t)):s=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,qc(t),o.updater=Cl,t.stateNode=o,o._reactInternals=t,bu(t,r,e,n),t=Mu(null,t,r,!0,s,n)):(t.tag=0,Fe&&s&&$c(t),lt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Si(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=ww(r),e=jt(r,e),o){case 0:t=Du(null,t,r,e,n);break e;case 1:t=qd(null,t,r,e,n);break e;case 11:t=Wd(null,t,r,e,n);break e;case 14:t=Qd(null,t,r,jt(r.type,e),n);break e}throw Error(M(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:jt(r,o),Du(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:jt(r,o),qd(e,t,r,o,n);case 3:e:{if(sy(t),e===null)throw Error(M(387));r=t.pendingProps,s=t.memoizedState,o=s.element,Am(e,t),Qi(t,r,null,n);var i=t.memoizedState;if(r=i.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){o=Zr(Error(M(423)),t),t=Kd(e,t,r,n,o);break e}else if(r!==o){o=Zr(Error(M(424)),t),t=Kd(e,t,r,n,o);break e}else for(Et=In(t.stateNode.containerInfo.firstChild),Ct=t,Fe=!0,Ht=null,n=bm(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Yr(),r===o){t=gn(e,t,n);break e}lt(e,t,r,n)}t=t.child}return t;case 5:return Fm(t),e===null&&Lu(t),r=t.type,o=t.pendingProps,s=e!==null?e.memoizedProps:null,i=o.children,xu(r,o)?i=null:s!==null&&xu(r,s)&&(t.flags|=32),oy(e,t),lt(e,t,i,n),t.child;case 6:return e===null&&Lu(t),null;case 13:return iy(e,t,n);case 4:return Kc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Jr(t,null,r,n):lt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:jt(r,o),Wd(e,t,r,o,n);case 7:return lt(e,t,t.pendingProps,n),t.child;case 8:return lt(e,t,t.pendingProps.children,n),t.child;case 12:return lt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value,Ne(Hi,r._currentValue),r._currentValue=i,s!==null)if(Kt(s.value,i)){if(s.children===o.children&&!mt.current){t=gn(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){i=s.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(s.tag===1){a=hn(-1,n&-n),a.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Pu(s.return,n,t),l.lanes|=n;break}a=a.next}}else if(s.tag===10)i=s.type===t.type?null:s.child;else if(s.tag===18){if(i=s.return,i===null)throw Error(M(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Pu(i,n,t),i=s.sibling}else i=s.child;if(i!==null)i.return=s;else for(i=s;i!==null;){if(i===t){i=null;break}if(s=i.sibling,s!==null){s.return=i.return,i=s;break}i=i.return}s=i}lt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Hr(t,n),o=Mt(o),r=r(o),t.flags|=1,lt(e,t,r,n),t.child;case 14:return r=t.type,o=jt(r,t.pendingProps),o=jt(r.type,o),Qd(e,t,r,o,n);case 15:return ny(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:jt(r,o),Si(e,t),t.tag=1,yt(r)?(e=!0,ji(t)):e=!1,Hr(t,n),Pm(t,r,o),bu(t,r,o,n),Mu(null,t,r,!0,e,n);case 19:return ly(e,t,n);case 22:return ry(e,t,n)}throw Error(M(156,t.tag))};function Ey(e,t){return Gp(e,t)}function Sw(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bt(e,t,n,r){return new Sw(e,t,n,r)}function cf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ww(e){if(typeof e=="function")return cf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Nc)return 11;if(e===Ac)return 14}return 2}function Bn(e,t){var n=e.alternate;return n===null?(n=bt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ri(e,t,n,r,o,s){var i=2;if(r=e,typeof e=="function")cf(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case kr:return cr(n.children,o,s,t);case kc:i=8,o|=8;break;case ru:return e=bt(12,n,t,o|2),e.elementType=ru,e.lanes=s,e;case ou:return e=bt(13,n,t,o),e.elementType=ou,e.lanes=s,e;case su:return e=bt(19,n,t,o),e.elementType=su,e.lanes=s,e;case Op:return Nl(n,o,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Lp:i=10;break e;case Pp:i=9;break e;case Nc:i=11;break e;case Ac:i=14;break e;case Cn:i=16,r=null;break e}throw Error(M(130,e==null?e:typeof e,""))}return t=bt(i,n,t,o),t.elementType=e,t.type=r,t.lanes=s,t}function cr(e,t,n,r){return e=bt(7,e,r,t),e.lanes=n,e}function Nl(e,t,n,r){return e=bt(22,e,r,t),e.elementType=Op,e.lanes=n,e.stateNode={isHidden:!1},e}function Da(e,t,n){return e=bt(6,e,null,t),e.lanes=n,e}function Ma(e,t,n){return t=bt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function _w(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ya(0),this.expirationTimes=ya(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ya(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function ff(e,t,n,r,o,s,i,l,a){return e=new _w(e,t,n,l,a),t===1?(t=1,s===!0&&(t|=8)):t=0,s=bt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},qc(s),e}function Rw(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ky)}catch(e){console.error(e)}}ky(),xp.exports=Tt;var Ny=xp.exports;const kw=Sc(Ny);var ih=Ny;tu.createRoot=ih.createRoot,tu.hydrateRoot=ih.hydrateRoot;/** * @remix-run/router v1.7.2 * * Copyright (c) Remix Software Inc. @@ -55,7 +55,7 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Gu(){return Gu=Object.assign?Object.assign.bind():function(e){for(var t=1;tObject.assign({},v,{params:Object.assign({},i,v.params),pathname:Qr([l,r.encodeLocation?r.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?l:Qr([l,r.encodeLocation?r.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),o,n);return t&&p?U.createElement(Fl.Provider,{value:{location:Gu({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:On.Pop}},p):p}function e_(){let e=a_(),t=qw(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},s=null;return U.createElement(U.Fragment,null,U.createElement("h2",null,"Unexpected Application Error!"),U.createElement("h3",{style:{fontStyle:"italic"}},t),n?U.createElement("pre",{style:o},n):null,s)}const t_=U.createElement(e_,null);class n_ extends U.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?U.createElement(Dl.Provider,{value:this.props.routeContext},U.createElement(Dy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function r_(e){let{routeContext:t,match:n,children:r}=e,o=U.useContext(Gw);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),U.createElement(Dl.Provider,{value:t},r)}function o_(e,t,n){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),e==null){var o;if((o=n)!=null&&o.errors)e=n.matches;else return null}let s=e,i=(r=n)==null?void 0:r.errors;if(i!=null){let l=s.findIndex(a=>a.route.id&&(i==null?void 0:i[a.route.id]));l>=0||St(!1),s=s.slice(0,Math.min(s.length,l+1))}return s.reduceRight((l,a,u)=>{let c=a.route.id?i==null?void 0:i[a.route.id]:null,f=null;n&&(f=a.route.errorElement||t_);let h=t.concat(s.slice(0,u+1)),S=()=>{let p;return c?p=f:a.route.Component?p=U.createElement(a.route.Component,null):a.route.element?p=a.route.element:p=l,U.createElement(r_,{match:a,routeContext:{outlet:l,matches:h,isDataRoute:n!=null},children:p})};return n&&(a.route.ErrorBoundary||a.route.errorElement||u===0)?U.createElement(n_,{location:n.location,revalidation:n.revalidation,component:f,error:c,children:S(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):S()},null)}var fh;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"})(fh||(fh={}));var nl;(function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId"})(nl||(nl={}));function s_(e){let t=U.useContext(Yw);return t||St(!1),t}function i_(e){let t=U.useContext(Dl);return t||St(!1),t}function l_(e){let t=i_(),n=t.matches[t.matches.length-1];return n.route.id||St(!1),n.route.id}function a_(){var e;let t=U.useContext(Dy),n=s_(nl.UseRouteError),r=l_(nl.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function Yu(e){St(!1)}function u_(e){let{basename:t="/",children:n=null,location:r,navigationType:o=On.Pop,navigator:s,static:i=!1}=e;yf()&&St(!1);let l=t.replace(/^\/*/,"/"),a=U.useMemo(()=>({basename:l,navigator:s,static:i}),[l,s,i]);typeof r=="string"&&(r=bl(r));let{pathname:u="/",search:c="",hash:f="",state:h=null,key:S="default"}=r,p=U.useMemo(()=>{let v=Oy(u,l);return v==null?null:{location:{pathname:v,search:c,hash:f,state:h,key:S},navigationType:o}},[l,u,c,f,h,S,o]);return p==null?null:U.createElement(Fy.Provider,{value:a},U.createElement(Fl.Provider,{children:n,value:p}))}function c_(e){let{children:t,location:n}=e;return Jw(Xu(t),n)}var dh;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(dh||(dh={}));new Promise(()=>{});function Xu(e,t){t===void 0&&(t=[]);let n=[];return U.Children.forEach(e,(r,o)=>{if(!U.isValidElement(r))return;let s=[...t,o];if(r.type===U.Fragment){n.push.apply(n,Xu(r.props.children,s));return}r.type!==Yu&&St(!1),!r.props.index||!r.props.children||St(!1);let i={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=Xu(r.props.children,s)),n.push(i)}),n}/** + */function Gu(){return Gu=Object.assign?Object.assign.bind():function(e){for(var t=1;tObject.assign({},v,{params:Object.assign({},i,v.params),pathname:Qr([l,r.encodeLocation?r.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?l:Qr([l,r.encodeLocation?r.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),o,n);return t&&p?U.createElement(Fl.Provider,{value:{location:Gu({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:On.Pop}},p):p}function e_(){let e=a_(),t=qw(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},s=null;return U.createElement(U.Fragment,null,U.createElement("h2",null,"Unexpected Application Error!"),U.createElement("h3",{style:{fontStyle:"italic"}},t),n?U.createElement("pre",{style:o},n):null,s)}const t_=U.createElement(e_,null);class n_ extends U.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?U.createElement(Dl.Provider,{value:this.props.routeContext},U.createElement(Dy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function r_(e){let{routeContext:t,match:n,children:r}=e,o=U.useContext(Gw);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),U.createElement(Dl.Provider,{value:t},r)}function o_(e,t,n){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),e==null){var o;if((o=n)!=null&&o.errors)e=n.matches;else return null}let s=e,i=(r=n)==null?void 0:r.errors;if(i!=null){let l=s.findIndex(a=>a.route.id&&(i==null?void 0:i[a.route.id]));l>=0||St(!1),s=s.slice(0,Math.min(s.length,l+1))}return s.reduceRight((l,a,u)=>{let c=a.route.id?i==null?void 0:i[a.route.id]:null,f=null;n&&(f=a.route.errorElement||t_);let h=t.concat(s.slice(0,u+1)),S=()=>{let p;return c?p=f:a.route.Component?p=U.createElement(a.route.Component,null):a.route.element?p=a.route.element:p=l,U.createElement(r_,{match:a,routeContext:{outlet:l,matches:h,isDataRoute:n!=null},children:p})};return n&&(a.route.ErrorBoundary||a.route.errorElement||u===0)?U.createElement(n_,{location:n.location,revalidation:n.revalidation,component:f,error:c,children:S(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):S()},null)}var fh;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"})(fh||(fh={}));var nl;(function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId"})(nl||(nl={}));function s_(e){let t=U.useContext(Yw);return t||St(!1),t}function i_(e){let t=U.useContext(Dl);return t||St(!1),t}function l_(e){let t=i_(),n=t.matches[t.matches.length-1];return n.route.id||St(!1),n.route.id}function a_(){var e;let t=U.useContext(Dy),n=s_(nl.UseRouteError),r=l_(nl.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function Yu(e){St(!1)}function u_(e){let{basename:t="/",children:n=null,location:r,navigationType:o=On.Pop,navigator:s,static:i=!1}=e;yf()&&St(!1);let l=t.replace(/^\/*/,"/"),a=U.useMemo(()=>({basename:l,navigator:s,static:i}),[l,s,i]);typeof r=="string"&&(r=bl(r));let{pathname:u="/",search:c="",hash:f="",state:h=null,key:S="default"}=r,p=U.useMemo(()=>{let v=Oy(u,l);return v==null?null:{location:{pathname:v,search:c,hash:f,state:h,key:S},navigationType:o}},[l,u,c,f,h,S,o]);return p==null?null:U.createElement(Fy.Provider,{value:a},U.createElement(Fl.Provider,{children:n,value:p}))}function c_(e){let{children:t,location:n}=e;return Xw(Ju(t),n)}var dh;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(dh||(dh={}));new Promise(()=>{});function Ju(e,t){t===void 0&&(t=[]);let n=[];return U.Children.forEach(e,(r,o)=>{if(!U.isValidElement(r))return;let s=[...t,o];if(r.type===U.Fragment){n.push.apply(n,Ju(r.props.children,s));return}r.type!==Yu&&St(!1),!r.props.index||!r.props.children||St(!1);let i={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=Ju(r.props.children,s)),n.push(i)}),n}/** * React Router DOM v6.14.2 * * Copyright (c) Remix Software Inc. @@ -64,9 +64,9 @@ Error generating stack: `+s.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */const f_="startTransition",hh=v0[f_];function d_(e){let{basename:t,children:n,future:r,window:o}=e,s=U.useRef();s.current==null&&(s.current=Nw({window:o,v5Compat:!0}));let i=s.current,[l,a]=U.useState({action:i.action,location:i.location}),{v7_startTransition:u}=r||{},c=U.useCallback(f=>{u&&hh?hh(()=>a(f)):a(f)},[a,u]);return U.useLayoutEffect(()=>i.listen(c),[i,c]),U.createElement(u_,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:i})}var ph;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(ph||(ph={}));var mh;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(mh||(mh={}));function h_(e){const t=new Error(e);if(t.stack===void 0)try{throw t}catch{}return t}var p_=h_,de=p_;function m_(e){return!!e&&typeof e.then=="function"}var Pe=m_;function y_(e,t){if(e!=null)return e;throw de(t??"Got unexpected null or undefined")}var De=y_;function fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Ml{getValue(){throw de("BaseLoadable")}toPromise(){throw de("BaseLoadable")}valueMaybe(){throw de("BaseLoadable")}valueOrThrow(){throw de(`Loadable expected value, but in "${this.state}" state`)}promiseMaybe(){throw de("BaseLoadable")}promiseOrThrow(){throw de(`Loadable expected promise, but in "${this.state}" state`)}errorMaybe(){throw de("BaseLoadable")}errorOrThrow(){throw de(`Loadable expected error, but in "${this.state}" state`)}is(t){return t.state===this.state&&t.contents===this.contents}map(t){throw de("BaseLoadable")}}class v_ extends Ml{constructor(t){super(),fe(this,"state","hasValue"),fe(this,"contents",void 0),this.contents=t}getValue(){return this.contents}toPromise(){return Promise.resolve(this.contents)}valueMaybe(){return this.contents}valueOrThrow(){return this.contents}promiseMaybe(){}errorMaybe(){}map(t){try{const n=t(this.contents);return Pe(n)?yr(n):to(n)?n:Ts(n)}catch(n){return Pe(n)?yr(n.next(()=>this.map(t))):Ul(n)}}}class g_ extends Ml{constructor(t){super(),fe(this,"state","hasError"),fe(this,"contents",void 0),this.contents=t}getValue(){throw this.contents}toPromise(){return Promise.reject(this.contents)}valueMaybe(){}promiseMaybe(){}errorMaybe(){return this.contents}errorOrThrow(){return this.contents}map(t){return this}}class My extends Ml{constructor(t){super(),fe(this,"state","loading"),fe(this,"contents",void 0),this.contents=t}getValue(){throw this.contents}toPromise(){return this.contents}valueMaybe(){}promiseMaybe(){return this.contents}promiseOrThrow(){return this.contents}errorMaybe(){}map(t){return yr(this.contents.then(n=>{const r=t(n);if(to(r)){const o=r;switch(o.state){case"hasValue":return o.contents;case"hasError":throw o.contents;case"loading":return o.contents}}return r}).catch(n=>{if(Pe(n))return n.then(()=>this.map(t).contents);throw n}))}}function Ts(e){return Object.freeze(new v_(e))}function Ul(e){return Object.freeze(new g_(e))}function yr(e){return Object.freeze(new My(e))}function Uy(){return Object.freeze(new My(new Promise(()=>{})))}function S_(e){return e.every(t=>t.state==="hasValue")?Ts(e.map(t=>t.contents)):e.some(t=>t.state==="hasError")?Ul(De(e.find(t=>t.state==="hasError"),"Invalid loadable passed to loadableAll").contents):yr(Promise.all(e.map(t=>t.contents)))}function Iy(e){const n=(Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(o=>e[o])).map(o=>to(o)?o:Pe(o)?yr(o):Ts(o)),r=S_(n);return Array.isArray(e)?r:r.map(o=>Object.getOwnPropertyNames(e).reduce((s,i,l)=>({...s,[i]:o[l]}),{}))}function to(e){return e instanceof Ml}const w_={of:e=>Pe(e)?yr(e):to(e)?e:Ts(e),error:e=>Ul(e),loading:()=>Uy(),all:Iy,isLoadable:to};var wr={loadableWithValue:Ts,loadableWithError:Ul,loadableWithPromise:yr,loadableLoading:Uy,loadableAll:Iy,isLoadable:to,RecoilLoadable:w_},__=wr.loadableWithValue,R_=wr.loadableWithError,E_=wr.loadableWithPromise,C_=wr.loadableLoading,x_=wr.loadableAll,T_=wr.isLoadable,k_=wr.RecoilLoadable,ks=Object.freeze({__proto__:null,loadableWithValue:__,loadableWithError:R_,loadableWithPromise:E_,loadableLoading:C_,loadableAll:x_,isLoadable:T_,RecoilLoadable:k_});const Ju={RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED:!0,RECOIL_GKS_ENABLED:new Set(["recoil_hamt_2020","recoil_sync_external_store","recoil_suppress_rerender_in_callback","recoil_memory_managament_2020"])};function N_(e,t){var n,r;const o=(n=process.env[e])===null||n===void 0||(r=n.toLowerCase())===null||r===void 0?void 0:r.trim();if(o==null||o==="")return;if(!["true","false"].includes(o))throw de(`({}).${e} value must be 'true', 'false', or empty: ${o}`);t(o==="true")}function A_(e,t){var n;const r=(n=process.env[e])===null||n===void 0?void 0:n.trim();r==null||r===""||t(r.split(/\s*,\s*|\s+/))}function L_(){var e;typeof process>"u"||((e=process)===null||e===void 0?void 0:e.env)!=null&&(N_("RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED",t=>{Ju.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED=t}),A_("RECOIL_GKS_ENABLED",t=>{t.forEach(n=>{Ju.RECOIL_GKS_ENABLED.add(n)})}))}L_();var ho=Ju;function Il(e){return ho.RECOIL_GKS_ENABLED.has(e)}Il.setPass=e=>{ho.RECOIL_GKS_ENABLED.add(e)};Il.setFail=e=>{ho.RECOIL_GKS_ENABLED.delete(e)};Il.clear=()=>{ho.RECOIL_GKS_ENABLED.clear()};var xe=Il;function P_(e,t,{error:n}={}){return null}var O_=P_,vf=O_,Ua,Ia,Va;const b_=(Ua=re.createMutableSource)!==null&&Ua!==void 0?Ua:re.unstable_createMutableSource,Vy=(Ia=re.useMutableSource)!==null&&Ia!==void 0?Ia:re.unstable_useMutableSource,$y=(Va=re.useSyncExternalStore)!==null&&Va!==void 0?Va:re.unstable_useSyncExternalStore;function F_(){var e;const{ReactCurrentDispatcher:t,ReactCurrentOwner:n}=re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;return((e=t==null?void 0:t.current)!==null&&e!==void 0?e:n.currentDispatcher).useSyncExternalStore!=null}function D_(){return xe("recoil_transition_support")?{mode:"TRANSITION_SUPPORT",early:!0,concurrent:!0}:xe("recoil_sync_external_store")&&$y!=null?{mode:"SYNC_EXTERNAL_STORE",early:!0,concurrent:!1}:xe("recoil_mutable_source")&&Vy!=null&&typeof window<"u"&&!window.$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE?xe("recoil_suppress_rerender_in_callback")?{mode:"MUTABLE_SOURCE",early:!0,concurrent:!0}:{mode:"MUTABLE_SOURCE",early:!1,concurrent:!1}:xe("recoil_suppress_rerender_in_callback")?{mode:"LEGACY",early:!0,concurrent:!1}:{mode:"LEGACY",early:!1,concurrent:!1}}function M_(){return!1}var Ns={createMutableSource:b_,useMutableSource:Vy,useSyncExternalStore:$y,currentRendererSupportsUseSyncExternalStore:F_,reactMode:D_,isFastRefreshEnabled:M_};class gf{constructor(t){fe(this,"key",void 0),this.key=t}toJSON(){return{key:this.key}}}class jy extends gf{}class By extends gf{}function U_(e){return e instanceof jy||e instanceof By}var Vl={AbstractRecoilValue:gf,RecoilState:jy,RecoilValueReadOnly:By,isRecoilValue:U_},I_=Vl.AbstractRecoilValue,V_=Vl.RecoilState,$_=Vl.RecoilValueReadOnly,j_=Vl.isRecoilValue,no=Object.freeze({__proto__:null,AbstractRecoilValue:I_,RecoilState:V_,RecoilValueReadOnly:$_,isRecoilValue:j_});function B_(e,t){return function*(){let n=0;for(const r of e)yield t(r,n++)}()}var $l=B_;class zy{}const z_=new zy,vr=new Map,Sf=new Map;function H_(e){return $l(e,t=>De(Sf.get(t)))}function W_(e){if(vr.has(e)){const t=`Duplicate atom key "${e}". This is a FATAL ERROR in + */const f_="startTransition",hh=v0[f_];function d_(e){let{basename:t,children:n,future:r,window:o}=e,s=U.useRef();s.current==null&&(s.current=Nw({window:o,v5Compat:!0}));let i=s.current,[l,a]=U.useState({action:i.action,location:i.location}),{v7_startTransition:u}=r||{},c=U.useCallback(f=>{u&&hh?hh(()=>a(f)):a(f)},[a,u]);return U.useLayoutEffect(()=>i.listen(c),[i,c]),U.createElement(u_,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:i})}var ph;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(ph||(ph={}));var mh;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(mh||(mh={}));function h_(e){const t=new Error(e);if(t.stack===void 0)try{throw t}catch{}return t}var p_=h_,de=p_;function m_(e){return!!e&&typeof e.then=="function"}var Pe=m_;function y_(e,t){if(e!=null)return e;throw de(t??"Got unexpected null or undefined")}var De=y_;function fe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Ml{getValue(){throw de("BaseLoadable")}toPromise(){throw de("BaseLoadable")}valueMaybe(){throw de("BaseLoadable")}valueOrThrow(){throw de(`Loadable expected value, but in "${this.state}" state`)}promiseMaybe(){throw de("BaseLoadable")}promiseOrThrow(){throw de(`Loadable expected promise, but in "${this.state}" state`)}errorMaybe(){throw de("BaseLoadable")}errorOrThrow(){throw de(`Loadable expected error, but in "${this.state}" state`)}is(t){return t.state===this.state&&t.contents===this.contents}map(t){throw de("BaseLoadable")}}class v_ extends Ml{constructor(t){super(),fe(this,"state","hasValue"),fe(this,"contents",void 0),this.contents=t}getValue(){return this.contents}toPromise(){return Promise.resolve(this.contents)}valueMaybe(){return this.contents}valueOrThrow(){return this.contents}promiseMaybe(){}errorMaybe(){}map(t){try{const n=t(this.contents);return Pe(n)?yr(n):to(n)?n:Ts(n)}catch(n){return Pe(n)?yr(n.next(()=>this.map(t))):Ul(n)}}}class g_ extends Ml{constructor(t){super(),fe(this,"state","hasError"),fe(this,"contents",void 0),this.contents=t}getValue(){throw this.contents}toPromise(){return Promise.reject(this.contents)}valueMaybe(){}promiseMaybe(){}errorMaybe(){return this.contents}errorOrThrow(){return this.contents}map(t){return this}}class My extends Ml{constructor(t){super(),fe(this,"state","loading"),fe(this,"contents",void 0),this.contents=t}getValue(){throw this.contents}toPromise(){return this.contents}valueMaybe(){}promiseMaybe(){return this.contents}promiseOrThrow(){return this.contents}errorMaybe(){}map(t){return yr(this.contents.then(n=>{const r=t(n);if(to(r)){const o=r;switch(o.state){case"hasValue":return o.contents;case"hasError":throw o.contents;case"loading":return o.contents}}return r}).catch(n=>{if(Pe(n))return n.then(()=>this.map(t).contents);throw n}))}}function Ts(e){return Object.freeze(new v_(e))}function Ul(e){return Object.freeze(new g_(e))}function yr(e){return Object.freeze(new My(e))}function Uy(){return Object.freeze(new My(new Promise(()=>{})))}function S_(e){return e.every(t=>t.state==="hasValue")?Ts(e.map(t=>t.contents)):e.some(t=>t.state==="hasError")?Ul(De(e.find(t=>t.state==="hasError"),"Invalid loadable passed to loadableAll").contents):yr(Promise.all(e.map(t=>t.contents)))}function Iy(e){const n=(Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(o=>e[o])).map(o=>to(o)?o:Pe(o)?yr(o):Ts(o)),r=S_(n);return Array.isArray(e)?r:r.map(o=>Object.getOwnPropertyNames(e).reduce((s,i,l)=>({...s,[i]:o[l]}),{}))}function to(e){return e instanceof Ml}const w_={of:e=>Pe(e)?yr(e):to(e)?e:Ts(e),error:e=>Ul(e),loading:()=>Uy(),all:Iy,isLoadable:to};var wr={loadableWithValue:Ts,loadableWithError:Ul,loadableWithPromise:yr,loadableLoading:Uy,loadableAll:Iy,isLoadable:to,RecoilLoadable:w_},__=wr.loadableWithValue,R_=wr.loadableWithError,E_=wr.loadableWithPromise,C_=wr.loadableLoading,x_=wr.loadableAll,T_=wr.isLoadable,k_=wr.RecoilLoadable,ks=Object.freeze({__proto__:null,loadableWithValue:__,loadableWithError:R_,loadableWithPromise:E_,loadableLoading:C_,loadableAll:x_,isLoadable:T_,RecoilLoadable:k_});const Xu={RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED:!0,RECOIL_GKS_ENABLED:new Set(["recoil_hamt_2020","recoil_sync_external_store","recoil_suppress_rerender_in_callback","recoil_memory_managament_2020"])};function N_(e,t){var n,r;const o=(n=process.env[e])===null||n===void 0||(r=n.toLowerCase())===null||r===void 0?void 0:r.trim();if(o==null||o==="")return;if(!["true","false"].includes(o))throw de(`({}).${e} value must be 'true', 'false', or empty: ${o}`);t(o==="true")}function A_(e,t){var n;const r=(n=process.env[e])===null||n===void 0?void 0:n.trim();r==null||r===""||t(r.split(/\s*,\s*|\s+/))}function L_(){var e;typeof process>"u"||((e=process)===null||e===void 0?void 0:e.env)!=null&&(N_("RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED",t=>{Xu.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED=t}),A_("RECOIL_GKS_ENABLED",t=>{t.forEach(n=>{Xu.RECOIL_GKS_ENABLED.add(n)})}))}L_();var ho=Xu;function Il(e){return ho.RECOIL_GKS_ENABLED.has(e)}Il.setPass=e=>{ho.RECOIL_GKS_ENABLED.add(e)};Il.setFail=e=>{ho.RECOIL_GKS_ENABLED.delete(e)};Il.clear=()=>{ho.RECOIL_GKS_ENABLED.clear()};var xe=Il;function P_(e,t,{error:n}={}){return null}var O_=P_,vf=O_,Ua,Ia,Va;const b_=(Ua=re.createMutableSource)!==null&&Ua!==void 0?Ua:re.unstable_createMutableSource,Vy=(Ia=re.useMutableSource)!==null&&Ia!==void 0?Ia:re.unstable_useMutableSource,$y=(Va=re.useSyncExternalStore)!==null&&Va!==void 0?Va:re.unstable_useSyncExternalStore;function F_(){var e;const{ReactCurrentDispatcher:t,ReactCurrentOwner:n}=re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;return((e=t==null?void 0:t.current)!==null&&e!==void 0?e:n.currentDispatcher).useSyncExternalStore!=null}function D_(){return xe("recoil_transition_support")?{mode:"TRANSITION_SUPPORT",early:!0,concurrent:!0}:xe("recoil_sync_external_store")&&$y!=null?{mode:"SYNC_EXTERNAL_STORE",early:!0,concurrent:!1}:xe("recoil_mutable_source")&&Vy!=null&&typeof window<"u"&&!window.$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE?xe("recoil_suppress_rerender_in_callback")?{mode:"MUTABLE_SOURCE",early:!0,concurrent:!0}:{mode:"MUTABLE_SOURCE",early:!1,concurrent:!1}:xe("recoil_suppress_rerender_in_callback")?{mode:"LEGACY",early:!0,concurrent:!1}:{mode:"LEGACY",early:!1,concurrent:!1}}function M_(){return!1}var Ns={createMutableSource:b_,useMutableSource:Vy,useSyncExternalStore:$y,currentRendererSupportsUseSyncExternalStore:F_,reactMode:D_,isFastRefreshEnabled:M_};class gf{constructor(t){fe(this,"key",void 0),this.key=t}toJSON(){return{key:this.key}}}class jy extends gf{}class By extends gf{}function U_(e){return e instanceof jy||e instanceof By}var Vl={AbstractRecoilValue:gf,RecoilState:jy,RecoilValueReadOnly:By,isRecoilValue:U_},I_=Vl.AbstractRecoilValue,V_=Vl.RecoilState,$_=Vl.RecoilValueReadOnly,j_=Vl.isRecoilValue,no=Object.freeze({__proto__:null,AbstractRecoilValue:I_,RecoilState:V_,RecoilValueReadOnly:$_,isRecoilValue:j_});function B_(e,t){return function*(){let n=0;for(const r of e)yield t(r,n++)}()}var $l=B_;class zy{}const z_=new zy,vr=new Map,Sf=new Map;function H_(e){return $l(e,t=>De(Sf.get(t)))}function W_(e){if(vr.has(e)){const t=`Duplicate atom key "${e}". This is a FATAL ERROR in production. But it is safe to ignore this warning if it occurred because of - hot module replacement.`;console.warn(t)}}function Q_(e){ho.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED&&W_(e.key),vr.set(e.key,e);const t=e.set==null?new no.RecoilValueReadOnly(e.key):new no.RecoilState(e.key);return Sf.set(e.key,t),t}class Hy extends Error{}function q_(e){const t=vr.get(e);if(t==null)throw new Hy(`Missing definition for RecoilValue: "${e}""`);return t}function K_(e){return vr.get(e)}const rl=new Map;function G_(e){var t;if(!xe("recoil_memory_managament_2020"))return;const n=vr.get(e);if(n!=null&&(t=n.shouldDeleteConfigOnRelease)!==null&&t!==void 0&&t.call(n)){var r;vr.delete(e),(r=Wy(e))===null||r===void 0||r(),rl.delete(e)}}function Y_(e,t){xe("recoil_memory_managament_2020")&&(t===void 0?rl.delete(e):rl.set(e,t))}function Wy(e){return rl.get(e)}var wt={nodes:vr,recoilValues:Sf,registerNode:Q_,getNode:q_,getNodeMaybe:K_,deleteNodeConfigIfPossible:G_,setConfigDeletionHandler:Y_,getConfigDeletionHandler:Wy,recoilValuesForKeys:H_,NodeMissingError:Hy,DefaultValue:zy,DEFAULT_VALUE:z_};function X_(e,t){t()}var J_={enqueueExecution:X_};function Z_(e,t){return t={exports:{}},e(t,t.exports),t.exports}var e1=Z_(function(e){var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},n={},r=5,o=Math.pow(2,r),s=o-1,i=o/2,l=o/4,a={},u=function(w){return function(){return w}},c=n.hash=function(E){var w=typeof E>"u"?"undefined":t(E);if(w==="number")return E;w!=="string"&&(E+="");for(var D=0,W=0,Q=E.length;W>1&1431655765,w=(w&858993459)+(w>>2&858993459),w=w+(w>>4)&252645135,w+=w>>8,w+=w>>16,w&127},h=function(w,D){return D>>>w&s},S=function(w){return 1<=D;)Q[ae--]=Q[ae];return Q[D]=W,Q}for(var se=0,ie=0,he=new Array(G+1);se>>=1;return ae[D]=W,me(w,ie+1,ae)},le=function(w,D,W,Q){for(var G=new Array(D-1),ae=0,se=0,ie=0,he=Q.length;ie1?Z(w,this.hash,he):he[0]}var be=Q();return be===a?this:(++se.value,Ee(w,W,this.hash,this,G,O(w,G,ae,be)))},H=function(w,D,W,Q,G,ae,se){var ie=this.mask,he=this.children,be=h(W,G),dt=S(be),Ge=p(ie,dt),Nt=ie&dt,It=Nt?he[Ge]:A,Rr=It._modify(w,D,W+r,Q,G,ae,se);if(It===Rr)return this;var Bs=we(w,this),So=ie,wo=void 0;if(Nt&&N(Rr)){if(So&=~dt,!So)return A;if(he.length<=2&&ue(he[Ge^1]))return he[Ge^1];wo=x(Bs,Ge,he)}else if(!Nt&&!N(Rr)){if(he.length>=i)return z(w,be,Rr,ie,he);So|=dt,wo=y(Bs,Ge,Rr,he)}else wo=v(Bs,Ge,Rr,he);return Bs?(this.mask=So,this.children=wo,this):Y(w,So,wo)},ce=function(w,D,W,Q,G,ae,se){var ie=this.size,he=this.children,be=h(W,G),dt=he[be],Ge=(dt||A)._modify(w,D,W+r,Q,G,ae,se);if(dt===Ge)return this;var Nt=we(w,this),It=void 0;if(N(dt)&&!N(Ge))++ie,It=v(Nt,be,Ge,he);else if(!N(dt)&&N(Ge)){if(--ie,ie<=l)return le(w,ie,be,he);It=v(Nt,be,A,he)}else It=v(Nt,be,Ge,he);return Nt?(this.size=ie,this.children=It,this):me(w,ie,It)};A._modify=function(E,w,D,W,Q,G,ae){var se=W();return se===a?A:(++ae.value,O(E,Q,G,se))};function C(E,w,D,W,Q){this._editable=E,this._edit=w,this._config=D,this._root=W,this._size=Q}C.prototype.setTree=function(E,w){return this._editable?(this._root=E,this._size=w,this):E===this._root?this:new C(this._editable,this._edit,this._config,E,w)};var b=n.tryGetHash=function(E,w,D,W){for(var Q=W._root,G=0,ae=W._config.keyEq;;)switch(Q.type){case d:return ae(D,Q.key)?Q.value:E;case m:{if(w===Q.hash)for(var se=Q.children,ie=0,he=se.length;ie{n.set(o,t(r,o))}),n}var ol=i1;function l1(){return{nodeDeps:new Map,nodeToNodeSubscriptions:new Map}}function a1(e){return{nodeDeps:ol(e.nodeDeps,t=>new Set(t)),nodeToNodeSubscriptions:ol(e.nodeToNodeSubscriptions,t=>new Set(t))}}function $a(e,t,n,r){const{nodeDeps:o,nodeToNodeSubscriptions:s}=n,i=o.get(e);if(i&&r&&i!==r.nodeDeps.get(e))return;o.set(e,t);const l=i==null?t:Zo(t,i);for(const a of l)s.has(a)||s.set(a,new Set),De(s.get(a)).add(e);if(i){const a=Zo(i,t);for(const u of a){if(!s.has(u))return;const c=De(s.get(u));c.delete(e),c.size===0&&s.delete(u)}}}function u1(e,t,n,r){var o,s,i,l;const a=n.getState();r===a.currentTree.version||r===((o=a.nextTree)===null||o===void 0?void 0:o.version)||((s=a.previousTree)===null||s===void 0||s.version);const u=n.getGraph(r);if($a(e,t,u),r===((i=a.previousTree)===null||i===void 0?void 0:i.version)){const f=n.getGraph(a.currentTree.version);$a(e,t,f,u)}if(r===((l=a.previousTree)===null||l===void 0?void 0:l.version)||r===a.currentTree.version){var c;const f=(c=a.nextTree)===null||c===void 0?void 0:c.version;if(f!==void 0){const h=n.getGraph(f);$a(e,t,h,u)}}}var As={cloneGraph:a1,graph:l1,saveDepsToStore:u1};let c1=0;const f1=()=>c1++;let d1=0;const h1=()=>d1++;let p1=0;const m1=()=>p1++;var jl={getNextTreeStateVersion:f1,getNextStoreID:h1,getNextComponentID:m1};const{persistentMap:yh}=o1,{graph:y1}=As,{getNextTreeStateVersion:Qy}=jl;function qy(){const e=Qy();return{version:e,stateID:e,transactionMetadata:{},dirtyAtoms:new Set,atomValues:yh(),nonvalidatedAtoms:yh()}}function v1(){const e=qy();return{currentTree:e,nextTree:null,previousTree:null,commitDepth:0,knownAtoms:new Set,knownSelectors:new Set,transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(e.version,y1()),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}}var Ky={makeEmptyTreeState:qy,makeEmptyStoreState:v1,getNextTreeStateVersion:Qy};class Gy{}function g1(){return new Gy}var Bl={RetentionZone:Gy,retentionZone:g1};function S1(e,t){const n=new Set(e);return n.add(t),n}function w1(e,t){const n=new Set(e);return n.delete(t),n}function _1(e,t,n){const r=new Map(e);return r.set(t,n),r}function R1(e,t,n){const r=new Map(e);return r.set(t,n(r.get(t))),r}function E1(e,t){const n=new Map(e);return n.delete(t),n}function C1(e,t){const n=new Map(e);return t.forEach(r=>n.delete(r)),n}var Yy={setByAddingToSet:S1,setByDeletingFromSet:w1,mapBySettingInMap:_1,mapByUpdatingInMap:R1,mapByDeletingFromMap:E1,mapByDeletingMultipleFromMap:C1};function*x1(e,t){let n=0;for(const r of e)t(r,n++)&&(yield r)}var Rf=x1;function T1(e,t){return new Proxy(e,{get:(r,o)=>(!(o in r)&&o in t&&(r[o]=t[o]()),r[o]),ownKeys:r=>Object.keys(r)})}var Xy=T1;const{getNode:Ls,getNodeMaybe:k1,recoilValuesForKeys:vh}=wt,{RetentionZone:gh}=Bl,{setByAddingToSet:N1}=Yy,A1=Object.freeze(new Set);class L1 extends Error{}function P1(e,t,n){if(!xe("recoil_memory_managament_2020"))return()=>{};const{nodesRetainedByZone:r}=e.getState().retention;function o(s){let i=r.get(s);i||r.set(s,i=new Set),i.add(t)}if(n instanceof gh)o(n);else if(Array.isArray(n))for(const s of n)o(s);return()=>{if(!xe("recoil_memory_managament_2020"))return;const{retention:s}=e.getState();function i(l){const a=s.nodesRetainedByZone.get(l);a==null||a.delete(t),a&&a.size===0&&s.nodesRetainedByZone.delete(l)}if(n instanceof gh)i(n);else if(Array.isArray(n))for(const l of n)i(l)}}function Ef(e,t,n,r){const o=e.getState();if(o.nodeCleanupFunctions.has(n))return;const s=Ls(n),i=P1(e,n,s.retainedBy),l=s.init(e,t,r);o.nodeCleanupFunctions.set(n,()=>{l(),i()})}function O1(e,t,n){Ef(e,e.getState().currentTree,t,n)}function b1(e,t){var n;const r=e.getState();(n=r.nodeCleanupFunctions.get(t))===null||n===void 0||n(),r.nodeCleanupFunctions.delete(t)}function F1(e,t,n){return Ef(e,t,n,"get"),Ls(n).get(e,t)}function Jy(e,t,n){return Ls(n).peek(e,t)}function D1(e,t,n){var r;const o=k1(t);return o==null||(r=o.invalidate)===null||r===void 0||r.call(o,e),{...e,atomValues:e.atomValues.clone().delete(t),nonvalidatedAtoms:e.nonvalidatedAtoms.clone().set(t,n),dirtyAtoms:N1(e.dirtyAtoms,t)}}function M1(e,t,n,r){const o=Ls(n);if(o.set==null)throw new L1(`Attempt to set read-only RecoilValue: ${n}`);const s=o.set;return Ef(e,t,n,"set"),s(e,t,r)}function U1(e,t,n){const r=e.getState(),o=e.getGraph(t.version),s=Ls(n).nodeType;return Xy({type:s},{loadable:()=>Jy(e,t,n),isActive:()=>r.knownAtoms.has(n)||r.knownSelectors.has(n),isSet:()=>s==="selector"?!1:t.atomValues.has(n),isModified:()=>t.dirtyAtoms.has(n),deps:()=>{var i;return vh((i=o.nodeDeps.get(n))!==null&&i!==void 0?i:[])},subscribers:()=>{var i,l;return{nodes:vh(Rf(Zy(e,t,new Set([n])),a=>a!==n)),components:$l((i=(l=r.nodeToComponentSubscriptions.get(n))===null||l===void 0?void 0:l.values())!==null&&i!==void 0?i:[],([a])=>({name:a}))}}})}function Zy(e,t,n){const r=new Set,o=Array.from(n),s=e.getGraph(t.version);for(let l=o.pop();l;l=o.pop()){var i;r.add(l);const a=(i=s.nodeToNodeSubscriptions.get(l))!==null&&i!==void 0?i:A1;for(const u of a)r.has(u)||o.push(u)}return r}var Gn={getNodeLoadable:F1,peekNodeLoadable:Jy,setNodeValue:M1,initializeNode:O1,cleanUpNode:b1,setUnvalidatedAtomValue_DEPRECATED:D1,peekNodeInfo:U1,getDownstreamNodes:Zy};let ev=null;function I1(e){ev=e}function V1(){var e;(e=ev)===null||e===void 0||e()}var tv={setInvalidateMemoizedSnapshot:I1,invalidateMemoizedSnapshot:V1};const{getDownstreamNodes:$1,getNodeLoadable:nv,setNodeValue:j1}=Gn,{getNextComponentID:B1}=jl,{getNode:z1,getNodeMaybe:rv}=wt,{DefaultValue:Cf}=wt,{reactMode:H1}=Ns,{AbstractRecoilValue:W1,RecoilState:Q1,RecoilValueReadOnly:q1,isRecoilValue:K1}=no,{invalidateMemoizedSnapshot:G1}=tv;function Y1(e,{key:t},n=e.getState().currentTree){var r,o;const s=e.getState();n.version===s.currentTree.version||n.version===((r=s.nextTree)===null||r===void 0?void 0:r.version)||(n.version,(o=s.previousTree)===null||o===void 0||o.version);const i=nv(e,n,t);return i.state==="loading"&&i.contents.catch(()=>{}),i}function X1(e,t){const n=e.clone();return t.forEach((r,o)=>{r.state==="hasValue"&&r.contents instanceof Cf?n.delete(o):n.set(o,r)}),n}function J1(e,t,{key:n},r){if(typeof r=="function"){const o=nv(e,t,n);if(o.state==="loading"){const s=`Tried to set atom or selector "${n}" using an updater function while the current state is pending, this is not currently supported.`;throw de(s)}else if(o.state==="hasError")throw o.contents;return r(o.contents)}else return r}function Z1(e,t,n){if(n.type==="set"){const{recoilValue:o,valueOrUpdater:s}=n,i=J1(e,t,o,s),l=j1(e,t,o.key,i);for(const[a,u]of l.entries())Zu(t,a,u)}else if(n.type==="setLoadable"){const{recoilValue:{key:o},loadable:s}=n;Zu(t,o,s)}else if(n.type==="markModified"){const{recoilValue:{key:o}}=n;t.dirtyAtoms.add(o)}else if(n.type==="setUnvalidated"){var r;const{recoilValue:{key:o},unvalidatedValue:s}=n,i=rv(o);i==null||(r=i.invalidate)===null||r===void 0||r.call(i,t),t.atomValues.delete(o),t.nonvalidatedAtoms.set(o,s),t.dirtyAtoms.add(o)}else vf(`Unknown action ${n.type}`)}function Zu(e,t,n){n.state==="hasValue"&&n.contents instanceof Cf?e.atomValues.delete(t):e.atomValues.set(t,n),e.dirtyAtoms.add(t),e.nonvalidatedAtoms.delete(t)}function ov(e,t){e.replaceState(n=>{const r=sv(n);for(const o of t)Z1(e,r,o);return iv(e,r),G1(),r})}function zl(e,t){if(es.length){const n=es[es.length-1];let r=n.get(e);r||n.set(e,r=[]),r.push(t)}else ov(e,[t])}const es=[];function eR(){const e=new Map;return es.push(e),()=>{for(const[t,n]of e)ov(t,n);es.pop()}}function sv(e){return{...e,atomValues:e.atomValues.clone(),nonvalidatedAtoms:e.nonvalidatedAtoms.clone(),dirtyAtoms:new Set(e.dirtyAtoms)}}function iv(e,t){const n=$1(e,t,t.dirtyAtoms);for(const s of n){var r,o;(r=rv(s))===null||r===void 0||(o=r.invalidate)===null||o===void 0||o.call(r,t)}}function lv(e,t,n){zl(e,{type:"set",recoilValue:t,valueOrUpdater:n})}function tR(e,t,n){if(n instanceof Cf)return lv(e,t,n);zl(e,{type:"setLoadable",recoilValue:t,loadable:n})}function nR(e,t){zl(e,{type:"markModified",recoilValue:t})}function rR(e,t,n){zl(e,{type:"setUnvalidated",recoilValue:t,unvalidatedValue:n})}function oR(e,{key:t},n,r=null){const o=B1(),s=e.getState();s.nodeToComponentSubscriptions.has(t)||s.nodeToComponentSubscriptions.set(t,new Map),De(s.nodeToComponentSubscriptions.get(t)).set(o,[r??"",n]);const i=H1();if(i.early&&(i.mode==="LEGACY"||i.mode==="MUTABLE_SOURCE")){const l=e.getState().nextTree;l&&l.dirtyAtoms.has(t)&&n(l)}return{release:()=>{const l=e.getState(),a=l.nodeToComponentSubscriptions.get(t);a===void 0||!a.has(o)||(a.delete(o),a.size===0&&l.nodeToComponentSubscriptions.delete(t))}}}function sR(e,t){var n;const{currentTree:r}=e.getState(),o=z1(t.key);(n=o.clearCache)===null||n===void 0||n.call(o,e,r)}var rn={RecoilValueReadOnly:q1,AbstractRecoilValue:W1,RecoilState:Q1,getRecoilValueAsLoadable:Y1,setRecoilValue:lv,setRecoilValueLoadable:tR,markRecoilValueModified:nR,setUnvalidatedRecoilValue:rR,subscribeToRecoilValue:oR,isRecoilValue:K1,applyAtomValueWrites:X1,batchStart:eR,writeLoadableToTreeState:Zu,invalidateDownstreams:iv,copyTreeState:sv,refreshRecoilValue:sR};function iR(e,t,n){const r=e.entries();let o=r.next();for(;!o.done;){const s=o.value;if(t.call(n,s[1],s[0],e))return!0;o=r.next()}return!1}var lR=iR;const{cleanUpNode:aR}=Gn,{deleteNodeConfigIfPossible:uR,getNode:av}=wt,{RetentionZone:uv}=Bl,cR=12e4,cv=new Set;function fv(e,t){const n=e.getState(),r=n.currentTree;if(n.nextTree)return;const o=new Set;for(const i of t)if(i instanceof uv)for(const l of pR(n,i))o.add(l);else o.add(i);const s=fR(e,o);for(const i of s)hR(e,r,i)}function fR(e,t){const n=e.getState(),r=n.currentTree,o=e.getGraph(r.version),s=new Set,i=new Set;return l(t),s;function l(a){const u=new Set,c=dR(e,r,a,s,i);for(const p of c){var f;if(av(p).retainedBy==="recoilRoot"){i.add(p);continue}if(((f=n.retention.referenceCounts.get(p))!==null&&f!==void 0?f:0)>0){i.add(p);continue}if(dv(p).some(x=>n.retention.referenceCounts.get(x))){i.add(p);continue}const v=o.nodeToNodeSubscriptions.get(p);if(v&&lR(v,x=>i.has(x))){i.add(p);continue}s.add(p),u.add(p)}const h=new Set;for(const p of u)for(const v of(S=o.nodeDeps.get(p))!==null&&S!==void 0?S:cv){var S;s.has(v)||h.add(v)}h.size&&l(h)}}function dR(e,t,n,r,o){const s=e.getGraph(t.version),i=[],l=new Set;for(;n.size>0;)a(De(n.values().next().value));return i;function a(u){if(r.has(u)||o.has(u)){n.delete(u);return}if(l.has(u))return;const c=s.nodeToNodeSubscriptions.get(u);if(c)for(const f of c)a(f);l.add(u),n.delete(u),i.push(u)}}function hR(e,t,n){if(!xe("recoil_memory_managament_2020"))return;aR(e,n);const r=e.getState();r.knownAtoms.delete(n),r.knownSelectors.delete(n),r.nodeTransactionSubscriptions.delete(n),r.retention.referenceCounts.delete(n);const o=dv(n);for(const a of o){var s;(s=r.retention.nodesRetainedByZone.get(a))===null||s===void 0||s.delete(n)}t.atomValues.delete(n),t.dirtyAtoms.delete(n),t.nonvalidatedAtoms.delete(n);const i=r.graphsByVersion.get(t.version);if(i){const a=i.nodeDeps.get(n);if(a!==void 0){i.nodeDeps.delete(n);for(const u of a){var l;(l=i.nodeToNodeSubscriptions.get(u))===null||l===void 0||l.delete(n)}}i.nodeToNodeSubscriptions.delete(n)}uR(n)}function pR(e,t){var n;return(n=e.retention.nodesRetainedByZone.get(t))!==null&&n!==void 0?n:cv}function dv(e){const t=av(e).retainedBy;return t===void 0||t==="components"||t==="recoilRoot"?[]:t instanceof uv?[t]:t}function mR(e,t){const n=e.getState();n.nextTree?n.retention.retainablesToCheckForRelease.add(t):fv(e,new Set([t]))}function yR(e,t,n){var r;if(!xe("recoil_memory_managament_2020"))return;const o=e.getState().retention.referenceCounts,s=((r=o.get(t))!==null&&r!==void 0?r:0)+n;s===0?hv(e,t):o.set(t,s)}function hv(e,t){if(!xe("recoil_memory_managament_2020"))return;e.getState().retention.referenceCounts.delete(t),mR(e,t)}function vR(e){if(!xe("recoil_memory_managament_2020"))return;const t=e.getState();fv(e,t.retention.retainablesToCheckForRelease),t.retention.retainablesToCheckForRelease.clear()}function gR(e){return e===void 0?"recoilRoot":e}var _r={SUSPENSE_TIMEOUT_MS:cR,updateRetainCount:yR,updateRetainCountToZero:hv,releaseScheduledRetainablesNow:vR,retainedByOptionWithDefault:gR};const{unstable_batchedUpdates:SR}=kw;var wR={unstable_batchedUpdates:SR};const{unstable_batchedUpdates:_R}=wR;var RR={unstable_batchedUpdates:_R};const{batchStart:ER}=rn,{unstable_batchedUpdates:CR}=RR;let xf=CR||(e=>e());const xR=e=>{xf=e},TR=()=>xf,kR=e=>{xf(()=>{let t=()=>{};try{t=ER(),e()}finally{t()}})};var Hl={getBatcher:TR,setBatcher:xR,batchUpdates:kR};function*NR(e){for(const t of e)for(const n of t)yield n}var pv=NR;const mv=typeof Window>"u"||typeof window>"u",AR=e=>!mv&&(e===window||e instanceof Window),LR=typeof navigator<"u"&&navigator.product==="ReactNative";var Wl={isSSR:mv,isReactNative:LR,isWindow:AR};function PR(e,t){let n;return(...r)=>{n||(n={});const o=t(...r);return Object.hasOwnProperty.call(n,o)||(n[o]=e(...r)),n[o]}}function OR(e,t){let n,r;return(...o)=>{const s=t(...o);return n===s||(n=s,r=e(...o)),r}}function bR(e,t){let n,r;return[(...i)=>{const l=t(...i);return n===l||(n=l,r=e(...i)),r},()=>{n=null}]}var FR={memoizeWithArgsHash:PR,memoizeOneWithArgsHash:OR,memoizeOneWithArgsHashAndInvalidation:bR};const{batchUpdates:ec}=Hl,{initializeNode:DR,peekNodeInfo:MR}=Gn,{graph:UR}=As,{getNextStoreID:IR}=jl,{DEFAULT_VALUE:VR,recoilValues:Sh,recoilValuesForKeys:wh}=wt,{AbstractRecoilValue:$R,getRecoilValueAsLoadable:jR,setRecoilValue:_h,setUnvalidatedRecoilValue:BR}=rn,{updateRetainCount:Ei}=_r,{setInvalidateMemoizedSnapshot:zR}=tv,{getNextTreeStateVersion:HR,makeEmptyStoreState:WR}=Ky,{isSSR:QR}=Wl,{memoizeOneWithArgsHashAndInvalidation:qR}=FR;class Ql{constructor(t,n){fe(this,"_store",void 0),fe(this,"_refCount",1),fe(this,"getLoadable",r=>(this.checkRefCount_INTERNAL(),jR(this._store,r))),fe(this,"getPromise",r=>(this.checkRefCount_INTERNAL(),this.getLoadable(r).toPromise())),fe(this,"getNodes_UNSTABLE",r=>{if(this.checkRefCount_INTERNAL(),(r==null?void 0:r.isModified)===!0){if((r==null?void 0:r.isInitialized)===!1)return[];const i=this._store.getState().currentTree;return wh(i.dirtyAtoms)}const o=this._store.getState().knownAtoms,s=this._store.getState().knownSelectors;return(r==null?void 0:r.isInitialized)==null?Sh.values():r.isInitialized===!0?wh(pv([o,s])):Rf(Sh.values(),({key:i})=>!o.has(i)&&!s.has(i))}),fe(this,"getInfo_UNSTABLE",({key:r})=>(this.checkRefCount_INTERNAL(),MR(this._store,this._store.getState().currentTree,r))),fe(this,"map",r=>{this.checkRefCount_INTERNAL();const o=new tc(this,ec);return r(o),o}),fe(this,"asyncMap",async r=>{this.checkRefCount_INTERNAL();const o=new tc(this,ec);return o.retain(),await r(o),o.autoRelease_INTERNAL(),o}),this._store={storeID:IR(),parentStoreID:n,getState:()=>t,replaceState:r=>{t.currentTree=r(t.currentTree)},getGraph:r=>{const o=t.graphsByVersion;if(o.has(r))return De(o.get(r));const s=UR();return o.set(r,s),s},subscribeToTransactions:()=>({release:()=>{}}),addTransactionMetadata:()=>{throw de("Cannot subscribe to Snapshots")}};for(const r of this._store.getState().knownAtoms)DR(this._store,r,"get"),Ei(this._store,r,1);this.autoRelease_INTERNAL()}retain(){this._refCount<=0,this._refCount++;let t=!1;return()=>{t||(t=!0,this._release())}}autoRelease_INTERNAL(){QR||window.setTimeout(()=>this._release(),10)}_release(){if(this._refCount--,this._refCount===0){if(this._store.getState().nodeCleanupFunctions.forEach(t=>t()),this._store.getState().nodeCleanupFunctions.clear(),!xe("recoil_memory_managament_2020"))return}else this._refCount<0}isRetained(){return this._refCount>0}checkRefCount_INTERNAL(){xe("recoil_memory_managament_2020")&&this._refCount<=0}getStore_INTERNAL(){return this.checkRefCount_INTERNAL(),this._store}getID(){return this.checkRefCount_INTERNAL(),this._store.getState().currentTree.stateID}getStoreID(){return this.checkRefCount_INTERNAL(),this._store.storeID}}function yv(e,t,n=!1){const r=e.getState(),o=n?HR():t.version;return{currentTree:{version:n?o:t.version,stateID:n?o:t.stateID,transactionMetadata:{...t.transactionMetadata},dirtyAtoms:new Set(t.dirtyAtoms),atomValues:t.atomValues.clone(),nonvalidatedAtoms:t.nonvalidatedAtoms.clone()},commitDepth:0,nextTree:null,previousTree:null,knownAtoms:new Set(r.knownAtoms),knownSelectors:new Set(r.knownSelectors),transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(o,e.getGraph(t.version)),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map($l(r.nodeCleanupFunctions.entries(),([s])=>[s,()=>{}]))}}function KR(e){const t=new Ql(WR());return e!=null?t.map(e):t}const[Rh,vv]=qR((e,t)=>{var n;const r=e.getState(),o=t==="latest"?(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree:De(r.previousTree);return new Ql(yv(e,o),e.storeID)},(e,t)=>{var n,r;return String(t)+String(e.storeID)+String((n=e.getState().nextTree)===null||n===void 0?void 0:n.version)+String(e.getState().currentTree.version)+String((r=e.getState().previousTree)===null||r===void 0?void 0:r.version)});zR(vv);function GR(e,t="latest"){const n=Rh(e,t);return n.isRetained()?n:(vv(),Rh(e,t))}class tc extends Ql{constructor(t,n){super(yv(t.getStore_INTERNAL(),t.getStore_INTERNAL().getState().currentTree,!0),t.getStoreID()),fe(this,"_batch",void 0),fe(this,"set",(r,o)=>{this.checkRefCount_INTERNAL();const s=this.getStore_INTERNAL();this._batch(()=>{Ei(s,r.key,1),_h(this.getStore_INTERNAL(),r,o)})}),fe(this,"reset",r=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();this._batch(()=>{Ei(o,r.key,1),_h(this.getStore_INTERNAL(),r,VR)})}),fe(this,"setUnvalidatedAtomValues_DEPRECATED",r=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();ec(()=>{for(const[s,i]of r.entries())Ei(o,s,1),BR(o,new $R(s),i)})}),this._batch=n}}var ql={Snapshot:Ql,MutableSnapshot:tc,freshSnapshot:KR,cloneSnapshot:GR},YR=ql.Snapshot,XR=ql.MutableSnapshot,JR=ql.freshSnapshot,ZR=ql.cloneSnapshot,Kl=Object.freeze({__proto__:null,Snapshot:YR,MutableSnapshot:XR,freshSnapshot:JR,cloneSnapshot:ZR});function eE(...e){const t=new Set;for(const n of e)for(const r of n)t.add(r);return t}var tE=eE;const{useRef:nE}=re;function rE(e){const t=nE(e);return t.current===e&&typeof e=="function"&&(t.current=e()),t}var Eh=rE;const{getNextTreeStateVersion:oE,makeEmptyStoreState:gv}=Ky,{cleanUpNode:sE,getDownstreamNodes:iE,initializeNode:lE,setNodeValue:aE,setUnvalidatedAtomValue_DEPRECATED:uE}=Gn,{graph:cE}=As,{cloneGraph:fE}=As,{getNextStoreID:Sv}=jl,{createMutableSource:ja,reactMode:wv}=Ns,{applyAtomValueWrites:dE}=rn,{releaseScheduledRetainablesNow:_v}=_r,{freshSnapshot:hE}=Kl,{useCallback:pE,useContext:Rv,useEffect:nc,useMemo:mE,useRef:yE,useState:vE}=re;function Ao(){throw de("This component must be used inside a component.")}const Ev=Object.freeze({storeID:Sv(),getState:Ao,replaceState:Ao,getGraph:Ao,subscribeToTransactions:Ao,addTransactionMetadata:Ao});let rc=!1;function Ch(e){if(rc)throw de("An atom update was triggered within the execution of a state updater function. State updater functions provided to Recoil must be pure functions.");const t=e.getState();if(t.nextTree===null){xe("recoil_memory_managament_2020")&&xe("recoil_release_on_cascading_update_killswitch_2021")&&t.commitDepth>0&&_v(e);const n=t.currentTree.version,r=oE();t.nextTree={...t.currentTree,version:r,stateID:r,dirtyAtoms:new Set,transactionMetadata:{}},t.graphsByVersion.set(r,fE(De(t.graphsByVersion.get(n))))}}const Cv=re.createContext({current:Ev}),Gl=()=>Rv(Cv),xv=re.createContext(null);function gE(){return Rv(xv)}function Tf(e,t,n){const r=iE(e,n,n.dirtyAtoms);for(const o of r){const s=t.nodeToComponentSubscriptions.get(o);if(s)for(const[i,[l,a]]of s)a(n)}}function Tv(e){const t=e.getState(),n=t.currentTree,r=n.dirtyAtoms;if(r.size){for(const[o,s]of t.nodeTransactionSubscriptions)if(r.has(o))for(const[i,l]of s)l(e);for(const[o,s]of t.transactionSubscriptions)s(e);(!wv().early||t.suspendedComponentResolvers.size>0)&&(Tf(e,t,n),t.suspendedComponentResolvers.forEach(o=>o()),t.suspendedComponentResolvers.clear())}t.queuedComponentCallbacks_DEPRECATED.forEach(o=>o(n)),t.queuedComponentCallbacks_DEPRECATED.splice(0,t.queuedComponentCallbacks_DEPRECATED.length)}function SE(e){const t=e.getState();t.commitDepth++;try{const{nextTree:n}=t;if(n==null)return;t.previousTree=t.currentTree,t.currentTree=n,t.nextTree=null,Tv(e),t.previousTree!=null?t.graphsByVersion.delete(t.previousTree.version):vf("Ended batch with no previous state, which is unexpected","recoil"),t.previousTree=null,xe("recoil_memory_managament_2020")&&n==null&&_v(e)}finally{t.commitDepth--}}function wE({setNotifyBatcherOfChange:e}){const t=Gl(),[,n]=vE([]);return e(()=>n({})),nc(()=>(e(()=>n({})),()=>{e(()=>{})}),[e]),nc(()=>{J_.enqueueExecution("Batcher",()=>{SE(t.current)})}),null}function _E(e,t){const n=gv();return t({set:(r,o)=>{const s=n.currentTree,i=aE(e,s,r.key,o),l=new Set(i.keys()),a=s.nonvalidatedAtoms.clone();for(const u of l)a.delete(u);n.currentTree={...s,dirtyAtoms:tE(s.dirtyAtoms,l),atomValues:dE(s.atomValues,i),nonvalidatedAtoms:a}},setUnvalidatedAtomValues:r=>{r.forEach((o,s)=>{n.currentTree=uE(n.currentTree,s,o)})}}),n}function RE(e){const t=hE(e),n=t.getStore_INTERNAL().getState();return t.retain(),n.nodeCleanupFunctions.forEach(r=>r()),n.nodeCleanupFunctions.clear(),n}let xh=0;function EE({initializeState_DEPRECATED:e,initializeState:t,store_INTERNAL:n,children:r}){let o;const s=S=>{const p=o.current.graphsByVersion;if(p.has(S))return De(p.get(S));const v=cE();return p.set(S,v),v},i=(S,p)=>{if(p==null){const{transactionSubscriptions:v}=f.current.getState(),x=xh++;return v.set(x,S),{release:()=>{v.delete(x)}}}else{const{nodeTransactionSubscriptions:v}=f.current.getState();v.has(p)||v.set(p,new Map);const x=xh++;return De(v.get(p)).set(x,S),{release:()=>{const y=v.get(p);y&&(y.delete(x),y.size===0&&v.delete(p))}}}},l=S=>{Ch(f.current);for(const p of Object.keys(S))De(f.current.getState().nextTree).transactionMetadata[p]=S[p]},a=S=>{Ch(f.current);const p=De(o.current.nextTree);let v;try{rc=!0,v=S(p)}finally{rc=!1}v!==p&&(o.current.nextTree=v,wv().early&&Tf(f.current,o.current,v),De(u.current)())},u=yE(null),c=pE(S=>{u.current=S},[u]),f=Eh(()=>n??{storeID:Sv(),getState:()=>o.current,replaceState:a,getGraph:s,subscribeToTransactions:i,addTransactionMetadata:l});n!=null&&(f.current=n),o=Eh(()=>e!=null?_E(f.current,e):t!=null?RE(t):gv());const h=mE(()=>ja==null?void 0:ja(o,()=>o.current.currentTree.version),[o]);return nc(()=>{const S=f.current;for(const p of new Set(S.getState().knownAtoms))lE(S,p,"get");return()=>{for(const p of S.getState().knownAtoms)sE(S,p)}},[f]),re.createElement(Cv.Provider,{value:f},re.createElement(xv.Provider,{value:h},re.createElement(wE,{setNotifyBatcherOfChange:c}),r))}function CE(e){const{override:t,...n}=e,r=Gl();return t===!1&&r.current!==Ev?e.children:re.createElement(EE,n)}function xE(){return Gl().current.storeID}var wn={RecoilRoot:CE,useStoreRef:Gl,useRecoilMutableSource:gE,useRecoilStoreID:xE,notifyComponents_FOR_TESTING:Tf,sendEndOfBatchNotifications_FOR_TESTING:Tv};function TE(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0,r=e.length;n{t.current=e}),t.current}var kv=LE;const{useStoreRef:PE}=wn,{SUSPENSE_TIMEOUT_MS:OE}=_r,{updateRetainCount:Lo}=_r,{RetentionZone:bE}=Bl,{useEffect:FE,useRef:DE}=re,{isSSR:Th}=Wl;function ME(e){if(xe("recoil_memory_managament_2020"))return UE(e)}function UE(e){const n=(Array.isArray(e)?e:[e]).map(i=>i instanceof bE?i:i.key),r=PE();FE(()=>{if(!xe("recoil_memory_managament_2020"))return;const i=r.current;if(o.current&&!Th)window.clearTimeout(o.current),o.current=null;else for(const l of n)Lo(i,l,1);return()=>{for(const l of n)Lo(i,l,-1)}},[r,...n]);const o=DE(),s=kv(n);if(!Th&&(s===void 0||!kE(s,n))){const i=r.current;for(const l of n)Lo(i,l,1);if(s)for(const l of s)Lo(i,l,-1);o.current&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{o.current=null;for(const l of n)Lo(i,l,-1)},OE)}}var kf=ME;function IE(){return""}var Ps=IE;const{batchUpdates:VE}=Hl,{DEFAULT_VALUE:Nv}=wt,{currentRendererSupportsUseSyncExternalStore:$E,reactMode:po,useMutableSource:jE,useSyncExternalStore:BE}=Ns,{useRecoilMutableSource:zE,useStoreRef:on}=wn,{AbstractRecoilValue:oc,getRecoilValueAsLoadable:Os,setRecoilValue:sl,setUnvalidatedRecoilValue:HE,subscribeToRecoilValue:ro}=rn,{useCallback:gt,useEffect:oo,useMemo:Av,useRef:ts,useState:Nf}=re,{setByAddingToSet:WE}=Yy,{isSSR:QE}=Wl;function Af(e,t,n){if(e.state==="hasValue")return e.contents;throw e.state==="loading"?new Promise(o=>{const s=n.current.getState().suspendedComponentResolvers;s.add(o),QE&&Pe(e.contents)&&e.contents.finally(()=>{s.delete(o)})}):e.state==="hasError"?e.contents:de(`Invalid value of loadable atom "${t.key}"`)}function qE(){const e=Ps(),t=on(),[,n]=Nf([]),r=ts(new Set);r.current=new Set;const o=ts(new Set),s=ts(new Map),i=gt(a=>{const u=s.current.get(a);u&&(u.release(),s.current.delete(a))},[s]),l=gt((a,u)=>{s.current.has(u)&&n([])},[]);return oo(()=>{const a=t.current;Zo(r.current,o.current).forEach(u=>{if(s.current.has(u))return;const c=ro(a,new oc(u),h=>l(h,u),e);s.current.set(u,c),a.getState().nextTree?a.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{l(a.getState(),u)}):l(a.getState(),u)}),Zo(o.current,r.current).forEach(u=>{i(u)}),o.current=r.current}),oo(()=>{const a=s.current;return Zo(r.current,new Set(a.keys())).forEach(u=>{const c=ro(t.current,new oc(u),f=>l(f,u),e);a.set(u,c)}),()=>a.forEach((u,c)=>i(c))},[e,t,i,l]),Av(()=>{function a(p){return v=>{sl(t.current,p,v)}}function u(p){return()=>sl(t.current,p,Nv)}function c(p){var v;r.current.has(p.key)||(r.current=WE(r.current,p.key));const x=t.current.getState();return Os(t.current,p,po().early&&(v=x.nextTree)!==null&&v!==void 0?v:x.currentTree)}function f(p){const v=c(p);return Af(v,p,t)}function h(p){return[f(p),a(p)]}function S(p){return[c(p),a(p)]}return{getRecoilValue:f,getRecoilValueLoadable:c,getRecoilState:h,getRecoilStateLoadable:S,getSetRecoilState:a,getResetRecoilState:u}},[r,t])}const KE={current:0};function GE(e){const t=on(),n=Ps(),r=gt(()=>{var l;const a=t.current,u=a.getState(),c=po().early&&(l=u.nextTree)!==null&&l!==void 0?l:u.currentTree;return{loadable:Os(a,e,c),key:e.key}},[t,e]),o=gt(l=>{let a;return()=>{var u,c;const f=l();return(u=a)!==null&&u!==void 0&&u.loadable.is(f.loadable)&&((c=a)===null||c===void 0?void 0:c.key)===f.key?a:(a=f,f)}},[]),s=Av(()=>o(r),[r,o]),i=gt(l=>{const a=t.current;return ro(a,e,l,n).release},[t,e,n]);return BE(i,s,s).loadable}function YE(e){const t=on(),n=gt(()=>{var u;const c=t.current,f=c.getState(),h=po().early&&(u=f.nextTree)!==null&&u!==void 0?u:f.currentTree;return Os(c,e,h)},[t,e]),r=gt(()=>n(),[n]),o=Ps(),s=gt((u,c)=>{const f=t.current;return ro(f,e,()=>{if(!xe("recoil_suppress_rerender_in_callback"))return c();const S=n();a.current.is(S)||c(),a.current=S},o).release},[t,e,o,n]),i=zE();if(i==null)throw de("Recoil hooks must be used in components contained within a component.");const l=jE(i,r,s),a=ts(l);return oo(()=>{a.current=l}),l}function sc(e){const t=on(),n=Ps(),r=gt(()=>{var a;const u=t.current,c=u.getState(),f=po().early&&(a=c.nextTree)!==null&&a!==void 0?a:c.currentTree;return Os(u,e,f)},[t,e]),o=gt(()=>({loadable:r(),key:e.key}),[r,e.key]),s=gt(a=>{const u=o();return a.loadable.is(u.loadable)&&a.key===u.key?a:u},[o]);oo(()=>{const a=ro(t.current,e,u=>{l(s)},n);return l(s),a.release},[n,e,t,s]);const[i,l]=Nf(o);return i.key!==e.key?o().loadable:i.loadable}function XE(e){const t=on(),[,n]=Nf([]),r=Ps(),o=gt(()=>{var l;const a=t.current,u=a.getState(),c=po().early&&(l=u.nextTree)!==null&&l!==void 0?l:u.currentTree;return Os(a,e,c)},[t,e]),s=o(),i=ts(s);return oo(()=>{i.current=s}),oo(()=>{const l=t.current,a=l.getState(),u=ro(l,e,f=>{var h;if(!xe("recoil_suppress_rerender_in_callback"))return n([]);const S=o();(h=i.current)!==null&&h!==void 0&&h.is(S)||n(S),i.current=S},r);if(a.nextTree)l.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{i.current=null,n([])});else{var c;if(!xe("recoil_suppress_rerender_in_callback"))return n([]);const f=o();(c=i.current)!==null&&c!==void 0&&c.is(f)||n(f),i.current=f}return u.release},[r,o,e,t]),s}function Lf(e){return xe("recoil_memory_managament_2020")&&kf(e),{TRANSITION_SUPPORT:sc,SYNC_EXTERNAL_STORE:$E()?GE:sc,MUTABLE_SOURCE:YE,LEGACY:XE}[po().mode](e)}function Lv(e){const t=on(),n=Lf(e);return Af(n,e,t)}function Yl(e){const t=on();return gt(n=>{sl(t.current,e,n)},[t,e])}function JE(e){const t=on();return gt(()=>{sl(t.current,e,Nv)},[t,e])}function ZE(e){return[Lv(e),Yl(e)]}function eC(e){return[Lf(e),Yl(e)]}function tC(){const e=on();return(t,n={})=>{VE(()=>{e.current.addTransactionMetadata(n),t.forEach((r,o)=>HE(e.current,new oc(o),r))})}}function Pv(e){return xe("recoil_memory_managament_2020")&&kf(e),sc(e)}function Ov(e){const t=on(),n=Pv(e);return Af(n,e,t)}function nC(e){return[Ov(e),Yl(e)]}var rC={recoilComponentGetRecoilValueCount_FOR_TESTING:KE,useRecoilInterface:qE,useRecoilState:ZE,useRecoilStateLoadable:eC,useRecoilValue:Lv,useRecoilValueLoadable:Lf,useResetRecoilState:JE,useSetRecoilState:Yl,useSetUnvalidatedAtomValues:tC,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:Pv,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:Ov,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:nC};function oC(e,t){const n=new Map;for(const[r,o]of e)t(o,r)&&n.set(r,o);return n}var sC=oC;function iC(e,t){const n=new Set;for(const r of e)t(r)&&n.add(r);return n}var lC=iC;function aC(...e){const t=new Map;for(let n=0;nt.current.subscribeToTransactions(e).release,[e,t])}function Ah(e){const t=e.atomValues.toMap(),n=ol(sC(t,(r,o)=>{const i=bv(o).persistence_UNSTABLE;return i!=null&&i.type!=="none"&&r.state==="hasValue"}),r=>r.contents);return uC(e.nonvalidatedAtoms.toMap(),n)}function vC(e){Jl(Xl(t=>{let n=t.getState().previousTree;const r=t.getState().currentTree;n||(n=t.getState().currentTree);const o=Ah(r),s=Ah(n),i=ol(dC,a=>{var u,c,f,h;return{persistence_UNSTABLE:{type:(u=(c=a.persistence_UNSTABLE)===null||c===void 0?void 0:c.type)!==null&&u!==void 0?u:"none",backButton:(f=(h=a.persistence_UNSTABLE)===null||h===void 0?void 0:h.backButton)!==null&&f!==void 0?f:!1}}}),l=lC(r.dirtyAtoms,a=>o.has(a)||s.has(a));e({atomValues:o,previousAtomValues:s,atomInfo:i,modifiedAtoms:l,transactionMetadata:{...r.transactionMetadata}})},[e]))}function gC(e){Jl(Xl(t=>{const n=il(t,"latest"),r=il(t,"previous");e({snapshot:n,previousSnapshot:r})},[e]))}function SC(){const e=Pf(),[t,n]=yC(()=>il(e.current)),r=kv(t),o=kh(),s=kh();if(Jl(Xl(l=>n(il(l)),[])),Fv(()=>{const l=t.retain();if(o.current&&!Nh){var a;window.clearTimeout(o.current),o.current=null,(a=s.current)===null||a===void 0||a.call(s),s.current=null}return()=>{window.setTimeout(l,10)}},[t]),r!==t&&!Nh){if(o.current){var i;window.clearTimeout(o.current),o.current=null,(i=s.current)===null||i===void 0||i.call(s),s.current=null}s.current=t.retain(),o.current=window.setTimeout(()=>{var l;o.current=null,(l=s.current)===null||l===void 0||l.call(s),s.current=null},mC)}return t}function Dv(e,t){var n;const r=e.getState(),o=(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree,s=t.getStore_INTERNAL().getState().currentTree;cC(()=>{const i=new Set;for(const u of[o.atomValues.keys(),s.atomValues.keys()])for(const c of u){var l,a;((l=o.atomValues.get(c))===null||l===void 0?void 0:l.contents)!==((a=s.atomValues.get(c))===null||a===void 0?void 0:a.contents)&&bv(c).shouldRestoreFromSnapshots&&i.add(c)}i.forEach(u=>{pC(e,new hC(u),s.atomValues.has(u)?De(s.atomValues.get(u)):fC)}),e.replaceState(u=>({...u,stateID:t.getID()}))})}function wC(){const e=Pf();return Xl(t=>Dv(e.current,t),[e])}var Mv={useRecoilSnapshot:SC,gotoSnapshot:Dv,useGotoRecoilSnapshot:wC,useRecoilTransactionObserver:gC,useTransactionObservation_DEPRECATED:vC,useTransactionSubscription_DEPRECATED:Jl};const{peekNodeInfo:_C}=Gn,{useStoreRef:RC}=wn;function EC(){const e=RC();return({key:t})=>_C(e.current,e.current.getState().currentTree,t)}var CC=EC;const{reactMode:xC}=Ns,{RecoilRoot:TC,useStoreRef:kC}=wn,{useMemo:NC}=re;function AC(){xC().mode==="MUTABLE_SOURCE"&&console.warn("Warning: There are known issues using useRecoilBridgeAcrossReactRoots() in recoil_mutable_source rendering mode. Please consider upgrading to recoil_sync_external_store mode.");const e=kC().current;return NC(()=>{function t({children:n}){return re.createElement(TC,{store_INTERNAL:e},n)}return t},[e])}var LC=AC;const{loadableWithValue:PC}=ks,{initializeNode:OC}=Gn,{DEFAULT_VALUE:bC,getNode:FC}=wt,{copyTreeState:DC,getRecoilValueAsLoadable:MC,invalidateDownstreams:UC,writeLoadableToTreeState:IC}=rn;function Lh(e){return FC(e.key).nodeType==="atom"}class VC{constructor(t,n){fe(this,"_store",void 0),fe(this,"_treeState",void 0),fe(this,"_changes",void 0),fe(this,"get",r=>{if(this._changes.has(r.key))return this._changes.get(r.key);if(!Lh(r))throw de("Reading selectors within atomicUpdate is not supported");const o=MC(this._store,r,this._treeState);if(o.state==="hasValue")return o.contents;throw o.state==="hasError"?o.contents:de(`Expected Recoil atom ${r.key} to have a value, but it is in a loading state.`)}),fe(this,"set",(r,o)=>{if(!Lh(r))throw de("Setting selectors within atomicUpdate is not supported");if(typeof o=="function"){const s=this.get(r);this._changes.set(r.key,o(s))}else OC(this._store,r.key,"set"),this._changes.set(r.key,o)}),fe(this,"reset",r=>{this.set(r,bC)}),this._store=t,this._treeState=n,this._changes=new Map}newTreeState_INTERNAL(){if(this._changes.size===0)return this._treeState;const t=DC(this._treeState);for(const[n,r]of this._changes)IC(t,n,PC(r));return UC(this._store,t),t}}function $C(e){return t=>{e.replaceState(n=>{const r=new VC(e,n);return t(r),r.newTreeState_INTERNAL()})}}var jC={atomicUpdater:$C},BC=jC.atomicUpdater,Uv=Object.freeze({__proto__:null,atomicUpdater:BC});function zC(e,t){if(!e)throw new Error(t)}var HC=zC,Bo=HC;const{atomicUpdater:WC}=Uv,{batchUpdates:QC}=Hl,{DEFAULT_VALUE:qC}=wt,{useStoreRef:KC}=wn,{refreshRecoilValue:GC,setRecoilValue:Ph}=rn,{cloneSnapshot:YC}=Kl,{gotoSnapshot:XC}=Mv,{useCallback:JC}=re;class Iv{}const ZC=new Iv;function Vv(e,t,n,r){let o=ZC,s;if(QC(()=>{const l="useRecoilCallback() expects a function that returns a function: it accepts a function of the type (RecoilInterface) => (Args) => ReturnType and returns a callback function (Args) => ReturnType, where RecoilInterface is an object {snapshot, set, ...} and Args and ReturnType are the argument and return types of the callback you want to create. Please see the docs at recoiljs.org for details.";if(typeof t!="function")throw de(l);const a=Xy({...r??{},set:(c,f)=>Ph(e,c,f),reset:c=>Ph(e,c,qC),refresh:c=>GC(e,c),gotoSnapshot:c=>XC(e,c),transact_UNSTABLE:c=>WC(e)(c)},{snapshot:()=>{const c=YC(e);return s=c.retain(),c}}),u=t(a);if(typeof u!="function")throw de(l);o=u(...n)}),o instanceof Iv&&Bo(!1),Pe(o))o=o.finally(()=>{var l;(l=s)===null||l===void 0||l()});else{var i;(i=s)===null||i===void 0||i()}return o}function ex(e,t){const n=KC();return JC((...r)=>Vv(n.current,e,r),t!=null?[...t,n]:void 0)}var $v={recoilCallback:Vv,useRecoilCallback:ex};const{useStoreRef:tx}=wn,{refreshRecoilValue:nx}=rn,{useCallback:rx}=re;function ox(e){const t=tx();return rx(()=>{const n=t.current;nx(n,e)},[e,t])}var sx=ox;const{atomicUpdater:ix}=Uv,{useStoreRef:lx}=wn,{useMemo:ax}=re;function ux(e,t){const n=lx();return ax(()=>(...r)=>{ix(n.current)(s=>{e(s)(...r)})},t!=null?[...t,n]:void 0)}var cx=ux;class fx{constructor(t){fe(this,"value",void 0),this.value=t}}var dx={WrappedValue:fx},hx=dx.WrappedValue,jv=Object.freeze({__proto__:null,WrappedValue:hx});const{isFastRefreshEnabled:px}=Ns;class Oh extends Error{}class mx{constructor(t){var n,r,o;fe(this,"_name",void 0),fe(this,"_numLeafs",void 0),fe(this,"_root",void 0),fe(this,"_onHit",void 0),fe(this,"_onSet",void 0),fe(this,"_mapNodeValue",void 0),this._name=t==null?void 0:t.name,this._numLeafs=0,this._root=null,this._onHit=(n=t==null?void 0:t.onHit)!==null&&n!==void 0?n:()=>{},this._onSet=(r=t==null?void 0:t.onSet)!==null&&r!==void 0?r:()=>{},this._mapNodeValue=(o=t==null?void 0:t.mapNodeValue)!==null&&o!==void 0?o:s=>s}size(){return this._numLeafs}root(){return this._root}get(t,n){var r;return(r=this.getLeafNode(t,n))===null||r===void 0?void 0:r.value}getLeafNode(t,n){if(this._root==null)return;let r=this._root;for(;r;){if(n==null||n.onNodeVisit(r),r.type==="leaf")return this._onHit(r),r;const o=this._mapNodeValue(t(r.nodeKey));r=r.branches.get(o)}}set(t,n,r){const o=()=>{var s,i,l,a;let u,c;for(const[x,y]of t){var f,h,S;const d=this._root;if((d==null?void 0:d.type)==="leaf")throw this.invalidCacheError();const m=u;if(u=m?m.branches.get(c):d,u=(f=u)!==null&&f!==void 0?f:{type:"branch",nodeKey:x,parent:m,branches:new Map,branchKey:c},u.type!=="branch"||u.nodeKey!==x)throw this.invalidCacheError();m==null||m.branches.set(c,u),r==null||(h=r.onNodeVisit)===null||h===void 0||h.call(r,u),c=this._mapNodeValue(y),this._root=(S=this._root)!==null&&S!==void 0?S:u}const p=u?(s=u)===null||s===void 0?void 0:s.branches.get(c):this._root;if(p!=null&&(p.type!=="leaf"||p.branchKey!==c))throw this.invalidCacheError();const v={type:"leaf",value:n,parent:u,branchKey:c};(i=u)===null||i===void 0||i.branches.set(c,v),this._root=(l=this._root)!==null&&l!==void 0?l:v,this._numLeafs++,this._onSet(v),r==null||(a=r.onNodeVisit)===null||a===void 0||a.call(r,v)};try{o()}catch(s){if(s instanceof Oh)this.clear(),o();else throw s}}delete(t){const n=this.root();if(!n)return!1;if(t===n)return this._root=null,this._numLeafs=0,!0;let r=t.parent,o=t.branchKey;for(;r;){var s;if(r.branches.delete(o),r===n)return r.branches.size===0?(this._root=null,this._numLeafs=0):this._numLeafs--,!0;if(r.branches.size>0)break;o=(s=r)===null||s===void 0?void 0:s.branchKey,r=r.parent}for(;r!==n;r=r.parent)if(r==null)return!1;return this._numLeafs--,!0}clear(){this._numLeafs=0,this._root=null}invalidCacheError(){const t=px()?"Possible Fast Refresh module reload detected. This may also be caused by an selector returning inconsistent values. Resetting cache.":"Invalid cache values. This happens when selectors do not return consistent values for the same input dependency values. That may also be caused when using Fast Refresh to change a selector implementation. Resetting cache.";throw vf(t+(this._name!=null?` - ${this._name}`:"")),new Oh}}var yx={TreeCache:mx},vx=yx.TreeCache,Bv=Object.freeze({__proto__:null,TreeCache:vx});class gx{constructor(t){var n;fe(this,"_maxSize",void 0),fe(this,"_size",void 0),fe(this,"_head",void 0),fe(this,"_tail",void 0),fe(this,"_map",void 0),fe(this,"_keyMapper",void 0),this._maxSize=t.maxSize,this._size=0,this._head=null,this._tail=null,this._map=new Map,this._keyMapper=(n=t.mapKey)!==null&&n!==void 0?n:r=>r}head(){return this._head}tail(){return this._tail}size(){return this._size}maxSize(){return this._maxSize}has(t){return this._map.has(this._keyMapper(t))}get(t){const n=this._keyMapper(t),r=this._map.get(n);if(r)return this.set(t,r.value),r.value}set(t,n){const r=this._keyMapper(t);this._map.get(r)&&this.delete(t);const s=this.head(),i={key:t,right:s,left:null,value:n};s?s.left=i:this._tail=i,this._map.set(r,i),this._head=i,this._size++,this._maybeDeleteLRU()}_maybeDeleteLRU(){this.size()>this.maxSize()&&this.deleteLru()}deleteLru(){const t=this.tail();t&&this.delete(t.key)}delete(t){const n=this._keyMapper(t);if(!this._size||!this._map.has(n))return;const r=De(this._map.get(n)),o=r.right,s=r.left;o&&(o.left=r.left),s&&(s.right=r.right),r===this.head()&&(this._head=o),r===this.tail()&&(this._tail=s),this._map.delete(n),this._size--}clear(){this._size=0,this._head=null,this._tail=null,this._map=new Map}}var Sx={LRUCache:gx},wx=Sx.LRUCache,zv=Object.freeze({__proto__:null,LRUCache:wx});const{LRUCache:_x}=zv,{TreeCache:Rx}=Bv;function Ex({name:e,maxSize:t,mapNodeValue:n=r=>r}){const r=new _x({maxSize:t}),o=new Rx({name:e,mapNodeValue:n,onHit:s=>{r.set(s,!0)},onSet:s=>{const i=r.tail();r.set(s,!0),i&&o.size()>t&&o.delete(i.key)}});return o}var bh=Ex;function $t(e,t,n){if(typeof e=="string"&&!e.includes('"')&&!e.includes("\\"))return`"${e}"`;switch(typeof e){case"undefined":return"";case"boolean":return e?"true":"false";case"number":case"symbol":return String(e);case"string":return JSON.stringify(e);case"function":if((t==null?void 0:t.allowFunctions)!==!0)throw de("Attempt to serialize function in a Recoil cache key");return`__FUNCTION(${e.name})__`}if(e===null)return"null";if(typeof e!="object"){var r;return(r=JSON.stringify(e))!==null&&r!==void 0?r:""}if(Pe(e))return"__PROMISE__";if(Array.isArray(e))return`[${e.map((o,s)=>$t(o,t,s.toString()))}]`;if(typeof e.toJSON=="function")return $t(e.toJSON(n),t,n);if(e instanceof Map){const o={};for(const[s,i]of e)o[typeof s=="string"?s:$t(s,t)]=i;return $t(o,t,n)}return e instanceof Set?$t(Array.from(e).sort((o,s)=>$t(o,t).localeCompare($t(s,t))),t,n):Symbol!==void 0&&e[Symbol.iterator]!=null&&typeof e[Symbol.iterator]=="function"?$t(Array.from(e),t,n):`{${Object.keys(e).filter(o=>e[o]!==void 0).sort().map(o=>`${$t(o,t)}:${$t(e[o],t,o)}`).join(",")}}`}function Cx(e,t={allowFunctions:!1}){return $t(e,t)}var Zl=Cx;const{TreeCache:xx}=Bv,ii={equality:"reference",eviction:"keep-all",maxSize:1/0};function Tx({equality:e=ii.equality,eviction:t=ii.eviction,maxSize:n=ii.maxSize}=ii,r){const o=kx(e);return Nx(t,n,o,r)}function kx(e){switch(e){case"reference":return t=>t;case"value":return t=>Zl(t)}throw de(`Unrecognized equality policy ${e}`)}function Nx(e,t,n,r){switch(e){case"keep-all":return new xx({name:r,mapNodeValue:n});case"lru":return bh({name:r,maxSize:De(t),mapNodeValue:n});case"most-recent":return bh({name:r,maxSize:1,mapNodeValue:n})}throw de(`Unrecognized eviction policy ${e}`)}var Ax=Tx;function Lx(e){return()=>null}var Px={startPerfBlock:Lx};const{isLoadable:Ox,loadableWithError:li,loadableWithPromise:bx,loadableWithValue:Ba}=ks,{WrappedValue:Hv}=jv,{getNodeLoadable:ai,peekNodeLoadable:Fx,setNodeValue:Dx}=Gn,{saveDepsToStore:Mx}=As,{DEFAULT_VALUE:Ux,getConfigDeletionHandler:Ix,getNode:Vx,registerNode:Fh}=wt,{isRecoilValue:$x}=no,{markRecoilValueModified:Dh}=rn,{retainedByOptionWithDefault:jx}=_r,{recoilCallback:Bx}=$v,{startPerfBlock:zx}=Px;class Wv{}const Po=new Wv,Oo=[],ui=new Map,Hx=(()=>{let e=0;return()=>e++})();function Qv(e){let t=null;const{key:n,get:r,cachePolicy_UNSTABLE:o}=e,s=e.set!=null?e.set:void 0,i=new Set,l=Ax(o??{equality:"reference",eviction:"keep-all"},n),a=jx(e.retainedBy_UNSTABLE),u=new Map;let c=0;function f(){return!xe("recoil_memory_managament_2020")||c>0}function h(C){return C.getState().knownSelectors.add(n),c++,()=>{c--}}function S(){return Ix(n)!==void 0&&!f()}function p(C,b,F,J,j){ge(b,J,j),v(C,F)}function v(C,b){le(C,b)&&z(C),y(b,!0)}function x(C,b){le(C,b)&&(De(Y(C)).stateVersions.clear(),y(b,!1))}function y(C,b){const F=ui.get(C);if(F!=null){for(const J of F)Dh(J,De(t));b&&ui.delete(C)}}function d(C,b){let F=ui.get(b);F==null&&ui.set(b,F=new Set),F.add(C)}function m(C,b,F,J,j,oe){return b.then(ne=>{if(!f())throw z(C),Po;const ee=Ba(ne);return p(C,F,j,ee,J),ne}).catch(ne=>{if(!f())throw z(C),Po;if(Pe(ne))return R(C,ne,F,J,j,oe);const ee=li(ne);throw p(C,F,j,ee,J),ne})}function R(C,b,F,J,j,oe){return b.then(ne=>{if(!f())throw z(C),Po;oe.loadingDepKey!=null&&oe.loadingDepPromise===b?F.atomValues.set(oe.loadingDepKey,Ba(ne)):C.getState().knownSelectors.forEach(Se=>{F.atomValues.delete(Se)});const ee=N(C,F);if(ee&&ee.state!=="loading"){if((le(C,j)||Y(C)==null)&&v(C,j),ee.state==="hasValue")return ee.contents;throw ee.contents}if(!le(C,j)){const Se=Z(C,F);if(Se!=null)return Se.loadingLoadable.contents}const[_e,ze]=A(C,F,j);if(_e.state!=="loading"&&p(C,F,j,_e,ze),_e.state==="hasError")throw _e.contents;return _e.contents}).catch(ne=>{if(ne instanceof Wv)throw Po;if(!f())throw z(C),Po;const ee=li(ne);throw p(C,F,j,ee,J),ne})}function k(C,b,F,J){var j,oe,ne,ee;if(le(C,J)||b.version===((j=C.getState())===null||j===void 0||(oe=j.currentTree)===null||oe===void 0?void 0:oe.version)||b.version===((ne=C.getState())===null||ne===void 0||(ee=ne.nextTree)===null||ee===void 0?void 0:ee.version)){var _e,ze,Se;Mx(n,F,C,(_e=(ze=C.getState())===null||ze===void 0||(Se=ze.nextTree)===null||Se===void 0?void 0:Se.version)!==null&&_e!==void 0?_e:C.getState().currentTree.version)}for(const Ce of F)i.add(Ce)}function A(C,b,F){const J=zx(n);let j=!0,oe=!0;const ne=()=>{J(),oe=!1};let ee,_e=!1,ze;const Se={loadingDepKey:null,loadingDepPromise:null},Ce=new Map;function _t({key:nt}){const g=ai(C,b,nt);switch(Ce.set(nt,g),j||(k(C,b,new Set(Ce.keys()),F),x(C,F)),g.state){case"hasValue":return g.contents;case"hasError":throw g.contents;case"loading":throw Se.loadingDepKey=nt,Se.loadingDepPromise=g.contents,g.contents}throw de("Invalid Loadable state")}const Gt=nt=>(...g)=>{if(oe)throw de("Callbacks from getCallback() should only be called asynchronously after the selector is evalutated. It can be used for selectors to return objects with callbacks that can work with Recoil state without a subscription.");return t==null&&Bo(!1),Bx(C,nt,g,{node:t})};try{ee=r({get:_t,getCallback:Gt}),ee=$x(ee)?_t(ee):ee,Ox(ee)&&(ee.state==="hasError"&&(_e=!0),ee=ee.contents),Pe(ee)?ee=m(C,ee,b,Ce,F,Se).finally(ne):ne(),ee=ee instanceof Hv?ee.value:ee}catch(nt){ee=nt,Pe(ee)?ee=R(C,ee,b,Ce,F,Se).finally(ne):(_e=!0,ne())}return _e?ze=li(ee):Pe(ee)?ze=bx(ee):ze=Ba(ee),j=!1,ue(C,F,Ce),k(C,b,new Set(Ce.keys()),F),[ze,Ce]}function N(C,b){let F=b.atomValues.get(n);if(F!=null)return F;const J=new Set;try{F=l.get(oe=>(typeof oe!="string"&&Bo(!1),ai(C,b,oe).contents),{onNodeVisit:oe=>{oe.type==="branch"&&oe.nodeKey!==n&&J.add(oe.nodeKey)}})}catch(oe){throw de(`Problem with cache lookup for selector "${n}": ${oe.message}`)}if(F){var j;b.atomValues.set(n,F),k(C,b,J,(j=Y(C))===null||j===void 0?void 0:j.executionID)}return F}function O(C,b){const F=N(C,b);if(F!=null)return z(C),F;const J=Z(C,b);if(J!=null){var j;return((j=J.loadingLoadable)===null||j===void 0?void 0:j.state)==="loading"&&d(C,J.executionID),J.loadingLoadable}const oe=Hx(),[ne,ee]=A(C,b,oe);return ne.state==="loading"?(me(C,oe,ne,ee,b),d(C,oe)):(z(C),ge(b,ne,ee)),ne}function Z(C,b){const F=pv([u.has(C)?[De(u.get(C))]:[],$l(Rf(u,([j])=>j!==C),([,j])=>j)]);function J(j){for(const[oe,ne]of j)if(!ai(C,b,oe).is(ne))return!0;return!1}for(const j of F){if(j.stateVersions.get(b.version)||!J(j.depValuesDiscoveredSoFarDuringAsyncWork))return j.stateVersions.set(b.version,!0),j;j.stateVersions.set(b.version,!1)}}function Y(C){return u.get(C)}function me(C,b,F,J,j){u.set(C,{depValuesDiscoveredSoFarDuringAsyncWork:J,executionID:b,loadingLoadable:F,stateVersions:new Map([[j.version,!0]])})}function ue(C,b,F){if(le(C,b)){const J=Y(C);J!=null&&(J.depValuesDiscoveredSoFarDuringAsyncWork=F)}}function z(C){u.delete(C)}function le(C,b){var F;return b===((F=Y(C))===null||F===void 0?void 0:F.executionID)}function Ee(C){return Array.from(C.entries()).map(([b,F])=>[b,F.contents])}function ge(C,b,F){C.atomValues.set(n,b);try{l.set(Ee(F),b)}catch(J){throw de(`Problem with setting cache for selector "${n}": ${J.message}`)}}function we(C){if(Oo.includes(n)){const b=`Recoil selector has circular dependencies: ${Oo.slice(Oo.indexOf(n)).join(" → ")}`;return li(de(b))}Oo.push(n);try{return C()}finally{Oo.pop()}}function V(C,b){const F=b.atomValues.get(n);return F??l.get(J=>{var j;return typeof J!="string"&&Bo(!1),(j=Fx(C,b,J))===null||j===void 0?void 0:j.contents})}function $(C,b){return we(()=>O(C,b))}function H(C){C.atomValues.delete(n)}function ce(C,b){t==null&&Bo(!1);for(const J of i){var F;const j=Vx(J);(F=j.clearCache)===null||F===void 0||F.call(j,C,b)}i.clear(),H(b),l.clear(),Dh(C,t)}return s!=null?t=Fh({key:n,nodeType:"selector",peek:V,get:$,set:(b,F,J)=>{let j=!1;const oe=new Map;function ne({key:Se}){if(j)throw de("Recoil: Async selector sets are not currently supported.");const Ce=ai(b,F,Se);if(Ce.state==="hasValue")return Ce.contents;if(Ce.state==="loading"){const _t=`Getting value of asynchronous atom or selector "${Se}" in a pending state while setting selector "${n}" is not yet supported.`;throw de(_t)}else throw Ce.contents}function ee(Se,Ce){if(j)throw de("Recoil: Async selector sets are not currently supported.");const _t=typeof Ce=="function"?Ce(ne(Se)):Ce;Dx(b,F,Se.key,_t).forEach((nt,g)=>oe.set(g,nt))}function _e(Se){ee(Se,Ux)}const ze=s({set:ee,get:ne,reset:_e},J);if(ze!==void 0)throw Pe(ze)?de("Recoil: Async selector sets are not currently supported."):de("Recoil: selector set should be a void function.");return j=!0,oe},init:h,invalidate:H,clearCache:ce,shouldDeleteConfigOnRelease:S,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:a}):t=Fh({key:n,nodeType:"selector",peek:V,get:$,init:h,invalidate:H,clearCache:ce,shouldDeleteConfigOnRelease:S,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:a})}Qv.value=e=>new Hv(e);var so=Qv;const{isLoadable:Wx,loadableWithError:za,loadableWithPromise:Ha,loadableWithValue:Cr}=ks,{WrappedValue:qv}=jv,{peekNodeInfo:Qx}=Gn,{DEFAULT_VALUE:rr,DefaultValue:Tn,getConfigDeletionHandler:Kv,registerNode:qx,setConfigDeletionHandler:Kx}=wt,{isRecoilValue:Gx}=no,{getRecoilValueAsLoadable:Yx,markRecoilValueModified:Xx,setRecoilValue:Mh,setRecoilValueLoadable:Jx}=rn,{retainedByOptionWithDefault:Zx}=_r,bo=e=>e instanceof qv?e.value:e;function eT(e){const{key:t,persistence_UNSTABLE:n}=e,r=Zx(e.retainedBy_UNSTABLE);let o=0;function s(d){return Ha(d.then(m=>(i=Cr(m),m)).catch(m=>{throw i=za(m),m}))}let i=Pe(e.default)?s(e.default):Wx(e.default)?e.default.state==="loading"?s(e.default.contents):e.default:Cr(bo(e.default));i.contents;let l;const a=new Map;function u(d){return d}function c(d,m){const R=m.then(k=>{var A,N;return((N=((A=d.getState().nextTree)!==null&&A!==void 0?A:d.getState().currentTree).atomValues.get(t))===null||N===void 0?void 0:N.contents)===R&&Mh(d,y,k),k}).catch(k=>{var A,N;throw((N=((A=d.getState().nextTree)!==null&&A!==void 0?A:d.getState().currentTree).atomValues.get(t))===null||N===void 0?void 0:N.contents)===R&&Jx(d,y,za(k)),k});return R}function f(d,m,R){var k;o++;const A=()=>{var z;o--,(z=a.get(d))===null||z===void 0||z.forEach(le=>le()),a.delete(d)};if(d.getState().knownAtoms.add(t),i.state==="loading"){const z=()=>{var le;((le=d.getState().nextTree)!==null&&le!==void 0?le:d.getState().currentTree).atomValues.has(t)||Xx(d,y)};i.contents.finally(z)}const N=(k=e.effects)!==null&&k!==void 0?k:e.effects_UNSTABLE;if(N!=null){let we=function(b){if(le&&b.key===t){const F=z;return F instanceof Tn?h(d,m):Pe(F)?Ha(F.then(J=>J instanceof Tn?i.toPromise():J)):Cr(F)}return Yx(d,b)},V=function(b){return we(b).toPromise()},$=function(b){var F;const J=Qx(d,(F=d.getState().nextTree)!==null&&F!==void 0?F:d.getState().currentTree,b.key);return le&&b.key===t&&!(z instanceof Tn)?{...J,isSet:!0,loadable:we(b)}:J};var Y=we,me=V,ue=$;let z=rr,le=!0,Ee=!1,ge=null;const H=b=>F=>{if(le){const J=we(y),j=J.state==="hasValue"?J.contents:rr;z=typeof F=="function"?F(j):F,Pe(z)&&(z=z.then(oe=>(ge={effect:b,value:oe},oe)))}else{if(Pe(F))throw de("Setting atoms to async values is not implemented.");typeof F!="function"&&(ge={effect:b,value:bo(F)}),Mh(d,y,typeof F=="function"?J=>{const j=bo(F(J));return ge={effect:b,value:j},j}:bo(F))}},ce=b=>()=>H(b)(rr),C=b=>F=>{var J;const{release:j}=d.subscribeToTransactions(oe=>{var ne;let{currentTree:ee,previousTree:_e}=oe.getState();_e||(_e=ee);const ze=(ne=ee.atomValues.get(t))!==null&&ne!==void 0?ne:i;if(ze.state==="hasValue"){var Se,Ce,_t,Gt;const nt=ze.contents,g=(Se=_e.atomValues.get(t))!==null&&Se!==void 0?Se:i,T=g.state==="hasValue"?g.contents:rr;((Ce=ge)===null||Ce===void 0?void 0:Ce.effect)!==b||((_t=ge)===null||_t===void 0?void 0:_t.value)!==nt?F(nt,T,!ee.atomValues.has(t)):((Gt=ge)===null||Gt===void 0?void 0:Gt.effect)===b&&(ge=null)}},t);a.set(d,[...(J=a.get(d))!==null&&J!==void 0?J:[],j])};for(const b of N)try{const F=b({node:y,storeID:d.storeID,parentStoreID_UNSTABLE:d.parentStoreID,trigger:R,setSelf:H(b),resetSelf:ce(b),onSet:C(b),getPromise:V,getLoadable:we,getInfo_UNSTABLE:$});if(F!=null){var O;a.set(d,[...(O=a.get(d))!==null&&O!==void 0?O:[],F])}}catch(F){z=F,Ee=!0}if(le=!1,!(z instanceof Tn)){var Z;const b=Ee?za(z):Pe(z)?Ha(c(d,z)):Cr(bo(z));b.contents,m.atomValues.set(t,b),(Z=d.getState().nextTree)===null||Z===void 0||Z.atomValues.set(t,b)}}return A}function h(d,m){var R,k;return(R=(k=m.atomValues.get(t))!==null&&k!==void 0?k:l)!==null&&R!==void 0?R:i}function S(d,m){if(m.atomValues.has(t))return De(m.atomValues.get(t));if(m.nonvalidatedAtoms.has(t)){if(l!=null)return l;if(n==null)return i;const R=m.nonvalidatedAtoms.get(t),k=n.validator(R,rr);return l=k instanceof Tn?i:Cr(k),l}else return i}function p(){l=void 0}function v(d,m,R){if(m.atomValues.has(t)){const k=De(m.atomValues.get(t));if(k.state==="hasValue"&&R===k.contents)return new Map}else if(!m.nonvalidatedAtoms.has(t)&&R instanceof Tn)return new Map;return l=void 0,new Map().set(t,Cr(R))}function x(){return Kv(t)!==void 0&&o<=0}const y=qx({key:t,nodeType:"atom",peek:h,get:S,set:v,init:f,invalidate:p,shouldDeleteConfigOnRelease:x,dangerouslyAllowMutability:e.dangerouslyAllowMutability,persistence_UNSTABLE:e.persistence_UNSTABLE?{type:e.persistence_UNSTABLE.type,backButton:e.persistence_UNSTABLE.backButton}:void 0,shouldRestoreFromSnapshots:!0,retainedBy:r});return y}function Of(e){const{...t}=e,n="default"in e?e.default:new Promise(()=>{});return Gx(n)?tT({...t,default:n}):eT({...t,default:n})}function tT(e){const t=Of({...e,default:rr,persistence_UNSTABLE:e.persistence_UNSTABLE===void 0?void 0:{...e.persistence_UNSTABLE,validator:r=>r instanceof Tn?r:De(e.persistence_UNSTABLE).validator(r,rr)},effects:e.effects,effects_UNSTABLE:e.effects_UNSTABLE}),n=so({key:`${e.key}__withFallback`,get:({get:r})=>{const o=r(t);return o instanceof Tn?e.default:o},set:({set:r},o)=>r(t,o),cachePolicy_UNSTABLE:{eviction:"most-recent"},dangerouslyAllowMutability:e.dangerouslyAllowMutability});return Kx(n.key,Kv(e.key)),n}Of.value=e=>new qv(e);var Gv=Of;class nT{constructor(t){var n;fe(this,"_map",void 0),fe(this,"_keyMapper",void 0),this._map=new Map,this._keyMapper=(n=t==null?void 0:t.mapKey)!==null&&n!==void 0?n:r=>r}size(){return this._map.size}has(t){return this._map.has(this._keyMapper(t))}get(t){return this._map.get(this._keyMapper(t))}set(t,n){this._map.set(this._keyMapper(t),n)}delete(t){this._map.delete(this._keyMapper(t))}clear(){this._map.clear()}}var rT={MapCache:nT},oT=rT.MapCache,sT=Object.freeze({__proto__:null,MapCache:oT});const{LRUCache:Uh}=zv,{MapCache:iT}=sT,ci={equality:"reference",eviction:"none",maxSize:1/0};function lT({equality:e=ci.equality,eviction:t=ci.eviction,maxSize:n=ci.maxSize}=ci){const r=aT(e);return uT(t,n,r)}function aT(e){switch(e){case"reference":return t=>t;case"value":return t=>Zl(t)}throw de(`Unrecognized equality policy ${e}`)}function uT(e,t,n){switch(e){case"keep-all":return new iT({mapKey:n});case"lru":return new Uh({mapKey:n,maxSize:De(t)});case"most-recent":return new Uh({mapKey:n,maxSize:1})}throw de(`Unrecognized eviction policy ${e}`)}var Yv=lT;const{setConfigDeletionHandler:cT}=wt;function fT(e){var t,n;const r=Yv({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return o=>{var s,i;const l=r.get(o);if(l!=null)return l;const{cachePolicyForParams_UNSTABLE:a,...u}=e,c="default"in e?e.default:new Promise(()=>{}),f=Gv({...u,key:`${e.key}__${(s=Zl(o))!==null&&s!==void 0?s:"void"}`,default:typeof c=="function"?c(o):c,retainedBy_UNSTABLE:typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(o):e.retainedBy_UNSTABLE,effects:typeof e.effects=="function"?e.effects(o):typeof e.effects_UNSTABLE=="function"?e.effects_UNSTABLE(o):(i=e.effects)!==null&&i!==void 0?i:e.effects_UNSTABLE});return r.set(o,f),cT(f.key,()=>{r.delete(o)}),f}}var dT=fT;const{setConfigDeletionHandler:hT}=wt;let pT=0;function mT(e){var t,n;const r=Yv({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return o=>{var s;let i;try{i=r.get(o)}catch(h){throw de(`Problem with cache lookup for selector ${e.key}: ${h.message}`)}if(i!=null)return i;const l=`${e.key}__selectorFamily/${(s=Zl(o,{allowFunctions:!0}))!==null&&s!==void 0?s:"void"}/${pT++}`,a=h=>e.get(o)(h),u=e.cachePolicy_UNSTABLE,c=typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(o):e.retainedBy_UNSTABLE;let f;if(e.set!=null){const h=e.set;f=so({key:l,get:a,set:(p,v)=>h(o)(p,v),cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c})}else f=so({key:l,get:a,cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c});return r.set(o,f),hT(f.key,()=>{r.delete(o)}),f}}var Yn=mT;const yT=Yn({key:"__constant",get:e=>()=>e,cachePolicyForParams_UNSTABLE:{equality:"reference"}});function vT(e){return yT(e)}var gT=vT;const ST=Yn({key:"__error",get:e=>()=>{throw de(e)},cachePolicyForParams_UNSTABLE:{equality:"reference"}});function wT(e){return ST(e)}var _T=wT;function RT(e){return e}var ET=RT;const{loadableWithError:Xv,loadableWithPromise:Jv,loadableWithValue:Zv}=ks;function ea(e,t){const n=Array(t.length).fill(void 0),r=Array(t.length).fill(void 0);for(const[o,s]of t.entries())try{n[o]=e(s)}catch(i){r[o]=i}return[n,r]}function CT(e){return e!=null&&!Pe(e)}function ta(e){return Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(t=>e[t])}function ic(e,t){return Array.isArray(e)?t:Object.getOwnPropertyNames(e).reduce((n,r,o)=>({...n,[r]:t[o]}),{})}function qr(e,t,n){const r=n.map((o,s)=>o==null?Zv(t[s]):Pe(o)?Jv(o):Xv(o));return ic(e,r)}function xT(e,t){return t.map((n,r)=>n===void 0?e[r]:n)}const TT=Yn({key:"__waitForNone",get:e=>({get:t})=>{const n=ta(e),[r,o]=ea(t,n);return qr(e,r,o)},dangerouslyAllowMutability:!0}),kT=Yn({key:"__waitForAny",get:e=>({get:t})=>{const n=ta(e),[r,o]=ea(t,n);return o.some(s=>!Pe(s))?qr(e,r,o):new Promise(s=>{for(const[i,l]of o.entries())Pe(l)&&l.then(a=>{r[i]=a,o[i]=void 0,s(qr(e,r,o))}).catch(a=>{o[i]=a,s(qr(e,r,o))})})},dangerouslyAllowMutability:!0}),NT=Yn({key:"__waitForAll",get:e=>({get:t})=>{const n=ta(e),[r,o]=ea(t,n);if(o.every(i=>i==null))return ic(e,r);const s=o.find(CT);if(s!=null)throw s;return Promise.all(o).then(i=>ic(e,xT(r,i)))},dangerouslyAllowMutability:!0}),AT=Yn({key:"__waitForAllSettled",get:e=>({get:t})=>{const n=ta(e),[r,o]=ea(t,n);return o.every(s=>!Pe(s))?qr(e,r,o):Promise.all(o.map((s,i)=>Pe(s)?s.then(l=>{r[i]=l,o[i]=void 0}).catch(l=>{r[i]=void 0,o[i]=l}):null)).then(()=>qr(e,r,o))},dangerouslyAllowMutability:!0}),LT=Yn({key:"__noWait",get:e=>({get:t})=>{try{return so.value(Zv(t(e)))}catch(n){return so.value(Pe(n)?Jv(n):Xv(n))}},dangerouslyAllowMutability:!0});var PT={waitForNone:TT,waitForAny:kT,waitForAll:NT,waitForAllSettled:AT,noWait:LT};const{RecoilLoadable:OT}=ks,{DefaultValue:bT}=wt,{RecoilRoot:FT,useRecoilStoreID:DT}=wn,{isRecoilValue:MT}=no,{retentionZone:UT}=Bl,{freshSnapshot:IT}=Kl,{useRecoilState:VT,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:$T,useRecoilStateLoadable:jT,useRecoilValue:BT,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:zT,useRecoilValueLoadable:HT,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:WT,useResetRecoilState:QT,useSetRecoilState:qT}=rC,{useGotoRecoilSnapshot:KT,useRecoilSnapshot:GT,useRecoilTransactionObserver:YT}=Mv,{useRecoilCallback:XT}=$v,{noWait:JT,waitForAll:ZT,waitForAllSettled:ek,waitForAny:tk,waitForNone:nk}=PT;var bf={DefaultValue:bT,isRecoilValue:MT,RecoilLoadable:OT,RecoilEnv:ho,RecoilRoot:FT,useRecoilStoreID:DT,useRecoilBridgeAcrossReactRoots_UNSTABLE:LC,atom:Gv,selector:so,atomFamily:dT,selectorFamily:Yn,constSelector:gT,errorSelector:_T,readOnlySelector:ET,noWait:JT,waitForNone:nk,waitForAny:tk,waitForAll:ZT,waitForAllSettled:ek,useRecoilValue:BT,useRecoilValueLoadable:HT,useRecoilState:VT,useRecoilStateLoadable:jT,useSetRecoilState:qT,useResetRecoilState:QT,useGetRecoilValueInfo_UNSTABLE:CC,useRecoilRefresher_UNSTABLE:sx,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:WT,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:zT,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:$T,useRecoilCallback:XT,useRecoilTransaction_UNSTABLE:cx,useGotoRecoilSnapshot:KT,useRecoilSnapshot:GT,useRecoilTransactionObserver_UNSTABLE:YT,snapshot_UNSTABLE:IT,useRetain:kf,retentionZone:UT},rk=bf.RecoilRoot,Ff=bf.atom,Wn=bf.useRecoilState;class mo{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){const n={listener:t};return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const Ss=typeof window>"u"||"Deno"in window;function At(){}function ok(e,t){return typeof e=="function"?e(t):e}function lc(e){return typeof e=="number"&&e>=0&&e!==1/0}function eg(e,t){return Math.max(e+(t||0)-Date.now(),0)}function zo(e,t,n){return bs(e)?typeof t=="function"?{...n,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function sk(e,t,n){return bs(e)?typeof t=="function"?{...n,mutationKey:e,mutationFn:t}:{...t,mutationKey:e}:typeof e=="function"?{...t,mutationFn:e}:{...e}}function kn(e,t,n){return bs(e)?[{...t,queryKey:e},n]:[e||{},t]}function Ih(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:l}=e;if(bs(i)){if(r){if(t.queryHash!==Df(i,t.options))return!1}else if(!ll(t.queryKey,i))return!1}if(n!=="all"){const a=t.isActive();if(n==="active"&&!a||n==="inactive"&&a)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||typeof o<"u"&&o!==t.state.fetchStatus||s&&!s(t))}function Vh(e,t){const{exact:n,fetching:r,predicate:o,mutationKey:s}=e;if(bs(s)){if(!t.options.mutationKey)return!1;if(n){if(lr(t.options.mutationKey)!==lr(s))return!1}else if(!ll(t.options.mutationKey,s))return!1}return!(typeof r=="boolean"&&t.state.status==="loading"!==r||o&&!o(t))}function Df(e,t){return((t==null?void 0:t.queryKeyHashFn)||lr)(e)}function lr(e){return JSON.stringify(e,(t,n)=>ac(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function ll(e,t){return tg(e,t)}function tg(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!tg(e[n],t[n])):!1}function ng(e,t){if(e===t)return e;const n=$h(e)&&$h(t);if(n||ac(e)&&ac(t)){const r=n?e.length:Object.keys(e).length,o=n?t:Object.keys(t),s=o.length,i=n?[]:{};let l=0;for(let a=0;a"u")return!0;const n=t.prototype;return!(!jh(n)||!n.hasOwnProperty("isPrototypeOf"))}function jh(e){return Object.prototype.toString.call(e)==="[object Object]"}function bs(e){return Array.isArray(e)}function rg(e){return new Promise(t=>{setTimeout(t,e)})}function Bh(e){rg(0).then(e)}function ik(){if(typeof AbortController=="function")return new AbortController}function uc(e,t,n){return n.isDataEqual!=null&&n.isDataEqual(e,t)?e:typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?ng(e,t):t}class lk extends mo{constructor(){super(),this.setup=t=>{if(!Ss&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),window.addEventListener("focus",n,!1),()=>{window.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(t){this.focused!==t&&(this.focused=t,this.onFocus())}onFocus(){this.listeners.forEach(({listener:t})=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const ul=new lk,zh=["online","offline"];class ak extends mo{constructor(){super(),this.setup=t=>{if(!Ss&&window.addEventListener){const n=()=>t();return zh.forEach(r=>{window.addEventListener(r,n,!1)}),()=>{zh.forEach(r=>{window.removeEventListener(r,n)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setOnline(r):this.onOnline()})}setOnline(t){this.online!==t&&(this.online=t,this.onOnline())}onOnline(){this.listeners.forEach(({listener:t})=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const cl=new ak;function uk(e){return Math.min(1e3*2**e,3e4)}function na(e){return(e??"online")==="online"?cl.isOnline():!0}class og{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function Ci(e){return e instanceof og}function sg(e){let t=!1,n=0,r=!1,o,s,i;const l=new Promise((x,y)=>{s=x,i=y}),a=x=>{r||(S(new og(x)),e.abort==null||e.abort())},u=()=>{t=!0},c=()=>{t=!1},f=()=>!ul.isFocused()||e.networkMode!=="always"&&!cl.isOnline(),h=x=>{r||(r=!0,e.onSuccess==null||e.onSuccess(x),o==null||o(),s(x))},S=x=>{r||(r=!0,e.onError==null||e.onError(x),o==null||o(),i(x))},p=()=>new Promise(x=>{o=y=>{const d=r||!f();return d&&x(y),d},e.onPause==null||e.onPause()}).then(()=>{o=void 0,r||e.onContinue==null||e.onContinue()}),v=()=>{if(r)return;let x;try{x=e.fn()}catch(y){x=Promise.reject(y)}Promise.resolve(x).then(h).catch(y=>{var d,m;if(r)return;const R=(d=e.retry)!=null?d:3,k=(m=e.retryDelay)!=null?m:uk,A=typeof k=="function"?k(n,y):k,N=R===!0||typeof R=="number"&&n{if(f())return p()}).then(()=>{t?S(y):v()})})};return na(e.networkMode)?v():p().then(v),{promise:l,cancel:a,continue:()=>(o==null?void 0:o())?l:Promise.resolve(),cancelRetry:u,continueRetry:c}}const Mf=console;function ck(){let e=[],t=0,n=c=>{c()},r=c=>{c()};const o=c=>{let f;t++;try{f=c()}finally{t--,t||l()}return f},s=c=>{t?e.push(c):Bh(()=>{n(c)})},i=c=>(...f)=>{s(()=>{c(...f)})},l=()=>{const c=e;e=[],c.length&&Bh(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:o,batchCalls:i,schedule:s,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c}}}const $e=ck();class ig{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),lc(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t??(Ss?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class fk extends ig{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||Mf,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||dk(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,n){const r=uc(this.state.data,t,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){this.dispatch({type:"setState",state:t,setStateOptions:n})}cancel(t){var n;const r=this.promise;return(n=this.retryer)==null||n.cancel(t),r?r.then(At).catch(At):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!eg(this.state.dataUpdatedAt,t)}onFocus(){var t;const n=this.observers.find(r=>r.shouldFetchOnWindowFocus());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}onOnline(){var t;const n=this.observers.find(r=>r.shouldFetchOnReconnect());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,n){var r,o;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&n!=null&&n.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var s;return(s=this.retryer)==null||s.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(p=>p.options.queryFn);S&&this.setOptions(S.options)}const i=ik(),l={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},a=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>{if(i)return this.abortSignalConsumed=!0,i.signal}})};a(l);const u=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(l)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),c={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:u};if(a(c),(r=this.options.behavior)==null||r.onFetch(c),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((o=c.fetchOptions)==null?void 0:o.meta)){var f;this.dispatch({type:"fetch",meta:(f=c.fetchOptions)==null?void 0:f.meta})}const h=S=>{if(Ci(S)&&S.silent||this.dispatch({type:"error",error:S}),!Ci(S)){var p,v,x,y;(p=(v=this.cache.config).onError)==null||p.call(v,S,this),(x=(y=this.cache.config).onSettled)==null||x.call(y,this.state.data,S,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=sg({fn:c.fetchFn,abort:i==null?void 0:i.abort.bind(i),onSuccess:S=>{var p,v,x,y;if(typeof S>"u"){h(new Error(this.queryHash+" data is undefined"));return}this.setData(S),(p=(v=this.cache.config).onSuccess)==null||p.call(v,S,this),(x=(y=this.cache.config).onSettled)==null||x.call(y,S,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:h,onFail:(S,p)=>{this.dispatch({type:"failed",failureCount:S,error:p})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const n=r=>{var o,s;switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(o=t.meta)!=null?o:null,fetchStatus:na(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(s=t.dataUpdatedAt)!=null?s:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return Ci(i)&&i.revert&&this.revertState?{...this.revertState,fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),$e.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function dk(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"loading",fetchStatus:"idle"}}class hk extends mo{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,n,r){var o;const s=n.queryKey,i=(o=n.queryHash)!=null?o:Df(s,n);let l=this.get(i);return l||(l=new fk({cache:this,logger:t.getLogger(),queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(l)),l}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){const n=this.queriesMap[t.queryHash];n&&(t.destroy(),this.queries=this.queries.filter(r=>r!==t),n===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){$e.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,n){const[r]=kn(t,n);return typeof r.exact>"u"&&(r.exact=!0),this.queries.find(o=>Ih(r,o))}findAll(t,n){const[r]=kn(t,n);return Object.keys(r).length>0?this.queries.filter(o=>Ih(r,o)):this.queries}notify(t){$e.batch(()=>{this.listeners.forEach(({listener:n})=>{n(t)})})}onFocus(){$e.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){$e.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class pk extends ig{constructor(t){super(),this.defaultOptions=t.defaultOptions,this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||Mf,this.observers=[],this.state=t.state||lg(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(n=>n!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var t,n;return(t=(n=this.retryer)==null?void 0:n.continue())!=null?t:this.execute()}async execute(){const t=()=>{var N;return this.retryer=sg({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(O,Z)=>{this.dispatch({type:"failed",failureCount:O,error:Z})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(N=this.options.retry)!=null?N:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},n=this.state.status==="loading";try{var r,o,s,i,l,a,u,c;if(!n){var f,h,S,p;this.dispatch({type:"loading",variables:this.options.variables}),await((f=(h=this.mutationCache.config).onMutate)==null?void 0:f.call(h,this.state.variables,this));const O=await((S=(p=this.options).onMutate)==null?void 0:S.call(p,this.state.variables));O!==this.state.context&&this.dispatch({type:"loading",context:O,variables:this.state.variables})}const N=await t();return await((r=(o=this.mutationCache.config).onSuccess)==null?void 0:r.call(o,N,this.state.variables,this.state.context,this)),await((s=(i=this.options).onSuccess)==null?void 0:s.call(i,N,this.state.variables,this.state.context)),await((l=(a=this.mutationCache.config).onSettled)==null?void 0:l.call(a,N,null,this.state.variables,this.state.context,this)),await((u=(c=this.options).onSettled)==null?void 0:u.call(c,N,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:N}),N}catch(N){try{var v,x,y,d,m,R,k,A;throw await((v=(x=this.mutationCache.config).onError)==null?void 0:v.call(x,N,this.state.variables,this.state.context,this)),await((y=(d=this.options).onError)==null?void 0:y.call(d,N,this.state.variables,this.state.context)),await((m=(R=this.mutationCache.config).onSettled)==null?void 0:m.call(R,void 0,N,this.state.variables,this.state.context,this)),await((k=(A=this.options).onSettled)==null?void 0:k.call(A,void 0,N,this.state.variables,this.state.context)),N}finally{this.dispatch({type:"error",error:N})}}}dispatch(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"loading":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!na(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...r,...t.state}}};this.state=n(this.state),$e.batch(()=>{this.observers.forEach(r=>{r.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function lg(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class mk extends mo{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,n,r){const o=new pk({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(n),state:r,defaultOptions:n.mutationKey?t.getMutationDefaults(n.mutationKey):void 0});return this.add(o),o}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(n=>n!==t),this.notify({type:"removed",mutation:t})}clear(){$e.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return typeof t.exact>"u"&&(t.exact=!0),this.mutations.find(n=>Vh(t,n))}findAll(t){return this.mutations.filter(n=>Vh(t,n))}notify(t){$e.batch(()=>{this.listeners.forEach(({listener:n})=>{n(t)})})}resumePausedMutations(){var t;return this.resuming=((t=this.resuming)!=null?t:Promise.resolve()).then(()=>{const n=this.mutations.filter(r=>r.state.isPaused);return $e.batch(()=>n.reduce((r,o)=>r.then(()=>o.continue().catch(At)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function yk(){return{onFetch:e=>{e.fetchFn=()=>{var t,n,r,o,s,i;const l=(t=e.fetchOptions)==null||(n=t.meta)==null?void 0:n.refetchPage,a=(r=e.fetchOptions)==null||(o=r.meta)==null?void 0:o.fetchMore,u=a==null?void 0:a.pageParam,c=(a==null?void 0:a.direction)==="forward",f=(a==null?void 0:a.direction)==="backward",h=((s=e.state.data)==null?void 0:s.pages)||[],S=((i=e.state.data)==null?void 0:i.pageParams)||[];let p=S,v=!1;const x=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>{var N;if((N=e.signal)!=null&&N.aborted)v=!0;else{var O;(O=e.signal)==null||O.addEventListener("abort",()=>{v=!0})}return e.signal}})},y=e.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+e.options.queryHash+"'")),d=(A,N,O,Z)=>(p=Z?[N,...p]:[...p,N],Z?[O,...A]:[...A,O]),m=(A,N,O,Z)=>{if(v)return Promise.reject("Cancelled");if(typeof O>"u"&&!N&&A.length)return Promise.resolve(A);const Y={queryKey:e.queryKey,pageParam:O,meta:e.options.meta};x(Y);const me=y(Y);return Promise.resolve(me).then(z=>d(A,O,z,Z))};let R;if(!h.length)R=m([]);else if(c){const A=typeof u<"u",N=A?u:Hh(e.options,h);R=m(h,A,N)}else if(f){const A=typeof u<"u",N=A?u:vk(e.options,h);R=m(h,A,N,!0)}else{p=[];const A=typeof e.options.getNextPageParam>"u";R=(l&&h[0]?l(h[0],0,h):!0)?m([],A,S[0]):Promise.resolve(d([],S[0],h[0]));for(let O=1;O{if(l&&h[O]?l(h[O],O,h):!0){const me=A?S[O]:Hh(e.options,Z);return m(Z,A,me)}return Promise.resolve(d(Z,S[O],h[O]))})}return R.then(A=>({pages:A,pageParams:p}))}}}}function Hh(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function vk(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class gk{constructor(t={}){this.queryCache=t.queryCache||new hk,this.mutationCache=t.mutationCache||new mk,this.logger=t.logger||Mf,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=ul.subscribe(()=>{ul.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=cl.subscribe(()=>{cl.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,n;this.mountCount--,this.mountCount===0&&((t=this.unsubscribeFocus)==null||t.call(this),this.unsubscribeFocus=void 0,(n=this.unsubscribeOnline)==null||n.call(this),this.unsubscribeOnline=void 0)}isFetching(t,n){const[r]=kn(t,n);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state.data}ensureQueryData(t,n,r){const o=zo(t,n,r),s=this.getQueryData(o.queryKey);return s?Promise.resolve(s):this.fetchQuery(o)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:n,state:r})=>{const o=r.data;return[n,o]})}setQueryData(t,n,r){const o=this.queryCache.find(t),s=o==null?void 0:o.state.data,i=ok(n,s);if(typeof i>"u")return;const l=zo(t),a=this.defaultQueryOptions(l);return this.queryCache.build(this,a).setData(i,{...r,manual:!0})}setQueriesData(t,n,r){return $e.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:o})=>[o,this.setQueryData(o,n,r)]))}getQueryState(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state}removeQueries(t,n){const[r]=kn(t,n),o=this.queryCache;$e.batch(()=>{o.findAll(r).forEach(s=>{o.remove(s)})})}resetQueries(t,n,r){const[o,s]=kn(t,n,r),i=this.queryCache,l={type:"active",...o};return $e.batch(()=>(i.findAll(o).forEach(a=>{a.reset()}),this.refetchQueries(l,s)))}cancelQueries(t,n,r){const[o,s={}]=kn(t,n,r);typeof s.revert>"u"&&(s.revert=!0);const i=$e.batch(()=>this.queryCache.findAll(o).map(l=>l.cancel(s)));return Promise.all(i).then(At).catch(At)}invalidateQueries(t,n,r){const[o,s]=kn(t,n,r);return $e.batch(()=>{var i,l;if(this.queryCache.findAll(o).forEach(u=>{u.invalidate()}),o.refetchType==="none")return Promise.resolve();const a={...o,type:(i=(l=o.refetchType)!=null?l:o.type)!=null?i:"active"};return this.refetchQueries(a,s)})}refetchQueries(t,n,r){const[o,s]=kn(t,n,r),i=$e.batch(()=>this.queryCache.findAll(o).filter(a=>!a.isDisabled()).map(a=>{var u;return a.fetch(void 0,{...s,cancelRefetch:(u=s==null?void 0:s.cancelRefetch)!=null?u:!0,meta:{refetchPage:o.refetchPage}})}));let l=Promise.all(i).then(At);return s!=null&&s.throwOnError||(l=l.catch(At)),l}fetchQuery(t,n,r){const o=zo(t,n,r),s=this.defaultQueryOptions(o);typeof s.retry>"u"&&(s.retry=!1);const i=this.queryCache.build(this,s);return i.isStaleByTime(s.staleTime)?i.fetch(s):Promise.resolve(i.state.data)}prefetchQuery(t,n,r){return this.fetchQuery(t,n,r).then(At).catch(At)}fetchInfiniteQuery(t,n,r){const o=zo(t,n,r);return o.behavior=yk(),this.fetchQuery(o)}prefetchInfiniteQuery(t,n,r){return this.fetchInfiniteQuery(t,n,r).then(At).catch(At)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,n){const r=this.queryDefaults.find(o=>lr(t)===lr(o.queryKey));r?r.defaultOptions=n:this.queryDefaults.push({queryKey:t,defaultOptions:n})}getQueryDefaults(t){if(!t)return;const n=this.queryDefaults.find(r=>ll(t,r.queryKey));return n==null?void 0:n.defaultOptions}setMutationDefaults(t,n){const r=this.mutationDefaults.find(o=>lr(t)===lr(o.mutationKey));r?r.defaultOptions=n:this.mutationDefaults.push({mutationKey:t,defaultOptions:n})}getMutationDefaults(t){if(!t)return;const n=this.mutationDefaults.find(r=>ll(t,r.mutationKey));return n==null?void 0:n.defaultOptions}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const n={...this.defaultOptions.queries,...this.getQueryDefaults(t==null?void 0:t.queryKey),...t,_defaulted:!0};return!n.queryHash&&n.queryKey&&(n.queryHash=Df(n.queryKey,n)),typeof n.refetchOnReconnect>"u"&&(n.refetchOnReconnect=n.networkMode!=="always"),typeof n.useErrorBoundary>"u"&&(n.useErrorBoundary=!!n.suspense),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(t==null?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class Sk extends mo{constructor(t,n){super(),this.client=t,this.options=n,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(n)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),Wh(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return cc(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return cc(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,n){const r=this.options,o=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),al(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();const s=this.hasListeners();s&&Qh(this.currentQuery,o,this.options,r)&&this.executeFetch(),this.updateResult(n),s&&(this.currentQuery!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const i=this.computeRefetchInterval();s&&(this.currentQuery!==o||this.options.enabled!==r.enabled||i!==this.currentRefetchInterval)&&this.updateRefetchInterval(i)}getOptimisticResult(t){const n=this.client.getQueryCache().build(this.client,t),r=this.createResult(n,t);return _k(this,r,t)&&(this.currentResult=r,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),r}getCurrentResult(){return this.currentResult}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),t[r])})}),n}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...n}={}){return this.fetch({...n,meta:{refetchPage:t}})}fetchOptimistic(t){const n=this.client.defaultQueryOptions(t),r=this.client.getQueryCache().build(this.client,n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){var n;return this.executeFetch({...t,cancelRefetch:(n=t.cancelRefetch)!=null?n:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let n=this.currentQuery.fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(At)),n}updateStaleTimeout(){if(this.clearStaleTimeout(),Ss||this.currentResult.isStale||!lc(this.options.staleTime))return;const n=eg(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},n)}computeRefetchInterval(){var t;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(t=this.options.refetchInterval)!=null?t:!1}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!(Ss||this.options.enabled===!1||!lc(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||ul.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,n){const r=this.currentQuery,o=this.options,s=this.currentResult,i=this.currentResultState,l=this.currentResultOptions,a=t!==r,u=a?t.state:this.currentQueryInitialState,c=a?this.currentResult:this.previousQueryResult,{state:f}=t;let{dataUpdatedAt:h,error:S,errorUpdatedAt:p,fetchStatus:v,status:x}=f,y=!1,d=!1,m;if(n._optimisticResults){const O=this.hasListeners(),Z=!O&&Wh(t,n),Y=O&&Qh(t,r,n,o);(Z||Y)&&(v=na(t.options.networkMode)?"fetching":"paused",h||(x="loading")),n._optimisticResults==="isRestoring"&&(v="idle")}if(n.keepPreviousData&&!f.dataUpdatedAt&&c!=null&&c.isSuccess&&x!=="error")m=c.data,h=c.dataUpdatedAt,x=c.status,y=!0;else if(n.select&&typeof f.data<"u")if(s&&f.data===(i==null?void 0:i.data)&&n.select===this.selectFn)m=this.selectResult;else try{this.selectFn=n.select,m=n.select(f.data),m=uc(s==null?void 0:s.data,m,n),this.selectResult=m,this.selectError=null}catch(O){this.selectError=O}else m=f.data;if(typeof n.placeholderData<"u"&&typeof m>"u"&&x==="loading"){let O;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))O=s.data;else if(O=typeof n.placeholderData=="function"?n.placeholderData():n.placeholderData,n.select&&typeof O<"u")try{O=n.select(O),this.selectError=null}catch(Z){this.selectError=Z}typeof O<"u"&&(x="success",m=uc(s==null?void 0:s.data,O,n),d=!0)}this.selectError&&(S=this.selectError,m=this.selectResult,p=Date.now(),x="error");const R=v==="fetching",k=x==="loading",A=x==="error";return{status:x,fetchStatus:v,isLoading:k,isSuccess:x==="success",isError:A,isInitialLoading:k&&R,data:m,dataUpdatedAt:h,error:S,errorUpdatedAt:p,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:R,isRefetching:R&&!k,isLoadingError:A&&f.dataUpdatedAt===0,isPaused:v==="paused",isPlaceholderData:d,isPreviousData:y,isRefetchError:A&&f.dataUpdatedAt!==0,isStale:Uf(t,n),refetch:this.refetch,remove:this.remove}}updateResult(t){const n=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,al(r,n))return;this.currentResult=r;const o={cache:!0},s=()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,l=typeof i=="function"?i():i;if(l==="all"||!l&&!this.trackedProps.size)return!0;const a=new Set(l??this.trackedProps);return this.options.useErrorBoundary&&a.add("error"),Object.keys(this.currentResult).some(u=>{const c=u;return this.currentResult[c]!==n[c]&&a.has(c)})};(t==null?void 0:t.listeners)!==!1&&s()&&(o.listeners=!0),this.notify({...o,...t})}updateQuery(){const t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;const n=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){const n={};t.type==="success"?n.onSuccess=!t.manual:t.type==="error"&&!Ci(t.error)&&(n.onError=!0),this.updateResult(n),this.hasListeners()&&this.updateTimers()}notify(t){$e.batch(()=>{if(t.onSuccess){var n,r,o,s;(n=(r=this.options).onSuccess)==null||n.call(r,this.currentResult.data),(o=(s=this.options).onSettled)==null||o.call(s,this.currentResult.data,null)}else if(t.onError){var i,l,a,u;(i=(l=this.options).onError)==null||i.call(l,this.currentResult.error),(a=(u=this.options).onSettled)==null||a.call(u,void 0,this.currentResult.error)}t.listeners&&this.listeners.forEach(({listener:c})=>{c(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function wk(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Wh(e,t){return wk(e,t)||e.state.dataUpdatedAt>0&&cc(e,t,t.refetchOnMount)}function cc(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Uf(e,t)}return!1}function Qh(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Uf(e,n)}function Uf(e,t){return e.isStaleByTime(t.staleTime)}function _k(e,t,n){return n.keepPreviousData?!1:n.placeholderData!==void 0?t.isPlaceholderData:!al(e.getCurrentResult(),t)}let Rk=class extends mo{constructor(t,n){super(),this.client=t,this.setOptions(n),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var n;const r=this.options;this.options=this.client.defaultMutationOptions(t),al(r,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),(n=this.currentMutation)==null||n.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.currentMutation)==null||t.removeObserver(this)}}onMutationUpdate(t){this.updateResult();const n={listeners:!0};t.type==="success"?n.onSuccess=!0:t.type==="error"&&(n.onError=!0),this.notify(n)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(t,n){return this.mutateOptions=n,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:typeof t<"u"?t:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){const t=this.currentMutation?this.currentMutation.state:lg(),n={...t,isLoading:t.status==="loading",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset};this.currentResult=n}notify(t){$e.batch(()=>{if(this.mutateOptions&&this.hasListeners()){if(t.onSuccess){var n,r,o,s;(n=(r=this.mutateOptions).onSuccess)==null||n.call(r,this.currentResult.data,this.currentResult.variables,this.currentResult.context),(o=(s=this.mutateOptions).onSettled)==null||o.call(s,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)}else if(t.onError){var i,l,a,u;(i=(l=this.mutateOptions).onError)==null||i.call(l,this.currentResult.error,this.currentResult.variables,this.currentResult.context),(a=(u=this.mutateOptions).onSettled)==null||a.call(u,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}}t.listeners&&this.listeners.forEach(({listener:c})=>{c(this.currentResult)})})}};var ag={exports:{}},ug={};/** + hot module replacement.`;console.warn(t)}}function Q_(e){ho.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED&&W_(e.key),vr.set(e.key,e);const t=e.set==null?new no.RecoilValueReadOnly(e.key):new no.RecoilState(e.key);return Sf.set(e.key,t),t}class Hy extends Error{}function q_(e){const t=vr.get(e);if(t==null)throw new Hy(`Missing definition for RecoilValue: "${e}""`);return t}function K_(e){return vr.get(e)}const rl=new Map;function G_(e){var t;if(!xe("recoil_memory_managament_2020"))return;const n=vr.get(e);if(n!=null&&(t=n.shouldDeleteConfigOnRelease)!==null&&t!==void 0&&t.call(n)){var r;vr.delete(e),(r=Wy(e))===null||r===void 0||r(),rl.delete(e)}}function Y_(e,t){xe("recoil_memory_managament_2020")&&(t===void 0?rl.delete(e):rl.set(e,t))}function Wy(e){return rl.get(e)}var wt={nodes:vr,recoilValues:Sf,registerNode:Q_,getNode:q_,getNodeMaybe:K_,deleteNodeConfigIfPossible:G_,setConfigDeletionHandler:Y_,getConfigDeletionHandler:Wy,recoilValuesForKeys:H_,NodeMissingError:Hy,DefaultValue:zy,DEFAULT_VALUE:z_};function J_(e,t){t()}var X_={enqueueExecution:J_};function Z_(e,t){return t={exports:{}},e(t,t.exports),t.exports}var e1=Z_(function(e){var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},n={},r=5,o=Math.pow(2,r),s=o-1,i=o/2,l=o/4,a={},u=function(w){return function(){return w}},c=n.hash=function(C){var w=typeof C>"u"?"undefined":t(C);if(w==="number")return C;w!=="string"&&(C+="");for(var D=0,W=0,Q=C.length;W>1&1431655765,w=(w&858993459)+(w>>2&858993459),w=w+(w>>4)&252645135,w+=w>>8,w+=w>>16,w&127},h=function(w,D){return D>>>w&s},S=function(w){return 1<=D;)Q[ae--]=Q[ae];return Q[D]=W,Q}for(var se=0,ie=0,he=new Array(G+1);se>>=1;return ae[D]=W,me(w,ie+1,ae)},le=function(w,D,W,Q){for(var G=new Array(D-1),ae=0,se=0,ie=0,he=Q.length;ie1?Z(w,this.hash,he):he[0]}var be=Q();return be===a?this:(++se.value,Ee(w,W,this.hash,this,G,O(w,G,ae,be)))},H=function(w,D,W,Q,G,ae,se){var ie=this.mask,he=this.children,be=h(W,G),dt=S(be),Ge=p(ie,dt),Nt=ie&dt,It=Nt?he[Ge]:A,Rr=It._modify(w,D,W+r,Q,G,ae,se);if(It===Rr)return this;var Bs=we(w,this),So=ie,wo=void 0;if(Nt&&N(Rr)){if(So&=~dt,!So)return A;if(he.length<=2&&ue(he[Ge^1]))return he[Ge^1];wo=x(Bs,Ge,he)}else if(!Nt&&!N(Rr)){if(he.length>=i)return z(w,be,Rr,ie,he);So|=dt,wo=y(Bs,Ge,Rr,he)}else wo=v(Bs,Ge,Rr,he);return Bs?(this.mask=So,this.children=wo,this):Y(w,So,wo)},ce=function(w,D,W,Q,G,ae,se){var ie=this.size,he=this.children,be=h(W,G),dt=he[be],Ge=(dt||A)._modify(w,D,W+r,Q,G,ae,se);if(dt===Ge)return this;var Nt=we(w,this),It=void 0;if(N(dt)&&!N(Ge))++ie,It=v(Nt,be,Ge,he);else if(!N(dt)&&N(Ge)){if(--ie,ie<=l)return le(w,ie,be,he);It=v(Nt,be,A,he)}else It=v(Nt,be,Ge,he);return Nt?(this.size=ie,this.children=It,this):me(w,ie,It)};A._modify=function(C,w,D,W,Q,G,ae){var se=W();return se===a?A:(++ae.value,O(C,Q,G,se))};function E(C,w,D,W,Q){this._editable=C,this._edit=w,this._config=D,this._root=W,this._size=Q}E.prototype.setTree=function(C,w){return this._editable?(this._root=C,this._size=w,this):C===this._root?this:new E(this._editable,this._edit,this._config,C,w)};var b=n.tryGetHash=function(C,w,D,W){for(var Q=W._root,G=0,ae=W._config.keyEq;;)switch(Q.type){case d:return ae(D,Q.key)?Q.value:C;case m:{if(w===Q.hash)for(var se=Q.children,ie=0,he=se.length;ie{n.set(o,t(r,o))}),n}var ol=i1;function l1(){return{nodeDeps:new Map,nodeToNodeSubscriptions:new Map}}function a1(e){return{nodeDeps:ol(e.nodeDeps,t=>new Set(t)),nodeToNodeSubscriptions:ol(e.nodeToNodeSubscriptions,t=>new Set(t))}}function $a(e,t,n,r){const{nodeDeps:o,nodeToNodeSubscriptions:s}=n,i=o.get(e);if(i&&r&&i!==r.nodeDeps.get(e))return;o.set(e,t);const l=i==null?t:Zo(t,i);for(const a of l)s.has(a)||s.set(a,new Set),De(s.get(a)).add(e);if(i){const a=Zo(i,t);for(const u of a){if(!s.has(u))return;const c=De(s.get(u));c.delete(e),c.size===0&&s.delete(u)}}}function u1(e,t,n,r){var o,s,i,l;const a=n.getState();r===a.currentTree.version||r===((o=a.nextTree)===null||o===void 0?void 0:o.version)||((s=a.previousTree)===null||s===void 0||s.version);const u=n.getGraph(r);if($a(e,t,u),r===((i=a.previousTree)===null||i===void 0?void 0:i.version)){const f=n.getGraph(a.currentTree.version);$a(e,t,f,u)}if(r===((l=a.previousTree)===null||l===void 0?void 0:l.version)||r===a.currentTree.version){var c;const f=(c=a.nextTree)===null||c===void 0?void 0:c.version;if(f!==void 0){const h=n.getGraph(f);$a(e,t,h,u)}}}var As={cloneGraph:a1,graph:l1,saveDepsToStore:u1};let c1=0;const f1=()=>c1++;let d1=0;const h1=()=>d1++;let p1=0;const m1=()=>p1++;var jl={getNextTreeStateVersion:f1,getNextStoreID:h1,getNextComponentID:m1};const{persistentMap:yh}=o1,{graph:y1}=As,{getNextTreeStateVersion:Qy}=jl;function qy(){const e=Qy();return{version:e,stateID:e,transactionMetadata:{},dirtyAtoms:new Set,atomValues:yh(),nonvalidatedAtoms:yh()}}function v1(){const e=qy();return{currentTree:e,nextTree:null,previousTree:null,commitDepth:0,knownAtoms:new Set,knownSelectors:new Set,transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(e.version,y1()),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}}var Ky={makeEmptyTreeState:qy,makeEmptyStoreState:v1,getNextTreeStateVersion:Qy};class Gy{}function g1(){return new Gy}var Bl={RetentionZone:Gy,retentionZone:g1};function S1(e,t){const n=new Set(e);return n.add(t),n}function w1(e,t){const n=new Set(e);return n.delete(t),n}function _1(e,t,n){const r=new Map(e);return r.set(t,n),r}function R1(e,t,n){const r=new Map(e);return r.set(t,n(r.get(t))),r}function E1(e,t){const n=new Map(e);return n.delete(t),n}function C1(e,t){const n=new Map(e);return t.forEach(r=>n.delete(r)),n}var Yy={setByAddingToSet:S1,setByDeletingFromSet:w1,mapBySettingInMap:_1,mapByUpdatingInMap:R1,mapByDeletingFromMap:E1,mapByDeletingMultipleFromMap:C1};function*x1(e,t){let n=0;for(const r of e)t(r,n++)&&(yield r)}var Rf=x1;function T1(e,t){return new Proxy(e,{get:(r,o)=>(!(o in r)&&o in t&&(r[o]=t[o]()),r[o]),ownKeys:r=>Object.keys(r)})}var Jy=T1;const{getNode:Ls,getNodeMaybe:k1,recoilValuesForKeys:vh}=wt,{RetentionZone:gh}=Bl,{setByAddingToSet:N1}=Yy,A1=Object.freeze(new Set);class L1 extends Error{}function P1(e,t,n){if(!xe("recoil_memory_managament_2020"))return()=>{};const{nodesRetainedByZone:r}=e.getState().retention;function o(s){let i=r.get(s);i||r.set(s,i=new Set),i.add(t)}if(n instanceof gh)o(n);else if(Array.isArray(n))for(const s of n)o(s);return()=>{if(!xe("recoil_memory_managament_2020"))return;const{retention:s}=e.getState();function i(l){const a=s.nodesRetainedByZone.get(l);a==null||a.delete(t),a&&a.size===0&&s.nodesRetainedByZone.delete(l)}if(n instanceof gh)i(n);else if(Array.isArray(n))for(const l of n)i(l)}}function Ef(e,t,n,r){const o=e.getState();if(o.nodeCleanupFunctions.has(n))return;const s=Ls(n),i=P1(e,n,s.retainedBy),l=s.init(e,t,r);o.nodeCleanupFunctions.set(n,()=>{l(),i()})}function O1(e,t,n){Ef(e,e.getState().currentTree,t,n)}function b1(e,t){var n;const r=e.getState();(n=r.nodeCleanupFunctions.get(t))===null||n===void 0||n(),r.nodeCleanupFunctions.delete(t)}function F1(e,t,n){return Ef(e,t,n,"get"),Ls(n).get(e,t)}function Xy(e,t,n){return Ls(n).peek(e,t)}function D1(e,t,n){var r;const o=k1(t);return o==null||(r=o.invalidate)===null||r===void 0||r.call(o,e),{...e,atomValues:e.atomValues.clone().delete(t),nonvalidatedAtoms:e.nonvalidatedAtoms.clone().set(t,n),dirtyAtoms:N1(e.dirtyAtoms,t)}}function M1(e,t,n,r){const o=Ls(n);if(o.set==null)throw new L1(`Attempt to set read-only RecoilValue: ${n}`);const s=o.set;return Ef(e,t,n,"set"),s(e,t,r)}function U1(e,t,n){const r=e.getState(),o=e.getGraph(t.version),s=Ls(n).nodeType;return Jy({type:s},{loadable:()=>Xy(e,t,n),isActive:()=>r.knownAtoms.has(n)||r.knownSelectors.has(n),isSet:()=>s==="selector"?!1:t.atomValues.has(n),isModified:()=>t.dirtyAtoms.has(n),deps:()=>{var i;return vh((i=o.nodeDeps.get(n))!==null&&i!==void 0?i:[])},subscribers:()=>{var i,l;return{nodes:vh(Rf(Zy(e,t,new Set([n])),a=>a!==n)),components:$l((i=(l=r.nodeToComponentSubscriptions.get(n))===null||l===void 0?void 0:l.values())!==null&&i!==void 0?i:[],([a])=>({name:a}))}}})}function Zy(e,t,n){const r=new Set,o=Array.from(n),s=e.getGraph(t.version);for(let l=o.pop();l;l=o.pop()){var i;r.add(l);const a=(i=s.nodeToNodeSubscriptions.get(l))!==null&&i!==void 0?i:A1;for(const u of a)r.has(u)||o.push(u)}return r}var Gn={getNodeLoadable:F1,peekNodeLoadable:Xy,setNodeValue:M1,initializeNode:O1,cleanUpNode:b1,setUnvalidatedAtomValue_DEPRECATED:D1,peekNodeInfo:U1,getDownstreamNodes:Zy};let ev=null;function I1(e){ev=e}function V1(){var e;(e=ev)===null||e===void 0||e()}var tv={setInvalidateMemoizedSnapshot:I1,invalidateMemoizedSnapshot:V1};const{getDownstreamNodes:$1,getNodeLoadable:nv,setNodeValue:j1}=Gn,{getNextComponentID:B1}=jl,{getNode:z1,getNodeMaybe:rv}=wt,{DefaultValue:Cf}=wt,{reactMode:H1}=Ns,{AbstractRecoilValue:W1,RecoilState:Q1,RecoilValueReadOnly:q1,isRecoilValue:K1}=no,{invalidateMemoizedSnapshot:G1}=tv;function Y1(e,{key:t},n=e.getState().currentTree){var r,o;const s=e.getState();n.version===s.currentTree.version||n.version===((r=s.nextTree)===null||r===void 0?void 0:r.version)||(n.version,(o=s.previousTree)===null||o===void 0||o.version);const i=nv(e,n,t);return i.state==="loading"&&i.contents.catch(()=>{}),i}function J1(e,t){const n=e.clone();return t.forEach((r,o)=>{r.state==="hasValue"&&r.contents instanceof Cf?n.delete(o):n.set(o,r)}),n}function X1(e,t,{key:n},r){if(typeof r=="function"){const o=nv(e,t,n);if(o.state==="loading"){const s=`Tried to set atom or selector "${n}" using an updater function while the current state is pending, this is not currently supported.`;throw de(s)}else if(o.state==="hasError")throw o.contents;return r(o.contents)}else return r}function Z1(e,t,n){if(n.type==="set"){const{recoilValue:o,valueOrUpdater:s}=n,i=X1(e,t,o,s),l=j1(e,t,o.key,i);for(const[a,u]of l.entries())Zu(t,a,u)}else if(n.type==="setLoadable"){const{recoilValue:{key:o},loadable:s}=n;Zu(t,o,s)}else if(n.type==="markModified"){const{recoilValue:{key:o}}=n;t.dirtyAtoms.add(o)}else if(n.type==="setUnvalidated"){var r;const{recoilValue:{key:o},unvalidatedValue:s}=n,i=rv(o);i==null||(r=i.invalidate)===null||r===void 0||r.call(i,t),t.atomValues.delete(o),t.nonvalidatedAtoms.set(o,s),t.dirtyAtoms.add(o)}else vf(`Unknown action ${n.type}`)}function Zu(e,t,n){n.state==="hasValue"&&n.contents instanceof Cf?e.atomValues.delete(t):e.atomValues.set(t,n),e.dirtyAtoms.add(t),e.nonvalidatedAtoms.delete(t)}function ov(e,t){e.replaceState(n=>{const r=sv(n);for(const o of t)Z1(e,r,o);return iv(e,r),G1(),r})}function zl(e,t){if(es.length){const n=es[es.length-1];let r=n.get(e);r||n.set(e,r=[]),r.push(t)}else ov(e,[t])}const es=[];function eR(){const e=new Map;return es.push(e),()=>{for(const[t,n]of e)ov(t,n);es.pop()}}function sv(e){return{...e,atomValues:e.atomValues.clone(),nonvalidatedAtoms:e.nonvalidatedAtoms.clone(),dirtyAtoms:new Set(e.dirtyAtoms)}}function iv(e,t){const n=$1(e,t,t.dirtyAtoms);for(const s of n){var r,o;(r=rv(s))===null||r===void 0||(o=r.invalidate)===null||o===void 0||o.call(r,t)}}function lv(e,t,n){zl(e,{type:"set",recoilValue:t,valueOrUpdater:n})}function tR(e,t,n){if(n instanceof Cf)return lv(e,t,n);zl(e,{type:"setLoadable",recoilValue:t,loadable:n})}function nR(e,t){zl(e,{type:"markModified",recoilValue:t})}function rR(e,t,n){zl(e,{type:"setUnvalidated",recoilValue:t,unvalidatedValue:n})}function oR(e,{key:t},n,r=null){const o=B1(),s=e.getState();s.nodeToComponentSubscriptions.has(t)||s.nodeToComponentSubscriptions.set(t,new Map),De(s.nodeToComponentSubscriptions.get(t)).set(o,[r??"",n]);const i=H1();if(i.early&&(i.mode==="LEGACY"||i.mode==="MUTABLE_SOURCE")){const l=e.getState().nextTree;l&&l.dirtyAtoms.has(t)&&n(l)}return{release:()=>{const l=e.getState(),a=l.nodeToComponentSubscriptions.get(t);a===void 0||!a.has(o)||(a.delete(o),a.size===0&&l.nodeToComponentSubscriptions.delete(t))}}}function sR(e,t){var n;const{currentTree:r}=e.getState(),o=z1(t.key);(n=o.clearCache)===null||n===void 0||n.call(o,e,r)}var rn={RecoilValueReadOnly:q1,AbstractRecoilValue:W1,RecoilState:Q1,getRecoilValueAsLoadable:Y1,setRecoilValue:lv,setRecoilValueLoadable:tR,markRecoilValueModified:nR,setUnvalidatedRecoilValue:rR,subscribeToRecoilValue:oR,isRecoilValue:K1,applyAtomValueWrites:J1,batchStart:eR,writeLoadableToTreeState:Zu,invalidateDownstreams:iv,copyTreeState:sv,refreshRecoilValue:sR};function iR(e,t,n){const r=e.entries();let o=r.next();for(;!o.done;){const s=o.value;if(t.call(n,s[1],s[0],e))return!0;o=r.next()}return!1}var lR=iR;const{cleanUpNode:aR}=Gn,{deleteNodeConfigIfPossible:uR,getNode:av}=wt,{RetentionZone:uv}=Bl,cR=12e4,cv=new Set;function fv(e,t){const n=e.getState(),r=n.currentTree;if(n.nextTree)return;const o=new Set;for(const i of t)if(i instanceof uv)for(const l of pR(n,i))o.add(l);else o.add(i);const s=fR(e,o);for(const i of s)hR(e,r,i)}function fR(e,t){const n=e.getState(),r=n.currentTree,o=e.getGraph(r.version),s=new Set,i=new Set;return l(t),s;function l(a){const u=new Set,c=dR(e,r,a,s,i);for(const p of c){var f;if(av(p).retainedBy==="recoilRoot"){i.add(p);continue}if(((f=n.retention.referenceCounts.get(p))!==null&&f!==void 0?f:0)>0){i.add(p);continue}if(dv(p).some(x=>n.retention.referenceCounts.get(x))){i.add(p);continue}const v=o.nodeToNodeSubscriptions.get(p);if(v&&lR(v,x=>i.has(x))){i.add(p);continue}s.add(p),u.add(p)}const h=new Set;for(const p of u)for(const v of(S=o.nodeDeps.get(p))!==null&&S!==void 0?S:cv){var S;s.has(v)||h.add(v)}h.size&&l(h)}}function dR(e,t,n,r,o){const s=e.getGraph(t.version),i=[],l=new Set;for(;n.size>0;)a(De(n.values().next().value));return i;function a(u){if(r.has(u)||o.has(u)){n.delete(u);return}if(l.has(u))return;const c=s.nodeToNodeSubscriptions.get(u);if(c)for(const f of c)a(f);l.add(u),n.delete(u),i.push(u)}}function hR(e,t,n){if(!xe("recoil_memory_managament_2020"))return;aR(e,n);const r=e.getState();r.knownAtoms.delete(n),r.knownSelectors.delete(n),r.nodeTransactionSubscriptions.delete(n),r.retention.referenceCounts.delete(n);const o=dv(n);for(const a of o){var s;(s=r.retention.nodesRetainedByZone.get(a))===null||s===void 0||s.delete(n)}t.atomValues.delete(n),t.dirtyAtoms.delete(n),t.nonvalidatedAtoms.delete(n);const i=r.graphsByVersion.get(t.version);if(i){const a=i.nodeDeps.get(n);if(a!==void 0){i.nodeDeps.delete(n);for(const u of a){var l;(l=i.nodeToNodeSubscriptions.get(u))===null||l===void 0||l.delete(n)}}i.nodeToNodeSubscriptions.delete(n)}uR(n)}function pR(e,t){var n;return(n=e.retention.nodesRetainedByZone.get(t))!==null&&n!==void 0?n:cv}function dv(e){const t=av(e).retainedBy;return t===void 0||t==="components"||t==="recoilRoot"?[]:t instanceof uv?[t]:t}function mR(e,t){const n=e.getState();n.nextTree?n.retention.retainablesToCheckForRelease.add(t):fv(e,new Set([t]))}function yR(e,t,n){var r;if(!xe("recoil_memory_managament_2020"))return;const o=e.getState().retention.referenceCounts,s=((r=o.get(t))!==null&&r!==void 0?r:0)+n;s===0?hv(e,t):o.set(t,s)}function hv(e,t){if(!xe("recoil_memory_managament_2020"))return;e.getState().retention.referenceCounts.delete(t),mR(e,t)}function vR(e){if(!xe("recoil_memory_managament_2020"))return;const t=e.getState();fv(e,t.retention.retainablesToCheckForRelease),t.retention.retainablesToCheckForRelease.clear()}function gR(e){return e===void 0?"recoilRoot":e}var _r={SUSPENSE_TIMEOUT_MS:cR,updateRetainCount:yR,updateRetainCountToZero:hv,releaseScheduledRetainablesNow:vR,retainedByOptionWithDefault:gR};const{unstable_batchedUpdates:SR}=kw;var wR={unstable_batchedUpdates:SR};const{unstable_batchedUpdates:_R}=wR;var RR={unstable_batchedUpdates:_R};const{batchStart:ER}=rn,{unstable_batchedUpdates:CR}=RR;let xf=CR||(e=>e());const xR=e=>{xf=e},TR=()=>xf,kR=e=>{xf(()=>{let t=()=>{};try{t=ER(),e()}finally{t()}})};var Hl={getBatcher:TR,setBatcher:xR,batchUpdates:kR};function*NR(e){for(const t of e)for(const n of t)yield n}var pv=NR;const mv=typeof Window>"u"||typeof window>"u",AR=e=>!mv&&(e===window||e instanceof Window),LR=typeof navigator<"u"&&navigator.product==="ReactNative";var Wl={isSSR:mv,isReactNative:LR,isWindow:AR};function PR(e,t){let n;return(...r)=>{n||(n={});const o=t(...r);return Object.hasOwnProperty.call(n,o)||(n[o]=e(...r)),n[o]}}function OR(e,t){let n,r;return(...o)=>{const s=t(...o);return n===s||(n=s,r=e(...o)),r}}function bR(e,t){let n,r;return[(...i)=>{const l=t(...i);return n===l||(n=l,r=e(...i)),r},()=>{n=null}]}var FR={memoizeWithArgsHash:PR,memoizeOneWithArgsHash:OR,memoizeOneWithArgsHashAndInvalidation:bR};const{batchUpdates:ec}=Hl,{initializeNode:DR,peekNodeInfo:MR}=Gn,{graph:UR}=As,{getNextStoreID:IR}=jl,{DEFAULT_VALUE:VR,recoilValues:Sh,recoilValuesForKeys:wh}=wt,{AbstractRecoilValue:$R,getRecoilValueAsLoadable:jR,setRecoilValue:_h,setUnvalidatedRecoilValue:BR}=rn,{updateRetainCount:Ei}=_r,{setInvalidateMemoizedSnapshot:zR}=tv,{getNextTreeStateVersion:HR,makeEmptyStoreState:WR}=Ky,{isSSR:QR}=Wl,{memoizeOneWithArgsHashAndInvalidation:qR}=FR;class Ql{constructor(t,n){fe(this,"_store",void 0),fe(this,"_refCount",1),fe(this,"getLoadable",r=>(this.checkRefCount_INTERNAL(),jR(this._store,r))),fe(this,"getPromise",r=>(this.checkRefCount_INTERNAL(),this.getLoadable(r).toPromise())),fe(this,"getNodes_UNSTABLE",r=>{if(this.checkRefCount_INTERNAL(),(r==null?void 0:r.isModified)===!0){if((r==null?void 0:r.isInitialized)===!1)return[];const i=this._store.getState().currentTree;return wh(i.dirtyAtoms)}const o=this._store.getState().knownAtoms,s=this._store.getState().knownSelectors;return(r==null?void 0:r.isInitialized)==null?Sh.values():r.isInitialized===!0?wh(pv([o,s])):Rf(Sh.values(),({key:i})=>!o.has(i)&&!s.has(i))}),fe(this,"getInfo_UNSTABLE",({key:r})=>(this.checkRefCount_INTERNAL(),MR(this._store,this._store.getState().currentTree,r))),fe(this,"map",r=>{this.checkRefCount_INTERNAL();const o=new tc(this,ec);return r(o),o}),fe(this,"asyncMap",async r=>{this.checkRefCount_INTERNAL();const o=new tc(this,ec);return o.retain(),await r(o),o.autoRelease_INTERNAL(),o}),this._store={storeID:IR(),parentStoreID:n,getState:()=>t,replaceState:r=>{t.currentTree=r(t.currentTree)},getGraph:r=>{const o=t.graphsByVersion;if(o.has(r))return De(o.get(r));const s=UR();return o.set(r,s),s},subscribeToTransactions:()=>({release:()=>{}}),addTransactionMetadata:()=>{throw de("Cannot subscribe to Snapshots")}};for(const r of this._store.getState().knownAtoms)DR(this._store,r,"get"),Ei(this._store,r,1);this.autoRelease_INTERNAL()}retain(){this._refCount<=0,this._refCount++;let t=!1;return()=>{t||(t=!0,this._release())}}autoRelease_INTERNAL(){QR||window.setTimeout(()=>this._release(),10)}_release(){if(this._refCount--,this._refCount===0){if(this._store.getState().nodeCleanupFunctions.forEach(t=>t()),this._store.getState().nodeCleanupFunctions.clear(),!xe("recoil_memory_managament_2020"))return}else this._refCount<0}isRetained(){return this._refCount>0}checkRefCount_INTERNAL(){xe("recoil_memory_managament_2020")&&this._refCount<=0}getStore_INTERNAL(){return this.checkRefCount_INTERNAL(),this._store}getID(){return this.checkRefCount_INTERNAL(),this._store.getState().currentTree.stateID}getStoreID(){return this.checkRefCount_INTERNAL(),this._store.storeID}}function yv(e,t,n=!1){const r=e.getState(),o=n?HR():t.version;return{currentTree:{version:n?o:t.version,stateID:n?o:t.stateID,transactionMetadata:{...t.transactionMetadata},dirtyAtoms:new Set(t.dirtyAtoms),atomValues:t.atomValues.clone(),nonvalidatedAtoms:t.nonvalidatedAtoms.clone()},commitDepth:0,nextTree:null,previousTree:null,knownAtoms:new Set(r.knownAtoms),knownSelectors:new Set(r.knownSelectors),transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(o,e.getGraph(t.version)),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map($l(r.nodeCleanupFunctions.entries(),([s])=>[s,()=>{}]))}}function KR(e){const t=new Ql(WR());return e!=null?t.map(e):t}const[Rh,vv]=qR((e,t)=>{var n;const r=e.getState(),o=t==="latest"?(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree:De(r.previousTree);return new Ql(yv(e,o),e.storeID)},(e,t)=>{var n,r;return String(t)+String(e.storeID)+String((n=e.getState().nextTree)===null||n===void 0?void 0:n.version)+String(e.getState().currentTree.version)+String((r=e.getState().previousTree)===null||r===void 0?void 0:r.version)});zR(vv);function GR(e,t="latest"){const n=Rh(e,t);return n.isRetained()?n:(vv(),Rh(e,t))}class tc extends Ql{constructor(t,n){super(yv(t.getStore_INTERNAL(),t.getStore_INTERNAL().getState().currentTree,!0),t.getStoreID()),fe(this,"_batch",void 0),fe(this,"set",(r,o)=>{this.checkRefCount_INTERNAL();const s=this.getStore_INTERNAL();this._batch(()=>{Ei(s,r.key,1),_h(this.getStore_INTERNAL(),r,o)})}),fe(this,"reset",r=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();this._batch(()=>{Ei(o,r.key,1),_h(this.getStore_INTERNAL(),r,VR)})}),fe(this,"setUnvalidatedAtomValues_DEPRECATED",r=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();ec(()=>{for(const[s,i]of r.entries())Ei(o,s,1),BR(o,new $R(s),i)})}),this._batch=n}}var ql={Snapshot:Ql,MutableSnapshot:tc,freshSnapshot:KR,cloneSnapshot:GR},YR=ql.Snapshot,JR=ql.MutableSnapshot,XR=ql.freshSnapshot,ZR=ql.cloneSnapshot,Kl=Object.freeze({__proto__:null,Snapshot:YR,MutableSnapshot:JR,freshSnapshot:XR,cloneSnapshot:ZR});function eE(...e){const t=new Set;for(const n of e)for(const r of n)t.add(r);return t}var tE=eE;const{useRef:nE}=re;function rE(e){const t=nE(e);return t.current===e&&typeof e=="function"&&(t.current=e()),t}var Eh=rE;const{getNextTreeStateVersion:oE,makeEmptyStoreState:gv}=Ky,{cleanUpNode:sE,getDownstreamNodes:iE,initializeNode:lE,setNodeValue:aE,setUnvalidatedAtomValue_DEPRECATED:uE}=Gn,{graph:cE}=As,{cloneGraph:fE}=As,{getNextStoreID:Sv}=jl,{createMutableSource:ja,reactMode:wv}=Ns,{applyAtomValueWrites:dE}=rn,{releaseScheduledRetainablesNow:_v}=_r,{freshSnapshot:hE}=Kl,{useCallback:pE,useContext:Rv,useEffect:nc,useMemo:mE,useRef:yE,useState:vE}=re;function Ao(){throw de("This component must be used inside a component.")}const Ev=Object.freeze({storeID:Sv(),getState:Ao,replaceState:Ao,getGraph:Ao,subscribeToTransactions:Ao,addTransactionMetadata:Ao});let rc=!1;function Ch(e){if(rc)throw de("An atom update was triggered within the execution of a state updater function. State updater functions provided to Recoil must be pure functions.");const t=e.getState();if(t.nextTree===null){xe("recoil_memory_managament_2020")&&xe("recoil_release_on_cascading_update_killswitch_2021")&&t.commitDepth>0&&_v(e);const n=t.currentTree.version,r=oE();t.nextTree={...t.currentTree,version:r,stateID:r,dirtyAtoms:new Set,transactionMetadata:{}},t.graphsByVersion.set(r,fE(De(t.graphsByVersion.get(n))))}}const Cv=re.createContext({current:Ev}),Gl=()=>Rv(Cv),xv=re.createContext(null);function gE(){return Rv(xv)}function Tf(e,t,n){const r=iE(e,n,n.dirtyAtoms);for(const o of r){const s=t.nodeToComponentSubscriptions.get(o);if(s)for(const[i,[l,a]]of s)a(n)}}function Tv(e){const t=e.getState(),n=t.currentTree,r=n.dirtyAtoms;if(r.size){for(const[o,s]of t.nodeTransactionSubscriptions)if(r.has(o))for(const[i,l]of s)l(e);for(const[o,s]of t.transactionSubscriptions)s(e);(!wv().early||t.suspendedComponentResolvers.size>0)&&(Tf(e,t,n),t.suspendedComponentResolvers.forEach(o=>o()),t.suspendedComponentResolvers.clear())}t.queuedComponentCallbacks_DEPRECATED.forEach(o=>o(n)),t.queuedComponentCallbacks_DEPRECATED.splice(0,t.queuedComponentCallbacks_DEPRECATED.length)}function SE(e){const t=e.getState();t.commitDepth++;try{const{nextTree:n}=t;if(n==null)return;t.previousTree=t.currentTree,t.currentTree=n,t.nextTree=null,Tv(e),t.previousTree!=null?t.graphsByVersion.delete(t.previousTree.version):vf("Ended batch with no previous state, which is unexpected","recoil"),t.previousTree=null,xe("recoil_memory_managament_2020")&&n==null&&_v(e)}finally{t.commitDepth--}}function wE({setNotifyBatcherOfChange:e}){const t=Gl(),[,n]=vE([]);return e(()=>n({})),nc(()=>(e(()=>n({})),()=>{e(()=>{})}),[e]),nc(()=>{X_.enqueueExecution("Batcher",()=>{SE(t.current)})}),null}function _E(e,t){const n=gv();return t({set:(r,o)=>{const s=n.currentTree,i=aE(e,s,r.key,o),l=new Set(i.keys()),a=s.nonvalidatedAtoms.clone();for(const u of l)a.delete(u);n.currentTree={...s,dirtyAtoms:tE(s.dirtyAtoms,l),atomValues:dE(s.atomValues,i),nonvalidatedAtoms:a}},setUnvalidatedAtomValues:r=>{r.forEach((o,s)=>{n.currentTree=uE(n.currentTree,s,o)})}}),n}function RE(e){const t=hE(e),n=t.getStore_INTERNAL().getState();return t.retain(),n.nodeCleanupFunctions.forEach(r=>r()),n.nodeCleanupFunctions.clear(),n}let xh=0;function EE({initializeState_DEPRECATED:e,initializeState:t,store_INTERNAL:n,children:r}){let o;const s=S=>{const p=o.current.graphsByVersion;if(p.has(S))return De(p.get(S));const v=cE();return p.set(S,v),v},i=(S,p)=>{if(p==null){const{transactionSubscriptions:v}=f.current.getState(),x=xh++;return v.set(x,S),{release:()=>{v.delete(x)}}}else{const{nodeTransactionSubscriptions:v}=f.current.getState();v.has(p)||v.set(p,new Map);const x=xh++;return De(v.get(p)).set(x,S),{release:()=>{const y=v.get(p);y&&(y.delete(x),y.size===0&&v.delete(p))}}}},l=S=>{Ch(f.current);for(const p of Object.keys(S))De(f.current.getState().nextTree).transactionMetadata[p]=S[p]},a=S=>{Ch(f.current);const p=De(o.current.nextTree);let v;try{rc=!0,v=S(p)}finally{rc=!1}v!==p&&(o.current.nextTree=v,wv().early&&Tf(f.current,o.current,v),De(u.current)())},u=yE(null),c=pE(S=>{u.current=S},[u]),f=Eh(()=>n??{storeID:Sv(),getState:()=>o.current,replaceState:a,getGraph:s,subscribeToTransactions:i,addTransactionMetadata:l});n!=null&&(f.current=n),o=Eh(()=>e!=null?_E(f.current,e):t!=null?RE(t):gv());const h=mE(()=>ja==null?void 0:ja(o,()=>o.current.currentTree.version),[o]);return nc(()=>{const S=f.current;for(const p of new Set(S.getState().knownAtoms))lE(S,p,"get");return()=>{for(const p of S.getState().knownAtoms)sE(S,p)}},[f]),re.createElement(Cv.Provider,{value:f},re.createElement(xv.Provider,{value:h},re.createElement(wE,{setNotifyBatcherOfChange:c}),r))}function CE(e){const{override:t,...n}=e,r=Gl();return t===!1&&r.current!==Ev?e.children:re.createElement(EE,n)}function xE(){return Gl().current.storeID}var wn={RecoilRoot:CE,useStoreRef:Gl,useRecoilMutableSource:gE,useRecoilStoreID:xE,notifyComponents_FOR_TESTING:Tf,sendEndOfBatchNotifications_FOR_TESTING:Tv};function TE(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0,r=e.length;n{t.current=e}),t.current}var kv=LE;const{useStoreRef:PE}=wn,{SUSPENSE_TIMEOUT_MS:OE}=_r,{updateRetainCount:Lo}=_r,{RetentionZone:bE}=Bl,{useEffect:FE,useRef:DE}=re,{isSSR:Th}=Wl;function ME(e){if(xe("recoil_memory_managament_2020"))return UE(e)}function UE(e){const n=(Array.isArray(e)?e:[e]).map(i=>i instanceof bE?i:i.key),r=PE();FE(()=>{if(!xe("recoil_memory_managament_2020"))return;const i=r.current;if(o.current&&!Th)window.clearTimeout(o.current),o.current=null;else for(const l of n)Lo(i,l,1);return()=>{for(const l of n)Lo(i,l,-1)}},[r,...n]);const o=DE(),s=kv(n);if(!Th&&(s===void 0||!kE(s,n))){const i=r.current;for(const l of n)Lo(i,l,1);if(s)for(const l of s)Lo(i,l,-1);o.current&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{o.current=null;for(const l of n)Lo(i,l,-1)},OE)}}var kf=ME;function IE(){return""}var Ps=IE;const{batchUpdates:VE}=Hl,{DEFAULT_VALUE:Nv}=wt,{currentRendererSupportsUseSyncExternalStore:$E,reactMode:po,useMutableSource:jE,useSyncExternalStore:BE}=Ns,{useRecoilMutableSource:zE,useStoreRef:on}=wn,{AbstractRecoilValue:oc,getRecoilValueAsLoadable:Os,setRecoilValue:sl,setUnvalidatedRecoilValue:HE,subscribeToRecoilValue:ro}=rn,{useCallback:gt,useEffect:oo,useMemo:Av,useRef:ts,useState:Nf}=re,{setByAddingToSet:WE}=Yy,{isSSR:QE}=Wl;function Af(e,t,n){if(e.state==="hasValue")return e.contents;throw e.state==="loading"?new Promise(o=>{const s=n.current.getState().suspendedComponentResolvers;s.add(o),QE&&Pe(e.contents)&&e.contents.finally(()=>{s.delete(o)})}):e.state==="hasError"?e.contents:de(`Invalid value of loadable atom "${t.key}"`)}function qE(){const e=Ps(),t=on(),[,n]=Nf([]),r=ts(new Set);r.current=new Set;const o=ts(new Set),s=ts(new Map),i=gt(a=>{const u=s.current.get(a);u&&(u.release(),s.current.delete(a))},[s]),l=gt((a,u)=>{s.current.has(u)&&n([])},[]);return oo(()=>{const a=t.current;Zo(r.current,o.current).forEach(u=>{if(s.current.has(u))return;const c=ro(a,new oc(u),h=>l(h,u),e);s.current.set(u,c),a.getState().nextTree?a.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{l(a.getState(),u)}):l(a.getState(),u)}),Zo(o.current,r.current).forEach(u=>{i(u)}),o.current=r.current}),oo(()=>{const a=s.current;return Zo(r.current,new Set(a.keys())).forEach(u=>{const c=ro(t.current,new oc(u),f=>l(f,u),e);a.set(u,c)}),()=>a.forEach((u,c)=>i(c))},[e,t,i,l]),Av(()=>{function a(p){return v=>{sl(t.current,p,v)}}function u(p){return()=>sl(t.current,p,Nv)}function c(p){var v;r.current.has(p.key)||(r.current=WE(r.current,p.key));const x=t.current.getState();return Os(t.current,p,po().early&&(v=x.nextTree)!==null&&v!==void 0?v:x.currentTree)}function f(p){const v=c(p);return Af(v,p,t)}function h(p){return[f(p),a(p)]}function S(p){return[c(p),a(p)]}return{getRecoilValue:f,getRecoilValueLoadable:c,getRecoilState:h,getRecoilStateLoadable:S,getSetRecoilState:a,getResetRecoilState:u}},[r,t])}const KE={current:0};function GE(e){const t=on(),n=Ps(),r=gt(()=>{var l;const a=t.current,u=a.getState(),c=po().early&&(l=u.nextTree)!==null&&l!==void 0?l:u.currentTree;return{loadable:Os(a,e,c),key:e.key}},[t,e]),o=gt(l=>{let a;return()=>{var u,c;const f=l();return(u=a)!==null&&u!==void 0&&u.loadable.is(f.loadable)&&((c=a)===null||c===void 0?void 0:c.key)===f.key?a:(a=f,f)}},[]),s=Av(()=>o(r),[r,o]),i=gt(l=>{const a=t.current;return ro(a,e,l,n).release},[t,e,n]);return BE(i,s,s).loadable}function YE(e){const t=on(),n=gt(()=>{var u;const c=t.current,f=c.getState(),h=po().early&&(u=f.nextTree)!==null&&u!==void 0?u:f.currentTree;return Os(c,e,h)},[t,e]),r=gt(()=>n(),[n]),o=Ps(),s=gt((u,c)=>{const f=t.current;return ro(f,e,()=>{if(!xe("recoil_suppress_rerender_in_callback"))return c();const S=n();a.current.is(S)||c(),a.current=S},o).release},[t,e,o,n]),i=zE();if(i==null)throw de("Recoil hooks must be used in components contained within a component.");const l=jE(i,r,s),a=ts(l);return oo(()=>{a.current=l}),l}function sc(e){const t=on(),n=Ps(),r=gt(()=>{var a;const u=t.current,c=u.getState(),f=po().early&&(a=c.nextTree)!==null&&a!==void 0?a:c.currentTree;return Os(u,e,f)},[t,e]),o=gt(()=>({loadable:r(),key:e.key}),[r,e.key]),s=gt(a=>{const u=o();return a.loadable.is(u.loadable)&&a.key===u.key?a:u},[o]);oo(()=>{const a=ro(t.current,e,u=>{l(s)},n);return l(s),a.release},[n,e,t,s]);const[i,l]=Nf(o);return i.key!==e.key?o().loadable:i.loadable}function JE(e){const t=on(),[,n]=Nf([]),r=Ps(),o=gt(()=>{var l;const a=t.current,u=a.getState(),c=po().early&&(l=u.nextTree)!==null&&l!==void 0?l:u.currentTree;return Os(a,e,c)},[t,e]),s=o(),i=ts(s);return oo(()=>{i.current=s}),oo(()=>{const l=t.current,a=l.getState(),u=ro(l,e,f=>{var h;if(!xe("recoil_suppress_rerender_in_callback"))return n([]);const S=o();(h=i.current)!==null&&h!==void 0&&h.is(S)||n(S),i.current=S},r);if(a.nextTree)l.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{i.current=null,n([])});else{var c;if(!xe("recoil_suppress_rerender_in_callback"))return n([]);const f=o();(c=i.current)!==null&&c!==void 0&&c.is(f)||n(f),i.current=f}return u.release},[r,o,e,t]),s}function Lf(e){return xe("recoil_memory_managament_2020")&&kf(e),{TRANSITION_SUPPORT:sc,SYNC_EXTERNAL_STORE:$E()?GE:sc,MUTABLE_SOURCE:YE,LEGACY:JE}[po().mode](e)}function Lv(e){const t=on(),n=Lf(e);return Af(n,e,t)}function Yl(e){const t=on();return gt(n=>{sl(t.current,e,n)},[t,e])}function XE(e){const t=on();return gt(()=>{sl(t.current,e,Nv)},[t,e])}function ZE(e){return[Lv(e),Yl(e)]}function eC(e){return[Lf(e),Yl(e)]}function tC(){const e=on();return(t,n={})=>{VE(()=>{e.current.addTransactionMetadata(n),t.forEach((r,o)=>HE(e.current,new oc(o),r))})}}function Pv(e){return xe("recoil_memory_managament_2020")&&kf(e),sc(e)}function Ov(e){const t=on(),n=Pv(e);return Af(n,e,t)}function nC(e){return[Ov(e),Yl(e)]}var rC={recoilComponentGetRecoilValueCount_FOR_TESTING:KE,useRecoilInterface:qE,useRecoilState:ZE,useRecoilStateLoadable:eC,useRecoilValue:Lv,useRecoilValueLoadable:Lf,useResetRecoilState:XE,useSetRecoilState:Yl,useSetUnvalidatedAtomValues:tC,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:Pv,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:Ov,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:nC};function oC(e,t){const n=new Map;for(const[r,o]of e)t(o,r)&&n.set(r,o);return n}var sC=oC;function iC(e,t){const n=new Set;for(const r of e)t(r)&&n.add(r);return n}var lC=iC;function aC(...e){const t=new Map;for(let n=0;nt.current.subscribeToTransactions(e).release,[e,t])}function Ah(e){const t=e.atomValues.toMap(),n=ol(sC(t,(r,o)=>{const i=bv(o).persistence_UNSTABLE;return i!=null&&i.type!=="none"&&r.state==="hasValue"}),r=>r.contents);return uC(e.nonvalidatedAtoms.toMap(),n)}function vC(e){Xl(Jl(t=>{let n=t.getState().previousTree;const r=t.getState().currentTree;n||(n=t.getState().currentTree);const o=Ah(r),s=Ah(n),i=ol(dC,a=>{var u,c,f,h;return{persistence_UNSTABLE:{type:(u=(c=a.persistence_UNSTABLE)===null||c===void 0?void 0:c.type)!==null&&u!==void 0?u:"none",backButton:(f=(h=a.persistence_UNSTABLE)===null||h===void 0?void 0:h.backButton)!==null&&f!==void 0?f:!1}}}),l=lC(r.dirtyAtoms,a=>o.has(a)||s.has(a));e({atomValues:o,previousAtomValues:s,atomInfo:i,modifiedAtoms:l,transactionMetadata:{...r.transactionMetadata}})},[e]))}function gC(e){Xl(Jl(t=>{const n=il(t,"latest"),r=il(t,"previous");e({snapshot:n,previousSnapshot:r})},[e]))}function SC(){const e=Pf(),[t,n]=yC(()=>il(e.current)),r=kv(t),o=kh(),s=kh();if(Xl(Jl(l=>n(il(l)),[])),Fv(()=>{const l=t.retain();if(o.current&&!Nh){var a;window.clearTimeout(o.current),o.current=null,(a=s.current)===null||a===void 0||a.call(s),s.current=null}return()=>{window.setTimeout(l,10)}},[t]),r!==t&&!Nh){if(o.current){var i;window.clearTimeout(o.current),o.current=null,(i=s.current)===null||i===void 0||i.call(s),s.current=null}s.current=t.retain(),o.current=window.setTimeout(()=>{var l;o.current=null,(l=s.current)===null||l===void 0||l.call(s),s.current=null},mC)}return t}function Dv(e,t){var n;const r=e.getState(),o=(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree,s=t.getStore_INTERNAL().getState().currentTree;cC(()=>{const i=new Set;for(const u of[o.atomValues.keys(),s.atomValues.keys()])for(const c of u){var l,a;((l=o.atomValues.get(c))===null||l===void 0?void 0:l.contents)!==((a=s.atomValues.get(c))===null||a===void 0?void 0:a.contents)&&bv(c).shouldRestoreFromSnapshots&&i.add(c)}i.forEach(u=>{pC(e,new hC(u),s.atomValues.has(u)?De(s.atomValues.get(u)):fC)}),e.replaceState(u=>({...u,stateID:t.getID()}))})}function wC(){const e=Pf();return Jl(t=>Dv(e.current,t),[e])}var Mv={useRecoilSnapshot:SC,gotoSnapshot:Dv,useGotoRecoilSnapshot:wC,useRecoilTransactionObserver:gC,useTransactionObservation_DEPRECATED:vC,useTransactionSubscription_DEPRECATED:Xl};const{peekNodeInfo:_C}=Gn,{useStoreRef:RC}=wn;function EC(){const e=RC();return({key:t})=>_C(e.current,e.current.getState().currentTree,t)}var CC=EC;const{reactMode:xC}=Ns,{RecoilRoot:TC,useStoreRef:kC}=wn,{useMemo:NC}=re;function AC(){xC().mode==="MUTABLE_SOURCE"&&console.warn("Warning: There are known issues using useRecoilBridgeAcrossReactRoots() in recoil_mutable_source rendering mode. Please consider upgrading to recoil_sync_external_store mode.");const e=kC().current;return NC(()=>{function t({children:n}){return re.createElement(TC,{store_INTERNAL:e},n)}return t},[e])}var LC=AC;const{loadableWithValue:PC}=ks,{initializeNode:OC}=Gn,{DEFAULT_VALUE:bC,getNode:FC}=wt,{copyTreeState:DC,getRecoilValueAsLoadable:MC,invalidateDownstreams:UC,writeLoadableToTreeState:IC}=rn;function Lh(e){return FC(e.key).nodeType==="atom"}class VC{constructor(t,n){fe(this,"_store",void 0),fe(this,"_treeState",void 0),fe(this,"_changes",void 0),fe(this,"get",r=>{if(this._changes.has(r.key))return this._changes.get(r.key);if(!Lh(r))throw de("Reading selectors within atomicUpdate is not supported");const o=MC(this._store,r,this._treeState);if(o.state==="hasValue")return o.contents;throw o.state==="hasError"?o.contents:de(`Expected Recoil atom ${r.key} to have a value, but it is in a loading state.`)}),fe(this,"set",(r,o)=>{if(!Lh(r))throw de("Setting selectors within atomicUpdate is not supported");if(typeof o=="function"){const s=this.get(r);this._changes.set(r.key,o(s))}else OC(this._store,r.key,"set"),this._changes.set(r.key,o)}),fe(this,"reset",r=>{this.set(r,bC)}),this._store=t,this._treeState=n,this._changes=new Map}newTreeState_INTERNAL(){if(this._changes.size===0)return this._treeState;const t=DC(this._treeState);for(const[n,r]of this._changes)IC(t,n,PC(r));return UC(this._store,t),t}}function $C(e){return t=>{e.replaceState(n=>{const r=new VC(e,n);return t(r),r.newTreeState_INTERNAL()})}}var jC={atomicUpdater:$C},BC=jC.atomicUpdater,Uv=Object.freeze({__proto__:null,atomicUpdater:BC});function zC(e,t){if(!e)throw new Error(t)}var HC=zC,Bo=HC;const{atomicUpdater:WC}=Uv,{batchUpdates:QC}=Hl,{DEFAULT_VALUE:qC}=wt,{useStoreRef:KC}=wn,{refreshRecoilValue:GC,setRecoilValue:Ph}=rn,{cloneSnapshot:YC}=Kl,{gotoSnapshot:JC}=Mv,{useCallback:XC}=re;class Iv{}const ZC=new Iv;function Vv(e,t,n,r){let o=ZC,s;if(QC(()=>{const l="useRecoilCallback() expects a function that returns a function: it accepts a function of the type (RecoilInterface) => (Args) => ReturnType and returns a callback function (Args) => ReturnType, where RecoilInterface is an object {snapshot, set, ...} and Args and ReturnType are the argument and return types of the callback you want to create. Please see the docs at recoiljs.org for details.";if(typeof t!="function")throw de(l);const a=Jy({...r??{},set:(c,f)=>Ph(e,c,f),reset:c=>Ph(e,c,qC),refresh:c=>GC(e,c),gotoSnapshot:c=>JC(e,c),transact_UNSTABLE:c=>WC(e)(c)},{snapshot:()=>{const c=YC(e);return s=c.retain(),c}}),u=t(a);if(typeof u!="function")throw de(l);o=u(...n)}),o instanceof Iv&&Bo(!1),Pe(o))o=o.finally(()=>{var l;(l=s)===null||l===void 0||l()});else{var i;(i=s)===null||i===void 0||i()}return o}function ex(e,t){const n=KC();return XC((...r)=>Vv(n.current,e,r),t!=null?[...t,n]:void 0)}var $v={recoilCallback:Vv,useRecoilCallback:ex};const{useStoreRef:tx}=wn,{refreshRecoilValue:nx}=rn,{useCallback:rx}=re;function ox(e){const t=tx();return rx(()=>{const n=t.current;nx(n,e)},[e,t])}var sx=ox;const{atomicUpdater:ix}=Uv,{useStoreRef:lx}=wn,{useMemo:ax}=re;function ux(e,t){const n=lx();return ax(()=>(...r)=>{ix(n.current)(s=>{e(s)(...r)})},t!=null?[...t,n]:void 0)}var cx=ux;class fx{constructor(t){fe(this,"value",void 0),this.value=t}}var dx={WrappedValue:fx},hx=dx.WrappedValue,jv=Object.freeze({__proto__:null,WrappedValue:hx});const{isFastRefreshEnabled:px}=Ns;class Oh extends Error{}class mx{constructor(t){var n,r,o;fe(this,"_name",void 0),fe(this,"_numLeafs",void 0),fe(this,"_root",void 0),fe(this,"_onHit",void 0),fe(this,"_onSet",void 0),fe(this,"_mapNodeValue",void 0),this._name=t==null?void 0:t.name,this._numLeafs=0,this._root=null,this._onHit=(n=t==null?void 0:t.onHit)!==null&&n!==void 0?n:()=>{},this._onSet=(r=t==null?void 0:t.onSet)!==null&&r!==void 0?r:()=>{},this._mapNodeValue=(o=t==null?void 0:t.mapNodeValue)!==null&&o!==void 0?o:s=>s}size(){return this._numLeafs}root(){return this._root}get(t,n){var r;return(r=this.getLeafNode(t,n))===null||r===void 0?void 0:r.value}getLeafNode(t,n){if(this._root==null)return;let r=this._root;for(;r;){if(n==null||n.onNodeVisit(r),r.type==="leaf")return this._onHit(r),r;const o=this._mapNodeValue(t(r.nodeKey));r=r.branches.get(o)}}set(t,n,r){const o=()=>{var s,i,l,a;let u,c;for(const[x,y]of t){var f,h,S;const d=this._root;if((d==null?void 0:d.type)==="leaf")throw this.invalidCacheError();const m=u;if(u=m?m.branches.get(c):d,u=(f=u)!==null&&f!==void 0?f:{type:"branch",nodeKey:x,parent:m,branches:new Map,branchKey:c},u.type!=="branch"||u.nodeKey!==x)throw this.invalidCacheError();m==null||m.branches.set(c,u),r==null||(h=r.onNodeVisit)===null||h===void 0||h.call(r,u),c=this._mapNodeValue(y),this._root=(S=this._root)!==null&&S!==void 0?S:u}const p=u?(s=u)===null||s===void 0?void 0:s.branches.get(c):this._root;if(p!=null&&(p.type!=="leaf"||p.branchKey!==c))throw this.invalidCacheError();const v={type:"leaf",value:n,parent:u,branchKey:c};(i=u)===null||i===void 0||i.branches.set(c,v),this._root=(l=this._root)!==null&&l!==void 0?l:v,this._numLeafs++,this._onSet(v),r==null||(a=r.onNodeVisit)===null||a===void 0||a.call(r,v)};try{o()}catch(s){if(s instanceof Oh)this.clear(),o();else throw s}}delete(t){const n=this.root();if(!n)return!1;if(t===n)return this._root=null,this._numLeafs=0,!0;let r=t.parent,o=t.branchKey;for(;r;){var s;if(r.branches.delete(o),r===n)return r.branches.size===0?(this._root=null,this._numLeafs=0):this._numLeafs--,!0;if(r.branches.size>0)break;o=(s=r)===null||s===void 0?void 0:s.branchKey,r=r.parent}for(;r!==n;r=r.parent)if(r==null)return!1;return this._numLeafs--,!0}clear(){this._numLeafs=0,this._root=null}invalidCacheError(){const t=px()?"Possible Fast Refresh module reload detected. This may also be caused by an selector returning inconsistent values. Resetting cache.":"Invalid cache values. This happens when selectors do not return consistent values for the same input dependency values. That may also be caused when using Fast Refresh to change a selector implementation. Resetting cache.";throw vf(t+(this._name!=null?` - ${this._name}`:"")),new Oh}}var yx={TreeCache:mx},vx=yx.TreeCache,Bv=Object.freeze({__proto__:null,TreeCache:vx});class gx{constructor(t){var n;fe(this,"_maxSize",void 0),fe(this,"_size",void 0),fe(this,"_head",void 0),fe(this,"_tail",void 0),fe(this,"_map",void 0),fe(this,"_keyMapper",void 0),this._maxSize=t.maxSize,this._size=0,this._head=null,this._tail=null,this._map=new Map,this._keyMapper=(n=t.mapKey)!==null&&n!==void 0?n:r=>r}head(){return this._head}tail(){return this._tail}size(){return this._size}maxSize(){return this._maxSize}has(t){return this._map.has(this._keyMapper(t))}get(t){const n=this._keyMapper(t),r=this._map.get(n);if(r)return this.set(t,r.value),r.value}set(t,n){const r=this._keyMapper(t);this._map.get(r)&&this.delete(t);const s=this.head(),i={key:t,right:s,left:null,value:n};s?s.left=i:this._tail=i,this._map.set(r,i),this._head=i,this._size++,this._maybeDeleteLRU()}_maybeDeleteLRU(){this.size()>this.maxSize()&&this.deleteLru()}deleteLru(){const t=this.tail();t&&this.delete(t.key)}delete(t){const n=this._keyMapper(t);if(!this._size||!this._map.has(n))return;const r=De(this._map.get(n)),o=r.right,s=r.left;o&&(o.left=r.left),s&&(s.right=r.right),r===this.head()&&(this._head=o),r===this.tail()&&(this._tail=s),this._map.delete(n),this._size--}clear(){this._size=0,this._head=null,this._tail=null,this._map=new Map}}var Sx={LRUCache:gx},wx=Sx.LRUCache,zv=Object.freeze({__proto__:null,LRUCache:wx});const{LRUCache:_x}=zv,{TreeCache:Rx}=Bv;function Ex({name:e,maxSize:t,mapNodeValue:n=r=>r}){const r=new _x({maxSize:t}),o=new Rx({name:e,mapNodeValue:n,onHit:s=>{r.set(s,!0)},onSet:s=>{const i=r.tail();r.set(s,!0),i&&o.size()>t&&o.delete(i.key)}});return o}var bh=Ex;function $t(e,t,n){if(typeof e=="string"&&!e.includes('"')&&!e.includes("\\"))return`"${e}"`;switch(typeof e){case"undefined":return"";case"boolean":return e?"true":"false";case"number":case"symbol":return String(e);case"string":return JSON.stringify(e);case"function":if((t==null?void 0:t.allowFunctions)!==!0)throw de("Attempt to serialize function in a Recoil cache key");return`__FUNCTION(${e.name})__`}if(e===null)return"null";if(typeof e!="object"){var r;return(r=JSON.stringify(e))!==null&&r!==void 0?r:""}if(Pe(e))return"__PROMISE__";if(Array.isArray(e))return`[${e.map((o,s)=>$t(o,t,s.toString()))}]`;if(typeof e.toJSON=="function")return $t(e.toJSON(n),t,n);if(e instanceof Map){const o={};for(const[s,i]of e)o[typeof s=="string"?s:$t(s,t)]=i;return $t(o,t,n)}return e instanceof Set?$t(Array.from(e).sort((o,s)=>$t(o,t).localeCompare($t(s,t))),t,n):Symbol!==void 0&&e[Symbol.iterator]!=null&&typeof e[Symbol.iterator]=="function"?$t(Array.from(e),t,n):`{${Object.keys(e).filter(o=>e[o]!==void 0).sort().map(o=>`${$t(o,t)}:${$t(e[o],t,o)}`).join(",")}}`}function Cx(e,t={allowFunctions:!1}){return $t(e,t)}var Zl=Cx;const{TreeCache:xx}=Bv,ii={equality:"reference",eviction:"keep-all",maxSize:1/0};function Tx({equality:e=ii.equality,eviction:t=ii.eviction,maxSize:n=ii.maxSize}=ii,r){const o=kx(e);return Nx(t,n,o,r)}function kx(e){switch(e){case"reference":return t=>t;case"value":return t=>Zl(t)}throw de(`Unrecognized equality policy ${e}`)}function Nx(e,t,n,r){switch(e){case"keep-all":return new xx({name:r,mapNodeValue:n});case"lru":return bh({name:r,maxSize:De(t),mapNodeValue:n});case"most-recent":return bh({name:r,maxSize:1,mapNodeValue:n})}throw de(`Unrecognized eviction policy ${e}`)}var Ax=Tx;function Lx(e){return()=>null}var Px={startPerfBlock:Lx};const{isLoadable:Ox,loadableWithError:li,loadableWithPromise:bx,loadableWithValue:Ba}=ks,{WrappedValue:Hv}=jv,{getNodeLoadable:ai,peekNodeLoadable:Fx,setNodeValue:Dx}=Gn,{saveDepsToStore:Mx}=As,{DEFAULT_VALUE:Ux,getConfigDeletionHandler:Ix,getNode:Vx,registerNode:Fh}=wt,{isRecoilValue:$x}=no,{markRecoilValueModified:Dh}=rn,{retainedByOptionWithDefault:jx}=_r,{recoilCallback:Bx}=$v,{startPerfBlock:zx}=Px;class Wv{}const Po=new Wv,Oo=[],ui=new Map,Hx=(()=>{let e=0;return()=>e++})();function Qv(e){let t=null;const{key:n,get:r,cachePolicy_UNSTABLE:o}=e,s=e.set!=null?e.set:void 0,i=new Set,l=Ax(o??{equality:"reference",eviction:"keep-all"},n),a=jx(e.retainedBy_UNSTABLE),u=new Map;let c=0;function f(){return!xe("recoil_memory_managament_2020")||c>0}function h(E){return E.getState().knownSelectors.add(n),c++,()=>{c--}}function S(){return Ix(n)!==void 0&&!f()}function p(E,b,F,X,j){ge(b,X,j),v(E,F)}function v(E,b){le(E,b)&&z(E),y(b,!0)}function x(E,b){le(E,b)&&(De(Y(E)).stateVersions.clear(),y(b,!1))}function y(E,b){const F=ui.get(E);if(F!=null){for(const X of F)Dh(X,De(t));b&&ui.delete(E)}}function d(E,b){let F=ui.get(b);F==null&&ui.set(b,F=new Set),F.add(E)}function m(E,b,F,X,j,oe){return b.then(ne=>{if(!f())throw z(E),Po;const ee=Ba(ne);return p(E,F,j,ee,X),ne}).catch(ne=>{if(!f())throw z(E),Po;if(Pe(ne))return R(E,ne,F,X,j,oe);const ee=li(ne);throw p(E,F,j,ee,X),ne})}function R(E,b,F,X,j,oe){return b.then(ne=>{if(!f())throw z(E),Po;oe.loadingDepKey!=null&&oe.loadingDepPromise===b?F.atomValues.set(oe.loadingDepKey,Ba(ne)):E.getState().knownSelectors.forEach(Se=>{F.atomValues.delete(Se)});const ee=N(E,F);if(ee&&ee.state!=="loading"){if((le(E,j)||Y(E)==null)&&v(E,j),ee.state==="hasValue")return ee.contents;throw ee.contents}if(!le(E,j)){const Se=Z(E,F);if(Se!=null)return Se.loadingLoadable.contents}const[_e,ze]=A(E,F,j);if(_e.state!=="loading"&&p(E,F,j,_e,ze),_e.state==="hasError")throw _e.contents;return _e.contents}).catch(ne=>{if(ne instanceof Wv)throw Po;if(!f())throw z(E),Po;const ee=li(ne);throw p(E,F,j,ee,X),ne})}function k(E,b,F,X){var j,oe,ne,ee;if(le(E,X)||b.version===((j=E.getState())===null||j===void 0||(oe=j.currentTree)===null||oe===void 0?void 0:oe.version)||b.version===((ne=E.getState())===null||ne===void 0||(ee=ne.nextTree)===null||ee===void 0?void 0:ee.version)){var _e,ze,Se;Mx(n,F,E,(_e=(ze=E.getState())===null||ze===void 0||(Se=ze.nextTree)===null||Se===void 0?void 0:Se.version)!==null&&_e!==void 0?_e:E.getState().currentTree.version)}for(const Ce of F)i.add(Ce)}function A(E,b,F){const X=zx(n);let j=!0,oe=!0;const ne=()=>{X(),oe=!1};let ee,_e=!1,ze;const Se={loadingDepKey:null,loadingDepPromise:null},Ce=new Map;function _t({key:nt}){const g=ai(E,b,nt);switch(Ce.set(nt,g),j||(k(E,b,new Set(Ce.keys()),F),x(E,F)),g.state){case"hasValue":return g.contents;case"hasError":throw g.contents;case"loading":throw Se.loadingDepKey=nt,Se.loadingDepPromise=g.contents,g.contents}throw de("Invalid Loadable state")}const Gt=nt=>(...g)=>{if(oe)throw de("Callbacks from getCallback() should only be called asynchronously after the selector is evalutated. It can be used for selectors to return objects with callbacks that can work with Recoil state without a subscription.");return t==null&&Bo(!1),Bx(E,nt,g,{node:t})};try{ee=r({get:_t,getCallback:Gt}),ee=$x(ee)?_t(ee):ee,Ox(ee)&&(ee.state==="hasError"&&(_e=!0),ee=ee.contents),Pe(ee)?ee=m(E,ee,b,Ce,F,Se).finally(ne):ne(),ee=ee instanceof Hv?ee.value:ee}catch(nt){ee=nt,Pe(ee)?ee=R(E,ee,b,Ce,F,Se).finally(ne):(_e=!0,ne())}return _e?ze=li(ee):Pe(ee)?ze=bx(ee):ze=Ba(ee),j=!1,ue(E,F,Ce),k(E,b,new Set(Ce.keys()),F),[ze,Ce]}function N(E,b){let F=b.atomValues.get(n);if(F!=null)return F;const X=new Set;try{F=l.get(oe=>(typeof oe!="string"&&Bo(!1),ai(E,b,oe).contents),{onNodeVisit:oe=>{oe.type==="branch"&&oe.nodeKey!==n&&X.add(oe.nodeKey)}})}catch(oe){throw de(`Problem with cache lookup for selector "${n}": ${oe.message}`)}if(F){var j;b.atomValues.set(n,F),k(E,b,X,(j=Y(E))===null||j===void 0?void 0:j.executionID)}return F}function O(E,b){const F=N(E,b);if(F!=null)return z(E),F;const X=Z(E,b);if(X!=null){var j;return((j=X.loadingLoadable)===null||j===void 0?void 0:j.state)==="loading"&&d(E,X.executionID),X.loadingLoadable}const oe=Hx(),[ne,ee]=A(E,b,oe);return ne.state==="loading"?(me(E,oe,ne,ee,b),d(E,oe)):(z(E),ge(b,ne,ee)),ne}function Z(E,b){const F=pv([u.has(E)?[De(u.get(E))]:[],$l(Rf(u,([j])=>j!==E),([,j])=>j)]);function X(j){for(const[oe,ne]of j)if(!ai(E,b,oe).is(ne))return!0;return!1}for(const j of F){if(j.stateVersions.get(b.version)||!X(j.depValuesDiscoveredSoFarDuringAsyncWork))return j.stateVersions.set(b.version,!0),j;j.stateVersions.set(b.version,!1)}}function Y(E){return u.get(E)}function me(E,b,F,X,j){u.set(E,{depValuesDiscoveredSoFarDuringAsyncWork:X,executionID:b,loadingLoadable:F,stateVersions:new Map([[j.version,!0]])})}function ue(E,b,F){if(le(E,b)){const X=Y(E);X!=null&&(X.depValuesDiscoveredSoFarDuringAsyncWork=F)}}function z(E){u.delete(E)}function le(E,b){var F;return b===((F=Y(E))===null||F===void 0?void 0:F.executionID)}function Ee(E){return Array.from(E.entries()).map(([b,F])=>[b,F.contents])}function ge(E,b,F){E.atomValues.set(n,b);try{l.set(Ee(F),b)}catch(X){throw de(`Problem with setting cache for selector "${n}": ${X.message}`)}}function we(E){if(Oo.includes(n)){const b=`Recoil selector has circular dependencies: ${Oo.slice(Oo.indexOf(n)).join(" → ")}`;return li(de(b))}Oo.push(n);try{return E()}finally{Oo.pop()}}function V(E,b){const F=b.atomValues.get(n);return F??l.get(X=>{var j;return typeof X!="string"&&Bo(!1),(j=Fx(E,b,X))===null||j===void 0?void 0:j.contents})}function $(E,b){return we(()=>O(E,b))}function H(E){E.atomValues.delete(n)}function ce(E,b){t==null&&Bo(!1);for(const X of i){var F;const j=Vx(X);(F=j.clearCache)===null||F===void 0||F.call(j,E,b)}i.clear(),H(b),l.clear(),Dh(E,t)}return s!=null?t=Fh({key:n,nodeType:"selector",peek:V,get:$,set:(b,F,X)=>{let j=!1;const oe=new Map;function ne({key:Se}){if(j)throw de("Recoil: Async selector sets are not currently supported.");const Ce=ai(b,F,Se);if(Ce.state==="hasValue")return Ce.contents;if(Ce.state==="loading"){const _t=`Getting value of asynchronous atom or selector "${Se}" in a pending state while setting selector "${n}" is not yet supported.`;throw de(_t)}else throw Ce.contents}function ee(Se,Ce){if(j)throw de("Recoil: Async selector sets are not currently supported.");const _t=typeof Ce=="function"?Ce(ne(Se)):Ce;Dx(b,F,Se.key,_t).forEach((nt,g)=>oe.set(g,nt))}function _e(Se){ee(Se,Ux)}const ze=s({set:ee,get:ne,reset:_e},X);if(ze!==void 0)throw Pe(ze)?de("Recoil: Async selector sets are not currently supported."):de("Recoil: selector set should be a void function.");return j=!0,oe},init:h,invalidate:H,clearCache:ce,shouldDeleteConfigOnRelease:S,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:a}):t=Fh({key:n,nodeType:"selector",peek:V,get:$,init:h,invalidate:H,clearCache:ce,shouldDeleteConfigOnRelease:S,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:a})}Qv.value=e=>new Hv(e);var so=Qv;const{isLoadable:Wx,loadableWithError:za,loadableWithPromise:Ha,loadableWithValue:Cr}=ks,{WrappedValue:qv}=jv,{peekNodeInfo:Qx}=Gn,{DEFAULT_VALUE:rr,DefaultValue:Tn,getConfigDeletionHandler:Kv,registerNode:qx,setConfigDeletionHandler:Kx}=wt,{isRecoilValue:Gx}=no,{getRecoilValueAsLoadable:Yx,markRecoilValueModified:Jx,setRecoilValue:Mh,setRecoilValueLoadable:Xx}=rn,{retainedByOptionWithDefault:Zx}=_r,bo=e=>e instanceof qv?e.value:e;function eT(e){const{key:t,persistence_UNSTABLE:n}=e,r=Zx(e.retainedBy_UNSTABLE);let o=0;function s(d){return Ha(d.then(m=>(i=Cr(m),m)).catch(m=>{throw i=za(m),m}))}let i=Pe(e.default)?s(e.default):Wx(e.default)?e.default.state==="loading"?s(e.default.contents):e.default:Cr(bo(e.default));i.contents;let l;const a=new Map;function u(d){return d}function c(d,m){const R=m.then(k=>{var A,N;return((N=((A=d.getState().nextTree)!==null&&A!==void 0?A:d.getState().currentTree).atomValues.get(t))===null||N===void 0?void 0:N.contents)===R&&Mh(d,y,k),k}).catch(k=>{var A,N;throw((N=((A=d.getState().nextTree)!==null&&A!==void 0?A:d.getState().currentTree).atomValues.get(t))===null||N===void 0?void 0:N.contents)===R&&Xx(d,y,za(k)),k});return R}function f(d,m,R){var k;o++;const A=()=>{var z;o--,(z=a.get(d))===null||z===void 0||z.forEach(le=>le()),a.delete(d)};if(d.getState().knownAtoms.add(t),i.state==="loading"){const z=()=>{var le;((le=d.getState().nextTree)!==null&&le!==void 0?le:d.getState().currentTree).atomValues.has(t)||Jx(d,y)};i.contents.finally(z)}const N=(k=e.effects)!==null&&k!==void 0?k:e.effects_UNSTABLE;if(N!=null){let we=function(b){if(le&&b.key===t){const F=z;return F instanceof Tn?h(d,m):Pe(F)?Ha(F.then(X=>X instanceof Tn?i.toPromise():X)):Cr(F)}return Yx(d,b)},V=function(b){return we(b).toPromise()},$=function(b){var F;const X=Qx(d,(F=d.getState().nextTree)!==null&&F!==void 0?F:d.getState().currentTree,b.key);return le&&b.key===t&&!(z instanceof Tn)?{...X,isSet:!0,loadable:we(b)}:X};var Y=we,me=V,ue=$;let z=rr,le=!0,Ee=!1,ge=null;const H=b=>F=>{if(le){const X=we(y),j=X.state==="hasValue"?X.contents:rr;z=typeof F=="function"?F(j):F,Pe(z)&&(z=z.then(oe=>(ge={effect:b,value:oe},oe)))}else{if(Pe(F))throw de("Setting atoms to async values is not implemented.");typeof F!="function"&&(ge={effect:b,value:bo(F)}),Mh(d,y,typeof F=="function"?X=>{const j=bo(F(X));return ge={effect:b,value:j},j}:bo(F))}},ce=b=>()=>H(b)(rr),E=b=>F=>{var X;const{release:j}=d.subscribeToTransactions(oe=>{var ne;let{currentTree:ee,previousTree:_e}=oe.getState();_e||(_e=ee);const ze=(ne=ee.atomValues.get(t))!==null&&ne!==void 0?ne:i;if(ze.state==="hasValue"){var Se,Ce,_t,Gt;const nt=ze.contents,g=(Se=_e.atomValues.get(t))!==null&&Se!==void 0?Se:i,T=g.state==="hasValue"?g.contents:rr;((Ce=ge)===null||Ce===void 0?void 0:Ce.effect)!==b||((_t=ge)===null||_t===void 0?void 0:_t.value)!==nt?F(nt,T,!ee.atomValues.has(t)):((Gt=ge)===null||Gt===void 0?void 0:Gt.effect)===b&&(ge=null)}},t);a.set(d,[...(X=a.get(d))!==null&&X!==void 0?X:[],j])};for(const b of N)try{const F=b({node:y,storeID:d.storeID,parentStoreID_UNSTABLE:d.parentStoreID,trigger:R,setSelf:H(b),resetSelf:ce(b),onSet:E(b),getPromise:V,getLoadable:we,getInfo_UNSTABLE:$});if(F!=null){var O;a.set(d,[...(O=a.get(d))!==null&&O!==void 0?O:[],F])}}catch(F){z=F,Ee=!0}if(le=!1,!(z instanceof Tn)){var Z;const b=Ee?za(z):Pe(z)?Ha(c(d,z)):Cr(bo(z));b.contents,m.atomValues.set(t,b),(Z=d.getState().nextTree)===null||Z===void 0||Z.atomValues.set(t,b)}}return A}function h(d,m){var R,k;return(R=(k=m.atomValues.get(t))!==null&&k!==void 0?k:l)!==null&&R!==void 0?R:i}function S(d,m){if(m.atomValues.has(t))return De(m.atomValues.get(t));if(m.nonvalidatedAtoms.has(t)){if(l!=null)return l;if(n==null)return i;const R=m.nonvalidatedAtoms.get(t),k=n.validator(R,rr);return l=k instanceof Tn?i:Cr(k),l}else return i}function p(){l=void 0}function v(d,m,R){if(m.atomValues.has(t)){const k=De(m.atomValues.get(t));if(k.state==="hasValue"&&R===k.contents)return new Map}else if(!m.nonvalidatedAtoms.has(t)&&R instanceof Tn)return new Map;return l=void 0,new Map().set(t,Cr(R))}function x(){return Kv(t)!==void 0&&o<=0}const y=qx({key:t,nodeType:"atom",peek:h,get:S,set:v,init:f,invalidate:p,shouldDeleteConfigOnRelease:x,dangerouslyAllowMutability:e.dangerouslyAllowMutability,persistence_UNSTABLE:e.persistence_UNSTABLE?{type:e.persistence_UNSTABLE.type,backButton:e.persistence_UNSTABLE.backButton}:void 0,shouldRestoreFromSnapshots:!0,retainedBy:r});return y}function Of(e){const{...t}=e,n="default"in e?e.default:new Promise(()=>{});return Gx(n)?tT({...t,default:n}):eT({...t,default:n})}function tT(e){const t=Of({...e,default:rr,persistence_UNSTABLE:e.persistence_UNSTABLE===void 0?void 0:{...e.persistence_UNSTABLE,validator:r=>r instanceof Tn?r:De(e.persistence_UNSTABLE).validator(r,rr)},effects:e.effects,effects_UNSTABLE:e.effects_UNSTABLE}),n=so({key:`${e.key}__withFallback`,get:({get:r})=>{const o=r(t);return o instanceof Tn?e.default:o},set:({set:r},o)=>r(t,o),cachePolicy_UNSTABLE:{eviction:"most-recent"},dangerouslyAllowMutability:e.dangerouslyAllowMutability});return Kx(n.key,Kv(e.key)),n}Of.value=e=>new qv(e);var Gv=Of;class nT{constructor(t){var n;fe(this,"_map",void 0),fe(this,"_keyMapper",void 0),this._map=new Map,this._keyMapper=(n=t==null?void 0:t.mapKey)!==null&&n!==void 0?n:r=>r}size(){return this._map.size}has(t){return this._map.has(this._keyMapper(t))}get(t){return this._map.get(this._keyMapper(t))}set(t,n){this._map.set(this._keyMapper(t),n)}delete(t){this._map.delete(this._keyMapper(t))}clear(){this._map.clear()}}var rT={MapCache:nT},oT=rT.MapCache,sT=Object.freeze({__proto__:null,MapCache:oT});const{LRUCache:Uh}=zv,{MapCache:iT}=sT,ci={equality:"reference",eviction:"none",maxSize:1/0};function lT({equality:e=ci.equality,eviction:t=ci.eviction,maxSize:n=ci.maxSize}=ci){const r=aT(e);return uT(t,n,r)}function aT(e){switch(e){case"reference":return t=>t;case"value":return t=>Zl(t)}throw de(`Unrecognized equality policy ${e}`)}function uT(e,t,n){switch(e){case"keep-all":return new iT({mapKey:n});case"lru":return new Uh({mapKey:n,maxSize:De(t)});case"most-recent":return new Uh({mapKey:n,maxSize:1})}throw de(`Unrecognized eviction policy ${e}`)}var Yv=lT;const{setConfigDeletionHandler:cT}=wt;function fT(e){var t,n;const r=Yv({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return o=>{var s,i;const l=r.get(o);if(l!=null)return l;const{cachePolicyForParams_UNSTABLE:a,...u}=e,c="default"in e?e.default:new Promise(()=>{}),f=Gv({...u,key:`${e.key}__${(s=Zl(o))!==null&&s!==void 0?s:"void"}`,default:typeof c=="function"?c(o):c,retainedBy_UNSTABLE:typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(o):e.retainedBy_UNSTABLE,effects:typeof e.effects=="function"?e.effects(o):typeof e.effects_UNSTABLE=="function"?e.effects_UNSTABLE(o):(i=e.effects)!==null&&i!==void 0?i:e.effects_UNSTABLE});return r.set(o,f),cT(f.key,()=>{r.delete(o)}),f}}var dT=fT;const{setConfigDeletionHandler:hT}=wt;let pT=0;function mT(e){var t,n;const r=Yv({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return o=>{var s;let i;try{i=r.get(o)}catch(h){throw de(`Problem with cache lookup for selector ${e.key}: ${h.message}`)}if(i!=null)return i;const l=`${e.key}__selectorFamily/${(s=Zl(o,{allowFunctions:!0}))!==null&&s!==void 0?s:"void"}/${pT++}`,a=h=>e.get(o)(h),u=e.cachePolicy_UNSTABLE,c=typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(o):e.retainedBy_UNSTABLE;let f;if(e.set!=null){const h=e.set;f=so({key:l,get:a,set:(p,v)=>h(o)(p,v),cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c})}else f=so({key:l,get:a,cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c});return r.set(o,f),hT(f.key,()=>{r.delete(o)}),f}}var Yn=mT;const yT=Yn({key:"__constant",get:e=>()=>e,cachePolicyForParams_UNSTABLE:{equality:"reference"}});function vT(e){return yT(e)}var gT=vT;const ST=Yn({key:"__error",get:e=>()=>{throw de(e)},cachePolicyForParams_UNSTABLE:{equality:"reference"}});function wT(e){return ST(e)}var _T=wT;function RT(e){return e}var ET=RT;const{loadableWithError:Jv,loadableWithPromise:Xv,loadableWithValue:Zv}=ks;function ea(e,t){const n=Array(t.length).fill(void 0),r=Array(t.length).fill(void 0);for(const[o,s]of t.entries())try{n[o]=e(s)}catch(i){r[o]=i}return[n,r]}function CT(e){return e!=null&&!Pe(e)}function ta(e){return Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(t=>e[t])}function ic(e,t){return Array.isArray(e)?t:Object.getOwnPropertyNames(e).reduce((n,r,o)=>({...n,[r]:t[o]}),{})}function qr(e,t,n){const r=n.map((o,s)=>o==null?Zv(t[s]):Pe(o)?Xv(o):Jv(o));return ic(e,r)}function xT(e,t){return t.map((n,r)=>n===void 0?e[r]:n)}const TT=Yn({key:"__waitForNone",get:e=>({get:t})=>{const n=ta(e),[r,o]=ea(t,n);return qr(e,r,o)},dangerouslyAllowMutability:!0}),kT=Yn({key:"__waitForAny",get:e=>({get:t})=>{const n=ta(e),[r,o]=ea(t,n);return o.some(s=>!Pe(s))?qr(e,r,o):new Promise(s=>{for(const[i,l]of o.entries())Pe(l)&&l.then(a=>{r[i]=a,o[i]=void 0,s(qr(e,r,o))}).catch(a=>{o[i]=a,s(qr(e,r,o))})})},dangerouslyAllowMutability:!0}),NT=Yn({key:"__waitForAll",get:e=>({get:t})=>{const n=ta(e),[r,o]=ea(t,n);if(o.every(i=>i==null))return ic(e,r);const s=o.find(CT);if(s!=null)throw s;return Promise.all(o).then(i=>ic(e,xT(r,i)))},dangerouslyAllowMutability:!0}),AT=Yn({key:"__waitForAllSettled",get:e=>({get:t})=>{const n=ta(e),[r,o]=ea(t,n);return o.every(s=>!Pe(s))?qr(e,r,o):Promise.all(o.map((s,i)=>Pe(s)?s.then(l=>{r[i]=l,o[i]=void 0}).catch(l=>{r[i]=void 0,o[i]=l}):null)).then(()=>qr(e,r,o))},dangerouslyAllowMutability:!0}),LT=Yn({key:"__noWait",get:e=>({get:t})=>{try{return so.value(Zv(t(e)))}catch(n){return so.value(Pe(n)?Xv(n):Jv(n))}},dangerouslyAllowMutability:!0});var PT={waitForNone:TT,waitForAny:kT,waitForAll:NT,waitForAllSettled:AT,noWait:LT};const{RecoilLoadable:OT}=ks,{DefaultValue:bT}=wt,{RecoilRoot:FT,useRecoilStoreID:DT}=wn,{isRecoilValue:MT}=no,{retentionZone:UT}=Bl,{freshSnapshot:IT}=Kl,{useRecoilState:VT,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:$T,useRecoilStateLoadable:jT,useRecoilValue:BT,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:zT,useRecoilValueLoadable:HT,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:WT,useResetRecoilState:QT,useSetRecoilState:qT}=rC,{useGotoRecoilSnapshot:KT,useRecoilSnapshot:GT,useRecoilTransactionObserver:YT}=Mv,{useRecoilCallback:JT}=$v,{noWait:XT,waitForAll:ZT,waitForAllSettled:ek,waitForAny:tk,waitForNone:nk}=PT;var bf={DefaultValue:bT,isRecoilValue:MT,RecoilLoadable:OT,RecoilEnv:ho,RecoilRoot:FT,useRecoilStoreID:DT,useRecoilBridgeAcrossReactRoots_UNSTABLE:LC,atom:Gv,selector:so,atomFamily:dT,selectorFamily:Yn,constSelector:gT,errorSelector:_T,readOnlySelector:ET,noWait:XT,waitForNone:nk,waitForAny:tk,waitForAll:ZT,waitForAllSettled:ek,useRecoilValue:BT,useRecoilValueLoadable:HT,useRecoilState:VT,useRecoilStateLoadable:jT,useSetRecoilState:qT,useResetRecoilState:QT,useGetRecoilValueInfo_UNSTABLE:CC,useRecoilRefresher_UNSTABLE:sx,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:WT,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:zT,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:$T,useRecoilCallback:JT,useRecoilTransaction_UNSTABLE:cx,useGotoRecoilSnapshot:KT,useRecoilSnapshot:GT,useRecoilTransactionObserver_UNSTABLE:YT,snapshot_UNSTABLE:IT,useRetain:kf,retentionZone:UT},rk=bf.RecoilRoot,Ff=bf.atom,Wn=bf.useRecoilState;class mo{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){const n={listener:t};return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const Ss=typeof window>"u"||"Deno"in window;function At(){}function ok(e,t){return typeof e=="function"?e(t):e}function lc(e){return typeof e=="number"&&e>=0&&e!==1/0}function eg(e,t){return Math.max(e+(t||0)-Date.now(),0)}function zo(e,t,n){return bs(e)?typeof t=="function"?{...n,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function sk(e,t,n){return bs(e)?typeof t=="function"?{...n,mutationKey:e,mutationFn:t}:{...t,mutationKey:e}:typeof e=="function"?{...t,mutationFn:e}:{...e}}function kn(e,t,n){return bs(e)?[{...t,queryKey:e},n]:[e||{},t]}function Ih(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:l}=e;if(bs(i)){if(r){if(t.queryHash!==Df(i,t.options))return!1}else if(!ll(t.queryKey,i))return!1}if(n!=="all"){const a=t.isActive();if(n==="active"&&!a||n==="inactive"&&a)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||typeof o<"u"&&o!==t.state.fetchStatus||s&&!s(t))}function Vh(e,t){const{exact:n,fetching:r,predicate:o,mutationKey:s}=e;if(bs(s)){if(!t.options.mutationKey)return!1;if(n){if(lr(t.options.mutationKey)!==lr(s))return!1}else if(!ll(t.options.mutationKey,s))return!1}return!(typeof r=="boolean"&&t.state.status==="loading"!==r||o&&!o(t))}function Df(e,t){return((t==null?void 0:t.queryKeyHashFn)||lr)(e)}function lr(e){return JSON.stringify(e,(t,n)=>ac(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function ll(e,t){return tg(e,t)}function tg(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!tg(e[n],t[n])):!1}function ng(e,t){if(e===t)return e;const n=$h(e)&&$h(t);if(n||ac(e)&&ac(t)){const r=n?e.length:Object.keys(e).length,o=n?t:Object.keys(t),s=o.length,i=n?[]:{};let l=0;for(let a=0;a"u")return!0;const n=t.prototype;return!(!jh(n)||!n.hasOwnProperty("isPrototypeOf"))}function jh(e){return Object.prototype.toString.call(e)==="[object Object]"}function bs(e){return Array.isArray(e)}function rg(e){return new Promise(t=>{setTimeout(t,e)})}function Bh(e){rg(0).then(e)}function ik(){if(typeof AbortController=="function")return new AbortController}function uc(e,t,n){return n.isDataEqual!=null&&n.isDataEqual(e,t)?e:typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?ng(e,t):t}class lk extends mo{constructor(){super(),this.setup=t=>{if(!Ss&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),window.addEventListener("focus",n,!1),()=>{window.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(t){this.focused!==t&&(this.focused=t,this.onFocus())}onFocus(){this.listeners.forEach(({listener:t})=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const ul=new lk,zh=["online","offline"];class ak extends mo{constructor(){super(),this.setup=t=>{if(!Ss&&window.addEventListener){const n=()=>t();return zh.forEach(r=>{window.addEventListener(r,n,!1)}),()=>{zh.forEach(r=>{window.removeEventListener(r,n)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setOnline(r):this.onOnline()})}setOnline(t){this.online!==t&&(this.online=t,this.onOnline())}onOnline(){this.listeners.forEach(({listener:t})=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const cl=new ak;function uk(e){return Math.min(1e3*2**e,3e4)}function na(e){return(e??"online")==="online"?cl.isOnline():!0}class og{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function Ci(e){return e instanceof og}function sg(e){let t=!1,n=0,r=!1,o,s,i;const l=new Promise((x,y)=>{s=x,i=y}),a=x=>{r||(S(new og(x)),e.abort==null||e.abort())},u=()=>{t=!0},c=()=>{t=!1},f=()=>!ul.isFocused()||e.networkMode!=="always"&&!cl.isOnline(),h=x=>{r||(r=!0,e.onSuccess==null||e.onSuccess(x),o==null||o(),s(x))},S=x=>{r||(r=!0,e.onError==null||e.onError(x),o==null||o(),i(x))},p=()=>new Promise(x=>{o=y=>{const d=r||!f();return d&&x(y),d},e.onPause==null||e.onPause()}).then(()=>{o=void 0,r||e.onContinue==null||e.onContinue()}),v=()=>{if(r)return;let x;try{x=e.fn()}catch(y){x=Promise.reject(y)}Promise.resolve(x).then(h).catch(y=>{var d,m;if(r)return;const R=(d=e.retry)!=null?d:3,k=(m=e.retryDelay)!=null?m:uk,A=typeof k=="function"?k(n,y):k,N=R===!0||typeof R=="number"&&n{if(f())return p()}).then(()=>{t?S(y):v()})})};return na(e.networkMode)?v():p().then(v),{promise:l,cancel:a,continue:()=>(o==null?void 0:o())?l:Promise.resolve(),cancelRetry:u,continueRetry:c}}const Mf=console;function ck(){let e=[],t=0,n=c=>{c()},r=c=>{c()};const o=c=>{let f;t++;try{f=c()}finally{t--,t||l()}return f},s=c=>{t?e.push(c):Bh(()=>{n(c)})},i=c=>(...f)=>{s(()=>{c(...f)})},l=()=>{const c=e;e=[],c.length&&Bh(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:o,batchCalls:i,schedule:s,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c}}}const $e=ck();class ig{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),lc(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t??(Ss?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class fk extends ig{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||Mf,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||dk(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,n){const r=uc(this.state.data,t,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){this.dispatch({type:"setState",state:t,setStateOptions:n})}cancel(t){var n;const r=this.promise;return(n=this.retryer)==null||n.cancel(t),r?r.then(At).catch(At):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!eg(this.state.dataUpdatedAt,t)}onFocus(){var t;const n=this.observers.find(r=>r.shouldFetchOnWindowFocus());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}onOnline(){var t;const n=this.observers.find(r=>r.shouldFetchOnReconnect());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,n){var r,o;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&n!=null&&n.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var s;return(s=this.retryer)==null||s.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(p=>p.options.queryFn);S&&this.setOptions(S.options)}const i=ik(),l={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},a=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>{if(i)return this.abortSignalConsumed=!0,i.signal}})};a(l);const u=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(l)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),c={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:u};if(a(c),(r=this.options.behavior)==null||r.onFetch(c),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((o=c.fetchOptions)==null?void 0:o.meta)){var f;this.dispatch({type:"fetch",meta:(f=c.fetchOptions)==null?void 0:f.meta})}const h=S=>{if(Ci(S)&&S.silent||this.dispatch({type:"error",error:S}),!Ci(S)){var p,v,x,y;(p=(v=this.cache.config).onError)==null||p.call(v,S,this),(x=(y=this.cache.config).onSettled)==null||x.call(y,this.state.data,S,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=sg({fn:c.fetchFn,abort:i==null?void 0:i.abort.bind(i),onSuccess:S=>{var p,v,x,y;if(typeof S>"u"){h(new Error(this.queryHash+" data is undefined"));return}this.setData(S),(p=(v=this.cache.config).onSuccess)==null||p.call(v,S,this),(x=(y=this.cache.config).onSettled)==null||x.call(y,S,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:h,onFail:(S,p)=>{this.dispatch({type:"failed",failureCount:S,error:p})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const n=r=>{var o,s;switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(o=t.meta)!=null?o:null,fetchStatus:na(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(s=t.dataUpdatedAt)!=null?s:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return Ci(i)&&i.revert&&this.revertState?{...this.revertState,fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),$e.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function dk(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"loading",fetchStatus:"idle"}}class hk extends mo{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,n,r){var o;const s=n.queryKey,i=(o=n.queryHash)!=null?o:Df(s,n);let l=this.get(i);return l||(l=new fk({cache:this,logger:t.getLogger(),queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(l)),l}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){const n=this.queriesMap[t.queryHash];n&&(t.destroy(),this.queries=this.queries.filter(r=>r!==t),n===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){$e.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,n){const[r]=kn(t,n);return typeof r.exact>"u"&&(r.exact=!0),this.queries.find(o=>Ih(r,o))}findAll(t,n){const[r]=kn(t,n);return Object.keys(r).length>0?this.queries.filter(o=>Ih(r,o)):this.queries}notify(t){$e.batch(()=>{this.listeners.forEach(({listener:n})=>{n(t)})})}onFocus(){$e.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){$e.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class pk extends ig{constructor(t){super(),this.defaultOptions=t.defaultOptions,this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||Mf,this.observers=[],this.state=t.state||lg(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(n=>n!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var t,n;return(t=(n=this.retryer)==null?void 0:n.continue())!=null?t:this.execute()}async execute(){const t=()=>{var N;return this.retryer=sg({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(O,Z)=>{this.dispatch({type:"failed",failureCount:O,error:Z})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(N=this.options.retry)!=null?N:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},n=this.state.status==="loading";try{var r,o,s,i,l,a,u,c;if(!n){var f,h,S,p;this.dispatch({type:"loading",variables:this.options.variables}),await((f=(h=this.mutationCache.config).onMutate)==null?void 0:f.call(h,this.state.variables,this));const O=await((S=(p=this.options).onMutate)==null?void 0:S.call(p,this.state.variables));O!==this.state.context&&this.dispatch({type:"loading",context:O,variables:this.state.variables})}const N=await t();return await((r=(o=this.mutationCache.config).onSuccess)==null?void 0:r.call(o,N,this.state.variables,this.state.context,this)),await((s=(i=this.options).onSuccess)==null?void 0:s.call(i,N,this.state.variables,this.state.context)),await((l=(a=this.mutationCache.config).onSettled)==null?void 0:l.call(a,N,null,this.state.variables,this.state.context,this)),await((u=(c=this.options).onSettled)==null?void 0:u.call(c,N,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:N}),N}catch(N){try{var v,x,y,d,m,R,k,A;throw await((v=(x=this.mutationCache.config).onError)==null?void 0:v.call(x,N,this.state.variables,this.state.context,this)),await((y=(d=this.options).onError)==null?void 0:y.call(d,N,this.state.variables,this.state.context)),await((m=(R=this.mutationCache.config).onSettled)==null?void 0:m.call(R,void 0,N,this.state.variables,this.state.context,this)),await((k=(A=this.options).onSettled)==null?void 0:k.call(A,void 0,N,this.state.variables,this.state.context)),N}finally{this.dispatch({type:"error",error:N})}}}dispatch(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"loading":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!na(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...r,...t.state}}};this.state=n(this.state),$e.batch(()=>{this.observers.forEach(r=>{r.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function lg(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class mk extends mo{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,n,r){const o=new pk({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(n),state:r,defaultOptions:n.mutationKey?t.getMutationDefaults(n.mutationKey):void 0});return this.add(o),o}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(n=>n!==t),this.notify({type:"removed",mutation:t})}clear(){$e.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return typeof t.exact>"u"&&(t.exact=!0),this.mutations.find(n=>Vh(t,n))}findAll(t){return this.mutations.filter(n=>Vh(t,n))}notify(t){$e.batch(()=>{this.listeners.forEach(({listener:n})=>{n(t)})})}resumePausedMutations(){var t;return this.resuming=((t=this.resuming)!=null?t:Promise.resolve()).then(()=>{const n=this.mutations.filter(r=>r.state.isPaused);return $e.batch(()=>n.reduce((r,o)=>r.then(()=>o.continue().catch(At)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function yk(){return{onFetch:e=>{e.fetchFn=()=>{var t,n,r,o,s,i;const l=(t=e.fetchOptions)==null||(n=t.meta)==null?void 0:n.refetchPage,a=(r=e.fetchOptions)==null||(o=r.meta)==null?void 0:o.fetchMore,u=a==null?void 0:a.pageParam,c=(a==null?void 0:a.direction)==="forward",f=(a==null?void 0:a.direction)==="backward",h=((s=e.state.data)==null?void 0:s.pages)||[],S=((i=e.state.data)==null?void 0:i.pageParams)||[];let p=S,v=!1;const x=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>{var N;if((N=e.signal)!=null&&N.aborted)v=!0;else{var O;(O=e.signal)==null||O.addEventListener("abort",()=>{v=!0})}return e.signal}})},y=e.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+e.options.queryHash+"'")),d=(A,N,O,Z)=>(p=Z?[N,...p]:[...p,N],Z?[O,...A]:[...A,O]),m=(A,N,O,Z)=>{if(v)return Promise.reject("Cancelled");if(typeof O>"u"&&!N&&A.length)return Promise.resolve(A);const Y={queryKey:e.queryKey,pageParam:O,meta:e.options.meta};x(Y);const me=y(Y);return Promise.resolve(me).then(z=>d(A,O,z,Z))};let R;if(!h.length)R=m([]);else if(c){const A=typeof u<"u",N=A?u:Hh(e.options,h);R=m(h,A,N)}else if(f){const A=typeof u<"u",N=A?u:vk(e.options,h);R=m(h,A,N,!0)}else{p=[];const A=typeof e.options.getNextPageParam>"u";R=(l&&h[0]?l(h[0],0,h):!0)?m([],A,S[0]):Promise.resolve(d([],S[0],h[0]));for(let O=1;O{if(l&&h[O]?l(h[O],O,h):!0){const me=A?S[O]:Hh(e.options,Z);return m(Z,A,me)}return Promise.resolve(d(Z,S[O],h[O]))})}return R.then(A=>({pages:A,pageParams:p}))}}}}function Hh(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function vk(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class gk{constructor(t={}){this.queryCache=t.queryCache||new hk,this.mutationCache=t.mutationCache||new mk,this.logger=t.logger||Mf,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=ul.subscribe(()=>{ul.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=cl.subscribe(()=>{cl.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,n;this.mountCount--,this.mountCount===0&&((t=this.unsubscribeFocus)==null||t.call(this),this.unsubscribeFocus=void 0,(n=this.unsubscribeOnline)==null||n.call(this),this.unsubscribeOnline=void 0)}isFetching(t,n){const[r]=kn(t,n);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state.data}ensureQueryData(t,n,r){const o=zo(t,n,r),s=this.getQueryData(o.queryKey);return s?Promise.resolve(s):this.fetchQuery(o)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:n,state:r})=>{const o=r.data;return[n,o]})}setQueryData(t,n,r){const o=this.queryCache.find(t),s=o==null?void 0:o.state.data,i=ok(n,s);if(typeof i>"u")return;const l=zo(t),a=this.defaultQueryOptions(l);return this.queryCache.build(this,a).setData(i,{...r,manual:!0})}setQueriesData(t,n,r){return $e.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:o})=>[o,this.setQueryData(o,n,r)]))}getQueryState(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state}removeQueries(t,n){const[r]=kn(t,n),o=this.queryCache;$e.batch(()=>{o.findAll(r).forEach(s=>{o.remove(s)})})}resetQueries(t,n,r){const[o,s]=kn(t,n,r),i=this.queryCache,l={type:"active",...o};return $e.batch(()=>(i.findAll(o).forEach(a=>{a.reset()}),this.refetchQueries(l,s)))}cancelQueries(t,n,r){const[o,s={}]=kn(t,n,r);typeof s.revert>"u"&&(s.revert=!0);const i=$e.batch(()=>this.queryCache.findAll(o).map(l=>l.cancel(s)));return Promise.all(i).then(At).catch(At)}invalidateQueries(t,n,r){const[o,s]=kn(t,n,r);return $e.batch(()=>{var i,l;if(this.queryCache.findAll(o).forEach(u=>{u.invalidate()}),o.refetchType==="none")return Promise.resolve();const a={...o,type:(i=(l=o.refetchType)!=null?l:o.type)!=null?i:"active"};return this.refetchQueries(a,s)})}refetchQueries(t,n,r){const[o,s]=kn(t,n,r),i=$e.batch(()=>this.queryCache.findAll(o).filter(a=>!a.isDisabled()).map(a=>{var u;return a.fetch(void 0,{...s,cancelRefetch:(u=s==null?void 0:s.cancelRefetch)!=null?u:!0,meta:{refetchPage:o.refetchPage}})}));let l=Promise.all(i).then(At);return s!=null&&s.throwOnError||(l=l.catch(At)),l}fetchQuery(t,n,r){const o=zo(t,n,r),s=this.defaultQueryOptions(o);typeof s.retry>"u"&&(s.retry=!1);const i=this.queryCache.build(this,s);return i.isStaleByTime(s.staleTime)?i.fetch(s):Promise.resolve(i.state.data)}prefetchQuery(t,n,r){return this.fetchQuery(t,n,r).then(At).catch(At)}fetchInfiniteQuery(t,n,r){const o=zo(t,n,r);return o.behavior=yk(),this.fetchQuery(o)}prefetchInfiniteQuery(t,n,r){return this.fetchInfiniteQuery(t,n,r).then(At).catch(At)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,n){const r=this.queryDefaults.find(o=>lr(t)===lr(o.queryKey));r?r.defaultOptions=n:this.queryDefaults.push({queryKey:t,defaultOptions:n})}getQueryDefaults(t){if(!t)return;const n=this.queryDefaults.find(r=>ll(t,r.queryKey));return n==null?void 0:n.defaultOptions}setMutationDefaults(t,n){const r=this.mutationDefaults.find(o=>lr(t)===lr(o.mutationKey));r?r.defaultOptions=n:this.mutationDefaults.push({mutationKey:t,defaultOptions:n})}getMutationDefaults(t){if(!t)return;const n=this.mutationDefaults.find(r=>ll(t,r.mutationKey));return n==null?void 0:n.defaultOptions}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const n={...this.defaultOptions.queries,...this.getQueryDefaults(t==null?void 0:t.queryKey),...t,_defaulted:!0};return!n.queryHash&&n.queryKey&&(n.queryHash=Df(n.queryKey,n)),typeof n.refetchOnReconnect>"u"&&(n.refetchOnReconnect=n.networkMode!=="always"),typeof n.useErrorBoundary>"u"&&(n.useErrorBoundary=!!n.suspense),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(t==null?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class Sk extends mo{constructor(t,n){super(),this.client=t,this.options=n,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(n)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),Wh(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return cc(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return cc(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,n){const r=this.options,o=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),al(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();const s=this.hasListeners();s&&Qh(this.currentQuery,o,this.options,r)&&this.executeFetch(),this.updateResult(n),s&&(this.currentQuery!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const i=this.computeRefetchInterval();s&&(this.currentQuery!==o||this.options.enabled!==r.enabled||i!==this.currentRefetchInterval)&&this.updateRefetchInterval(i)}getOptimisticResult(t){const n=this.client.getQueryCache().build(this.client,t),r=this.createResult(n,t);return _k(this,r,t)&&(this.currentResult=r,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),r}getCurrentResult(){return this.currentResult}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),t[r])})}),n}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...n}={}){return this.fetch({...n,meta:{refetchPage:t}})}fetchOptimistic(t){const n=this.client.defaultQueryOptions(t),r=this.client.getQueryCache().build(this.client,n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){var n;return this.executeFetch({...t,cancelRefetch:(n=t.cancelRefetch)!=null?n:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let n=this.currentQuery.fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(At)),n}updateStaleTimeout(){if(this.clearStaleTimeout(),Ss||this.currentResult.isStale||!lc(this.options.staleTime))return;const n=eg(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},n)}computeRefetchInterval(){var t;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(t=this.options.refetchInterval)!=null?t:!1}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!(Ss||this.options.enabled===!1||!lc(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||ul.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,n){const r=this.currentQuery,o=this.options,s=this.currentResult,i=this.currentResultState,l=this.currentResultOptions,a=t!==r,u=a?t.state:this.currentQueryInitialState,c=a?this.currentResult:this.previousQueryResult,{state:f}=t;let{dataUpdatedAt:h,error:S,errorUpdatedAt:p,fetchStatus:v,status:x}=f,y=!1,d=!1,m;if(n._optimisticResults){const O=this.hasListeners(),Z=!O&&Wh(t,n),Y=O&&Qh(t,r,n,o);(Z||Y)&&(v=na(t.options.networkMode)?"fetching":"paused",h||(x="loading")),n._optimisticResults==="isRestoring"&&(v="idle")}if(n.keepPreviousData&&!f.dataUpdatedAt&&c!=null&&c.isSuccess&&x!=="error")m=c.data,h=c.dataUpdatedAt,x=c.status,y=!0;else if(n.select&&typeof f.data<"u")if(s&&f.data===(i==null?void 0:i.data)&&n.select===this.selectFn)m=this.selectResult;else try{this.selectFn=n.select,m=n.select(f.data),m=uc(s==null?void 0:s.data,m,n),this.selectResult=m,this.selectError=null}catch(O){this.selectError=O}else m=f.data;if(typeof n.placeholderData<"u"&&typeof m>"u"&&x==="loading"){let O;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))O=s.data;else if(O=typeof n.placeholderData=="function"?n.placeholderData():n.placeholderData,n.select&&typeof O<"u")try{O=n.select(O),this.selectError=null}catch(Z){this.selectError=Z}typeof O<"u"&&(x="success",m=uc(s==null?void 0:s.data,O,n),d=!0)}this.selectError&&(S=this.selectError,m=this.selectResult,p=Date.now(),x="error");const R=v==="fetching",k=x==="loading",A=x==="error";return{status:x,fetchStatus:v,isLoading:k,isSuccess:x==="success",isError:A,isInitialLoading:k&&R,data:m,dataUpdatedAt:h,error:S,errorUpdatedAt:p,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:R,isRefetching:R&&!k,isLoadingError:A&&f.dataUpdatedAt===0,isPaused:v==="paused",isPlaceholderData:d,isPreviousData:y,isRefetchError:A&&f.dataUpdatedAt!==0,isStale:Uf(t,n),refetch:this.refetch,remove:this.remove}}updateResult(t){const n=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,al(r,n))return;this.currentResult=r;const o={cache:!0},s=()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,l=typeof i=="function"?i():i;if(l==="all"||!l&&!this.trackedProps.size)return!0;const a=new Set(l??this.trackedProps);return this.options.useErrorBoundary&&a.add("error"),Object.keys(this.currentResult).some(u=>{const c=u;return this.currentResult[c]!==n[c]&&a.has(c)})};(t==null?void 0:t.listeners)!==!1&&s()&&(o.listeners=!0),this.notify({...o,...t})}updateQuery(){const t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;const n=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){const n={};t.type==="success"?n.onSuccess=!t.manual:t.type==="error"&&!Ci(t.error)&&(n.onError=!0),this.updateResult(n),this.hasListeners()&&this.updateTimers()}notify(t){$e.batch(()=>{if(t.onSuccess){var n,r,o,s;(n=(r=this.options).onSuccess)==null||n.call(r,this.currentResult.data),(o=(s=this.options).onSettled)==null||o.call(s,this.currentResult.data,null)}else if(t.onError){var i,l,a,u;(i=(l=this.options).onError)==null||i.call(l,this.currentResult.error),(a=(u=this.options).onSettled)==null||a.call(u,void 0,this.currentResult.error)}t.listeners&&this.listeners.forEach(({listener:c})=>{c(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function wk(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Wh(e,t){return wk(e,t)||e.state.dataUpdatedAt>0&&cc(e,t,t.refetchOnMount)}function cc(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Uf(e,t)}return!1}function Qh(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Uf(e,n)}function Uf(e,t){return e.isStaleByTime(t.staleTime)}function _k(e,t,n){return n.keepPreviousData?!1:n.placeholderData!==void 0?t.isPlaceholderData:!al(e.getCurrentResult(),t)}let Rk=class extends mo{constructor(t,n){super(),this.client=t,this.setOptions(n),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var n;const r=this.options;this.options=this.client.defaultMutationOptions(t),al(r,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),(n=this.currentMutation)==null||n.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.currentMutation)==null||t.removeObserver(this)}}onMutationUpdate(t){this.updateResult();const n={listeners:!0};t.type==="success"?n.onSuccess=!0:t.type==="error"&&(n.onError=!0),this.notify(n)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(t,n){return this.mutateOptions=n,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:typeof t<"u"?t:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){const t=this.currentMutation?this.currentMutation.state:lg(),n={...t,isLoading:t.status==="loading",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset};this.currentResult=n}notify(t){$e.batch(()=>{if(this.mutateOptions&&this.hasListeners()){if(t.onSuccess){var n,r,o,s;(n=(r=this.mutateOptions).onSuccess)==null||n.call(r,this.currentResult.data,this.currentResult.variables,this.currentResult.context),(o=(s=this.mutateOptions).onSettled)==null||o.call(s,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)}else if(t.onError){var i,l,a,u;(i=(l=this.mutateOptions).onError)==null||i.call(l,this.currentResult.error,this.currentResult.variables,this.currentResult.context),(a=(u=this.mutateOptions).onSettled)==null||a.call(u,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}}t.listeners&&this.listeners.forEach(({listener:c})=>{c(this.currentResult)})})}};var ag={exports:{}},ug={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -78,8 +78,8 @@ Error generating stack: `+s.message+` Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],o=0;o{const r=Xn("alert",{"alert-success":t==="success","alert-warning":t==="warning","alert-error":t==="error","alert-info":t==="info"});return _.jsx("div",{id:e,className:r,children:_.jsx("div",{className:"alert-body",children:_.jsx("p",{className:"alert-text",children:n})})})},yg=({id:e=void 0,className:t,children:n})=>{const r=Xn("button-group",t);return _.jsx("ul",{id:e,className:r,children:U.Children.map(n,(o,s)=>_.jsx("li",{className:"button-group-item",children:o},s))})},lo=({id:e,type:t="button",variant:n="primary",className:r,children:o,...s})=>{const i=Xn("btn rounded border-2 font-bold whitespace-nowrap",{"btn-primary":n==="primary","btn-secondary":n==="secondary"},r);return _.jsx("button",{id:e,type:t,className:i,...s,children:o})};function Gk({title:e,titleId:t,...n},r){return U.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?U.createElement("title",{id:t},e):null,U.createElement("path",{fillRule:"evenodd",d:"M4.5 12a1.5 1.5 0 113 0 1.5 1.5 0 01-3 0zm6 0a1.5 1.5 0 113 0 1.5 1.5 0 01-3 0zm6 0a1.5 1.5 0 113 0 1.5 1.5 0 01-3 0z",clipRule:"evenodd"}))}const Yk=U.forwardRef(Gk),Xk=Yk;function Jk({title:e,titleId:t,...n},r){return U.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?U.createElement("title",{id:t},e):null,U.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 011.06 0L12 10.94l5.47-5.47a.75.75 0 111.06 1.06L13.06 12l5.47 5.47a.75.75 0 11-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 01-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 010-1.06z",clipRule:"evenodd"}))}const Zk=U.forwardRef(Jk),eN=Zk,tN=({id:e,items:t})=>{const n=re.useRef(null);return _.jsxs("div",{className:"context-menu-container",id:e,tabIndex:0,ref:n,children:[_.jsx(Xk,{}),_.jsx("ul",{className:"context-menu",children:t.filter(r=>r.visible).map(r=>_.jsx("li",{children:_.jsx("a",{className:r.disabled?"disabled":"",onClick:o=>{var s;r.onClick&&!r.disabled&&(r.onClick(o),(s=n.current)==null||s.blur())},children:r.title})},`context-menu-item-${r.id}`))})]})},Fo=({id:e=void 0,errors:t,children:n})=>!n&&!t?_.jsx(_.Fragment,{}):_.jsx(_.Fragment,{children:n??(t==null?void 0:t.map((r,o)=>_.jsx("span",{id:`${e}-${o}`,className:"text-red",children:r},o)))}),Jn=({id:e=void 0,errors:t,className:n,children:r})=>{const o=!!(t&&t.length>0),s=Xn("form-group",{"form-group-error":o},n);return _.jsx("div",{id:e,className:s,children:r})},Zn=({htmlFor:e,required:t,children:n,...r})=>_.jsxs("label",{className:"label",htmlFor:e,...r,children:[n,t&&_.jsx("span",{className:"text-red",children:" *"})]}),dc=({title:e,setIsOpen:t,body:n,footer:r})=>_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"modal-overlay",onClick:()=>t(!1)}),_.jsx("div",{className:"modal-container",children:_.jsxs("div",{className:"modal-main",children:[_.jsxs("div",{className:"modal-heading",children:[_.jsx("h5",{className:"modal-title",children:e}),_.jsx("button",{className:"modal-close-btn",onClick:()=>t(!1),children:_.jsx(eN,{})})]}),_.jsx("div",{className:"modal-body",children:n}),r?_.jsx("div",{className:"modal-footer",children:r}):_.jsx(_.Fragment,{})]})})]}),Qa=({id:e,options:t,className:n,onChange:r,...o})=>{const s=Xn("select p-2",n);return _.jsx("select",{id:e,className:s,onChange:r,...o,children:t.map((i,l)=>_.jsx("option",{value:i.value,children:i.label},l))})},nN=({id:e,children:t,className:n})=>{const r=Xn("tag",n);return _.jsx("span",{id:e,className:r,children:t})},rN=({id:e,rows:t,className:n,onChange:r,...o})=>_.jsx("textarea",{className:Xn("text-area p-2",n),id:e,rows:t,onChange:r,...o}),xi=({id:e,name:t,className:n,type:r,onChange:o,...s})=>{const i=Xn("text-input p-2",n);return _.jsx("input",{id:e,name:t,className:i,type:r,onChange:o,...s})};Ff({key:"currentUser",default:void 0});const If=Ff({key:"currentJhData",default:{admin_access:!1,base_url:"/hub",options_form:!1,prefix:"/",user:"",xsrf_token:""}}),Fs=Ff({key:"currentNotification",default:void 0});function vg(e,t){return function(){return e.apply(t,arguments)}}const{toString:oN}=Object.prototype,{getPrototypeOf:Vf}=Object,oa=(e=>t=>{const n=oN.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),sn=e=>(e=e.toLowerCase(),t=>oa(t)===e),sa=e=>t=>typeof t===e,{isArray:yo}=Array,ws=sa("undefined");function sN(e){return e!==null&&!ws(e)&&e.constructor!==null&&!ws(e.constructor)&&Dt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const gg=sn("ArrayBuffer");function iN(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&gg(e.buffer),t}const lN=sa("string"),Dt=sa("function"),Sg=sa("number"),ia=e=>e!==null&&typeof e=="object",aN=e=>e===!0||e===!1,Ti=e=>{if(oa(e)!=="object")return!1;const t=Vf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},uN=sn("Date"),cN=sn("File"),fN=sn("Blob"),dN=sn("FileList"),hN=e=>ia(e)&&Dt(e.pipe),pN=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Dt(e.append)&&((t=oa(e))==="formdata"||t==="object"&&Dt(e.toString)&&e.toString()==="[object FormData]"))},mN=sn("URLSearchParams"),yN=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ds(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),yo(e))for(r=0,o=e.length;r0;)if(o=n[r],t===o.toLowerCase())return o;return null}const _g=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Rg=e=>!ws(e)&&e!==_g;function hc(){const{caseless:e}=Rg(this)&&this||{},t={},n=(r,o)=>{const s=e&&wg(t,o)||o;Ti(t[s])&&Ti(r)?t[s]=hc(t[s],r):Ti(r)?t[s]=hc({},r):yo(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r(Ds(t,(o,s)=>{n&&Dt(o)?e[s]=vg(o,n):e[s]=o},{allOwnKeys:r}),e),gN=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),SN=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},wN=(e,t,n,r)=>{let o,s,i;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!r||r(i,e,t))&&!l[i]&&(t[i]=e[i],l[i]=!0);e=n!==!1&&Vf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},_N=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},RN=e=>{if(!e)return null;if(yo(e))return e;let t=e.length;if(!Sg(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},EN=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Vf(Uint8Array)),CN=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},xN=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},TN=sn("HTMLFormElement"),kN=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Kh=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),NN=sn("RegExp"),Eg=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ds(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},AN=e=>{Eg(e,(t,n)=>{if(Dt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Dt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},LN=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return yo(e)?r(e):r(String(e).split(t)),n},PN=()=>{},ON=(e,t)=>(e=+e,Number.isFinite(e)?e:t),qa="abcdefghijklmnopqrstuvwxyz",Gh="0123456789",Cg={DIGIT:Gh,ALPHA:qa,ALPHA_DIGIT:qa+qa.toUpperCase()+Gh},bN=(e=16,t=Cg.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function FN(e){return!!(e&&Dt(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const DN=e=>{const t=new Array(10),n=(r,o)=>{if(ia(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=yo(r)?[]:{};return Ds(r,(i,l)=>{const a=n(i,o+1);!ws(a)&&(s[l]=a)}),t[o]=void 0,s}}return r};return n(e,0)},MN=sn("AsyncFunction"),UN=e=>e&&(ia(e)||Dt(e))&&Dt(e.then)&&Dt(e.catch),P={isArray:yo,isArrayBuffer:gg,isBuffer:sN,isFormData:pN,isArrayBufferView:iN,isString:lN,isNumber:Sg,isBoolean:aN,isObject:ia,isPlainObject:Ti,isUndefined:ws,isDate:uN,isFile:cN,isBlob:fN,isRegExp:NN,isFunction:Dt,isStream:hN,isURLSearchParams:mN,isTypedArray:EN,isFileList:dN,forEach:Ds,merge:hc,extend:vN,trim:yN,stripBOM:gN,inherits:SN,toFlatObject:wN,kindOf:oa,kindOfTest:sn,endsWith:_N,toArray:RN,forEachEntry:CN,matchAll:xN,isHTMLForm:TN,hasOwnProperty:Kh,hasOwnProp:Kh,reduceDescriptors:Eg,freezeMethods:AN,toObjectSet:LN,toCamelCase:kN,noop:PN,toFiniteNumber:ON,findKey:wg,global:_g,isContextDefined:Rg,ALPHABET:Cg,generateString:bN,isSpecCompliantForm:FN,toJSONObject:DN,isAsyncFn:MN,isThenable:UN};function ye(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}P.inherits(ye,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:P.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const xg=ye.prototype,Tg={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Tg[e]={value:e}});Object.defineProperties(ye,Tg);Object.defineProperty(xg,"isAxiosError",{value:!0});ye.from=(e,t,n,r,o,s)=>{const i=Object.create(xg);return P.toFlatObject(e,i,function(a){return a!==Error.prototype},l=>l!=="isAxiosError"),ye.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const IN=null;function pc(e){return P.isPlainObject(e)||P.isArray(e)}function kg(e){return P.endsWith(e,"[]")?e.slice(0,-2):e}function Yh(e,t,n){return e?e.concat(t).map(function(o,s){return o=kg(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function VN(e){return P.isArray(e)&&!e.some(pc)}const $N=P.toFlatObject(P,{},null,function(t){return/^is[A-Z]/.test(t)});function la(e,t,n){if(!P.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=P.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,x){return!P.isUndefined(x[v])});const r=n.metaTokens,o=n.visitor||c,s=n.dots,i=n.indexes,a=(n.Blob||typeof Blob<"u"&&Blob)&&P.isSpecCompliantForm(t);if(!P.isFunction(o))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(P.isDate(p))return p.toISOString();if(!a&&P.isBlob(p))throw new ye("Blob is not supported. Use a Buffer instead.");return P.isArrayBuffer(p)||P.isTypedArray(p)?a&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function c(p,v,x){let y=p;if(p&&!x&&typeof p=="object"){if(P.endsWith(v,"{}"))v=r?v:v.slice(0,-2),p=JSON.stringify(p);else if(P.isArray(p)&&VN(p)||(P.isFileList(p)||P.endsWith(v,"[]"))&&(y=P.toArray(p)))return v=kg(v),y.forEach(function(m,R){!(P.isUndefined(m)||m===null)&&t.append(i===!0?Yh([v],R,s):i===null?v:v+"[]",u(m))}),!1}return pc(p)?!0:(t.append(Yh(x,v,s),u(p)),!1)}const f=[],h=Object.assign($N,{defaultVisitor:c,convertValue:u,isVisitable:pc});function S(p,v){if(!P.isUndefined(p)){if(f.indexOf(p)!==-1)throw Error("Circular reference detected in "+v.join("."));f.push(p),P.forEach(p,function(y,d){(!(P.isUndefined(y)||y===null)&&o.call(t,y,P.isString(d)?d.trim():d,v,h))===!0&&S(y,v?v.concat(d):[d])}),f.pop()}}if(!P.isObject(e))throw new TypeError("data must be an object");return S(e),t}function Xh(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function $f(e,t){this._pairs=[],e&&la(e,this,t)}const Ng=$f.prototype;Ng.append=function(t,n){this._pairs.push([t,n])};Ng.toString=function(t){const n=t?function(r){return t.call(this,r,Xh)}:Xh;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function jN(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ag(e,t,n){if(!t)return e;const r=n&&n.encode||jN,o=n&&n.serialize;let s;if(o?s=o(t,n):s=P.isURLSearchParams(t)?t.toString():new $f(t,n).toString(r),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class BN{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){P.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Jh=BN,Lg={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zN=typeof URLSearchParams<"u"?URLSearchParams:$f,HN=typeof FormData<"u"?FormData:null,WN=typeof Blob<"u"?Blob:null,QN={isBrowser:!0,classes:{URLSearchParams:zN,FormData:HN,Blob:WN},protocols:["http","https","file","blob","url","data"]},Pg=typeof window<"u"&&typeof document<"u",qN=(e=>Pg&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),KN=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),GN=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Pg,hasStandardBrowserEnv:qN,hasStandardBrowserWebWorkerEnv:KN},Symbol.toStringTag,{value:"Module"})),Zt={...GN,...QN};function YN(e,t){return la(e,new Zt.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return Zt.isNode&&P.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function XN(e){return P.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function JN(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r=n.length;return i=!i&&P.isArray(o)?o.length:i,a?(P.hasOwnProp(o,i)?o[i]=[o[i],r]:o[i]=r,!l):((!o[i]||!P.isObject(o[i]))&&(o[i]=[]),t(n,r,o[i],s)&&P.isArray(o[i])&&(o[i]=JN(o[i])),!l)}if(P.isFormData(e)&&P.isFunction(e.entries)){const n={};return P.forEachEntry(e,(r,o)=>{t(XN(r),o,n,0)}),n}return null}function ZN(e,t,n){if(P.isString(e))try{return(t||JSON.parse)(e),P.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const jf={transitional:Lg,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=P.isObject(t);if(s&&P.isHTMLForm(t)&&(t=new FormData(t)),P.isFormData(t))return o&&o?JSON.stringify(Og(t)):t;if(P.isArrayBuffer(t)||P.isBuffer(t)||P.isStream(t)||P.isFile(t)||P.isBlob(t))return t;if(P.isArrayBufferView(t))return t.buffer;if(P.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return YN(t,this.formSerializer).toString();if((l=P.isFileList(t))||r.indexOf("multipart/form-data")>-1){const a=this.env&&this.env.FormData;return la(l?{"files[]":t}:t,a&&new a,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),ZN(t)):t}],transformResponse:[function(t){const n=this.transitional||jf.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(t&&P.isString(t)&&(r&&!this.responseType||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(l){if(i)throw l.name==="SyntaxError"?ye.from(l,ye.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Zt.classes.FormData,Blob:Zt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};P.forEach(["delete","get","head","post","put","patch"],e=>{jf.headers[e]={}});const Bf=jf,eA=P.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),tA=e=>{const t={};let n,r,o;return e&&e.split(` +*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],o=0;o{const r=Jn("alert",{"alert-success":t==="success","alert-warning":t==="warning","alert-error":t==="error","alert-info":t==="info"});return _.jsx("div",{id:e,className:r,children:_.jsx("div",{className:"alert-body",children:_.jsx("p",{className:"alert-text",children:n})})})},yg=({id:e=void 0,className:t,children:n})=>{const r=Jn("button-group",t);return _.jsx("ul",{id:e,className:r,children:U.Children.map(n,(o,s)=>_.jsx("li",{className:"button-group-item",children:o},s))})},lo=({id:e,type:t="button",variant:n="primary",className:r,children:o,...s})=>{const i=Jn("btn rounded border-2 font-bold whitespace-nowrap",{"btn-primary":n==="primary","btn-secondary":n==="secondary"},r);return _.jsx("button",{id:e,type:t,className:i,...s,children:o})};function Gk({title:e,titleId:t,...n},r){return U.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?U.createElement("title",{id:t},e):null,U.createElement("path",{fillRule:"evenodd",d:"M4.5 12a1.5 1.5 0 113 0 1.5 1.5 0 01-3 0zm6 0a1.5 1.5 0 113 0 1.5 1.5 0 01-3 0zm6 0a1.5 1.5 0 113 0 1.5 1.5 0 01-3 0z",clipRule:"evenodd"}))}const Yk=U.forwardRef(Gk),Jk=Yk;function Xk({title:e,titleId:t,...n},r){return U.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?U.createElement("title",{id:t},e):null,U.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 011.06 0L12 10.94l5.47-5.47a.75.75 0 111.06 1.06L13.06 12l5.47 5.47a.75.75 0 11-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 01-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 010-1.06z",clipRule:"evenodd"}))}const Zk=U.forwardRef(Xk),eN=Zk,tN=({id:e,items:t})=>{const n=re.useRef(null);return _.jsxs("div",{className:"context-menu-container",id:e,tabIndex:0,ref:n,children:[_.jsx(Jk,{}),_.jsx("ul",{className:"context-menu",children:t.filter(r=>r.visible).map(r=>_.jsx("li",{children:_.jsx("a",{className:r.disabled?"disabled":"",onClick:o=>{var s;r.onClick&&!r.disabled&&(r.onClick(o),(s=n.current)==null||s.blur())},children:r.title})},`context-menu-item-${r.id}`))})]})},Fo=({id:e=void 0,errors:t,children:n})=>!n&&!t?_.jsx(_.Fragment,{}):_.jsx(_.Fragment,{children:n??(t==null?void 0:t.map((r,o)=>_.jsx("span",{id:`${e}-${o}`,className:"text-red",children:r},o)))}),Xn=({id:e=void 0,errors:t,className:n,children:r})=>{const o=!!(t&&t.length>0),s=Jn("form-group",{"form-group-error":o},n);return _.jsx("div",{id:e,className:s,children:r})},Zn=({htmlFor:e,required:t,children:n,...r})=>_.jsxs("label",{className:"label",htmlFor:e,...r,children:[n,t&&_.jsx("span",{className:"text-red",children:" *"})]}),dc=({title:e,setIsOpen:t,body:n,footer:r})=>_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"modal-overlay",onClick:()=>t(!1)}),_.jsx("div",{className:"modal-container",children:_.jsxs("div",{className:"modal-main",children:[_.jsxs("div",{className:"modal-heading",children:[_.jsx("h5",{className:"modal-title",children:e}),_.jsx("button",{className:"modal-close-btn",onClick:()=>t(!1),children:_.jsx(eN,{})})]}),_.jsx("div",{className:"modal-body",children:n}),r?_.jsx("div",{className:"modal-footer",children:r}):_.jsx(_.Fragment,{})]})})]}),Qa=({id:e,options:t,className:n,onChange:r,...o})=>{const s=Jn("select p-2",n);return _.jsx("select",{id:e,className:s,onChange:r,...o,children:t.map((i,l)=>_.jsx("option",{value:i.value,children:i.label},l))})},nN=({id:e,children:t,className:n})=>{const r=Jn("tag",n);return _.jsx("span",{id:e,className:r,children:t})},rN=({id:e,rows:t,className:n,onChange:r,...o})=>_.jsx("textarea",{className:Jn("text-area p-2",n),id:e,rows:t,onChange:r,...o}),xi=({id:e,name:t,className:n,type:r,onChange:o,...s})=>{const i=Jn("text-input p-2",n);return _.jsx("input",{id:e,name:t,className:i,type:r,onChange:o,...s})};Ff({key:"currentUser",default:void 0});const If=Ff({key:"currentJhData",default:{admin_access:!1,base_url:"/hub",options_form:!1,prefix:"/",user:"",xsrf_token:""}}),Fs=Ff({key:"currentNotification",default:void 0});function vg(e,t){return function(){return e.apply(t,arguments)}}const{toString:oN}=Object.prototype,{getPrototypeOf:Vf}=Object,oa=(e=>t=>{const n=oN.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),sn=e=>(e=e.toLowerCase(),t=>oa(t)===e),sa=e=>t=>typeof t===e,{isArray:yo}=Array,ws=sa("undefined");function sN(e){return e!==null&&!ws(e)&&e.constructor!==null&&!ws(e.constructor)&&Dt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const gg=sn("ArrayBuffer");function iN(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&gg(e.buffer),t}const lN=sa("string"),Dt=sa("function"),Sg=sa("number"),ia=e=>e!==null&&typeof e=="object",aN=e=>e===!0||e===!1,Ti=e=>{if(oa(e)!=="object")return!1;const t=Vf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},uN=sn("Date"),cN=sn("File"),fN=sn("Blob"),dN=sn("FileList"),hN=e=>ia(e)&&Dt(e.pipe),pN=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Dt(e.append)&&((t=oa(e))==="formdata"||t==="object"&&Dt(e.toString)&&e.toString()==="[object FormData]"))},mN=sn("URLSearchParams"),yN=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ds(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),yo(e))for(r=0,o=e.length;r0;)if(o=n[r],t===o.toLowerCase())return o;return null}const _g=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Rg=e=>!ws(e)&&e!==_g;function hc(){const{caseless:e}=Rg(this)&&this||{},t={},n=(r,o)=>{const s=e&&wg(t,o)||o;Ti(t[s])&&Ti(r)?t[s]=hc(t[s],r):Ti(r)?t[s]=hc({},r):yo(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r(Ds(t,(o,s)=>{n&&Dt(o)?e[s]=vg(o,n):e[s]=o},{allOwnKeys:r}),e),gN=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),SN=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},wN=(e,t,n,r)=>{let o,s,i;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!r||r(i,e,t))&&!l[i]&&(t[i]=e[i],l[i]=!0);e=n!==!1&&Vf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},_N=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},RN=e=>{if(!e)return null;if(yo(e))return e;let t=e.length;if(!Sg(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},EN=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Vf(Uint8Array)),CN=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},xN=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},TN=sn("HTMLFormElement"),kN=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Kh=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),NN=sn("RegExp"),Eg=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ds(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},AN=e=>{Eg(e,(t,n)=>{if(Dt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Dt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},LN=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return yo(e)?r(e):r(String(e).split(t)),n},PN=()=>{},ON=(e,t)=>(e=+e,Number.isFinite(e)?e:t),qa="abcdefghijklmnopqrstuvwxyz",Gh="0123456789",Cg={DIGIT:Gh,ALPHA:qa,ALPHA_DIGIT:qa+qa.toUpperCase()+Gh},bN=(e=16,t=Cg.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function FN(e){return!!(e&&Dt(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const DN=e=>{const t=new Array(10),n=(r,o)=>{if(ia(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=yo(r)?[]:{};return Ds(r,(i,l)=>{const a=n(i,o+1);!ws(a)&&(s[l]=a)}),t[o]=void 0,s}}return r};return n(e,0)},MN=sn("AsyncFunction"),UN=e=>e&&(ia(e)||Dt(e))&&Dt(e.then)&&Dt(e.catch),P={isArray:yo,isArrayBuffer:gg,isBuffer:sN,isFormData:pN,isArrayBufferView:iN,isString:lN,isNumber:Sg,isBoolean:aN,isObject:ia,isPlainObject:Ti,isUndefined:ws,isDate:uN,isFile:cN,isBlob:fN,isRegExp:NN,isFunction:Dt,isStream:hN,isURLSearchParams:mN,isTypedArray:EN,isFileList:dN,forEach:Ds,merge:hc,extend:vN,trim:yN,stripBOM:gN,inherits:SN,toFlatObject:wN,kindOf:oa,kindOfTest:sn,endsWith:_N,toArray:RN,forEachEntry:CN,matchAll:xN,isHTMLForm:TN,hasOwnProperty:Kh,hasOwnProp:Kh,reduceDescriptors:Eg,freezeMethods:AN,toObjectSet:LN,toCamelCase:kN,noop:PN,toFiniteNumber:ON,findKey:wg,global:_g,isContextDefined:Rg,ALPHABET:Cg,generateString:bN,isSpecCompliantForm:FN,toJSONObject:DN,isAsyncFn:MN,isThenable:UN};function ye(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}P.inherits(ye,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:P.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const xg=ye.prototype,Tg={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Tg[e]={value:e}});Object.defineProperties(ye,Tg);Object.defineProperty(xg,"isAxiosError",{value:!0});ye.from=(e,t,n,r,o,s)=>{const i=Object.create(xg);return P.toFlatObject(e,i,function(a){return a!==Error.prototype},l=>l!=="isAxiosError"),ye.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const IN=null;function pc(e){return P.isPlainObject(e)||P.isArray(e)}function kg(e){return P.endsWith(e,"[]")?e.slice(0,-2):e}function Yh(e,t,n){return e?e.concat(t).map(function(o,s){return o=kg(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function VN(e){return P.isArray(e)&&!e.some(pc)}const $N=P.toFlatObject(P,{},null,function(t){return/^is[A-Z]/.test(t)});function la(e,t,n){if(!P.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=P.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,x){return!P.isUndefined(x[v])});const r=n.metaTokens,o=n.visitor||c,s=n.dots,i=n.indexes,a=(n.Blob||typeof Blob<"u"&&Blob)&&P.isSpecCompliantForm(t);if(!P.isFunction(o))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(P.isDate(p))return p.toISOString();if(!a&&P.isBlob(p))throw new ye("Blob is not supported. Use a Buffer instead.");return P.isArrayBuffer(p)||P.isTypedArray(p)?a&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function c(p,v,x){let y=p;if(p&&!x&&typeof p=="object"){if(P.endsWith(v,"{}"))v=r?v:v.slice(0,-2),p=JSON.stringify(p);else if(P.isArray(p)&&VN(p)||(P.isFileList(p)||P.endsWith(v,"[]"))&&(y=P.toArray(p)))return v=kg(v),y.forEach(function(m,R){!(P.isUndefined(m)||m===null)&&t.append(i===!0?Yh([v],R,s):i===null?v:v+"[]",u(m))}),!1}return pc(p)?!0:(t.append(Yh(x,v,s),u(p)),!1)}const f=[],h=Object.assign($N,{defaultVisitor:c,convertValue:u,isVisitable:pc});function S(p,v){if(!P.isUndefined(p)){if(f.indexOf(p)!==-1)throw Error("Circular reference detected in "+v.join("."));f.push(p),P.forEach(p,function(y,d){(!(P.isUndefined(y)||y===null)&&o.call(t,y,P.isString(d)?d.trim():d,v,h))===!0&&S(y,v?v.concat(d):[d])}),f.pop()}}if(!P.isObject(e))throw new TypeError("data must be an object");return S(e),t}function Jh(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function $f(e,t){this._pairs=[],e&&la(e,this,t)}const Ng=$f.prototype;Ng.append=function(t,n){this._pairs.push([t,n])};Ng.toString=function(t){const n=t?function(r){return t.call(this,r,Jh)}:Jh;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function jN(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ag(e,t,n){if(!t)return e;const r=n&&n.encode||jN,o=n&&n.serialize;let s;if(o?s=o(t,n):s=P.isURLSearchParams(t)?t.toString():new $f(t,n).toString(r),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class BN{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){P.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Xh=BN,Lg={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zN=typeof URLSearchParams<"u"?URLSearchParams:$f,HN=typeof FormData<"u"?FormData:null,WN=typeof Blob<"u"?Blob:null,QN={isBrowser:!0,classes:{URLSearchParams:zN,FormData:HN,Blob:WN},protocols:["http","https","file","blob","url","data"]},Pg=typeof window<"u"&&typeof document<"u",qN=(e=>Pg&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),KN=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),GN=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Pg,hasStandardBrowserEnv:qN,hasStandardBrowserWebWorkerEnv:KN},Symbol.toStringTag,{value:"Module"})),Zt={...GN,...QN};function YN(e,t){return la(e,new Zt.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return Zt.isNode&&P.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function JN(e){return P.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function XN(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r=n.length;return i=!i&&P.isArray(o)?o.length:i,a?(P.hasOwnProp(o,i)?o[i]=[o[i],r]:o[i]=r,!l):((!o[i]||!P.isObject(o[i]))&&(o[i]=[]),t(n,r,o[i],s)&&P.isArray(o[i])&&(o[i]=XN(o[i])),!l)}if(P.isFormData(e)&&P.isFunction(e.entries)){const n={};return P.forEachEntry(e,(r,o)=>{t(JN(r),o,n,0)}),n}return null}function ZN(e,t,n){if(P.isString(e))try{return(t||JSON.parse)(e),P.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const jf={transitional:Lg,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=P.isObject(t);if(s&&P.isHTMLForm(t)&&(t=new FormData(t)),P.isFormData(t))return o&&o?JSON.stringify(Og(t)):t;if(P.isArrayBuffer(t)||P.isBuffer(t)||P.isStream(t)||P.isFile(t)||P.isBlob(t))return t;if(P.isArrayBufferView(t))return t.buffer;if(P.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return YN(t,this.formSerializer).toString();if((l=P.isFileList(t))||r.indexOf("multipart/form-data")>-1){const a=this.env&&this.env.FormData;return la(l?{"files[]":t}:t,a&&new a,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),ZN(t)):t}],transformResponse:[function(t){const n=this.transitional||jf.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(t&&P.isString(t)&&(r&&!this.responseType||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(l){if(i)throw l.name==="SyntaxError"?ye.from(l,ye.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Zt.classes.FormData,Blob:Zt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};P.forEach(["delete","get","head","post","put","patch"],e=>{jf.headers[e]={}});const Bf=jf,eA=P.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),tA=e=>{const t={};let n,r,o;return e&&e.split(` `).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),r=i.substring(o+1).trim(),!(!n||t[n]&&eA[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Zh=Symbol("internals");function Do(e){return e&&String(e).trim().toLowerCase()}function ki(e){return e===!1||e==null?e:P.isArray(e)?e.map(ki):String(e)}function nA(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const rA=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ka(e,t,n,r,o){if(P.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!P.isString(t)){if(P.isString(r))return t.indexOf(r)!==-1;if(P.isRegExp(r))return r.test(t)}}function oA(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function sA(e,t){const n=P.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,s,i){return this[r].call(this,t,o,s,i)},configurable:!0})})}class aa{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function s(l,a,u){const c=Do(a);if(!c)throw new Error("header name must be a non-empty string");const f=P.findKey(o,c);(!f||o[f]===void 0||u===!0||u===void 0&&o[f]!==!1)&&(o[f||a]=ki(l))}const i=(l,a)=>P.forEach(l,(u,c)=>s(u,c,a));return P.isPlainObject(t)||t instanceof this.constructor?i(t,n):P.isString(t)&&(t=t.trim())&&!rA(t)?i(tA(t),n):t!=null&&s(n,t,r),this}get(t,n){if(t=Do(t),t){const r=P.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return nA(o);if(P.isFunction(n))return n.call(this,o,r);if(P.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Do(t),t){const r=P.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Ka(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function s(i){if(i=Do(i),i){const l=P.findKey(r,i);l&&(!n||Ka(r,r[l],l,n))&&(delete r[l],o=!0)}}return P.isArray(t)?t.forEach(s):s(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const s=n[r];(!t||Ka(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,r={};return P.forEach(this,(o,s)=>{const i=P.findKey(r,s);if(i){n[i]=ki(o),delete n[s];return}const l=t?oA(s):String(s).trim();l!==s&&delete n[s],n[l]=ki(o),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return P.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&P.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[Zh]=this[Zh]={accessors:{}}).accessors,o=this.prototype;function s(i){const l=Do(i);r[l]||(sA(o,i),r[l]=!0)}return P.isArray(t)?t.forEach(s):s(t),this}}aa.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);P.reduceDescriptors(aa.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});P.freezeMethods(aa);const pn=aa;function Ga(e,t){const n=this||Bf,r=t||n,o=pn.from(r.headers);let s=r.data;return P.forEach(e,function(l){s=l.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function bg(e){return!!(e&&e.__CANCEL__)}function Ms(e,t,n){ye.call(this,e??"canceled",ye.ERR_CANCELED,t,n),this.name="CanceledError"}P.inherits(Ms,ye,{__CANCEL__:!0});function iA(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ye("Request failed with status code "+n.status,[ye.ERR_BAD_REQUEST,ye.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const lA=Zt.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];P.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),P.isString(r)&&i.push("path="+r),P.isString(o)&&i.push("domain="+o),s===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function aA(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function uA(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Fg(e,t){return e&&!aA(t)?uA(e,t):t}const cA=Zt.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(s){let i=s;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(i){const l=P.isString(i)?o(i):i;return l.protocol===r.protocol&&l.host===r.host}}():function(){return function(){return!0}}();function fA(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function dA(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(a){const u=Date.now(),c=r[s];i||(i=u),n[o]=a,r[o]=u;let f=s,h=0;for(;f!==o;)h+=n[f++],f=f%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),u-i{const s=o.loaded,i=o.lengthComputable?o.total:void 0,l=s-n,a=r(l),u=s<=i;n=s;const c={loaded:s,total:i,progress:i?s/i:void 0,bytes:l,rate:a||void 0,estimated:a&&i&&u?(i-s)/a:void 0,event:o};c[t?"download":"upload"]=!0,e(c)}}const hA=typeof XMLHttpRequest<"u",pA=hA&&function(e){return new Promise(function(n,r){let o=e.data;const s=pn.from(e.headers).normalize();let{responseType:i,withXSRFToken:l}=e,a;function u(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}let c;if(P.isFormData(o)){if(Zt.hasStandardBrowserEnv||Zt.hasStandardBrowserWebWorkerEnv)s.setContentType(!1);else if((c=s.getContentType())!==!1){const[v,...x]=c?c.split(";").map(y=>y.trim()).filter(Boolean):[];s.setContentType([v||"multipart/form-data",...x].join("; "))}}let f=new XMLHttpRequest;if(e.auth){const v=e.auth.username||"",x=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(v+":"+x))}const h=Fg(e.baseURL,e.url);f.open(e.method.toUpperCase(),Ag(h,e.params,e.paramsSerializer),!0),f.timeout=e.timeout;function S(){if(!f)return;const v=pn.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),y={data:!i||i==="text"||i==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:v,config:e,request:f};iA(function(m){n(m),u()},function(m){r(m),u()},y),f=null}if("onloadend"in f?f.onloadend=S:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(S)},f.onabort=function(){f&&(r(new ye("Request aborted",ye.ECONNABORTED,e,f)),f=null)},f.onerror=function(){r(new ye("Network Error",ye.ERR_NETWORK,e,f)),f=null},f.ontimeout=function(){let x=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const y=e.transitional||Lg;e.timeoutErrorMessage&&(x=e.timeoutErrorMessage),r(new ye(x,y.clarifyTimeoutError?ye.ETIMEDOUT:ye.ECONNABORTED,e,f)),f=null},Zt.hasStandardBrowserEnv&&(l&&P.isFunction(l)&&(l=l(e)),l||l!==!1&&cA(h))){const v=e.xsrfHeaderName&&e.xsrfCookieName&&lA.read(e.xsrfCookieName);v&&s.set(e.xsrfHeaderName,v)}o===void 0&&s.setContentType(null),"setRequestHeader"in f&&P.forEach(s.toJSON(),function(x,y){f.setRequestHeader(y,x)}),P.isUndefined(e.withCredentials)||(f.withCredentials=!!e.withCredentials),i&&i!=="json"&&(f.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&f.addEventListener("progress",ep(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&f.upload&&f.upload.addEventListener("progress",ep(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=v=>{f&&(r(!v||v.type?new Ms(null,e,f):v),f.abort(),f=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const p=fA(h);if(p&&Zt.protocols.indexOf(p)===-1){r(new ye("Unsupported protocol "+p+":",ye.ERR_BAD_REQUEST,e));return}f.send(o||null)})},mc={http:IN,xhr:pA};P.forEach(mc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const tp=e=>`- ${e}`,mA=e=>P.isFunction(e)||e===null||e===!1,Dg={getAdapter:e=>{e=P.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s`adapter ${l} `+(a===!1?"is not supported by the environment":"is not available in the build"));let i=t?s.length>1?`since : `+s.map(tp).join(` -`):" "+tp(s[0]):"as no adapter specified";throw new ye("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:mc};function Ya(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ms(null,e)}function np(e){return Ya(e),e.headers=pn.from(e.headers),e.data=Ga.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Dg.getAdapter(e.adapter||Bf.adapter)(e).then(function(r){return Ya(e),r.data=Ga.call(e,e.transformResponse,r),r.headers=pn.from(r.headers),r},function(r){return bg(r)||(Ya(e),r&&r.response&&(r.response.data=Ga.call(e,e.transformResponse,r.response),r.response.headers=pn.from(r.response.headers))),Promise.reject(r)})}const rp=e=>e instanceof pn?e.toJSON():e;function ao(e,t){t=t||{};const n={};function r(u,c,f){return P.isPlainObject(u)&&P.isPlainObject(c)?P.merge.call({caseless:f},u,c):P.isPlainObject(c)?P.merge({},c):P.isArray(c)?c.slice():c}function o(u,c,f){if(P.isUndefined(c)){if(!P.isUndefined(u))return r(void 0,u,f)}else return r(u,c,f)}function s(u,c){if(!P.isUndefined(c))return r(void 0,c)}function i(u,c){if(P.isUndefined(c)){if(!P.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function l(u,c,f){if(f in t)return r(u,c);if(f in e)return r(void 0,u)}const a={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(u,c)=>o(rp(u),rp(c),!0)};return P.forEach(Object.keys(Object.assign({},e,t)),function(c){const f=a[c]||o,h=f(e[c],t[c],c);P.isUndefined(h)&&f!==l||(n[c]=h)}),n}const Mg="1.6.2",zf={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{zf[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const op={};zf.transitional=function(t,n,r){function o(s,i){return"[Axios v"+Mg+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,l)=>{if(t===!1)throw new ye(o(i," has been removed"+(n?" in "+n:"")),ye.ERR_DEPRECATED);return n&&!op[i]&&(op[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,i,l):!0}};function yA(e,t,n){if(typeof e!="object")throw new ye("options must be an object",ye.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const l=e[s],a=l===void 0||i(l,s,e);if(a!==!0)throw new ye("option "+s+" must be "+a,ye.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ye("Unknown option "+s,ye.ERR_BAD_OPTION)}}const yc={assertOptions:yA,validators:zf},En=yc.validators;class fl{constructor(t){this.defaults=t,this.interceptors={request:new Jh,response:new Jh}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ao(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&yc.assertOptions(r,{silentJSONParsing:En.transitional(En.boolean),forcedJSONParsing:En.transitional(En.boolean),clarifyTimeoutError:En.transitional(En.boolean)},!1),o!=null&&(P.isFunction(o)?n.paramsSerializer={serialize:o}:yc.assertOptions(o,{encode:En.function,serialize:En.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&P.merge(s.common,s[n.method]);s&&P.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),n.headers=pn.concat(i,s);const l=[];let a=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(a=a&&v.synchronous,l.unshift(v.fulfilled,v.rejected))});const u=[];this.interceptors.response.forEach(function(v){u.push(v.fulfilled,v.rejected)});let c,f=0,h;if(!a){const p=[np.bind(this),void 0];for(p.unshift.apply(p,l),p.push.apply(p,u),h=p.length,c=Promise.resolve(n);f{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(l=>{r.subscribe(l),s=l}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},t(function(s,i,l){r.reason||(r.reason=new Ms(s,i,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new Hf(function(o){t=o}),cancel:t}}}const vA=Hf;function gA(e){return function(n){return e.apply(null,n)}}function SA(e){return P.isObject(e)&&e.isAxiosError===!0}const vc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(vc).forEach(([e,t])=>{vc[t]=e});const wA=vc;function Ug(e){const t=new Ni(e),n=vg(Ni.prototype.request,t);return P.extend(n,Ni.prototype,t,{allOwnKeys:!0}),P.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Ug(ao(e,o))},n}const We=Ug(Bf);We.Axios=Ni;We.CanceledError=Ms;We.CancelToken=vA;We.isCancel=bg;We.VERSION=Mg;We.toFormData=la;We.AxiosError=ye;We.Cancel=We.CanceledError;We.all=function(t){return Promise.all(t)};We.spread=gA;We.isAxiosError=SA;We.mergeConfig=ao;We.AxiosHeaders=pn;We.formToJSON=e=>Og(P.isHTMLForm(e)?new FormData(e):e);We.getAdapter=Dg.getAdapter;We.HttpStatusCode=wA;We.default=We;const Ig=We,cn=Ig.create({baseURL:"/services/japps",headers:{"Content-Type":"application/json"}});cn.interceptors.response.use(e=>e,e=>{const t=e.response.status;(e.response.status===401||t===403)&&(window.location.href="/services/japps/jhub-login")});const _A="This field is required.",Mo={required:_A},Wf=()=>window.jhdata,RA=(e,t)=>{var r;const n=[];for(const o in e)if(Object.hasOwnProperty.call(e,o)){const s=e[o];s.display===!0&&n.push({name:s.info.name,url:(r=s.info.url)==null?void 0:r.replace("[USER]",t),external:s.info.external})}return n},EA=(e,t)=>{var r;const n=[];for(const o in e)if(Object.hasOwnProperty.call(e,o)){const s=e[o];if((r=s.user_options)!=null&&r.jhub_app){const i=s.user_options;n.push({id:i.name,name:i.display_name,description:i.description,framework:CA(i.framework),url:s.url,thumbnail:i.thumbnail,shared:!1,ready:i.ready})}}return t.toLowerCase()==="shared"?n.filter(o=>o.shared===!0):n.filter(o=>o.shared===!1)},CA=e=>e.charAt(0).toUpperCase()+e.slice(1);var Us=e=>e.type==="checkbox",Vr=e=>e instanceof Date,at=e=>e==null;const Vg=e=>typeof e=="object";var Ke=e=>!at(e)&&!Array.isArray(e)&&Vg(e)&&!Vr(e),$g=e=>Ke(e)&&e.target?Us(e.target)?e.target.checked:e.target.value:e,xA=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,jg=(e,t)=>e.has(xA(t)),TA=e=>{const t=e.constructor&&e.constructor.prototype;return Ke(t)&&t.hasOwnProperty("isPrototypeOf")},Qf=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Bt(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Qf&&(e instanceof Blob||e instanceof FileList))&&(n||Ke(e)))if(t=n?[]:{},!n&&!TA(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Bt(e[r]));else return e;return t}var Is=e=>Array.isArray(e)?e.filter(Boolean):[],je=e=>e===void 0,q=(e,t,n)=>{if(!t||!Ke(e))return n;const r=Is(t.split(/[,[\].]+?/)).reduce((o,s)=>at(o)?o:o[s],e);return je(r)||r===e?je(e[t])?n:e[t]:r},bn=e=>typeof e=="boolean";const dl={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Wt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ln={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},kA=re.createContext(null),qf=()=>re.useContext(kA);var Bg=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==Wt.all&&(t._proxyFormState[i]=!r||Wt.all),n&&(n[i]=!0),e[i]}});return o},Lt=e=>Ke(e)&&!Object.keys(e).length,zg=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return Lt(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===(!r||Wt.all))},Ai=e=>Array.isArray(e)?e:[e],Hg=(e,t,n)=>!e||!t||e===t||Ai(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function Kf(e){const t=re.useRef(e);t.current=e,re.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function NA(e){const t=qf(),{control:n=t.control,disabled:r,name:o,exact:s}=e||{},[i,l]=re.useState(n._formState),a=re.useRef(!0),u=re.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),c=re.useRef(o);return c.current=o,Kf({disabled:r,next:f=>a.current&&Hg(c.current,f.name,s)&&zg(f,u.current,n._updateFormState)&&l({...n._formState,...f}),subject:n._subjects.state}),re.useEffect(()=>(a.current=!0,u.current.isValid&&n._updateValid(!0),()=>{a.current=!1}),[n]),Bg(i,n,u.current,!1)}var en=e=>typeof e=="string",Wg=(e,t,n,r,o)=>en(e)?(r&&t.watch.add(e),q(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),q(n,s))):(r&&(t.watchAll=!0),n);function AA(e){const t=qf(),{control:n=t.control,name:r,defaultValue:o,disabled:s,exact:i}=e||{},l=re.useRef(r);l.current=r,Kf({disabled:s,subject:n._subjects.values,next:c=>{Hg(l.current,c.name,i)&&u(Bt(Wg(l.current,n._names,c.values||n._formValues,!1,o)))}});const[a,u]=re.useState(n._getWatch(r,o));return re.useEffect(()=>n._removeUnmounted()),a}var Gf=e=>/^\w*$/.test(e),Qg=e=>Is(e.replace(/["|']|\]/g,"").split(/\.|\[/));function ke(e,t,n){let r=-1;const o=Gf(t)?[t]:Qg(t),s=o.length,i=s-1;for(;++r{const c=o._options.shouldUnregister||s,f=(h,S)=>{const p=q(o._fields,h);p&&(p._f.mount=S)};if(f(n,!0),c){const h=Bt(q(o._options.defaultValues,n));ke(o._defaultValues,n,h),je(q(o._formValues,n))&&ke(o._formValues,n,h)}return()=>{(i?c&&!o._state.action:c)?o.unregister(n):f(n,!1)}},[n,o,i,s]),re.useEffect(()=>{q(o._fields,n)&&o._updateDisabledField({disabled:r,fields:o._fields,name:n})},[r,n,o]),{field:{name:n,value:l,...bn(r)?{disabled:r}:{},onChange:re.useCallback(c=>u.current.onChange({target:{value:$g(c),name:n},type:dl.CHANGE}),[n]),onBlur:re.useCallback(()=>u.current.onBlur({target:{value:q(o._formValues,n),name:n},type:dl.BLUR}),[n,o]),ref:c=>{const f=q(o._fields,n);f&&c&&(f._f.ref={focus:()=>c.focus(),select:()=>c.select(),setCustomValidity:h=>c.setCustomValidity(h),reportValidity:()=>c.reportValidity()})}},formState:a,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!q(a.errors,n)},isDirty:{enumerable:!0,get:()=>!!q(a.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!q(a.touchedFields,n)},error:{enumerable:!0,get:()=>q(a.errors,n)}})}}const er=e=>e.render(LA(e));var PA=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{};const gc=(e,t,n)=>{for(const r of n||Object.keys(e)){const o=q(e,r);if(o){const{_f:s,...i}=o;if(s&&t(s.name)){if(s.ref.focus){s.ref.focus();break}else if(s.refs&&s.refs[0].focus){s.refs[0].focus();break}}else Ke(i)&&gc(i,t)}}};var sp=e=>({isOnSubmit:!e||e===Wt.onSubmit,isOnBlur:e===Wt.onBlur,isOnChange:e===Wt.onChange,isOnAll:e===Wt.all,isOnTouch:e===Wt.onTouched}),ip=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length)))),OA=(e,t,n)=>{const r=Is(q(e,n));return ke(r,"root",t[n]),ke(e,n,r),e},Yf=e=>e.type==="file",Fn=e=>typeof e=="function",hl=e=>{if(!Qf)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Li=e=>en(e),Xf=e=>e.type==="radio",pl=e=>e instanceof RegExp;const lp={value:!1,isValid:!1},ap={value:!0,isValid:!0};var qg=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!je(e[0].attributes.value)?je(e[0].value)||e[0].value===""?ap:{value:e[0].value,isValid:!0}:ap:lp}return lp};const up={isValid:!1,value:null};var Kg=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,up):up;function cp(e,t,n="validate"){if(Li(e)||Array.isArray(e)&&e.every(Li)||bn(e)&&!e)return{type:n,message:Li(e)?e:"",ref:t}}var xr=e=>Ke(e)&&!pl(e)?e:{value:e,message:""},fp=async(e,t,n,r,o)=>{const{ref:s,refs:i,required:l,maxLength:a,minLength:u,min:c,max:f,pattern:h,validate:S,name:p,valueAsNumber:v,mount:x,disabled:y}=e._f,d=q(t,p);if(!x||y)return{};const m=i?i[0]:s,R=ue=>{r&&m.reportValidity&&(m.setCustomValidity(bn(ue)?"":ue||""),m.reportValidity())},k={},A=Xf(s),N=Us(s),O=A||N,Z=(v||Yf(s))&&je(s.value)&&je(d)||hl(s)&&s.value===""||d===""||Array.isArray(d)&&!d.length,Y=PA.bind(null,p,n,k),me=(ue,z,le,Ee=ln.maxLength,ge=ln.minLength)=>{const we=ue?z:le;k[p]={type:ue?Ee:ge,message:we,ref:s,...Y(ue?Ee:ge,we)}};if(o?!Array.isArray(d)||!d.length:l&&(!O&&(Z||at(d))||bn(d)&&!d||N&&!qg(i).isValid||A&&!Kg(i).isValid)){const{value:ue,message:z}=Li(l)?{value:!!l,message:l}:xr(l);if(ue&&(k[p]={type:ln.required,message:z,ref:m,...Y(ln.required,z)},!n))return R(z),k}if(!Z&&(!at(c)||!at(f))){let ue,z;const le=xr(f),Ee=xr(c);if(!at(d)&&!isNaN(d)){const ge=s.valueAsNumber||d&&+d;at(le.value)||(ue=ge>le.value),at(Ee.value)||(z=genew Date(new Date().toDateString()+" "+H),V=s.type=="time",$=s.type=="week";en(le.value)&&d&&(ue=V?we(d)>we(le.value):$?d>le.value:ge>new Date(le.value)),en(Ee.value)&&d&&(z=V?we(d)+ue.value,Ee=!at(z.value)&&d.length<+z.value;if((le||Ee)&&(me(le,ue.message,z.message),!n))return R(k[p].message),k}if(h&&!Z&&en(d)){const{value:ue,message:z}=xr(h);if(pl(ue)&&!d.match(ue)&&(k[p]={type:ln.pattern,message:z,ref:s,...Y(ln.pattern,z)},!n))return R(z),k}if(S){if(Fn(S)){const ue=await S(d,t),z=cp(ue,m);if(z&&(k[p]={...z,...Y(ln.validate,z.message)},!n))return R(z.message),k}else if(Ke(S)){let ue={};for(const z in S){if(!Lt(ue)&&!n)break;const le=cp(await S[z](d,t),m,z);le&&(ue={...le,...Y(z,le.message)},R(le.message),n&&(k[p]=ue))}if(!Lt(ue)&&(k[p]={ref:m,...ue},!n))return k}}return R(!0),k};function bA(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}}var ml=e=>at(e)||!Vg(e);function ar(e,t){if(ml(e)||ml(t))return e===t;if(Vr(e)&&Vr(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const s=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const i=t[o];if(Vr(s)&&Vr(i)||Ke(s)&&Ke(i)||Array.isArray(s)&&Array.isArray(i)?!ar(s,i):s!==i)return!1}}return!0}var Gg=e=>e.type==="select-multiple",DA=e=>Xf(e)||Us(e),Ja=e=>hl(e)&&e.isConnected,Yg=e=>{for(const t in e)if(Fn(e[t]))return!0;return!1};function yl(e,t={}){const n=Array.isArray(e);if(Ke(e)||n)for(const r in e)Array.isArray(e[r])||Ke(e[r])&&!Yg(e[r])?(t[r]=Array.isArray(e[r])?[]:{},yl(e[r],t[r])):at(e[r])||(t[r]=!0);return t}function Xg(e,t,n){const r=Array.isArray(e);if(Ke(e)||r)for(const o in e)Array.isArray(e[o])||Ke(e[o])&&!Yg(e[o])?je(t)||ml(n[o])?n[o]=Array.isArray(e[o])?yl(e[o],[]):{...yl(e[o])}:Xg(e[o],at(t)?{}:t[o],n[o]):n[o]=!ar(e[o],t[o]);return n}var Za=(e,t)=>Xg(e,t,yl(t)),Jg=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>je(e)?e:t?e===""?NaN:e&&+e:n&&en(e)?new Date(e):r?r(e):e;function eu(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return Yf(t)?t.files:Xf(t)?Kg(e.refs).value:Gg(t)?[...t.selectedOptions].map(({value:n})=>n):Us(t)?qg(e.refs).value:Jg(je(t.value)?e.ref.value:t.value,e)}var MA=(e,t,n,r)=>{const o={};for(const s of e){const i=q(t,s);i&&ke(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Uo=e=>je(e)?e:pl(e)?e.source:Ke(e)?pl(e.value)?e.value.source:e.value:e,UA=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function dp(e,t,n){const r=q(e,n);if(r||Gf(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=q(t,s),l=q(e,s);if(i&&!Array.isArray(i)&&n!==s)return{name:n};if(l&&l.type)return{name:s,error:l};o.pop()}return{name:n}}var IA=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,VA=(e,t)=>!Is(q(e,t)).length&&Je(e,t);const $A={mode:Wt.onSubmit,reValidateMode:Wt.onChange,shouldFocusError:!0};function jA(e={},t){let n={...$A,...e},r={submitCount:0,isDirty:!1,isLoading:Fn(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},o={},s=Ke(n.defaultValues)||Ke(n.values)?Bt(n.defaultValues||n.values)||{}:{},i=n.shouldUnregister?{}:Bt(s),l={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0;const f={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={values:Xa(),array:Xa(),state:Xa()},S=e.resetOptions&&e.resetOptions.keepDirtyValues,p=sp(n.mode),v=sp(n.reValidateMode),x=n.criteriaMode===Wt.all,y=g=>T=>{clearTimeout(c),c=setTimeout(g,T)},d=async g=>{if(f.isValid||g){const T=n.resolver?Lt((await Z()).errors):await me(o,!0);T!==r.isValid&&h.state.next({isValid:T})}},m=g=>f.isValidating&&h.state.next({isValidating:g}),R=(g,T=[],L,X,B=!0,I=!0)=>{if(X&&L){if(l.action=!0,I&&Array.isArray(q(o,g))){const te=L(q(o,g),X.argA,X.argB);B&&ke(o,g,te)}if(I&&Array.isArray(q(r.errors,g))){const te=L(q(r.errors,g),X.argA,X.argB);B&&ke(r.errors,g,te),VA(r.errors,g)}if(f.touchedFields&&I&&Array.isArray(q(r.touchedFields,g))){const te=L(q(r.touchedFields,g),X.argA,X.argB);B&&ke(r.touchedFields,g,te)}f.dirtyFields&&(r.dirtyFields=Za(s,i)),h.state.next({name:g,isDirty:z(g,T),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ke(i,g,T)},k=(g,T)=>{ke(r.errors,g,T),h.state.next({errors:r.errors})},A=(g,T,L,X)=>{const B=q(o,g);if(B){const I=q(i,g,je(L)?q(s,g):L);je(I)||X&&X.defaultChecked||T?ke(i,g,T?I:eu(B._f)):ge(g,I),l.mount&&d()}},N=(g,T,L,X,B)=>{let I=!1,te=!1;const Te={name:g};if(!L||X){f.isDirty&&(te=r.isDirty,r.isDirty=Te.isDirty=z(),I=te!==Te.isDirty);const Ae=ar(q(s,g),T);te=q(r.dirtyFields,g),Ae?Je(r.dirtyFields,g):ke(r.dirtyFields,g,!0),Te.dirtyFields=r.dirtyFields,I=I||f.dirtyFields&&te!==!Ae}if(L){const Ae=q(r.touchedFields,g);Ae||(ke(r.touchedFields,g,L),Te.touchedFields=r.touchedFields,I=I||f.touchedFields&&Ae!==L)}return I&&B&&h.state.next(Te),I?Te:{}},O=(g,T,L,X)=>{const B=q(r.errors,g),I=f.isValid&&bn(T)&&r.isValid!==T;if(e.delayError&&L?(u=y(()=>k(g,L)),u(e.delayError)):(clearTimeout(c),u=null,L?ke(r.errors,g,L):Je(r.errors,g)),(L?!ar(B,L):B)||!Lt(X)||I){const te={...X,...I&&bn(T)?{isValid:T}:{},errors:r.errors,name:g};r={...r,...te},h.state.next(te)}m(!1)},Z=async g=>n.resolver(i,n.context,MA(g||a.mount,o,n.criteriaMode,n.shouldUseNativeValidation)),Y=async g=>{const{errors:T}=await Z(g);if(g)for(const L of g){const X=q(T,L);X?ke(r.errors,L,X):Je(r.errors,L)}else r.errors=T;return T},me=async(g,T,L={valid:!0})=>{for(const X in g){const B=g[X];if(B){const{_f:I,...te}=B;if(I){const Te=a.array.has(I.name),Ae=await fp(B,i,x,n.shouldUseNativeValidation&&!T,Te);if(Ae[I.name]&&(L.valid=!1,T))break;!T&&(q(Ae,I.name)?Te?OA(r.errors,Ae,I.name):ke(r.errors,I.name,Ae[I.name]):Je(r.errors,I.name))}te&&await me(te,T,L)}}return L.valid},ue=()=>{for(const g of a.unMount){const T=q(o,g);T&&(T._f.refs?T._f.refs.every(L=>!Ja(L)):!Ja(T._f.ref))&&j(g)}a.unMount=new Set},z=(g,T)=>(g&&T&&ke(i,g,T),!ar(ce(),s)),le=(g,T,L)=>Wg(g,a,{...l.mount?i:je(T)?s:en(g)?{[g]:T}:T},L,T),Ee=g=>Is(q(l.mount?i:s,g,e.shouldUnregister?q(s,g,[]):[])),ge=(g,T,L={})=>{const X=q(o,g);let B=T;if(X){const I=X._f;I&&(!I.disabled&&ke(i,g,Jg(T,I)),B=hl(I.ref)&&at(T)?"":T,Gg(I.ref)?[...I.ref.options].forEach(te=>te.selected=B.includes(te.value)):I.refs?Us(I.ref)?I.refs.length>1?I.refs.forEach(te=>(!te.defaultChecked||!te.disabled)&&(te.checked=Array.isArray(B)?!!B.find(Te=>Te===te.value):B===te.value)):I.refs[0]&&(I.refs[0].checked=!!B):I.refs.forEach(te=>te.checked=te.value===B):Yf(I.ref)?I.ref.value="":(I.ref.value=B,I.ref.type||h.values.next({name:g,values:{...i}})))}(L.shouldDirty||L.shouldTouch)&&N(g,B,L.shouldTouch,L.shouldDirty,!0),L.shouldValidate&&H(g)},we=(g,T,L)=>{for(const X in T){const B=T[X],I=`${g}.${X}`,te=q(o,I);(a.array.has(g)||!ml(B)||te&&!te._f)&&!Vr(B)?we(I,B,L):ge(I,B,L)}},V=(g,T,L={})=>{const X=q(o,g),B=a.array.has(g),I=Bt(T);ke(i,g,I),B?(h.array.next({name:g,values:{...i}}),(f.isDirty||f.dirtyFields)&&L.shouldDirty&&h.state.next({name:g,dirtyFields:Za(s,i),isDirty:z(g,I)})):X&&!X._f&&!at(I)?we(g,I,L):ge(g,I,L),ip(g,a)&&h.state.next({...r}),h.values.next({name:g,values:{...i}}),!l.mount&&t()},$=async g=>{const T=g.target;let L=T.name,X=!0;const B=q(o,L),I=()=>T.type?eu(B._f):$g(g);if(B){let te,Te;const Ae=I(),_n=g.type===dl.BLUR||g.type===dl.FOCUS_OUT,ua=!UA(B._f)&&!n.resolver&&!q(r.errors,L)&&!B._f.deps||IA(_n,q(r.touchedFields,L),r.isSubmitted,v,p),vo=ip(L,a,_n);ke(i,L,Ae),_n?(B._f.onBlur&&B._f.onBlur(g),u&&u(0)):B._f.onChange&&B._f.onChange(g);const go=N(L,Ae,_n,!1),ca=!Lt(go)||vo;if(!_n&&h.values.next({name:L,type:g.type,values:{...i}}),ua)return f.isValid&&d(),ca&&h.state.next({name:L,...vo?{}:go});if(!_n&&vo&&h.state.next({...r}),m(!0),n.resolver){const{errors:Vs}=await Z([L]),$s=dp(r.errors,o,L),js=dp(Vs,o,$s.name||L);te=js.error,L=js.name,Te=Lt(Vs)}else te=(await fp(B,i,x,n.shouldUseNativeValidation))[L],X=Number.isNaN(Ae)||Ae===q(i,L,Ae),X&&(te?Te=!1:f.isValid&&(Te=await me(o,!0)));X&&(B._f.deps&&H(B._f.deps),O(L,Te,te,go))}},H=async(g,T={})=>{let L,X;const B=Ai(g);if(m(!0),n.resolver){const I=await Y(je(g)?g:B);L=Lt(I),X=g?!B.some(te=>q(I,te)):L}else g?(X=(await Promise.all(B.map(async I=>{const te=q(o,I);return await me(te&&te._f?{[I]:te}:te)}))).every(Boolean),!(!X&&!r.isValid)&&d()):X=L=await me(o);return h.state.next({...!en(g)||f.isValid&&L!==r.isValid?{}:{name:g},...n.resolver||!g?{isValid:L}:{},errors:r.errors,isValidating:!1}),T.shouldFocus&&!X&&gc(o,I=>I&&q(r.errors,I),g?B:a.mount),X},ce=g=>{const T={...s,...l.mount?i:{}};return je(g)?T:en(g)?q(T,g):g.map(L=>q(T,L))},C=(g,T)=>({invalid:!!q((T||r).errors,g),isDirty:!!q((T||r).dirtyFields,g),isTouched:!!q((T||r).touchedFields,g),error:q((T||r).errors,g)}),b=g=>{g&&Ai(g).forEach(T=>Je(r.errors,T)),h.state.next({errors:g?r.errors:{}})},F=(g,T,L)=>{const X=(q(o,g,{_f:{}})._f||{}).ref;ke(r.errors,g,{...T,ref:X}),h.state.next({name:g,errors:r.errors,isValid:!1}),L&&L.shouldFocus&&X&&X.focus&&X.focus()},J=(g,T)=>Fn(g)?h.values.subscribe({next:L=>g(le(void 0,T),L)}):le(g,T,!0),j=(g,T={})=>{for(const L of g?Ai(g):a.mount)a.mount.delete(L),a.array.delete(L),T.keepValue||(Je(o,L),Je(i,L)),!T.keepError&&Je(r.errors,L),!T.keepDirty&&Je(r.dirtyFields,L),!T.keepTouched&&Je(r.touchedFields,L),!n.shouldUnregister&&!T.keepDefaultValue&&Je(s,L);h.values.next({values:{...i}}),h.state.next({...r,...T.keepDirty?{isDirty:z()}:{}}),!T.keepIsValid&&d()},oe=({disabled:g,name:T,field:L,fields:X})=>{if(bn(g)){const B=g?void 0:q(i,T,eu(L?L._f:q(X,T)._f));ke(i,T,B),N(T,B,!1,!1,!0)}},ne=(g,T={})=>{let L=q(o,g);const X=bn(T.disabled);return ke(o,g,{...L||{},_f:{...L&&L._f?L._f:{ref:{name:g}},name:g,mount:!0,...T}}),a.mount.add(g),L?oe({field:L,disabled:T.disabled,name:g}):A(g,!0,T.value),{...X?{disabled:T.disabled}:{},...n.progressive?{required:!!T.required,min:Uo(T.min),max:Uo(T.max),minLength:Uo(T.minLength),maxLength:Uo(T.maxLength),pattern:Uo(T.pattern)}:{},name:g,onChange:$,onBlur:$,ref:B=>{if(B){ne(g,T),L=q(o,g);const I=je(B.value)&&B.querySelectorAll&&B.querySelectorAll("input,select,textarea")[0]||B,te=DA(I),Te=L._f.refs||[];if(te?Te.find(Ae=>Ae===I):I===L._f.ref)return;ke(o,g,{_f:{...L._f,...te?{refs:[...Te.filter(Ja),I,...Array.isArray(q(s,g))?[{}]:[]],ref:{type:I.type,name:g}}:{ref:I}}}),A(g,!1,void 0,I)}else L=q(o,g,{}),L._f&&(L._f.mount=!1),(n.shouldUnregister||T.shouldUnregister)&&!(jg(a.array,g)&&l.action)&&a.unMount.add(g)}}},ee=()=>n.shouldFocusError&&gc(o,g=>g&&q(r.errors,g),a.mount),_e=(g,T)=>async L=>{L&&(L.preventDefault&&L.preventDefault(),L.persist&&L.persist());let X=Bt(i);if(h.state.next({isSubmitting:!0}),n.resolver){const{errors:B,values:I}=await Z();r.errors=B,X=I}else await me(o);Je(r.errors,"root"),Lt(r.errors)?(h.state.next({errors:{}}),await g(X,L)):(T&&await T({...r.errors},L),ee(),setTimeout(ee)),h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Lt(r.errors),submitCount:r.submitCount+1,errors:r.errors})},ze=(g,T={})=>{q(o,g)&&(je(T.defaultValue)?V(g,q(s,g)):(V(g,T.defaultValue),ke(s,g,T.defaultValue)),T.keepTouched||Je(r.touchedFields,g),T.keepDirty||(Je(r.dirtyFields,g),r.isDirty=T.defaultValue?z(g,q(s,g)):z()),T.keepError||(Je(r.errors,g),f.isValid&&d()),h.state.next({...r}))},Se=(g,T={})=>{const L=g?Bt(g):s,X=Bt(L),B=g&&!Lt(g)?X:s;if(T.keepDefaultValues||(s=L),!T.keepValues){if(T.keepDirtyValues||S)for(const I of a.mount)q(r.dirtyFields,I)?ke(B,I,q(i,I)):V(I,q(B,I));else{if(Qf&&je(g))for(const I of a.mount){const te=q(o,I);if(te&&te._f){const Te=Array.isArray(te._f.refs)?te._f.refs[0]:te._f.ref;if(hl(Te)){const Ae=Te.closest("form");if(Ae){Ae.reset();break}}}}o={}}i=e.shouldUnregister?T.keepDefaultValues?Bt(s):{}:Bt(B),h.array.next({values:{...B}}),h.values.next({values:{...B}})}a={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!l.mount&&t(),l.mount=!f.isValid||!!T.keepIsValid,l.watch=!!e.shouldUnregister,h.state.next({submitCount:T.keepSubmitCount?r.submitCount:0,isDirty:T.keepDirty?r.isDirty:!!(T.keepDefaultValues&&!ar(g,s)),isSubmitted:T.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:T.keepDirtyValues?r.dirtyFields:T.keepDefaultValues&&g?Za(s,g):{},touchedFields:T.keepTouched?r.touchedFields:{},errors:T.keepErrors?r.errors:{},isSubmitSuccessful:T.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Ce=(g,T)=>Se(Fn(g)?g(i):g,T);return{control:{register:ne,unregister:j,getFieldState:C,handleSubmit:_e,setError:F,_executeSchema:Z,_getWatch:le,_getDirty:z,_updateValid:d,_removeUnmounted:ue,_updateFieldArray:R,_updateDisabledField:oe,_getFieldArray:Ee,_reset:Se,_resetDefaultValues:()=>Fn(n.defaultValues)&&n.defaultValues().then(g=>{Ce(g,n.resetOptions),h.state.next({isLoading:!1})}),_updateFormState:g=>{r={...r,...g}},_subjects:h,_proxyFormState:f,get _fields(){return o},get _formValues(){return i},get _state(){return l},set _state(g){l=g},get _defaultValues(){return s},get _names(){return a},set _names(g){a=g},get _formState(){return r},set _formState(g){r=g},get _options(){return n},set _options(g){n={...n,...g}}},trigger:H,register:ne,handleSubmit:_e,watch:J,setValue:V,getValues:ce,reset:Ce,resetField:ze,clearErrors:b,unregister:j,setError:F,setFocus:(g,T={})=>{const L=q(o,g),X=L&&L._f;if(X){const B=X.refs?X.refs[0]:X.ref;B.focus&&(B.focus(),T.shouldSelect&&B.select())}},getFieldState:C}}function BA(e={}){const t=re.useRef(),n=re.useRef(),[r,o]=re.useState({isDirty:!1,isValidating:!1,isLoading:Fn(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:Fn(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...jA(e,()=>o(i=>({...i}))),formState:r});const s=t.current.control;return s._options=e,Kf({subject:s._subjects.state,next:i=>{zg(i,s._proxyFormState,s._updateFormState,!0)&&o({...s._formState})}}),re.useEffect(()=>{e.values&&!ar(e.values,n.current)?(s._reset(e.values,s._options.resetOptions),n.current=e.values):s._resetDefaultValues()},[e.values,s]),re.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=Bg(r,s),t.current}const Zg=({id:e,onCancel:t,onSubmit:n})=>{var Z,Y,me,ue,z,le,Ee,ge,we,V;const r=ra(),[o,s]=U.useState(!1),[,i]=Wn(Fs),[l,a]=U.useState(""),{data:u,error:c}=Ir({queryKey:["app-form",e],queryFn:()=>cn.get(`/server/${e}`).then($=>$.data),enabled:!!e}),{data:f}=Ir({queryKey:["app-frameworks"],queryFn:()=>cn.get("/frameworks").then($=>$.data)}),{data:h}=Ir({queryKey:["app-environments"],queryFn:()=>cn.get("/conda-environments").then($=>$.data)}),{data:S}=Ir({queryKey:["app-profiles"],queryFn:()=>cn.get("/spawner-profiles").then($=>$.data)}),{control:p,handleSubmit:v,reset:x,watch:y,formState:{errors:d}}=BA({defaultValues:{display_name:"",description:"",framework:"",thumbnail:"",filepath:"",conda_env:"",custom_command:"",profile:""}}),m=y("framework"),R=({display_name:$,description:H,framework:ce,thumbnail:C,filepath:b,conda_env:F,custom_command:J,profile:j})=>{const oe={servername:l||$,user_options:{jhub_app:!0,name:l||$,display_name:$,description:H||"",framework:ce,thumbnail:C||"",filepath:b||"",conda_env:F||"",custom_command:J||"",profile:j||""}};s(!0),e?O(oe,{onSuccess:async()=>{s(!1),r.invalidateQueries(["app-state"]),n&&n()},onError:async ne=>{s(!1),i(ne.message)}}):N(oe,{onSuccess:async ne=>{s(!1);const ee=Wf().user;if(ee&&(ne==null?void 0:ne.length)>1){const _e=ne[1];window.location.assign(`/user/${ee}/${_e}`)}},onError:async ne=>{s(!1),i(ne.message)}})},k=async({servername:$,user_options:H})=>(await cn.post("/server",{servername:$,user_options:H})).data,A=async({servername:$,user_options:H})=>(await cn.put(`/server/${$}`,{servername:$,user_options:H})).data,{mutate:N}=fc({mutationFn:k,retry:1}),{mutate:O}=fc({mutationFn:A,retry:1});return U.useEffect(()=>{u!=null&&u.name&&(u!=null&&u.user_options)&&(a(u.name),x({...u.user_options}))},[u==null?void 0:u.name,u==null?void 0:u.user_options,x]),U.useEffect(()=>{c&&i(c.message)},[c,i]),_.jsxs("form",{id:"app-form",onSubmit:v(R),className:"form",children:[_.jsxs(Jn,{errors:(Z=d.display_name)!=null&&Z.message?[d.display_name.message]:void 0,children:[_.jsx(Zn,{htmlFor:"display_name",required:!0,children:"Display Name"}),_.jsx(er,{name:"display_name",control:p,rules:Mo,render:({field:{ref:$,...H}})=>_.jsx(xi,{...H,id:"display_name",autoFocus:!0})}),((Y=d.display_name)==null?void 0:Y.message)&&_.jsx(Fo,{errors:[d.display_name.message]})]}),_.jsxs(Jn,{children:[_.jsx(Zn,{htmlFor:"description",children:"Description"}),_.jsx(er,{name:"description",control:p,render:({field:{ref:$,...H}})=>_.jsx(rN,{...H,id:"description"})})]}),_.jsxs(Jn,{errors:(me=d.framework)!=null&&me.message?[d.framework.message]:void 0,children:[_.jsx(Zn,{htmlFor:"framework",required:!0,children:"Framework"}),_.jsx(er,{name:"framework",control:p,rules:Mo,render:({field:{ref:$,...H}})=>_.jsx(Qa,{...H,id:"framework",options:f?[{value:"",label:"Select..."},...f.map(ce=>({value:ce.name,label:ce.display_name}))]:[]})}),((ue=d.framework)==null?void 0:ue.message)&&_.jsx(Fo,{errors:[d.framework.message]})]}),_.jsxs(Jn,{children:[_.jsx(Zn,{htmlFor:"filepath",children:"Filepath"}),_.jsx(er,{name:"filepath",control:p,render:({field:{ref:$,...H}})=>_.jsx(xi,{...H,id:"filepath"})})]}),h&&h.length>0?_.jsxs(Jn,{errors:(z=d.conda_env)!=null&&z.message?[d.conda_env.message]:void 0,children:[_.jsx(Zn,{htmlFor:"conda_env",required:!0,children:"Conda Environment"}),_.jsx(er,{name:"conda_env",control:p,rules:Mo,render:({field:{ref:$,...H}})=>_.jsx(Qa,{...H,id:"conda_env",options:[{value:"",label:"Select..."},...h.map(ce=>({value:ce,label:ce}))]})}),((le=d.conda_env)==null?void 0:le.message)&&_.jsx(Fo,{errors:[d.conda_env.message]})]}):_.jsx(_.Fragment,{}),S&&S.length>0?_.jsxs(Jn,{errors:(Ee=d.profile)!=null&&Ee.message?[d.profile.message]:void 0,children:[_.jsx(Zn,{htmlFor:"profile",required:!0,children:"Spawner Profile"}),_.jsx(er,{name:"profile",control:p,rules:Mo,render:({field:{ref:$,...H}})=>_.jsx(Qa,{...H,id:"profile",options:[{value:"",label:"Select..."},...S.map(ce=>({value:ce.display_name,label:ce.display_name}))]})}),((ge=d.profile)==null?void 0:ge.message)&&_.jsx(Fo,{errors:[d.profile.message]})]}):_.jsx(_.Fragment,{}),m==="custom"?_.jsxs(Jn,{errors:(we=d.custom_command)!=null&&we.message?[d.custom_command.message]:void 0,children:[_.jsx(Zn,{htmlFor:"custom_command",required:!0,children:"Custom Command"}),_.jsx(er,{name:"custom_command",control:p,rules:Mo,render:({field:{ref:$,...H}})=>_.jsx(xi,{...H,id:"custom_command"})}),((V=d.custom_command)==null?void 0:V.message)&&_.jsx(Fo,{errors:[d.custom_command.message]})]}):_.jsx(_.Fragment,{}),_.jsxs(yg,{children:[_.jsx(lo,{id:"cancel-btn",type:"button",variant:"secondary",onClick:t,children:"Cancel"}),_.jsx(lo,{id:"submit-btn",type:"submit",disabled:o,children:"Submit"})]})]})},zA=({id:e,title:t,description:n,thumbnail:r,framework:o,url:s})=>{const i=ra(),[l,a]=U.useState(!1),[,u]=Wn(Fs),[c,f]=U.useState(!1),[h,S]=U.useState(!1),p=async({id:m})=>await cn.delete(`/server/${m}`),{mutate:v}=fc({mutationFn:p,retry:1}),x=()=>{a(!0),v({id:e},{onSuccess:async()=>{a(!1),f(!1),i.invalidateQueries(["app-state"])},onError:async m=>{a(!1),u(m.message)}})},y=[{id:"edit",title:"Edit",onClick:()=>S(!0),visible:!0},{id:"delete",title:"Delete",onClick:()=>f(!0),visible:!0}],d=_.jsxs(_.Fragment,{children:[_.jsxs("p",{className:"w-[400px] mb-6",children:["Are you sure you want to delete ",_.jsx("b",{children:t}),"? This action is permanent and cannot be reversed."]}),_.jsxs(yg,{children:[_.jsx(lo,{id:"cancel-btn",variant:"secondary",onClick:()=>f(!1),children:"Cancel"}),_.jsx(lo,{id:"delete-btn",variant:"primary",onClick:()=>x(),disabled:l,children:"Delete"})]})]});return _.jsxs("div",{className:"card",id:`card-${e}`,tabIndex:0,children:[_.jsxs("div",{className:"card-header-media",children:[_.jsxs("div",{className:"card-header-menu",children:[_.jsx(tN,{id:`card-menu-${e}`,items:y}),c&&_.jsx(dc,{title:`Delete ${t}`,setIsOpen:f,body:d}),h&&_.jsx(dc,{title:`Edit ${t}`,setIsOpen:S,body:_.jsx(Zg,{id:e,onCancel:()=>S(!1),onSubmit:()=>S(!1)})})]}),_.jsx("div",{className:"card-header-img",children:r?_.jsx("img",{src:r,alt:"App thumb"}):void 0})]}),_.jsx("div",{className:"card-header",children:_.jsx("h3",{className:"font-bold",children:_.jsx("a",{href:s,children:t})})}),_.jsx("div",{className:"card-body",children:_.jsx("p",{className:"text-sm",children:n})}),_.jsx("div",{className:"card-footer",children:_.jsx(nN,{id:`tag-${e}`,children:o})})]})},hp=({appType:e="My",filter:t})=>{const[n]=Wn(If),[,r]=Wn(Fs),[o,s]=U.useState([]),{isLoading:i,error:l,data:a}=Ir({queryKey:["app-state"],queryFn:()=>cn.get("/server/").then(u=>u.data).then(u=>u),enabled:!!n.user});return U.useEffect(()=>{if(!i&&a){const u=t.toLowerCase();s(()=>EA(a,e).filter(c=>{var f,h;return c.name.toLowerCase().includes(u)||((f=c.description)==null?void 0:f.toLowerCase().includes(u))||((h=c.framework)==null?void 0:h.toLowerCase().includes(u))}))}},[i,a,e,t]),U.useEffect(()=>{r(l?l.message:void 0)},[l,r]),_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"container grid grid-cols-12 flex flex-align-center pb-12",children:[_.jsx("div",{className:"col-span-1",children:_.jsxs("h2",{className:"whitespace-nowrap font-bold",children:[e," Apps"]})}),_.jsx("div",{className:"col-span-10",children:_.jsx("hr",{className:"spacer"})}),_.jsx("div",{className:"col-span-1 flex justify-end",children:_.jsxs("h2",{className:"whitespace-nowrap font-bold",children:[o.length," apps"]})})]}),_.jsx("div",{className:"container grid pb-12",children:o.length>0?_.jsx("div",{className:"flex flex flex-row flex-wrap gap-4",children:o.map(u=>_.jsx(zA,{id:u.id,title:u.name,description:u.description,thumbnail:u.thumbnail,framework:u.framework,url:u.url,ready:u.ready},`app-${u.id}`))}):_.jsx("div",{children:"No apps available"})})]})},HA=Ig.create({baseURL:"/api",headers:{"Content-Type":"application/json",Authorization:"Authorization: token 13748105b2e64b9082e10f802b04f523"},params:{_xsrf:Wf().xsrf_token}}),WA=()=>{const[e]=Wn(If),[,t]=Wn(Fs),[n,r]=U.useState([]),{isLoading:o,error:s,data:i}=Ir({queryKey:["service-data"],queryFn:()=>HA.get("/services").then(a=>a.data).then(a=>a),enabled:!!e.user}),l=(a,u)=>{u?window.open(a,"_blank"):window.location.assign(a)};return U.useEffect(()=>{!o&&i&&r(()=>RA(i,e.user))},[o,i,e.user]),U.useEffect(()=>{t(s?s.message:void 0)},[s,t]),_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"container grid grid-cols-12 flex flex-align-center pb-12",children:[_.jsx("div",{className:"col-span-1",children:_.jsx("h2",{className:"whitespace-nowrap font-bold",children:"Services"})}),_.jsx("div",{className:"col-span-10",children:_.jsx("hr",{className:"spacer"})}),_.jsx("div",{className:"col-span-1 flex justify-end",children:_.jsxs("h2",{className:"whitespace-nowrap font-bold",children:[n.length," services"]})})]}),_.jsx("div",{className:"container grid pb-12",children:n.length>0?_.jsx("div",{className:"flex flex flex-row flex-wrap gap-4",children:n.map((a,u)=>_.jsx(lo,{id:`service-${u}`,variant:"secondary",style:{minWidth:"180px"},onClick:()=>{l(a.url,a.external)},children:a.name},`service-${u}`))}):_.jsx("div",{children:"No services available"})})]})},pp=()=>{const[e,t]=U.useState(!1),[n]=Wn(Fs),[r,o]=U.useState(""),s=i=>{const l=i.target;o(l.value)};return _.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"container grid grid-cols-12 pb-12",children:[_.jsx("div",{className:"md:col-span-2 xs:col-span-12",children:_.jsx("h1",{className:"text-3xl font-bold",children:"Home"})}),_.jsx("div",{className:"md:col-span-8 xs:col-span-8",children:_.jsx(xi,{id:"search",placeholder:"Search...","aria-label":"Search for an app",className:"w-full mt-0",onChange:s})}),_.jsxs("div",{className:"md:col-span-2 xs:col-span-4 flex justify-end",children:[_.jsx(lo,{id:"create-app",onClick:()=>{t(!0)},children:"Create App"}),e&&_.jsx(dc,{title:"Create New App",setIsOpen:t,body:_.jsx(Zg,{onCancel:()=>t(!1)})})]})]}),n&&_.jsx("div",{className:"container grid grid-cols-12 pb-2",children:_.jsx("div",{className:"col-span-12",children:_.jsx(Kk,{id:"alert-notification",type:"error",children:n})})}),_.jsx(WA,{}),_.jsx(hp,{appType:"My",filter:r}),_.jsx(hp,{appType:"Shared",filter:r})]})},QA=new gk,qA=()=>{const[,e]=Wn(If);return U.useEffect(()=>{e(Wf())},[e]),_.jsx(bk,{client:QA,children:_.jsx("div",{children:_.jsx("main",{className:"my-6",children:_.jsxs(c_,{children:[_.jsx(Yu,{path:"/home",element:_.jsx(pp,{})}),_.jsx(Yu,{path:"/",element:_.jsx(pp,{})})]})})})})};tu.createRoot(document.getElementById("root")).render(_.jsx(re.StrictMode,{children:_.jsx(d_,{basename:"/hub",children:_.jsx(rk,{children:_.jsx(qA,{})})})})); +`):" "+tp(s[0]):"as no adapter specified";throw new ye("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:mc};function Ya(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ms(null,e)}function np(e){return Ya(e),e.headers=pn.from(e.headers),e.data=Ga.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Dg.getAdapter(e.adapter||Bf.adapter)(e).then(function(r){return Ya(e),r.data=Ga.call(e,e.transformResponse,r),r.headers=pn.from(r.headers),r},function(r){return bg(r)||(Ya(e),r&&r.response&&(r.response.data=Ga.call(e,e.transformResponse,r.response),r.response.headers=pn.from(r.response.headers))),Promise.reject(r)})}const rp=e=>e instanceof pn?e.toJSON():e;function ao(e,t){t=t||{};const n={};function r(u,c,f){return P.isPlainObject(u)&&P.isPlainObject(c)?P.merge.call({caseless:f},u,c):P.isPlainObject(c)?P.merge({},c):P.isArray(c)?c.slice():c}function o(u,c,f){if(P.isUndefined(c)){if(!P.isUndefined(u))return r(void 0,u,f)}else return r(u,c,f)}function s(u,c){if(!P.isUndefined(c))return r(void 0,c)}function i(u,c){if(P.isUndefined(c)){if(!P.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function l(u,c,f){if(f in t)return r(u,c);if(f in e)return r(void 0,u)}const a={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(u,c)=>o(rp(u),rp(c),!0)};return P.forEach(Object.keys(Object.assign({},e,t)),function(c){const f=a[c]||o,h=f(e[c],t[c],c);P.isUndefined(h)&&f!==l||(n[c]=h)}),n}const Mg="1.6.2",zf={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{zf[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const op={};zf.transitional=function(t,n,r){function o(s,i){return"[Axios v"+Mg+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,l)=>{if(t===!1)throw new ye(o(i," has been removed"+(n?" in "+n:"")),ye.ERR_DEPRECATED);return n&&!op[i]&&(op[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,i,l):!0}};function yA(e,t,n){if(typeof e!="object")throw new ye("options must be an object",ye.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const l=e[s],a=l===void 0||i(l,s,e);if(a!==!0)throw new ye("option "+s+" must be "+a,ye.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ye("Unknown option "+s,ye.ERR_BAD_OPTION)}}const yc={assertOptions:yA,validators:zf},En=yc.validators;class fl{constructor(t){this.defaults=t,this.interceptors={request:new Xh,response:new Xh}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ao(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&yc.assertOptions(r,{silentJSONParsing:En.transitional(En.boolean),forcedJSONParsing:En.transitional(En.boolean),clarifyTimeoutError:En.transitional(En.boolean)},!1),o!=null&&(P.isFunction(o)?n.paramsSerializer={serialize:o}:yc.assertOptions(o,{encode:En.function,serialize:En.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&P.merge(s.common,s[n.method]);s&&P.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),n.headers=pn.concat(i,s);const l=[];let a=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(a=a&&v.synchronous,l.unshift(v.fulfilled,v.rejected))});const u=[];this.interceptors.response.forEach(function(v){u.push(v.fulfilled,v.rejected)});let c,f=0,h;if(!a){const p=[np.bind(this),void 0];for(p.unshift.apply(p,l),p.push.apply(p,u),h=p.length,c=Promise.resolve(n);f{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(l=>{r.subscribe(l),s=l}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},t(function(s,i,l){r.reason||(r.reason=new Ms(s,i,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new Hf(function(o){t=o}),cancel:t}}}const vA=Hf;function gA(e){return function(n){return e.apply(null,n)}}function SA(e){return P.isObject(e)&&e.isAxiosError===!0}const vc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(vc).forEach(([e,t])=>{vc[t]=e});const wA=vc;function Ug(e){const t=new Ni(e),n=vg(Ni.prototype.request,t);return P.extend(n,Ni.prototype,t,{allOwnKeys:!0}),P.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Ug(ao(e,o))},n}const We=Ug(Bf);We.Axios=Ni;We.CanceledError=Ms;We.CancelToken=vA;We.isCancel=bg;We.VERSION=Mg;We.toFormData=la;We.AxiosError=ye;We.Cancel=We.CanceledError;We.all=function(t){return Promise.all(t)};We.spread=gA;We.isAxiosError=SA;We.mergeConfig=ao;We.AxiosHeaders=pn;We.formToJSON=e=>Og(P.isHTMLForm(e)?new FormData(e):e);We.getAdapter=Dg.getAdapter;We.HttpStatusCode=wA;We.default=We;const Ig=We,cn=Ig.create({baseURL:"/services/japps",headers:{"Content-Type":"application/json"}});cn.interceptors.response.use(e=>e,e=>{const t=e.response.status;(e.response.status===401||t===403)&&(window.location.href="/services/japps/jhub-login")});const _A="This field is required.",Mo={required:_A},Wf=()=>window.jhdata,RA=(e,t)=>{var r;const n=[];for(const o in e)if(Object.hasOwnProperty.call(e,o)){const s=e[o];s.display===!0&&n.push({name:s.info.name,url:(r=s.info.url)==null?void 0:r.replace("[USER]",t),external:s.info.external})}return n},EA=(e,t)=>{var r;const n=[];for(const o in e)if(Object.hasOwnProperty.call(e,o)){const s=e[o];if((r=s.user_options)!=null&&r.jhub_app){const i=s.user_options;n.push({id:i.name,name:i.display_name,description:i.description,framework:CA(i.framework),url:s.url,thumbnail:i.thumbnail,shared:!1,ready:i.ready})}}return t.toLowerCase()==="shared"?n.filter(o=>o.shared===!0):n.filter(o=>o.shared===!1)},CA=e=>e.charAt(0).toUpperCase()+e.slice(1);var Us=e=>e.type==="checkbox",Vr=e=>e instanceof Date,at=e=>e==null;const Vg=e=>typeof e=="object";var Ke=e=>!at(e)&&!Array.isArray(e)&&Vg(e)&&!Vr(e),$g=e=>Ke(e)&&e.target?Us(e.target)?e.target.checked:e.target.value:e,xA=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,jg=(e,t)=>e.has(xA(t)),TA=e=>{const t=e.constructor&&e.constructor.prototype;return Ke(t)&&t.hasOwnProperty("isPrototypeOf")},Qf=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Bt(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Qf&&(e instanceof Blob||e instanceof FileList))&&(n||Ke(e)))if(t=n?[]:{},!n&&!TA(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Bt(e[r]));else return e;return t}var Is=e=>Array.isArray(e)?e.filter(Boolean):[],je=e=>e===void 0,q=(e,t,n)=>{if(!t||!Ke(e))return n;const r=Is(t.split(/[,[\].]+?/)).reduce((o,s)=>at(o)?o:o[s],e);return je(r)||r===e?je(e[t])?n:e[t]:r},bn=e=>typeof e=="boolean";const dl={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Wt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ln={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},kA=re.createContext(null),qf=()=>re.useContext(kA);var Bg=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==Wt.all&&(t._proxyFormState[i]=!r||Wt.all),n&&(n[i]=!0),e[i]}});return o},Lt=e=>Ke(e)&&!Object.keys(e).length,zg=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return Lt(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===(!r||Wt.all))},Ai=e=>Array.isArray(e)?e:[e],Hg=(e,t,n)=>!e||!t||e===t||Ai(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function Kf(e){const t=re.useRef(e);t.current=e,re.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function NA(e){const t=qf(),{control:n=t.control,disabled:r,name:o,exact:s}=e||{},[i,l]=re.useState(n._formState),a=re.useRef(!0),u=re.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),c=re.useRef(o);return c.current=o,Kf({disabled:r,next:f=>a.current&&Hg(c.current,f.name,s)&&zg(f,u.current,n._updateFormState)&&l({...n._formState,...f}),subject:n._subjects.state}),re.useEffect(()=>(a.current=!0,u.current.isValid&&n._updateValid(!0),()=>{a.current=!1}),[n]),Bg(i,n,u.current,!1)}var en=e=>typeof e=="string",Wg=(e,t,n,r,o)=>en(e)?(r&&t.watch.add(e),q(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),q(n,s))):(r&&(t.watchAll=!0),n);function AA(e){const t=qf(),{control:n=t.control,name:r,defaultValue:o,disabled:s,exact:i}=e||{},l=re.useRef(r);l.current=r,Kf({disabled:s,subject:n._subjects.values,next:c=>{Hg(l.current,c.name,i)&&u(Bt(Wg(l.current,n._names,c.values||n._formValues,!1,o)))}});const[a,u]=re.useState(n._getWatch(r,o));return re.useEffect(()=>n._removeUnmounted()),a}var Gf=e=>/^\w*$/.test(e),Qg=e=>Is(e.replace(/["|']|\]/g,"").split(/\.|\[/));function ke(e,t,n){let r=-1;const o=Gf(t)?[t]:Qg(t),s=o.length,i=s-1;for(;++r{const c=o._options.shouldUnregister||s,f=(h,S)=>{const p=q(o._fields,h);p&&(p._f.mount=S)};if(f(n,!0),c){const h=Bt(q(o._options.defaultValues,n));ke(o._defaultValues,n,h),je(q(o._formValues,n))&&ke(o._formValues,n,h)}return()=>{(i?c&&!o._state.action:c)?o.unregister(n):f(n,!1)}},[n,o,i,s]),re.useEffect(()=>{q(o._fields,n)&&o._updateDisabledField({disabled:r,fields:o._fields,name:n})},[r,n,o]),{field:{name:n,value:l,...bn(r)?{disabled:r}:{},onChange:re.useCallback(c=>u.current.onChange({target:{value:$g(c),name:n},type:dl.CHANGE}),[n]),onBlur:re.useCallback(()=>u.current.onBlur({target:{value:q(o._formValues,n),name:n},type:dl.BLUR}),[n,o]),ref:c=>{const f=q(o._fields,n);f&&c&&(f._f.ref={focus:()=>c.focus(),select:()=>c.select(),setCustomValidity:h=>c.setCustomValidity(h),reportValidity:()=>c.reportValidity()})}},formState:a,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!q(a.errors,n)},isDirty:{enumerable:!0,get:()=>!!q(a.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!q(a.touchedFields,n)},error:{enumerable:!0,get:()=>q(a.errors,n)}})}}const er=e=>e.render(LA(e));var PA=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{};const gc=(e,t,n)=>{for(const r of n||Object.keys(e)){const o=q(e,r);if(o){const{_f:s,...i}=o;if(s&&t(s.name)){if(s.ref.focus){s.ref.focus();break}else if(s.refs&&s.refs[0].focus){s.refs[0].focus();break}}else Ke(i)&&gc(i,t)}}};var sp=e=>({isOnSubmit:!e||e===Wt.onSubmit,isOnBlur:e===Wt.onBlur,isOnChange:e===Wt.onChange,isOnAll:e===Wt.all,isOnTouch:e===Wt.onTouched}),ip=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length)))),OA=(e,t,n)=>{const r=Is(q(e,n));return ke(r,"root",t[n]),ke(e,n,r),e},Yf=e=>e.type==="file",Fn=e=>typeof e=="function",hl=e=>{if(!Qf)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Li=e=>en(e),Jf=e=>e.type==="radio",pl=e=>e instanceof RegExp;const lp={value:!1,isValid:!1},ap={value:!0,isValid:!0};var qg=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!je(e[0].attributes.value)?je(e[0].value)||e[0].value===""?ap:{value:e[0].value,isValid:!0}:ap:lp}return lp};const up={isValid:!1,value:null};var Kg=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,up):up;function cp(e,t,n="validate"){if(Li(e)||Array.isArray(e)&&e.every(Li)||bn(e)&&!e)return{type:n,message:Li(e)?e:"",ref:t}}var xr=e=>Ke(e)&&!pl(e)?e:{value:e,message:""},fp=async(e,t,n,r,o)=>{const{ref:s,refs:i,required:l,maxLength:a,minLength:u,min:c,max:f,pattern:h,validate:S,name:p,valueAsNumber:v,mount:x,disabled:y}=e._f,d=q(t,p);if(!x||y)return{};const m=i?i[0]:s,R=ue=>{r&&m.reportValidity&&(m.setCustomValidity(bn(ue)?"":ue||""),m.reportValidity())},k={},A=Jf(s),N=Us(s),O=A||N,Z=(v||Yf(s))&&je(s.value)&&je(d)||hl(s)&&s.value===""||d===""||Array.isArray(d)&&!d.length,Y=PA.bind(null,p,n,k),me=(ue,z,le,Ee=ln.maxLength,ge=ln.minLength)=>{const we=ue?z:le;k[p]={type:ue?Ee:ge,message:we,ref:s,...Y(ue?Ee:ge,we)}};if(o?!Array.isArray(d)||!d.length:l&&(!O&&(Z||at(d))||bn(d)&&!d||N&&!qg(i).isValid||A&&!Kg(i).isValid)){const{value:ue,message:z}=Li(l)?{value:!!l,message:l}:xr(l);if(ue&&(k[p]={type:ln.required,message:z,ref:m,...Y(ln.required,z)},!n))return R(z),k}if(!Z&&(!at(c)||!at(f))){let ue,z;const le=xr(f),Ee=xr(c);if(!at(d)&&!isNaN(d)){const ge=s.valueAsNumber||d&&+d;at(le.value)||(ue=ge>le.value),at(Ee.value)||(z=genew Date(new Date().toDateString()+" "+H),V=s.type=="time",$=s.type=="week";en(le.value)&&d&&(ue=V?we(d)>we(le.value):$?d>le.value:ge>new Date(le.value)),en(Ee.value)&&d&&(z=V?we(d)+ue.value,Ee=!at(z.value)&&d.length<+z.value;if((le||Ee)&&(me(le,ue.message,z.message),!n))return R(k[p].message),k}if(h&&!Z&&en(d)){const{value:ue,message:z}=xr(h);if(pl(ue)&&!d.match(ue)&&(k[p]={type:ln.pattern,message:z,ref:s,...Y(ln.pattern,z)},!n))return R(z),k}if(S){if(Fn(S)){const ue=await S(d,t),z=cp(ue,m);if(z&&(k[p]={...z,...Y(ln.validate,z.message)},!n))return R(z.message),k}else if(Ke(S)){let ue={};for(const z in S){if(!Lt(ue)&&!n)break;const le=cp(await S[z](d,t),m,z);le&&(ue={...le,...Y(z,le.message)},R(le.message),n&&(k[p]=ue))}if(!Lt(ue)&&(k[p]={ref:m,...ue},!n))return k}}return R(!0),k};function bA(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}}var ml=e=>at(e)||!Vg(e);function ar(e,t){if(ml(e)||ml(t))return e===t;if(Vr(e)&&Vr(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const s=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const i=t[o];if(Vr(s)&&Vr(i)||Ke(s)&&Ke(i)||Array.isArray(s)&&Array.isArray(i)?!ar(s,i):s!==i)return!1}}return!0}var Gg=e=>e.type==="select-multiple",DA=e=>Jf(e)||Us(e),Xa=e=>hl(e)&&e.isConnected,Yg=e=>{for(const t in e)if(Fn(e[t]))return!0;return!1};function yl(e,t={}){const n=Array.isArray(e);if(Ke(e)||n)for(const r in e)Array.isArray(e[r])||Ke(e[r])&&!Yg(e[r])?(t[r]=Array.isArray(e[r])?[]:{},yl(e[r],t[r])):at(e[r])||(t[r]=!0);return t}function Jg(e,t,n){const r=Array.isArray(e);if(Ke(e)||r)for(const o in e)Array.isArray(e[o])||Ke(e[o])&&!Yg(e[o])?je(t)||ml(n[o])?n[o]=Array.isArray(e[o])?yl(e[o],[]):{...yl(e[o])}:Jg(e[o],at(t)?{}:t[o],n[o]):n[o]=!ar(e[o],t[o]);return n}var Za=(e,t)=>Jg(e,t,yl(t)),Xg=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>je(e)?e:t?e===""?NaN:e&&+e:n&&en(e)?new Date(e):r?r(e):e;function eu(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return Yf(t)?t.files:Jf(t)?Kg(e.refs).value:Gg(t)?[...t.selectedOptions].map(({value:n})=>n):Us(t)?qg(e.refs).value:Xg(je(t.value)?e.ref.value:t.value,e)}var MA=(e,t,n,r)=>{const o={};for(const s of e){const i=q(t,s);i&&ke(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Uo=e=>je(e)?e:pl(e)?e.source:Ke(e)?pl(e.value)?e.value.source:e.value:e,UA=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function dp(e,t,n){const r=q(e,n);if(r||Gf(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=q(t,s),l=q(e,s);if(i&&!Array.isArray(i)&&n!==s)return{name:n};if(l&&l.type)return{name:s,error:l};o.pop()}return{name:n}}var IA=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,VA=(e,t)=>!Is(q(e,t)).length&&Xe(e,t);const $A={mode:Wt.onSubmit,reValidateMode:Wt.onChange,shouldFocusError:!0};function jA(e={},t){let n={...$A,...e},r={submitCount:0,isDirty:!1,isLoading:Fn(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},o={},s=Ke(n.defaultValues)||Ke(n.values)?Bt(n.defaultValues||n.values)||{}:{},i=n.shouldUnregister?{}:Bt(s),l={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0;const f={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={values:Ja(),array:Ja(),state:Ja()},S=e.resetOptions&&e.resetOptions.keepDirtyValues,p=sp(n.mode),v=sp(n.reValidateMode),x=n.criteriaMode===Wt.all,y=g=>T=>{clearTimeout(c),c=setTimeout(g,T)},d=async g=>{if(f.isValid||g){const T=n.resolver?Lt((await Z()).errors):await me(o,!0);T!==r.isValid&&h.state.next({isValid:T})}},m=g=>f.isValidating&&h.state.next({isValidating:g}),R=(g,T=[],L,J,B=!0,I=!0)=>{if(J&&L){if(l.action=!0,I&&Array.isArray(q(o,g))){const te=L(q(o,g),J.argA,J.argB);B&&ke(o,g,te)}if(I&&Array.isArray(q(r.errors,g))){const te=L(q(r.errors,g),J.argA,J.argB);B&&ke(r.errors,g,te),VA(r.errors,g)}if(f.touchedFields&&I&&Array.isArray(q(r.touchedFields,g))){const te=L(q(r.touchedFields,g),J.argA,J.argB);B&&ke(r.touchedFields,g,te)}f.dirtyFields&&(r.dirtyFields=Za(s,i)),h.state.next({name:g,isDirty:z(g,T),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ke(i,g,T)},k=(g,T)=>{ke(r.errors,g,T),h.state.next({errors:r.errors})},A=(g,T,L,J)=>{const B=q(o,g);if(B){const I=q(i,g,je(L)?q(s,g):L);je(I)||J&&J.defaultChecked||T?ke(i,g,T?I:eu(B._f)):ge(g,I),l.mount&&d()}},N=(g,T,L,J,B)=>{let I=!1,te=!1;const Te={name:g};if(!L||J){f.isDirty&&(te=r.isDirty,r.isDirty=Te.isDirty=z(),I=te!==Te.isDirty);const Ae=ar(q(s,g),T);te=q(r.dirtyFields,g),Ae?Xe(r.dirtyFields,g):ke(r.dirtyFields,g,!0),Te.dirtyFields=r.dirtyFields,I=I||f.dirtyFields&&te!==!Ae}if(L){const Ae=q(r.touchedFields,g);Ae||(ke(r.touchedFields,g,L),Te.touchedFields=r.touchedFields,I=I||f.touchedFields&&Ae!==L)}return I&&B&&h.state.next(Te),I?Te:{}},O=(g,T,L,J)=>{const B=q(r.errors,g),I=f.isValid&&bn(T)&&r.isValid!==T;if(e.delayError&&L?(u=y(()=>k(g,L)),u(e.delayError)):(clearTimeout(c),u=null,L?ke(r.errors,g,L):Xe(r.errors,g)),(L?!ar(B,L):B)||!Lt(J)||I){const te={...J,...I&&bn(T)?{isValid:T}:{},errors:r.errors,name:g};r={...r,...te},h.state.next(te)}m(!1)},Z=async g=>n.resolver(i,n.context,MA(g||a.mount,o,n.criteriaMode,n.shouldUseNativeValidation)),Y=async g=>{const{errors:T}=await Z(g);if(g)for(const L of g){const J=q(T,L);J?ke(r.errors,L,J):Xe(r.errors,L)}else r.errors=T;return T},me=async(g,T,L={valid:!0})=>{for(const J in g){const B=g[J];if(B){const{_f:I,...te}=B;if(I){const Te=a.array.has(I.name),Ae=await fp(B,i,x,n.shouldUseNativeValidation&&!T,Te);if(Ae[I.name]&&(L.valid=!1,T))break;!T&&(q(Ae,I.name)?Te?OA(r.errors,Ae,I.name):ke(r.errors,I.name,Ae[I.name]):Xe(r.errors,I.name))}te&&await me(te,T,L)}}return L.valid},ue=()=>{for(const g of a.unMount){const T=q(o,g);T&&(T._f.refs?T._f.refs.every(L=>!Xa(L)):!Xa(T._f.ref))&&j(g)}a.unMount=new Set},z=(g,T)=>(g&&T&&ke(i,g,T),!ar(ce(),s)),le=(g,T,L)=>Wg(g,a,{...l.mount?i:je(T)?s:en(g)?{[g]:T}:T},L,T),Ee=g=>Is(q(l.mount?i:s,g,e.shouldUnregister?q(s,g,[]):[])),ge=(g,T,L={})=>{const J=q(o,g);let B=T;if(J){const I=J._f;I&&(!I.disabled&&ke(i,g,Xg(T,I)),B=hl(I.ref)&&at(T)?"":T,Gg(I.ref)?[...I.ref.options].forEach(te=>te.selected=B.includes(te.value)):I.refs?Us(I.ref)?I.refs.length>1?I.refs.forEach(te=>(!te.defaultChecked||!te.disabled)&&(te.checked=Array.isArray(B)?!!B.find(Te=>Te===te.value):B===te.value)):I.refs[0]&&(I.refs[0].checked=!!B):I.refs.forEach(te=>te.checked=te.value===B):Yf(I.ref)?I.ref.value="":(I.ref.value=B,I.ref.type||h.values.next({name:g,values:{...i}})))}(L.shouldDirty||L.shouldTouch)&&N(g,B,L.shouldTouch,L.shouldDirty,!0),L.shouldValidate&&H(g)},we=(g,T,L)=>{for(const J in T){const B=T[J],I=`${g}.${J}`,te=q(o,I);(a.array.has(g)||!ml(B)||te&&!te._f)&&!Vr(B)?we(I,B,L):ge(I,B,L)}},V=(g,T,L={})=>{const J=q(o,g),B=a.array.has(g),I=Bt(T);ke(i,g,I),B?(h.array.next({name:g,values:{...i}}),(f.isDirty||f.dirtyFields)&&L.shouldDirty&&h.state.next({name:g,dirtyFields:Za(s,i),isDirty:z(g,I)})):J&&!J._f&&!at(I)?we(g,I,L):ge(g,I,L),ip(g,a)&&h.state.next({...r}),h.values.next({name:g,values:{...i}}),!l.mount&&t()},$=async g=>{const T=g.target;let L=T.name,J=!0;const B=q(o,L),I=()=>T.type?eu(B._f):$g(g);if(B){let te,Te;const Ae=I(),_n=g.type===dl.BLUR||g.type===dl.FOCUS_OUT,ua=!UA(B._f)&&!n.resolver&&!q(r.errors,L)&&!B._f.deps||IA(_n,q(r.touchedFields,L),r.isSubmitted,v,p),vo=ip(L,a,_n);ke(i,L,Ae),_n?(B._f.onBlur&&B._f.onBlur(g),u&&u(0)):B._f.onChange&&B._f.onChange(g);const go=N(L,Ae,_n,!1),ca=!Lt(go)||vo;if(!_n&&h.values.next({name:L,type:g.type,values:{...i}}),ua)return f.isValid&&d(),ca&&h.state.next({name:L,...vo?{}:go});if(!_n&&vo&&h.state.next({...r}),m(!0),n.resolver){const{errors:Vs}=await Z([L]),$s=dp(r.errors,o,L),js=dp(Vs,o,$s.name||L);te=js.error,L=js.name,Te=Lt(Vs)}else te=(await fp(B,i,x,n.shouldUseNativeValidation))[L],J=Number.isNaN(Ae)||Ae===q(i,L,Ae),J&&(te?Te=!1:f.isValid&&(Te=await me(o,!0)));J&&(B._f.deps&&H(B._f.deps),O(L,Te,te,go))}},H=async(g,T={})=>{let L,J;const B=Ai(g);if(m(!0),n.resolver){const I=await Y(je(g)?g:B);L=Lt(I),J=g?!B.some(te=>q(I,te)):L}else g?(J=(await Promise.all(B.map(async I=>{const te=q(o,I);return await me(te&&te._f?{[I]:te}:te)}))).every(Boolean),!(!J&&!r.isValid)&&d()):J=L=await me(o);return h.state.next({...!en(g)||f.isValid&&L!==r.isValid?{}:{name:g},...n.resolver||!g?{isValid:L}:{},errors:r.errors,isValidating:!1}),T.shouldFocus&&!J&&gc(o,I=>I&&q(r.errors,I),g?B:a.mount),J},ce=g=>{const T={...s,...l.mount?i:{}};return je(g)?T:en(g)?q(T,g):g.map(L=>q(T,L))},E=(g,T)=>({invalid:!!q((T||r).errors,g),isDirty:!!q((T||r).dirtyFields,g),isTouched:!!q((T||r).touchedFields,g),error:q((T||r).errors,g)}),b=g=>{g&&Ai(g).forEach(T=>Xe(r.errors,T)),h.state.next({errors:g?r.errors:{}})},F=(g,T,L)=>{const J=(q(o,g,{_f:{}})._f||{}).ref;ke(r.errors,g,{...T,ref:J}),h.state.next({name:g,errors:r.errors,isValid:!1}),L&&L.shouldFocus&&J&&J.focus&&J.focus()},X=(g,T)=>Fn(g)?h.values.subscribe({next:L=>g(le(void 0,T),L)}):le(g,T,!0),j=(g,T={})=>{for(const L of g?Ai(g):a.mount)a.mount.delete(L),a.array.delete(L),T.keepValue||(Xe(o,L),Xe(i,L)),!T.keepError&&Xe(r.errors,L),!T.keepDirty&&Xe(r.dirtyFields,L),!T.keepTouched&&Xe(r.touchedFields,L),!n.shouldUnregister&&!T.keepDefaultValue&&Xe(s,L);h.values.next({values:{...i}}),h.state.next({...r,...T.keepDirty?{isDirty:z()}:{}}),!T.keepIsValid&&d()},oe=({disabled:g,name:T,field:L,fields:J})=>{if(bn(g)){const B=g?void 0:q(i,T,eu(L?L._f:q(J,T)._f));ke(i,T,B),N(T,B,!1,!1,!0)}},ne=(g,T={})=>{let L=q(o,g);const J=bn(T.disabled);return ke(o,g,{...L||{},_f:{...L&&L._f?L._f:{ref:{name:g}},name:g,mount:!0,...T}}),a.mount.add(g),L?oe({field:L,disabled:T.disabled,name:g}):A(g,!0,T.value),{...J?{disabled:T.disabled}:{},...n.progressive?{required:!!T.required,min:Uo(T.min),max:Uo(T.max),minLength:Uo(T.minLength),maxLength:Uo(T.maxLength),pattern:Uo(T.pattern)}:{},name:g,onChange:$,onBlur:$,ref:B=>{if(B){ne(g,T),L=q(o,g);const I=je(B.value)&&B.querySelectorAll&&B.querySelectorAll("input,select,textarea")[0]||B,te=DA(I),Te=L._f.refs||[];if(te?Te.find(Ae=>Ae===I):I===L._f.ref)return;ke(o,g,{_f:{...L._f,...te?{refs:[...Te.filter(Xa),I,...Array.isArray(q(s,g))?[{}]:[]],ref:{type:I.type,name:g}}:{ref:I}}}),A(g,!1,void 0,I)}else L=q(o,g,{}),L._f&&(L._f.mount=!1),(n.shouldUnregister||T.shouldUnregister)&&!(jg(a.array,g)&&l.action)&&a.unMount.add(g)}}},ee=()=>n.shouldFocusError&&gc(o,g=>g&&q(r.errors,g),a.mount),_e=(g,T)=>async L=>{L&&(L.preventDefault&&L.preventDefault(),L.persist&&L.persist());let J=Bt(i);if(h.state.next({isSubmitting:!0}),n.resolver){const{errors:B,values:I}=await Z();r.errors=B,J=I}else await me(o);Xe(r.errors,"root"),Lt(r.errors)?(h.state.next({errors:{}}),await g(J,L)):(T&&await T({...r.errors},L),ee(),setTimeout(ee)),h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Lt(r.errors),submitCount:r.submitCount+1,errors:r.errors})},ze=(g,T={})=>{q(o,g)&&(je(T.defaultValue)?V(g,q(s,g)):(V(g,T.defaultValue),ke(s,g,T.defaultValue)),T.keepTouched||Xe(r.touchedFields,g),T.keepDirty||(Xe(r.dirtyFields,g),r.isDirty=T.defaultValue?z(g,q(s,g)):z()),T.keepError||(Xe(r.errors,g),f.isValid&&d()),h.state.next({...r}))},Se=(g,T={})=>{const L=g?Bt(g):s,J=Bt(L),B=g&&!Lt(g)?J:s;if(T.keepDefaultValues||(s=L),!T.keepValues){if(T.keepDirtyValues||S)for(const I of a.mount)q(r.dirtyFields,I)?ke(B,I,q(i,I)):V(I,q(B,I));else{if(Qf&&je(g))for(const I of a.mount){const te=q(o,I);if(te&&te._f){const Te=Array.isArray(te._f.refs)?te._f.refs[0]:te._f.ref;if(hl(Te)){const Ae=Te.closest("form");if(Ae){Ae.reset();break}}}}o={}}i=e.shouldUnregister?T.keepDefaultValues?Bt(s):{}:Bt(B),h.array.next({values:{...B}}),h.values.next({values:{...B}})}a={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!l.mount&&t(),l.mount=!f.isValid||!!T.keepIsValid,l.watch=!!e.shouldUnregister,h.state.next({submitCount:T.keepSubmitCount?r.submitCount:0,isDirty:T.keepDirty?r.isDirty:!!(T.keepDefaultValues&&!ar(g,s)),isSubmitted:T.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:T.keepDirtyValues?r.dirtyFields:T.keepDefaultValues&&g?Za(s,g):{},touchedFields:T.keepTouched?r.touchedFields:{},errors:T.keepErrors?r.errors:{},isSubmitSuccessful:T.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Ce=(g,T)=>Se(Fn(g)?g(i):g,T);return{control:{register:ne,unregister:j,getFieldState:E,handleSubmit:_e,setError:F,_executeSchema:Z,_getWatch:le,_getDirty:z,_updateValid:d,_removeUnmounted:ue,_updateFieldArray:R,_updateDisabledField:oe,_getFieldArray:Ee,_reset:Se,_resetDefaultValues:()=>Fn(n.defaultValues)&&n.defaultValues().then(g=>{Ce(g,n.resetOptions),h.state.next({isLoading:!1})}),_updateFormState:g=>{r={...r,...g}},_subjects:h,_proxyFormState:f,get _fields(){return o},get _formValues(){return i},get _state(){return l},set _state(g){l=g},get _defaultValues(){return s},get _names(){return a},set _names(g){a=g},get _formState(){return r},set _formState(g){r=g},get _options(){return n},set _options(g){n={...n,...g}}},trigger:H,register:ne,handleSubmit:_e,watch:X,setValue:V,getValues:ce,reset:Ce,resetField:ze,clearErrors:b,unregister:j,setError:F,setFocus:(g,T={})=>{const L=q(o,g),J=L&&L._f;if(J){const B=J.refs?J.refs[0]:J.ref;B.focus&&(B.focus(),T.shouldSelect&&B.select())}},getFieldState:E}}function BA(e={}){const t=re.useRef(),n=re.useRef(),[r,o]=re.useState({isDirty:!1,isValidating:!1,isLoading:Fn(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:Fn(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...jA(e,()=>o(i=>({...i}))),formState:r});const s=t.current.control;return s._options=e,Kf({subject:s._subjects.state,next:i=>{zg(i,s._proxyFormState,s._updateFormState,!0)&&o({...s._formState})}}),re.useEffect(()=>{e.values&&!ar(e.values,n.current)?(s._reset(e.values,s._options.resetOptions),n.current=e.values):s._resetDefaultValues()},[e.values,s]),re.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=Bg(r,s),t.current}const Zg=({id:e,onCancel:t,onSubmit:n})=>{var Z,Y,me,ue,z,le,Ee,ge,we,V;const r=ra(),[o,s]=U.useState(!1),[,i]=Wn(Fs),[l,a]=U.useState(""),{data:u,error:c}=Ir({queryKey:["app-form",e],queryFn:()=>cn.get(`/server/${e}`).then($=>$.data),enabled:!!e}),{data:f}=Ir({queryKey:["app-frameworks"],queryFn:()=>cn.get("/frameworks").then($=>$.data)}),{data:h}=Ir({queryKey:["app-environments"],queryFn:()=>cn.get("/conda-environments").then($=>$.data)}),{data:S}=Ir({queryKey:["app-profiles"],queryFn:()=>cn.get("/spawner-profiles").then($=>$.data)}),{control:p,handleSubmit:v,reset:x,watch:y,formState:{errors:d}}=BA({defaultValues:{display_name:"",description:"",framework:"",thumbnail:"",filepath:"",conda_env:"",custom_command:"",profile:""}}),m=y("framework"),R=({display_name:$,description:H,framework:ce,thumbnail:E,filepath:b,conda_env:F,custom_command:X,profile:j})=>{const oe={servername:l||$,user_options:{jhub_app:!0,name:l||$,display_name:$,description:H||"",framework:ce,thumbnail:E||"",filepath:b||"",conda_env:F||"",custom_command:X||"",profile:j||""}};s(!0),e?O(oe,{onSuccess:async()=>{s(!1),r.invalidateQueries(["app-state"]),n&&n()},onError:async ne=>{s(!1),i(ne.message)}}):N(oe,{onSuccess:async ne=>{s(!1);const ee=Wf().user;if(ee&&(ne==null?void 0:ne.length)>1){const _e=ne[1];window.location.assign(`/user/${ee}/${_e}`)}},onError:async ne=>{s(!1),i(ne.message)}})},k=async({servername:$,user_options:H})=>{const ce={accept:"application/json","Content-Type":"multipart/form-data"},E=new FormData;return E.append("data",JSON.stringify({servername:$,user_options:H})),(await cn.post("/server",E,{headers:ce})).data},A=async({servername:$,user_options:H})=>(await cn.put(`/server/${$}`,{servername:$,user_options:H})).data,{mutate:N}=fc({mutationFn:k,retry:1}),{mutate:O}=fc({mutationFn:A,retry:1});return U.useEffect(()=>{u!=null&&u.name&&(u!=null&&u.user_options)&&(a(u.name),x({...u.user_options}))},[u==null?void 0:u.name,u==null?void 0:u.user_options,x]),U.useEffect(()=>{c&&i(c.message)},[c,i]),_.jsxs("form",{id:"app-form",onSubmit:v(R),className:"form",children:[_.jsxs(Xn,{errors:(Z=d.display_name)!=null&&Z.message?[d.display_name.message]:void 0,children:[_.jsx(Zn,{htmlFor:"display_name",required:!0,children:"Display Name"}),_.jsx(er,{name:"display_name",control:p,rules:Mo,render:({field:{ref:$,...H}})=>_.jsx(xi,{...H,id:"display_name",autoFocus:!0})}),((Y=d.display_name)==null?void 0:Y.message)&&_.jsx(Fo,{errors:[d.display_name.message]})]}),_.jsxs(Xn,{children:[_.jsx(Zn,{htmlFor:"description",children:"Description"}),_.jsx(er,{name:"description",control:p,render:({field:{ref:$,...H}})=>_.jsx(rN,{...H,id:"description"})})]}),_.jsxs(Xn,{errors:(me=d.framework)!=null&&me.message?[d.framework.message]:void 0,children:[_.jsx(Zn,{htmlFor:"framework",required:!0,children:"Framework"}),_.jsx(er,{name:"framework",control:p,rules:Mo,render:({field:{ref:$,...H}})=>_.jsx(Qa,{...H,id:"framework",options:f?[{value:"",label:"Select..."},...f.map(ce=>({value:ce.name,label:ce.display_name}))]:[]})}),((ue=d.framework)==null?void 0:ue.message)&&_.jsx(Fo,{errors:[d.framework.message]})]}),_.jsxs(Xn,{children:[_.jsx(Zn,{htmlFor:"filepath",children:"Filepath"}),_.jsx(er,{name:"filepath",control:p,render:({field:{ref:$,...H}})=>_.jsx(xi,{...H,id:"filepath"})})]}),h&&h.length>0?_.jsxs(Xn,{errors:(z=d.conda_env)!=null&&z.message?[d.conda_env.message]:void 0,children:[_.jsx(Zn,{htmlFor:"conda_env",required:!0,children:"Conda Environment"}),_.jsx(er,{name:"conda_env",control:p,rules:Mo,render:({field:{ref:$,...H}})=>_.jsx(Qa,{...H,id:"conda_env",options:[{value:"",label:"Select..."},...h.map(ce=>({value:ce,label:ce}))]})}),((le=d.conda_env)==null?void 0:le.message)&&_.jsx(Fo,{errors:[d.conda_env.message]})]}):_.jsx(_.Fragment,{}),S&&S.length>0?_.jsxs(Xn,{errors:(Ee=d.profile)!=null&&Ee.message?[d.profile.message]:void 0,children:[_.jsx(Zn,{htmlFor:"profile",required:!0,children:"Spawner Profile"}),_.jsx(er,{name:"profile",control:p,rules:Mo,render:({field:{ref:$,...H}})=>_.jsx(Qa,{...H,id:"profile",options:[{value:"",label:"Select..."},...S.map(ce=>({value:ce.display_name,label:ce.display_name}))]})}),((ge=d.profile)==null?void 0:ge.message)&&_.jsx(Fo,{errors:[d.profile.message]})]}):_.jsx(_.Fragment,{}),m==="custom"?_.jsxs(Xn,{errors:(we=d.custom_command)!=null&&we.message?[d.custom_command.message]:void 0,children:[_.jsx(Zn,{htmlFor:"custom_command",required:!0,children:"Custom Command"}),_.jsx(er,{name:"custom_command",control:p,rules:Mo,render:({field:{ref:$,...H}})=>_.jsx(xi,{...H,id:"custom_command"})}),((V=d.custom_command)==null?void 0:V.message)&&_.jsx(Fo,{errors:[d.custom_command.message]})]}):_.jsx(_.Fragment,{}),_.jsxs(yg,{children:[_.jsx(lo,{id:"cancel-btn",type:"button",variant:"secondary",onClick:t,children:"Cancel"}),_.jsx(lo,{id:"submit-btn",type:"submit",disabled:o,children:"Submit"})]})]})},zA=({id:e,title:t,description:n,thumbnail:r,framework:o,url:s})=>{const i=ra(),[l,a]=U.useState(!1),[,u]=Wn(Fs),[c,f]=U.useState(!1),[h,S]=U.useState(!1),p=async({id:m})=>await cn.delete(`/server/${m}`),{mutate:v}=fc({mutationFn:p,retry:1}),x=()=>{a(!0),v({id:e},{onSuccess:async()=>{a(!1),f(!1),i.invalidateQueries(["app-state"])},onError:async m=>{a(!1),u(m.message)}})},y=[{id:"edit",title:"Edit",onClick:()=>S(!0),visible:!0},{id:"delete",title:"Delete",onClick:()=>f(!0),visible:!0}],d=_.jsxs(_.Fragment,{children:[_.jsxs("p",{className:"w-[400px] mb-6",children:["Are you sure you want to delete ",_.jsx("b",{children:t}),"? This action is permanent and cannot be reversed."]}),_.jsxs(yg,{children:[_.jsx(lo,{id:"cancel-btn",variant:"secondary",onClick:()=>f(!1),children:"Cancel"}),_.jsx(lo,{id:"delete-btn",variant:"primary",onClick:()=>x(),disabled:l,children:"Delete"})]})]});return _.jsxs("div",{className:"card",id:`card-${e}`,tabIndex:0,children:[_.jsxs("div",{className:"card-header-media",children:[_.jsxs("div",{className:"card-header-menu",children:[_.jsx(tN,{id:`card-menu-${e}`,items:y}),c&&_.jsx(dc,{title:`Delete ${t}`,setIsOpen:f,body:d}),h&&_.jsx(dc,{title:`Edit ${t}`,setIsOpen:S,body:_.jsx(Zg,{id:e,onCancel:()=>S(!1),onSubmit:()=>S(!1)})})]}),_.jsx("div",{className:"card-header-img",children:r?_.jsx("img",{src:r,alt:"App thumb"}):void 0})]}),_.jsx("div",{className:"card-header",children:_.jsx("h3",{className:"font-bold",children:_.jsx("a",{href:s,children:t})})}),_.jsx("div",{className:"card-body",children:_.jsx("p",{className:"text-sm",children:n})}),_.jsx("div",{className:"card-footer",children:_.jsx(nN,{id:`tag-${e}`,children:o})})]})},hp=({appType:e="My",filter:t})=>{const[n]=Wn(If),[,r]=Wn(Fs),[o,s]=U.useState([]),{isLoading:i,error:l,data:a}=Ir({queryKey:["app-state"],queryFn:()=>cn.get("/server/").then(u=>u.data).then(u=>u),enabled:!!n.user});return U.useEffect(()=>{if(!i&&a){const u=t.toLowerCase();s(()=>EA(a,e).filter(c=>{var f,h;return c.name.toLowerCase().includes(u)||((f=c.description)==null?void 0:f.toLowerCase().includes(u))||((h=c.framework)==null?void 0:h.toLowerCase().includes(u))}))}},[i,a,e,t]),U.useEffect(()=>{r(l?l.message:void 0)},[l,r]),_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"container grid grid-cols-12 flex flex-align-center pb-12",children:[_.jsx("div",{className:"col-span-1",children:_.jsxs("h2",{className:"whitespace-nowrap font-bold",children:[e," Apps"]})}),_.jsx("div",{className:"col-span-10",children:_.jsx("hr",{className:"spacer"})}),_.jsx("div",{className:"col-span-1 flex justify-end",children:_.jsxs("h2",{className:"whitespace-nowrap font-bold",children:[o.length," apps"]})})]}),_.jsx("div",{className:"container grid pb-12",children:o.length>0?_.jsx("div",{className:"flex flex flex-row flex-wrap gap-4",children:o.map(u=>_.jsx(zA,{id:u.id,title:u.name,description:u.description,thumbnail:u.thumbnail,framework:u.framework,url:u.url,ready:u.ready},`app-${u.id}`))}):_.jsx("div",{children:"No apps available"})})]})},HA=Ig.create({baseURL:"/api",headers:{"Content-Type":"application/json",Authorization:`Authorization: token ${{}.JUPYERHUB_API_TOKEN}`},params:{_xsrf:Wf().xsrf_token}}),WA=()=>{const[e]=Wn(If),[,t]=Wn(Fs),[n,r]=U.useState([]),{isLoading:o,error:s,data:i}=Ir({queryKey:["service-data"],queryFn:()=>HA.get("/services").then(a=>a.data).then(a=>a),enabled:!!e.user}),l=(a,u)=>{u?window.open(a,"_blank"):window.location.assign(a)};return U.useEffect(()=>{!o&&i&&r(()=>RA(i,e.user))},[o,i,e.user]),U.useEffect(()=>{t(s?s.message:void 0)},[s,t]),_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"container grid grid-cols-12 flex flex-align-center pb-12",children:[_.jsx("div",{className:"col-span-1",children:_.jsx("h2",{className:"whitespace-nowrap font-bold",children:"Services"})}),_.jsx("div",{className:"col-span-10",children:_.jsx("hr",{className:"spacer"})}),_.jsx("div",{className:"col-span-1 flex justify-end",children:_.jsxs("h2",{className:"whitespace-nowrap font-bold",children:[n.length," services"]})})]}),_.jsx("div",{className:"container grid pb-12",children:n.length>0?_.jsx("div",{className:"flex flex flex-row flex-wrap gap-4",children:n.map((a,u)=>_.jsx(lo,{id:`service-${u}`,variant:"secondary",style:{minWidth:"180px"},onClick:()=>{l(a.url,a.external)},children:a.name},`service-${u}`))}):_.jsx("div",{children:"No services available"})})]})},pp=()=>{const[e,t]=U.useState(!1),[n]=Wn(Fs),[r,o]=U.useState(""),s=i=>{const l=i.target;o(l.value)};return _.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"container grid grid-cols-12 pb-12",children:[_.jsx("div",{className:"md:col-span-2 xs:col-span-12",children:_.jsx("h1",{className:"text-3xl font-bold",children:"Home"})}),_.jsx("div",{className:"md:col-span-8 xs:col-span-8",children:_.jsx(xi,{id:"search",placeholder:"Search...","aria-label":"Search for an app",className:"w-full mt-0",onChange:s})}),_.jsxs("div",{className:"md:col-span-2 xs:col-span-4 flex justify-end",children:[_.jsx(lo,{id:"create-app",onClick:()=>{t(!0)},children:"Create App"}),e&&_.jsx(dc,{title:"Create New App",setIsOpen:t,body:_.jsx(Zg,{onCancel:()=>t(!1)})})]})]}),n&&_.jsx("div",{className:"container grid grid-cols-12 pb-2",children:_.jsx("div",{className:"col-span-12",children:_.jsx(Kk,{id:"alert-notification",type:"error",children:n})})}),_.jsx(WA,{}),_.jsx(hp,{appType:"My",filter:r}),_.jsx(hp,{appType:"Shared",filter:r})]})},QA=new gk,qA=()=>{const[,e]=Wn(If);return U.useEffect(()=>{e(Wf())},[e]),_.jsx(bk,{client:QA,children:_.jsx("div",{children:_.jsx("main",{className:"my-6",children:_.jsxs(c_,{children:[_.jsx(Yu,{path:"/home",element:_.jsx(pp,{})}),_.jsx(Yu,{path:"/",element:_.jsx(pp,{})})]})})})})};tu.createRoot(document.getElementById("root")).render(_.jsx(re.StrictMode,{children:_.jsx(d_,{basename:"/hub",children:_.jsx(rk,{children:_.jsx(qA,{})})})})); diff --git a/ui/src/pages/home/app-form/app-form.tsx b/ui/src/pages/home/app-form/app-form.tsx index 5fec7f44..313c65ee 100644 --- a/ui/src/pages/home/app-form/app-form.tsx +++ b/ui/src/pages/home/app-form/app-form.tsx @@ -166,7 +166,13 @@ export const AppForm = ({ servername, user_options, }: AppQueryUpdateProps) => { - const response = await axios.post('/server', { servername, user_options }); + const headers = { + accept: 'application/json', + 'Content-Type': 'multipart/form-data', + }; + const formData = new FormData(); + formData.append('data', JSON.stringify({ servername, user_options })); + const response = await axios.post('/server', formData, { headers }); return response.data; };