diff --git a/.dockerignore b/.dockerignore index 0d406464..eb211532 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,7 @@ .git *Dockerfile* *docker-compose* +package-lock.json +.env node_modules dist \ No newline at end of file diff --git a/.env.example b/.env.example index 02eca612..9325f3ab 100644 --- a/.env.example +++ b/.env.example @@ -3,6 +3,9 @@ SERVER_PORT=8080 # Server URL - Set your application url SERVER_URL=http://localhost:8080 +SSL_CONF_PRIVKEY=/path/to/cert.key +SSL_CONF_FULLCHAIN=/path/to/cert.crt + SENTRY_DSN= # Cors - * for all or set separate by commas - ex.: 'yourdomain1.com, yourdomain2.com' @@ -47,6 +50,7 @@ DATABASE_DELETE_MESSAGE=true RABBITMQ_ENABLED=false RABBITMQ_URI=amqp://localhost RABBITMQ_EXCHANGE_NAME=evolution +RABBITMQ_FRAME_MAX=8192 # Global events - By enabling this variable, events from all instances are sent in the same event queue. RABBITMQ_GLOBAL_ENABLED=false # Prefix key to queue name @@ -62,6 +66,7 @@ RABBITMQ_EVENTS_MESSAGES_EDITED=false RABBITMQ_EVENTS_MESSAGES_UPDATE=false RABBITMQ_EVENTS_MESSAGES_DELETE=false RABBITMQ_EVENTS_SEND_MESSAGE=false +RABBITMQ_EVENTS_SEND_MESSAGE_UPDATE=false RABBITMQ_EVENTS_CONTACTS_SET=false RABBITMQ_EVENTS_CONTACTS_UPSERT=false RABBITMQ_EVENTS_CONTACTS_UPDATE=false @@ -108,6 +113,7 @@ PUSHER_EVENTS_MESSAGES_EDITED=true PUSHER_EVENTS_MESSAGES_UPDATE=true PUSHER_EVENTS_MESSAGES_DELETE=true PUSHER_EVENTS_SEND_MESSAGE=true +PUSHER_EVENTS_SEND_MESSAGE_UPDATE=true PUSHER_EVENTS_CONTACTS_SET=true PUSHER_EVENTS_CONTACTS_UPSERT=true PUSHER_EVENTS_CONTACTS_UPDATE=true @@ -149,6 +155,7 @@ WEBHOOK_EVENTS_MESSAGES_EDITED=true WEBHOOK_EVENTS_MESSAGES_UPDATE=true WEBHOOK_EVENTS_MESSAGES_DELETE=true WEBHOOK_EVENTS_SEND_MESSAGE=true +WEBHOOK_EVENTS_SEND_MESSAGE_UPDATE=true WEBHOOK_EVENTS_CONTACTS_SET=true WEBHOOK_EVENTS_CONTACTS_UPSERT=true WEBHOOK_EVENTS_CONTACTS_UPDATE=true @@ -173,6 +180,15 @@ WEBHOOK_EVENTS_TYPEBOT_CHANGE_STATUS=false WEBHOOK_EVENTS_ERRORS=false WEBHOOK_EVENTS_ERRORS_WEBHOOK= +WEBHOOK_REQUEST_TIMEOUT_MS=60000 +WEBHOOK_RETRY_MAX_ATTEMPTS=10 +WEBHOOK_RETRY_INITIAL_DELAY_SECONDS=5 +WEBHOOK_RETRY_USE_EXPONENTIAL_BACKOFF=true +WEBHOOK_RETRY_MAX_DELAY_SECONDS=300 +WEBHOOK_RETRY_JITTER_FACTOR=0.2 +# Comma separated list of HTTP status codes that should not trigger retries +WEBHOOK_RETRY_NON_RETRYABLE_STATUS_CODES=400,401,403,404,422 + # Name that will be displayed on smartphone connection CONFIG_SESSION_PHONE_CLIENT=Evolution API # Browser Name = Chrome | Firefox | Edge | Opera | Safari @@ -180,7 +196,7 @@ CONFIG_SESSION_PHONE_NAME=Chrome # Whatsapp Web version for baileys channel # https://web.whatsapp.com/check-update?version=0&platform=web -CONFIG_SESSION_PHONE_VERSION=2.3000.1015901307 +# CONFIG_SESSION_PHONE_VERSION=2.3000.1023204200 # Set qrcode display limit QRCODE_LIMIT=30 @@ -210,6 +226,12 @@ OPENAI_ENABLED=false # Dify - Environment variables DIFY_ENABLED=false +# n8n - Environment variables +N8N_ENABLED=false + +# EvoAI - Environment variables +EVOAI_ENABLED=false + # Cache - Environment variables # Redis Cache enabled CACHE_REDIS_ENABLED=true @@ -266,4 +288,4 @@ LANGUAGE=en # PROXY_PORT=80 # PROXY_PROTOCOL=http # PROXY_USERNAME= -# PROXY_PASSWORD= \ No newline at end of file +# PROXY_PASSWORD= diff --git a/.github/workflows/publish_docker_image.yml b/.github/workflows/publish_docker_image.yml index 68a08a31..09d09390 100644 --- a/.github/workflows/publish_docker_image.yml +++ b/.github/workflows/publish_docker_image.yml @@ -20,7 +20,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: atendai/evolution-api + images: evoapicloud/evolution-api tags: type=semver,pattern=v{{version}} - name: Set up QEMU diff --git a/.github/workflows/publish_docker_image_homolog.yml b/.github/workflows/publish_docker_image_homolog.yml index 77032dc9..b97a5e25 100644 --- a/.github/workflows/publish_docker_image_homolog.yml +++ b/.github/workflows/publish_docker_image_homolog.yml @@ -20,7 +20,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: atendai/evolution-api + images: evoapicloud/evolution-api tags: homolog - name: Set up QEMU diff --git a/.github/workflows/publish_docker_image_latest.yml b/.github/workflows/publish_docker_image_latest.yml index 641dc5e0..cffdab01 100644 --- a/.github/workflows/publish_docker_image_latest.yml +++ b/.github/workflows/publish_docker_image_latest.yml @@ -20,7 +20,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: atendai/evolution-api + images: evoapicloud/evolution-api tags: latest - name: Set up QEMU diff --git a/.gitignore b/.gitignore index a8226ede..1cecfa98 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ /dist /node_modules +.cursor* + /Docker/.env .vscode diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d316041..cbd786ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,34 @@ +# 2.3.0 (2025-06-17 09:19) + +### Feature + +* Add support to get Catalogs and Collections with new routes: '{{baseUrl}}/chat/fetchCatalogs' and '{{baseUrl}}/chat/fetchCollections' +* Add NATS integration support to the event system +* Add message location support meta +* Add S3_SKIP_POLICY env variable to disable setBucketPolicy for incompatible providers +* Add EvoAI integration with models, services, and routes +* Add N8n integration with models, services, and routes + +### Fixed + +* Shell injection vulnerability +* Update Baileys Version v6.7.18 +* Audio send duplicate from chatwoot +* Chatwoot csat creating new conversation in another language +* Refactor SQS controller to correct bug in sqs events by instance +* Adjustin cloud api send audio and video +* Preserve animation in GIF and WebP stickers +* Preventing use conversation from other inbox for the same user +* Ensure full WhatsApp compatibility for audio conversion (libopus, 48kHz, mono) +* Enhance message fetching and processing logic +* Added lid on whatsapp numbers router +* Now if the CONFIG_SESSION_PHONE_VERSION variable is not filled in it automatically searches for the most updated version + +### Security + +* Change execSync to execFileSync +* Enhance WebSocket authentication and connection handling + # 2.2.3 (2025-02-03 11:52) ### Fixed diff --git a/Docker/swarm/evolution_api_v2.yaml b/Docker/swarm/evolution_api_v2.yaml index 41c2daa2..db06823b 100644 --- a/Docker/swarm/evolution_api_v2.yaml +++ b/Docker/swarm/evolution_api_v2.yaml @@ -2,7 +2,7 @@ version: "3.7" services: evolution_v2: - image: atendai/evolution-api:v2.1.2 + image: atendai/evolution-api:v2.2.3 volumes: - evolution_instances:/evolution/instances networks: @@ -34,6 +34,7 @@ services: - RABBITMQ_EVENTS_MESSAGES_UPDATE=false - RABBITMQ_EVENTS_MESSAGES_DELETE=false - RABBITMQ_EVENTS_SEND_MESSAGE=false + - RABBITMQ_EVENTS_SEND_MESSAGE_UPDATE=false - RABBITMQ_EVENTS_CONTACTS_SET=false - RABBITMQ_EVENTS_CONTACTS_UPSERT=false - RABBITMQ_EVENTS_CONTACTS_UPDATE=false @@ -71,6 +72,7 @@ services: - WEBHOOK_EVENTS_MESSAGES_UPDATE=true - WEBHOOK_EVENTS_MESSAGES_DELETE=true - WEBHOOK_EVENTS_SEND_MESSAGE=true + - WEBHOOK_EVENTS_SEND_MESSAGE_UPDATE=true - WEBHOOK_EVENTS_CONTACTS_SET=true - WEBHOOK_EVENTS_CONTACTS_UPSERT=true - WEBHOOK_EVENTS_CONTACTS_UPDATE=true @@ -92,7 +94,7 @@ services: - WEBHOOK_EVENTS_ERRORS_WEBHOOK= - CONFIG_SESSION_PHONE_CLIENT=Evolution API V2 - CONFIG_SESSION_PHONE_NAME=Chrome - - CONFIG_SESSION_PHONE_VERSION=2.3000.1015901307 + - CONFIG_SESSION_PHONE_VERSION=2.3000.1023204200 - QRCODE_LIMIT=30 - OPENAI_ENABLED=true - DIFY_ENABLED=true diff --git a/Dockerfile b/Dockerfile index ca61b39a..fc535aa2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ FROM node:20-alpine AS builder RUN apk update && \ - apk add git ffmpeg wget curl bash openssl + apk add --no-cache git ffmpeg wget curl bash openssl -LABEL version="2.2.3" description="Api to control whatsapp features through http requests." +LABEL version="2.3.0" description="Api to control whatsapp features through http requests." LABEL maintainer="Davidson Gomes" git="https://github.com/DavidsonGomes" -LABEL contact="contato@atendai.com" +LABEL contact="contato@evolution-api.com" WORKDIR /evolution diff --git a/LICENSE b/LICENSE index da01e779..ad430f14 100644 --- a/LICENSE +++ b/LICENSE @@ -8,7 +8,7 @@ a. LOGO and copyright information: In the process of using Evolution API's front b. Usage Notification Requirement: If Evolution API is used as part of any project, including closed-source systems (e.g., proprietary software), the user is required to display a clear notification within the system that Evolution API is being utilized. This notification should be visible to system administrators and accessible from the system's documentation or settings page. Failure to comply with this requirement may result in the necessity for a commercial license, as determined by the producer. -Please contact contato@atendai.com to inquire about licensing matters. +Please contact contato@evolution-api.com to inquire about licensing matters. 2. As a contributor, you should agree that: diff --git a/README.md b/README.md index 93197499..6e40ce74 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@
F||125 0}function vt(P,R){let B=C.blockers.get(P)||Zc;return oe.get(P)!==R&&oe.set(P,R),B}function _n(P){C.blockers.delete(P),oe.delete(P)}function xs(P,R){let B=C.blockers.get(P)||Zc;et(B.state==="unblocked"&&R.state==="blocked"||B.state==="blocked"&&R.state==="blocked"||B.state==="blocked"&&R.state==="proceeding"||B.state==="blocked"&&R.state==="unblocked"||B.state==="proceeding"&&R.state==="unblocked","Invalid blocker state transition: "+B.state+" -> "+R.state);let W=new Map(C.blockers);W.set(P,R),ve({blockers:W})}function Io(P){let{currentLocation:R,nextLocation:B,historyAction:W}=P;if(oe.size===0)return;oe.size>1&&dc(!1,"A router only supports one blocker at a time");let be=Array.from(oe.entries()),[Me,ze]=be[be.length-1],pe=C.blockers.get(Me);if(!(pe&&pe.state==="proceeding")&&ze({currentLocation:R,nextLocation:B,historyAction:W}))return Me}function Bc(P){let R=Hn(404,{pathname:P}),B=c||a,{matches:W,route:be}=P0(B);return ws(),{notFoundMatches:W,route:be,error:R}}function Zi(P,R){return{boundaryId:Tl(R.partialMatches).route.id,error:Hn(400,{type:"route-discovery",pathname:P,message:R.error!=null&&"message"in R.error?R.error:String(R.error)})}}function ws(P){let R=[];return le.forEach((B,W)=>{(!P||P(W))&&(B.cancel(),R.push(W),le.delete(W))}),R}function zc(P,R,B){if(h=P,x=R,m=B||null,!b&&C.navigation===Fm){b=!0;let W=Qw(C.location,C.matches);W!=null&&ve({restoreScrollPosition:W})}return()=>{h=null,x=null,m=null}}function Jw(P,R){return m&&m(P,R.map(W=>R2(W,C.loaderData)))||P.key}function eD(P,R){if(h&&x){let B=Jw(P,R);h[B]=x()}}function Qw(P,R){if(h){let B=Jw(P,R),W=h[B];if(typeof W=="number")return W}return null}function im(P,R,B){if(d)if(P){let W=P[P.length-1].route;if(W.path&&(W.path==="*"||W.path.endsWith("/*")))return{active:!0,matches:dp(R,B,u,!0)}}else return{active:!0,matches:dp(R,B,u,!0)||[]};return{active:!1,matches:null}}async function of(P,R,B){let W=P,be=W.length>0?W[W.length-1].route:null;for(;;){let Me=c==null,ze=c||a;try{await iL(d,R,W,ze,o,s,Q,B)}catch(Oe){return{type:"error",error:Oe,partialMatches:W}}finally{Me&&(a=[...a])}if(B.aborted)return{type:"aborted"};let pe=Ya(ze,R,u),Je=!1;if(pe){let Oe=pe[pe.length-1].route;if(Oe.index)return{type:"success",matches:pe};if(Oe.path&&Oe.path.length>0)if(Oe.path==="*")Je=!0;else return{type:"success",matches:pe}}let _e=dp(ze,R,u,!0);if(!_e||W.map(Oe=>Oe.route.id).join("-")===_e.map(Oe=>Oe.route.id).join("-"))return{type:"success",matches:Je?pe:null};if(W=_e,be=W[W.length-1].route,be.path==="*")return{type:"success",matches:W}}}function tD(P){o={},c=ad(P,s,void 0,o)}function nD(P,R){let B=c==null;bT(P,R,c||a,o,s),B&&(a=[...a],ve({}))}return E={get basename(){return u},get future(){return p},get state(){return C},get routes(){return a},get window(){return t},initialize:Pe,subscribe:Re,enableScrollRestoration:zc,navigate:Vt,fetch:he,revalidate:tn,createHref:P=>e.history.createHref(P),encodeLocation:P=>e.history.encodeLocation(P),getFetcher:Oo,deleteFetcher:qa,dispose:Be,getBlocker:vt,deleteBlocker:_n,patchRoutes:nD,_internalFetchControllers:J,_internalActiveDeferreds:le,_internalSetRoutes:tD},E}function sL(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ay(e,t,n,r,s,o,a,c){let u,i;if(a){u=[];for(let p of t)if(u.push(p),p.route.id===a){i=p;break}}else u=t,i=t[t.length-1];let d=Yg(s||".",Zg(u,o),Cc(e.pathname,n)||e.pathname,c==="path");return s==null&&(d.search=e.search,d.hash=e.hash),(s==null||s===""||s===".")&&i&&i.route.index&&!Ox(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:ho([n,d.pathname])),Pi(d)}function S0(e,t,n,r){if(!r||!sL(r))return{path:n};if(r.formMethod&&!yL(r.formMethod))return{path:n,error:Hn(405,{method:r.formMethod})};let s=()=>({path:n,error:Hn(400,{type:"invalid-body"})}),o=r.formMethod||"get",a=e?o.toUpperCase():o.toLowerCase(),c=xT(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Yr(a))return s();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((g,h)=>{let[m,x]=h;return""+g+m+"="+x+`
+`},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:c,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!Yr(a))return s();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:c,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return s()}}}et(typeof FormData=="function","FormData is not available in this environment");let u,i;if(r.formData)u=Fy(r.formData),i=r.formData;else if(r.body instanceof FormData)u=Fy(r.body),i=r.body;else if(r.body instanceof URLSearchParams)u=r.body,i=T0(u);else if(r.body==null)u=new URLSearchParams,i=new FormData;else try{u=new URLSearchParams(r.body),i=T0(u)}catch{return s()}let d={formMethod:a,formAction:c,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(Yr(d.formMethod))return{path:n,submission:d};let p=Ra(n);return t&&p.search&&Ox(p.search)&&u.append("index",""),p.search="?"+u,{path:Pi(p),submission:d}}function oL(e,t){let n=e;if(t){let r=e.findIndex(s=>s.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function C0(e,t,n,r,s,o,a,c,u,i,d,p,f,g,h,m){let x=m?mr(m[1])?m[1].error:m[1].data:void 0,b=e.createURL(t.location),y=e.createURL(s),w=m&&mr(m[1])?m[0]:void 0,S=w?oL(n,w):n,E=m?m[1].statusCode:void 0,C=a&&E&&E>=400,T=S.filter((_,O)=>{let{route:K}=_;if(K.lazy)return!0;if(K.loader==null)return!1;if(o)return typeof K.loader!="function"||K.loader.hydrate?!0:t.loaderData[K.id]===void 0&&(!t.errors||t.errors[K.id]===void 0);if(aL(t.loaderData,t.matches[O],_)||u.some(q=>q===_.route.id))return!0;let I=t.matches[O],Y=_;return E0(_,Kt({currentUrl:b,currentParams:I.params,nextUrl:y,nextParams:Y.params},r,{actionResult:x,actionStatus:E,defaultShouldRevalidate:C?!1:c||b.pathname+b.search===y.pathname+y.search||b.search!==y.search||yT(I,Y)}))}),j=[];return p.forEach((_,O)=>{if(o||!n.some(Z=>Z.route.id===_.routeId)||d.has(O))return;let K=Ya(g,_.path,h);if(!K){j.push({key:O,routeId:_.routeId,path:_.path,matches:null,match:null,controller:null});return}let I=t.fetchers.get(O),Y=mu(K,_.path),q=!1;f.has(O)?q=!1:i.includes(O)?q=!0:I&&I.state!=="idle"&&I.data===void 0?q=c:q=E0(Y,Kt({currentUrl:b,currentParams:t.matches[t.matches.length-1].params,nextUrl:y,nextParams:n[n.length-1].params},r,{actionResult:x,actionStatus:E,defaultShouldRevalidate:C?!1:c})),q&&j.push({key:O,routeId:_.routeId,path:_.path,matches:K,match:Y,controller:new AbortController})}),[T,j]}function aL(e,t,n){let r=!t||n.route.id!==t.route.id,s=e[n.route.id]===void 0;return r||s}function yT(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function E0(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function iL(e,t,n,r,s,o,a,c){let u=[t,...n.map(i=>i.route.id)].join("-");try{let i=a.get(u);i||(i=e({path:t,matches:n,patch:(d,p)=>{c.aborted||bT(d,p,r,s,o)}}),a.set(u,i)),i&&hL(i)&&await i}finally{a.delete(u)}}function bT(e,t,n,r,s){if(e){var o;let a=r[e];et(a,"No route found to patch children into: routeId = "+e);let c=ad(t,s,[e,"patch",String(((o=a.children)==null?void 0:o.length)||"0")],r);a.children?a.children.push(...c):a.children=c}else{let a=ad(t,s,["patch",String(n.length||"0")],r);n.push(...a)}}async function k0(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let s=n[e.id];et(s,"No route found in manifest");let o={};for(let a in r){let u=s[a]!==void 0&&a!=="hasErrorBoundary";dc(!u,'Route "'+s.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!u&&!_2.has(a)&&(o[a]=r[a])}Object.assign(s,o),Object.assign(s,Kt({},t(s),{lazy:void 0}))}function lL(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function cL(e,t,n,r,s,o,a,c){let u=r.reduce((p,f)=>p.add(f.route.id),new Set),i=new Set,d=await e({matches:s.map(p=>{let f=u.has(p.route.id);return Kt({},p,{shouldLoad:f,resolve:h=>(i.add(p.route.id),f?uL(t,n,p,o,a,h,c):Promise.resolve({type:Mt.data,result:void 0}))})}),request:n,params:s[0].params,context:c});return s.forEach(p=>et(i.has(p.route.id),'`match.resolve()` was not called for route id "'+p.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),d.filter((p,f)=>u.has(s[f].route.id))}async function uL(e,t,n,r,s,o,a){let c,u,i=d=>{let p,f=new Promise((m,x)=>p=x);u=()=>p(),t.signal.addEventListener("abort",u);let g=m=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):d({request:t,params:n.params,context:a},...m!==void 0?[m]:[]),h;return o?h=o(m=>g(m)):h=(async()=>{try{return{type:"data",result:await g()}}catch(m){return{type:"error",result:m}}})(),Promise.race([h,f])};try{let d=n.route[e];if(n.route.lazy)if(d){let p,[f]=await Promise.all([i(d).catch(g=>{p=g}),k0(n.route,s,r)]);if(p!==void 0)throw p;c=f}else if(await k0(n.route,s,r),d=n.route[e],d)c=await i(d);else if(e==="action"){let p=new URL(t.url),f=p.pathname+p.search;throw Hn(405,{method:t.method,pathname:f,routeId:n.route.id})}else return{type:Mt.data,result:void 0};else if(d)c=await i(d);else{let p=new URL(t.url),f=p.pathname+p.search;throw Hn(404,{pathname:f})}et(c.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:Mt.error,result:d}}finally{u&&t.signal.removeEventListener("abort",u)}return c}async function dL(e){let{result:t,type:n,status:r}=e;if(wT(t)){let a;try{let c=t.headers.get("Content-Type");c&&/\bapplication\/json\b/.test(c)?t.body==null?a=null:a=await t.json():a=await t.text()}catch(c){return{type:Mt.error,error:c}}return n===Mt.error?{type:Mt.error,error:new Px(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:Mt.data,data:a,statusCode:t.status,headers:t.headers}}if(n===Mt.error)return{type:Mt.error,error:t,statusCode:Xg(t)?t.status:r};if(vL(t)){var s,o;return{type:Mt.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((o=t.init)==null?void 0:o.headers)&&new Headers(t.init.headers)}}return{type:Mt.data,data:t,statusCode:r}}function fL(e,t,n,r,s,o){let a=e.headers.get("Location");if(et(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!Rx.test(a)){let c=r.slice(0,r.findIndex(u=>u.route.id===n)+1);a=Ay(new URL(t.url),c,s,!0,a,o),e.headers.set("Location",a)}return e}function j0(e,t,n){if(Rx.test(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=Cc(s.pathname,n)!=null;if(s.origin===t.origin&&o)return s.pathname+s.search+s.hash}return e}function nl(e,t,n,r){let s=e.createURL(xT(t)).toString(),o={signal:n};if(r&&Yr(r.formMethod)){let{formMethod:a,formEncType:c}=r;o.method=a.toUpperCase(),c==="application/json"?(o.headers=new Headers({"Content-Type":c}),o.body=JSON.stringify(r.json)):c==="text/plain"?o.body=r.text:c==="application/x-www-form-urlencoded"&&r.formData?o.body=Fy(r.formData):o.body=r.formData}return new Request(s,o)}function Fy(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function T0(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function pL(e,t,n,r,s,o){let a={},c=null,u,i=!1,d={},p=r&&mr(r[1])?r[1].error:void 0;return n.forEach((f,g)=>{let h=t[g].route.id;if(et(!ri(f),"Cannot handle redirect results in processLoaderData"),mr(f)){let m=f.error;p!==void 0&&(m=p,p=void 0),c=c||{};{let x=Tl(e,h);c[x.route.id]==null&&(c[x.route.id]=m)}a[h]=void 0,i||(i=!0,u=Xg(f.error)?f.error.status:500),f.headers&&(d[h]=f.headers)}else ni(f)?(s.set(h,f.deferredData),a[h]=f.deferredData.data,f.statusCode!=null&&f.statusCode!==200&&!i&&(u=f.statusCode),f.headers&&(d[h]=f.headers)):(a[h]=f.data,f.statusCode&&f.statusCode!==200&&!i&&(u=f.statusCode),f.headers&&(d[h]=f.headers))}),p!==void 0&&r&&(c={[r[0]]:p},a[r[0]]=void 0),{loaderData:a,errors:c,statusCode:u||200,loaderHeaders:d}}function M0(e,t,n,r,s,o,a,c){let{loaderData:u,errors:i}=pL(t,n,r,s,c);for(let d=0;dT?(P=k,k=null):P=k.sibling;var N=f(b,k,w[T],S);if(N===null){k===null&&(k=P);break}e&&k&&N.alternate===null&&t(b,k),y=o(N,y,T),C===null?E=N:C.sibling=N,C=N,k=P}if(T===w.length)return n(b,k),Ot&&$a(b,T),E;if(k===null){for(;Ttypeof e=="number"&&!isNaN(e),ci=e=>typeof e=="string",gr=e=>typeof e=="function",dp=e=>ci(e)||gr(e)?e:null,Iy=e=>v.isValidElement(e)||ci(e)||gr(e)||rd(e);function WL(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:s}=e;requestAnimationFrame(()=>{s.minHeight="initial",s.height=r+"px",s.transition=`all ${n}ms`,requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(t,n)})})}function Xh(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:s=!0,collapseDuration:o=300}=e;return function(a){let{children:l,position:c,preventExitTransition:i,done:d,nodeRef:p,isIn:f,playToast:h}=a;const g=r?`${t}--${c}`:t,m=r?`${n}--${c}`:n,x=v.useRef(0);return v.useLayoutEffect(()=>{const b=p.current,y=g.split(" "),w=S=>{S.target===p.current&&(h(),b.removeEventListener("animationend",w),b.removeEventListener("animationcancel",w),x.current===0&&S.type!=="animationcancel"&&b.classList.remove(...y))};b.classList.add(...y),b.addEventListener("animationend",w),b.addEventListener("animationcancel",w)},[]),v.useEffect(()=>{const b=p.current,y=()=>{b.removeEventListener("animationend",y),s?WL(b,d,o):d()};f||(i?y():(x.current=1,b.className+=` ${m}`,b.addEventListener("animationend",y)))},[f]),Te.createElement(Te.Fragment,null,l)}}function D0(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const Vn=new Map;let sd=[];const Dy=new Set,GL=e=>Dy.forEach(t=>t(e)),E_=()=>Vn.size>0;function T_(e,t){var n;if(t)return!((n=Vn.get(t))==null||!n.isToastActive(e));let r=!1;return Vn.forEach(s=>{s.isToastActive(e)&&(r=!0)}),r}function k_(e,t){Iy(e)&&(E_()||sd.push({content:e,options:t}),Vn.forEach(n=>{n.buildToast(e,t)}))}function A0(e,t){Vn.forEach(n=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===n.id&&n.toggle(e,t==null?void 0:t.id):n.toggle(e,t==null?void 0:t.id)})}function JL(e){const{subscribe:t,getSnapshot:n,setProps:r}=v.useRef(function(o){const a=o.containerId||1;return{subscribe(l){const c=function(d,p,f){let h=1,g=0,m=[],x=[],b=[],y=p;const w=new Map,S=new Set,E=()=>{b=Array.from(w.values()),S.forEach(T=>T())},C=T=>{x=T==null?[]:x.filter(P=>P!==T),E()},k=T=>{const{toastId:P,onOpen:N,updateId:U,children:I}=T.props,Z=U==null;T.staleId&&w.delete(T.staleId),w.set(P,T),x=[...x,T.props.toastId].filter(V=>V!==T.staleId),E(),f(D0(T,Z?"added":"updated")),Z&&gr(N)&&N(v.isValidElement(I)&&I.props)};return{id:d,props:y,observe:T=>(S.add(T),()=>S.delete(T)),toggle:(T,P)=>{w.forEach(N=>{P!=null&&P!==N.props.toastId||gr(N.toggle)&&N.toggle(T)})},removeToast:C,toasts:w,clearQueue:()=>{g-=m.length,m=[]},buildToast:(T,P)=>{if((z=>{let{containerId:se,toastId:ne,updateId:ie}=z;const oe=se?se!==d:d!==1,J=w.has(ne)&&ie==null;return oe||J})(P))return;const{toastId:N,updateId:U,data:I,staleId:Z,delay:V}=P,Q=()=>{C(N)},ee=U==null;ee&&g++;const W={...y,style:y.toastStyle,key:h++,...Object.fromEntries(Object.entries(P).filter(z=>{let[se,ne]=z;return ne!=null})),toastId:N,updateId:U,data:I,closeToast:Q,isIn:!1,className:dp(P.className||y.toastClassName),bodyClassName:dp(P.bodyClassName||y.bodyClassName),progressClassName:dp(P.progressClassName||y.progressClassName),autoClose:!P.isLoading&&(F=P.autoClose,A=y.autoClose,F===!1||rd(F)&&F>0?F:A),deleteToast(){const z=w.get(N),{onClose:se,children:ne}=z.props;gr(se)&&se(v.isValidElement(ne)&&ne.props),f(D0(z,"removed")),w.delete(N),g--,g<0&&(g=0),m.length>0?k(m.shift()):E()}};var F,A;W.closeButton=y.closeButton,P.closeButton===!1||Iy(P.closeButton)?W.closeButton=P.closeButton:P.closeButton===!0&&(W.closeButton=!Iy(y.closeButton)||y.closeButton);let Y=T;v.isValidElement(T)&&!ci(T.type)?Y=v.cloneElement(T,{closeToast:Q,toastProps:W,data:I}):gr(T)&&(Y=T({closeToast:Q,toastProps:W,data:I}));const de={content:Y,props:W,staleId:Z};y.limit&&y.limit>0&&g>y.limit&&ee?m.push(de):rd(V)?setTimeout(()=>{k(de)},V):k(de)},setProps(T){y=T},setToggle:(T,P)=>{w.get(T).toggle=P},isToastActive:T=>x.some(P=>P===T),getSnapshot:()=>y.newestOnTop?b.reverse():b}}(a,o,GL);Vn.set(a,c);const i=c.observe(l);return sd.forEach(d=>k_(d.content,d.options)),sd=[],()=>{i(),Vn.delete(a)}},setProps(l){var c;(c=Vn.get(a))==null||c.setProps(l)},getSnapshot(){var l;return(l=Vn.get(a))==null?void 0:l.getSnapshot()}}}(e)).current;r(e);const s=v.useSyncExternalStore(t,n,n);return{getToastToRender:function(o){if(!s)return[];const a=new Map;return s.forEach(l=>{const{position:c}=l.props;a.has(c)||a.set(c,[]),a.get(c).push(l)}),Array.from(a,l=>o(l[0],l[1]))},isToastActive:T_,count:s==null?void 0:s.length}}function QL(e){const[t,n]=v.useState(!1),[r,s]=v.useState(!1),o=v.useRef(null),a=v.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:l,pauseOnHover:c,closeToast:i,onClick:d,closeOnClick:p}=e;var f,h;function g(){n(!0)}function m(){n(!1)}function x(w){const S=o.current;a.canDrag&&S&&(a.didMove=!0,t&&m(),a.delta=e.draggableDirection==="x"?w.clientX-a.start:w.clientY-a.start,a.start!==w.clientX&&(a.canCloseOnClick=!1),S.style.transform=`translate3d(${e.draggableDirection==="x"?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`},0)`,S.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function b(){document.removeEventListener("pointermove",x),document.removeEventListener("pointerup",b);const w=o.current;if(a.canDrag&&a.didMove&&w){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return s(!0),e.closeToast(),void e.collapseAll();w.style.transition="transform 0.2s, opacity 0.2s",w.style.removeProperty("transform"),w.style.removeProperty("opacity")}}(h=Vn.get((f={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||h.setToggle(f.id,f.fn),v.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||m(),window.addEventListener("focus",g),window.addEventListener("blur",m),()=>{window.removeEventListener("focus",g),window.removeEventListener("blur",m)}},[e.pauseOnFocusLoss]);const y={onPointerDown:function(w){if(e.draggable===!0||e.draggable===w.pointerType){a.didMove=!1,document.addEventListener("pointermove",x),document.addEventListener("pointerup",b);const S=o.current;a.canCloseOnClick=!0,a.canDrag=!0,S.style.transition="none",e.draggableDirection==="x"?(a.start=w.clientX,a.removalDistance=S.offsetWidth*(e.draggablePercent/100)):(a.start=w.clientY,a.removalDistance=S.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(w){const{top:S,bottom:E,left:C,right:k}=o.current.getBoundingClientRect();w.nativeEvent.type!=="touchend"&&e.pauseOnHover&&w.clientX>=C&&w.clientX<=k&&w.clientY>=S&&w.clientY<=E?m():g()}};return l&&c&&(y.onMouseEnter=m,e.stacked||(y.onMouseLeave=g)),p&&(y.onClick=w=>{d&&d(w),a.canCloseOnClick&&i()}),{playToast:g,pauseToast:m,isRunning:t,preventExitTransition:r,toastRef:o,eventHandlers:y}}function ZL(e){let{delay:t,isRunning:n,closeToast:r,type:s="default",hide:o,className:a,style:l,controlledProgress:c,progress:i,rtl:d,isIn:p,theme:f}=e;const h=o||c&&i===0,g={...l,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};c&&(g.transform=`scaleX(${i})`);const m=oo("Toastify__progress-bar",c?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${f}`,`Toastify__progress-bar--${s}`,{"Toastify__progress-bar--rtl":d}),x=gr(a)?a({rtl:d,type:s,defaultClassName:m}):oo(m,a),b={[c&&i>=1?"onTransitionEnd":"onAnimationEnd"]:c&&i<1?null:()=>{p&&r()}};return Te.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":h},Te.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${f} Toastify__progress-bar--${s}`}),Te.createElement("div",{role:"progressbar","aria-hidden":h?"true":"false","aria-label":"notification timer",className:x,style:g,...b}))}let YL=1;const __=()=>""+YL++;function XL(e){return e&&(ci(e.toastId)||rd(e.toastId))?e.toastId:__()}function _c(e,t){return k_(e,t),t.toastId}function Xp(e,t){return{...t,type:t&&t.type||e,toastId:XL(t)}}function jf(e){return(t,n)=>_c(t,Xp(e,n))}function X(e,t){return _c(e,Xp("default",t))}X.loading=(e,t)=>_c(e,Xp("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),X.promise=function(e,t,n){let r,{pending:s,error:o,success:a}=t;s&&(r=ci(s)?X.loading(s,n):X.loading(s.render,{...n,...s}));const l={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},c=(d,p,f)=>{if(p==null)return void X.dismiss(r);const h={type:d,...l,...n,data:f},g=ci(p)?{render:p}:p;return r?X.update(r,{...h,...g}):X(g.render,{...h,...g}),f},i=gr(e)?e():e;return i.then(d=>c("success",a,d)).catch(d=>c("error",o,d)),i},X.success=jf("success"),X.info=jf("info"),X.error=jf("error"),X.warning=jf("warning"),X.warn=X.warning,X.dark=(e,t)=>_c(e,Xp("default",{theme:"dark",...t})),X.dismiss=function(e){(function(t){var n;if(E_()){if(t==null||ci(n=t)||rd(n))Vn.forEach(r=>{r.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){const r=Vn.get(t.containerId);r?r.removeToast(t.id):Vn.forEach(s=>{s.removeToast(t.id)})}}else sd=sd.filter(r=>t!=null&&r.options.toastId!==t)})(e)},X.clearWaitingQueue=function(e){e===void 0&&(e={}),Vn.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},X.isActive=T_,X.update=function(e,t){t===void 0&&(t={});const n=((r,s)=>{var o;let{containerId:a}=s;return(o=Vn.get(a||1))==null?void 0:o.toasts.get(r)})(e,t);if(n){const{props:r,content:s}=n,o={delay:100,...r,...t,toastId:t.toastId||e,updateId:__()};o.toastId!==e&&(o.staleId=e);const a=o.render||s;delete o.render,_c(a,o)}},X.done=e=>{X.update(e,{progress:1})},X.onChange=function(e){return Dy.add(e),()=>{Dy.delete(e)}},X.play=e=>A0(!0,e),X.pause=e=>A0(!1,e);const e$=typeof window<"u"?v.useLayoutEffect:v.useEffect,Rf=e=>{let{theme:t,type:n,isLoading:r,...s}=e;return Te.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...s})},Dm={info:function(e){return Te.createElement(Rf,{...e},Te.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return Te.createElement(Rf,{...e},Te.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return Te.createElement(Rf,{...e},Te.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return Te.createElement(Rf,{...e},Te.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return Te.createElement("div",{className:"Toastify__spinner"})}},t$=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:s,playToast:o}=QL(e),{closeButton:a,children:l,autoClose:c,onClick:i,type:d,hideProgressBar:p,closeToast:f,transition:h,position:g,className:m,style:x,bodyClassName:b,bodyStyle:y,progressClassName:w,progressStyle:S,updateId:E,role:C,progress:k,rtl:T,toastId:P,deleteToast:N,isIn:U,isLoading:I,closeOnClick:Z,theme:V}=e,Q=oo("Toastify__toast",`Toastify__toast-theme--${V}`,`Toastify__toast--${d}`,{"Toastify__toast--rtl":T},{"Toastify__toast--close-on-click":Z}),ee=gr(m)?m({rtl:T,position:g,type:d,defaultClassName:Q}):oo(Q,m),W=function(de){let{theme:z,type:se,isLoading:ne,icon:ie}=de,oe=null;const J={theme:z,type:se};return ie===!1||(gr(ie)?oe=ie({...J,isLoading:ne}):v.isValidElement(ie)?oe=v.cloneElement(ie,J):ne?oe=Dm.spinner():(Ce=>Ce in Dm)(se)&&(oe=Dm[se](J))),oe}(e),F=!!k||!c,A={closeToast:f,type:d,theme:V};let Y=null;return a===!1||(Y=gr(a)?a(A):v.isValidElement(a)?v.cloneElement(a,A):function(de){let{closeToast:z,theme:se,ariaLabel:ne="close"}=de;return Te.createElement("button",{className:`Toastify__close-button Toastify__close-button--${se}`,type:"button",onClick:ie=>{ie.stopPropagation(),z(ie)},"aria-label":ne},Te.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},Te.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(A)),Te.createElement(h,{isIn:U,done:N,position:g,preventExitTransition:n,nodeRef:r,playToast:o},Te.createElement("div",{id:P,onClick:i,"data-in":U,className:ee,...s,style:x,ref:r},Te.createElement("div",{...U&&{role:C},className:gr(b)?b({type:d}):oo("Toastify__toast-body",b),style:y},W!=null&&Te.createElement("div",{className:oo("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!I})},W),Te.createElement("div",null,l)),Y,Te.createElement(ZL,{...E&&!F?{key:`pb-${E}`}:{},rtl:T,theme:V,delay:c,isRunning:t,isIn:U,closeToast:f,hide:p,type:d,style:S,className:w,controlledProgress:F,progress:k||0})))},eg=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},n$=Xh(eg("bounce",!0));Xh(eg("slide",!0));Xh(eg("zoom"));Xh(eg("flip"));const r$={position:"top-right",transition:n$,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function s$(e){let t={...r$,...e};const n=e.stacked,[r,s]=v.useState(!0),o=v.useRef(null),{getToastToRender:a,isToastActive:l,count:c}=JL(t),{className:i,style:d,rtl:p,containerId:f}=t;function h(m){const x=oo("Toastify__toast-container",`Toastify__toast-container--${m}`,{"Toastify__toast-container--rtl":p});return gr(i)?i({position:m,rtl:p,defaultClassName:x}):oo(x,dp(i))}function g(){n&&(s(!0),X.play())}return e$(()=>{if(n){var m;const x=o.current.querySelectorAll('[data-in="true"]'),b=12,y=(m=t.position)==null?void 0:m.includes("top");let w=0,S=0;Array.from(x).reverse().forEach((E,C)=>{const k=E;k.classList.add("Toastify__toast--stacked"),C>0&&(k.dataset.collapsed=`${r}`),k.dataset.pos||(k.dataset.pos=y?"top":"bot");const T=w*(r?.2:1)+(r?0:b*C);k.style.setProperty("--y",`${y?T:-1*T}px`),k.style.setProperty("--g",`${b}`),k.style.setProperty("--s",""+(1-(r?S:0))),w+=k.offsetHeight,S+=.025})}},[r,c,n]),Te.createElement("div",{ref:o,className:"Toastify",id:f,onMouseEnter:()=>{n&&(s(!1),X.pause())},onMouseLeave:g},a((m,x)=>{const b=x.length?{...d}:{...d,pointerEvents:"none"};return Te.createElement("div",{className:h(m),style:b,key:`container-${m}`},x.map(y=>{let{content:w,props:S}=y;return Te.createElement(t$,{...S,stacked:n,collapseAll:g,isIn:l(S.toastId,S.containerId),style:S.style,key:`toast-${S.key}`},w)}))}))}const o$={theme:"system",setTheme:()=>null},j_=v.createContext(o$);function a$({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[s,o]=v.useState(()=>localStorage.getItem(n)||t);v.useEffect(()=>{const l=window.document.documentElement;if(l.classList.remove("light","dark"),s==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";l.classList.add(c);return}l.classList.add(s)},[s]);const a={theme:s,setTheme:l=>{localStorage.setItem(n,l),o(l)}};return u.jsx(j_.Provider,{...r,value:a,children:e})}const R_=()=>{const e=v.useContext(j_);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};let Am=!1;const i$=new RD({defaultOptions:{queries:{staleTime:1e3*60*5,retry(e){return e>=3?(Am===!1&&(Am=!0,X.error("The application is taking longer than expected to load, please try again in a few minutes.",{onClose:()=>{Am=!1}})),!1):!0}}}});var rs=(e=>(e.API_URL="apiUrl",e.TOKEN="token",e.VERSION="version",e.FACEBOOK_APP_ID="facebookAppId",e.FACEBOOK_CONFIG_ID="facebookConfigId",e.FACEBOOK_USER_TOKEN="facebookUserToken",e.CLIENT_NAME="clientName",e))(rs||{});const P_=async e=>{if(e.url){const t=e.url.endsWith("/")?e.url.slice(0,-1):e.url;localStorage.setItem("apiUrl",t)}e.token&&localStorage.setItem("token",e.token),e.version&&localStorage.setItem("version",e.version),e.facebookAppId&&localStorage.setItem("facebookAppId",e.facebookAppId),e.facebookConfigId&&localStorage.setItem("facebookConfigId",e.facebookConfigId),e.facebookUserToken&&localStorage.setItem("facebookUserToken",e.facebookUserToken),e.clientName&&localStorage.setItem("clientName",e.clientName)},M_=()=>{localStorage.removeItem("apiUrl"),localStorage.removeItem("token"),localStorage.removeItem("version"),localStorage.removeItem("facebookAppId"),localStorage.removeItem("facebookConfigId"),localStorage.removeItem("facebookUserToken"),localStorage.removeItem("clientName")},Fs=e=>localStorage.getItem(e),Gt=({children:e})=>{const t=Fs(rs.API_URL),n=Fs(rs.TOKEN),r=Fs(rs.VERSION);return!t||!n||!r?u.jsx(S_,{to:"/manager/login"}):e},l$=({children:e})=>{const t=Fs(rs.API_URL),n=Fs(rs.TOKEN),r=Fs(rs.VERSION);return t&&n&&r?u.jsx(S_,{to:"/"}):e};function O_(e,t){return function(){return e.apply(t,arguments)}}const{toString:u$}=Object.prototype,{getPrototypeOf:Mx}=Object,tg=(e=>t=>{const n=u$.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),fs=e=>(e=e.toLowerCase(),t=>tg(t)===e),ng=e=>t=>typeof t===e,{isArray:hu}=Array,od=ng("undefined");function c$(e){return e!==null&&!od(e)&&e.constructor!==null&&!od(e.constructor)&&Lr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const N_=fs("ArrayBuffer");function d$(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&N_(e.buffer),t}const f$=ng("string"),Lr=ng("function"),I_=ng("number"),rg=e=>e!==null&&typeof e=="object",p$=e=>e===!0||e===!1,fp=e=>{if(tg(e)!=="object")return!1;const t=Mx(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},h$=fs("Date"),g$=fs("File"),m$=fs("Blob"),v$=fs("FileList"),y$=e=>rg(e)&&Lr(e.pipe),b$=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Lr(e.append)&&((t=tg(e))==="formdata"||t==="object"&&Lr(e.toString)&&e.toString()==="[object FormData]"))},x$=fs("URLSearchParams"),[w$,S$,C$,E$]=["ReadableStream","Request","Response","Headers"].map(fs),T$=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Bd(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),hu(e))for(r=0,s=e.length;r0;)if(s=n[r],t===s.toLowerCase())return s;return null}const A_=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,F_=e=>!od(e)&&e!==A_;function Ay(){const{caseless:e}=F_(this)&&this||{},t={},n=(r,s)=>{const o=e&&D_(t,s)||s;fp(t[o])&&fp(r)?t[o]=Ay(t[o],r):fp(r)?t[o]=Ay({},r):hu(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r(Bd(t,(s,o)=>{n&&Lr(s)?e[o]=O_(s,n):e[o]=s},{allOwnKeys:r}),e),_$=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),j$=(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)},R$=(e,t,n,r)=>{let s,o,a;const l={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)a=s[o],(!r||r(a,e,t))&&!l[a]&&(t[a]=e[a],l[a]=!0);e=n!==!1&&Mx(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},P$=(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},M$=e=>{if(!e)return null;if(hu(e))return e;let t=e.length;if(!I_(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},O$=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Mx(Uint8Array)),N$=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},I$=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},D$=fs("HTMLFormElement"),A$=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),F0=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),F$=fs("RegExp"),L_=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Bd(n,(s,o)=>{let a;(a=t(s,o,e))!==!1&&(r[o]=a||s)}),Object.defineProperties(e,r)},L$=e=>{L_(e,(t,n)=>{if(Lr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Lr(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+"'")})}})},$$=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return hu(e)?r(e):r(String(e).split(t)),n},B$=()=>{},z$=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Fm="abcdefghijklmnopqrstuvwxyz",L0="0123456789",$_={DIGIT:L0,ALPHA:Fm,ALPHA_DIGIT:Fm+Fm.toUpperCase()+L0},U$=(e=16,t=$_.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function V$(e){return!!(e&&Lr(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const H$=e=>{const t=new Array(10),n=(r,s)=>{if(rg(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const o=hu(r)?[]:{};return Bd(r,(a,l)=>{const c=n(a,s+1);!od(c)&&(o[l]=c)}),t[s]=void 0,o}}return r};return n(e,0)},K$=fs("AsyncFunction"),q$=e=>e&&(rg(e)||Lr(e))&&Lr(e.then)&&Lr(e.catch),$={isArray:hu,isArrayBuffer:N_,isBuffer:c$,isFormData:b$,isArrayBufferView:d$,isString:f$,isNumber:I_,isBoolean:p$,isObject:rg,isPlainObject:fp,isReadableStream:w$,isRequest:S$,isResponse:C$,isHeaders:E$,isUndefined:od,isDate:h$,isFile:g$,isBlob:m$,isRegExp:F$,isFunction:Lr,isStream:y$,isURLSearchParams:x$,isTypedArray:O$,isFileList:v$,forEach:Bd,merge:Ay,extend:k$,trim:T$,stripBOM:_$,inherits:j$,toFlatObject:R$,kindOf:tg,kindOfTest:fs,endsWith:P$,toArray:M$,forEachEntry:N$,matchAll:I$,isHTMLForm:D$,hasOwnProperty:F0,hasOwnProp:F0,reduceDescriptors:L_,freezeMethods:L$,toObjectSet:$$,toCamelCase:A$,noop:B$,toFiniteNumber:z$,findKey:D_,global:A_,isContextDefined:F_,ALPHABET:$_,generateString:U$,isSpecCompliantForm:V$,toJSONObject:H$,isAsyncFn:K$,isThenable:q$};function He(e,t,n,r,s){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),s&&(this.response=s)}$.inherits(He,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:$.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const B_=He.prototype,z_={};["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=>{z_[e]={value:e}});Object.defineProperties(He,z_);Object.defineProperty(B_,"isAxiosError",{value:!0});He.from=(e,t,n,r,s,o)=>{const a=Object.create(B_);return $.toFlatObject(e,a,function(c){return c!==Error.prototype},l=>l!=="isAxiosError"),He.call(a,e.message,t,n,r,s),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const W$=null;function Fy(e){return $.isPlainObject(e)||$.isArray(e)}function U_(e){return $.endsWith(e,"[]")?e.slice(0,-2):e}function $0(e,t,n){return e?e.concat(t).map(function(s,o){return s=U_(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function G$(e){return $.isArray(e)&&!e.some(Fy)}const J$=$.toFlatObject($,{},null,function(t){return/^is[A-Z]/.test(t)});function sg(e,t,n){if(!$.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=$.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,x){return!$.isUndefined(x[m])});const r=n.metaTokens,s=n.visitor||d,o=n.dots,a=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&$.isSpecCompliantForm(t);if(!$.isFunction(s))throw new TypeError("visitor must be a function");function i(g){if(g===null)return"";if($.isDate(g))return g.toISOString();if(!c&&$.isBlob(g))throw new He("Blob is not supported. Use a Buffer instead.");return $.isArrayBuffer(g)||$.isTypedArray(g)?c&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function d(g,m,x){let b=g;if(g&&!x&&typeof g=="object"){if($.endsWith(m,"{}"))m=r?m:m.slice(0,-2),g=JSON.stringify(g);else if($.isArray(g)&&G$(g)||($.isFileList(g)||$.endsWith(m,"[]"))&&(b=$.toArray(g)))return m=U_(m),b.forEach(function(w,S){!($.isUndefined(w)||w===null)&&t.append(a===!0?$0([m],S,o):a===null?m:m+"[]",i(w))}),!1}return Fy(g)?!0:(t.append($0(x,m,o),i(g)),!1)}const p=[],f=Object.assign(J$,{defaultVisitor:d,convertValue:i,isVisitable:Fy});function h(g,m){if(!$.isUndefined(g)){if(p.indexOf(g)!==-1)throw Error("Circular reference detected in "+m.join("."));p.push(g),$.forEach(g,function(b,y){(!($.isUndefined(b)||b===null)&&s.call(t,b,$.isString(y)?y.trim():y,m,f))===!0&&h(b,m?m.concat(y):[y])}),p.pop()}}if(!$.isObject(e))throw new TypeError("data must be an object");return h(e),t}function B0(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Ox(e,t){this._pairs=[],e&&sg(e,this,t)}const V_=Ox.prototype;V_.append=function(t,n){this._pairs.push([t,n])};V_.toString=function(t){const n=t?function(r){return t.call(this,r,B0)}:B0;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Q$(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function H_(e,t,n){if(!t)return e;const r=n&&n.encode||Q$,s=n&&n.serialize;let o;if(s?o=s(t,n):o=$.isURLSearchParams(t)?t.toString():new Ox(t,n).toString(r),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class z0{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){$.forEach(this.handlers,function(r){r!==null&&t(r)})}}const K_={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Z$=typeof URLSearchParams<"u"?URLSearchParams:Ox,Y$=typeof FormData<"u"?FormData:null,X$=typeof Blob<"u"?Blob:null,e4={isBrowser:!0,classes:{URLSearchParams:Z$,FormData:Y$,Blob:X$},protocols:["http","https","file","blob","url","data"]},Nx=typeof window<"u"&&typeof document<"u",t4=(e=>Nx&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),n4=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",r4=Nx&&window.location.href||"http://localhost",s4=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Nx,hasStandardBrowserEnv:t4,hasStandardBrowserWebWorkerEnv:n4,origin:r4},Symbol.toStringTag,{value:"Module"})),ss={...s4,...e4};function o4(e,t){return sg(e,new ss.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return ss.isNode&&$.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function a4(e){return $.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function i4(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r=n.length;return a=!a&&$.isArray(s)?s.length:a,c?($.hasOwnProp(s,a)?s[a]=[s[a],r]:s[a]=r,!l):((!s[a]||!$.isObject(s[a]))&&(s[a]=[]),t(n,r,s[a],o)&&$.isArray(s[a])&&(s[a]=i4(s[a])),!l)}if($.isFormData(e)&&$.isFunction(e.entries)){const n={};return $.forEachEntry(e,(r,s)=>{t(a4(r),s,n,0)}),n}return null}function l4(e,t,n){if($.isString(e))try{return(t||JSON.parse)(e),$.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const zd={transitional:K_,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=$.isObject(t);if(o&&$.isHTMLForm(t)&&(t=new FormData(t)),$.isFormData(t))return s?JSON.stringify(q_(t)):t;if($.isArrayBuffer(t)||$.isBuffer(t)||$.isStream(t)||$.isFile(t)||$.isBlob(t)||$.isReadableStream(t))return t;if($.isArrayBufferView(t))return t.buffer;if($.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return o4(t,this.formSerializer).toString();if((l=$.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return sg(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),l4(t)):t}],transformResponse:[function(t){const n=this.transitional||zd.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if($.isResponse(t)||$.isReadableStream(t))return t;if(t&&$.isString(t)&&(r&&!this.responseType||s)){const a=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(l){if(a)throw l.name==="SyntaxError"?He.from(l,He.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:ss.classes.FormData,Blob:ss.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};$.forEach(["delete","get","head","post","put","patch"],e=>{zd.headers[e]={}});const u4=$.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"]),c4=e=>{const t={};let n,r,s;return e&&e.split(`
-`).forEach(function(a){s=a.indexOf(":"),n=a.substring(0,s).trim().toLowerCase(),r=a.substring(s+1).trim(),!(!n||t[n]&&u4[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},U0=Symbol("internals");function Gu(e){return e&&String(e).trim().toLowerCase()}function pp(e){return e===!1||e==null?e:$.isArray(e)?e.map(pp):String(e)}function d4(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 f4=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Lm(e,t,n,r,s){if($.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!$.isString(t)){if($.isString(r))return t.indexOf(r)!==-1;if($.isRegExp(r))return r.test(t)}}function p4(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function h4(e,t){const n=$.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,a){return this[r].call(this,t,s,o,a)},configurable:!0})})}let sr=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(l,c,i){const d=Gu(c);if(!d)throw new Error("header name must be a non-empty string");const p=$.findKey(s,d);(!p||s[p]===void 0||i===!0||i===void 0&&s[p]!==!1)&&(s[p||c]=pp(l))}const a=(l,c)=>$.forEach(l,(i,d)=>o(i,d,c));if($.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if($.isString(t)&&(t=t.trim())&&!f4(t))a(c4(t),n);else if($.isHeaders(t))for(const[l,c]of t.entries())o(c,l,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=Gu(t),t){const r=$.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return d4(s);if($.isFunction(n))return n.call(this,s,r);if($.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Gu(t),t){const r=$.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Lm(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(a){if(a=Gu(a),a){const l=$.findKey(r,a);l&&(!n||Lm(r,r[l],l,n))&&(delete r[l],s=!0)}}return $.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||Lm(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return $.forEach(this,(s,o)=>{const a=$.findKey(r,o);if(a){n[a]=pp(s),delete n[o];return}const l=t?p4(o):String(o).trim();l!==o&&delete n[o],n[l]=pp(s),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return $.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&$.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(s=>r.set(s)),r}static accessor(t){const r=(this[U0]=this[U0]={accessors:{}}).accessors,s=this.prototype;function o(a){const l=Gu(a);r[l]||(h4(s,a),r[l]=!0)}return $.isArray(t)?t.forEach(o):o(t),this}};sr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);$.reduceDescriptors(sr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});$.freezeMethods(sr);function $m(e,t){const n=this||zd,r=t||n,s=sr.from(r.headers);let o=r.data;return $.forEach(e,function(l){o=l.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function W_(e){return!!(e&&e.__CANCEL__)}function gu(e,t,n){He.call(this,e??"canceled",He.ERR_CANCELED,t,n),this.name="CanceledError"}$.inherits(gu,He,{__CANCEL__:!0});function G_(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new He("Request failed with status code "+n.status,[He.ERR_BAD_REQUEST,He.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function g4(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function m4(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,a;return t=t!==void 0?t:1e3,function(c){const i=Date.now(),d=r[o];a||(a=i),n[s]=c,r[s]=i;let p=o,f=0;for(;p!==s;)f+=n[p++],p=p%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),i-aE&&(h=E)}if(i){var b,y;const w=f==="y"?"width":"height",S=["top","left"].includes(yo(s)),E=o.reference[p]-o.floating[w]+(S&&((b=a.offset)==null?void 0:b[p])||0)+(S?0:x.crossAxis),C=o.reference[p]+o.reference[w]+(S?0:((y=a.offset)==null?void 0:y[p])||0)-(S?x.crossAxis:0);g"u")return oU;var t=aU(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},lU=eR(),_l="data-scroll-locked",uU=function(e,t,n,r){var s=e.left,o=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),`
- .`.concat(Hz,` {
- overflow: hidden `).concat(r,`;
- padding-right: `).concat(l,"px ").concat(r,`;
- }
- body[`).concat(_l,`] {
- overflow: hidden `).concat(r,`;
- overscroll-behavior: contain;
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
- padding-left: `.concat(s,`px;
- padding-top: `).concat(o,`px;
- padding-right: `).concat(a,`px;
- margin-left:0;
- margin-top:0;
- margin-right: `).concat(l,"px ").concat(r,`;
- `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
- }
-
- .`).concat(gp,` {
- right: `).concat(l,"px ").concat(r,`;
- }
-
- .`).concat(mp,` {
- margin-right: `).concat(l,"px ").concat(r,`;
- }
-
- .`).concat(gp," .").concat(gp,` {
- right: 0 `).concat(r,`;
- }
-
- .`).concat(mp," .").concat(mp,` {
- margin-right: 0 `).concat(r,`;
- }
-
- body[`).concat(_l,`] {
- `).concat(Kz,": ").concat(l,`px;
- }
-`)},vC=function(){var e=parseInt(document.body.getAttribute(_l)||"0",10);return isFinite(e)?e:0},cU=function(){v.useEffect(function(){return document.body.setAttribute(_l,(vC()+1).toString()),function(){var e=vC()-1;e<=0?document.body.removeAttribute(_l):document.body.setAttribute(_l,e.toString())}},[])},dU=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;cU();var o=v.useMemo(function(){return iU(s)},[s]);return v.createElement(lU,{styles:uU(o,!t,s,n?"":"!important")})},Jy=!1;if(typeof window<"u")try{var Df=Object.defineProperty({},"passive",{get:function(){return Jy=!0,!0}});window.addEventListener("test",Df,Df),window.removeEventListener("test",Df,Df)}catch{Jy=!1}var qi=Jy?{passive:!1}:!1,fU=function(e){return e.tagName==="TEXTAREA"},tR=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!fU(e)&&n[t]==="visible")},pU=function(e){return tR(e,"overflowY")},hU=function(e){return tR(e,"overflowX")},yC=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=nR(e,r);if(s){var o=rR(e,r),a=o[1],l=o[2];if(a>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},gU=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},mU=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},nR=function(e,t){return e==="v"?pU(t):hU(t)},rR=function(e,t){return e==="v"?gU(t):mU(t)},vU=function(e,t){return e==="h"&&t==="rtl"?-1:1},yU=function(e,t,n,r,s){var o=vU(e,window.getComputedStyle(t).direction),a=o*r,l=n.target,c=t.contains(l),i=!1,d=a>0,p=0,f=0;do{var h=rR(e,l),g=h[0],m=h[1],x=h[2],b=m-x-o*g;(g||b)&&nR(e,l)&&(p+=b,f+=g),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(p)<1||!s)||!d&&(Math.abs(f)<1||!s))&&(i=!0),i},Af=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},bC=function(e){return[e.deltaX,e.deltaY]},xC=function(e){return e&&"current"in e?e.current:e},bU=function(e,t){return e[0]===t[0]&&e[1]===t[1]},xU=function(e){return`
- .block-interactivity-`.concat(e,` {pointer-events: none;}
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
-`)},wU=0,Wi=[];function SU(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),s=v.useState(wU++)[0],o=v.useState(eR)[0],a=v.useRef(e);v.useEffect(function(){a.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=Vz([e.lockRef.current],(e.shards||[]).map(xC),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=v.useCallback(function(m,x){if("touches"in m&&m.touches.length===2)return!a.current.allowPinchZoom;var b=Af(m),y=n.current,w="deltaX"in m?m.deltaX:y[0]-b[0],S="deltaY"in m?m.deltaY:y[1]-b[1],E,C=m.target,k=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in m&&k==="h"&&C.type==="range")return!1;var T=yC(k,C);if(!T)return!0;if(T?E=k:(E=k==="v"?"h":"v",T=yC(k,C)),!T)return!1;if(!r.current&&"changedTouches"in m&&(w||S)&&(r.current=E),!E)return!0;var P=r.current||E;return yU(P,x,m,P==="h"?w:S,!0)},[]),c=v.useCallback(function(m){var x=m;if(!(!Wi.length||Wi[Wi.length-1]!==o)){var b="deltaY"in x?bC(x):Af(x),y=t.current.filter(function(E){return E.name===x.type&&(E.target===x.target||x.target===E.shadowParent)&&bU(E.delta,b)})[0];if(y&&y.should){x.cancelable&&x.preventDefault();return}if(!y){var w=(a.current.shards||[]).map(xC).filter(Boolean).filter(function(E){return E.contains(x.target)}),S=w.length>0?l(x,w[0]):!a.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),i=v.useCallback(function(m,x,b,y){var w={name:m,delta:x,target:b,should:y,shadowParent:CU(b)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),d=v.useCallback(function(m){n.current=Af(m),r.current=void 0},[]),p=v.useCallback(function(m){i(m.type,bC(m),m.target,l(m,e.lockRef.current))},[]),f=v.useCallback(function(m){i(m.type,Af(m),m.target,l(m,e.lockRef.current))},[]);v.useEffect(function(){return Wi.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:f}),document.addEventListener("wheel",c,qi),document.addEventListener("touchmove",c,qi),document.addEventListener("touchstart",d,qi),function(){Wi=Wi.filter(function(m){return m!==o}),document.removeEventListener("wheel",c,qi),document.removeEventListener("touchmove",c,qi),document.removeEventListener("touchstart",d,qi)}},[]);var h=e.removeScrollBar,g=e.inert;return v.createElement(v.Fragment,null,g?v.createElement(o,{styles:xU(s)}):null,h?v.createElement(dU,{gapMode:e.gapMode}):null)}function CU(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const EU=Yz(Xj,SU);var bg=v.forwardRef(function(e,t){return v.createElement(yg,_s({},e,{ref:t,sideCar:EU}))});bg.classNames=yg.classNames;var Qy=["Enter"," "],TU=["ArrowDown","PageUp","Home"],sR=["ArrowUp","PageDown","End"],kU=[...TU,...sR],_U={ltr:[...Qy,"ArrowRight"],rtl:[...Qy,"ArrowLeft"]},jU={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Qd="Menu",[ld,RU,PU]=Fx(Qd),[Ii,oR]=Vr(Qd,[PU,hg,vg]),xg=hg(),aR=vg(),[MU,Di]=Ii(Qd),[OU,Zd]=Ii(Qd),iR=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:a=!0}=e,l=xg(t),[c,i]=v.useState(null),d=v.useRef(!1),p=nn(o),f=Gd(s);return v.useEffect(()=>{const h=()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>d.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),u.jsx($j,{...l,children:u.jsx(MU,{scope:t,open:n,onOpenChange:p,content:c,onContentChange:i,children:u.jsx(OU,{scope:t,onClose:v.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:d,dir:f,modal:a,children:r})})})};iR.displayName=Qd;var NU="MenuAnchor",Gx=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=xg(n);return u.jsx(Bj,{...s,...r,ref:t})});Gx.displayName=NU;var Jx="MenuPortal",[IU,lR]=Ii(Jx,{forceMount:void 0}),uR=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=Di(Jx,t);return u.jsx(IU,{scope:t,forceMount:n,children:u.jsx(or,{present:n||o.open,children:u.jsx(gg,{asChild:!0,container:s,children:r})})})};uR.displayName=Jx;var $r="MenuContent",[DU,Qx]=Ii($r),cR=v.forwardRef((e,t)=>{const n=lR($r,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=Di($r,e.__scopeMenu),a=Zd($r,e.__scopeMenu);return u.jsx(ld.Provider,{scope:e.__scopeMenu,children:u.jsx(or,{present:r||o.open,children:u.jsx(ld.Slot,{scope:e.__scopeMenu,children:a.modal?u.jsx(AU,{...s,ref:t}):u.jsx(FU,{...s,ref:t})})})})}),AU=v.forwardRef((e,t)=>{const n=Di($r,e.__scopeMenu),r=v.useRef(null),s=it(t,r);return v.useEffect(()=>{const o=r.current;if(o)return Wx(o)},[]),u.jsx(Zx,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Se(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),FU=v.forwardRef((e,t)=>{const n=Di($r,e.__scopeMenu);return u.jsx(Zx,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Zx=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:i,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:f,onDismiss:h,disableOutsideScroll:g,...m}=e,x=Di($r,n),b=Zd($r,n),y=xg(n),w=aR(n),S=RU(n),[E,C]=v.useState(null),k=v.useRef(null),T=it(t,k,x.onContentChange),P=v.useRef(0),N=v.useRef(""),U=v.useRef(0),I=v.useRef(null),Z=v.useRef("right"),V=v.useRef(0),Q=g?bg:v.Fragment,ee=g?{as:mo,allowPinchZoom:!0}:void 0,W=A=>{var J,Ce;const Y=N.current+A,de=S().filter(Pe=>!Pe.disabled),z=document.activeElement,se=(J=de.find(Pe=>Pe.ref.current===z))==null?void 0:J.textValue,ne=de.map(Pe=>Pe.textValue),ie=JU(ne,Y,se),oe=(Ce=de.find(Pe=>Pe.textValue===ie))==null?void 0:Ce.ref.current;(function Pe(Le){N.current=Le,window.clearTimeout(P.current),Le!==""&&(P.current=window.setTimeout(()=>Pe(""),1e3))})(Y),oe&&setTimeout(()=>oe.focus())};v.useEffect(()=>()=>window.clearTimeout(P.current),[]),Lx();const F=v.useCallback(A=>{var de,z;return Z.current===((de=I.current)==null?void 0:de.side)&&ZU(A,(z=I.current)==null?void 0:z.area)},[]);return u.jsx(DU,{scope:n,searchRef:N,onItemEnter:v.useCallback(A=>{F(A)&&A.preventDefault()},[F]),onItemLeave:v.useCallback(A=>{var Y;F(A)||((Y=k.current)==null||Y.focus(),C(null))},[F]),onTriggerLeave:v.useCallback(A=>{F(A)&&A.preventDefault()},[F]),pointerGraceTimerRef:U,onPointerGraceIntentChange:v.useCallback(A=>{I.current=A},[]),children:u.jsx(Q,{...ee,children:u.jsx(dg,{asChild:!0,trapped:s,onMountAutoFocus:Se(o,A=>{var Y;A.preventDefault(),(Y=k.current)==null||Y.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:u.jsx(cg,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:i,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:f,onDismiss:h,children:u.jsx(Gj,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:C,onEntryFocus:Se(c,A=>{b.isUsingKeyboardRef.current||A.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(zj,{role:"menu","aria-orientation":"vertical","data-state":kR(x.open),"data-radix-menu-content":"",dir:b.dir,...y,...m,ref:T,style:{outline:"none",...m.style},onKeyDown:Se(m.onKeyDown,A=>{const de=A.target.closest("[data-radix-menu-content]")===A.currentTarget,z=A.ctrlKey||A.altKey||A.metaKey,se=A.key.length===1;de&&(A.key==="Tab"&&A.preventDefault(),!z&&se&&W(A.key));const ne=k.current;if(A.target!==ne||!kU.includes(A.key))return;A.preventDefault();const oe=S().filter(J=>!J.disabled).map(J=>J.ref.current);sR.includes(A.key)&&oe.reverse(),WU(oe)}),onBlur:Se(e.onBlur,A=>{A.currentTarget.contains(A.target)||(window.clearTimeout(P.current),N.current="")}),onPointerMove:Se(e.onPointerMove,ud(A=>{const Y=A.target,de=V.current!==A.clientX;if(A.currentTarget.contains(Y)&&de){const z=A.clientX>V.current?"right":"left";Z.current=z,V.current=A.clientX}}))})})})})})})});cR.displayName=$r;var LU="MenuGroup",Yx=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Ne.div,{role:"group",...r,ref:t})});Yx.displayName=LU;var $U="MenuLabel",dR=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Ne.div,{...r,ref:t})});dR.displayName=$U;var ah="MenuItem",wC="menu.itemSelect",wg=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=v.useRef(null),a=Zd(ah,e.__scopeMenu),l=Qx(ah,e.__scopeMenu),c=it(t,o),i=v.useRef(!1),d=()=>{const p=o.current;if(!n&&p){const f=new CustomEvent(wC,{bubbles:!0,cancelable:!0});p.addEventListener(wC,h=>r==null?void 0:r(h),{once:!0}),gj(p,f),f.defaultPrevented?i.current=!1:a.onClose()}};return u.jsx(fR,{...s,ref:c,disabled:n,onClick:Se(e.onClick,d),onPointerDown:p=>{var f;(f=e.onPointerDown)==null||f.call(e,p),i.current=!0},onPointerUp:Se(e.onPointerUp,p=>{var f;i.current||(f=p.currentTarget)==null||f.click()}),onKeyDown:Se(e.onKeyDown,p=>{const f=l.searchRef.current!=="";n||f&&p.key===" "||Qy.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});wg.displayName=ah;var fR=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,a=Qx(ah,n),l=aR(n),c=v.useRef(null),i=it(t,c),[d,p]=v.useState(!1),[f,h]=v.useState("");return v.useEffect(()=>{const g=c.current;g&&h((g.textContent??"").trim())},[o.children]),u.jsx(ld.ItemSlot,{scope:n,disabled:r,textValue:s??f,children:u.jsx(Jj,{asChild:!0,...l,focusable:!r,children:u.jsx(Ne.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:i,onPointerMove:Se(e.onPointerMove,ud(g=>{r?a.onItemLeave(g):(a.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Se(e.onPointerLeave,ud(g=>a.onItemLeave(g))),onFocus:Se(e.onFocus,()=>p(!0)),onBlur:Se(e.onBlur,()=>p(!1))})})})}),BU="MenuCheckboxItem",pR=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return u.jsx(yR,{scope:e.__scopeMenu,checked:n,children:u.jsx(wg,{role:"menuitemcheckbox","aria-checked":ih(n)?"mixed":n,...s,ref:t,"data-state":ew(n),onSelect:Se(s.onSelect,()=>r==null?void 0:r(ih(n)?!0:!n),{checkForDefaultPrevented:!1})})})});pR.displayName=BU;var hR="MenuRadioGroup",[zU,UU]=Ii(hR,{value:void 0,onValueChange:()=>{}}),gR=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=nn(r);return u.jsx(zU,{scope:e.__scopeMenu,value:n,onValueChange:o,children:u.jsx(Yx,{...s,ref:t})})});gR.displayName=hR;var mR="MenuRadioItem",vR=v.forwardRef((e,t)=>{const{value:n,...r}=e,s=UU(mR,e.__scopeMenu),o=n===s.value;return u.jsx(yR,{scope:e.__scopeMenu,checked:o,children:u.jsx(wg,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":ew(o),onSelect:Se(r.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,n)},{checkForDefaultPrevented:!1})})})});vR.displayName=mR;var Xx="MenuItemIndicator",[yR,VU]=Ii(Xx,{checked:!1}),bR=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=VU(Xx,n);return u.jsx(or,{present:r||ih(o.checked)||o.checked===!0,children:u.jsx(Ne.span,{...s,ref:t,"data-state":ew(o.checked)})})});bR.displayName=Xx;var HU="MenuSeparator",xR=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Ne.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});xR.displayName=HU;var KU="MenuArrow",wR=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=xg(n);return u.jsx(Uj,{...s,...r,ref:t})});wR.displayName=KU;var qU="MenuSub",[qse,SR]=Ii(qU),dc="MenuSubTrigger",CR=v.forwardRef((e,t)=>{const n=Di(dc,e.__scopeMenu),r=Zd(dc,e.__scopeMenu),s=SR(dc,e.__scopeMenu),o=Qx(dc,e.__scopeMenu),a=v.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=o,i={__scopeMenu:e.__scopeMenu},d=v.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return v.useEffect(()=>d,[d]),v.useEffect(()=>{const p=l.current;return()=>{window.clearTimeout(p),c(null)}},[l,c]),u.jsx(Gx,{asChild:!0,...i,children:u.jsx(fR,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":kR(n.open),...e,ref:ag(t,s.onTriggerChange),onClick:p=>{var f;(f=e.onClick)==null||f.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Se(e.onPointerMove,ud(p=>{o.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:Se(e.onPointerLeave,ud(p=>{var h,g;d();const f=(h=n.content)==null?void 0:h.getBoundingClientRect();if(f){const m=(g=n.content)==null?void 0:g.dataset.side,x=m==="right",b=x?-5:5,y=f[x?"left":"right"],w=f[x?"right":"left"];o.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x:y,y:f.top},{x:w,y:f.top},{x:w,y:f.bottom},{x:y,y:f.bottom}],side:m}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(p),p.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Se(e.onKeyDown,p=>{var h;const f=o.searchRef.current!=="";e.disabled||f&&p.key===" "||_U[r.dir].includes(p.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),p.preventDefault())})})})});CR.displayName=dc;var ER="MenuSubContent",TR=v.forwardRef((e,t)=>{const n=lR($r,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=Di($r,e.__scopeMenu),a=Zd($r,e.__scopeMenu),l=SR(ER,e.__scopeMenu),c=v.useRef(null),i=it(t,c);return u.jsx(ld.Provider,{scope:e.__scopeMenu,children:u.jsx(or,{present:r||o.open,children:u.jsx(ld.Slot,{scope:e.__scopeMenu,children:u.jsx(Zx,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:i,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var p;a.isUsingKeyboardRef.current&&((p=c.current)==null||p.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:Se(e.onFocusOutside,d=>{d.target!==l.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Se(e.onEscapeKeyDown,d=>{a.onClose(),d.preventDefault()}),onKeyDown:Se(e.onKeyDown,d=>{var h;const p=d.currentTarget.contains(d.target),f=jU[a.dir].includes(d.key);p&&f&&(o.onOpenChange(!1),(h=l.trigger)==null||h.focus(),d.preventDefault())})})})})})});TR.displayName=ER;function kR(e){return e?"open":"closed"}function ih(e){return e==="indeterminate"}function ew(e){return ih(e)?"indeterminate":e?"checked":"unchecked"}function WU(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function GU(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function JU(e,t,n){const s=t.length>1&&Array.from(t).every(i=>i===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=GU(e,Math.max(o,0));s.length===1&&(a=a.filter(i=>i!==n));const c=a.find(i=>i.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function QU(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,a=t.length-1;o{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=dH(this.flush),this.requestErrorThrow=RM(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class pH{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,n){this.onError=t,this.release=n,this.task=null}}class hH{create(t){const n=this.freeTasks,r=n.length?n.pop():new pH(this.onError,s=>n[n.length]=s);return r.task=t,r}constructor(t){this.onError=t,this.freeTasks=[]}}const PM=new fH,gH=new hH(PM.registerPendingError);function mH(e){PM.enqueueTask(gH.create(e))}function vH(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yH(e,t){for(var n=0;nUw(e.getValue(n),t.getValue(n));function Uw(e,t){return e===t?0:e>t?1:-1}function Sa(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function wI(e,t){const n=e.split(kb).filter(Boolean),r=t.split(kb).filter(Boolean);for(;n.length&&r.length;){const s=n.shift(),o=r.shift(),a=parseInt(s,10),l=parseInt(o,10),c=[a,l].sort();if(isNaN(c[0])){if(s>o)return 1;if(o>s)return-1;continue}if(isNaN(c[1]))return isNaN(a)?-1:1;if(a>l)return 1;if(l>a)return-1}return n.length-r.length}const rc={alphanumeric:fX,alphanumericCaseSensitive:pX,text:hX,textCaseSensitive:gX,datetime:mX,basic:vX},yX={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Sr("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const s of n){const o=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return rc.datetime;if(typeof o=="string"&&(r=!0,o.split(kb).length>1))return rc.alphanumeric}return r?rc.text:rc.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Zg(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:rc[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const s=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(a=>{const l=a==null?void 0:a.find(h=>h.id===e.id),c=a==null?void 0:a.findIndex(h=>h.id===e.id);let i=[],d,p=o?n:s==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&r?l?d="toggle":d="add":a!=null&&a.length&&c!==a.length-1?d="replace":l?d="toggle":d="replace",d==="toggle"&&(o||s||(d="remove")),d==="add"){var f;i=[...a,{id:e.id,desc:p}],i.splice(0,i.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else d==="toggle"?i=a.map(h=>h.id===e.id?{...h,desc:p}:h):d==="remove"?i=a.filter(h=>h.id!==e.id):i=[{id:e.id,desc:p}];return i})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,s;const o=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!1:a==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(s=>s.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},bX=[zY,oX,tX,nX,UY,VY,aX,iX,yX,XY,lX,uX,cX,dX,rX];function xX(e){var t,n;const r=[...bX,...(t=e._features)!=null?t:[]];let s={_features:r};const o=s._features.reduce((f,h)=>Object.assign(f,h.getDefaultOptions==null?void 0:h.getDefaultOptions(s)),{}),a=f=>s.options.mergeOptions?s.options.mergeOptions(o,f):{...o,...f};let c={...{},...(n=e.initialState)!=null?n:{}};s._features.forEach(f=>{var h;c=(h=f.getInitialState==null?void 0:f.getInitialState(c))!=null?h:c});const i=[];let d=!1;const p={_features:r,options:{...o,...e},initialState:c,_queue:f=>{i.push(f),d||(d=!0,Promise.resolve().then(()=>{for(;i.length;)i.shift()();d=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{s.setState(s.initialState)},setOptions:f=>{const h=na(f,s.options);s.options=a(h)},getState:()=>s.options.state,setState:f=>{s.options.onStateChange==null||s.options.onStateChange(f)},_getRowId:(f,h,g)=>{var m;return(m=s.options.getRowId==null?void 0:s.options.getRowId(f,h,g))!=null?m:`${g?[g.id,h].join("."):h}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(f,h)=>{let g=(h?s.getPrePaginationRowModel():s.getRowModel()).rowsById[f];if(!g&&(g=s.getCoreRowModel().rowsById[f],!g))throw new Error;return g},_getDefaultColumnDef:De(()=>[s.options.defaultColumn],f=>{var h;return f=(h=f)!=null?h:{},{header:g=>{const m=g.header.column.columnDef;return m.accessorKey?m.accessorKey:m.accessorFn?m.id:null},cell:g=>{var m,x;return(m=(x=g.renderValue())==null||x.toString==null?void 0:x.toString())!=null?m:null},...s._features.reduce((g,m)=>Object.assign(g,m.getDefaultColumnDef==null?void 0:m.getDefaultColumnDef()),{}),...f}},Ae(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:De(()=>[s._getColumnDefs()],f=>{const h=function(g,m,x){return x===void 0&&(x=0),g.map(b=>{const y=BY(s,b,x,m),w=b;return y.columns=w.columns?h(w.columns,y,x+1):[],y})};return h(f)},Ae(e,"debugColumns")),getAllFlatColumns:De(()=>[s.getAllColumns()],f=>f.flatMap(h=>h.getFlatColumns()),Ae(e,"debugColumns")),_getAllFlatColumnsById:De(()=>[s.getAllFlatColumns()],f=>f.reduce((h,g)=>(h[g.id]=g,h),{}),Ae(e,"debugColumns")),getAllLeafColumns:De(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(f,h)=>{let g=f.flatMap(m=>m.getLeafColumns());return h(g)},Ae(e,"debugColumns")),getColumn:f=>s._getAllFlatColumnsById()[f]};Object.assign(s,p);for(let f=0;fp()?void 0:m()).then(()=>{t?h(w):x()})})};return{promise:c,cancel:u,continue:()=>(s==null||s(),c),cancelRetry:i,continueRetry:d,canStart:f,start:()=>(f()?x():m().then(x),c)}}function OD(){let e=[],t=0,n=f=>{f()},r=f=>{f()},s=f=>setTimeout(f,0);const o=f=>{s=f},a=f=>{let g;t++;try{g=f()}finally{t--,t||i()}return g},c=f=>{t?e.push(f):s(()=>{n(f)})},u=f=>(...g)=>{c(()=>{f(...g)})},i=()=>{const f=e;e=[],f.length&&s(()=>{r(()=>{f.forEach(g=>{n(g)})})})};return{batch:a,batchCalls:u,schedule:c,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{r=f},setScheduler:o}}var dn=OD(),di,TE,ek=(TE=class{constructor(){De(this,di)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Nv(this.gcTime)&&we(this,di,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(rc?1/0:5*60*1e3))}clearGcTimeout(){N(this,di)&&(clearTimeout(N(this,di)),we(this,di,void 0))}},di=new WeakMap,TE),Wl,Gl,Ir,Dn,Fd,fi,Qr,eo,ME,ID=(ME=class extends ek{constructor(t){super();De(this,Qr);De(this,Wl);De(this,Gl);De(this,Ir);De(this,Dn);De(this,Fd);De(this,fi);we(this,fi,!1),we(this,Fd,t.defaultOptions),this.setOptions(t.options),this.observers=[],we(this,Ir,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,we(this,Wl,DD(this.options)),this.state=t.state??N(this,Wl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=N(this,Dn))==null?void 0:t.promise}setOptions(t){this.options={...N(this,Fd),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,Ir).remove(this)}setData(t,n){const r=Pv(this.state.data,t,this.options);return Ye(this,Qr,eo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ye(this,Qr,eo).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=N(this,Dn))==null?void 0:r.promise;return(s=N(this,Dn))==null||s.cancel(t),n?n.then(Dr).catch(Dr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(N(this,Wl))}isActive(){return this.observers.some(t=>Xr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!WE(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Dn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=N(this,Dn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),N(this,Ir).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(N(this,Dn)&&(N(this,fi)?N(this,Dn).cancel({revert:!0}):N(this,Dn).cancelRetry()),this.scheduleGc()),N(this,Ir).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ye(this,Qr,eo).call(this,{type:"invalidate"})}fetch(t,n){var u,i,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(N(this,Dn))return N(this,Dn).continueRetry(),N(this,Dn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const p=this.observers.find(f=>f.options.queryFn);p&&this.setOptions(p.options)}const r=new AbortController,s=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(we(this,fi,!0),r.signal)})},o=()=>{const p=QE(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return s(f),we(this,fi,!1),this.options.persister?this.options.persister(p,f,this):p(f)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};s(a),(u=this.options.behavior)==null||u.onFetch(a,this),we(this,Gl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=a.fetchOptions)==null?void 0:i.meta))&&Ye(this,Qr,eo).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const c=p=>{var f,g,h,m;um(p)&&p.silent||Ye(this,Qr,eo).call(this,{type:"error",error:p}),um(p)||((g=(f=N(this,Ir).config).onError)==null||g.call(f,p,this),(m=(h=N(this,Ir).config).onSettled)==null||m.call(h,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return we(this,Dn,XE({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var f,g,h,m;if(p===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(x){c(x);return}(g=(f=N(this,Ir).config).onSuccess)==null||g.call(f,p,this),(m=(h=N(this,Ir).config).onSettled)==null||m.call(h,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:c,onFail:(p,f)=>{Ye(this,Qr,eo).call(this,{type:"failed",failureCount:p,error:f})},onPause:()=>{Ye(this,Qr,eo).call(this,{type:"pause"})},onContinue:()=>{Ye(this,Qr,eo).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),N(this,Dn).start()}},Wl=new WeakMap,Gl=new WeakMap,Ir=new WeakMap,Dn=new WeakMap,Fd=new WeakMap,fi=new WeakMap,Qr=new WeakSet,eo=function(t){const n=r=>{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,...tk(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return um(s)&&s.revert&&N(this,Gl)?{...N(this,Gl),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),dn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),N(this,Ir).notify({query:this,type:"updated",action:t})})},ME);function tk(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ZE(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function DD(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var js,NE,AD=(NE=class extends xc{constructor(t={}){super();De(this,js);this.config=t,we(this,js,new Map)}build(t,n,r){const s=n.queryKey,o=n.queryHash??Fb(s,n);let a=this.get(o);return a||(a=new ID({cache:this,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){N(this,js).has(t.queryHash)||(N(this,js).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=N(this,js).get(t.queryHash);n&&(t.destroy(),n===t&&N(this,js).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){dn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return N(this,js).get(t)}getAll(){return[...N(this,js).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>nS(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>nS(t,r)):n}notify(t){dn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){dn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){dn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},js=new WeakMap,NE),Ts,Un,pi,Ms,zo,_E,FD=(_E=class extends ek{constructor(t){super();De(this,Ms);De(this,Ts);De(this,Un);De(this,pi);this.mutationId=t.mutationId,we(this,Un,t.mutationCache),we(this,Ts,[]),this.state=t.state||nk(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){N(this,Ts).includes(t)||(N(this,Ts).push(t),this.clearGcTimeout(),N(this,Un).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){we(this,Ts,N(this,Ts).filter(n=>n!==t)),this.scheduleGc(),N(this,Un).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){N(this,Ts).length||(this.state.status==="pending"?this.scheduleGc():N(this,Un).remove(this))}continue(){var t;return((t=N(this,pi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,o,a,c,u,i,d,p,f,g,h,m,x,b,y,w,S,E,C,T;we(this,pi,XE({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(j,_)=>{Ye(this,Ms,zo).call(this,{type:"failed",failureCount:j,error:_})},onPause:()=>{Ye(this,Ms,zo).call(this,{type:"pause"})},onContinue:()=>{Ye(this,Ms,zo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,Un).canRun(this)}));const n=this.state.status==="pending",r=!N(this,pi).canStart();try{if(!n){Ye(this,Ms,zo).call(this,{type:"pending",variables:t,isPaused:r}),await((o=(s=N(this,Un).config).onMutate)==null?void 0:o.call(s,t,this));const _=await((c=(a=this.options).onMutate)==null?void 0:c.call(a,t));_!==this.state.context&&Ye(this,Ms,zo).call(this,{type:"pending",context:_,variables:t,isPaused:r})}const j=await N(this,pi).start();return await((i=(u=N(this,Un).config).onSuccess)==null?void 0:i.call(u,j,t,this.state.context,this)),await((p=(d=this.options).onSuccess)==null?void 0:p.call(d,j,t,this.state.context)),await((g=(f=N(this,Un).config).onSettled)==null?void 0:g.call(f,j,null,this.state.variables,this.state.context,this)),await((m=(h=this.options).onSettled)==null?void 0:m.call(h,j,null,t,this.state.context)),Ye(this,Ms,zo).call(this,{type:"success",data:j}),j}catch(j){try{throw await((b=(x=N(this,Un).config).onError)==null?void 0:b.call(x,j,t,this.state.context,this)),await((w=(y=this.options).onError)==null?void 0:w.call(y,j,t,this.state.context)),await((E=(S=N(this,Un).config).onSettled)==null?void 0:E.call(S,void 0,j,this.state.variables,this.state.context,this)),await((T=(C=this.options).onSettled)==null?void 0:T.call(C,void 0,j,t,this.state.context)),j}finally{Ye(this,Ms,zo).call(this,{type:"error",error:j})}}finally{N(this,Un).runNext(this)}}},Ts=new WeakMap,Un=new WeakMap,pi=new WeakMap,Ms=new WeakSet,zo=function(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"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};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"}}};this.state=n(this.state),dn.batch(()=>{N(this,Ts).forEach(r=>{r.onMutationUpdate(t)}),N(this,Un).notify({mutation:this,type:"updated",action:t})})},_E);function nk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var fr,Ld,PE,LD=(PE=class extends xc{constructor(t={}){super();De(this,fr);De(this,Ld);this.config=t,we(this,fr,new Map),we(this,Ld,Date.now())}build(t,n,r){const s=new FD({mutationCache:this,mutationId:++uf(this,Ld)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){const n=ff(t),r=N(this,fr).get(n)??[];r.push(t),N(this,fr).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=ff(t);if(N(this,fr).has(n)){const s=(r=N(this,fr).get(n))==null?void 0:r.filter(o=>o!==t);s&&(s.length===0?N(this,fr).delete(n):N(this,fr).set(n,s))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=N(this,fr).get(ff(t)))==null?void 0:r.find(s=>s.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=N(this,fr).get(ff(t)))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){dn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...N(this,fr).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>rS(n,r))}findAll(t={}){return this.getAll().filter(n=>rS(t,n))}notify(t){dn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return dn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Dr))))}},fr=new WeakMap,Ld=new WeakMap,PE);function ff(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function $D(e){return{onFetch:(t,n)=>{const r=async()=>{var h,m,x,b,y;const s=t.options,o=(x=(m=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:m.fetchMore)==null?void 0:x.direction,a=((b=t.state.data)==null?void 0:b.pages)||[],c=((y=t.state.data)==null?void 0:y.pageParams)||[],u={pages:[],pageParams:[]};let i=!1;const d=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?i=!0:t.signal.addEventListener("abort",()=>{i=!0}),t.signal)})},p=QE(t.options,t.fetchOptions),f=async(w,S,E)=>{if(i)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const C={queryKey:t.queryKey,pageParam:S,direction:E?"backward":"forward",meta:t.options.meta};d(C);const T=await p(C),{maxPages:j}=t.options,_=E?ND:MD;return{pages:_(w.pages,T,j),pageParams:_(w.pageParams,S,j)}};let g;if(o&&a.length){const w=o==="backward",S=w?BD:aS,E={pages:a,pageParams:c},C=S(s,E);g=await f(E,C,w)}else{g=await f(u,c[0]??s.initialPageParam);const w=e??a.length;for(let S=1;S>>1;fej?(_=T,T=null):_=T.sibling;var O=f(b,T,w[j],S);if(O===null){T===null&&(T=_);break}e&&T&&O.alternate===null&&t(b,T),y=o(O,y,j),C===null?E=O:C.sibling=O,C=O,T=_}if(j===w.length)return n(b,T),$t&&Ja(b,j),E;if(T===null){for(;jtypeof e=="number"&&!isNaN(e),xi=e=>typeof e=="string",br=e=>typeof e=="function",fp=e=>xi(e)||br(e)?e:null,Ly=e=>v.isValidElement(e)||xi(e)||br(e)||cd(e);function o$(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:s}=e;requestAnimationFrame(()=>{s.minHeight="initial",s.height=r+"px",s.transition=`all ${n}ms`,requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(t,n)})})}function th(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:s=!0,collapseDuration:o=300}=e;return function(a){let{children:c,position:u,preventExitTransition:i,done:d,nodeRef:p,isIn:f,playToast:g}=a;const h=r?`${t}--${u}`:t,m=r?`${n}--${u}`:n,x=v.useRef(0);return v.useLayoutEffect(()=>{const b=p.current,y=h.split(" "),w=S=>{S.target===p.current&&(g(),b.removeEventListener("animationend",w),b.removeEventListener("animationcancel",w),x.current===0&&S.type!=="animationcancel"&&b.classList.remove(...y))};b.classList.add(...y),b.addEventListener("animationend",w),b.addEventListener("animationcancel",w)},[]),v.useEffect(()=>{const b=p.current,y=()=>{b.removeEventListener("animationend",y),s?o$(b,d,o):d()};f||(i?y():(x.current=1,b.className+=` ${m}`,b.addEventListener("animationend",y)))},[f]),je.createElement(je.Fragment,null,c)}}function B0(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const Wn=new Map;let ud=[];const $y=new Set,a$=e=>$y.forEach(t=>t(e)),PT=()=>Wn.size>0;function RT(e,t){var n;if(t)return!((n=Wn.get(t))==null||!n.isToastActive(e));let r=!1;return Wn.forEach(s=>{s.isToastActive(e)&&(r=!0)}),r}function OT(e,t){Ly(e)&&(PT()||ud.push({content:e,options:t}),Wn.forEach(n=>{n.buildToast(e,t)}))}function z0(e,t){Wn.forEach(n=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===n.id&&n.toggle(e,t==null?void 0:t.id):n.toggle(e,t==null?void 0:t.id)})}function i$(e){const{subscribe:t,getSnapshot:n,setProps:r}=v.useRef(function(o){const a=o.containerId||1;return{subscribe(c){const u=function(d,p,f){let g=1,h=0,m=[],x=[],b=[],y=p;const w=new Map,S=new Set,E=()=>{b=Array.from(w.values()),S.forEach(j=>j())},C=j=>{x=j==null?[]:x.filter(_=>_!==j),E()},T=j=>{const{toastId:_,onOpen:O,updateId:K,children:I}=j.props,Y=K==null;j.staleId&&w.delete(j.staleId),w.set(_,j),x=[...x,j.props.toastId].filter(q=>q!==j.staleId),E(),f(B0(j,Y?"added":"updated")),Y&&br(O)&&O(v.isValidElement(I)&&I.props)};return{id:d,props:y,observe:j=>(S.add(j),()=>S.delete(j)),toggle:(j,_)=>{w.forEach(O=>{_!=null&&_!==O.props.toastId||br(O.toggle)&&O.toggle(j)})},removeToast:C,toasts:w,clearQueue:()=>{h-=m.length,m=[]},buildToast:(j,_)=>{if((H=>{let{containerId:se,toastId:ne,updateId:le}=H;const oe=se?se!==d:d!==1,Q=w.has(ne)&&le==null;return oe||Q})(_))return;const{toastId:O,updateId:K,data:I,staleId:Y,delay:q}=_,Z=()=>{C(O)},ee=K==null;ee&&h++;const J={...y,style:y.toastStyle,key:g++,...Object.fromEntries(Object.entries(_).filter(H=>{let[se,ne]=H;return ne!=null})),toastId:O,updateId:K,data:I,closeToast:Z,isIn:!1,className:fp(_.className||y.toastClassName),bodyClassName:fp(_.bodyClassName||y.bodyClassName),progressClassName:fp(_.progressClassName||y.progressClassName),autoClose:!_.isLoading&&(L=_.autoClose,A=y.autoClose,L===!1||cd(L)&&L>0?L:A),deleteToast(){const H=w.get(O),{onClose:se,children:ne}=H.props;br(se)&&se(v.isValidElement(ne)&&ne.props),f(B0(H,"removed")),w.delete(O),h--,h<0&&(h=0),m.length>0?T(m.shift()):E()}};var L,A;J.closeButton=y.closeButton,_.closeButton===!1||Ly(_.closeButton)?J.closeButton=_.closeButton:_.closeButton===!0&&(J.closeButton=!Ly(y.closeButton)||y.closeButton);let X=j;v.isValidElement(j)&&!xi(j.type)?X=v.cloneElement(j,{closeToast:Z,toastProps:J,data:I}):br(j)&&(X=j({closeToast:Z,toastProps:J,data:I}));const fe={content:X,props:J,staleId:Y};y.limit&&y.limit>0&&h>y.limit&&ee?m.push(fe):cd(q)?setTimeout(()=>{T(fe)},q):T(fe)},setProps(j){y=j},setToggle:(j,_)=>{w.get(j).toggle=_},isToastActive:j=>x.some(_=>_===j),getSnapshot:()=>y.newestOnTop?b.reverse():b}}(a,o,a$);Wn.set(a,u);const i=u.observe(c);return ud.forEach(d=>OT(d.content,d.options)),ud=[],()=>{i(),Wn.delete(a)}},setProps(c){var u;(u=Wn.get(a))==null||u.setProps(c)},getSnapshot(){var c;return(c=Wn.get(a))==null?void 0:c.getSnapshot()}}}(e)).current;r(e);const s=v.useSyncExternalStore(t,n,n);return{getToastToRender:function(o){if(!s)return[];const a=new Map;return s.forEach(c=>{const{position:u}=c.props;a.has(u)||a.set(u,[]),a.get(u).push(c)}),Array.from(a,c=>o(c[0],c[1]))},isToastActive:RT,count:s==null?void 0:s.length}}function l$(e){const[t,n]=v.useState(!1),[r,s]=v.useState(!1),o=v.useRef(null),a=v.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:c,pauseOnHover:u,closeToast:i,onClick:d,closeOnClick:p}=e;var f,g;function h(){n(!0)}function m(){n(!1)}function x(w){const S=o.current;a.canDrag&&S&&(a.didMove=!0,t&&m(),a.delta=e.draggableDirection==="x"?w.clientX-a.start:w.clientY-a.start,a.start!==w.clientX&&(a.canCloseOnClick=!1),S.style.transform=`translate3d(${e.draggableDirection==="x"?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`},0)`,S.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function b(){document.removeEventListener("pointermove",x),document.removeEventListener("pointerup",b);const w=o.current;if(a.canDrag&&a.didMove&&w){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return s(!0),e.closeToast(),void e.collapseAll();w.style.transition="transform 0.2s, opacity 0.2s",w.style.removeProperty("transform"),w.style.removeProperty("opacity")}}(g=Wn.get((f={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||g.setToggle(f.id,f.fn),v.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||m(),window.addEventListener("focus",h),window.addEventListener("blur",m),()=>{window.removeEventListener("focus",h),window.removeEventListener("blur",m)}},[e.pauseOnFocusLoss]);const y={onPointerDown:function(w){if(e.draggable===!0||e.draggable===w.pointerType){a.didMove=!1,document.addEventListener("pointermove",x),document.addEventListener("pointerup",b);const S=o.current;a.canCloseOnClick=!0,a.canDrag=!0,S.style.transition="none",e.draggableDirection==="x"?(a.start=w.clientX,a.removalDistance=S.offsetWidth*(e.draggablePercent/100)):(a.start=w.clientY,a.removalDistance=S.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(w){const{top:S,bottom:E,left:C,right:T}=o.current.getBoundingClientRect();w.nativeEvent.type!=="touchend"&&e.pauseOnHover&&w.clientX>=C&&w.clientX<=T&&w.clientY>=S&&w.clientY<=E?m():h()}};return c&&u&&(y.onMouseEnter=m,e.stacked||(y.onMouseLeave=h)),p&&(y.onClick=w=>{d&&d(w),a.canCloseOnClick&&i()}),{playToast:h,pauseToast:m,isRunning:t,preventExitTransition:r,toastRef:o,eventHandlers:y}}function c$(e){let{delay:t,isRunning:n,closeToast:r,type:s="default",hide:o,className:a,style:c,controlledProgress:u,progress:i,rtl:d,isIn:p,theme:f}=e;const g=o||u&&i===0,h={...c,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};u&&(h.transform=`scaleX(${i})`);const m=uo("Toastify__progress-bar",u?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${f}`,`Toastify__progress-bar--${s}`,{"Toastify__progress-bar--rtl":d}),x=br(a)?a({rtl:d,type:s,defaultClassName:m}):uo(m,a),b={[u&&i>=1?"onTransitionEnd":"onAnimationEnd"]:u&&i<1?null:()=>{p&&r()}};return je.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":g},je.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${f} Toastify__progress-bar--${s}`}),je.createElement("div",{role:"progressbar","aria-hidden":g?"true":"false","aria-label":"notification timer",className:x,style:h,...b}))}let u$=1;const IT=()=>""+u$++;function d$(e){return e&&(xi(e.toastId)||cd(e.toastId))?e.toastId:IT()}function Ou(e,t){return OT(e,t),t.toastId}function eg(e,t){return{...t,type:t&&t.type||e,toastId:d$(t)}}function Nf(e){return(t,n)=>Ou(t,eg(e,n))}function G(e,t){return Ou(e,eg("default",t))}G.loading=(e,t)=>Ou(e,eg("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),G.promise=function(e,t,n){let r,{pending:s,error:o,success:a}=t;s&&(r=xi(s)?G.loading(s,n):G.loading(s.render,{...n,...s}));const c={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},u=(d,p,f)=>{if(p==null)return void G.dismiss(r);const g={type:d,...c,...n,data:f},h=xi(p)?{render:p}:p;return r?G.update(r,{...g,...h}):G(h.render,{...g,...h}),f},i=br(e)?e():e;return i.then(d=>u("success",a,d)).catch(d=>u("error",o,d)),i},G.success=Nf("success"),G.info=Nf("info"),G.error=Nf("error"),G.warning=Nf("warning"),G.warn=G.warning,G.dark=(e,t)=>Ou(e,eg("default",{theme:"dark",...t})),G.dismiss=function(e){(function(t){var n;if(PT()){if(t==null||xi(n=t)||cd(n))Wn.forEach(r=>{r.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){const r=Wn.get(t.containerId);r?r.removeToast(t.id):Wn.forEach(s=>{s.removeToast(t.id)})}}else ud=ud.filter(r=>t!=null&&r.options.toastId!==t)})(e)},G.clearWaitingQueue=function(e){e===void 0&&(e={}),Wn.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},G.isActive=RT,G.update=function(e,t){t===void 0&&(t={});const n=((r,s)=>{var o;let{containerId:a}=s;return(o=Wn.get(a||1))==null?void 0:o.toasts.get(r)})(e,t);if(n){const{props:r,content:s}=n,o={delay:100,...r,...t,toastId:t.toastId||e,updateId:IT()};o.toastId!==e&&(o.staleId=e);const a=o.render||s;delete o.render,Ou(a,o)}},G.done=e=>{G.update(e,{progress:1})},G.onChange=function(e){return $y.add(e),()=>{$y.delete(e)}},G.play=e=>z0(!0,e),G.pause=e=>z0(!1,e);const f$=typeof window<"u"?v.useLayoutEffect:v.useEffect,_f=e=>{let{theme:t,type:n,isLoading:r,...s}=e;return je.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...s})},$m={info:function(e){return je.createElement(_f,{...e},je.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return je.createElement(_f,{...e},je.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return je.createElement(_f,{...e},je.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return je.createElement(_f,{...e},je.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return je.createElement("div",{className:"Toastify__spinner"})}},p$=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:s,playToast:o}=l$(e),{closeButton:a,children:c,autoClose:u,onClick:i,type:d,hideProgressBar:p,closeToast:f,transition:g,position:h,className:m,style:x,bodyClassName:b,bodyStyle:y,progressClassName:w,progressStyle:S,updateId:E,role:C,progress:T,rtl:j,toastId:_,deleteToast:O,isIn:K,isLoading:I,closeOnClick:Y,theme:q}=e,Z=uo("Toastify__toast",`Toastify__toast-theme--${q}`,`Toastify__toast--${d}`,{"Toastify__toast--rtl":j},{"Toastify__toast--close-on-click":Y}),ee=br(m)?m({rtl:j,position:h,type:d,defaultClassName:Z}):uo(Z,m),J=function(fe){let{theme:H,type:se,isLoading:ne,icon:le}=fe,oe=null;const Q={theme:H,type:se};return le===!1||(br(le)?oe=le({...Q,isLoading:ne}):v.isValidElement(le)?oe=v.cloneElement(le,Q):ne?oe=$m.spinner():(Ee=>Ee in $m)(se)&&(oe=$m[se](Q))),oe}(e),L=!!T||!u,A={closeToast:f,type:d,theme:q};let X=null;return a===!1||(X=br(a)?a(A):v.isValidElement(a)?v.cloneElement(a,A):function(fe){let{closeToast:H,theme:se,ariaLabel:ne="close"}=fe;return je.createElement("button",{className:`Toastify__close-button Toastify__close-button--${se}`,type:"button",onClick:le=>{le.stopPropagation(),H(le)},"aria-label":ne},je.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},je.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(A)),je.createElement(g,{isIn:K,done:O,position:h,preventExitTransition:n,nodeRef:r,playToast:o},je.createElement("div",{id:_,onClick:i,"data-in":K,className:ee,...s,style:x,ref:r},je.createElement("div",{...K&&{role:C},className:br(b)?b({type:d}):uo("Toastify__toast-body",b),style:y},J!=null&&je.createElement("div",{className:uo("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!I})},J),je.createElement("div",null,c)),X,je.createElement(c$,{...E&&!L?{key:`pb-${E}`}:{},rtl:j,theme:q,delay:u,isRunning:t,isIn:K,closeToast:f,hide:p,type:d,style:S,className:w,controlledProgress:L,progress:T||0})))},nh=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},g$=th(nh("bounce",!0));th(nh("slide",!0));th(nh("zoom"));th(nh("flip"));const h$={position:"top-right",transition:g$,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function m$(e){let t={...h$,...e};const n=e.stacked,[r,s]=v.useState(!0),o=v.useRef(null),{getToastToRender:a,isToastActive:c,count:u}=i$(t),{className:i,style:d,rtl:p,containerId:f}=t;function g(m){const x=uo("Toastify__toast-container",`Toastify__toast-container--${m}`,{"Toastify__toast-container--rtl":p});return br(i)?i({position:m,rtl:p,defaultClassName:x}):uo(x,fp(i))}function h(){n&&(s(!0),G.play())}return f$(()=>{if(n){var m;const x=o.current.querySelectorAll('[data-in="true"]'),b=12,y=(m=t.position)==null?void 0:m.includes("top");let w=0,S=0;Array.from(x).reverse().forEach((E,C)=>{const T=E;T.classList.add("Toastify__toast--stacked"),C>0&&(T.dataset.collapsed=`${r}`),T.dataset.pos||(T.dataset.pos=y?"top":"bot");const j=w*(r?.2:1)+(r?0:b*C);T.style.setProperty("--y",`${y?j:-1*j}px`),T.style.setProperty("--g",`${b}`),T.style.setProperty("--s",""+(1-(r?S:0))),w+=T.offsetHeight,S+=.025})}},[r,u,n]),je.createElement("div",{ref:o,className:"Toastify",id:f,onMouseEnter:()=>{n&&(s(!1),G.pause())},onMouseLeave:h},a((m,x)=>{const b=x.length?{...d}:{...d,pointerEvents:"none"};return je.createElement("div",{className:g(m),style:b,key:`container-${m}`},x.map(y=>{let{content:w,props:S}=y;return je.createElement(p$,{...S,stacked:n,collapseAll:h,isIn:c(S.toastId,S.containerId),style:S.style,key:`toast-${S.key}`},w)}))}))}const v$={theme:"system",setTheme:()=>null},DT=v.createContext(v$);function y$({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[s,o]=v.useState(()=>localStorage.getItem(n)||t);v.useEffect(()=>{const c=window.document.documentElement;if(c.classList.remove("light","dark"),s==="system"){const u=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";c.classList.add(u);return}c.classList.add(s)},[s]);const a={theme:s,setTheme:c=>{localStorage.setItem(n,c),o(c)}};return l.jsx(DT.Provider,{...r,value:a,children:e})}const Dx=()=>{const e=v.useContext(DT);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};let Bm=!1;const b$=new zD({defaultOptions:{queries:{staleTime:1e3*60*5,retry(e){return e>=3?(Bm===!1&&(Bm=!0,G.error("The application is taking longer than expected to load, please try again in a few minutes.",{onClose:()=>{Bm=!1}})),!1):!0}}}});var Fn=(e=>(e.API_URL="apiUrl",e.TOKEN="token",e.INSTANCE_ID="instanceId",e.INSTANCE_NAME="instanceName",e.INSTANCE_TOKEN="instanceToken",e.VERSION="version",e.FACEBOOK_APP_ID="facebookAppId",e.FACEBOOK_CONFIG_ID="facebookConfigId",e.FACEBOOK_USER_TOKEN="facebookUserToken",e.CLIENT_NAME="clientName",e))(Fn||{});const AT=async e=>{if(e.url){const t=e.url.endsWith("/")?e.url.slice(0,-1):e.url;localStorage.setItem("apiUrl",t)}e.token&&localStorage.setItem("token",e.token),e.version&&localStorage.setItem("version",e.version),e.facebookAppId&&localStorage.setItem("facebookAppId",e.facebookAppId),e.facebookConfigId&&localStorage.setItem("facebookConfigId",e.facebookConfigId),e.facebookUserToken&&localStorage.setItem("facebookUserToken",e.facebookUserToken),e.clientName&&localStorage.setItem("clientName",e.clientName)},FT=()=>{localStorage.removeItem("apiUrl"),localStorage.removeItem("token"),localStorage.removeItem("version"),localStorage.removeItem("facebookAppId"),localStorage.removeItem("facebookConfigId"),localStorage.removeItem("facebookUserToken"),localStorage.removeItem("clientName")},zr=e=>localStorage.getItem(e),Rt=({children:e})=>{const t=zr(Fn.API_URL),n=zr(Fn.TOKEN),r=zr(Fn.VERSION);return!t||!n||!r?l.jsx(NT,{to:"/manager/login"}):e},x$=({children:e})=>{const t=zr(Fn.API_URL),n=zr(Fn.TOKEN),r=zr(Fn.VERSION);return t&&n&&r?l.jsx(NT,{to:"/"}):e};function LT(e,t){return function(){return e.apply(t,arguments)}}const{toString:w$}=Object.prototype,{getPrototypeOf:Ax}=Object,rh=(e=>t=>{const n=w$.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),hs=e=>(e=e.toLowerCase(),t=>rh(t)===e),sh=e=>t=>typeof t===e,{isArray:jc}=Array,dd=sh("undefined");function S$(e){return e!==null&&!dd(e)&&e.constructor!==null&&!dd(e.constructor)&&Ur(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $T=hs("ArrayBuffer");function C$(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&$T(e.buffer),t}const E$=sh("string"),Ur=sh("function"),BT=sh("number"),oh=e=>e!==null&&typeof e=="object",k$=e=>e===!0||e===!1,pp=e=>{if(rh(e)!=="object")return!1;const t=Ax(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},j$=hs("Date"),T$=hs("File"),M$=hs("Blob"),N$=hs("FileList"),_$=e=>oh(e)&&Ur(e.pipe),P$=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ur(e.append)&&((t=rh(e))==="formdata"||t==="object"&&Ur(e.toString)&&e.toString()==="[object FormData]"))},R$=hs("URLSearchParams"),[O$,I$,D$,A$]=["ReadableStream","Request","Response","Headers"].map(hs),F$=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function qd(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),jc(e))for(r=0,s=e.length;r0;)if(s=n[r],t===s.toLowerCase())return s;return null}const UT=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,VT=e=>!dd(e)&&e!==UT;function By(){const{caseless:e}=VT(this)&&this||{},t={},n=(r,s)=>{const o=e&&zT(t,s)||s;pp(t[o])&&pp(r)?t[o]=By(t[o],r):pp(r)?t[o]=By({},r):jc(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r(qd(t,(s,o)=>{n&&Ur(s)?e[o]=LT(s,n):e[o]=s},{allOwnKeys:r}),e),$$=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),B$=(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)},z$=(e,t,n,r)=>{let s,o,a;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)a=s[o],(!r||r(a,e,t))&&!c[a]&&(t[a]=e[a],c[a]=!0);e=n!==!1&&Ax(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},U$=(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},V$=e=>{if(!e)return null;if(jc(e))return e;let t=e.length;if(!BT(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},H$=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ax(Uint8Array)),K$=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},q$=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},W$=hs("HTMLFormElement"),G$=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),U0=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),J$=hs("RegExp"),HT=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};qd(n,(s,o)=>{let a;(a=t(s,o,e))!==!1&&(r[o]=a||s)}),Object.defineProperties(e,r)},Q$=e=>{HT(e,(t,n)=>{if(Ur(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ur(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+"'")})}})},Z$=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return jc(e)?r(e):r(String(e).split(t)),n},Y$=()=>{},X$=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,zm="abcdefghijklmnopqrstuvwxyz",V0="0123456789",KT={DIGIT:V0,ALPHA:zm,ALPHA_DIGIT:zm+zm.toUpperCase()+V0},e4=(e=16,t=KT.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function t4(e){return!!(e&&Ur(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const n4=e=>{const t=new Array(10),n=(r,s)=>{if(oh(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const o=jc(r)?[]:{};return qd(r,(a,c)=>{const u=n(a,s+1);!dd(u)&&(o[c]=u)}),t[s]=void 0,o}}return r};return n(e,0)},r4=hs("AsyncFunction"),s4=e=>e&&(oh(e)||Ur(e))&&Ur(e.then)&&Ur(e.catch),U={isArray:jc,isArrayBuffer:$T,isBuffer:S$,isFormData:P$,isArrayBufferView:C$,isString:E$,isNumber:BT,isBoolean:k$,isObject:oh,isPlainObject:pp,isReadableStream:O$,isRequest:I$,isResponse:D$,isHeaders:A$,isUndefined:dd,isDate:j$,isFile:T$,isBlob:M$,isRegExp:J$,isFunction:Ur,isStream:_$,isURLSearchParams:R$,isTypedArray:H$,isFileList:N$,forEach:qd,merge:By,extend:L$,trim:F$,stripBOM:$$,inherits:B$,toFlatObject:z$,kindOf:rh,kindOfTest:hs,endsWith:U$,toArray:V$,forEachEntry:K$,matchAll:q$,isHTMLForm:W$,hasOwnProperty:U0,hasOwnProp:U0,reduceDescriptors:HT,freezeMethods:Q$,toObjectSet:Z$,toCamelCase:G$,noop:Y$,toFiniteNumber:X$,findKey:zT,global:UT,isContextDefined:VT,ALPHABET:KT,generateString:e4,isSpecCompliantForm:t4,toJSONObject:n4,isAsyncFn:r4,isThenable:s4};function We(e,t,n,r,s){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),s&&(this.response=s)}U.inherits(We,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:U.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const qT=We.prototype,WT={};["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=>{WT[e]={value:e}});Object.defineProperties(We,WT);Object.defineProperty(qT,"isAxiosError",{value:!0});We.from=(e,t,n,r,s,o)=>{const a=Object.create(qT);return U.toFlatObject(e,a,function(u){return u!==Error.prototype},c=>c!=="isAxiosError"),We.call(a,e.message,t,n,r,s),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const o4=null;function zy(e){return U.isPlainObject(e)||U.isArray(e)}function GT(e){return U.endsWith(e,"[]")?e.slice(0,-2):e}function H0(e,t,n){return e?e.concat(t).map(function(s,o){return s=GT(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function a4(e){return U.isArray(e)&&!e.some(zy)}const i4=U.toFlatObject(U,{},null,function(t){return/^is[A-Z]/.test(t)});function ah(e,t,n){if(!U.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=U.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,x){return!U.isUndefined(x[m])});const r=n.metaTokens,s=n.visitor||d,o=n.dots,a=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&U.isSpecCompliantForm(t);if(!U.isFunction(s))throw new TypeError("visitor must be a function");function i(h){if(h===null)return"";if(U.isDate(h))return h.toISOString();if(!u&&U.isBlob(h))throw new We("Blob is not supported. Use a Buffer instead.");return U.isArrayBuffer(h)||U.isTypedArray(h)?u&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function d(h,m,x){let b=h;if(h&&!x&&typeof h=="object"){if(U.endsWith(m,"{}"))m=r?m:m.slice(0,-2),h=JSON.stringify(h);else if(U.isArray(h)&&a4(h)||(U.isFileList(h)||U.endsWith(m,"[]"))&&(b=U.toArray(h)))return m=GT(m),b.forEach(function(w,S){!(U.isUndefined(w)||w===null)&&t.append(a===!0?H0([m],S,o):a===null?m:m+"[]",i(w))}),!1}return zy(h)?!0:(t.append(H0(x,m,o),i(h)),!1)}const p=[],f=Object.assign(i4,{defaultVisitor:d,convertValue:i,isVisitable:zy});function g(h,m){if(!U.isUndefined(h)){if(p.indexOf(h)!==-1)throw Error("Circular reference detected in "+m.join("."));p.push(h),U.forEach(h,function(b,y){(!(U.isUndefined(b)||b===null)&&s.call(t,b,U.isString(y)?y.trim():y,m,f))===!0&&g(b,m?m.concat(y):[y])}),p.pop()}}if(!U.isObject(e))throw new TypeError("data must be an object");return g(e),t}function K0(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Fx(e,t){this._pairs=[],e&&ah(e,this,t)}const JT=Fx.prototype;JT.append=function(t,n){this._pairs.push([t,n])};JT.toString=function(t){const n=t?function(r){return t.call(this,r,K0)}:K0;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function l4(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function QT(e,t,n){if(!t)return e;const r=n&&n.encode||l4,s=n&&n.serialize;let o;if(s?o=s(t,n):o=U.isURLSearchParams(t)?t.toString():new Fx(t,n).toString(r),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class q0{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){U.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ZT={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},c4=typeof URLSearchParams<"u"?URLSearchParams:Fx,u4=typeof FormData<"u"?FormData:null,d4=typeof Blob<"u"?Blob:null,f4={isBrowser:!0,classes:{URLSearchParams:c4,FormData:u4,Blob:d4},protocols:["http","https","file","blob","url","data"]},Lx=typeof window<"u"&&typeof document<"u",p4=(e=>Lx&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),g4=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",h4=Lx&&window.location.href||"http://localhost",m4=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Lx,hasStandardBrowserEnv:p4,hasStandardBrowserWebWorkerEnv:g4,origin:h4},Symbol.toStringTag,{value:"Module"})),as={...m4,...f4};function v4(e,t){return ah(e,new as.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return as.isNode&&U.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function y4(e){return U.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function b4(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r=n.length;return a=!a&&U.isArray(s)?s.length:a,u?(U.hasOwnProp(s,a)?s[a]=[s[a],r]:s[a]=r,!c):((!s[a]||!U.isObject(s[a]))&&(s[a]=[]),t(n,r,s[a],o)&&U.isArray(s[a])&&(s[a]=b4(s[a])),!c)}if(U.isFormData(e)&&U.isFunction(e.entries)){const n={};return U.forEachEntry(e,(r,s)=>{t(y4(r),s,n,0)}),n}return null}function x4(e,t,n){if(U.isString(e))try{return(t||JSON.parse)(e),U.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Wd={transitional:ZT,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=U.isObject(t);if(o&&U.isHTMLForm(t)&&(t=new FormData(t)),U.isFormData(t))return s?JSON.stringify(YT(t)):t;if(U.isArrayBuffer(t)||U.isBuffer(t)||U.isStream(t)||U.isFile(t)||U.isBlob(t)||U.isReadableStream(t))return t;if(U.isArrayBufferView(t))return t.buffer;if(U.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return v4(t,this.formSerializer).toString();if((c=U.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return ah(c?{"files[]":t}:t,u&&new u,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),x4(t)):t}],transformResponse:[function(t){const n=this.transitional||Wd.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(U.isResponse(t)||U.isReadableStream(t))return t;if(t&&U.isString(t)&&(r&&!this.responseType||s)){const a=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(a)throw c.name==="SyntaxError"?We.from(c,We.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:as.classes.FormData,Blob:as.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};U.forEach(["delete","get","head","post","put","patch"],e=>{Wd.headers[e]={}});const w4=U.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"]),S4=e=>{const t={};let n,r,s;return e&&e.split(`
+`).forEach(function(a){s=a.indexOf(":"),n=a.substring(0,s).trim().toLowerCase(),r=a.substring(s+1).trim(),!(!n||t[n]&&w4[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},W0=Symbol("internals");function eu(e){return e&&String(e).trim().toLowerCase()}function gp(e){return e===!1||e==null?e:U.isArray(e)?e.map(gp):String(e)}function C4(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 E4=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Um(e,t,n,r,s){if(U.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!U.isString(t)){if(U.isString(r))return t.indexOf(r)!==-1;if(U.isRegExp(r))return r.test(t)}}function k4(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function j4(e,t){const n=U.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,a){return this[r].call(this,t,s,o,a)},configurable:!0})})}let lr=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,u,i){const d=eu(u);if(!d)throw new Error("header name must be a non-empty string");const p=U.findKey(s,d);(!p||s[p]===void 0||i===!0||i===void 0&&s[p]!==!1)&&(s[p||u]=gp(c))}const a=(c,u)=>U.forEach(c,(i,d)=>o(i,d,u));if(U.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(U.isString(t)&&(t=t.trim())&&!E4(t))a(S4(t),n);else if(U.isHeaders(t))for(const[c,u]of t.entries())o(u,c,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=eu(t),t){const r=U.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return C4(s);if(U.isFunction(n))return n.call(this,s,r);if(U.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=eu(t),t){const r=U.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Um(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(a){if(a=eu(a),a){const c=U.findKey(r,a);c&&(!n||Um(r,r[c],c,n))&&(delete r[c],s=!0)}}return U.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||Um(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return U.forEach(this,(s,o)=>{const a=U.findKey(r,o);if(a){n[a]=gp(s),delete n[o];return}const c=t?k4(o):String(o).trim();c!==o&&delete n[o],n[c]=gp(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return U.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&U.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(s=>r.set(s)),r}static accessor(t){const r=(this[W0]=this[W0]={accessors:{}}).accessors,s=this.prototype;function o(a){const c=eu(a);r[c]||(j4(s,a),r[c]=!0)}return U.isArray(t)?t.forEach(o):o(t),this}};lr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);U.reduceDescriptors(lr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});U.freezeMethods(lr);function Vm(e,t){const n=this||Wd,r=t||n,s=lr.from(r.headers);let o=r.data;return U.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function XT(e){return!!(e&&e.__CANCEL__)}function Tc(e,t,n){We.call(this,e??"canceled",We.ERR_CANCELED,t,n),this.name="CanceledError"}U.inherits(Tc,We,{__CANCEL__:!0});function eM(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new We("Request failed with status code "+n.status,[We.ERR_BAD_REQUEST,We.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function T4(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function M4(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,a;return t=t!==void 0?t:1e3,function(u){const i=Date.now(),d=r[o];a||(a=i),n[s]=u,r[s]=i;let p=o,f=0;for(;p!==s;)f+=n[p++],p=p%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),i-aE&&(g=E)}if(i){var b,y;const w=f==="y"?"width":"height",S=["top","left"].includes(Co(s)),E=o.reference[p]-o.floating[w]+(S&&((b=a.offset)==null?void 0:b[p])||0)+(S?0:x.crossAxis),C=o.reference[p]+o.reference[w]+(S?0:((y=a.offset)==null?void 0:y[p])||0)-(S?x.crossAxis:0);h"u")return vU;var t=yU(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},xU=oN(),$l="data-scroll-locked",wU=function(e,t,n,r){var s=e.left,o=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
+ .`.concat(nU,` {
+ overflow: hidden `).concat(r,`;
+ padding-right: `).concat(c,"px ").concat(r,`;
+ }
+ body[`).concat($l,`] {
+ overflow: hidden `).concat(r,`;
+ overscroll-behavior: contain;
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
+ padding-left: `.concat(s,`px;
+ padding-top: `).concat(o,`px;
+ padding-right: `).concat(a,`px;
+ margin-left:0;
+ margin-top:0;
+ margin-right: `).concat(c,"px ").concat(r,`;
+ `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
+ }
+
+ .`).concat(mp,` {
+ right: `).concat(c,"px ").concat(r,`;
+ }
+
+ .`).concat(vp,` {
+ margin-right: `).concat(c,"px ").concat(r,`;
+ }
+
+ .`).concat(mp," .").concat(mp,` {
+ right: 0 `).concat(r,`;
+ }
+
+ .`).concat(vp," .").concat(vp,` {
+ margin-right: 0 `).concat(r,`;
+ }
+
+ body[`).concat($l,`] {
+ `).concat(rU,": ").concat(c,`px;
+ }
+`)},SC=function(){var e=parseInt(document.body.getAttribute($l)||"0",10);return isFinite(e)?e:0},SU=function(){v.useEffect(function(){return document.body.setAttribute($l,(SC()+1).toString()),function(){var e=SC()-1;e<=0?document.body.removeAttribute($l):document.body.setAttribute($l,e.toString())}},[])},CU=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;SU();var o=v.useMemo(function(){return bU(s)},[s]);return v.createElement(xU,{styles:wU(o,!t,s,n?"":"!important")})},Xy=!1;if(typeof window<"u")try{var Af=Object.defineProperty({},"passive",{get:function(){return Xy=!0,!0}});window.addEventListener("test",Af,Af),window.removeEventListener("test",Af,Af)}catch{Xy=!1}var sl=Xy?{passive:!1}:!1,EU=function(e){return e.tagName==="TEXTAREA"},aN=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!EU(e)&&n[t]==="visible")},kU=function(e){return aN(e,"overflowY")},jU=function(e){return aN(e,"overflowX")},CC=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=iN(e,r);if(s){var o=lN(e,r),a=o[1],c=o[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},TU=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},MU=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},iN=function(e,t){return e==="v"?kU(t):jU(t)},lN=function(e,t){return e==="v"?TU(t):MU(t)},NU=function(e,t){return e==="h"&&t==="rtl"?-1:1},_U=function(e,t,n,r,s){var o=NU(e,window.getComputedStyle(t).direction),a=o*r,c=n.target,u=t.contains(c),i=!1,d=a>0,p=0,f=0;do{var g=lN(e,c),h=g[0],m=g[1],x=g[2],b=m-x-o*h;(h||b)&&iN(e,c)&&(p+=b,f+=h),c instanceof ShadowRoot?c=c.host:c=c.parentNode}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(d&&(Math.abs(p)<1||!s)||!d&&(Math.abs(f)<1||!s))&&(i=!0),i},Ff=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},EC=function(e){return[e.deltaX,e.deltaY]},kC=function(e){return e&&"current"in e?e.current:e},PU=function(e,t){return e[0]===t[0]&&e[1]===t[1]},RU=function(e){return`
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
+`)},OU=0,ol=[];function IU(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),s=v.useState(OU++)[0],o=v.useState(oN)[0],a=v.useRef(e);v.useEffect(function(){a.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=tU([e.lockRef.current],(e.shards||[]).map(kC),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=v.useCallback(function(m,x){if("touches"in m&&m.touches.length===2)return!a.current.allowPinchZoom;var b=Ff(m),y=n.current,w="deltaX"in m?m.deltaX:y[0]-b[0],S="deltaY"in m?m.deltaY:y[1]-b[1],E,C=m.target,T=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in m&&T==="h"&&C.type==="range")return!1;var j=CC(T,C);if(!j)return!0;if(j?E=T:(E=T==="v"?"h":"v",j=CC(T,C)),!j)return!1;if(!r.current&&"changedTouches"in m&&(w||S)&&(r.current=E),!E)return!0;var _=r.current||E;return _U(_,x,m,_==="h"?w:S,!0)},[]),u=v.useCallback(function(m){var x=m;if(!(!ol.length||ol[ol.length-1]!==o)){var b="deltaY"in x?EC(x):Ff(x),y=t.current.filter(function(E){return E.name===x.type&&(E.target===x.target||x.target===E.shadowParent)&&PU(E.delta,b)})[0];if(y&&y.should){x.cancelable&&x.preventDefault();return}if(!y){var w=(a.current.shards||[]).map(kC).filter(Boolean).filter(function(E){return E.contains(x.target)}),S=w.length>0?c(x,w[0]):!a.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),i=v.useCallback(function(m,x,b,y){var w={name:m,delta:x,target:b,should:y,shadowParent:DU(b)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),d=v.useCallback(function(m){n.current=Ff(m),r.current=void 0},[]),p=v.useCallback(function(m){i(m.type,EC(m),m.target,c(m,e.lockRef.current))},[]),f=v.useCallback(function(m){i(m.type,Ff(m),m.target,c(m,e.lockRef.current))},[]);v.useEffect(function(){return ol.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:f}),document.addEventListener("wheel",u,sl),document.addEventListener("touchmove",u,sl),document.addEventListener("touchstart",d,sl),function(){ol=ol.filter(function(m){return m!==o}),document.removeEventListener("wheel",u,sl),document.removeEventListener("touchmove",u,sl),document.removeEventListener("touchstart",d,sl)}},[]);var g=e.removeScrollBar,h=e.inert;return v.createElement(v.Fragment,null,h?v.createElement(o,{styles:RU(s)}):null,g?v.createElement(CU,{gapMode:e.gapMode}):null)}function DU(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const AU=uU(sN,IU);var wh=v.forwardRef(function(e,t){return v.createElement(xh,Ps({},e,{ref:t,sideCar:AU}))});wh.classNames=xh.classNames;var eb=["Enter"," "],FU=["ArrowDown","PageUp","Home"],cN=["ArrowUp","PageDown","End"],LU=[...FU,...cN],$U={ltr:[...eb,"ArrowRight"],rtl:[...eb,"ArrowLeft"]},BU={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Zd="Menu",[gd,zU,UU]=Ux(Zd),[Gi,uN]=qr(Zd,[UU,mh,bh]),Sh=mh(),dN=bh(),[VU,Ji]=Gi(Zd),[HU,Yd]=Gi(Zd),fN=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:a=!0}=e,c=Sh(t),[u,i]=v.useState(null),d=v.useRef(!1),p=on(o),f=Jd(s);return v.useEffect(()=>{const g=()=>{d.current=!0,document.addEventListener("pointerdown",h,{capture:!0,once:!0}),document.addEventListener("pointermove",h,{capture:!0,once:!0})},h=()=>d.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",h,{capture:!0}),document.removeEventListener("pointermove",h,{capture:!0})}},[]),l.jsx(HM,{...c,children:l.jsx(VU,{scope:t,open:n,onOpenChange:p,content:u,onContentChange:i,children:l.jsx(HU,{scope:t,onClose:v.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:d,dir:f,modal:a,children:r})})})};fN.displayName=Zd;var KU="MenuAnchor",Xx=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Sh(n);return l.jsx(KM,{...s,...r,ref:t})});Xx.displayName=KU;var ew="MenuPortal",[qU,pN]=Gi(ew,{forceMount:void 0}),gN=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=Ji(ew,t);return l.jsx(qU,{scope:t,forceMount:n,children:l.jsx(cr,{present:n||o.open,children:l.jsx(vh,{asChild:!0,container:s,children:r})})})};gN.displayName=ew;var Vr="MenuContent",[WU,tw]=Gi(Vr),hN=v.forwardRef((e,t)=>{const n=pN(Vr,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=Ji(Vr,e.__scopeMenu),a=Yd(Vr,e.__scopeMenu);return l.jsx(gd.Provider,{scope:e.__scopeMenu,children:l.jsx(cr,{present:r||o.open,children:l.jsx(gd.Slot,{scope:e.__scopeMenu,children:a.modal?l.jsx(GU,{...s,ref:t}):l.jsx(JU,{...s,ref:t})})})})}),GU=v.forwardRef((e,t)=>{const n=Ji(Vr,e.__scopeMenu),r=v.useRef(null),s=ct(t,r);return v.useEffect(()=>{const o=r.current;if(o)return Yx(o)},[]),l.jsx(nw,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ce(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),JU=v.forwardRef((e,t)=>{const n=Ji(Vr,e.__scopeMenu);return l.jsx(nw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),nw=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:i,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:f,onDismiss:g,disableOutsideScroll:h,...m}=e,x=Ji(Vr,n),b=Yd(Vr,n),y=Sh(n),w=dN(n),S=zU(n),[E,C]=v.useState(null),T=v.useRef(null),j=ct(t,T,x.onContentChange),_=v.useRef(0),O=v.useRef(""),K=v.useRef(0),I=v.useRef(null),Y=v.useRef("right"),q=v.useRef(0),Z=h?wh:v.Fragment,ee=h?{as:wo,allowPinchZoom:!0}:void 0,J=A=>{var Q,Ee;const X=O.current+A,fe=S().filter(Pe=>!Pe.disabled),H=document.activeElement,se=(Q=fe.find(Pe=>Pe.ref.current===H))==null?void 0:Q.textValue,ne=fe.map(Pe=>Pe.textValue),le=i5(ne,X,se),oe=(Ee=fe.find(Pe=>Pe.textValue===le))==null?void 0:Ee.ref.current;(function Pe(Be){O.current=Be,window.clearTimeout(_.current),Be!==""&&(_.current=window.setTimeout(()=>Pe(""),1e3))})(X),oe&&setTimeout(()=>oe.focus())};v.useEffect(()=>()=>window.clearTimeout(_.current),[]),Vx();const L=v.useCallback(A=>{var fe,H;return Y.current===((fe=I.current)==null?void 0:fe.side)&&c5(A,(H=I.current)==null?void 0:H.area)},[]);return l.jsx(WU,{scope:n,searchRef:O,onItemEnter:v.useCallback(A=>{L(A)&&A.preventDefault()},[L]),onItemLeave:v.useCallback(A=>{var X;L(A)||((X=T.current)==null||X.focus(),C(null))},[L]),onTriggerLeave:v.useCallback(A=>{L(A)&&A.preventDefault()},[L]),pointerGraceTimerRef:K,onPointerGraceIntentChange:v.useCallback(A=>{I.current=A},[]),children:l.jsx(Z,{...ee,children:l.jsx(ph,{asChild:!0,trapped:s,onMountAutoFocus:Ce(o,A=>{var X;A.preventDefault(),(X=T.current)==null||X.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:l.jsx(fh,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:i,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:f,onDismiss:g,children:l.jsx(XM,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:C,onEntryFocus:Ce(u,A=>{b.isUsingKeyboardRef.current||A.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(qM,{role:"menu","aria-orientation":"vertical","data-state":PN(x.open),"data-radix-menu-content":"",dir:b.dir,...y,...m,ref:j,style:{outline:"none",...m.style},onKeyDown:Ce(m.onKeyDown,A=>{const fe=A.target.closest("[data-radix-menu-content]")===A.currentTarget,H=A.ctrlKey||A.altKey||A.metaKey,se=A.key.length===1;fe&&(A.key==="Tab"&&A.preventDefault(),!H&&se&&J(A.key));const ne=T.current;if(A.target!==ne||!LU.includes(A.key))return;A.preventDefault();const oe=S().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);cN.includes(A.key)&&oe.reverse(),o5(oe)}),onBlur:Ce(e.onBlur,A=>{A.currentTarget.contains(A.target)||(window.clearTimeout(_.current),O.current="")}),onPointerMove:Ce(e.onPointerMove,hd(A=>{const X=A.target,fe=q.current!==A.clientX;if(A.currentTarget.contains(X)&&fe){const H=A.clientX>q.current?"right":"left";Y.current=H,q.current=A.clientX}}))})})})})})})});hN.displayName=Vr;var QU="MenuGroup",rw=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Ie.div,{role:"group",...r,ref:t})});rw.displayName=QU;var ZU="MenuLabel",mN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Ie.div,{...r,ref:t})});mN.displayName=ZU;var lg="MenuItem",jC="menu.itemSelect",Ch=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=v.useRef(null),a=Yd(lg,e.__scopeMenu),c=tw(lg,e.__scopeMenu),u=ct(t,o),i=v.useRef(!1),d=()=>{const p=o.current;if(!n&&p){const f=new CustomEvent(jC,{bubbles:!0,cancelable:!0});p.addEventListener(jC,g=>r==null?void 0:r(g),{once:!0}),xM(p,f),f.defaultPrevented?i.current=!1:a.onClose()}};return l.jsx(vN,{...s,ref:u,disabled:n,onClick:Ce(e.onClick,d),onPointerDown:p=>{var f;(f=e.onPointerDown)==null||f.call(e,p),i.current=!0},onPointerUp:Ce(e.onPointerUp,p=>{var f;i.current||(f=p.currentTarget)==null||f.click()}),onKeyDown:Ce(e.onKeyDown,p=>{const f=c.searchRef.current!=="";n||f&&p.key===" "||eb.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Ch.displayName=lg;var vN=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,a=tw(lg,n),c=dN(n),u=v.useRef(null),i=ct(t,u),[d,p]=v.useState(!1),[f,g]=v.useState("");return v.useEffect(()=>{const h=u.current;h&&g((h.textContent??"").trim())},[o.children]),l.jsx(gd.ItemSlot,{scope:n,disabled:r,textValue:s??f,children:l.jsx(eN,{asChild:!0,...c,focusable:!r,children:l.jsx(Ie.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:i,onPointerMove:Ce(e.onPointerMove,hd(h=>{r?a.onItemLeave(h):(a.onItemEnter(h),h.defaultPrevented||h.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ce(e.onPointerLeave,hd(h=>a.onItemLeave(h))),onFocus:Ce(e.onFocus,()=>p(!0)),onBlur:Ce(e.onBlur,()=>p(!1))})})})}),YU="MenuCheckboxItem",yN=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return l.jsx(CN,{scope:e.__scopeMenu,checked:n,children:l.jsx(Ch,{role:"menuitemcheckbox","aria-checked":cg(n)?"mixed":n,...s,ref:t,"data-state":ow(n),onSelect:Ce(s.onSelect,()=>r==null?void 0:r(cg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});yN.displayName=YU;var bN="MenuRadioGroup",[XU,e5]=Gi(bN,{value:void 0,onValueChange:()=>{}}),xN=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=on(r);return l.jsx(XU,{scope:e.__scopeMenu,value:n,onValueChange:o,children:l.jsx(rw,{...s,ref:t})})});xN.displayName=bN;var wN="MenuRadioItem",SN=v.forwardRef((e,t)=>{const{value:n,...r}=e,s=e5(wN,e.__scopeMenu),o=n===s.value;return l.jsx(CN,{scope:e.__scopeMenu,checked:o,children:l.jsx(Ch,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":ow(o),onSelect:Ce(r.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,n)},{checkForDefaultPrevented:!1})})})});SN.displayName=wN;var sw="MenuItemIndicator",[CN,t5]=Gi(sw,{checked:!1}),EN=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=t5(sw,n);return l.jsx(cr,{present:r||cg(o.checked)||o.checked===!0,children:l.jsx(Ie.span,{...s,ref:t,"data-state":ow(o.checked)})})});EN.displayName=sw;var n5="MenuSeparator",kN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(Ie.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});kN.displayName=n5;var r5="MenuArrow",jN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Sh(n);return l.jsx(WM,{...s,...r,ref:t})});jN.displayName=r5;var s5="MenuSub",[Xoe,TN]=Gi(s5),vu="MenuSubTrigger",MN=v.forwardRef((e,t)=>{const n=Ji(vu,e.__scopeMenu),r=Yd(vu,e.__scopeMenu),s=TN(vu,e.__scopeMenu),o=tw(vu,e.__scopeMenu),a=v.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,i={__scopeMenu:e.__scopeMenu},d=v.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return v.useEffect(()=>d,[d]),v.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),u(null)}},[c,u]),l.jsx(Xx,{asChild:!0,...i,children:l.jsx(vN,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":PN(n.open),...e,ref:lh(t,s.onTriggerChange),onClick:p=>{var f;(f=e.onClick)==null||f.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ce(e.onPointerMove,hd(p=>{o.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:Ce(e.onPointerLeave,hd(p=>{var g,h;d();const f=(g=n.content)==null?void 0:g.getBoundingClientRect();if(f){const m=(h=n.content)==null?void 0:h.dataset.side,x=m==="right",b=x?-5:5,y=f[x?"left":"right"],w=f[x?"right":"left"];o.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x:y,y:f.top},{x:w,y:f.top},{x:w,y:f.bottom},{x:y,y:f.bottom}],side:m}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(p),p.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Ce(e.onKeyDown,p=>{var g;const f=o.searchRef.current!=="";e.disabled||f&&p.key===" "||$U[r.dir].includes(p.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),p.preventDefault())})})})});MN.displayName=vu;var NN="MenuSubContent",_N=v.forwardRef((e,t)=>{const n=pN(Vr,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=Ji(Vr,e.__scopeMenu),a=Yd(Vr,e.__scopeMenu),c=TN(NN,e.__scopeMenu),u=v.useRef(null),i=ct(t,u);return l.jsx(gd.Provider,{scope:e.__scopeMenu,children:l.jsx(cr,{present:r||o.open,children:l.jsx(gd.Slot,{scope:e.__scopeMenu,children:l.jsx(nw,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:i,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var p;a.isUsingKeyboardRef.current&&((p=u.current)==null||p.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:Ce(e.onFocusOutside,d=>{d.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Ce(e.onEscapeKeyDown,d=>{a.onClose(),d.preventDefault()}),onKeyDown:Ce(e.onKeyDown,d=>{var g;const p=d.currentTarget.contains(d.target),f=BU[a.dir].includes(d.key);p&&f&&(o.onOpenChange(!1),(g=c.trigger)==null||g.focus(),d.preventDefault())})})})})})});_N.displayName=NN;function PN(e){return e?"open":"closed"}function cg(e){return e==="indeterminate"}function ow(e){return cg(e)?"indeterminate":e?"checked":"unchecked"}function o5(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function a5(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function i5(e,t,n){const s=t.length>1&&Array.from(t).every(i=>i===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=a5(e,Math.max(o,0));s.length===1&&(a=a.filter(i=>i!==n));const u=a.find(i=>i.toLowerCase().startsWith(s.toLowerCase()));return u!==n?u:void 0}function l5(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,a=t.length-1;o