tmex-cli 0.6.8 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,225 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SettingsPage-BU-Jjd2f.js","assets/select-CD0ieoCm.js","assets/useValueChanged-CFS5t0R_.js","assets/switch-B4Od47H9.js","assets/DevicesPage-BvCZBCO1.js","assets/DevicePage-CJEjk7rL.js"])))=>i.map(i=>d[i]);
2
- var tO=Object.defineProperty;var W0=e=>{throw TypeError(e)};var nO=(e,t,r)=>t in e?tO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Be=(e,t,r)=>nO(e,typeof t!="symbol"?t+"":t,r),Cm=(e,t,r)=>t.has(e)||W0("Cannot "+r);var W=(e,t,r)=>(Cm(e,t,"read from private field"),r?r.call(e):t.get(e)),rt=(e,t,r)=>t.has(e)?W0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ie=(e,t,r,i)=>(Cm(e,t,"write to private field"),i?i.call(e,r):t.set(e,r),r),Nt=(e,t,r)=>(Cm(e,t,"access private method"),r);var td=(e,t,r,i)=>({set _(s){Ie(e,t,s,r)},get _(){return W(e,t,i)}});function rO(e,t){for(var r=0;r<t.length;r++){const i=t[r];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in e)){const l=Object.getOwnPropertyDescriptor(i,s);l&&Object.defineProperty(e,s,l.get?l:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function r(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=r(s);fetch(s.href,l)}})();const aO="modulepreload",iO=function(e){return"/"+e},$0={},og=function(t,r,i){let s=Promise.resolve();if(r&&r.length>0){let u=function(f){return Promise.all(f.map(y=>Promise.resolve(y).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),m=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));s=u(r.map(f=>{if(f=iO(f),f in $0)return;$0[f]=!0;const y=f.endsWith(".css"),p=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${p}`))return;const v=document.createElement("link");if(v.rel=y?"stylesheet":aO,y||(v.as="script"),v.crossOrigin="",v.href=f,m&&v.setAttribute("nonce",m),document.head.appendChild(v),y)return new Promise((b,S)=>{v.addEventListener("load",b),v.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${f}`)))})}))}function l(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return s.then(u=>{for(const d of u||[])d.status==="rejected"&&l(d.reason);return t().catch(l)})};function _x(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Om={exports:{}},ql={};/**
3
- * @license React
4
- * react-jsx-runtime.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var Q0;function oO(){if(Q0)return ql;Q0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(i,s,l){var u=null;if(l!==void 0&&(u=""+l),s.key!==void 0&&(u=""+s.key),"key"in s){l={};for(var d in s)d!=="key"&&(l[d]=s[d])}else l=s;return s=l.ref,{$$typeof:e,type:i,key:u,ref:s!==void 0?s:null,props:l}}return ql.Fragment=t,ql.jsx=r,ql.jsxs=r,ql}var Z0;function sO(){return Z0||(Z0=1,Om.exports=oO()),Om.exports}var I=sO(),Mc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},lO={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ri,ig,Ex,cO=(Ex=class{constructor(){rt(this,Ri,lO);rt(this,ig,!1)}setTimeoutProvider(e){Ie(this,Ri,e)}setTimeout(e,t){return W(this,Ri).setTimeout(e,t)}clearTimeout(e){W(this,Ri).clearTimeout(e)}setInterval(e,t){return W(this,Ri).setInterval(e,t)}clearInterval(e){W(this,Ri).clearInterval(e)}},Ri=new WeakMap,ig=new WeakMap,Ex),yo=new cO;function uO(e){setTimeout(e,0)}var Ao=typeof window>"u"||"Deno"in globalThis;function mr(){}function dO(e,t){return typeof e=="function"?e(t):e}function gp(e){return typeof e=="number"&&e>=0&&e!==1/0}function Lx(e,t){return Math.max(e+(t||0)-Date.now(),0)}function zi(e,t){return typeof e=="function"?e(t):e}function Br(e,t){return typeof e=="function"?e(t):e}function J0(e,t){const{type:r="all",exact:i,fetchStatus:s,predicate:l,queryKey:u,stale:d}=e;if(u){if(i){if(t.queryHash!==sg(u,t.options))return!1}else if(!mc(t.queryKey,u))return!1}if(r!=="all"){const m=t.isActive();if(r==="active"&&!m||r==="inactive"&&m)return!1}return!(typeof d=="boolean"&&t.isStale()!==d||s&&s!==t.state.fetchStatus||l&&!l(t))}function ew(e,t){const{exact:r,status:i,predicate:s,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(r){if(hc(t.options.mutationKey)!==hc(l))return!1}else if(!mc(t.options.mutationKey,l))return!1}return!(i&&t.state.status!==i||s&&!s(t))}function sg(e,t){return((t==null?void 0:t.queryKeyHashFn)||hc)(e)}function hc(e){return JSON.stringify(e,(t,r)=>vp(r)?Object.keys(r).sort().reduce((i,s)=>(i[s]=r[s],i),{}):r)}function mc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>mc(e[r],t[r])):!1}var fO=Object.prototype.hasOwnProperty;function zx(e,t,r=0){if(e===t)return e;if(r>500)return t;const i=tw(e)&&tw(t);if(!i&&!(vp(e)&&vp(t)))return t;const l=(i?e:Object.keys(e)).length,u=i?t:Object.keys(t),d=u.length,m=i?new Array(d):{};let f=0;for(let y=0;y<d;y++){const p=i?y:u[y],v=e[p],b=t[p];if(v===b){m[p]=v,(i?y<l:fO.call(e,p))&&f++;continue}if(v===null||b===null||typeof v!="object"||typeof b!="object"){m[p]=b;continue}const S=zx(v,b,r+1);m[p]=S,S===v&&f++}return l===d&&f===l?e:m}function yp(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function tw(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function vp(e){if(!nw(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!nw(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function nw(e){return Object.prototype.toString.call(e)==="[object Object]"}function hO(e){return new Promise(t=>{yo.setTimeout(t,e)})}function bp(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?zx(e,t):t}function mO(e,t,r=0){const i=[...e,t];return r&&i.length>r?i.slice(1):i}function pO(e,t,r=0){const i=[t,...e];return r&&i.length>r?i.slice(0,-1):i}var lg=Symbol();function Px(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===lg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ix(e,t){return typeof e=="function"?e(...t):!!e}function gO(e,t,r){let i=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),i||(i=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var wo,Ti,ks,Rx,yO=(Rx=class extends Mc{constructor(){super();rt(this,wo);rt(this,Ti);rt(this,ks);Ie(this,ks,t=>{if(!Ao&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){W(this,Ti)||this.setEventListener(W(this,ks))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Ti))==null||t.call(this),Ie(this,Ti,void 0))}setEventListener(t){var r;Ie(this,ks,t),(r=W(this,Ti))==null||r.call(this),Ie(this,Ti,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){W(this,wo)!==t&&(Ie(this,wo,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof W(this,wo)=="boolean"?W(this,wo):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},wo=new WeakMap,Ti=new WeakMap,ks=new WeakMap,Rx),cg=new yO;function wp(){let e,t;const r=new Promise((s,l)=>{e=s,t=l});r.status="pending",r.catch(()=>{});function i(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{i({status:"fulfilled",value:s}),e(s)},r.reject=s=>{i({status:"rejected",reason:s}),t(s)},r}var vO=uO;function bO(){let e=[],t=0,r=d=>{d()},i=d=>{d()},s=vO;const l=d=>{t?e.push(d):s(()=>{r(d)})},u=()=>{const d=e;e=[],d.length&&s(()=>{i(()=>{d.forEach(m=>{r(m)})})})};return{batch:d=>{let m;t++;try{m=d()}finally{t--,t||u()}return m},batchCalls:d=>(...m)=>{l(()=>{d(...m)})},schedule:l,setNotifyFunction:d=>{r=d},setBatchNotifyFunction:d=>{i=d},setScheduler:d=>{s=d}}}var Hn=bO(),_s,Ci,Ls,Tx,wO=(Tx=class extends Mc{constructor(){super();rt(this,_s,!0);rt(this,Ci);rt(this,Ls);Ie(this,Ls,t=>{if(!Ao&&window.addEventListener){const r=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",i)}}})}onSubscribe(){W(this,Ci)||this.setEventListener(W(this,Ls))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Ci))==null||t.call(this),Ie(this,Ci,void 0))}setEventListener(t){var r;Ie(this,Ls,t),(r=W(this,Ci))==null||r.call(this),Ie(this,Ci,t(this.setOnline.bind(this)))}setOnline(t){W(this,_s)!==t&&(Ie(this,_s,t),this.listeners.forEach(i=>{i(t)}))}isOnline(){return W(this,_s)}},_s=new WeakMap,Ci=new WeakMap,Ls=new WeakMap,Tx),kd=new wO;function SO(e){return Math.min(1e3*2**e,3e4)}function Ux(e){return(e??"online")==="online"?kd.isOnline():!0}var Sp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function jx(e){let t=!1,r=0,i;const s=wp(),l=()=>s.status!=="pending",u=x=>{var R;if(!l()){const T=new Sp(x);v(T),(R=e.onCancel)==null||R.call(e,T)}},d=()=>{t=!0},m=()=>{t=!1},f=()=>cg.isFocused()&&(e.networkMode==="always"||kd.isOnline())&&e.canRun(),y=()=>Ux(e.networkMode)&&e.canRun(),p=x=>{l()||(i==null||i(),s.resolve(x))},v=x=>{l()||(i==null||i(),s.reject(x))},b=()=>new Promise(x=>{var R;i=T=>{(l()||f())&&x(T)},(R=e.onPause)==null||R.call(e)}).then(()=>{var x;i=void 0,l()||(x=e.onContinue)==null||x.call(e)}),S=()=>{if(l())return;let x;const R=r===0?e.initialPromise:void 0;try{x=R??e.fn()}catch(T){x=Promise.reject(T)}Promise.resolve(x).then(p).catch(T=>{var k;if(l())return;const M=e.retry??(Ao?0:3),D=e.retryDelay??SO,C=typeof D=="function"?D(r,T):D,N=M===!0||typeof M=="number"&&r<M||typeof M=="function"&&M(r,T);if(t||!N){v(T);return}r++,(k=e.onFail)==null||k.call(e,r,T),hO(C).then(()=>f()?void 0:b()).then(()=>{t?v(T):S()})})};return{promise:s,status:()=>s.status,cancel:u,continue:()=>(i==null||i(),s),cancelRetry:d,continueRetry:m,canStart:y,start:()=>(y()?S():b().then(S),s)}}var So,Cx,Hx=(Cx=class{constructor(){rt(this,So)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),gp(this.gcTime)&&Ie(this,So,yo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ao?1/0:300*1e3))}clearGcTimeout(){W(this,So)&&(yo.clearTimeout(W(this,So)),Ie(this,So,void 0))}},So=new WeakMap,Cx),xo,zs,jr,Eo,Nn,Ec,Ro,ta,Va,Ox,xO=(Ox=class extends Hx{constructor(t){super();rt(this,ta);rt(this,xo);rt(this,zs);rt(this,jr);rt(this,Eo);rt(this,Nn);rt(this,Ec);rt(this,Ro);Ie(this,Ro,!1),Ie(this,Ec,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ie(this,Eo,t.client),Ie(this,jr,W(this,Eo).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ie(this,xo,aw(this.options)),this.state=t.state??W(this,xo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=W(this,Nn))==null?void 0:t.promise}setOptions(t){if(this.options={...W(this,Ec),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=aw(this.options);r.data!==void 0&&(this.setState(rw(r.data,r.dataUpdatedAt)),Ie(this,xo,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,jr).remove(this)}setData(t,r){const i=bp(this.state.data,t,this.options);return Nt(this,ta,Va).call(this,{data:i,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),i}setState(t,r){Nt(this,ta,Va).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var i,s;const r=(i=W(this,Nn))==null?void 0:i.promise;return(s=W(this,Nn))==null||s.cancel(t),r?r.then(mr).catch(mr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(W(this,xo))}isActive(){return this.observers.some(t=>Br(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===lg||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>zi(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Lx(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(i=>i.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=W(this,Nn))==null||r.continue()}onOnline(){var r;const t=this.observers.find(i=>i.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=W(this,Nn))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),W(this,jr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(W(this,Nn)&&(W(this,Ro)?W(this,Nn).cancel({revert:!0}):W(this,Nn).cancelRetry()),this.scheduleGc()),W(this,jr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Nt(this,ta,Va).call(this,{type:"invalidate"})}async fetch(t,r){var m,f,y,p,v,b,S,x,R,T,M,D;if(this.state.fetchStatus!=="idle"&&((m=W(this,Nn))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(W(this,Nn))return W(this,Nn).continueRetry(),W(this,Nn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const C=this.observers.find(N=>N.options.queryFn);C&&this.setOptions(C.options)}const i=new AbortController,s=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(Ie(this,Ro,!0),i.signal)})},l=()=>{const C=Px(this.options,r),k=(()=>{const O={client:W(this,Eo),queryKey:this.queryKey,meta:this.meta};return s(O),O})();return Ie(this,Ro,!1),this.options.persister?this.options.persister(C,k,this):C(k)},d=(()=>{const C={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:W(this,Eo),state:this.state,fetchFn:l};return s(C),C})();(f=this.options.behavior)==null||f.onFetch(d,this),Ie(this,zs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=d.fetchOptions)==null?void 0:y.meta))&&Nt(this,ta,Va).call(this,{type:"fetch",meta:(p=d.fetchOptions)==null?void 0:p.meta}),Ie(this,Nn,jx({initialPromise:r==null?void 0:r.initialPromise,fn:d.fetchFn,onCancel:C=>{C instanceof Sp&&C.revert&&this.setState({...W(this,zs),fetchStatus:"idle"}),i.abort()},onFail:(C,N)=>{Nt(this,ta,Va).call(this,{type:"failed",failureCount:C,error:N})},onPause:()=>{Nt(this,ta,Va).call(this,{type:"pause"})},onContinue:()=>{Nt(this,ta,Va).call(this,{type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0}));try{const C=await W(this,Nn).start();if(C===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(C),(b=(v=W(this,jr).config).onSuccess)==null||b.call(v,C,this),(x=(S=W(this,jr).config).onSettled)==null||x.call(S,C,this.state.error,this),C}catch(C){if(C instanceof Sp){if(C.silent)return W(this,Nn).promise;if(C.revert){if(this.state.data===void 0)throw C;return this.state.data}}throw Nt(this,ta,Va).call(this,{type:"error",error:C}),(T=(R=W(this,jr).config).onError)==null||T.call(R,C,this),(D=(M=W(this,jr).config).onSettled)==null||D.call(M,this.state.data,C,this),C}finally{this.scheduleGc()}}},xo=new WeakMap,zs=new WeakMap,jr=new WeakMap,Eo=new WeakMap,Nn=new WeakMap,Ec=new WeakMap,Ro=new WeakMap,ta=new WeakSet,Va=function(t){const r=i=>{switch(t.type){case"failed":return{...i,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...Bx(i.data,this.options),fetchMeta:t.meta??null};case"success":const s={...i,...rw(t.data,t.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ie(this,zs,t.manual?s:void 0),s;case"error":const l=t.error;return{...i,error:l,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...t.state}}};this.state=r(this.state),Hn.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),W(this,jr).notify({query:this,type:"updated",action:t})})},Ox);function Bx(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ux(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function rw(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function aw(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,i=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var fr,kt,Rc,Qn,To,Ps,Ga,Oi,Tc,Is,Us,Co,Oo,Mi,js,Bt,tc,xp,Ep,Rp,Tp,Cp,Op,Mp,Fx,Mx,EO=(Mx=class extends Mc{constructor(t,r){super();rt(this,Bt);rt(this,fr);rt(this,kt);rt(this,Rc);rt(this,Qn);rt(this,To);rt(this,Ps);rt(this,Ga);rt(this,Oi);rt(this,Tc);rt(this,Is);rt(this,Us);rt(this,Co);rt(this,Oo);rt(this,Mi);rt(this,js,new Set);this.options=r,Ie(this,fr,t),Ie(this,Oi,null),Ie(this,Ga,wp()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,kt).addObserver(this),iw(W(this,kt),this.options)?Nt(this,Bt,tc).call(this):this.updateResult(),Nt(this,Bt,Tp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Dp(W(this,kt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Dp(W(this,kt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Nt(this,Bt,Cp).call(this),Nt(this,Bt,Op).call(this),W(this,kt).removeObserver(this)}setOptions(t){const r=this.options,i=W(this,kt);if(this.options=W(this,fr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Br(this.options.enabled,W(this,kt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Nt(this,Bt,Mp).call(this),W(this,kt).setOptions(this.options),r._defaulted&&!yp(this.options,r)&&W(this,fr).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,kt),observer:this});const s=this.hasListeners();s&&ow(W(this,kt),i,this.options,r)&&Nt(this,Bt,tc).call(this),this.updateResult(),s&&(W(this,kt)!==i||Br(this.options.enabled,W(this,kt))!==Br(r.enabled,W(this,kt))||zi(this.options.staleTime,W(this,kt))!==zi(r.staleTime,W(this,kt)))&&Nt(this,Bt,xp).call(this);const l=Nt(this,Bt,Ep).call(this);s&&(W(this,kt)!==i||Br(this.options.enabled,W(this,kt))!==Br(r.enabled,W(this,kt))||l!==W(this,Mi))&&Nt(this,Bt,Rp).call(this,l)}getOptimisticResult(t){const r=W(this,fr).getQueryCache().build(W(this,fr),t),i=this.createResult(r,t);return TO(this,i)&&(Ie(this,Qn,i),Ie(this,Ps,this.options),Ie(this,To,W(this,kt).state)),i}getCurrentResult(){return W(this,Qn)}trackResult(t,r){return new Proxy(t,{get:(i,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&W(this,Ga).status==="pending"&&W(this,Ga).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,s))})}trackProp(t){W(this,js).add(t)}getCurrentQuery(){return W(this,kt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=W(this,fr).defaultQueryOptions(t),i=W(this,fr).getQueryCache().build(W(this,fr),r);return i.fetch().then(()=>this.createResult(i,r))}fetch(t){return Nt(this,Bt,tc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,Qn)))}createResult(t,r){var G;const i=W(this,kt),s=this.options,l=W(this,Qn),u=W(this,To),d=W(this,Ps),f=t!==i?t.state:W(this,Rc),{state:y}=t;let p={...y},v=!1,b;if(r._optimisticResults){const J=this.hasListeners(),Z=!J&&iw(t,r),z=J&&ow(t,i,r,s);(Z||z)&&(p={...p,...Bx(y.data,t.options)}),r._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:S,errorUpdatedAt:x,status:R}=p;b=p.data;let T=!1;if(r.placeholderData!==void 0&&b===void 0&&R==="pending"){let J;l!=null&&l.isPlaceholderData&&r.placeholderData===(d==null?void 0:d.placeholderData)?(J=l.data,T=!0):J=typeof r.placeholderData=="function"?r.placeholderData((G=W(this,Us))==null?void 0:G.state.data,W(this,Us)):r.placeholderData,J!==void 0&&(R="success",b=bp(l==null?void 0:l.data,J,r),v=!0)}if(r.select&&b!==void 0&&!T)if(l&&b===(u==null?void 0:u.data)&&r.select===W(this,Tc))b=W(this,Is);else try{Ie(this,Tc,r.select),b=r.select(b),b=bp(l==null?void 0:l.data,b,r),Ie(this,Is,b),Ie(this,Oi,null)}catch(J){Ie(this,Oi,J)}W(this,Oi)&&(S=W(this,Oi),b=W(this,Is),x=Date.now(),R="error");const M=p.fetchStatus==="fetching",D=R==="pending",C=R==="error",N=D&&M,k=b!==void 0,L={status:R,fetchStatus:p.fetchStatus,isPending:D,isSuccess:R==="success",isError:C,isInitialLoading:N,isLoading:N,data:b,dataUpdatedAt:p.dataUpdatedAt,error:S,errorUpdatedAt:x,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>f.dataUpdateCount||p.errorUpdateCount>f.errorUpdateCount,isFetching:M,isRefetching:M&&!D,isLoadingError:C&&!k,isPaused:p.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:C&&k,isStale:ug(t,r),refetch:this.refetch,promise:W(this,Ga),isEnabled:Br(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const J=L.data!==void 0,Z=L.status==="error"&&!J,z=q=>{Z?q.reject(L.error):J&&q.resolve(L.data)},H=()=>{const q=Ie(this,Ga,L.promise=wp());z(q)},V=W(this,Ga);switch(V.status){case"pending":t.queryHash===i.queryHash&&z(V);break;case"fulfilled":(Z||L.data!==V.value)&&H();break;case"rejected":(!Z||L.error!==V.reason)&&H();break}}return L}updateResult(){const t=W(this,Qn),r=this.createResult(W(this,kt),this.options);if(Ie(this,To,W(this,kt).state),Ie(this,Ps,this.options),W(this,To).data!==void 0&&Ie(this,Us,W(this,kt)),yp(r,t))return;Ie(this,Qn,r);const i=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,l=typeof s=="function"?s():s;if(l==="all"||!l&&!W(this,js).size)return!0;const u=new Set(l??W(this,js));return this.options.throwOnError&&u.add("error"),Object.keys(W(this,Qn)).some(d=>{const m=d;return W(this,Qn)[m]!==t[m]&&u.has(m)})};Nt(this,Bt,Fx).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Nt(this,Bt,Tp).call(this)}},fr=new WeakMap,kt=new WeakMap,Rc=new WeakMap,Qn=new WeakMap,To=new WeakMap,Ps=new WeakMap,Ga=new WeakMap,Oi=new WeakMap,Tc=new WeakMap,Is=new WeakMap,Us=new WeakMap,Co=new WeakMap,Oo=new WeakMap,Mi=new WeakMap,js=new WeakMap,Bt=new WeakSet,tc=function(t){Nt(this,Bt,Mp).call(this);let r=W(this,kt).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(mr)),r},xp=function(){Nt(this,Bt,Cp).call(this);const t=zi(this.options.staleTime,W(this,kt));if(Ao||W(this,Qn).isStale||!gp(t))return;const i=Lx(W(this,Qn).dataUpdatedAt,t)+1;Ie(this,Co,yo.setTimeout(()=>{W(this,Qn).isStale||this.updateResult()},i))},Ep=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,kt)):this.options.refetchInterval)??!1},Rp=function(t){Nt(this,Bt,Op).call(this),Ie(this,Mi,t),!(Ao||Br(this.options.enabled,W(this,kt))===!1||!gp(W(this,Mi))||W(this,Mi)===0)&&Ie(this,Oo,yo.setInterval(()=>{(this.options.refetchIntervalInBackground||cg.isFocused())&&Nt(this,Bt,tc).call(this)},W(this,Mi)))},Tp=function(){Nt(this,Bt,xp).call(this),Nt(this,Bt,Rp).call(this,Nt(this,Bt,Ep).call(this))},Cp=function(){W(this,Co)&&(yo.clearTimeout(W(this,Co)),Ie(this,Co,void 0))},Op=function(){W(this,Oo)&&(yo.clearInterval(W(this,Oo)),Ie(this,Oo,void 0))},Mp=function(){const t=W(this,fr).getQueryCache().build(W(this,fr),this.options);if(t===W(this,kt))return;const r=W(this,kt);Ie(this,kt,t),Ie(this,Rc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Fx=function(t){Hn.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(W(this,Qn))}),W(this,fr).getQueryCache().notify({query:W(this,kt),type:"observerResultsUpdated"})})},Mx);function RO(e,t){return Br(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function iw(e,t){return RO(e,t)||e.state.data!==void 0&&Dp(e,t,t.refetchOnMount)}function Dp(e,t,r){if(Br(t.enabled,e)!==!1&&zi(t.staleTime,e)!=="static"){const i=typeof r=="function"?r(e):r;return i==="always"||i!==!1&&ug(e,t)}return!1}function ow(e,t,r,i){return(e!==t||Br(i.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&ug(e,r)}function ug(e,t){return Br(t.enabled,e)!==!1&&e.isStaleByTime(zi(t.staleTime,e))}function TO(e,t){return!yp(e.getCurrentResult(),t)}function sw(e){return{onFetch:(t,r)=>{var y,p,v,b,S;const i=t.options,s=(v=(p=(y=t.fetchOptions)==null?void 0:y.meta)==null?void 0:p.fetchMore)==null?void 0:v.direction,l=((b=t.state.data)==null?void 0:b.pages)||[],u=((S=t.state.data)==null?void 0:S.pageParams)||[];let d={pages:[],pageParams:[]},m=0;const f=async()=>{let x=!1;const R=D=>{gO(D,()=>t.signal,()=>x=!0)},T=Px(t.options,t.fetchOptions),M=async(D,C,N)=>{if(x)return Promise.reject();if(C==null&&D.pages.length)return Promise.resolve(D);const O=(()=>{const Z={client:t.client,queryKey:t.queryKey,pageParam:C,direction:N?"backward":"forward",meta:t.options.meta};return R(Z),Z})(),L=await T(O),{maxPages:G}=t.options,J=N?pO:mO;return{pages:J(D.pages,L,G),pageParams:J(D.pageParams,C,G)}};if(s&&l.length){const D=s==="backward",C=D?CO:lw,N={pages:l,pageParams:u},k=C(i,N);d=await M(N,k,D)}else{const D=e??l.length;do{const C=m===0?u[0]??i.initialPageParam:lw(i,d);if(m>0&&C==null)break;d=await M(d,C),m++}while(m<D)}return d};t.options.persister?t.fetchFn=()=>{var x,R;return(R=(x=t.options).persister)==null?void 0:R.call(x,f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=f}}}function lw(e,{pages:t,pageParams:r}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,r[i],r):void 0}function CO(e,{pages:t,pageParams:r}){var i;return t.length>0?(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,r[0],r):void 0}var Cc,ua,Fn,Mo,da,Si,Dx,OO=(Dx=class extends Hx{constructor(t){super();rt(this,da);rt(this,Cc);rt(this,ua);rt(this,Fn);rt(this,Mo);Ie(this,Cc,t.client),this.mutationId=t.mutationId,Ie(this,Fn,t.mutationCache),Ie(this,ua,[]),this.state=t.state||MO(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){W(this,ua).includes(t)||(W(this,ua).push(t),this.clearGcTimeout(),W(this,Fn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ie(this,ua,W(this,ua).filter(r=>r!==t)),this.scheduleGc(),W(this,Fn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){W(this,ua).length||(this.state.status==="pending"?this.scheduleGc():W(this,Fn).remove(this))}continue(){var t;return((t=W(this,Mo))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var u,d,m,f,y,p,v,b,S,x,R,T,M,D,C,N,k,O;const r=()=>{Nt(this,da,Si).call(this,{type:"continue"})},i={client:W(this,Cc),meta:this.options.meta,mutationKey:this.options.mutationKey};Ie(this,Mo,jx({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(L,G)=>{Nt(this,da,Si).call(this,{type:"failed",failureCount:L,error:G})},onPause:()=>{Nt(this,da,Si).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,Fn).canRun(this)}));const s=this.state.status==="pending",l=!W(this,Mo).canStart();try{if(s)r();else{Nt(this,da,Si).call(this,{type:"pending",variables:t,isPaused:l}),W(this,Fn).config.onMutate&&await W(this,Fn).config.onMutate(t,this,i);const G=await((d=(u=this.options).onMutate)==null?void 0:d.call(u,t,i));G!==this.state.context&&Nt(this,da,Si).call(this,{type:"pending",context:G,variables:t,isPaused:l})}const L=await W(this,Mo).start();return await((f=(m=W(this,Fn).config).onSuccess)==null?void 0:f.call(m,L,t,this.state.context,this,i)),await((p=(y=this.options).onSuccess)==null?void 0:p.call(y,L,t,this.state.context,i)),await((b=(v=W(this,Fn).config).onSettled)==null?void 0:b.call(v,L,null,this.state.variables,this.state.context,this,i)),await((x=(S=this.options).onSettled)==null?void 0:x.call(S,L,null,t,this.state.context,i)),Nt(this,da,Si).call(this,{type:"success",data:L}),L}catch(L){try{await((T=(R=W(this,Fn).config).onError)==null?void 0:T.call(R,L,t,this.state.context,this,i))}catch(G){Promise.reject(G)}try{await((D=(M=this.options).onError)==null?void 0:D.call(M,L,t,this.state.context,i))}catch(G){Promise.reject(G)}try{await((N=(C=W(this,Fn).config).onSettled)==null?void 0:N.call(C,void 0,L,this.state.variables,this.state.context,this,i))}catch(G){Promise.reject(G)}try{await((O=(k=this.options).onSettled)==null?void 0:O.call(k,void 0,L,t,this.state.context,i))}catch(G){Promise.reject(G)}throw Nt(this,da,Si).call(this,{type:"error",error:L}),L}finally{W(this,Fn).runNext(this)}}},Cc=new WeakMap,ua=new WeakMap,Fn=new WeakMap,Mo=new WeakMap,da=new WeakSet,Si=function(t){const r=i=>{switch(t.type){case"failed":return{...i,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,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{...i,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Hn.batch(()=>{W(this,ua).forEach(i=>{i.onMutationUpdate(t)}),W(this,Fn).notify({mutation:this,type:"updated",action:t})})},Dx);function MO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ka,na,Oc,Ax,DO=(Ax=class extends Mc{constructor(t={}){super();rt(this,Ka);rt(this,na);rt(this,Oc);this.config=t,Ie(this,Ka,new Set),Ie(this,na,new Map),Ie(this,Oc,0)}build(t,r,i){const s=new OO({client:t,mutationCache:this,mutationId:++td(this,Oc)._,options:t.defaultMutationOptions(r),state:i});return this.add(s),s}add(t){W(this,Ka).add(t);const r=nd(t);if(typeof r=="string"){const i=W(this,na).get(r);i?i.push(t):W(this,na).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(W(this,Ka).delete(t)){const r=nd(t);if(typeof r=="string"){const i=W(this,na).get(r);if(i)if(i.length>1){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}else i[0]===t&&W(this,na).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=nd(t);if(typeof r=="string"){const i=W(this,na).get(r),s=i==null?void 0:i.find(l=>l.state.status==="pending");return!s||s===t}else return!0}runNext(t){var i;const r=nd(t);if(typeof r=="string"){const s=(i=W(this,na).get(r))==null?void 0:i.find(l=>l!==t&&l.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Hn.batch(()=>{W(this,Ka).forEach(t=>{this.notify({type:"removed",mutation:t})}),W(this,Ka).clear(),W(this,na).clear()})}getAll(){return Array.from(W(this,Ka))}find(t){const r={exact:!0,...t};return this.getAll().find(i=>ew(r,i))}findAll(t={}){return this.getAll().filter(r=>ew(t,r))}notify(t){Hn.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Hn.batch(()=>Promise.all(t.map(r=>r.continue().catch(mr))))}},Ka=new WeakMap,na=new WeakMap,Oc=new WeakMap,Ax);function nd(e){var t;return(t=e.options.scope)==null?void 0:t.id}var fa,Nx,AO=(Nx=class extends Mc{constructor(t={}){super();rt(this,fa);this.config=t,Ie(this,fa,new Map)}build(t,r,i){const s=r.queryKey,l=r.queryHash??sg(s,r);let u=this.get(l);return u||(u=new xO({client:t,queryKey:s,queryHash:l,options:t.defaultQueryOptions(r),state:i,defaultOptions:t.getQueryDefaults(s)}),this.add(u)),u}add(t){W(this,fa).has(t.queryHash)||(W(this,fa).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=W(this,fa).get(t.queryHash);r&&(t.destroy(),r===t&&W(this,fa).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Hn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return W(this,fa).get(t)}getAll(){return[...W(this,fa).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(i=>J0(r,i))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(i=>J0(t,i)):r}notify(t){Hn.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Hn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Hn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},fa=new WeakMap,Nx),hn,Di,Ai,Hs,Bs,Ni,Fs,Vs,kx,NO=(kx=class{constructor(e={}){rt(this,hn);rt(this,Di);rt(this,Ai);rt(this,Hs);rt(this,Bs);rt(this,Ni);rt(this,Fs);rt(this,Vs);Ie(this,hn,e.queryCache||new AO),Ie(this,Di,e.mutationCache||new DO),Ie(this,Ai,e.defaultOptions||{}),Ie(this,Hs,new Map),Ie(this,Bs,new Map),Ie(this,Ni,0)}mount(){td(this,Ni)._++,W(this,Ni)===1&&(Ie(this,Fs,cg.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,hn).onFocus())})),Ie(this,Vs,kd.subscribe(async e=>{e&&(await this.resumePausedMutations(),W(this,hn).onOnline())})))}unmount(){var e,t;td(this,Ni)._--,W(this,Ni)===0&&((e=W(this,Fs))==null||e.call(this),Ie(this,Fs,void 0),(t=W(this,Vs))==null||t.call(this),Ie(this,Vs,void 0))}isFetching(e){return W(this,hn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return W(this,Di).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=W(this,hn).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=W(this,hn).build(this,t),i=r.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(zi(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return W(this,hn).findAll(e).map(({queryKey:t,state:r})=>{const i=r.data;return[t,i]})}setQueryData(e,t,r){const i=this.defaultQueryOptions({queryKey:e}),s=W(this,hn).get(i.queryHash),l=s==null?void 0:s.state.data,u=dO(t,l);if(u!==void 0)return W(this,hn).build(this,i).setData(u,{...r,manual:!0})}setQueriesData(e,t,r){return Hn.batch(()=>W(this,hn).findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=W(this,hn).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=W(this,hn);Hn.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=W(this,hn);return Hn.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},i=Hn.batch(()=>W(this,hn).findAll(e).map(s=>s.cancel(r)));return Promise.all(i).then(mr).catch(mr)}invalidateQueries(e,t={}){return Hn.batch(()=>(W(this,hn).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},i=Hn.batch(()=>W(this,hn).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let l=s.fetch(void 0,r);return r.throwOnError||(l=l.catch(mr)),s.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(i).then(mr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=W(this,hn).build(this,t);return r.isStaleByTime(zi(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(mr).catch(mr)}fetchInfiniteQuery(e){return e.behavior=sw(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(mr).catch(mr)}ensureInfiniteQueryData(e){return e.behavior=sw(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return kd.isOnline()?W(this,Di).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,hn)}getMutationCache(){return W(this,Di)}getDefaultOptions(){return W(this,Ai)}setDefaultOptions(e){Ie(this,Ai,e)}setQueryDefaults(e,t){W(this,Hs).set(hc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...W(this,Hs).values()],r={};return t.forEach(i=>{mc(e,i.queryKey)&&Object.assign(r,i.defaultOptions)}),r}setMutationDefaults(e,t){W(this,Bs).set(hc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...W(this,Bs).values()],r={};return t.forEach(i=>{mc(e,i.mutationKey)&&Object.assign(r,i.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...W(this,Ai).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=sg(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===lg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...W(this,Ai).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){W(this,hn).clear(),W(this,Di).clear()}},hn=new WeakMap,Di=new WeakMap,Ai=new WeakMap,Hs=new WeakMap,Bs=new WeakMap,Ni=new WeakMap,Fs=new WeakMap,Vs=new WeakMap,kx),Mm={exports:{}},ct={};/**
11
- * @license React
12
- * react.production.js
13
- *
14
- * Copyright (c) Meta Platforms, Inc. and affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- */var cw;function kO(){if(cw)return ct;cw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),v=Symbol.iterator;function b(P){return P===null||typeof P!="object"?null:(P=v&&P[v]||P["@@iterator"],typeof P=="function"?P:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,R={};function T(P,X,$){this.props=P,this.context=X,this.refs=R,this.updater=$||S}T.prototype.isReactComponent={},T.prototype.setState=function(P,X){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,X,"setState")},T.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function M(){}M.prototype=T.prototype;function D(P,X,$){this.props=P,this.context=X,this.refs=R,this.updater=$||S}var C=D.prototype=new M;C.constructor=D,x(C,T.prototype),C.isPureReactComponent=!0;var N=Array.isArray;function k(){}var O={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function G(P,X,$){var F=$.ref;return{$$typeof:e,type:P,key:X,ref:F!==void 0?F:null,props:$}}function J(P,X){return G(P.type,X,P.props)}function Z(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function z(P){var X={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function($){return X[$]})}var H=/\/+/g;function V(P,X){return typeof P=="object"&&P!==null&&P.key!=null?z(""+P.key):X.toString(36)}function q(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(k,k):(P.status="pending",P.then(function(X){P.status==="pending"&&(P.status="fulfilled",P.value=X)},function(X){P.status==="pending"&&(P.status="rejected",P.reason=X)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function _(P,X,$,F,te){var ue=typeof P;(ue==="undefined"||ue==="boolean")&&(P=null);var he=!1;if(P===null)he=!0;else switch(ue){case"bigint":case"string":case"number":he=!0;break;case"object":switch(P.$$typeof){case e:case t:he=!0;break;case y:return he=P._init,_(he(P._payload),X,$,F,te)}}if(he)return te=te(P),he=F===""?"."+V(P,0):F,N(te)?($="",he!=null&&($=he.replace(H,"$&/")+"/"),_(te,X,$,"",function(ke){return ke})):te!=null&&(Z(te)&&(te=J(te,$+(te.key==null||P&&P.key===te.key?"":(""+te.key).replace(H,"$&/")+"/")+he)),X.push(te)),1;he=0;var we=F===""?".":F+":";if(N(P))for(var ve=0;ve<P.length;ve++)F=P[ve],ue=we+V(F,ve),he+=_(F,X,$,ue,te);else if(ve=b(P),typeof ve=="function")for(P=ve.call(P),ve=0;!(F=P.next()).done;)F=F.value,ue=we+V(F,ve++),he+=_(F,X,$,ue,te);else if(ue==="object"){if(typeof P.then=="function")return _(q(P),X,$,F,te);throw X=String(P),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return he}function j(P,X,$){if(P==null)return P;var F=[],te=0;return _(P,F,"","",function(ue){return X.call($,ue,te++)}),F}function U(P){if(P._status===-1){var X=P._result;X=X(),X.then(function($){(P._status===0||P._status===-1)&&(P._status=1,P._result=$)},function($){(P._status===0||P._status===-1)&&(P._status=2,P._result=$)}),P._status===-1&&(P._status=0,P._result=X)}if(P._status===1)return P._result.default;throw P._result}var ie=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},ae={map:j,forEach:function(P,X,$){j(P,function(){X.apply(this,arguments)},$)},count:function(P){var X=0;return j(P,function(){X++}),X},toArray:function(P){return j(P,function(X){return X})||[]},only:function(P){if(!Z(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return ct.Activity=p,ct.Children=ae,ct.Component=T,ct.Fragment=r,ct.Profiler=s,ct.PureComponent=D,ct.StrictMode=i,ct.Suspense=m,ct.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,ct.__COMPILER_RUNTIME={__proto__:null,c:function(P){return O.H.useMemoCache(P)}},ct.cache=function(P){return function(){return P.apply(null,arguments)}},ct.cacheSignal=function(){return null},ct.cloneElement=function(P,X,$){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var F=x({},P.props),te=P.key;if(X!=null)for(ue in X.key!==void 0&&(te=""+X.key),X)!L.call(X,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&X.ref===void 0||(F[ue]=X[ue]);var ue=arguments.length-2;if(ue===1)F.children=$;else if(1<ue){for(var he=Array(ue),we=0;we<ue;we++)he[we]=arguments[we+2];F.children=he}return G(P.type,te,F)},ct.createContext=function(P){return P={$$typeof:u,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:l,_context:P},P},ct.createElement=function(P,X,$){var F,te={},ue=null;if(X!=null)for(F in X.key!==void 0&&(ue=""+X.key),X)L.call(X,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(te[F]=X[F]);var he=arguments.length-2;if(he===1)te.children=$;else if(1<he){for(var we=Array(he),ve=0;ve<he;ve++)we[ve]=arguments[ve+2];te.children=we}if(P&&P.defaultProps)for(F in he=P.defaultProps,he)te[F]===void 0&&(te[F]=he[F]);return G(P,ue,te)},ct.createRef=function(){return{current:null}},ct.forwardRef=function(P){return{$$typeof:d,render:P}},ct.isValidElement=Z,ct.lazy=function(P){return{$$typeof:y,_payload:{_status:-1,_result:P},_init:U}},ct.memo=function(P,X){return{$$typeof:f,type:P,compare:X===void 0?null:X}},ct.startTransition=function(P){var X=O.T,$={};O.T=$;try{var F=P(),te=O.S;te!==null&&te($,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(k,ie)}catch(ue){ie(ue)}finally{X!==null&&$.types!==null&&(X.types=$.types),O.T=X}},ct.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},ct.use=function(P){return O.H.use(P)},ct.useActionState=function(P,X,$){return O.H.useActionState(P,X,$)},ct.useCallback=function(P,X){return O.H.useCallback(P,X)},ct.useContext=function(P){return O.H.useContext(P)},ct.useDebugValue=function(){},ct.useDeferredValue=function(P,X){return O.H.useDeferredValue(P,X)},ct.useEffect=function(P,X){return O.H.useEffect(P,X)},ct.useEffectEvent=function(P){return O.H.useEffectEvent(P)},ct.useId=function(){return O.H.useId()},ct.useImperativeHandle=function(P,X,$){return O.H.useImperativeHandle(P,X,$)},ct.useInsertionEffect=function(P,X){return O.H.useInsertionEffect(P,X)},ct.useLayoutEffect=function(P,X){return O.H.useLayoutEffect(P,X)},ct.useMemo=function(P,X){return O.H.useMemo(P,X)},ct.useOptimistic=function(P,X){return O.H.useOptimistic(P,X)},ct.useReducer=function(P,X,$){return O.H.useReducer(P,X,$)},ct.useRef=function(P){return O.H.useRef(P)},ct.useState=function(P){return O.H.useState(P)},ct.useSyncExternalStore=function(P,X,$){return O.H.useSyncExternalStore(P,X,$)},ct.useTransition=function(){return O.H.useTransition()},ct.version="19.2.4",ct}var uw;function Dc(){return uw||(uw=1,Mm.exports=kO()),Mm.exports}var w=Dc();const Oe=_x(w),dg=rO({__proto__:null,default:Oe},[w]);var Vx=w.createContext(void 0),_O=e=>{const t=w.useContext(Vx);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},LO=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),I.jsx(Vx.Provider,{value:e,children:t})),Yx=w.createContext(!1),zO=()=>w.useContext(Yx);Yx.Provider;function PO(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var IO=w.createContext(PO()),UO=()=>w.useContext(IO),jO=(e,t,r)=>{const i=r!=null&&r.state.error&&typeof e.throwOnError=="function"?Ix(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},HO=e=>{w.useEffect(()=>{e.clearReset()},[e])},BO=({result:e,errorResetBoundary:t,throwOnError:r,query:i,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(s&&e.data===void 0||Ix(r,[e.error,i])),FO=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...s)=>r(i(...s)):r(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},VO=(e,t)=>e.isLoading&&e.isFetching&&!t,YO=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,dw=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function qO(e,t,r){var v,b,S,x;const i=zO(),s=UO(),l=_O(),u=l.defaultQueryOptions(e);(b=(v=l.getDefaultOptions().queries)==null?void 0:v._experimental_beforeQuery)==null||b.call(v,u);const d=l.getQueryCache().get(u.queryHash);u._optimisticResults=i?"isRestoring":"optimistic",FO(u),jO(u,s,d),HO(s);const m=!l.getQueryCache().get(u.queryHash),[f]=w.useState(()=>new t(l,u)),y=f.getOptimisticResult(u),p=!i&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(R=>{const T=p?f.subscribe(Hn.batchCalls(R)):mr;return f.updateResult(),T},[f,p]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),w.useEffect(()=>{f.setOptions(u)},[u,f]),YO(u,y))throw dw(u,f,s);if(BO({result:y,errorResetBoundary:s,throwOnError:u.throwOnError,query:d,suspense:u.suspense}))throw y.error;if((x=(S=l.getDefaultOptions().queries)==null?void 0:S._experimental_afterQuery)==null||x.call(S,u,y),u.experimental_prefetchInRender&&!Ao&&VO(y,i)){const R=m?dw(u,f,s):d==null?void 0:d.promise;R==null||R.catch(mr).finally(()=>{f.updateResult()})}return u.notifyOnChangeProps?y:f.trackResult(y)}function GO(e,t){return qO(e,EO)}var Dm={exports:{}},Gl={},Am={exports:{}},Nm={};/**
19
- * @license React
20
- * scheduler.production.js
21
- *
22
- * Copyright (c) Meta Platforms, Inc. and affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- */var fw;function KO(){return fw||(fw=1,(function(e){function t(_,j){var U=_.length;_.push(j);e:for(;0<U;){var ie=U-1>>>1,ae=_[ie];if(0<s(ae,j))_[ie]=j,_[U]=ae,U=ie;else break e}}function r(_){return _.length===0?null:_[0]}function i(_){if(_.length===0)return null;var j=_[0],U=_.pop();if(U!==j){_[0]=U;e:for(var ie=0,ae=_.length,P=ae>>>1;ie<P;){var X=2*(ie+1)-1,$=_[X],F=X+1,te=_[F];if(0>s($,U))F<ae&&0>s(te,$)?(_[ie]=te,_[F]=U,ie=F):(_[ie]=$,_[X]=U,ie=X);else if(F<ae&&0>s(te,U))_[ie]=te,_[F]=U,ie=F;else break e}}return j}function s(_,j){var U=_.sortIndex-j.sortIndex;return U!==0?U:_.id-j.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var m=[],f=[],y=1,p=null,v=3,b=!1,S=!1,x=!1,R=!1,T=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function C(_){for(var j=r(f);j!==null;){if(j.callback===null)i(f);else if(j.startTime<=_)i(f),j.sortIndex=j.expirationTime,t(m,j);else break;j=r(f)}}function N(_){if(x=!1,C(_),!S)if(r(m)!==null)S=!0,k||(k=!0,z());else{var j=r(f);j!==null&&q(N,j.startTime-_)}}var k=!1,O=-1,L=5,G=-1;function J(){return R?!0:!(e.unstable_now()-G<L)}function Z(){if(R=!1,k){var _=e.unstable_now();G=_;var j=!0;try{e:{S=!1,x&&(x=!1,M(O),O=-1),b=!0;var U=v;try{t:{for(C(_),p=r(m);p!==null&&!(p.expirationTime>_&&J());){var ie=p.callback;if(typeof ie=="function"){p.callback=null,v=p.priorityLevel;var ae=ie(p.expirationTime<=_);if(_=e.unstable_now(),typeof ae=="function"){p.callback=ae,C(_),j=!0;break t}p===r(m)&&i(m),C(_)}else i(m);p=r(m)}if(p!==null)j=!0;else{var P=r(f);P!==null&&q(N,P.startTime-_),j=!1}}break e}finally{p=null,v=U,b=!1}j=void 0}}finally{j?z():k=!1}}}var z;if(typeof D=="function")z=function(){D(Z)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,V=H.port2;H.port1.onmessage=Z,z=function(){V.postMessage(null)}}else z=function(){T(Z,0)};function q(_,j){O=T(function(){_(e.unstable_now())},j)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(_){_.callback=null},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(_){switch(v){case 1:case 2:case 3:var j=3;break;default:j=v}var U=v;v=j;try{return _()}finally{v=U}},e.unstable_requestPaint=function(){R=!0},e.unstable_runWithPriority=function(_,j){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var U=v;v=_;try{return j()}finally{v=U}},e.unstable_scheduleCallback=function(_,j,U){var ie=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?ie+U:ie):U=ie,_){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=U+ae,_={id:y++,callback:j,priorityLevel:_,startTime:U,expirationTime:ae,sortIndex:-1},U>ie?(_.sortIndex=U,t(f,_),r(m)===null&&_===r(f)&&(x?(M(O),O=-1):x=!0,q(N,U-ie))):(_.sortIndex=ae,t(m,_),S||b||(S=!0,k||(k=!0,z()))),_},e.unstable_shouldYield=J,e.unstable_wrapCallback=function(_){var j=v;return function(){var U=v;v=j;try{return _.apply(this,arguments)}finally{v=U}}}})(Nm)),Nm}var hw;function XO(){return hw||(hw=1,Am.exports=KO()),Am.exports}var km={exports:{}},Bn={};/**
27
- * @license React
28
- * react-dom.production.js
29
- *
30
- * Copyright (c) Meta Platforms, Inc. and affiliates.
31
- *
32
- * This source code is licensed under the MIT license found in the
33
- * LICENSE file in the root directory of this source tree.
34
- */var mw;function WO(){if(mw)return Bn;mw=1;var e=Dc();function t(m){var f="https://react.dev/errors/"+m;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)f+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+m+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var i={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal");function l(m,f,y){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:m,containerInfo:f,implementation:y}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,f){if(m==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Bn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Bn.createPortal=function(m,f){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return l(m,f,null,y)},Bn.flushSync=function(m){var f=u.T,y=i.p;try{if(u.T=null,i.p=2,m)return m()}finally{u.T=f,i.p=y,i.d.f()}},Bn.preconnect=function(m,f){typeof m=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,i.d.C(m,f))},Bn.prefetchDNS=function(m){typeof m=="string"&&i.d.D(m)},Bn.preinit=function(m,f){if(typeof m=="string"&&f&&typeof f.as=="string"){var y=f.as,p=d(y,f.crossOrigin),v=typeof f.integrity=="string"?f.integrity:void 0,b=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;y==="style"?i.d.S(m,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:p,integrity:v,fetchPriority:b}):y==="script"&&i.d.X(m,{crossOrigin:p,integrity:v,fetchPriority:b,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Bn.preinitModule=function(m,f){if(typeof m=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var y=d(f.as,f.crossOrigin);i.d.M(m,{crossOrigin:y,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&i.d.M(m)},Bn.preload=function(m,f){if(typeof m=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var y=f.as,p=d(y,f.crossOrigin);i.d.L(m,y,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Bn.preloadModule=function(m,f){if(typeof m=="string")if(f){var y=d(f.as,f.crossOrigin);i.d.m(m,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:y,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else i.d.m(m)},Bn.requestFormReset=function(m){i.d.r(m)},Bn.unstable_batchedUpdates=function(m,f){return m(f)},Bn.useFormState=function(m,f,y){return u.H.useFormState(m,f,y)},Bn.useFormStatus=function(){return u.H.useHostTransitionStatus()},Bn.version="19.2.4",Bn}var pw;function qx(){if(pw)return km.exports;pw=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),km.exports=WO(),km.exports}/**
35
- * @license React
36
- * react-dom-client.production.js
37
- *
38
- * Copyright (c) Meta Platforms, Inc. and affiliates.
39
- *
40
- * This source code is licensed under the MIT license found in the
41
- * LICENSE file in the root directory of this source tree.
42
- */var gw;function $O(){if(gw)return Gl;gw=1;var e=XO(),t=Dc(),r=qx();function i(n){var a="https://react.dev/errors/"+n;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)a+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+n+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function l(n){var a=n,o=n;if(n.alternate)for(;a.return;)a=a.return;else{n=a;do a=n,(a.flags&4098)!==0&&(o=a.return),n=a.return;while(n)}return a.tag===3?o:null}function u(n){if(n.tag===13){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}function d(n){if(n.tag===31){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}function m(n){if(l(n)!==n)throw Error(i(188))}function f(n){var a=n.alternate;if(!a){if(a=l(n),a===null)throw Error(i(188));return a!==n?null:n}for(var o=n,c=a;;){var h=o.return;if(h===null)break;var g=h.alternate;if(g===null){if(c=h.return,c!==null){o=c;continue}break}if(h.child===g.child){for(g=h.child;g;){if(g===o)return m(h),n;if(g===c)return m(h),a;g=g.sibling}throw Error(i(188))}if(o.return!==c.return)o=h,c=g;else{for(var E=!1,A=h.child;A;){if(A===o){E=!0,o=h,c=g;break}if(A===c){E=!0,c=h,o=g;break}A=A.sibling}if(!E){for(A=g.child;A;){if(A===o){E=!0,o=g,c=h;break}if(A===c){E=!0,c=g,o=h;break}A=A.sibling}if(!E)throw Error(i(189))}}if(o.alternate!==c)throw Error(i(190))}if(o.tag!==3)throw Error(i(188));return o.stateNode.current===o?n:a}function y(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n;for(n=n.child;n!==null;){if(a=y(n),a!==null)return a;n=n.sibling}return null}var p=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),D=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),J=Symbol.for("react.memo_cache_sentinel"),Z=Symbol.iterator;function z(n){return n===null||typeof n!="object"?null:(n=Z&&n[Z]||n["@@iterator"],typeof n=="function"?n:null)}var H=Symbol.for("react.client.reference");function V(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===H?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case x:return"Fragment";case T:return"Profiler";case R:return"StrictMode";case N:return"Suspense";case k:return"SuspenseList";case G:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case S:return"Portal";case D:return n.displayName||"Context";case M:return(n._context.displayName||"Context")+".Consumer";case C:var a=n.render;return n=n.displayName,n||(n=a.displayName||a.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case O:return a=n.displayName||null,a!==null?a:V(n.type)||"Memo";case L:a=n._payload,n=n._init;try{return V(n(a))}catch{}}return null}var q=Array.isArray,_=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},ie=[],ae=-1;function P(n){return{current:n}}function X(n){0>ae||(n.current=ie[ae],ie[ae]=null,ae--)}function $(n,a){ae++,ie[ae]=n.current,n.current=a}var F=P(null),te=P(null),ue=P(null),he=P(null);function we(n,a){switch($(ue,a),$(te,n),$(F,null),a.nodeType){case 9:case 11:n=(n=a.documentElement)&&(n=n.namespaceURI)?v0(n):0;break;default:if(n=a.tagName,a=a.namespaceURI)a=v0(a),n=b0(a,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}X(F),$(F,n)}function ve(){X(F),X(te),X(ue)}function ke(n){n.memoizedState!==null&&$(he,n);var a=F.current,o=b0(a,n.type);a!==o&&($(te,n),$(F,o))}function Xe(n){te.current===n&&(X(F),X(te)),he.current===n&&(X(he),Bl._currentValue=U)}var ne,fe;function Se(n){if(ne===void 0)try{throw Error()}catch(o){var a=o.stack.trim().match(/\n( *(at )?)/);ne=a&&a[1]||"",fe=-1<o.stack.indexOf(`
43
- at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+ne+n+fe}var Ne=!1;function Te(n,a){if(!n||Ne)return"";Ne=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(a){var ye=function(){throw Error()};if(Object.defineProperty(ye.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ye,[])}catch(de){var ce=de}Reflect.construct(n,[],ye)}else{try{ye.call()}catch(de){ce=de}n.call(ye.prototype)}}else{try{throw Error()}catch(de){ce=de}(ye=n())&&typeof ye.catch=="function"&&ye.catch(function(){})}}catch(de){if(de&&ce&&typeof de.stack=="string")return[de.stack,ce.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=c.DetermineComponentFrameRoot(),E=g[0],A=g[1];if(E&&A){var Y=E.split(`
45
- `),se=A.split(`
46
- `);for(h=c=0;c<Y.length&&!Y[c].includes("DetermineComponentFrameRoot");)c++;for(;h<se.length&&!se[h].includes("DetermineComponentFrameRoot");)h++;if(c===Y.length||h===se.length)for(c=Y.length-1,h=se.length-1;1<=c&&0<=h&&Y[c]!==se[h];)h--;for(;1<=c&&0<=h;c--,h--)if(Y[c]!==se[h]){if(c!==1||h!==1)do if(c--,h--,0>h||Y[c]!==se[h]){var me=`
47
- `+Y[c].replace(" at new "," at ");return n.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",n.displayName)),me}while(1<=c&&0<=h);break}}}finally{Ne=!1,Error.prepareStackTrace=o}return(o=n?n.displayName||n.name:"")?Se(o):""}function Ee(n,a){switch(n.tag){case 26:case 27:case 5:return Se(n.type);case 16:return Se("Lazy");case 13:return n.child!==a&&a!==null?Se("Suspense Fallback"):Se("Suspense");case 19:return Se("SuspenseList");case 0:case 15:return Te(n.type,!1);case 11:return Te(n.type.render,!1);case 1:return Te(n.type,!0);case 31:return Se("Activity");default:return""}}function Re(n){try{var a="",o=null;do a+=Ee(n,o),o=n,n=n.return;while(n);return a}catch(c){return`
48
- Error generating stack: `+c.message+`
49
- `+c.stack}}var pe=Object.prototype.hasOwnProperty,De=e.unstable_scheduleCallback,xe=e.unstable_cancelCallback,qe=e.unstable_shouldYield,Ge=e.unstable_requestPaint,Le=e.unstable_now,ot=e.unstable_getCurrentPriorityLevel,Pt=e.unstable_ImmediatePriority,Ft=e.unstable_UserBlockingPriority,tt=e.unstable_NormalPriority,ft=e.unstable_LowPriority,Ct=e.unstable_IdlePriority,sn=e.log,ln=e.unstable_setDisableYieldValue,On=null,Pe=null;function st(n){if(typeof sn=="function"&&ln(n),Pe&&typeof Pe.setStrictMode=="function")try{Pe.setStrictMode(On,n)}catch{}}var gt=Math.clz32?Math.clz32:lt,Kn=Math.log,rn=Math.LN2;function lt(n){return n>>>=0,n===0?32:31-(Kn(n)/rn|0)|0}var wt=256,et=262144,vt=4194304;function Ht(n){var a=n&42;if(a!==0)return a;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Ke(n,a,o){var c=n.pendingLanes;if(c===0)return 0;var h=0,g=n.suspendedLanes,E=n.pingedLanes;n=n.warmLanes;var A=c&134217727;return A!==0?(c=A&~g,c!==0?h=Ht(c):(E&=A,E!==0?h=Ht(E):o||(o=A&~n,o!==0&&(h=Ht(o))))):(A=c&~g,A!==0?h=Ht(A):E!==0?h=Ht(E):o||(o=c&~n,o!==0&&(h=Ht(o)))),h===0?0:a!==0&&a!==h&&(a&g)===0&&(g=h&-h,o=a&-a,g>=o||g===32&&(o&4194048)!==0)?a:h}function It(n,a){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&a)===0}function Zt(n,a){switch(n){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qt(){var n=vt;return vt<<=1,(vt&62914560)===0&&(vt=4194304),n}function Xn(n){for(var a=[],o=0;31>o;o++)a.push(n);return a}function Gt(n,a){n.pendingLanes|=a,a!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Mn(n,a,o,c,h,g){var E=n.pendingLanes;n.pendingLanes=o,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=o,n.entangledLanes&=o,n.errorRecoveryDisabledLanes&=o,n.shellSuspendCounter=0;var A=n.entanglements,Y=n.expirationTimes,se=n.hiddenUpdates;for(o=E&~o;0<o;){var me=31-gt(o),ye=1<<me;A[me]=0,Y[me]=-1;var ce=se[me];if(ce!==null)for(se[me]=null,me=0;me<ce.length;me++){var de=ce[me];de!==null&&(de.lane&=-536870913)}o&=~ye}c!==0&&Kr(n,c,0),g!==0&&h===0&&n.tag!==0&&(n.suspendedLanes|=g&~(E&~a))}function Kr(n,a,o){n.pendingLanes|=a,n.suspendedLanes&=~a;var c=31-gt(a);n.entangledLanes|=a,n.entanglements[c]=n.entanglements[c]|1073741824|o&261930}function B(n,a){var o=n.entangledLanes|=a;for(n=n.entanglements;o;){var c=31-gt(o),h=1<<c;h&a|n[c]&a&&(n[c]|=a),o&=~h}}function Q(n,a){var o=a&-a;return o=(o&42)!==0?1:le(o),(o&(n.suspendedLanes|a))!==0?0:o}function le(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function be(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Ce(){var n=j.p;return n!==0?n:(n=window.event,n===void 0?32:F0(n.type))}function We(n,a){var o=j.p;try{return j.p=n,a()}finally{j.p=o}}var He=Math.random().toString(36).slice(2),Me="__reactFiber$"+He,Ae="__reactProps$"+He,Ue="__reactContainer$"+He,at="__reactEvents$"+He,Qe="__reactListeners$"+He,ut="__reactHandles$"+He,St="__reactResources$"+He,an="__reactMarker$"+He;function cn(n){delete n[Me],delete n[Ae],delete n[at],delete n[Qe],delete n[ut]}function un(n){var a=n[Me];if(a)return a;for(var o=n.parentNode;o;){if(a=o[Ue]||o[Me]){if(o=a.alternate,a.child!==null||o!==null&&o.child!==null)for(n=C0(n);n!==null;){if(o=n[Me])return o;n=C0(n)}return a}n=o,o=n.parentNode}return null}function Ot(n){if(n=n[Me]||n[Ue]){var a=n.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return n}return null}function Dn(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n.stateNode;throw Error(i(33))}function ir(n){var a=n[St];return a||(a=n[St]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function tn(n){n[an]=!0}var Xr=new Set,yr={};function Wr(n,a){Dr(n,a),Dr(n+"Capture",a)}function Dr(n,a){for(yr[n]=a,n=0;n<a.length;n++)Xr.add(a[n])}var Ra=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ki={},Xi={};function Mt(n){return pe.call(Xi,n)?!0:pe.call(Ki,n)?!1:Ra.test(n)?Xi[n]=!0:(Ki[n]=!0,!1)}function pn(n,a,o){if(Mt(a))if(o===null)n.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":n.removeAttribute(a);return;case"boolean":var c=a.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){n.removeAttribute(a);return}}n.setAttribute(a,""+o)}}function $r(n,a,o){if(o===null)n.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(a);return}n.setAttribute(a,""+o)}}function zn(n,a,o,c){if(c===null)n.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(o);return}n.setAttributeNS(a,o,""+c)}}function Dt(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Wi(n){var a=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Yc(n,a,o){var c=Object.getOwnPropertyDescriptor(n.constructor.prototype,a);if(!n.hasOwnProperty(a)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var h=c.get,g=c.set;return Object.defineProperty(n,a,{configurable:!0,get:function(){return h.call(this)},set:function(E){o=""+E,g.call(this,E)}}),Object.defineProperty(n,a,{enumerable:c.enumerable}),{getValue:function(){return o},setValue:function(E){o=""+E},stopTracking:function(){n._valueTracker=null,delete n[a]}}}}function rl(n){if(!n._valueTracker){var a=Wi(n)?"checked":"value";n._valueTracker=Yc(n,a,""+n[a])}}function dy(n){if(!n)return!1;var a=n._valueTracker;if(!a)return!0;var o=a.getValue(),c="";return n&&(c=Wi(n)?n.checked?"true":"false":n.value),n=c,n!==o?(a.setValue(n),!0):!1}function qc(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var WR=/[\n"\\]/g;function Ar(n){return n.replace(WR,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function wf(n,a,o,c,h,g,E,A){n.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?n.type=E:n.removeAttribute("type"),a!=null?E==="number"?(a===0&&n.value===""||n.value!=a)&&(n.value=""+Dt(a)):n.value!==""+Dt(a)&&(n.value=""+Dt(a)):E!=="submit"&&E!=="reset"||n.removeAttribute("value"),a!=null?Sf(n,E,Dt(a)):o!=null?Sf(n,E,Dt(o)):c!=null&&n.removeAttribute("value"),h==null&&g!=null&&(n.defaultChecked=!!g),h!=null&&(n.checked=h&&typeof h!="function"&&typeof h!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?n.name=""+Dt(A):n.removeAttribute("name")}function fy(n,a,o,c,h,g,E,A){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(n.type=g),a!=null||o!=null){if(!(g!=="submit"&&g!=="reset"||a!=null)){rl(n);return}o=o!=null?""+Dt(o):"",a=a!=null?""+Dt(a):o,A||a===n.value||(n.value=a),n.defaultValue=a}c=c??h,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=A?n.checked:!!c,n.defaultChecked=!!c,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(n.name=E),rl(n)}function Sf(n,a,o){a==="number"&&qc(n.ownerDocument)===n||n.defaultValue===""+o||(n.defaultValue=""+o)}function Bo(n,a,o,c){if(n=n.options,a){a={};for(var h=0;h<o.length;h++)a["$"+o[h]]=!0;for(o=0;o<n.length;o++)h=a.hasOwnProperty("$"+n[o].value),n[o].selected!==h&&(n[o].selected=h),h&&c&&(n[o].defaultSelected=!0)}else{for(o=""+Dt(o),a=null,h=0;h<n.length;h++){if(n[h].value===o){n[h].selected=!0,c&&(n[h].defaultSelected=!0);return}a!==null||n[h].disabled||(a=n[h])}a!==null&&(a.selected=!0)}}function hy(n,a,o){if(a!=null&&(a=""+Dt(a),a!==n.value&&(n.value=a),o==null)){n.defaultValue!==a&&(n.defaultValue=a);return}n.defaultValue=o!=null?""+Dt(o):""}function my(n,a,o,c){if(a==null){if(c!=null){if(o!=null)throw Error(i(92));if(q(c)){if(1<c.length)throw Error(i(93));c=c[0]}o=c}o==null&&(o=""),a=o}o=Dt(a),n.defaultValue=o,c=n.textContent,c===o&&c!==""&&c!==null&&(n.value=c),rl(n)}function Fo(n,a){if(a){var o=n.firstChild;if(o&&o===n.lastChild&&o.nodeType===3){o.nodeValue=a;return}}n.textContent=a}var $R=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function py(n,a,o){var c=a.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?c?n.setProperty(a,""):a==="float"?n.cssFloat="":n[a]="":c?n.setProperty(a,o):typeof o!="number"||o===0||$R.has(a)?a==="float"?n.cssFloat=o:n[a]=(""+o).trim():n[a]=o+"px"}function gy(n,a,o){if(a!=null&&typeof a!="object")throw Error(i(62));if(n=n.style,o!=null){for(var c in o)!o.hasOwnProperty(c)||a!=null&&a.hasOwnProperty(c)||(c.indexOf("--")===0?n.setProperty(c,""):c==="float"?n.cssFloat="":n[c]="");for(var h in a)c=a[h],a.hasOwnProperty(h)&&o[h]!==c&&py(n,h,c)}else for(var g in a)a.hasOwnProperty(g)&&py(n,g,a[g])}function xf(n){if(n.indexOf("-")===-1)return!1;switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var QR=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),ZR=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Gc(n){return ZR.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function Ta(){}var Ef=null;function Rf(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Vo=null,Yo=null;function yy(n){var a=Ot(n);if(a&&(n=a.stateNode)){var o=n[Ae]||null;e:switch(n=a.stateNode,a.type){case"input":if(wf(n,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),a=o.name,o.type==="radio"&&a!=null){for(o=n;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Ar(""+a)+'"][type="radio"]'),a=0;a<o.length;a++){var c=o[a];if(c!==n&&c.form===n.form){var h=c[Ae]||null;if(!h)throw Error(i(90));wf(c,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(a=0;a<o.length;a++)c=o[a],c.form===n.form&&dy(c)}break e;case"textarea":hy(n,o.value,o.defaultValue);break e;case"select":a=o.value,a!=null&&Bo(n,!!o.multiple,a,!1)}}}var Tf=!1;function vy(n,a,o){if(Tf)return n(a,o);Tf=!0;try{var c=n(a);return c}finally{if(Tf=!1,(Vo!==null||Yo!==null)&&(_u(),Vo&&(a=Vo,n=Yo,Yo=Vo=null,yy(a),n)))for(a=0;a<n.length;a++)yy(n[a])}}function al(n,a){var o=n.stateNode;if(o===null)return null;var c=o[Ae]||null;if(c===null)return null;o=c[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(n=n.type,c=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!c;break e;default:n=!1}if(n)return null;if(o&&typeof o!="function")throw Error(i(231,a,typeof o));return o}var Ca=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cf=!1;if(Ca)try{var il={};Object.defineProperty(il,"passive",{get:function(){Cf=!0}}),window.addEventListener("test",il,il),window.removeEventListener("test",il,il)}catch{Cf=!1}var Qa=null,Of=null,Kc=null;function by(){if(Kc)return Kc;var n,a=Of,o=a.length,c,h="value"in Qa?Qa.value:Qa.textContent,g=h.length;for(n=0;n<o&&a[n]===h[n];n++);var E=o-n;for(c=1;c<=E&&a[o-c]===h[g-c];c++);return Kc=h.slice(n,1<c?1-c:void 0)}function Xc(n){var a=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&a===13&&(n=13)):n=a,n===10&&(n=13),32<=n||n===13?n:0}function Wc(){return!0}function wy(){return!1}function or(n){function a(o,c,h,g,E){this._reactName=o,this._targetInst=h,this.type=c,this.nativeEvent=g,this.target=E,this.currentTarget=null;for(var A in n)n.hasOwnProperty(A)&&(o=n[A],this[A]=o?o(g):g[A]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Wc:wy,this.isPropagationStopped=wy,this}return p(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Wc)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Wc)},persist:function(){},isPersistent:Wc}),a}var $i={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$c=or($i),ol=p({},$i,{view:0,detail:0}),JR=or(ol),Mf,Df,sl,Qc=p({},ol,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nf,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==sl&&(sl&&n.type==="mousemove"?(Mf=n.screenX-sl.screenX,Df=n.screenY-sl.screenY):Df=Mf=0,sl=n),Mf)},movementY:function(n){return"movementY"in n?n.movementY:Df}}),Sy=or(Qc),eT=p({},Qc,{dataTransfer:0}),tT=or(eT),nT=p({},ol,{relatedTarget:0}),Af=or(nT),rT=p({},$i,{animationName:0,elapsedTime:0,pseudoElement:0}),aT=or(rT),iT=p({},$i,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),oT=or(iT),sT=p({},$i,{data:0}),xy=or(sT),lT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cT={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},uT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dT(n){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(n):(n=uT[n])?!!a[n]:!1}function Nf(){return dT}var fT=p({},ol,{key:function(n){if(n.key){var a=lT[n.key]||n.key;if(a!=="Unidentified")return a}return n.type==="keypress"?(n=Xc(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?cT[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nf,charCode:function(n){return n.type==="keypress"?Xc(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Xc(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),hT=or(fT),mT=p({},Qc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ey=or(mT),pT=p({},ol,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nf}),gT=or(pT),yT=p({},$i,{propertyName:0,elapsedTime:0,pseudoElement:0}),vT=or(yT),bT=p({},Qc,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),wT=or(bT),ST=p({},$i,{newState:0,oldState:0}),xT=or(ST),ET=[9,13,27,32],kf=Ca&&"CompositionEvent"in window,ll=null;Ca&&"documentMode"in document&&(ll=document.documentMode);var RT=Ca&&"TextEvent"in window&&!ll,Ry=Ca&&(!kf||ll&&8<ll&&11>=ll),Ty=" ",Cy=!1;function Oy(n,a){switch(n){case"keyup":return ET.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function My(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var qo=!1;function TT(n,a){switch(n){case"compositionend":return My(a);case"keypress":return a.which!==32?null:(Cy=!0,Ty);case"textInput":return n=a.data,n===Ty&&Cy?null:n;default:return null}}function CT(n,a){if(qo)return n==="compositionend"||!kf&&Oy(n,a)?(n=by(),Kc=Of=Qa=null,qo=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Ry&&a.locale!=="ko"?null:a.data;default:return null}}var OT={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Dy(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a==="input"?!!OT[n.type]:a==="textarea"}function Ay(n,a,o,c){Vo?Yo?Yo.push(c):Yo=[c]:Vo=c,a=Hu(a,"onChange"),0<a.length&&(o=new $c("onChange","change",null,o,c),n.push({event:o,listeners:a}))}var cl=null,ul=null;function MT(n){f0(n,0)}function Zc(n){var a=Dn(n);if(dy(a))return n}function Ny(n,a){if(n==="change")return a}var ky=!1;if(Ca){var _f;if(Ca){var Lf="oninput"in document;if(!Lf){var _y=document.createElement("div");_y.setAttribute("oninput","return;"),Lf=typeof _y.oninput=="function"}_f=Lf}else _f=!1;ky=_f&&(!document.documentMode||9<document.documentMode)}function Ly(){cl&&(cl.detachEvent("onpropertychange",zy),ul=cl=null)}function zy(n){if(n.propertyName==="value"&&Zc(ul)){var a=[];Ay(a,ul,n,Rf(n)),vy(MT,a)}}function DT(n,a,o){n==="focusin"?(Ly(),cl=a,ul=o,cl.attachEvent("onpropertychange",zy)):n==="focusout"&&Ly()}function AT(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Zc(ul)}function NT(n,a){if(n==="click")return Zc(a)}function kT(n,a){if(n==="input"||n==="change")return Zc(a)}function _T(n,a){return n===a&&(n!==0||1/n===1/a)||n!==n&&a!==a}var vr=typeof Object.is=="function"?Object.is:_T;function dl(n,a){if(vr(n,a))return!0;if(typeof n!="object"||n===null||typeof a!="object"||a===null)return!1;var o=Object.keys(n),c=Object.keys(a);if(o.length!==c.length)return!1;for(c=0;c<o.length;c++){var h=o[c];if(!pe.call(a,h)||!vr(n[h],a[h]))return!1}return!0}function Py(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Iy(n,a){var o=Py(n);n=0;for(var c;o;){if(o.nodeType===3){if(c=n+o.textContent.length,n<=a&&c>=a)return{node:o,offset:a-n};n=c}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Py(o)}}function Uy(n,a){return n&&a?n===a?!0:n&&n.nodeType===3?!1:a&&a.nodeType===3?Uy(n,a.parentNode):"contains"in n?n.contains(a):n.compareDocumentPosition?!!(n.compareDocumentPosition(a)&16):!1:!1}function jy(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var a=qc(n.document);a instanceof n.HTMLIFrameElement;){try{var o=typeof a.contentWindow.location.href=="string"}catch{o=!1}if(o)n=a.contentWindow;else break;a=qc(n.document)}return a}function zf(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a&&(a==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||a==="textarea"||n.contentEditable==="true")}var LT=Ca&&"documentMode"in document&&11>=document.documentMode,Go=null,Pf=null,fl=null,If=!1;function Hy(n,a,o){var c=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;If||Go==null||Go!==qc(c)||(c=Go,"selectionStart"in c&&zf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),fl&&dl(fl,c)||(fl=c,c=Hu(Pf,"onSelect"),0<c.length&&(a=new $c("onSelect","select",null,a,o),n.push({event:a,listeners:c}),a.target=Go)))}function Qi(n,a){var o={};return o[n.toLowerCase()]=a.toLowerCase(),o["Webkit"+n]="webkit"+a,o["Moz"+n]="moz"+a,o}var Ko={animationend:Qi("Animation","AnimationEnd"),animationiteration:Qi("Animation","AnimationIteration"),animationstart:Qi("Animation","AnimationStart"),transitionrun:Qi("Transition","TransitionRun"),transitionstart:Qi("Transition","TransitionStart"),transitioncancel:Qi("Transition","TransitionCancel"),transitionend:Qi("Transition","TransitionEnd")},Uf={},By={};Ca&&(By=document.createElement("div").style,"AnimationEvent"in window||(delete Ko.animationend.animation,delete Ko.animationiteration.animation,delete Ko.animationstart.animation),"TransitionEvent"in window||delete Ko.transitionend.transition);function Zi(n){if(Uf[n])return Uf[n];if(!Ko[n])return n;var a=Ko[n],o;for(o in a)if(a.hasOwnProperty(o)&&o in By)return Uf[n]=a[o];return n}var Fy=Zi("animationend"),Vy=Zi("animationiteration"),Yy=Zi("animationstart"),zT=Zi("transitionrun"),PT=Zi("transitionstart"),IT=Zi("transitioncancel"),qy=Zi("transitionend"),Gy=new Map,jf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");jf.push("scrollEnd");function Qr(n,a){Gy.set(n,a),Wr(a,[n])}var Jc=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Nr=[],Xo=0,Hf=0;function eu(){for(var n=Xo,a=Hf=Xo=0;a<n;){var o=Nr[a];Nr[a++]=null;var c=Nr[a];Nr[a++]=null;var h=Nr[a];Nr[a++]=null;var g=Nr[a];if(Nr[a++]=null,c!==null&&h!==null){var E=c.pending;E===null?h.next=h:(h.next=E.next,E.next=h),c.pending=h}g!==0&&Ky(o,h,g)}}function tu(n,a,o,c){Nr[Xo++]=n,Nr[Xo++]=a,Nr[Xo++]=o,Nr[Xo++]=c,Hf|=c,n.lanes|=c,n=n.alternate,n!==null&&(n.lanes|=c)}function Bf(n,a,o,c){return tu(n,a,o,c),nu(n)}function Ji(n,a){return tu(n,null,null,a),nu(n)}function Ky(n,a,o){n.lanes|=o;var c=n.alternate;c!==null&&(c.lanes|=o);for(var h=!1,g=n.return;g!==null;)g.childLanes|=o,c=g.alternate,c!==null&&(c.childLanes|=o),g.tag===22&&(n=g.stateNode,n===null||n._visibility&1||(h=!0)),n=g,g=g.return;return n.tag===3?(g=n.stateNode,h&&a!==null&&(h=31-gt(o),n=g.hiddenUpdates,c=n[h],c===null?n[h]=[a]:c.push(a),a.lane=o|536870912),g):null}function nu(n){if(50<Ll)throw Ll=0,$h=null,Error(i(185));for(var a=n.return;a!==null;)n=a,a=n.return;return n.tag===3?n.stateNode:null}var Wo={};function UT(n,a,o,c){this.tag=n,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function br(n,a,o,c){return new UT(n,a,o,c)}function Ff(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Oa(n,a){var o=n.alternate;return o===null?(o=br(n.tag,a,n.key,n.mode),o.elementType=n.elementType,o.type=n.type,o.stateNode=n.stateNode,o.alternate=n,n.alternate=o):(o.pendingProps=a,o.type=n.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=n.flags&65011712,o.childLanes=n.childLanes,o.lanes=n.lanes,o.child=n.child,o.memoizedProps=n.memoizedProps,o.memoizedState=n.memoizedState,o.updateQueue=n.updateQueue,a=n.dependencies,o.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},o.sibling=n.sibling,o.index=n.index,o.ref=n.ref,o.refCleanup=n.refCleanup,o}function Xy(n,a){n.flags&=65011714;var o=n.alternate;return o===null?(n.childLanes=0,n.lanes=a,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=o.childLanes,n.lanes=o.lanes,n.child=o.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=o.memoizedProps,n.memoizedState=o.memoizedState,n.updateQueue=o.updateQueue,n.type=o.type,a=o.dependencies,n.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),n}function ru(n,a,o,c,h,g){var E=0;if(c=n,typeof n=="function")Ff(n)&&(E=1);else if(typeof n=="string")E=VC(n,o,F.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case G:return n=br(31,o,a,h),n.elementType=G,n.lanes=g,n;case x:return eo(o.children,h,g,a);case R:E=8,h|=24;break;case T:return n=br(12,o,a,h|2),n.elementType=T,n.lanes=g,n;case N:return n=br(13,o,a,h),n.elementType=N,n.lanes=g,n;case k:return n=br(19,o,a,h),n.elementType=k,n.lanes=g,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case D:E=10;break e;case M:E=9;break e;case C:E=11;break e;case O:E=14;break e;case L:E=16,c=null;break e}E=29,o=Error(i(130,n===null?"null":typeof n,"")),c=null}return a=br(E,o,a,h),a.elementType=n,a.type=c,a.lanes=g,a}function eo(n,a,o,c){return n=br(7,n,c,a),n.lanes=o,n}function Vf(n,a,o){return n=br(6,n,null,a),n.lanes=o,n}function Wy(n){var a=br(18,null,null,0);return a.stateNode=n,a}function Yf(n,a,o){return a=br(4,n.children!==null?n.children:[],n.key,a),a.lanes=o,a.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},a}var $y=new WeakMap;function kr(n,a){if(typeof n=="object"&&n!==null){var o=$y.get(n);return o!==void 0?o:(a={value:n,source:a,stack:Re(a)},$y.set(n,a),a)}return{value:n,source:a,stack:Re(a)}}var $o=[],Qo=0,au=null,hl=0,_r=[],Lr=0,Za=null,ia=1,oa="";function Ma(n,a){$o[Qo++]=hl,$o[Qo++]=au,au=n,hl=a}function Qy(n,a,o){_r[Lr++]=ia,_r[Lr++]=oa,_r[Lr++]=Za,Za=n;var c=ia;n=oa;var h=32-gt(c)-1;c&=~(1<<h),o+=1;var g=32-gt(a)+h;if(30<g){var E=h-h%5;g=(c&(1<<E)-1).toString(32),c>>=E,h-=E,ia=1<<32-gt(a)+h|o<<h|c,oa=g+n}else ia=1<<g|o<<h|c,oa=n}function qf(n){n.return!==null&&(Ma(n,1),Qy(n,1,0))}function Gf(n){for(;n===au;)au=$o[--Qo],$o[Qo]=null,hl=$o[--Qo],$o[Qo]=null;for(;n===Za;)Za=_r[--Lr],_r[Lr]=null,oa=_r[--Lr],_r[Lr]=null,ia=_r[--Lr],_r[Lr]=null}function Zy(n,a){_r[Lr++]=ia,_r[Lr++]=oa,_r[Lr++]=Za,ia=a.id,oa=a.overflow,Za=n}var Pn=null,Jt=null,At=!1,Ja=null,zr=!1,Kf=Error(i(519));function ei(n){var a=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ml(kr(a,n)),Kf}function Jy(n){var a=n.stateNode,o=n.type,c=n.memoizedProps;switch(a[Me]=n,a[Ae]=c,o){case"dialog":Et("cancel",a),Et("close",a);break;case"iframe":case"object":case"embed":Et("load",a);break;case"video":case"audio":for(o=0;o<Pl.length;o++)Et(Pl[o],a);break;case"source":Et("error",a);break;case"img":case"image":case"link":Et("error",a),Et("load",a);break;case"details":Et("toggle",a);break;case"input":Et("invalid",a),fy(a,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Et("invalid",a);break;case"textarea":Et("invalid",a),my(a,c.value,c.defaultValue,c.children)}o=c.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||a.textContent===""+o||c.suppressHydrationWarning===!0||g0(a.textContent,o)?(c.popover!=null&&(Et("beforetoggle",a),Et("toggle",a)),c.onScroll!=null&&Et("scroll",a),c.onScrollEnd!=null&&Et("scrollend",a),c.onClick!=null&&(a.onclick=Ta),a=!0):a=!1,a||ei(n,!0)}function ev(n){for(Pn=n.return;Pn;)switch(Pn.tag){case 5:case 31:case 13:zr=!1;return;case 27:case 3:zr=!0;return;default:Pn=Pn.return}}function Zo(n){if(n!==Pn)return!1;if(!At)return ev(n),At=!0,!1;var a=n.tag,o;if((o=a!==3&&a!==27)&&((o=a===5)&&(o=n.type,o=!(o!=="form"&&o!=="button")||dm(n.type,n.memoizedProps)),o=!o),o&&Jt&&ei(n),ev(n),a===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));Jt=T0(n)}else if(a===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));Jt=T0(n)}else a===27?(a=Jt,mi(n.type)?(n=gm,gm=null,Jt=n):Jt=a):Jt=Pn?Ir(n.stateNode.nextSibling):null;return!0}function to(){Jt=Pn=null,At=!1}function Xf(){var n=Ja;return n!==null&&(ur===null?ur=n:ur.push.apply(ur,n),Ja=null),n}function ml(n){Ja===null?Ja=[n]:Ja.push(n)}var Wf=P(null),no=null,Da=null;function ti(n,a,o){$(Wf,a._currentValue),a._currentValue=o}function Aa(n){n._currentValue=Wf.current,X(Wf)}function $f(n,a,o){for(;n!==null;){var c=n.alternate;if((n.childLanes&a)!==a?(n.childLanes|=a,c!==null&&(c.childLanes|=a)):c!==null&&(c.childLanes&a)!==a&&(c.childLanes|=a),n===o)break;n=n.return}}function Qf(n,a,o,c){var h=n.child;for(h!==null&&(h.return=n);h!==null;){var g=h.dependencies;if(g!==null){var E=h.child;g=g.firstContext;e:for(;g!==null;){var A=g;g=h;for(var Y=0;Y<a.length;Y++)if(A.context===a[Y]){g.lanes|=o,A=g.alternate,A!==null&&(A.lanes|=o),$f(g.return,o,n),c||(E=null);break e}g=A.next}}else if(h.tag===18){if(E=h.return,E===null)throw Error(i(341));E.lanes|=o,g=E.alternate,g!==null&&(g.lanes|=o),$f(E,o,n),E=null}else E=h.child;if(E!==null)E.return=h;else for(E=h;E!==null;){if(E===n){E=null;break}if(h=E.sibling,h!==null){h.return=E.return,E=h;break}E=E.return}h=E}}function Jo(n,a,o,c){n=null;for(var h=a,g=!1;h!==null;){if(!g){if((h.flags&524288)!==0)g=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var E=h.alternate;if(E===null)throw Error(i(387));if(E=E.memoizedProps,E!==null){var A=h.type;vr(h.pendingProps.value,E.value)||(n!==null?n.push(A):n=[A])}}else if(h===he.current){if(E=h.alternate,E===null)throw Error(i(387));E.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(n!==null?n.push(Bl):n=[Bl])}h=h.return}n!==null&&Qf(a,n,o,c),a.flags|=262144}function iu(n){for(n=n.firstContext;n!==null;){if(!vr(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function ro(n){no=n,Da=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function In(n){return tv(no,n)}function ou(n,a){return no===null&&ro(n),tv(n,a)}function tv(n,a){var o=a._currentValue;if(a={context:a,memoizedValue:o,next:null},Da===null){if(n===null)throw Error(i(308));Da=a,n.dependencies={lanes:0,firstContext:a},n.flags|=524288}else Da=Da.next=a;return o}var jT=typeof AbortController<"u"?AbortController:function(){var n=[],a=this.signal={aborted:!1,addEventListener:function(o,c){n.push(c)}};this.abort=function(){a.aborted=!0,n.forEach(function(o){return o()})}},HT=e.unstable_scheduleCallback,BT=e.unstable_NormalPriority,vn={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Zf(){return{controller:new jT,data:new Map,refCount:0}}function pl(n){n.refCount--,n.refCount===0&&HT(BT,function(){n.controller.abort()})}var gl=null,Jf=0,es=0,ts=null;function FT(n,a){if(gl===null){var o=gl=[];Jf=0,es=nm(),ts={status:"pending",value:void 0,then:function(c){o.push(c)}}}return Jf++,a.then(nv,nv),a}function nv(){if(--Jf===0&&gl!==null){ts!==null&&(ts.status="fulfilled");var n=gl;gl=null,es=0,ts=null;for(var a=0;a<n.length;a++)(0,n[a])()}}function VT(n,a){var o=[],c={status:"pending",value:null,reason:null,then:function(h){o.push(h)}};return n.then(function(){c.status="fulfilled",c.value=a;for(var h=0;h<o.length;h++)(0,o[h])(a)},function(h){for(c.status="rejected",c.reason=h,h=0;h<o.length;h++)(0,o[h])(void 0)}),c}var rv=_.S;_.S=function(n,a){Hb=Le(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&FT(n,a),rv!==null&&rv(n,a)};var ao=P(null);function eh(){var n=ao.current;return n!==null?n:$t.pooledCache}function su(n,a){a===null?$(ao,ao.current):$(ao,a.pool)}function av(){var n=eh();return n===null?null:{parent:vn._currentValue,pool:n}}var ns=Error(i(460)),th=Error(i(474)),lu=Error(i(542)),cu={then:function(){}};function iv(n){return n=n.status,n==="fulfilled"||n==="rejected"}function ov(n,a,o){switch(o=n[o],o===void 0?n.push(a):o!==a&&(a.then(Ta,Ta),a=o),a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,lv(n),n;default:if(typeof a.status=="string")a.then(Ta,Ta);else{if(n=$t,n!==null&&100<n.shellSuspendCounter)throw Error(i(482));n=a,n.status="pending",n.then(function(c){if(a.status==="pending"){var h=a;h.status="fulfilled",h.value=c}},function(c){if(a.status==="pending"){var h=a;h.status="rejected",h.reason=c}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,lv(n),n}throw oo=a,ns}}function io(n){try{var a=n._init;return a(n._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(oo=o,ns):o}}var oo=null;function sv(){if(oo===null)throw Error(i(459));var n=oo;return oo=null,n}function lv(n){if(n===ns||n===lu)throw Error(i(483))}var rs=null,yl=0;function uu(n){var a=yl;return yl+=1,rs===null&&(rs=[]),ov(rs,n,a)}function vl(n,a){a=a.props.ref,n.ref=a!==void 0?a:null}function du(n,a){throw a.$$typeof===v?Error(i(525)):(n=Object.prototype.toString.call(a),Error(i(31,n==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":n)))}function cv(n){function a(ee,K){if(n){var oe=ee.deletions;oe===null?(ee.deletions=[K],ee.flags|=16):oe.push(K)}}function o(ee,K){if(!n)return null;for(;K!==null;)a(ee,K),K=K.sibling;return null}function c(ee){for(var K=new Map;ee!==null;)ee.key!==null?K.set(ee.key,ee):K.set(ee.index,ee),ee=ee.sibling;return K}function h(ee,K){return ee=Oa(ee,K),ee.index=0,ee.sibling=null,ee}function g(ee,K,oe){return ee.index=oe,n?(oe=ee.alternate,oe!==null?(oe=oe.index,oe<K?(ee.flags|=67108866,K):oe):(ee.flags|=67108866,K)):(ee.flags|=1048576,K)}function E(ee){return n&&ee.alternate===null&&(ee.flags|=67108866),ee}function A(ee,K,oe,ge){return K===null||K.tag!==6?(K=Vf(oe,ee.mode,ge),K.return=ee,K):(K=h(K,oe),K.return=ee,K)}function Y(ee,K,oe,ge){var Ze=oe.type;return Ze===x?me(ee,K,oe.props.children,ge,oe.key):K!==null&&(K.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===L&&io(Ze)===K.type)?(K=h(K,oe.props),vl(K,oe),K.return=ee,K):(K=ru(oe.type,oe.key,oe.props,null,ee.mode,ge),vl(K,oe),K.return=ee,K)}function se(ee,K,oe,ge){return K===null||K.tag!==4||K.stateNode.containerInfo!==oe.containerInfo||K.stateNode.implementation!==oe.implementation?(K=Yf(oe,ee.mode,ge),K.return=ee,K):(K=h(K,oe.children||[]),K.return=ee,K)}function me(ee,K,oe,ge,Ze){return K===null||K.tag!==7?(K=eo(oe,ee.mode,ge,Ze),K.return=ee,K):(K=h(K,oe),K.return=ee,K)}function ye(ee,K,oe){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=Vf(""+K,ee.mode,oe),K.return=ee,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case b:return oe=ru(K.type,K.key,K.props,null,ee.mode,oe),vl(oe,K),oe.return=ee,oe;case S:return K=Yf(K,ee.mode,oe),K.return=ee,K;case L:return K=io(K),ye(ee,K,oe)}if(q(K)||z(K))return K=eo(K,ee.mode,oe,null),K.return=ee,K;if(typeof K.then=="function")return ye(ee,uu(K),oe);if(K.$$typeof===D)return ye(ee,ou(ee,K),oe);du(ee,K)}return null}function ce(ee,K,oe,ge){var Ze=K!==null?K.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Ze!==null?null:A(ee,K,""+oe,ge);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case b:return oe.key===Ze?Y(ee,K,oe,ge):null;case S:return oe.key===Ze?se(ee,K,oe,ge):null;case L:return oe=io(oe),ce(ee,K,oe,ge)}if(q(oe)||z(oe))return Ze!==null?null:me(ee,K,oe,ge,null);if(typeof oe.then=="function")return ce(ee,K,uu(oe),ge);if(oe.$$typeof===D)return ce(ee,K,ou(ee,oe),ge);du(ee,oe)}return null}function de(ee,K,oe,ge,Ze){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return ee=ee.get(oe)||null,A(K,ee,""+ge,Ze);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case b:return ee=ee.get(ge.key===null?oe:ge.key)||null,Y(K,ee,ge,Ze);case S:return ee=ee.get(ge.key===null?oe:ge.key)||null,se(K,ee,ge,Ze);case L:return ge=io(ge),de(ee,K,oe,ge,Ze)}if(q(ge)||z(ge))return ee=ee.get(oe)||null,me(K,ee,ge,Ze,null);if(typeof ge.then=="function")return de(ee,K,oe,uu(ge),Ze);if(ge.$$typeof===D)return de(ee,K,oe,ou(K,ge),Ze);du(K,ge)}return null}function je(ee,K,oe,ge){for(var Ze=null,_t=null,$e=K,ht=K=0,Tt=null;$e!==null&&ht<oe.length;ht++){$e.index>ht?(Tt=$e,$e=null):Tt=$e.sibling;var Lt=ce(ee,$e,oe[ht],ge);if(Lt===null){$e===null&&($e=Tt);break}n&&$e&&Lt.alternate===null&&a(ee,$e),K=g(Lt,K,ht),_t===null?Ze=Lt:_t.sibling=Lt,_t=Lt,$e=Tt}if(ht===oe.length)return o(ee,$e),At&&Ma(ee,ht),Ze;if($e===null){for(;ht<oe.length;ht++)$e=ye(ee,oe[ht],ge),$e!==null&&(K=g($e,K,ht),_t===null?Ze=$e:_t.sibling=$e,_t=$e);return At&&Ma(ee,ht),Ze}for($e=c($e);ht<oe.length;ht++)Tt=de($e,ee,ht,oe[ht],ge),Tt!==null&&(n&&Tt.alternate!==null&&$e.delete(Tt.key===null?ht:Tt.key),K=g(Tt,K,ht),_t===null?Ze=Tt:_t.sibling=Tt,_t=Tt);return n&&$e.forEach(function(bi){return a(ee,bi)}),At&&Ma(ee,ht),Ze}function nt(ee,K,oe,ge){if(oe==null)throw Error(i(151));for(var Ze=null,_t=null,$e=K,ht=K=0,Tt=null,Lt=oe.next();$e!==null&&!Lt.done;ht++,Lt=oe.next()){$e.index>ht?(Tt=$e,$e=null):Tt=$e.sibling;var bi=ce(ee,$e,Lt.value,ge);if(bi===null){$e===null&&($e=Tt);break}n&&$e&&bi.alternate===null&&a(ee,$e),K=g(bi,K,ht),_t===null?Ze=bi:_t.sibling=bi,_t=bi,$e=Tt}if(Lt.done)return o(ee,$e),At&&Ma(ee,ht),Ze;if($e===null){for(;!Lt.done;ht++,Lt=oe.next())Lt=ye(ee,Lt.value,ge),Lt!==null&&(K=g(Lt,K,ht),_t===null?Ze=Lt:_t.sibling=Lt,_t=Lt);return At&&Ma(ee,ht),Ze}for($e=c($e);!Lt.done;ht++,Lt=oe.next())Lt=de($e,ee,ht,Lt.value,ge),Lt!==null&&(n&&Lt.alternate!==null&&$e.delete(Lt.key===null?ht:Lt.key),K=g(Lt,K,ht),_t===null?Ze=Lt:_t.sibling=Lt,_t=Lt);return n&&$e.forEach(function(eO){return a(ee,eO)}),At&&Ma(ee,ht),Ze}function Wt(ee,K,oe,ge){if(typeof oe=="object"&&oe!==null&&oe.type===x&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case b:e:{for(var Ze=oe.key;K!==null;){if(K.key===Ze){if(Ze=oe.type,Ze===x){if(K.tag===7){o(ee,K.sibling),ge=h(K,oe.props.children),ge.return=ee,ee=ge;break e}}else if(K.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===L&&io(Ze)===K.type){o(ee,K.sibling),ge=h(K,oe.props),vl(ge,oe),ge.return=ee,ee=ge;break e}o(ee,K);break}else a(ee,K);K=K.sibling}oe.type===x?(ge=eo(oe.props.children,ee.mode,ge,oe.key),ge.return=ee,ee=ge):(ge=ru(oe.type,oe.key,oe.props,null,ee.mode,ge),vl(ge,oe),ge.return=ee,ee=ge)}return E(ee);case S:e:{for(Ze=oe.key;K!==null;){if(K.key===Ze)if(K.tag===4&&K.stateNode.containerInfo===oe.containerInfo&&K.stateNode.implementation===oe.implementation){o(ee,K.sibling),ge=h(K,oe.children||[]),ge.return=ee,ee=ge;break e}else{o(ee,K);break}else a(ee,K);K=K.sibling}ge=Yf(oe,ee.mode,ge),ge.return=ee,ee=ge}return E(ee);case L:return oe=io(oe),Wt(ee,K,oe,ge)}if(q(oe))return je(ee,K,oe,ge);if(z(oe)){if(Ze=z(oe),typeof Ze!="function")throw Error(i(150));return oe=Ze.call(oe),nt(ee,K,oe,ge)}if(typeof oe.then=="function")return Wt(ee,K,uu(oe),ge);if(oe.$$typeof===D)return Wt(ee,K,ou(ee,oe),ge);du(ee,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,K!==null&&K.tag===6?(o(ee,K.sibling),ge=h(K,oe),ge.return=ee,ee=ge):(o(ee,K),ge=Vf(oe,ee.mode,ge),ge.return=ee,ee=ge),E(ee)):o(ee,K)}return function(ee,K,oe,ge){try{yl=0;var Ze=Wt(ee,K,oe,ge);return rs=null,Ze}catch($e){if($e===ns||$e===lu)throw $e;var _t=br(29,$e,null,ee.mode);return _t.lanes=ge,_t.return=ee,_t}finally{}}}var so=cv(!0),uv=cv(!1),ni=!1;function nh(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function rh(n,a){n=n.updateQueue,a.updateQueue===n&&(a.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function ri(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function ai(n,a,o){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(Ut&2)!==0){var h=c.pending;return h===null?a.next=a:(a.next=h.next,h.next=a),c.pending=a,a=nu(n),Ky(n,null,o),a}return tu(n,c,a,o),nu(n)}function bl(n,a,o){if(a=a.updateQueue,a!==null&&(a=a.shared,(o&4194048)!==0)){var c=a.lanes;c&=n.pendingLanes,o|=c,a.lanes=o,B(n,o)}}function ah(n,a){var o=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,o===c)){var h=null,g=null;if(o=o.firstBaseUpdate,o!==null){do{var E={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};g===null?h=g=E:g=g.next=E,o=o.next}while(o!==null);g===null?h=g=a:g=g.next=a}else h=g=a;o={baseState:c.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:c.shared,callbacks:c.callbacks},n.updateQueue=o;return}n=o.lastBaseUpdate,n===null?o.firstBaseUpdate=a:n.next=a,o.lastBaseUpdate=a}var ih=!1;function wl(){if(ih){var n=ts;if(n!==null)throw n}}function Sl(n,a,o,c){ih=!1;var h=n.updateQueue;ni=!1;var g=h.firstBaseUpdate,E=h.lastBaseUpdate,A=h.shared.pending;if(A!==null){h.shared.pending=null;var Y=A,se=Y.next;Y.next=null,E===null?g=se:E.next=se,E=Y;var me=n.alternate;me!==null&&(me=me.updateQueue,A=me.lastBaseUpdate,A!==E&&(A===null?me.firstBaseUpdate=se:A.next=se,me.lastBaseUpdate=Y))}if(g!==null){var ye=h.baseState;E=0,me=se=Y=null,A=g;do{var ce=A.lane&-536870913,de=ce!==A.lane;if(de?(Rt&ce)===ce:(c&ce)===ce){ce!==0&&ce===es&&(ih=!0),me!==null&&(me=me.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var je=n,nt=A;ce=a;var Wt=o;switch(nt.tag){case 1:if(je=nt.payload,typeof je=="function"){ye=je.call(Wt,ye,ce);break e}ye=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=nt.payload,ce=typeof je=="function"?je.call(Wt,ye,ce):je,ce==null)break e;ye=p({},ye,ce);break e;case 2:ni=!0}}ce=A.callback,ce!==null&&(n.flags|=64,de&&(n.flags|=8192),de=h.callbacks,de===null?h.callbacks=[ce]:de.push(ce))}else de={lane:ce,tag:A.tag,payload:A.payload,callback:A.callback,next:null},me===null?(se=me=de,Y=ye):me=me.next=de,E|=ce;if(A=A.next,A===null){if(A=h.shared.pending,A===null)break;de=A,A=de.next,de.next=null,h.lastBaseUpdate=de,h.shared.pending=null}}while(!0);me===null&&(Y=ye),h.baseState=Y,h.firstBaseUpdate=se,h.lastBaseUpdate=me,g===null&&(h.shared.lanes=0),ci|=E,n.lanes=E,n.memoizedState=ye}}function dv(n,a){if(typeof n!="function")throw Error(i(191,n));n.call(a)}function fv(n,a){var o=n.callbacks;if(o!==null)for(n.callbacks=null,n=0;n<o.length;n++)dv(o[n],a)}var as=P(null),fu=P(0);function hv(n,a){n=ja,$(fu,n),$(as,a),ja=n|a.baseLanes}function oh(){$(fu,ja),$(as,as.current)}function sh(){ja=fu.current,X(as),X(fu)}var wr=P(null),Pr=null;function ii(n){var a=n.alternate;$(gn,gn.current&1),$(wr,n),Pr===null&&(a===null||as.current!==null||a.memoizedState!==null)&&(Pr=n)}function lh(n){$(gn,gn.current),$(wr,n),Pr===null&&(Pr=n)}function mv(n){n.tag===22?($(gn,gn.current),$(wr,n),Pr===null&&(Pr=n)):oi()}function oi(){$(gn,gn.current),$(wr,wr.current)}function Sr(n){X(wr),Pr===n&&(Pr=null),X(gn)}var gn=P(0);function hu(n){for(var a=n;a!==null;){if(a.tag===13){var o=a.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||mm(o)||pm(o)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===n)break;for(;a.sibling===null;){if(a.return===null||a.return===n)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Na=0,dt=null,Kt=null,bn=null,mu=!1,is=!1,lo=!1,pu=0,xl=0,os=null,YT=0;function dn(){throw Error(i(321))}function ch(n,a){if(a===null)return!1;for(var o=0;o<a.length&&o<n.length;o++)if(!vr(n[o],a[o]))return!1;return!0}function uh(n,a,o,c,h,g){return Na=g,dt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,_.H=n===null||n.memoizedState===null?Qv:Th,lo=!1,g=o(c,h),lo=!1,is&&(g=gv(a,o,c,h)),pv(n),g}function pv(n){_.H=Tl;var a=Kt!==null&&Kt.next!==null;if(Na=0,bn=Kt=dt=null,mu=!1,xl=0,os=null,a)throw Error(i(300));n===null||wn||(n=n.dependencies,n!==null&&iu(n)&&(wn=!0))}function gv(n,a,o,c){dt=n;var h=0;do{if(is&&(os=null),xl=0,is=!1,25<=h)throw Error(i(301));if(h+=1,bn=Kt=null,n.updateQueue!=null){var g=n.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}_.H=Zv,g=a(o,c)}while(is);return g}function qT(){var n=_.H,a=n.useState()[0];return a=typeof a.then=="function"?El(a):a,n=n.useState()[0],(Kt!==null?Kt.memoizedState:null)!==n&&(dt.flags|=1024),a}function dh(){var n=pu!==0;return pu=0,n}function fh(n,a,o){a.updateQueue=n.updateQueue,a.flags&=-2053,n.lanes&=~o}function hh(n){if(mu){for(n=n.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}mu=!1}Na=0,bn=Kt=dt=null,is=!1,xl=pu=0,os=null}function Wn(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bn===null?dt.memoizedState=bn=n:bn=bn.next=n,bn}function yn(){if(Kt===null){var n=dt.alternate;n=n!==null?n.memoizedState:null}else n=Kt.next;var a=bn===null?dt.memoizedState:bn.next;if(a!==null)bn=a,Kt=n;else{if(n===null)throw dt.alternate===null?Error(i(467)):Error(i(310));Kt=n,n={memoizedState:Kt.memoizedState,baseState:Kt.baseState,baseQueue:Kt.baseQueue,queue:Kt.queue,next:null},bn===null?dt.memoizedState=bn=n:bn=bn.next=n}return bn}function gu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function El(n){var a=xl;return xl+=1,os===null&&(os=[]),n=ov(os,n,a),a=dt,(bn===null?a.memoizedState:bn.next)===null&&(a=a.alternate,_.H=a===null||a.memoizedState===null?Qv:Th),n}function yu(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return El(n);if(n.$$typeof===D)return In(n)}throw Error(i(438,String(n)))}function mh(n){var a=null,o=dt.updateQueue;if(o!==null&&(a=o.memoCache),a==null){var c=dt.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(a={data:c.data.map(function(h){return h.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),o===null&&(o=gu(),dt.updateQueue=o),o.memoCache=a,o=a.data[a.index],o===void 0)for(o=a.data[a.index]=Array(n),c=0;c<n;c++)o[c]=J;return a.index++,o}function ka(n,a){return typeof a=="function"?a(n):a}function vu(n){var a=yn();return ph(a,Kt,n)}function ph(n,a,o){var c=n.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=o;var h=n.baseQueue,g=c.pending;if(g!==null){if(h!==null){var E=h.next;h.next=g.next,g.next=E}a.baseQueue=h=g,c.pending=null}if(g=n.baseState,h===null)n.memoizedState=g;else{a=h.next;var A=E=null,Y=null,se=a,me=!1;do{var ye=se.lane&-536870913;if(ye!==se.lane?(Rt&ye)===ye:(Na&ye)===ye){var ce=se.revertLane;if(ce===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),ye===es&&(me=!0);else if((Na&ce)===ce){se=se.next,ce===es&&(me=!0);continue}else ye={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},Y===null?(A=Y=ye,E=g):Y=Y.next=ye,dt.lanes|=ce,ci|=ce;ye=se.action,lo&&o(g,ye),g=se.hasEagerState?se.eagerState:o(g,ye)}else ce={lane:ye,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},Y===null?(A=Y=ce,E=g):Y=Y.next=ce,dt.lanes|=ye,ci|=ye;se=se.next}while(se!==null&&se!==a);if(Y===null?E=g:Y.next=A,!vr(g,n.memoizedState)&&(wn=!0,me&&(o=ts,o!==null)))throw o;n.memoizedState=g,n.baseState=E,n.baseQueue=Y,c.lastRenderedState=g}return h===null&&(c.lanes=0),[n.memoizedState,c.dispatch]}function gh(n){var a=yn(),o=a.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=n;var c=o.dispatch,h=o.pending,g=a.memoizedState;if(h!==null){o.pending=null;var E=h=h.next;do g=n(g,E.action),E=E.next;while(E!==h);vr(g,a.memoizedState)||(wn=!0),a.memoizedState=g,a.baseQueue===null&&(a.baseState=g),o.lastRenderedState=g}return[g,c]}function yv(n,a,o){var c=dt,h=yn(),g=At;if(g){if(o===void 0)throw Error(i(407));o=o()}else o=a();var E=!vr((Kt||h).memoizedState,o);if(E&&(h.memoizedState=o,wn=!0),h=h.queue,bh(wv.bind(null,c,h,n),[n]),h.getSnapshot!==a||E||bn!==null&&bn.memoizedState.tag&1){if(c.flags|=2048,ss(9,{destroy:void 0},bv.bind(null,c,h,o,a),null),$t===null)throw Error(i(349));g||(Na&127)!==0||vv(c,a,o)}return o}function vv(n,a,o){n.flags|=16384,n={getSnapshot:a,value:o},a=dt.updateQueue,a===null?(a=gu(),dt.updateQueue=a,a.stores=[n]):(o=a.stores,o===null?a.stores=[n]:o.push(n))}function bv(n,a,o,c){a.value=o,a.getSnapshot=c,Sv(a)&&xv(n)}function wv(n,a,o){return o(function(){Sv(a)&&xv(n)})}function Sv(n){var a=n.getSnapshot;n=n.value;try{var o=a();return!vr(n,o)}catch{return!0}}function xv(n){var a=Ji(n,2);a!==null&&dr(a,n,2)}function yh(n){var a=Wn();if(typeof n=="function"){var o=n;if(n=o(),lo){st(!0);try{o()}finally{st(!1)}}}return a.memoizedState=a.baseState=n,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ka,lastRenderedState:n},a}function Ev(n,a,o,c){return n.baseState=o,ph(n,Kt,typeof c=="function"?c:ka)}function GT(n,a,o,c,h){if(Su(n))throw Error(i(485));if(n=a.action,n!==null){var g={payload:h,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){g.listeners.push(E)}};_.T!==null?o(!0):g.isTransition=!1,c(g),o=a.pending,o===null?(g.next=a.pending=g,Rv(a,g)):(g.next=o.next,a.pending=o.next=g)}}function Rv(n,a){var o=a.action,c=a.payload,h=n.state;if(a.isTransition){var g=_.T,E={};_.T=E;try{var A=o(h,c),Y=_.S;Y!==null&&Y(E,A),Tv(n,a,A)}catch(se){vh(n,a,se)}finally{g!==null&&E.types!==null&&(g.types=E.types),_.T=g}}else try{g=o(h,c),Tv(n,a,g)}catch(se){vh(n,a,se)}}function Tv(n,a,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(c){Cv(n,a,c)},function(c){return vh(n,a,c)}):Cv(n,a,o)}function Cv(n,a,o){a.status="fulfilled",a.value=o,Ov(a),n.state=o,a=n.pending,a!==null&&(o=a.next,o===a?n.pending=null:(o=o.next,a.next=o,Rv(n,o)))}function vh(n,a,o){var c=n.pending;if(n.pending=null,c!==null){c=c.next;do a.status="rejected",a.reason=o,Ov(a),a=a.next;while(a!==c)}n.action=null}function Ov(n){n=n.listeners;for(var a=0;a<n.length;a++)(0,n[a])()}function Mv(n,a){return a}function Dv(n,a){if(At){var o=$t.formState;if(o!==null){e:{var c=dt;if(At){if(Jt){t:{for(var h=Jt,g=zr;h.nodeType!==8;){if(!g){h=null;break t}if(h=Ir(h.nextSibling),h===null){h=null;break t}}g=h.data,h=g==="F!"||g==="F"?h:null}if(h){Jt=Ir(h.nextSibling),c=h.data==="F!";break e}}ei(c)}c=!1}c&&(a=o[0])}}return o=Wn(),o.memoizedState=o.baseState=a,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mv,lastRenderedState:a},o.queue=c,o=Xv.bind(null,dt,c),c.dispatch=o,c=yh(!1),g=Rh.bind(null,dt,!1,c.queue),c=Wn(),h={state:a,dispatch:null,action:n,pending:null},c.queue=h,o=GT.bind(null,dt,h,g,o),h.dispatch=o,c.memoizedState=n,[a,o,!1]}function Av(n){var a=yn();return Nv(a,Kt,n)}function Nv(n,a,o){if(a=ph(n,a,Mv)[0],n=vu(ka)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var c=El(a)}catch(E){throw E===ns?lu:E}else c=a;a=yn();var h=a.queue,g=h.dispatch;return o!==a.memoizedState&&(dt.flags|=2048,ss(9,{destroy:void 0},KT.bind(null,h,o),null)),[c,g,n]}function KT(n,a){n.action=a}function kv(n){var a=yn(),o=Kt;if(o!==null)return Nv(a,o,n);yn(),a=a.memoizedState,o=yn();var c=o.queue.dispatch;return o.memoizedState=n,[a,c,!1]}function ss(n,a,o,c){return n={tag:n,create:o,deps:c,inst:a,next:null},a=dt.updateQueue,a===null&&(a=gu(),dt.updateQueue=a),o=a.lastEffect,o===null?a.lastEffect=n.next=n:(c=o.next,o.next=n,n.next=c,a.lastEffect=n),n}function _v(){return yn().memoizedState}function bu(n,a,o,c){var h=Wn();dt.flags|=n,h.memoizedState=ss(1|a,{destroy:void 0},o,c===void 0?null:c)}function wu(n,a,o,c){var h=yn();c=c===void 0?null:c;var g=h.memoizedState.inst;Kt!==null&&c!==null&&ch(c,Kt.memoizedState.deps)?h.memoizedState=ss(a,g,o,c):(dt.flags|=n,h.memoizedState=ss(1|a,g,o,c))}function Lv(n,a){bu(8390656,8,n,a)}function bh(n,a){wu(2048,8,n,a)}function XT(n){dt.flags|=4;var a=dt.updateQueue;if(a===null)a=gu(),dt.updateQueue=a,a.events=[n];else{var o=a.events;o===null?a.events=[n]:o.push(n)}}function zv(n){var a=yn().memoizedState;return XT({ref:a,nextImpl:n}),function(){if((Ut&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}function Pv(n,a){return wu(4,2,n,a)}function Iv(n,a){return wu(4,4,n,a)}function Uv(n,a){if(typeof a=="function"){n=n();var o=a(n);return function(){typeof o=="function"?o():a(null)}}if(a!=null)return n=n(),a.current=n,function(){a.current=null}}function jv(n,a,o){o=o!=null?o.concat([n]):null,wu(4,4,Uv.bind(null,a,n),o)}function wh(){}function Hv(n,a){var o=yn();a=a===void 0?null:a;var c=o.memoizedState;return a!==null&&ch(a,c[1])?c[0]:(o.memoizedState=[n,a],n)}function Bv(n,a){var o=yn();a=a===void 0?null:a;var c=o.memoizedState;if(a!==null&&ch(a,c[1]))return c[0];if(c=n(),lo){st(!0);try{n()}finally{st(!1)}}return o.memoizedState=[c,a],c}function Sh(n,a,o){return o===void 0||(Na&1073741824)!==0&&(Rt&261930)===0?n.memoizedState=a:(n.memoizedState=o,n=Fb(),dt.lanes|=n,ci|=n,o)}function Fv(n,a,o,c){return vr(o,a)?o:as.current!==null?(n=Sh(n,o,c),vr(n,a)||(wn=!0),n):(Na&42)===0||(Na&1073741824)!==0&&(Rt&261930)===0?(wn=!0,n.memoizedState=o):(n=Fb(),dt.lanes|=n,ci|=n,a)}function Vv(n,a,o,c,h){var g=j.p;j.p=g!==0&&8>g?g:8;var E=_.T,A={};_.T=A,Rh(n,!1,a,o);try{var Y=h(),se=_.S;if(se!==null&&se(A,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var me=VT(Y,c);Rl(n,a,me,Rr(n))}else Rl(n,a,c,Rr(n))}catch(ye){Rl(n,a,{then:function(){},status:"rejected",reason:ye},Rr())}finally{j.p=g,E!==null&&A.types!==null&&(E.types=A.types),_.T=E}}function WT(){}function xh(n,a,o,c){if(n.tag!==5)throw Error(i(476));var h=Yv(n).queue;Vv(n,h,a,U,o===null?WT:function(){return qv(n),o(c)})}function Yv(n){var a=n.memoizedState;if(a!==null)return a;a={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ka,lastRenderedState:U},next:null};var o={};return a.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ka,lastRenderedState:o},next:null},n.memoizedState=a,n=n.alternate,n!==null&&(n.memoizedState=a),a}function qv(n){var a=Yv(n);a.next===null&&(a=n.alternate.memoizedState),Rl(n,a.next.queue,{},Rr())}function Eh(){return In(Bl)}function Gv(){return yn().memoizedState}function Kv(){return yn().memoizedState}function $T(n){for(var a=n.return;a!==null;){switch(a.tag){case 24:case 3:var o=Rr();n=ri(o);var c=ai(a,n,o);c!==null&&(dr(c,a,o),bl(c,a,o)),a={cache:Zf()},n.payload=a;return}a=a.return}}function QT(n,a,o){var c=Rr();o={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Su(n)?Wv(a,o):(o=Bf(n,a,o,c),o!==null&&(dr(o,n,c),$v(o,a,c)))}function Xv(n,a,o){var c=Rr();Rl(n,a,o,c)}function Rl(n,a,o,c){var h={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Su(n))Wv(a,h);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=a.lastRenderedReducer,g!==null))try{var E=a.lastRenderedState,A=g(E,o);if(h.hasEagerState=!0,h.eagerState=A,vr(A,E))return tu(n,a,h,0),$t===null&&eu(),!1}catch{}finally{}if(o=Bf(n,a,h,c),o!==null)return dr(o,n,c),$v(o,a,c),!0}return!1}function Rh(n,a,o,c){if(c={lane:2,revertLane:nm(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Su(n)){if(a)throw Error(i(479))}else a=Bf(n,o,c,2),a!==null&&dr(a,n,2)}function Su(n){var a=n.alternate;return n===dt||a!==null&&a===dt}function Wv(n,a){is=mu=!0;var o=n.pending;o===null?a.next=a:(a.next=o.next,o.next=a),n.pending=a}function $v(n,a,o){if((o&4194048)!==0){var c=a.lanes;c&=n.pendingLanes,o|=c,a.lanes=o,B(n,o)}}var Tl={readContext:In,use:yu,useCallback:dn,useContext:dn,useEffect:dn,useImperativeHandle:dn,useLayoutEffect:dn,useInsertionEffect:dn,useMemo:dn,useReducer:dn,useRef:dn,useState:dn,useDebugValue:dn,useDeferredValue:dn,useTransition:dn,useSyncExternalStore:dn,useId:dn,useHostTransitionStatus:dn,useFormState:dn,useActionState:dn,useOptimistic:dn,useMemoCache:dn,useCacheRefresh:dn};Tl.useEffectEvent=dn;var Qv={readContext:In,use:yu,useCallback:function(n,a){return Wn().memoizedState=[n,a===void 0?null:a],n},useContext:In,useEffect:Lv,useImperativeHandle:function(n,a,o){o=o!=null?o.concat([n]):null,bu(4194308,4,Uv.bind(null,a,n),o)},useLayoutEffect:function(n,a){return bu(4194308,4,n,a)},useInsertionEffect:function(n,a){bu(4,2,n,a)},useMemo:function(n,a){var o=Wn();a=a===void 0?null:a;var c=n();if(lo){st(!0);try{n()}finally{st(!1)}}return o.memoizedState=[c,a],c},useReducer:function(n,a,o){var c=Wn();if(o!==void 0){var h=o(a);if(lo){st(!0);try{o(a)}finally{st(!1)}}}else h=a;return c.memoizedState=c.baseState=h,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:h},c.queue=n,n=n.dispatch=QT.bind(null,dt,n),[c.memoizedState,n]},useRef:function(n){var a=Wn();return n={current:n},a.memoizedState=n},useState:function(n){n=yh(n);var a=n.queue,o=Xv.bind(null,dt,a);return a.dispatch=o,[n.memoizedState,o]},useDebugValue:wh,useDeferredValue:function(n,a){var o=Wn();return Sh(o,n,a)},useTransition:function(){var n=yh(!1);return n=Vv.bind(null,dt,n.queue,!0,!1),Wn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,a,o){var c=dt,h=Wn();if(At){if(o===void 0)throw Error(i(407));o=o()}else{if(o=a(),$t===null)throw Error(i(349));(Rt&127)!==0||vv(c,a,o)}h.memoizedState=o;var g={value:o,getSnapshot:a};return h.queue=g,Lv(wv.bind(null,c,g,n),[n]),c.flags|=2048,ss(9,{destroy:void 0},bv.bind(null,c,g,o,a),null),o},useId:function(){var n=Wn(),a=$t.identifierPrefix;if(At){var o=oa,c=ia;o=(c&~(1<<32-gt(c)-1)).toString(32)+o,a="_"+a+"R_"+o,o=pu++,0<o&&(a+="H"+o.toString(32)),a+="_"}else o=YT++,a="_"+a+"r_"+o.toString(32)+"_";return n.memoizedState=a},useHostTransitionStatus:Eh,useFormState:Dv,useActionState:Dv,useOptimistic:function(n){var a=Wn();a.memoizedState=a.baseState=n;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=o,a=Rh.bind(null,dt,!0,o),o.dispatch=a,[n,a]},useMemoCache:mh,useCacheRefresh:function(){return Wn().memoizedState=$T.bind(null,dt)},useEffectEvent:function(n){var a=Wn(),o={impl:n};return a.memoizedState=o,function(){if((Ut&2)!==0)throw Error(i(440));return o.impl.apply(void 0,arguments)}}},Th={readContext:In,use:yu,useCallback:Hv,useContext:In,useEffect:bh,useImperativeHandle:jv,useInsertionEffect:Pv,useLayoutEffect:Iv,useMemo:Bv,useReducer:vu,useRef:_v,useState:function(){return vu(ka)},useDebugValue:wh,useDeferredValue:function(n,a){var o=yn();return Fv(o,Kt.memoizedState,n,a)},useTransition:function(){var n=vu(ka)[0],a=yn().memoizedState;return[typeof n=="boolean"?n:El(n),a]},useSyncExternalStore:yv,useId:Gv,useHostTransitionStatus:Eh,useFormState:Av,useActionState:Av,useOptimistic:function(n,a){var o=yn();return Ev(o,Kt,n,a)},useMemoCache:mh,useCacheRefresh:Kv};Th.useEffectEvent=zv;var Zv={readContext:In,use:yu,useCallback:Hv,useContext:In,useEffect:bh,useImperativeHandle:jv,useInsertionEffect:Pv,useLayoutEffect:Iv,useMemo:Bv,useReducer:gh,useRef:_v,useState:function(){return gh(ka)},useDebugValue:wh,useDeferredValue:function(n,a){var o=yn();return Kt===null?Sh(o,n,a):Fv(o,Kt.memoizedState,n,a)},useTransition:function(){var n=gh(ka)[0],a=yn().memoizedState;return[typeof n=="boolean"?n:El(n),a]},useSyncExternalStore:yv,useId:Gv,useHostTransitionStatus:Eh,useFormState:kv,useActionState:kv,useOptimistic:function(n,a){var o=yn();return Kt!==null?Ev(o,Kt,n,a):(o.baseState=n,[n,o.queue.dispatch])},useMemoCache:mh,useCacheRefresh:Kv};Zv.useEffectEvent=zv;function Ch(n,a,o,c){a=n.memoizedState,o=o(c,a),o=o==null?a:p({},a,o),n.memoizedState=o,n.lanes===0&&(n.updateQueue.baseState=o)}var Oh={enqueueSetState:function(n,a,o){n=n._reactInternals;var c=Rr(),h=ri(c);h.payload=a,o!=null&&(h.callback=o),a=ai(n,h,c),a!==null&&(dr(a,n,c),bl(a,n,c))},enqueueReplaceState:function(n,a,o){n=n._reactInternals;var c=Rr(),h=ri(c);h.tag=1,h.payload=a,o!=null&&(h.callback=o),a=ai(n,h,c),a!==null&&(dr(a,n,c),bl(a,n,c))},enqueueForceUpdate:function(n,a){n=n._reactInternals;var o=Rr(),c=ri(o);c.tag=2,a!=null&&(c.callback=a),a=ai(n,c,o),a!==null&&(dr(a,n,o),bl(a,n,o))}};function Jv(n,a,o,c,h,g,E){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(c,g,E):a.prototype&&a.prototype.isPureReactComponent?!dl(o,c)||!dl(h,g):!0}function eb(n,a,o,c){n=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(o,c),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(o,c),a.state!==n&&Oh.enqueueReplaceState(a,a.state,null)}function co(n,a){var o=a;if("ref"in a){o={};for(var c in a)c!=="ref"&&(o[c]=a[c])}if(n=n.defaultProps){o===a&&(o=p({},o));for(var h in n)o[h]===void 0&&(o[h]=n[h])}return o}function tb(n){Jc(n)}function nb(n){console.error(n)}function rb(n){Jc(n)}function xu(n,a){try{var o=n.onUncaughtError;o(a.value,{componentStack:a.stack})}catch(c){setTimeout(function(){throw c})}}function ab(n,a,o){try{var c=n.onCaughtError;c(o.value,{componentStack:o.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function Mh(n,a,o){return o=ri(o),o.tag=3,o.payload={element:null},o.callback=function(){xu(n,a)},o}function ib(n){return n=ri(n),n.tag=3,n}function ob(n,a,o,c){var h=o.type.getDerivedStateFromError;if(typeof h=="function"){var g=c.value;n.payload=function(){return h(g)},n.callback=function(){ab(a,o,c)}}var E=o.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(n.callback=function(){ab(a,o,c),typeof h!="function"&&(ui===null?ui=new Set([this]):ui.add(this));var A=c.stack;this.componentDidCatch(c.value,{componentStack:A!==null?A:""})})}function ZT(n,a,o,c,h){if(o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(a=o.alternate,a!==null&&Jo(a,o,h,!0),o=wr.current,o!==null){switch(o.tag){case 31:case 13:return Pr===null?Lu():o.alternate===null&&fn===0&&(fn=3),o.flags&=-257,o.flags|=65536,o.lanes=h,c===cu?o.flags|=16384:(a=o.updateQueue,a===null?o.updateQueue=new Set([c]):a.add(c),Jh(n,c,h)),!1;case 22:return o.flags|=65536,c===cu?o.flags|=16384:(a=o.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([c])},o.updateQueue=a):(o=a.retryQueue,o===null?a.retryQueue=new Set([c]):o.add(c)),Jh(n,c,h)),!1}throw Error(i(435,o.tag))}return Jh(n,c,h),Lu(),!1}if(At)return a=wr.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=h,c!==Kf&&(n=Error(i(422),{cause:c}),ml(kr(n,o)))):(c!==Kf&&(a=Error(i(423),{cause:c}),ml(kr(a,o))),n=n.current.alternate,n.flags|=65536,h&=-h,n.lanes|=h,c=kr(c,o),h=Mh(n.stateNode,c,h),ah(n,h),fn!==4&&(fn=2)),!1;var g=Error(i(520),{cause:c});if(g=kr(g,o),_l===null?_l=[g]:_l.push(g),fn!==4&&(fn=2),a===null)return!0;c=kr(c,o),o=a;do{switch(o.tag){case 3:return o.flags|=65536,n=h&-h,o.lanes|=n,n=Mh(o.stateNode,c,n),ah(o,n),!1;case 1:if(a=o.type,g=o.stateNode,(o.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(ui===null||!ui.has(g))))return o.flags|=65536,h&=-h,o.lanes|=h,h=ib(h),ob(h,n,o,c),ah(o,h),!1}o=o.return}while(o!==null);return!1}var Dh=Error(i(461)),wn=!1;function Un(n,a,o,c){a.child=n===null?uv(a,null,o,c):so(a,n.child,o,c)}function sb(n,a,o,c,h){o=o.render;var g=a.ref;if("ref"in c){var E={};for(var A in c)A!=="ref"&&(E[A]=c[A])}else E=c;return ro(a),c=uh(n,a,o,E,g,h),A=dh(),n!==null&&!wn?(fh(n,a,h),_a(n,a,h)):(At&&A&&qf(a),a.flags|=1,Un(n,a,c,h),a.child)}function lb(n,a,o,c,h){if(n===null){var g=o.type;return typeof g=="function"&&!Ff(g)&&g.defaultProps===void 0&&o.compare===null?(a.tag=15,a.type=g,cb(n,a,g,c,h)):(n=ru(o.type,null,c,a,a.mode,h),n.ref=a.ref,n.return=a,a.child=n)}if(g=n.child,!Ih(n,h)){var E=g.memoizedProps;if(o=o.compare,o=o!==null?o:dl,o(E,c)&&n.ref===a.ref)return _a(n,a,h)}return a.flags|=1,n=Oa(g,c),n.ref=a.ref,n.return=a,a.child=n}function cb(n,a,o,c,h){if(n!==null){var g=n.memoizedProps;if(dl(g,c)&&n.ref===a.ref)if(wn=!1,a.pendingProps=c=g,Ih(n,h))(n.flags&131072)!==0&&(wn=!0);else return a.lanes=n.lanes,_a(n,a,h)}return Ah(n,a,o,c,h)}function ub(n,a,o,c){var h=c.children,g=n!==null?n.memoizedState:null;if(n===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((a.flags&128)!==0){if(g=g!==null?g.baseLanes|o:o,n!==null){for(c=a.child=n.child,h=0;c!==null;)h=h|c.lanes|c.childLanes,c=c.sibling;c=h&~g}else c=0,a.child=null;return db(n,a,g,o,c)}if((o&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},n!==null&&su(a,g!==null?g.cachePool:null),g!==null?hv(a,g):oh(),mv(a);else return c=a.lanes=536870912,db(n,a,g!==null?g.baseLanes|o:o,o,c)}else g!==null?(su(a,g.cachePool),hv(a,g),oi(),a.memoizedState=null):(n!==null&&su(a,null),oh(),oi());return Un(n,a,h,o),a.child}function Cl(n,a){return n!==null&&n.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function db(n,a,o,c,h){var g=eh();return g=g===null?null:{parent:vn._currentValue,pool:g},a.memoizedState={baseLanes:o,cachePool:g},n!==null&&su(a,null),oh(),mv(a),n!==null&&Jo(n,a,c,!0),a.childLanes=h,null}function Eu(n,a){return a=Tu({mode:a.mode,children:a.children},n.mode),a.ref=n.ref,n.child=a,a.return=n,a}function fb(n,a,o){return so(a,n.child,null,o),n=Eu(a,a.pendingProps),n.flags|=2,Sr(a),a.memoizedState=null,n}function JT(n,a,o){var c=a.pendingProps,h=(a.flags&128)!==0;if(a.flags&=-129,n===null){if(At){if(c.mode==="hidden")return n=Eu(a,c),a.lanes=536870912,Cl(null,n);if(lh(a),(n=Jt)?(n=R0(n,zr),n=n!==null&&n.data==="&"?n:null,n!==null&&(a.memoizedState={dehydrated:n,treeContext:Za!==null?{id:ia,overflow:oa}:null,retryLane:536870912,hydrationErrors:null},o=Wy(n),o.return=a,a.child=o,Pn=a,Jt=null)):n=null,n===null)throw ei(a);return a.lanes=536870912,null}return Eu(a,c)}var g=n.memoizedState;if(g!==null){var E=g.dehydrated;if(lh(a),h)if(a.flags&256)a.flags&=-257,a=fb(n,a,o);else if(a.memoizedState!==null)a.child=n.child,a.flags|=128,a=null;else throw Error(i(558));else if(wn||Jo(n,a,o,!1),h=(o&n.childLanes)!==0,wn||h){if(c=$t,c!==null&&(E=Q(c,o),E!==0&&E!==g.retryLane))throw g.retryLane=E,Ji(n,E),dr(c,n,E),Dh;Lu(),a=fb(n,a,o)}else n=g.treeContext,Jt=Ir(E.nextSibling),Pn=a,At=!0,Ja=null,zr=!1,n!==null&&Zy(a,n),a=Eu(a,c),a.flags|=4096;return a}return n=Oa(n.child,{mode:c.mode,children:c.children}),n.ref=a.ref,a.child=n,n.return=a,n}function Ru(n,a){var o=a.ref;if(o===null)n!==null&&n.ref!==null&&(a.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(i(284));(n===null||n.ref!==o)&&(a.flags|=4194816)}}function Ah(n,a,o,c,h){return ro(a),o=uh(n,a,o,c,void 0,h),c=dh(),n!==null&&!wn?(fh(n,a,h),_a(n,a,h)):(At&&c&&qf(a),a.flags|=1,Un(n,a,o,h),a.child)}function hb(n,a,o,c,h,g){return ro(a),a.updateQueue=null,o=gv(a,c,o,h),pv(n),c=dh(),n!==null&&!wn?(fh(n,a,g),_a(n,a,g)):(At&&c&&qf(a),a.flags|=1,Un(n,a,o,g),a.child)}function mb(n,a,o,c,h){if(ro(a),a.stateNode===null){var g=Wo,E=o.contextType;typeof E=="object"&&E!==null&&(g=In(E)),g=new o(c,g),a.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Oh,a.stateNode=g,g._reactInternals=a,g=a.stateNode,g.props=c,g.state=a.memoizedState,g.refs={},nh(a),E=o.contextType,g.context=typeof E=="object"&&E!==null?In(E):Wo,g.state=a.memoizedState,E=o.getDerivedStateFromProps,typeof E=="function"&&(Ch(a,o,E,c),g.state=a.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(E=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),E!==g.state&&Oh.enqueueReplaceState(g,g.state,null),Sl(a,c,g,h),wl(),g.state=a.memoizedState),typeof g.componentDidMount=="function"&&(a.flags|=4194308),c=!0}else if(n===null){g=a.stateNode;var A=a.memoizedProps,Y=co(o,A);g.props=Y;var se=g.context,me=o.contextType;E=Wo,typeof me=="object"&&me!==null&&(E=In(me));var ye=o.getDerivedStateFromProps;me=typeof ye=="function"||typeof g.getSnapshotBeforeUpdate=="function",A=a.pendingProps!==A,me||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(A||se!==E)&&eb(a,g,c,E),ni=!1;var ce=a.memoizedState;g.state=ce,Sl(a,c,g,h),wl(),se=a.memoizedState,A||ce!==se||ni?(typeof ye=="function"&&(Ch(a,o,ye,c),se=a.memoizedState),(Y=ni||Jv(a,o,Y,c,ce,se,E))?(me||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(a.flags|=4194308)):(typeof g.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=c,a.memoizedState=se),g.props=c,g.state=se,g.context=E,c=Y):(typeof g.componentDidMount=="function"&&(a.flags|=4194308),c=!1)}else{g=a.stateNode,rh(n,a),E=a.memoizedProps,me=co(o,E),g.props=me,ye=a.pendingProps,ce=g.context,se=o.contextType,Y=Wo,typeof se=="object"&&se!==null&&(Y=In(se)),A=o.getDerivedStateFromProps,(se=typeof A=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(E!==ye||ce!==Y)&&eb(a,g,c,Y),ni=!1,ce=a.memoizedState,g.state=ce,Sl(a,c,g,h),wl();var de=a.memoizedState;E!==ye||ce!==de||ni||n!==null&&n.dependencies!==null&&iu(n.dependencies)?(typeof A=="function"&&(Ch(a,o,A,c),de=a.memoizedState),(me=ni||Jv(a,o,me,c,ce,de,Y)||n!==null&&n.dependencies!==null&&iu(n.dependencies))?(se||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(c,de,Y),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(c,de,Y)),typeof g.componentDidUpdate=="function"&&(a.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof g.componentDidUpdate!="function"||E===n.memoizedProps&&ce===n.memoizedState||(a.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||E===n.memoizedProps&&ce===n.memoizedState||(a.flags|=1024),a.memoizedProps=c,a.memoizedState=de),g.props=c,g.state=de,g.context=Y,c=me):(typeof g.componentDidUpdate!="function"||E===n.memoizedProps&&ce===n.memoizedState||(a.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||E===n.memoizedProps&&ce===n.memoizedState||(a.flags|=1024),c=!1)}return g=c,Ru(n,a),c=(a.flags&128)!==0,g||c?(g=a.stateNode,o=c&&typeof o.getDerivedStateFromError!="function"?null:g.render(),a.flags|=1,n!==null&&c?(a.child=so(a,n.child,null,h),a.child=so(a,null,o,h)):Un(n,a,o,h),a.memoizedState=g.state,n=a.child):n=_a(n,a,h),n}function pb(n,a,o,c){return to(),a.flags|=256,Un(n,a,o,c),a.child}var Nh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function kh(n){return{baseLanes:n,cachePool:av()}}function _h(n,a,o){return n=n!==null?n.childLanes&~o:0,a&&(n|=Er),n}function gb(n,a,o){var c=a.pendingProps,h=!1,g=(a.flags&128)!==0,E;if((E=g)||(E=n!==null&&n.memoizedState===null?!1:(gn.current&2)!==0),E&&(h=!0,a.flags&=-129),E=(a.flags&32)!==0,a.flags&=-33,n===null){if(At){if(h?ii(a):oi(),(n=Jt)?(n=R0(n,zr),n=n!==null&&n.data!=="&"?n:null,n!==null&&(a.memoizedState={dehydrated:n,treeContext:Za!==null?{id:ia,overflow:oa}:null,retryLane:536870912,hydrationErrors:null},o=Wy(n),o.return=a,a.child=o,Pn=a,Jt=null)):n=null,n===null)throw ei(a);return pm(n)?a.lanes=32:a.lanes=536870912,null}var A=c.children;return c=c.fallback,h?(oi(),h=a.mode,A=Tu({mode:"hidden",children:A},h),c=eo(c,h,o,null),A.return=a,c.return=a,A.sibling=c,a.child=A,c=a.child,c.memoizedState=kh(o),c.childLanes=_h(n,E,o),a.memoizedState=Nh,Cl(null,c)):(ii(a),Lh(a,A))}var Y=n.memoizedState;if(Y!==null&&(A=Y.dehydrated,A!==null)){if(g)a.flags&256?(ii(a),a.flags&=-257,a=zh(n,a,o)):a.memoizedState!==null?(oi(),a.child=n.child,a.flags|=128,a=null):(oi(),A=c.fallback,h=a.mode,c=Tu({mode:"visible",children:c.children},h),A=eo(A,h,o,null),A.flags|=2,c.return=a,A.return=a,c.sibling=A,a.child=c,so(a,n.child,null,o),c=a.child,c.memoizedState=kh(o),c.childLanes=_h(n,E,o),a.memoizedState=Nh,a=Cl(null,c));else if(ii(a),pm(A)){if(E=A.nextSibling&&A.nextSibling.dataset,E)var se=E.dgst;E=se,c=Error(i(419)),c.stack="",c.digest=E,ml({value:c,source:null,stack:null}),a=zh(n,a,o)}else if(wn||Jo(n,a,o,!1),E=(o&n.childLanes)!==0,wn||E){if(E=$t,E!==null&&(c=Q(E,o),c!==0&&c!==Y.retryLane))throw Y.retryLane=c,Ji(n,c),dr(E,n,c),Dh;mm(A)||Lu(),a=zh(n,a,o)}else mm(A)?(a.flags|=192,a.child=n.child,a=null):(n=Y.treeContext,Jt=Ir(A.nextSibling),Pn=a,At=!0,Ja=null,zr=!1,n!==null&&Zy(a,n),a=Lh(a,c.children),a.flags|=4096);return a}return h?(oi(),A=c.fallback,h=a.mode,Y=n.child,se=Y.sibling,c=Oa(Y,{mode:"hidden",children:c.children}),c.subtreeFlags=Y.subtreeFlags&65011712,se!==null?A=Oa(se,A):(A=eo(A,h,o,null),A.flags|=2),A.return=a,c.return=a,c.sibling=A,a.child=c,Cl(null,c),c=a.child,A=n.child.memoizedState,A===null?A=kh(o):(h=A.cachePool,h!==null?(Y=vn._currentValue,h=h.parent!==Y?{parent:Y,pool:Y}:h):h=av(),A={baseLanes:A.baseLanes|o,cachePool:h}),c.memoizedState=A,c.childLanes=_h(n,E,o),a.memoizedState=Nh,Cl(n.child,c)):(ii(a),o=n.child,n=o.sibling,o=Oa(o,{mode:"visible",children:c.children}),o.return=a,o.sibling=null,n!==null&&(E=a.deletions,E===null?(a.deletions=[n],a.flags|=16):E.push(n)),a.child=o,a.memoizedState=null,o)}function Lh(n,a){return a=Tu({mode:"visible",children:a},n.mode),a.return=n,n.child=a}function Tu(n,a){return n=br(22,n,null,a),n.lanes=0,n}function zh(n,a,o){return so(a,n.child,null,o),n=Lh(a,a.pendingProps.children),n.flags|=2,a.memoizedState=null,n}function yb(n,a,o){n.lanes|=a;var c=n.alternate;c!==null&&(c.lanes|=a),$f(n.return,a,o)}function Ph(n,a,o,c,h,g){var E=n.memoizedState;E===null?n.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:c,tail:o,tailMode:h,treeForkCount:g}:(E.isBackwards=a,E.rendering=null,E.renderingStartTime=0,E.last=c,E.tail=o,E.tailMode=h,E.treeForkCount=g)}function vb(n,a,o){var c=a.pendingProps,h=c.revealOrder,g=c.tail;c=c.children;var E=gn.current,A=(E&2)!==0;if(A?(E=E&1|2,a.flags|=128):E&=1,$(gn,E),Un(n,a,c,o),c=At?hl:0,!A&&n!==null&&(n.flags&128)!==0)e:for(n=a.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&yb(n,o,a);else if(n.tag===19)yb(n,o,a);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===a)break e;for(;n.sibling===null;){if(n.return===null||n.return===a)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(h){case"forwards":for(o=a.child,h=null;o!==null;)n=o.alternate,n!==null&&hu(n)===null&&(h=o),o=o.sibling;o=h,o===null?(h=a.child,a.child=null):(h=o.sibling,o.sibling=null),Ph(a,!1,h,o,g,c);break;case"backwards":case"unstable_legacy-backwards":for(o=null,h=a.child,a.child=null;h!==null;){if(n=h.alternate,n!==null&&hu(n)===null){a.child=h;break}n=h.sibling,h.sibling=o,o=h,h=n}Ph(a,!0,o,null,g,c);break;case"together":Ph(a,!1,null,null,void 0,c);break;default:a.memoizedState=null}return a.child}function _a(n,a,o){if(n!==null&&(a.dependencies=n.dependencies),ci|=a.lanes,(o&a.childLanes)===0)if(n!==null){if(Jo(n,a,o,!1),(o&a.childLanes)===0)return null}else return null;if(n!==null&&a.child!==n.child)throw Error(i(153));if(a.child!==null){for(n=a.child,o=Oa(n,n.pendingProps),a.child=o,o.return=a;n.sibling!==null;)n=n.sibling,o=o.sibling=Oa(n,n.pendingProps),o.return=a;o.sibling=null}return a.child}function Ih(n,a){return(n.lanes&a)!==0?!0:(n=n.dependencies,!!(n!==null&&iu(n)))}function eC(n,a,o){switch(a.tag){case 3:we(a,a.stateNode.containerInfo),ti(a,vn,n.memoizedState.cache),to();break;case 27:case 5:ke(a);break;case 4:we(a,a.stateNode.containerInfo);break;case 10:ti(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,lh(a),null;break;case 13:var c=a.memoizedState;if(c!==null)return c.dehydrated!==null?(ii(a),a.flags|=128,null):(o&a.child.childLanes)!==0?gb(n,a,o):(ii(a),n=_a(n,a,o),n!==null?n.sibling:null);ii(a);break;case 19:var h=(n.flags&128)!==0;if(c=(o&a.childLanes)!==0,c||(Jo(n,a,o,!1),c=(o&a.childLanes)!==0),h){if(c)return vb(n,a,o);a.flags|=128}if(h=a.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),$(gn,gn.current),c)break;return null;case 22:return a.lanes=0,ub(n,a,o,a.pendingProps);case 24:ti(a,vn,n.memoizedState.cache)}return _a(n,a,o)}function bb(n,a,o){if(n!==null)if(n.memoizedProps!==a.pendingProps)wn=!0;else{if(!Ih(n,o)&&(a.flags&128)===0)return wn=!1,eC(n,a,o);wn=(n.flags&131072)!==0}else wn=!1,At&&(a.flags&1048576)!==0&&Qy(a,hl,a.index);switch(a.lanes=0,a.tag){case 16:e:{var c=a.pendingProps;if(n=io(a.elementType),a.type=n,typeof n=="function")Ff(n)?(c=co(n,c),a.tag=1,a=mb(null,a,n,c,o)):(a.tag=0,a=Ah(null,a,n,c,o));else{if(n!=null){var h=n.$$typeof;if(h===C){a.tag=11,a=sb(null,a,n,c,o);break e}else if(h===O){a.tag=14,a=lb(null,a,n,c,o);break e}}throw a=V(n)||n,Error(i(306,a,""))}}return a;case 0:return Ah(n,a,a.type,a.pendingProps,o);case 1:return c=a.type,h=co(c,a.pendingProps),mb(n,a,c,h,o);case 3:e:{if(we(a,a.stateNode.containerInfo),n===null)throw Error(i(387));c=a.pendingProps;var g=a.memoizedState;h=g.element,rh(n,a),Sl(a,c,null,o);var E=a.memoizedState;if(c=E.cache,ti(a,vn,c),c!==g.cache&&Qf(a,[vn],o,!0),wl(),c=E.element,g.isDehydrated)if(g={element:c,isDehydrated:!1,cache:E.cache},a.updateQueue.baseState=g,a.memoizedState=g,a.flags&256){a=pb(n,a,c,o);break e}else if(c!==h){h=kr(Error(i(424)),a),ml(h),a=pb(n,a,c,o);break e}else{switch(n=a.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(Jt=Ir(n.firstChild),Pn=a,At=!0,Ja=null,zr=!0,o=uv(a,null,c,o),a.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(to(),c===h){a=_a(n,a,o);break e}Un(n,a,c,o)}a=a.child}return a;case 26:return Ru(n,a),n===null?(o=A0(a.type,null,a.pendingProps,null))?a.memoizedState=o:At||(o=a.type,n=a.pendingProps,c=Bu(ue.current).createElement(o),c[Me]=a,c[Ae]=n,jn(c,o,n),tn(c),a.stateNode=c):a.memoizedState=A0(a.type,n.memoizedProps,a.pendingProps,n.memoizedState),null;case 27:return ke(a),n===null&&At&&(c=a.stateNode=O0(a.type,a.pendingProps,ue.current),Pn=a,zr=!0,h=Jt,mi(a.type)?(gm=h,Jt=Ir(c.firstChild)):Jt=h),Un(n,a,a.pendingProps.children,o),Ru(n,a),n===null&&(a.flags|=4194304),a.child;case 5:return n===null&&At&&((h=c=Jt)&&(c=AC(c,a.type,a.pendingProps,zr),c!==null?(a.stateNode=c,Pn=a,Jt=Ir(c.firstChild),zr=!1,h=!0):h=!1),h||ei(a)),ke(a),h=a.type,g=a.pendingProps,E=n!==null?n.memoizedProps:null,c=g.children,dm(h,g)?c=null:E!==null&&dm(h,E)&&(a.flags|=32),a.memoizedState!==null&&(h=uh(n,a,qT,null,null,o),Bl._currentValue=h),Ru(n,a),Un(n,a,c,o),a.child;case 6:return n===null&&At&&((n=o=Jt)&&(o=NC(o,a.pendingProps,zr),o!==null?(a.stateNode=o,Pn=a,Jt=null,n=!0):n=!1),n||ei(a)),null;case 13:return gb(n,a,o);case 4:return we(a,a.stateNode.containerInfo),c=a.pendingProps,n===null?a.child=so(a,null,c,o):Un(n,a,c,o),a.child;case 11:return sb(n,a,a.type,a.pendingProps,o);case 7:return Un(n,a,a.pendingProps,o),a.child;case 8:return Un(n,a,a.pendingProps.children,o),a.child;case 12:return Un(n,a,a.pendingProps.children,o),a.child;case 10:return c=a.pendingProps,ti(a,a.type,c.value),Un(n,a,c.children,o),a.child;case 9:return h=a.type._context,c=a.pendingProps.children,ro(a),h=In(h),c=c(h),a.flags|=1,Un(n,a,c,o),a.child;case 14:return lb(n,a,a.type,a.pendingProps,o);case 15:return cb(n,a,a.type,a.pendingProps,o);case 19:return vb(n,a,o);case 31:return JT(n,a,o);case 22:return ub(n,a,o,a.pendingProps);case 24:return ro(a),c=In(vn),n===null?(h=eh(),h===null&&(h=$t,g=Zf(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=o),h=g),a.memoizedState={parent:c,cache:h},nh(a),ti(a,vn,h)):((n.lanes&o)!==0&&(rh(n,a),Sl(a,null,null,o),wl()),h=n.memoizedState,g=a.memoizedState,h.parent!==c?(h={parent:c,cache:c},a.memoizedState=h,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=h),ti(a,vn,c)):(c=g.cache,ti(a,vn,c),c!==h.cache&&Qf(a,[vn],o,!0))),Un(n,a,a.pendingProps.children,o),a.child;case 29:throw a.pendingProps}throw Error(i(156,a.tag))}function La(n){n.flags|=4}function Uh(n,a,o,c,h){if((a=(n.mode&32)!==0)&&(a=!1),a){if(n.flags|=16777216,(h&335544128)===h)if(n.stateNode.complete)n.flags|=8192;else if(Gb())n.flags|=8192;else throw oo=cu,th}else n.flags&=-16777217}function wb(n,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!z0(a))if(Gb())n.flags|=8192;else throw oo=cu,th}function Cu(n,a){a!==null&&(n.flags|=4),n.flags&16384&&(a=n.tag!==22?qt():536870912,n.lanes|=a,ds|=a)}function Ol(n,a){if(!At)switch(n.tailMode){case"hidden":a=n.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?n.tail=null:o.sibling=null;break;case"collapsed":o=n.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?a||n.tail===null?n.tail=null:n.tail.sibling=null:c.sibling=null}}function en(n){var a=n.alternate!==null&&n.alternate.child===n.child,o=0,c=0;if(a)for(var h=n.child;h!==null;)o|=h.lanes|h.childLanes,c|=h.subtreeFlags&65011712,c|=h.flags&65011712,h.return=n,h=h.sibling;else for(h=n.child;h!==null;)o|=h.lanes|h.childLanes,c|=h.subtreeFlags,c|=h.flags,h.return=n,h=h.sibling;return n.subtreeFlags|=c,n.childLanes=o,a}function tC(n,a,o){var c=a.pendingProps;switch(Gf(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return en(a),null;case 1:return en(a),null;case 3:return o=a.stateNode,c=null,n!==null&&(c=n.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),Aa(vn),ve(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(n===null||n.child===null)&&(Zo(a)?La(a):n===null||n.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Xf())),en(a),null;case 26:var h=a.type,g=a.memoizedState;return n===null?(La(a),g!==null?(en(a),wb(a,g)):(en(a),Uh(a,h,null,c,o))):g?g!==n.memoizedState?(La(a),en(a),wb(a,g)):(en(a),a.flags&=-16777217):(n=n.memoizedProps,n!==c&&La(a),en(a),Uh(a,h,n,c,o)),null;case 27:if(Xe(a),o=ue.current,h=a.type,n!==null&&a.stateNode!=null)n.memoizedProps!==c&&La(a);else{if(!c){if(a.stateNode===null)throw Error(i(166));return en(a),null}n=F.current,Zo(a)?Jy(a):(n=O0(h,c,o),a.stateNode=n,La(a))}return en(a),null;case 5:if(Xe(a),h=a.type,n!==null&&a.stateNode!=null)n.memoizedProps!==c&&La(a);else{if(!c){if(a.stateNode===null)throw Error(i(166));return en(a),null}if(g=F.current,Zo(a))Jy(a);else{var E=Bu(ue.current);switch(g){case 1:g=E.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:g=E.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":g=E.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":g=E.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":g=E.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof c.is=="string"?E.createElement("select",{is:c.is}):E.createElement("select"),c.multiple?g.multiple=!0:c.size&&(g.size=c.size);break;default:g=typeof c.is=="string"?E.createElement(h,{is:c.is}):E.createElement(h)}}g[Me]=a,g[Ae]=c;e:for(E=a.child;E!==null;){if(E.tag===5||E.tag===6)g.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===a)break e;for(;E.sibling===null;){if(E.return===null||E.return===a)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}a.stateNode=g;e:switch(jn(g,h,c),h){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&La(a)}}return en(a),Uh(a,a.type,n===null?null:n.memoizedProps,a.pendingProps,o),null;case 6:if(n&&a.stateNode!=null)n.memoizedProps!==c&&La(a);else{if(typeof c!="string"&&a.stateNode===null)throw Error(i(166));if(n=ue.current,Zo(a)){if(n=a.stateNode,o=a.memoizedProps,c=null,h=Pn,h!==null)switch(h.tag){case 27:case 5:c=h.memoizedProps}n[Me]=a,n=!!(n.nodeValue===o||c!==null&&c.suppressHydrationWarning===!0||g0(n.nodeValue,o)),n||ei(a,!0)}else n=Bu(n).createTextNode(c),n[Me]=a,a.stateNode=n}return en(a),null;case 31:if(o=a.memoizedState,n===null||n.memoizedState!==null){if(c=Zo(a),o!==null){if(n===null){if(!c)throw Error(i(318));if(n=a.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(557));n[Me]=a}else to(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;en(a),n=!1}else o=Xf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=o),n=!0;if(!n)return a.flags&256?(Sr(a),a):(Sr(a),null);if((a.flags&128)!==0)throw Error(i(558))}return en(a),null;case 13:if(c=a.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(h=Zo(a),c!==null&&c.dehydrated!==null){if(n===null){if(!h)throw Error(i(318));if(h=a.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(i(317));h[Me]=a}else to(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;en(a),h=!1}else h=Xf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=h),h=!0;if(!h)return a.flags&256?(Sr(a),a):(Sr(a),null)}return Sr(a),(a.flags&128)!==0?(a.lanes=o,a):(o=c!==null,n=n!==null&&n.memoizedState!==null,o&&(c=a.child,h=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(h=c.alternate.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==h&&(c.flags|=2048)),o!==n&&o&&(a.child.flags|=8192),Cu(a,a.updateQueue),en(a),null);case 4:return ve(),n===null&&om(a.stateNode.containerInfo),en(a),null;case 10:return Aa(a.type),en(a),null;case 19:if(X(gn),c=a.memoizedState,c===null)return en(a),null;if(h=(a.flags&128)!==0,g=c.rendering,g===null)if(h)Ol(c,!1);else{if(fn!==0||n!==null&&(n.flags&128)!==0)for(n=a.child;n!==null;){if(g=hu(n),g!==null){for(a.flags|=128,Ol(c,!1),n=g.updateQueue,a.updateQueue=n,Cu(a,n),a.subtreeFlags=0,n=o,o=a.child;o!==null;)Xy(o,n),o=o.sibling;return $(gn,gn.current&1|2),At&&Ma(a,c.treeForkCount),a.child}n=n.sibling}c.tail!==null&&Le()>Nu&&(a.flags|=128,h=!0,Ol(c,!1),a.lanes=4194304)}else{if(!h)if(n=hu(g),n!==null){if(a.flags|=128,h=!0,n=n.updateQueue,a.updateQueue=n,Cu(a,n),Ol(c,!0),c.tail===null&&c.tailMode==="hidden"&&!g.alternate&&!At)return en(a),null}else 2*Le()-c.renderingStartTime>Nu&&o!==536870912&&(a.flags|=128,h=!0,Ol(c,!1),a.lanes=4194304);c.isBackwards?(g.sibling=a.child,a.child=g):(n=c.last,n!==null?n.sibling=g:a.child=g,c.last=g)}return c.tail!==null?(n=c.tail,c.rendering=n,c.tail=n.sibling,c.renderingStartTime=Le(),n.sibling=null,o=gn.current,$(gn,h?o&1|2:o&1),At&&Ma(a,c.treeForkCount),n):(en(a),null);case 22:case 23:return Sr(a),sh(),c=a.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(a.flags|=8192):c&&(a.flags|=8192),c?(o&536870912)!==0&&(a.flags&128)===0&&(en(a),a.subtreeFlags&6&&(a.flags|=8192)):en(a),o=a.updateQueue,o!==null&&Cu(a,o.retryQueue),o=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==o&&(a.flags|=2048),n!==null&&X(ao),null;case 24:return o=null,n!==null&&(o=n.memoizedState.cache),a.memoizedState.cache!==o&&(a.flags|=2048),Aa(vn),en(a),null;case 25:return null;case 30:return null}throw Error(i(156,a.tag))}function nC(n,a){switch(Gf(a),a.tag){case 1:return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 3:return Aa(vn),ve(),n=a.flags,(n&65536)!==0&&(n&128)===0?(a.flags=n&-65537|128,a):null;case 26:case 27:case 5:return Xe(a),null;case 31:if(a.memoizedState!==null){if(Sr(a),a.alternate===null)throw Error(i(340));to()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 13:if(Sr(a),n=a.memoizedState,n!==null&&n.dehydrated!==null){if(a.alternate===null)throw Error(i(340));to()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 19:return X(gn),null;case 4:return ve(),null;case 10:return Aa(a.type),null;case 22:case 23:return Sr(a),sh(),n!==null&&X(ao),n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 24:return Aa(vn),null;case 25:return null;default:return null}}function Sb(n,a){switch(Gf(a),a.tag){case 3:Aa(vn),ve();break;case 26:case 27:case 5:Xe(a);break;case 4:ve();break;case 31:a.memoizedState!==null&&Sr(a);break;case 13:Sr(a);break;case 19:X(gn);break;case 10:Aa(a.type);break;case 22:case 23:Sr(a),sh(),n!==null&&X(ao);break;case 24:Aa(vn)}}function Ml(n,a){try{var o=a.updateQueue,c=o!==null?o.lastEffect:null;if(c!==null){var h=c.next;o=h;do{if((o.tag&n)===n){c=void 0;var g=o.create,E=o.inst;c=g(),E.destroy=c}o=o.next}while(o!==h)}}catch(A){Yt(a,a.return,A)}}function si(n,a,o){try{var c=a.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var g=h.next;c=g;do{if((c.tag&n)===n){var E=c.inst,A=E.destroy;if(A!==void 0){E.destroy=void 0,h=a;var Y=o,se=A;try{se()}catch(me){Yt(h,Y,me)}}}c=c.next}while(c!==g)}}catch(me){Yt(a,a.return,me)}}function xb(n){var a=n.updateQueue;if(a!==null){var o=n.stateNode;try{fv(a,o)}catch(c){Yt(n,n.return,c)}}}function Eb(n,a,o){o.props=co(n.type,n.memoizedProps),o.state=n.memoizedState;try{o.componentWillUnmount()}catch(c){Yt(n,a,c)}}function Dl(n,a){try{var o=n.ref;if(o!==null){switch(n.tag){case 26:case 27:case 5:var c=n.stateNode;break;case 30:c=n.stateNode;break;default:c=n.stateNode}typeof o=="function"?n.refCleanup=o(c):o.current=c}}catch(h){Yt(n,a,h)}}function sa(n,a){var o=n.ref,c=n.refCleanup;if(o!==null)if(typeof c=="function")try{c()}catch(h){Yt(n,a,h)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(h){Yt(n,a,h)}else o.current=null}function Rb(n){var a=n.type,o=n.memoizedProps,c=n.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":o.autoFocus&&c.focus();break e;case"img":o.src?c.src=o.src:o.srcSet&&(c.srcset=o.srcSet)}}catch(h){Yt(n,n.return,h)}}function jh(n,a,o){try{var c=n.stateNode;RC(c,n.type,o,a),c[Ae]=a}catch(h){Yt(n,n.return,h)}}function Tb(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&mi(n.type)||n.tag===4}function Hh(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Tb(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&mi(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Bh(n,a,o){var c=n.tag;if(c===5||c===6)n=n.stateNode,a?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(n,a):(a=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,a.appendChild(n),o=o._reactRootContainer,o!=null||a.onclick!==null||(a.onclick=Ta));else if(c!==4&&(c===27&&mi(n.type)&&(o=n.stateNode,a=null),n=n.child,n!==null))for(Bh(n,a,o),n=n.sibling;n!==null;)Bh(n,a,o),n=n.sibling}function Ou(n,a,o){var c=n.tag;if(c===5||c===6)n=n.stateNode,a?o.insertBefore(n,a):o.appendChild(n);else if(c!==4&&(c===27&&mi(n.type)&&(o=n.stateNode),n=n.child,n!==null))for(Ou(n,a,o),n=n.sibling;n!==null;)Ou(n,a,o),n=n.sibling}function Cb(n){var a=n.stateNode,o=n.memoizedProps;try{for(var c=n.type,h=a.attributes;h.length;)a.removeAttributeNode(h[0]);jn(a,c,o),a[Me]=n,a[Ae]=o}catch(g){Yt(n,n.return,g)}}var za=!1,Sn=!1,Fh=!1,Ob=typeof WeakSet=="function"?WeakSet:Set,An=null;function rC(n,a){if(n=n.containerInfo,cm=Xu,n=jy(n),zf(n)){if("selectionStart"in n)var o={start:n.selectionStart,end:n.selectionEnd};else e:{o=(o=n.ownerDocument)&&o.defaultView||window;var c=o.getSelection&&o.getSelection();if(c&&c.rangeCount!==0){o=c.anchorNode;var h=c.anchorOffset,g=c.focusNode;c=c.focusOffset;try{o.nodeType,g.nodeType}catch{o=null;break e}var E=0,A=-1,Y=-1,se=0,me=0,ye=n,ce=null;t:for(;;){for(var de;ye!==o||h!==0&&ye.nodeType!==3||(A=E+h),ye!==g||c!==0&&ye.nodeType!==3||(Y=E+c),ye.nodeType===3&&(E+=ye.nodeValue.length),(de=ye.firstChild)!==null;)ce=ye,ye=de;for(;;){if(ye===n)break t;if(ce===o&&++se===h&&(A=E),ce===g&&++me===c&&(Y=E),(de=ye.nextSibling)!==null)break;ye=ce,ce=ye.parentNode}ye=de}o=A===-1||Y===-1?null:{start:A,end:Y}}else o=null}o=o||{start:0,end:0}}else o=null;for(um={focusedElem:n,selectionRange:o},Xu=!1,An=a;An!==null;)if(a=An,n=a.child,(a.subtreeFlags&1028)!==0&&n!==null)n.return=a,An=n;else for(;An!==null;){switch(a=An,g=a.alternate,n=a.flags,a.tag){case 0:if((n&4)!==0&&(n=a.updateQueue,n=n!==null?n.events:null,n!==null))for(o=0;o<n.length;o++)h=n[o],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&g!==null){n=void 0,o=a,h=g.memoizedProps,g=g.memoizedState,c=o.stateNode;try{var je=co(o.type,h);n=c.getSnapshotBeforeUpdate(je,g),c.__reactInternalSnapshotBeforeUpdate=n}catch(nt){Yt(o,o.return,nt)}}break;case 3:if((n&1024)!==0){if(n=a.stateNode.containerInfo,o=n.nodeType,o===9)hm(n);else if(o===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":hm(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(i(163))}if(n=a.sibling,n!==null){n.return=a.return,An=n;break}An=a.return}}function Mb(n,a,o){var c=o.flags;switch(o.tag){case 0:case 11:case 15:Ia(n,o),c&4&&Ml(5,o);break;case 1:if(Ia(n,o),c&4)if(n=o.stateNode,a===null)try{n.componentDidMount()}catch(E){Yt(o,o.return,E)}else{var h=co(o.type,a.memoizedProps);a=a.memoizedState;try{n.componentDidUpdate(h,a,n.__reactInternalSnapshotBeforeUpdate)}catch(E){Yt(o,o.return,E)}}c&64&&xb(o),c&512&&Dl(o,o.return);break;case 3:if(Ia(n,o),c&64&&(n=o.updateQueue,n!==null)){if(a=null,o.child!==null)switch(o.child.tag){case 27:case 5:a=o.child.stateNode;break;case 1:a=o.child.stateNode}try{fv(n,a)}catch(E){Yt(o,o.return,E)}}break;case 27:a===null&&c&4&&Cb(o);case 26:case 5:Ia(n,o),a===null&&c&4&&Rb(o),c&512&&Dl(o,o.return);break;case 12:Ia(n,o);break;case 31:Ia(n,o),c&4&&Nb(n,o);break;case 13:Ia(n,o),c&4&&kb(n,o),c&64&&(n=o.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(o=fC.bind(null,o),kC(n,o))));break;case 22:if(c=o.memoizedState!==null||za,!c){a=a!==null&&a.memoizedState!==null||Sn,h=za;var g=Sn;za=c,(Sn=a)&&!g?Ua(n,o,(o.subtreeFlags&8772)!==0):Ia(n,o),za=h,Sn=g}break;case 30:break;default:Ia(n,o)}}function Db(n){var a=n.alternate;a!==null&&(n.alternate=null,Db(a)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(a=n.stateNode,a!==null&&cn(a)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var nn=null,sr=!1;function Pa(n,a,o){for(o=o.child;o!==null;)Ab(n,a,o),o=o.sibling}function Ab(n,a,o){if(Pe&&typeof Pe.onCommitFiberUnmount=="function")try{Pe.onCommitFiberUnmount(On,o)}catch{}switch(o.tag){case 26:Sn||sa(o,a),Pa(n,a,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:Sn||sa(o,a);var c=nn,h=sr;mi(o.type)&&(nn=o.stateNode,sr=!1),Pa(n,a,o),Ul(o.stateNode),nn=c,sr=h;break;case 5:Sn||sa(o,a);case 6:if(c=nn,h=sr,nn=null,Pa(n,a,o),nn=c,sr=h,nn!==null)if(sr)try{(nn.nodeType===9?nn.body:nn.nodeName==="HTML"?nn.ownerDocument.body:nn).removeChild(o.stateNode)}catch(g){Yt(o,a,g)}else try{nn.removeChild(o.stateNode)}catch(g){Yt(o,a,g)}break;case 18:nn!==null&&(sr?(n=nn,x0(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,o.stateNode),bs(n)):x0(nn,o.stateNode));break;case 4:c=nn,h=sr,nn=o.stateNode.containerInfo,sr=!0,Pa(n,a,o),nn=c,sr=h;break;case 0:case 11:case 14:case 15:si(2,o,a),Sn||si(4,o,a),Pa(n,a,o);break;case 1:Sn||(sa(o,a),c=o.stateNode,typeof c.componentWillUnmount=="function"&&Eb(o,a,c)),Pa(n,a,o);break;case 21:Pa(n,a,o);break;case 22:Sn=(c=Sn)||o.memoizedState!==null,Pa(n,a,o),Sn=c;break;default:Pa(n,a,o)}}function Nb(n,a){if(a.memoizedState===null&&(n=a.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{bs(n)}catch(o){Yt(a,a.return,o)}}}function kb(n,a){if(a.memoizedState===null&&(n=a.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{bs(n)}catch(o){Yt(a,a.return,o)}}function aC(n){switch(n.tag){case 31:case 13:case 19:var a=n.stateNode;return a===null&&(a=n.stateNode=new Ob),a;case 22:return n=n.stateNode,a=n._retryCache,a===null&&(a=n._retryCache=new Ob),a;default:throw Error(i(435,n.tag))}}function Mu(n,a){var o=aC(n);a.forEach(function(c){if(!o.has(c)){o.add(c);var h=hC.bind(null,n,c);c.then(h,h)}})}function lr(n,a){var o=a.deletions;if(o!==null)for(var c=0;c<o.length;c++){var h=o[c],g=n,E=a,A=E;e:for(;A!==null;){switch(A.tag){case 27:if(mi(A.type)){nn=A.stateNode,sr=!1;break e}break;case 5:nn=A.stateNode,sr=!1;break e;case 3:case 4:nn=A.stateNode.containerInfo,sr=!0;break e}A=A.return}if(nn===null)throw Error(i(160));Ab(g,E,h),nn=null,sr=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)_b(a,n),a=a.sibling}var Zr=null;function _b(n,a){var o=n.alternate,c=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:lr(a,n),cr(n),c&4&&(si(3,n,n.return),Ml(3,n),si(5,n,n.return));break;case 1:lr(a,n),cr(n),c&512&&(Sn||o===null||sa(o,o.return)),c&64&&za&&(n=n.updateQueue,n!==null&&(c=n.callbacks,c!==null&&(o=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=o===null?c:o.concat(c))));break;case 26:var h=Zr;if(lr(a,n),cr(n),c&512&&(Sn||o===null||sa(o,o.return)),c&4){var g=o!==null?o.memoizedState:null;if(c=n.memoizedState,o===null)if(c===null)if(n.stateNode===null){e:{c=n.type,o=n.memoizedProps,h=h.ownerDocument||h;t:switch(c){case"title":g=h.getElementsByTagName("title")[0],(!g||g[an]||g[Me]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=h.createElement(c),h.head.insertBefore(g,h.querySelector("head > title"))),jn(g,c,o),g[Me]=n,tn(g),c=g;break e;case"link":var E=_0("link","href",h).get(c+(o.href||""));if(E){for(var A=0;A<E.length;A++)if(g=E[A],g.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&g.getAttribute("rel")===(o.rel==null?null:o.rel)&&g.getAttribute("title")===(o.title==null?null:o.title)&&g.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){E.splice(A,1);break t}}g=h.createElement(c),jn(g,c,o),h.head.appendChild(g);break;case"meta":if(E=_0("meta","content",h).get(c+(o.content||""))){for(A=0;A<E.length;A++)if(g=E[A],g.getAttribute("content")===(o.content==null?null:""+o.content)&&g.getAttribute("name")===(o.name==null?null:o.name)&&g.getAttribute("property")===(o.property==null?null:o.property)&&g.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&g.getAttribute("charset")===(o.charSet==null?null:o.charSet)){E.splice(A,1);break t}}g=h.createElement(c),jn(g,c,o),h.head.appendChild(g);break;default:throw Error(i(468,c))}g[Me]=n,tn(g),c=g}n.stateNode=c}else L0(h,n.type,n.stateNode);else n.stateNode=k0(h,c,n.memoizedProps);else g!==c?(g===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):g.count--,c===null?L0(h,n.type,n.stateNode):k0(h,c,n.memoizedProps)):c===null&&n.stateNode!==null&&jh(n,n.memoizedProps,o.memoizedProps)}break;case 27:lr(a,n),cr(n),c&512&&(Sn||o===null||sa(o,o.return)),o!==null&&c&4&&jh(n,n.memoizedProps,o.memoizedProps);break;case 5:if(lr(a,n),cr(n),c&512&&(Sn||o===null||sa(o,o.return)),n.flags&32){h=n.stateNode;try{Fo(h,"")}catch(je){Yt(n,n.return,je)}}c&4&&n.stateNode!=null&&(h=n.memoizedProps,jh(n,h,o!==null?o.memoizedProps:h)),c&1024&&(Fh=!0);break;case 6:if(lr(a,n),cr(n),c&4){if(n.stateNode===null)throw Error(i(162));c=n.memoizedProps,o=n.stateNode;try{o.nodeValue=c}catch(je){Yt(n,n.return,je)}}break;case 3:if(Yu=null,h=Zr,Zr=Fu(a.containerInfo),lr(a,n),Zr=h,cr(n),c&4&&o!==null&&o.memoizedState.isDehydrated)try{bs(a.containerInfo)}catch(je){Yt(n,n.return,je)}Fh&&(Fh=!1,Lb(n));break;case 4:c=Zr,Zr=Fu(n.stateNode.containerInfo),lr(a,n),cr(n),Zr=c;break;case 12:lr(a,n),cr(n);break;case 31:lr(a,n),cr(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,Mu(n,c)));break;case 13:lr(a,n),cr(n),n.child.flags&8192&&n.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Au=Le()),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,Mu(n,c)));break;case 22:h=n.memoizedState!==null;var Y=o!==null&&o.memoizedState!==null,se=za,me=Sn;if(za=se||h,Sn=me||Y,lr(a,n),Sn=me,za=se,cr(n),c&8192)e:for(a=n.stateNode,a._visibility=h?a._visibility&-2:a._visibility|1,h&&(o===null||Y||za||Sn||uo(n)),o=null,a=n;;){if(a.tag===5||a.tag===26){if(o===null){Y=o=a;try{if(g=Y.stateNode,h)E=g.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{A=Y.stateNode;var ye=Y.memoizedProps.style,ce=ye!=null&&ye.hasOwnProperty("display")?ye.display:null;A.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(je){Yt(Y,Y.return,je)}}}else if(a.tag===6){if(o===null){Y=a;try{Y.stateNode.nodeValue=h?"":Y.memoizedProps}catch(je){Yt(Y,Y.return,je)}}}else if(a.tag===18){if(o===null){Y=a;try{var de=Y.stateNode;h?E0(de,!0):E0(Y.stateNode,!1)}catch(je){Yt(Y,Y.return,je)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===n)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===n)break e;for(;a.sibling===null;){if(a.return===null||a.return===n)break e;o===a&&(o=null),a=a.return}o===a&&(o=null),a.sibling.return=a.return,a=a.sibling}c&4&&(c=n.updateQueue,c!==null&&(o=c.retryQueue,o!==null&&(c.retryQueue=null,Mu(n,o))));break;case 19:lr(a,n),cr(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,Mu(n,c)));break;case 30:break;case 21:break;default:lr(a,n),cr(n)}}function cr(n){var a=n.flags;if(a&2){try{for(var o,c=n.return;c!==null;){if(Tb(c)){o=c;break}c=c.return}if(o==null)throw Error(i(160));switch(o.tag){case 27:var h=o.stateNode,g=Hh(n);Ou(n,g,h);break;case 5:var E=o.stateNode;o.flags&32&&(Fo(E,""),o.flags&=-33);var A=Hh(n);Ou(n,A,E);break;case 3:case 4:var Y=o.stateNode.containerInfo,se=Hh(n);Bh(n,se,Y);break;default:throw Error(i(161))}}catch(me){Yt(n,n.return,me)}n.flags&=-3}a&4096&&(n.flags&=-4097)}function Lb(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var a=n;Lb(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),n=n.sibling}}function Ia(n,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)Mb(n,a.alternate,a),a=a.sibling}function uo(n){for(n=n.child;n!==null;){var a=n;switch(a.tag){case 0:case 11:case 14:case 15:si(4,a,a.return),uo(a);break;case 1:sa(a,a.return);var o=a.stateNode;typeof o.componentWillUnmount=="function"&&Eb(a,a.return,o),uo(a);break;case 27:Ul(a.stateNode);case 26:case 5:sa(a,a.return),uo(a);break;case 22:a.memoizedState===null&&uo(a);break;case 30:uo(a);break;default:uo(a)}n=n.sibling}}function Ua(n,a,o){for(o=o&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var c=a.alternate,h=n,g=a,E=g.flags;switch(g.tag){case 0:case 11:case 15:Ua(h,g,o),Ml(4,g);break;case 1:if(Ua(h,g,o),c=g,h=c.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(se){Yt(c,c.return,se)}if(c=g,h=c.updateQueue,h!==null){var A=c.stateNode;try{var Y=h.shared.hiddenCallbacks;if(Y!==null)for(h.shared.hiddenCallbacks=null,h=0;h<Y.length;h++)dv(Y[h],A)}catch(se){Yt(c,c.return,se)}}o&&E&64&&xb(g),Dl(g,g.return);break;case 27:Cb(g);case 26:case 5:Ua(h,g,o),o&&c===null&&E&4&&Rb(g),Dl(g,g.return);break;case 12:Ua(h,g,o);break;case 31:Ua(h,g,o),o&&E&4&&Nb(h,g);break;case 13:Ua(h,g,o),o&&E&4&&kb(h,g);break;case 22:g.memoizedState===null&&Ua(h,g,o),Dl(g,g.return);break;case 30:break;default:Ua(h,g,o)}a=a.sibling}}function Vh(n,a){var o=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),n=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(n=a.memoizedState.cachePool.pool),n!==o&&(n!=null&&n.refCount++,o!=null&&pl(o))}function Yh(n,a){n=null,a.alternate!==null&&(n=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==n&&(a.refCount++,n!=null&&pl(n))}function Jr(n,a,o,c){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)zb(n,a,o,c),a=a.sibling}function zb(n,a,o,c){var h=a.flags;switch(a.tag){case 0:case 11:case 15:Jr(n,a,o,c),h&2048&&Ml(9,a);break;case 1:Jr(n,a,o,c);break;case 3:Jr(n,a,o,c),h&2048&&(n=null,a.alternate!==null&&(n=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==n&&(a.refCount++,n!=null&&pl(n)));break;case 12:if(h&2048){Jr(n,a,o,c),n=a.stateNode;try{var g=a.memoizedProps,E=g.id,A=g.onPostCommit;typeof A=="function"&&A(E,a.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(Y){Yt(a,a.return,Y)}}else Jr(n,a,o,c);break;case 31:Jr(n,a,o,c);break;case 13:Jr(n,a,o,c);break;case 23:break;case 22:g=a.stateNode,E=a.alternate,a.memoizedState!==null?g._visibility&2?Jr(n,a,o,c):Al(n,a):g._visibility&2?Jr(n,a,o,c):(g._visibility|=2,ls(n,a,o,c,(a.subtreeFlags&10256)!==0||!1)),h&2048&&Vh(E,a);break;case 24:Jr(n,a,o,c),h&2048&&Yh(a.alternate,a);break;default:Jr(n,a,o,c)}}function ls(n,a,o,c,h){for(h=h&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var g=n,E=a,A=o,Y=c,se=E.flags;switch(E.tag){case 0:case 11:case 15:ls(g,E,A,Y,h),Ml(8,E);break;case 23:break;case 22:var me=E.stateNode;E.memoizedState!==null?me._visibility&2?ls(g,E,A,Y,h):Al(g,E):(me._visibility|=2,ls(g,E,A,Y,h)),h&&se&2048&&Vh(E.alternate,E);break;case 24:ls(g,E,A,Y,h),h&&se&2048&&Yh(E.alternate,E);break;default:ls(g,E,A,Y,h)}a=a.sibling}}function Al(n,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var o=n,c=a,h=c.flags;switch(c.tag){case 22:Al(o,c),h&2048&&Vh(c.alternate,c);break;case 24:Al(o,c),h&2048&&Yh(c.alternate,c);break;default:Al(o,c)}a=a.sibling}}var Nl=8192;function cs(n,a,o){if(n.subtreeFlags&Nl)for(n=n.child;n!==null;)Pb(n,a,o),n=n.sibling}function Pb(n,a,o){switch(n.tag){case 26:cs(n,a,o),n.flags&Nl&&n.memoizedState!==null&&YC(o,Zr,n.memoizedState,n.memoizedProps);break;case 5:cs(n,a,o);break;case 3:case 4:var c=Zr;Zr=Fu(n.stateNode.containerInfo),cs(n,a,o),Zr=c;break;case 22:n.memoizedState===null&&(c=n.alternate,c!==null&&c.memoizedState!==null?(c=Nl,Nl=16777216,cs(n,a,o),Nl=c):cs(n,a,o));break;default:cs(n,a,o)}}function Ib(n){var a=n.alternate;if(a!==null&&(n=a.child,n!==null)){a.child=null;do a=n.sibling,n.sibling=null,n=a;while(n!==null)}}function kl(n){var a=n.deletions;if((n.flags&16)!==0){if(a!==null)for(var o=0;o<a.length;o++){var c=a[o];An=c,jb(c,n)}Ib(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Ub(n),n=n.sibling}function Ub(n){switch(n.tag){case 0:case 11:case 15:kl(n),n.flags&2048&&si(9,n,n.return);break;case 3:kl(n);break;case 12:kl(n);break;case 22:var a=n.stateNode;n.memoizedState!==null&&a._visibility&2&&(n.return===null||n.return.tag!==13)?(a._visibility&=-3,Du(n)):kl(n);break;default:kl(n)}}function Du(n){var a=n.deletions;if((n.flags&16)!==0){if(a!==null)for(var o=0;o<a.length;o++){var c=a[o];An=c,jb(c,n)}Ib(n)}for(n=n.child;n!==null;){switch(a=n,a.tag){case 0:case 11:case 15:si(8,a,a.return),Du(a);break;case 22:o=a.stateNode,o._visibility&2&&(o._visibility&=-3,Du(a));break;default:Du(a)}n=n.sibling}}function jb(n,a){for(;An!==null;){var o=An;switch(o.tag){case 0:case 11:case 15:si(8,o,a);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var c=o.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:pl(o.memoizedState.cache)}if(c=o.child,c!==null)c.return=o,An=c;else e:for(o=n;An!==null;){c=An;var h=c.sibling,g=c.return;if(Db(c),c===o){An=null;break e}if(h!==null){h.return=g,An=h;break e}An=g}}}var iC={getCacheForType:function(n){var a=In(vn),o=a.data.get(n);return o===void 0&&(o=n(),a.data.set(n,o)),o},cacheSignal:function(){return In(vn).controller.signal}},oC=typeof WeakMap=="function"?WeakMap:Map,Ut=0,$t=null,xt=null,Rt=0,Vt=0,xr=null,li=!1,us=!1,qh=!1,ja=0,fn=0,ci=0,fo=0,Gh=0,Er=0,ds=0,_l=null,ur=null,Kh=!1,Au=0,Hb=0,Nu=1/0,ku=null,ui=null,Tn=0,di=null,fs=null,Ha=0,Xh=0,Wh=null,Bb=null,Ll=0,$h=null;function Rr(){return(Ut&2)!==0&&Rt!==0?Rt&-Rt:_.T!==null?nm():Ce()}function Fb(){if(Er===0)if((Rt&536870912)===0||At){var n=et;et<<=1,(et&3932160)===0&&(et=262144),Er=n}else Er=536870912;return n=wr.current,n!==null&&(n.flags|=32),Er}function dr(n,a,o){(n===$t&&(Vt===2||Vt===9)||n.cancelPendingCommit!==null)&&(hs(n,0),fi(n,Rt,Er,!1)),Gt(n,o),((Ut&2)===0||n!==$t)&&(n===$t&&((Ut&2)===0&&(fo|=o),fn===4&&fi(n,Rt,Er,!1)),la(n))}function Vb(n,a,o){if((Ut&6)!==0)throw Error(i(327));var c=!o&&(a&127)===0&&(a&n.expiredLanes)===0||It(n,a),h=c?cC(n,a):Zh(n,a,!0),g=c;do{if(h===0){us&&!c&&fi(n,a,0,!1);break}else{if(o=n.current.alternate,g&&!sC(o)){h=Zh(n,a,!1),g=!1;continue}if(h===2){if(g=a,n.errorRecoveryDisabledLanes&g)var E=0;else E=n.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){a=E;e:{var A=n;h=_l;var Y=A.current.memoizedState.isDehydrated;if(Y&&(hs(A,E).flags|=256),E=Zh(A,E,!1),E!==2){if(qh&&!Y){A.errorRecoveryDisabledLanes|=g,fo|=g,h=4;break e}g=ur,ur=h,g!==null&&(ur===null?ur=g:ur.push.apply(ur,g))}h=E}if(g=!1,h!==2)continue}}if(h===1){hs(n,0),fi(n,a,0,!0);break}e:{switch(c=n,g=h,g){case 0:case 1:throw Error(i(345));case 4:if((a&4194048)!==a)break;case 6:fi(c,a,Er,!li);break e;case 2:ur=null;break;case 3:case 5:break;default:throw Error(i(329))}if((a&62914560)===a&&(h=Au+300-Le(),10<h)){if(fi(c,a,Er,!li),Ke(c,0,!0)!==0)break e;Ha=a,c.timeoutHandle=w0(Yb.bind(null,c,o,ur,ku,Kh,a,Er,fo,ds,li,g,"Throttled",-0,0),h);break e}Yb(c,o,ur,ku,Kh,a,Er,fo,ds,li,g,null,-0,0)}}break}while(!0);la(n)}function Yb(n,a,o,c,h,g,E,A,Y,se,me,ye,ce,de){if(n.timeoutHandle=-1,ye=a.subtreeFlags,ye&8192||(ye&16785408)===16785408){ye={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ta},Pb(a,g,ye);var je=(g&62914560)===g?Au-Le():(g&4194048)===g?Hb-Le():0;if(je=qC(ye,je),je!==null){Ha=g,n.cancelPendingCommit=je(Zb.bind(null,n,a,g,o,c,h,E,A,Y,me,ye,null,ce,de)),fi(n,g,E,!se);return}}Zb(n,a,g,o,c,h,E,A,Y)}function sC(n){for(var a=n;;){var o=a.tag;if((o===0||o===11||o===15)&&a.flags&16384&&(o=a.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var c=0;c<o.length;c++){var h=o[c],g=h.getSnapshot;h=h.value;try{if(!vr(g(),h))return!1}catch{return!1}}if(o=a.child,a.subtreeFlags&16384&&o!==null)o.return=a,a=o;else{if(a===n)break;for(;a.sibling===null;){if(a.return===null||a.return===n)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function fi(n,a,o,c){a&=~Gh,a&=~fo,n.suspendedLanes|=a,n.pingedLanes&=~a,c&&(n.warmLanes|=a),c=n.expirationTimes;for(var h=a;0<h;){var g=31-gt(h),E=1<<g;c[g]=-1,h&=~E}o!==0&&Kr(n,o,a)}function _u(){return(Ut&6)===0?(zl(0),!1):!0}function Qh(){if(xt!==null){if(Vt===0)var n=xt.return;else n=xt,Da=no=null,hh(n),rs=null,yl=0,n=xt;for(;n!==null;)Sb(n.alternate,n),n=n.return;xt=null}}function hs(n,a){var o=n.timeoutHandle;o!==-1&&(n.timeoutHandle=-1,OC(o)),o=n.cancelPendingCommit,o!==null&&(n.cancelPendingCommit=null,o()),Ha=0,Qh(),$t=n,xt=o=Oa(n.current,null),Rt=a,Vt=0,xr=null,li=!1,us=It(n,a),qh=!1,ds=Er=Gh=fo=ci=fn=0,ur=_l=null,Kh=!1,(a&8)!==0&&(a|=a&32);var c=n.entangledLanes;if(c!==0)for(n=n.entanglements,c&=a;0<c;){var h=31-gt(c),g=1<<h;a|=n[h],c&=~g}return ja=a,eu(),o}function qb(n,a){dt=null,_.H=Tl,a===ns||a===lu?(a=sv(),Vt=3):a===th?(a=sv(),Vt=4):Vt=a===Dh?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,xr=a,xt===null&&(fn=1,xu(n,kr(a,n.current)))}function Gb(){var n=wr.current;return n===null?!0:(Rt&4194048)===Rt?Pr===null:(Rt&62914560)===Rt||(Rt&536870912)!==0?n===Pr:!1}function Kb(){var n=_.H;return _.H=Tl,n===null?Tl:n}function Xb(){var n=_.A;return _.A=iC,n}function Lu(){fn=4,li||(Rt&4194048)!==Rt&&wr.current!==null||(us=!0),(ci&134217727)===0&&(fo&134217727)===0||$t===null||fi($t,Rt,Er,!1)}function Zh(n,a,o){var c=Ut;Ut|=2;var h=Kb(),g=Xb();($t!==n||Rt!==a)&&(ku=null,hs(n,a)),a=!1;var E=fn;e:do try{if(Vt!==0&&xt!==null){var A=xt,Y=xr;switch(Vt){case 8:Qh(),E=6;break e;case 3:case 2:case 9:case 6:wr.current===null&&(a=!0);var se=Vt;if(Vt=0,xr=null,ms(n,A,Y,se),o&&us){E=0;break e}break;default:se=Vt,Vt=0,xr=null,ms(n,A,Y,se)}}lC(),E=fn;break}catch(me){qb(n,me)}while(!0);return a&&n.shellSuspendCounter++,Da=no=null,Ut=c,_.H=h,_.A=g,xt===null&&($t=null,Rt=0,eu()),E}function lC(){for(;xt!==null;)Wb(xt)}function cC(n,a){var o=Ut;Ut|=2;var c=Kb(),h=Xb();$t!==n||Rt!==a?(ku=null,Nu=Le()+500,hs(n,a)):us=It(n,a);e:do try{if(Vt!==0&&xt!==null){a=xt;var g=xr;t:switch(Vt){case 1:Vt=0,xr=null,ms(n,a,g,1);break;case 2:case 9:if(iv(g)){Vt=0,xr=null,$b(a);break}a=function(){Vt!==2&&Vt!==9||$t!==n||(Vt=7),la(n)},g.then(a,a);break e;case 3:Vt=7;break e;case 4:Vt=5;break e;case 7:iv(g)?(Vt=0,xr=null,$b(a)):(Vt=0,xr=null,ms(n,a,g,7));break;case 5:var E=null;switch(xt.tag){case 26:E=xt.memoizedState;case 5:case 27:var A=xt;if(E?z0(E):A.stateNode.complete){Vt=0,xr=null;var Y=A.sibling;if(Y!==null)xt=Y;else{var se=A.return;se!==null?(xt=se,zu(se)):xt=null}break t}}Vt=0,xr=null,ms(n,a,g,5);break;case 6:Vt=0,xr=null,ms(n,a,g,6);break;case 8:Qh(),fn=6;break e;default:throw Error(i(462))}}uC();break}catch(me){qb(n,me)}while(!0);return Da=no=null,_.H=c,_.A=h,Ut=o,xt!==null?0:($t=null,Rt=0,eu(),fn)}function uC(){for(;xt!==null&&!qe();)Wb(xt)}function Wb(n){var a=bb(n.alternate,n,ja);n.memoizedProps=n.pendingProps,a===null?zu(n):xt=a}function $b(n){var a=n,o=a.alternate;switch(a.tag){case 15:case 0:a=hb(o,a,a.pendingProps,a.type,void 0,Rt);break;case 11:a=hb(o,a,a.pendingProps,a.type.render,a.ref,Rt);break;case 5:hh(a);default:Sb(o,a),a=xt=Xy(a,ja),a=bb(o,a,ja)}n.memoizedProps=n.pendingProps,a===null?zu(n):xt=a}function ms(n,a,o,c){Da=no=null,hh(a),rs=null,yl=0;var h=a.return;try{if(ZT(n,h,a,o,Rt)){fn=1,xu(n,kr(o,n.current)),xt=null;return}}catch(g){if(h!==null)throw xt=h,g;fn=1,xu(n,kr(o,n.current)),xt=null;return}a.flags&32768?(At||c===1?n=!0:us||(Rt&536870912)!==0?n=!1:(li=n=!0,(c===2||c===9||c===3||c===6)&&(c=wr.current,c!==null&&c.tag===13&&(c.flags|=16384))),Qb(a,n)):zu(a)}function zu(n){var a=n;do{if((a.flags&32768)!==0){Qb(a,li);return}n=a.return;var o=tC(a.alternate,a,ja);if(o!==null){xt=o;return}if(a=a.sibling,a!==null){xt=a;return}xt=a=n}while(a!==null);fn===0&&(fn=5)}function Qb(n,a){do{var o=nC(n.alternate,n);if(o!==null){o.flags&=32767,xt=o;return}if(o=n.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!a&&(n=n.sibling,n!==null)){xt=n;return}xt=n=o}while(n!==null);fn=6,xt=null}function Zb(n,a,o,c,h,g,E,A,Y){n.cancelPendingCommit=null;do Pu();while(Tn!==0);if((Ut&6)!==0)throw Error(i(327));if(a!==null){if(a===n.current)throw Error(i(177));if(g=a.lanes|a.childLanes,g|=Hf,Mn(n,o,g,E,A,Y),n===$t&&(xt=$t=null,Rt=0),fs=a,di=n,Ha=o,Xh=g,Wh=h,Bb=c,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,mC(tt,function(){return r0(),null})):(n.callbackNode=null,n.callbackPriority=0),c=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||c){c=_.T,_.T=null,h=j.p,j.p=2,E=Ut,Ut|=4;try{rC(n,a,o)}finally{Ut=E,j.p=h,_.T=c}}Tn=1,Jb(),e0(),t0()}}function Jb(){if(Tn===1){Tn=0;var n=di,a=fs,o=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||o){o=_.T,_.T=null;var c=j.p;j.p=2;var h=Ut;Ut|=4;try{_b(a,n);var g=um,E=jy(n.containerInfo),A=g.focusedElem,Y=g.selectionRange;if(E!==A&&A&&A.ownerDocument&&Uy(A.ownerDocument.documentElement,A)){if(Y!==null&&zf(A)){var se=Y.start,me=Y.end;if(me===void 0&&(me=se),"selectionStart"in A)A.selectionStart=se,A.selectionEnd=Math.min(me,A.value.length);else{var ye=A.ownerDocument||document,ce=ye&&ye.defaultView||window;if(ce.getSelection){var de=ce.getSelection(),je=A.textContent.length,nt=Math.min(Y.start,je),Wt=Y.end===void 0?nt:Math.min(Y.end,je);!de.extend&&nt>Wt&&(E=Wt,Wt=nt,nt=E);var ee=Iy(A,nt),K=Iy(A,Wt);if(ee&&K&&(de.rangeCount!==1||de.anchorNode!==ee.node||de.anchorOffset!==ee.offset||de.focusNode!==K.node||de.focusOffset!==K.offset)){var oe=ye.createRange();oe.setStart(ee.node,ee.offset),de.removeAllRanges(),nt>Wt?(de.addRange(oe),de.extend(K.node,K.offset)):(oe.setEnd(K.node,K.offset),de.addRange(oe))}}}}for(ye=[],de=A;de=de.parentNode;)de.nodeType===1&&ye.push({element:de,left:de.scrollLeft,top:de.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<ye.length;A++){var ge=ye[A];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}Xu=!!cm,um=cm=null}finally{Ut=h,j.p=c,_.T=o}}n.current=a,Tn=2}}function e0(){if(Tn===2){Tn=0;var n=di,a=fs,o=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||o){o=_.T,_.T=null;var c=j.p;j.p=2;var h=Ut;Ut|=4;try{Mb(n,a.alternate,a)}finally{Ut=h,j.p=c,_.T=o}}Tn=3}}function t0(){if(Tn===4||Tn===3){Tn=0,Ge();var n=di,a=fs,o=Ha,c=Bb;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Tn=5:(Tn=0,fs=di=null,n0(n,n.pendingLanes));var h=n.pendingLanes;if(h===0&&(ui=null),be(o),a=a.stateNode,Pe&&typeof Pe.onCommitFiberRoot=="function")try{Pe.onCommitFiberRoot(On,a,void 0,(a.current.flags&128)===128)}catch{}if(c!==null){a=_.T,h=j.p,j.p=2,_.T=null;try{for(var g=n.onRecoverableError,E=0;E<c.length;E++){var A=c[E];g(A.value,{componentStack:A.stack})}}finally{_.T=a,j.p=h}}(Ha&3)!==0&&Pu(),la(n),h=n.pendingLanes,(o&261930)!==0&&(h&42)!==0?n===$h?Ll++:(Ll=0,$h=n):Ll=0,zl(0)}}function n0(n,a){(n.pooledCacheLanes&=a)===0&&(a=n.pooledCache,a!=null&&(n.pooledCache=null,pl(a)))}function Pu(){return Jb(),e0(),t0(),r0()}function r0(){if(Tn!==5)return!1;var n=di,a=Xh;Xh=0;var o=be(Ha),c=_.T,h=j.p;try{j.p=32>o?32:o,_.T=null,o=Wh,Wh=null;var g=di,E=Ha;if(Tn=0,fs=di=null,Ha=0,(Ut&6)!==0)throw Error(i(331));var A=Ut;if(Ut|=4,Ub(g.current),zb(g,g.current,E,o),Ut=A,zl(0,!1),Pe&&typeof Pe.onPostCommitFiberRoot=="function")try{Pe.onPostCommitFiberRoot(On,g)}catch{}return!0}finally{j.p=h,_.T=c,n0(n,a)}}function a0(n,a,o){a=kr(o,a),a=Mh(n.stateNode,a,2),n=ai(n,a,2),n!==null&&(Gt(n,2),la(n))}function Yt(n,a,o){if(n.tag===3)a0(n,n,o);else for(;a!==null;){if(a.tag===3){a0(a,n,o);break}else if(a.tag===1){var c=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(ui===null||!ui.has(c))){n=kr(o,n),o=ib(2),c=ai(a,o,2),c!==null&&(ob(o,c,a,n),Gt(c,2),la(c));break}}a=a.return}}function Jh(n,a,o){var c=n.pingCache;if(c===null){c=n.pingCache=new oC;var h=new Set;c.set(a,h)}else h=c.get(a),h===void 0&&(h=new Set,c.set(a,h));h.has(o)||(qh=!0,h.add(o),n=dC.bind(null,n,a,o),a.then(n,n))}function dC(n,a,o){var c=n.pingCache;c!==null&&c.delete(a),n.pingedLanes|=n.suspendedLanes&o,n.warmLanes&=~o,$t===n&&(Rt&o)===o&&(fn===4||fn===3&&(Rt&62914560)===Rt&&300>Le()-Au?(Ut&2)===0&&hs(n,0):Gh|=o,ds===Rt&&(ds=0)),la(n)}function i0(n,a){a===0&&(a=qt()),n=Ji(n,a),n!==null&&(Gt(n,a),la(n))}function fC(n){var a=n.memoizedState,o=0;a!==null&&(o=a.retryLane),i0(n,o)}function hC(n,a){var o=0;switch(n.tag){case 31:case 13:var c=n.stateNode,h=n.memoizedState;h!==null&&(o=h.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error(i(314))}c!==null&&c.delete(a),i0(n,o)}function mC(n,a){return De(n,a)}var Iu=null,ps=null,em=!1,Uu=!1,tm=!1,hi=0;function la(n){n!==ps&&n.next===null&&(ps===null?Iu=ps=n:ps=ps.next=n),Uu=!0,em||(em=!0,gC())}function zl(n,a){if(!tm&&Uu){tm=!0;do for(var o=!1,c=Iu;c!==null;){if(n!==0){var h=c.pendingLanes;if(h===0)var g=0;else{var E=c.suspendedLanes,A=c.pingedLanes;g=(1<<31-gt(42|n)+1)-1,g&=h&~(E&~A),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(o=!0,c0(c,g))}else g=Rt,g=Ke(c,c===$t?g:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(g&3)===0||It(c,g)||(o=!0,c0(c,g));c=c.next}while(o);tm=!1}}function pC(){o0()}function o0(){Uu=em=!1;var n=0;hi!==0&&CC()&&(n=hi);for(var a=Le(),o=null,c=Iu;c!==null;){var h=c.next,g=s0(c,a);g===0?(c.next=null,o===null?Iu=h:o.next=h,h===null&&(ps=o)):(o=c,(n!==0||(g&3)!==0)&&(Uu=!0)),c=h}Tn!==0&&Tn!==5||zl(n),hi!==0&&(hi=0)}function s0(n,a){for(var o=n.suspendedLanes,c=n.pingedLanes,h=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var E=31-gt(g),A=1<<E,Y=h[E];Y===-1?((A&o)===0||(A&c)!==0)&&(h[E]=Zt(A,a)):Y<=a&&(n.expiredLanes|=A),g&=~A}if(a=$t,o=Rt,o=Ke(n,n===a?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c=n.callbackNode,o===0||n===a&&(Vt===2||Vt===9)||n.cancelPendingCommit!==null)return c!==null&&c!==null&&xe(c),n.callbackNode=null,n.callbackPriority=0;if((o&3)===0||It(n,o)){if(a=o&-o,a===n.callbackPriority)return a;switch(c!==null&&xe(c),be(o)){case 2:case 8:o=Ft;break;case 32:o=tt;break;case 268435456:o=Ct;break;default:o=tt}return c=l0.bind(null,n),o=De(o,c),n.callbackPriority=a,n.callbackNode=o,a}return c!==null&&c!==null&&xe(c),n.callbackPriority=2,n.callbackNode=null,2}function l0(n,a){if(Tn!==0&&Tn!==5)return n.callbackNode=null,n.callbackPriority=0,null;var o=n.callbackNode;if(Pu()&&n.callbackNode!==o)return null;var c=Rt;return c=Ke(n,n===$t?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c===0?null:(Vb(n,c,a),s0(n,Le()),n.callbackNode!=null&&n.callbackNode===o?l0.bind(null,n):null)}function c0(n,a){if(Pu())return null;Vb(n,a,!0)}function gC(){MC(function(){(Ut&6)!==0?De(Pt,pC):o0()})}function nm(){if(hi===0){var n=es;n===0&&(n=wt,wt<<=1,(wt&261888)===0&&(wt=256)),hi=n}return hi}function u0(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Gc(""+n)}function d0(n,a){var o=a.ownerDocument.createElement("input");return o.name=a.name,o.value=a.value,n.id&&o.setAttribute("form",n.id),a.parentNode.insertBefore(o,a),n=new FormData(n),o.parentNode.removeChild(o),n}function yC(n,a,o,c,h){if(a==="submit"&&o&&o.stateNode===h){var g=u0((h[Ae]||null).action),E=c.submitter;E&&(a=(a=E[Ae]||null)?u0(a.formAction):E.getAttribute("formAction"),a!==null&&(g=a,E=null));var A=new $c("action","action",null,c,h);n.push({event:A,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(hi!==0){var Y=E?d0(h,E):new FormData(h);xh(o,{pending:!0,data:Y,method:h.method,action:g},null,Y)}}else typeof g=="function"&&(A.preventDefault(),Y=E?d0(h,E):new FormData(h),xh(o,{pending:!0,data:Y,method:h.method,action:g},g,Y))},currentTarget:h}]})}}for(var rm=0;rm<jf.length;rm++){var am=jf[rm],vC=am.toLowerCase(),bC=am[0].toUpperCase()+am.slice(1);Qr(vC,"on"+bC)}Qr(Fy,"onAnimationEnd"),Qr(Vy,"onAnimationIteration"),Qr(Yy,"onAnimationStart"),Qr("dblclick","onDoubleClick"),Qr("focusin","onFocus"),Qr("focusout","onBlur"),Qr(zT,"onTransitionRun"),Qr(PT,"onTransitionStart"),Qr(IT,"onTransitionCancel"),Qr(qy,"onTransitionEnd"),Dr("onMouseEnter",["mouseout","mouseover"]),Dr("onMouseLeave",["mouseout","mouseover"]),Dr("onPointerEnter",["pointerout","pointerover"]),Dr("onPointerLeave",["pointerout","pointerover"]),Wr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Wr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Wr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Wr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Wr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Wr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),wC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Pl));function f0(n,a){a=(a&4)!==0;for(var o=0;o<n.length;o++){var c=n[o],h=c.event;c=c.listeners;e:{var g=void 0;if(a)for(var E=c.length-1;0<=E;E--){var A=c[E],Y=A.instance,se=A.currentTarget;if(A=A.listener,Y!==g&&h.isPropagationStopped())break e;g=A,h.currentTarget=se;try{g(h)}catch(me){Jc(me)}h.currentTarget=null,g=Y}else for(E=0;E<c.length;E++){if(A=c[E],Y=A.instance,se=A.currentTarget,A=A.listener,Y!==g&&h.isPropagationStopped())break e;g=A,h.currentTarget=se;try{g(h)}catch(me){Jc(me)}h.currentTarget=null,g=Y}}}}function Et(n,a){var o=a[at];o===void 0&&(o=a[at]=new Set);var c=n+"__bubble";o.has(c)||(h0(a,n,2,!1),o.add(c))}function im(n,a,o){var c=0;a&&(c|=4),h0(o,n,c,a)}var ju="_reactListening"+Math.random().toString(36).slice(2);function om(n){if(!n[ju]){n[ju]=!0,Xr.forEach(function(o){o!=="selectionchange"&&(wC.has(o)||im(o,!1,n),im(o,!0,n))});var a=n.nodeType===9?n:n.ownerDocument;a===null||a[ju]||(a[ju]=!0,im("selectionchange",!1,a))}}function h0(n,a,o,c){switch(F0(a)){case 2:var h=XC;break;case 8:h=WC;break;default:h=Sm}o=h.bind(null,a,o,n),h=void 0,!Cf||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(h=!0),c?h!==void 0?n.addEventListener(a,o,{capture:!0,passive:h}):n.addEventListener(a,o,!0):h!==void 0?n.addEventListener(a,o,{passive:h}):n.addEventListener(a,o,!1)}function sm(n,a,o,c,h){var g=c;if((a&1)===0&&(a&2)===0&&c!==null)e:for(;;){if(c===null)return;var E=c.tag;if(E===3||E===4){var A=c.stateNode.containerInfo;if(A===h)break;if(E===4)for(E=c.return;E!==null;){var Y=E.tag;if((Y===3||Y===4)&&E.stateNode.containerInfo===h)return;E=E.return}for(;A!==null;){if(E=un(A),E===null)return;if(Y=E.tag,Y===5||Y===6||Y===26||Y===27){c=g=E;continue e}A=A.parentNode}}c=c.return}vy(function(){var se=g,me=Rf(o),ye=[];e:{var ce=Gy.get(n);if(ce!==void 0){var de=$c,je=n;switch(n){case"keypress":if(Xc(o)===0)break e;case"keydown":case"keyup":de=hT;break;case"focusin":je="focus",de=Af;break;case"focusout":je="blur",de=Af;break;case"beforeblur":case"afterblur":de=Af;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":de=Sy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=tT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=gT;break;case Fy:case Vy:case Yy:de=aT;break;case qy:de=vT;break;case"scroll":case"scrollend":de=JR;break;case"wheel":de=wT;break;case"copy":case"cut":case"paste":de=oT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=Ey;break;case"toggle":case"beforetoggle":de=xT}var nt=(a&4)!==0,Wt=!nt&&(n==="scroll"||n==="scrollend"),ee=nt?ce!==null?ce+"Capture":null:ce;nt=[];for(var K=se,oe;K!==null;){var ge=K;if(oe=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||oe===null||ee===null||(ge=al(K,ee),ge!=null&&nt.push(Il(K,ge,oe))),Wt)break;K=K.return}0<nt.length&&(ce=new de(ce,je,null,o,me),ye.push({event:ce,listeners:nt}))}}if((a&7)===0){e:{if(ce=n==="mouseover"||n==="pointerover",de=n==="mouseout"||n==="pointerout",ce&&o!==Ef&&(je=o.relatedTarget||o.fromElement)&&(un(je)||je[Ue]))break e;if((de||ce)&&(ce=me.window===me?me:(ce=me.ownerDocument)?ce.defaultView||ce.parentWindow:window,de?(je=o.relatedTarget||o.toElement,de=se,je=je?un(je):null,je!==null&&(Wt=l(je),nt=je.tag,je!==Wt||nt!==5&&nt!==27&&nt!==6)&&(je=null)):(de=null,je=se),de!==je)){if(nt=Sy,ge="onMouseLeave",ee="onMouseEnter",K="mouse",(n==="pointerout"||n==="pointerover")&&(nt=Ey,ge="onPointerLeave",ee="onPointerEnter",K="pointer"),Wt=de==null?ce:Dn(de),oe=je==null?ce:Dn(je),ce=new nt(ge,K+"leave",de,o,me),ce.target=Wt,ce.relatedTarget=oe,ge=null,un(me)===se&&(nt=new nt(ee,K+"enter",je,o,me),nt.target=oe,nt.relatedTarget=Wt,ge=nt),Wt=ge,de&&je)t:{for(nt=SC,ee=de,K=je,oe=0,ge=ee;ge;ge=nt(ge))oe++;ge=0;for(var Ze=K;Ze;Ze=nt(Ze))ge++;for(;0<oe-ge;)ee=nt(ee),oe--;for(;0<ge-oe;)K=nt(K),ge--;for(;oe--;){if(ee===K||K!==null&&ee===K.alternate){nt=ee;break t}ee=nt(ee),K=nt(K)}nt=null}else nt=null;de!==null&&m0(ye,ce,de,nt,!1),je!==null&&Wt!==null&&m0(ye,Wt,je,nt,!0)}}e:{if(ce=se?Dn(se):window,de=ce.nodeName&&ce.nodeName.toLowerCase(),de==="select"||de==="input"&&ce.type==="file")var _t=Ny;else if(Dy(ce))if(ky)_t=kT;else{_t=AT;var $e=DT}else de=ce.nodeName,!de||de.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?se&&xf(se.elementType)&&(_t=Ny):_t=NT;if(_t&&(_t=_t(n,se))){Ay(ye,_t,o,me);break e}$e&&$e(n,ce,se),n==="focusout"&&se&&ce.type==="number"&&se.memoizedProps.value!=null&&Sf(ce,"number",ce.value)}switch($e=se?Dn(se):window,n){case"focusin":(Dy($e)||$e.contentEditable==="true")&&(Go=$e,Pf=se,fl=null);break;case"focusout":fl=Pf=Go=null;break;case"mousedown":If=!0;break;case"contextmenu":case"mouseup":case"dragend":If=!1,Hy(ye,o,me);break;case"selectionchange":if(LT)break;case"keydown":case"keyup":Hy(ye,o,me)}var ht;if(kf)e:{switch(n){case"compositionstart":var Tt="onCompositionStart";break e;case"compositionend":Tt="onCompositionEnd";break e;case"compositionupdate":Tt="onCompositionUpdate";break e}Tt=void 0}else qo?Oy(n,o)&&(Tt="onCompositionEnd"):n==="keydown"&&o.keyCode===229&&(Tt="onCompositionStart");Tt&&(Ry&&o.locale!=="ko"&&(qo||Tt!=="onCompositionStart"?Tt==="onCompositionEnd"&&qo&&(ht=by()):(Qa=me,Of="value"in Qa?Qa.value:Qa.textContent,qo=!0)),$e=Hu(se,Tt),0<$e.length&&(Tt=new xy(Tt,n,null,o,me),ye.push({event:Tt,listeners:$e}),ht?Tt.data=ht:(ht=My(o),ht!==null&&(Tt.data=ht)))),(ht=RT?TT(n,o):CT(n,o))&&(Tt=Hu(se,"onBeforeInput"),0<Tt.length&&($e=new xy("onBeforeInput","beforeinput",null,o,me),ye.push({event:$e,listeners:Tt}),$e.data=ht)),yC(ye,n,se,o,me)}f0(ye,a)})}function Il(n,a,o){return{instance:n,listener:a,currentTarget:o}}function Hu(n,a){for(var o=a+"Capture",c=[];n!==null;){var h=n,g=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||g===null||(h=al(n,o),h!=null&&c.unshift(Il(n,h,g)),h=al(n,a),h!=null&&c.push(Il(n,h,g))),n.tag===3)return c;n=n.return}return[]}function SC(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function m0(n,a,o,c,h){for(var g=a._reactName,E=[];o!==null&&o!==c;){var A=o,Y=A.alternate,se=A.stateNode;if(A=A.tag,Y!==null&&Y===c)break;A!==5&&A!==26&&A!==27||se===null||(Y=se,h?(se=al(o,g),se!=null&&E.unshift(Il(o,se,Y))):h||(se=al(o,g),se!=null&&E.push(Il(o,se,Y)))),o=o.return}E.length!==0&&n.push({event:a,listeners:E})}var xC=/\r\n?/g,EC=/\u0000|\uFFFD/g;function p0(n){return(typeof n=="string"?n:""+n).replace(xC,`
50
- `).replace(EC,"")}function g0(n,a){return a=p0(a),p0(n)===a}function Xt(n,a,o,c,h,g){switch(o){case"children":typeof c=="string"?a==="body"||a==="textarea"&&c===""||Fo(n,c):(typeof c=="number"||typeof c=="bigint")&&a!=="body"&&Fo(n,""+c);break;case"className":$r(n,"class",c);break;case"tabIndex":$r(n,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":$r(n,o,c);break;case"style":gy(n,c,g);break;case"data":if(a!=="object"){$r(n,"data",c);break}case"src":case"href":if(c===""&&(a!=="a"||o!=="href")){n.removeAttribute(o);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(o);break}c=Gc(""+c),n.setAttribute(o,c);break;case"action":case"formAction":if(typeof c=="function"){n.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof g=="function"&&(o==="formAction"?(a!=="input"&&Xt(n,a,"name",h.name,h,null),Xt(n,a,"formEncType",h.formEncType,h,null),Xt(n,a,"formMethod",h.formMethod,h,null),Xt(n,a,"formTarget",h.formTarget,h,null)):(Xt(n,a,"encType",h.encType,h,null),Xt(n,a,"method",h.method,h,null),Xt(n,a,"target",h.target,h,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(o);break}c=Gc(""+c),n.setAttribute(o,c);break;case"onClick":c!=null&&(n.onclick=Ta);break;case"onScroll":c!=null&&Et("scroll",n);break;case"onScrollEnd":c!=null&&Et("scrollend",n);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(o=c.__html,o!=null){if(h.children!=null)throw Error(i(60));n.innerHTML=o}}break;case"multiple":n.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":n.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){n.removeAttribute("xlink:href");break}o=Gc(""+c),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(o,""+c):n.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(o,""):n.removeAttribute(o);break;case"capture":case"download":c===!0?n.setAttribute(o,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(o,c):n.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?n.setAttribute(o,c):n.removeAttribute(o);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?n.removeAttribute(o):n.setAttribute(o,c);break;case"popover":Et("beforetoggle",n),Et("toggle",n),pn(n,"popover",c);break;case"xlinkActuate":zn(n,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":zn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":zn(n,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":zn(n,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":zn(n,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":zn(n,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":zn(n,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":zn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":zn(n,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":pn(n,"is",c);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=QR.get(o)||o,pn(n,o,c))}}function lm(n,a,o,c,h,g){switch(o){case"style":gy(n,c,g);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(o=c.__html,o!=null){if(h.children!=null)throw Error(i(60));n.innerHTML=o}}break;case"children":typeof c=="string"?Fo(n,c):(typeof c=="number"||typeof c=="bigint")&&Fo(n,""+c);break;case"onScroll":c!=null&&Et("scroll",n);break;case"onScrollEnd":c!=null&&Et("scrollend",n);break;case"onClick":c!=null&&(n.onclick=Ta);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yr.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(h=o.endsWith("Capture"),a=o.slice(2,h?o.length-7:void 0),g=n[Ae]||null,g=g!=null?g[o]:null,typeof g=="function"&&n.removeEventListener(a,g,h),typeof c=="function")){typeof g!="function"&&g!==null&&(o in n?n[o]=null:n.hasAttribute(o)&&n.removeAttribute(o)),n.addEventListener(a,c,h);break e}o in n?n[o]=c:c===!0?n.setAttribute(o,""):pn(n,o,c)}}}function jn(n,a,o){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Et("error",n),Et("load",n);var c=!1,h=!1,g;for(g in o)if(o.hasOwnProperty(g)){var E=o[g];if(E!=null)switch(g){case"src":c=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:Xt(n,a,g,E,o,null)}}h&&Xt(n,a,"srcSet",o.srcSet,o,null),c&&Xt(n,a,"src",o.src,o,null);return;case"input":Et("invalid",n);var A=g=E=h=null,Y=null,se=null;for(c in o)if(o.hasOwnProperty(c)){var me=o[c];if(me!=null)switch(c){case"name":h=me;break;case"type":E=me;break;case"checked":Y=me;break;case"defaultChecked":se=me;break;case"value":g=me;break;case"defaultValue":A=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(i(137,a));break;default:Xt(n,a,c,me,o,null)}}fy(n,g,A,Y,se,E,h,!1);return;case"select":Et("invalid",n),c=E=g=null;for(h in o)if(o.hasOwnProperty(h)&&(A=o[h],A!=null))switch(h){case"value":g=A;break;case"defaultValue":E=A;break;case"multiple":c=A;default:Xt(n,a,h,A,o,null)}a=g,o=E,n.multiple=!!c,a!=null?Bo(n,!!c,a,!1):o!=null&&Bo(n,!!c,o,!0);return;case"textarea":Et("invalid",n),g=h=c=null;for(E in o)if(o.hasOwnProperty(E)&&(A=o[E],A!=null))switch(E){case"value":c=A;break;case"defaultValue":h=A;break;case"children":g=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(i(91));break;default:Xt(n,a,E,A,o,null)}my(n,c,h,g);return;case"option":for(Y in o)if(o.hasOwnProperty(Y)&&(c=o[Y],c!=null))switch(Y){case"selected":n.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:Xt(n,a,Y,c,o,null)}return;case"dialog":Et("beforetoggle",n),Et("toggle",n),Et("cancel",n),Et("close",n);break;case"iframe":case"object":Et("load",n);break;case"video":case"audio":for(c=0;c<Pl.length;c++)Et(Pl[c],n);break;case"image":Et("error",n),Et("load",n);break;case"details":Et("toggle",n);break;case"embed":case"source":case"link":Et("error",n),Et("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in o)if(o.hasOwnProperty(se)&&(c=o[se],c!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:Xt(n,a,se,c,o,null)}return;default:if(xf(a)){for(me in o)o.hasOwnProperty(me)&&(c=o[me],c!==void 0&&lm(n,a,me,c,o,void 0));return}}for(A in o)o.hasOwnProperty(A)&&(c=o[A],c!=null&&Xt(n,a,A,c,o,null))}function RC(n,a,o,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,g=null,E=null,A=null,Y=null,se=null,me=null;for(de in o){var ye=o[de];if(o.hasOwnProperty(de)&&ye!=null)switch(de){case"checked":break;case"value":break;case"defaultValue":Y=ye;default:c.hasOwnProperty(de)||Xt(n,a,de,null,c,ye)}}for(var ce in c){var de=c[ce];if(ye=o[ce],c.hasOwnProperty(ce)&&(de!=null||ye!=null))switch(ce){case"type":g=de;break;case"name":h=de;break;case"checked":se=de;break;case"defaultChecked":me=de;break;case"value":E=de;break;case"defaultValue":A=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(i(137,a));break;default:de!==ye&&Xt(n,a,ce,de,c,ye)}}wf(n,E,A,Y,se,me,g,h);return;case"select":de=E=A=ce=null;for(g in o)if(Y=o[g],o.hasOwnProperty(g)&&Y!=null)switch(g){case"value":break;case"multiple":de=Y;default:c.hasOwnProperty(g)||Xt(n,a,g,null,c,Y)}for(h in c)if(g=c[h],Y=o[h],c.hasOwnProperty(h)&&(g!=null||Y!=null))switch(h){case"value":ce=g;break;case"defaultValue":A=g;break;case"multiple":E=g;default:g!==Y&&Xt(n,a,h,g,c,Y)}a=A,o=E,c=de,ce!=null?Bo(n,!!o,ce,!1):!!c!=!!o&&(a!=null?Bo(n,!!o,a,!0):Bo(n,!!o,o?[]:"",!1));return;case"textarea":de=ce=null;for(A in o)if(h=o[A],o.hasOwnProperty(A)&&h!=null&&!c.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:Xt(n,a,A,null,c,h)}for(E in c)if(h=c[E],g=o[E],c.hasOwnProperty(E)&&(h!=null||g!=null))switch(E){case"value":ce=h;break;case"defaultValue":de=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(i(91));break;default:h!==g&&Xt(n,a,E,h,c,g)}hy(n,ce,de);return;case"option":for(var je in o)if(ce=o[je],o.hasOwnProperty(je)&&ce!=null&&!c.hasOwnProperty(je))switch(je){case"selected":n.selected=!1;break;default:Xt(n,a,je,null,c,ce)}for(Y in c)if(ce=c[Y],de=o[Y],c.hasOwnProperty(Y)&&ce!==de&&(ce!=null||de!=null))switch(Y){case"selected":n.selected=ce&&typeof ce!="function"&&typeof ce!="symbol";break;default:Xt(n,a,Y,ce,c,de)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var nt in o)ce=o[nt],o.hasOwnProperty(nt)&&ce!=null&&!c.hasOwnProperty(nt)&&Xt(n,a,nt,null,c,ce);for(se in c)if(ce=c[se],de=o[se],c.hasOwnProperty(se)&&ce!==de&&(ce!=null||de!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(i(137,a));break;default:Xt(n,a,se,ce,c,de)}return;default:if(xf(a)){for(var Wt in o)ce=o[Wt],o.hasOwnProperty(Wt)&&ce!==void 0&&!c.hasOwnProperty(Wt)&&lm(n,a,Wt,void 0,c,ce);for(me in c)ce=c[me],de=o[me],!c.hasOwnProperty(me)||ce===de||ce===void 0&&de===void 0||lm(n,a,me,ce,c,de);return}}for(var ee in o)ce=o[ee],o.hasOwnProperty(ee)&&ce!=null&&!c.hasOwnProperty(ee)&&Xt(n,a,ee,null,c,ce);for(ye in c)ce=c[ye],de=o[ye],!c.hasOwnProperty(ye)||ce===de||ce==null&&de==null||Xt(n,a,ye,ce,c,de)}function y0(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function TC(){if(typeof performance.getEntriesByType=="function"){for(var n=0,a=0,o=performance.getEntriesByType("resource"),c=0;c<o.length;c++){var h=o[c],g=h.transferSize,E=h.initiatorType,A=h.duration;if(g&&A&&y0(E)){for(E=0,A=h.responseEnd,c+=1;c<o.length;c++){var Y=o[c],se=Y.startTime;if(se>A)break;var me=Y.transferSize,ye=Y.initiatorType;me&&y0(ye)&&(Y=Y.responseEnd,E+=me*(Y<A?1:(A-se)/(Y-se)))}if(--c,a+=8*(g+E)/(h.duration/1e3),n++,10<n)break}}if(0<n)return a/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var cm=null,um=null;function Bu(n){return n.nodeType===9?n:n.ownerDocument}function v0(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function b0(n,a){if(n===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&a==="foreignObject"?0:n}function dm(n,a){return n==="textarea"||n==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var fm=null;function CC(){var n=window.event;return n&&n.type==="popstate"?n===fm?!1:(fm=n,!0):(fm=null,!1)}var w0=typeof setTimeout=="function"?setTimeout:void 0,OC=typeof clearTimeout=="function"?clearTimeout:void 0,S0=typeof Promise=="function"?Promise:void 0,MC=typeof queueMicrotask=="function"?queueMicrotask:typeof S0<"u"?function(n){return S0.resolve(null).then(n).catch(DC)}:w0;function DC(n){setTimeout(function(){throw n})}function mi(n){return n==="head"}function x0(n,a){var o=a,c=0;do{var h=o.nextSibling;if(n.removeChild(o),h&&h.nodeType===8)if(o=h.data,o==="/$"||o==="/&"){if(c===0){n.removeChild(h),bs(a);return}c--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")c++;else if(o==="html")Ul(n.ownerDocument.documentElement);else if(o==="head"){o=n.ownerDocument.head,Ul(o);for(var g=o.firstChild;g;){var E=g.nextSibling,A=g.nodeName;g[an]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&g.rel.toLowerCase()==="stylesheet"||o.removeChild(g),g=E}}else o==="body"&&Ul(n.ownerDocument.body);o=h}while(o);bs(a)}function E0(n,a){var o=n;n=0;do{var c=o.nextSibling;if(o.nodeType===1?a?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(a?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),c&&c.nodeType===8)if(o=c.data,o==="/$"){if(n===0)break;n--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||n++;o=c}while(o)}function hm(n){var a=n.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var o=a;switch(a=a.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":hm(o),cn(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}n.removeChild(o)}}function AC(n,a,o,c){for(;n.nodeType===1;){var h=o;if(n.nodeName.toLowerCase()!==a.toLowerCase()){if(!c&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(c){if(!n[an])switch(a){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(g=n.getAttribute("rel"),g==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(g!==h.rel||n.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||n.getAttribute("title")!==(h.title==null?null:h.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(g=n.getAttribute("src"),(g!==(h.src==null?null:h.src)||n.getAttribute("type")!==(h.type==null?null:h.type)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&g&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(a==="input"&&n.type==="hidden"){var g=h.name==null?null:""+h.name;if(h.type==="hidden"&&n.getAttribute("name")===g)return n}else return n;if(n=Ir(n.nextSibling),n===null)break}return null}function NC(n,a,o){if(a==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!o||(n=Ir(n.nextSibling),n===null))return null;return n}function R0(n,a){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!a||(n=Ir(n.nextSibling),n===null))return null;return n}function mm(n){return n.data==="$?"||n.data==="$~"}function pm(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function kC(n,a){var o=n.ownerDocument;if(n.data==="$~")n._reactRetry=a;else if(n.data!=="$?"||o.readyState!=="loading")a();else{var c=function(){a(),o.removeEventListener("DOMContentLoaded",c)};o.addEventListener("DOMContentLoaded",c),n._reactRetry=c}}function Ir(n){for(;n!=null;n=n.nextSibling){var a=n.nodeType;if(a===1||a===3)break;if(a===8){if(a=n.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return n}var gm=null;function T0(n){n=n.nextSibling;for(var a=0;n;){if(n.nodeType===8){var o=n.data;if(o==="/$"||o==="/&"){if(a===0)return Ir(n.nextSibling);a--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||a++}n=n.nextSibling}return null}function C0(n){n=n.previousSibling;for(var a=0;n;){if(n.nodeType===8){var o=n.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(a===0)return n;a--}else o!=="/$"&&o!=="/&"||a++}n=n.previousSibling}return null}function O0(n,a,o){switch(a=Bu(o),n){case"html":if(n=a.documentElement,!n)throw Error(i(452));return n;case"head":if(n=a.head,!n)throw Error(i(453));return n;case"body":if(n=a.body,!n)throw Error(i(454));return n;default:throw Error(i(451))}}function Ul(n){for(var a=n.attributes;a.length;)n.removeAttributeNode(a[0]);cn(n)}var Ur=new Map,M0=new Set;function Fu(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Ba=j.d;j.d={f:_C,r:LC,D:zC,C:PC,L:IC,m:UC,X:HC,S:jC,M:BC};function _C(){var n=Ba.f(),a=_u();return n||a}function LC(n){var a=Ot(n);a!==null&&a.tag===5&&a.type==="form"?qv(a):Ba.r(n)}var gs=typeof document>"u"?null:document;function D0(n,a,o){var c=gs;if(c&&typeof a=="string"&&a){var h=Ar(a);h='link[rel="'+n+'"][href="'+h+'"]',typeof o=="string"&&(h+='[crossorigin="'+o+'"]'),M0.has(h)||(M0.add(h),n={rel:n,crossOrigin:o,href:a},c.querySelector(h)===null&&(a=c.createElement("link"),jn(a,"link",n),tn(a),c.head.appendChild(a)))}}function zC(n){Ba.D(n),D0("dns-prefetch",n,null)}function PC(n,a){Ba.C(n,a),D0("preconnect",n,a)}function IC(n,a,o){Ba.L(n,a,o);var c=gs;if(c&&n&&a){var h='link[rel="preload"][as="'+Ar(a)+'"]';a==="image"&&o&&o.imageSrcSet?(h+='[imagesrcset="'+Ar(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(h+='[imagesizes="'+Ar(o.imageSizes)+'"]')):h+='[href="'+Ar(n)+'"]';var g=h;switch(a){case"style":g=ys(n);break;case"script":g=vs(n)}Ur.has(g)||(n=p({rel:"preload",href:a==="image"&&o&&o.imageSrcSet?void 0:n,as:a},o),Ur.set(g,n),c.querySelector(h)!==null||a==="style"&&c.querySelector(jl(g))||a==="script"&&c.querySelector(Hl(g))||(a=c.createElement("link"),jn(a,"link",n),tn(a),c.head.appendChild(a)))}}function UC(n,a){Ba.m(n,a);var o=gs;if(o&&n){var c=a&&typeof a.as=="string"?a.as:"script",h='link[rel="modulepreload"][as="'+Ar(c)+'"][href="'+Ar(n)+'"]',g=h;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=vs(n)}if(!Ur.has(g)&&(n=p({rel:"modulepreload",href:n},a),Ur.set(g,n),o.querySelector(h)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Hl(g)))return}c=o.createElement("link"),jn(c,"link",n),tn(c),o.head.appendChild(c)}}}function jC(n,a,o){Ba.S(n,a,o);var c=gs;if(c&&n){var h=ir(c).hoistableStyles,g=ys(n);a=a||"default";var E=h.get(g);if(!E){var A={loading:0,preload:null};if(E=c.querySelector(jl(g)))A.loading=5;else{n=p({rel:"stylesheet",href:n,"data-precedence":a},o),(o=Ur.get(g))&&ym(n,o);var Y=E=c.createElement("link");tn(Y),jn(Y,"link",n),Y._p=new Promise(function(se,me){Y.onload=se,Y.onerror=me}),Y.addEventListener("load",function(){A.loading|=1}),Y.addEventListener("error",function(){A.loading|=2}),A.loading|=4,Vu(E,a,c)}E={type:"stylesheet",instance:E,count:1,state:A},h.set(g,E)}}}function HC(n,a){Ba.X(n,a);var o=gs;if(o&&n){var c=ir(o).hoistableScripts,h=vs(n),g=c.get(h);g||(g=o.querySelector(Hl(h)),g||(n=p({src:n,async:!0},a),(a=Ur.get(h))&&vm(n,a),g=o.createElement("script"),tn(g),jn(g,"link",n),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(h,g))}}function BC(n,a){Ba.M(n,a);var o=gs;if(o&&n){var c=ir(o).hoistableScripts,h=vs(n),g=c.get(h);g||(g=o.querySelector(Hl(h)),g||(n=p({src:n,async:!0,type:"module"},a),(a=Ur.get(h))&&vm(n,a),g=o.createElement("script"),tn(g),jn(g,"link",n),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(h,g))}}function A0(n,a,o,c){var h=(h=ue.current)?Fu(h):null;if(!h)throw Error(i(446));switch(n){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(a=ys(o.href),o=ir(h).hoistableStyles,c=o.get(a),c||(c={type:"style",instance:null,count:0,state:null},o.set(a,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){n=ys(o.href);var g=ir(h).hoistableStyles,E=g.get(n);if(E||(h=h.ownerDocument||h,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,E),(g=h.querySelector(jl(n)))&&!g._p&&(E.instance=g,E.state.loading=5),Ur.has(n)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Ur.set(n,o),g||FC(h,n,o,E.state))),a&&c===null)throw Error(i(528,""));return E}if(a&&c!==null)throw Error(i(529,""));return null;case"script":return a=o.async,o=o.src,typeof o=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=vs(o),o=ir(h).hoistableScripts,c=o.get(a),c||(c={type:"script",instance:null,count:0,state:null},o.set(a,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,n))}}function ys(n){return'href="'+Ar(n)+'"'}function jl(n){return'link[rel="stylesheet"]['+n+"]"}function N0(n){return p({},n,{"data-precedence":n.precedence,precedence:null})}function FC(n,a,o,c){n.querySelector('link[rel="preload"][as="style"]['+a+"]")?c.loading=1:(a=n.createElement("link"),c.preload=a,a.addEventListener("load",function(){return c.loading|=1}),a.addEventListener("error",function(){return c.loading|=2}),jn(a,"link",o),tn(a),n.head.appendChild(a))}function vs(n){return'[src="'+Ar(n)+'"]'}function Hl(n){return"script[async]"+n}function k0(n,a,o){if(a.count++,a.instance===null)switch(a.type){case"style":var c=n.querySelector('style[data-href~="'+Ar(o.href)+'"]');if(c)return a.instance=c,tn(c),c;var h=p({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),tn(c),jn(c,"style",h),Vu(c,o.precedence,n),a.instance=c;case"stylesheet":h=ys(o.href);var g=n.querySelector(jl(h));if(g)return a.state.loading|=4,a.instance=g,tn(g),g;c=N0(o),(h=Ur.get(h))&&ym(c,h),g=(n.ownerDocument||n).createElement("link"),tn(g);var E=g;return E._p=new Promise(function(A,Y){E.onload=A,E.onerror=Y}),jn(g,"link",c),a.state.loading|=4,Vu(g,o.precedence,n),a.instance=g;case"script":return g=vs(o.src),(h=n.querySelector(Hl(g)))?(a.instance=h,tn(h),h):(c=o,(h=Ur.get(g))&&(c=p({},o),vm(c,h)),n=n.ownerDocument||n,h=n.createElement("script"),tn(h),jn(h,"link",c),n.head.appendChild(h),a.instance=h);case"void":return null;default:throw Error(i(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(c=a.instance,a.state.loading|=4,Vu(c,o.precedence,n));return a.instance}function Vu(n,a,o){for(var c=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=c.length?c[c.length-1]:null,g=h,E=0;E<c.length;E++){var A=c[E];if(A.dataset.precedence===a)g=A;else if(g!==h)break}g?g.parentNode.insertBefore(n,g.nextSibling):(a=o.nodeType===9?o.head:o,a.insertBefore(n,a.firstChild))}function ym(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.title==null&&(n.title=a.title)}function vm(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.integrity==null&&(n.integrity=a.integrity)}var Yu=null;function _0(n,a,o){if(Yu===null){var c=new Map,h=Yu=new Map;h.set(o,c)}else h=Yu,c=h.get(o),c||(c=new Map,h.set(o,c));if(c.has(n))return c;for(c.set(n,null),o=o.getElementsByTagName(n),h=0;h<o.length;h++){var g=o[h];if(!(g[an]||g[Me]||n==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var E=g.getAttribute(a)||"";E=n+E;var A=c.get(E);A?A.push(g):c.set(E,[g])}}return c}function L0(n,a,o){n=n.ownerDocument||n,n.head.insertBefore(o,a==="title"?n.querySelector("head > title"):null)}function VC(n,a,o){if(o===1||a.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return n=a.disabled,typeof a.precedence=="string"&&n==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function z0(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function YC(n,a,o,c){if(o.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var h=ys(c.href),g=a.querySelector(jl(h));if(g){a=g._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(n.count++,n=qu.bind(n),a.then(n,n)),o.state.loading|=4,o.instance=g,tn(g);return}g=a.ownerDocument||a,c=N0(c),(h=Ur.get(h))&&ym(c,h),g=g.createElement("link"),tn(g);var E=g;E._p=new Promise(function(A,Y){E.onload=A,E.onerror=Y}),jn(g,"link",c),o.instance=g}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(o,a),(a=o.state.preload)&&(o.state.loading&3)===0&&(n.count++,o=qu.bind(n),a.addEventListener("load",o),a.addEventListener("error",o))}}var bm=0;function qC(n,a){return n.stylesheets&&n.count===0&&Ku(n,n.stylesheets),0<n.count||0<n.imgCount?function(o){var c=setTimeout(function(){if(n.stylesheets&&Ku(n,n.stylesheets),n.unsuspend){var g=n.unsuspend;n.unsuspend=null,g()}},6e4+a);0<n.imgBytes&&bm===0&&(bm=62500*TC());var h=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Ku(n,n.stylesheets),n.unsuspend)){var g=n.unsuspend;n.unsuspend=null,g()}},(n.imgBytes>bm?50:800)+a);return n.unsuspend=o,function(){n.unsuspend=null,clearTimeout(c),clearTimeout(h)}}:null}function qu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ku(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Gu=null;function Ku(n,a){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Gu=new Map,a.forEach(GC,n),Gu=null,qu.call(n))}function GC(n,a){if(!(a.state.loading&4)){var o=Gu.get(n);if(o)var c=o.get(null);else{o=new Map,Gu.set(n,o);for(var h=n.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<h.length;g++){var E=h[g];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(o.set(E.dataset.precedence,E),c=E)}c&&o.set(null,c)}h=a.instance,E=h.getAttribute("data-precedence"),g=o.get(E)||c,g===c&&o.set(null,h),o.set(E,h),this.count++,c=qu.bind(this),h.addEventListener("load",c),h.addEventListener("error",c),g?g.parentNode.insertBefore(h,g.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(h,n.firstChild)),a.state.loading|=4}}var Bl={$$typeof:D,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function KC(n,a,o,c,h,g,E,A,Y){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Xn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xn(0),this.hiddenUpdates=Xn(null),this.identifierPrefix=c,this.onUncaughtError=h,this.onCaughtError=g,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function P0(n,a,o,c,h,g,E,A,Y,se,me,ye){return n=new KC(n,a,o,E,Y,se,me,ye,A),a=1,g===!0&&(a|=24),g=br(3,null,null,a),n.current=g,g.stateNode=n,a=Zf(),a.refCount++,n.pooledCache=a,a.refCount++,g.memoizedState={element:c,isDehydrated:o,cache:a},nh(g),n}function I0(n){return n?(n=Wo,n):Wo}function U0(n,a,o,c,h,g){h=I0(h),c.context===null?c.context=h:c.pendingContext=h,c=ri(a),c.payload={element:o},g=g===void 0?null:g,g!==null&&(c.callback=g),o=ai(n,c,a),o!==null&&(dr(o,n,a),bl(o,n,a))}function j0(n,a){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var o=n.retryLane;n.retryLane=o!==0&&o<a?o:a}}function wm(n,a){j0(n,a),(n=n.alternate)&&j0(n,a)}function H0(n){if(n.tag===13||n.tag===31){var a=Ji(n,67108864);a!==null&&dr(a,n,67108864),wm(n,67108864)}}function B0(n){if(n.tag===13||n.tag===31){var a=Rr();a=le(a);var o=Ji(n,a);o!==null&&dr(o,n,a),wm(n,a)}}var Xu=!0;function XC(n,a,o,c){var h=_.T;_.T=null;var g=j.p;try{j.p=2,Sm(n,a,o,c)}finally{j.p=g,_.T=h}}function WC(n,a,o,c){var h=_.T;_.T=null;var g=j.p;try{j.p=8,Sm(n,a,o,c)}finally{j.p=g,_.T=h}}function Sm(n,a,o,c){if(Xu){var h=xm(c);if(h===null)sm(n,a,c,Wu,o),V0(n,c);else if(QC(h,n,a,o,c))c.stopPropagation();else if(V0(n,c),a&4&&-1<$C.indexOf(n)){for(;h!==null;){var g=Ot(h);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var E=Ht(g.pendingLanes);if(E!==0){var A=g;for(A.pendingLanes|=2,A.entangledLanes|=2;E;){var Y=1<<31-gt(E);A.entanglements[1]|=Y,E&=~Y}la(g),(Ut&6)===0&&(Nu=Le()+500,zl(0))}}break;case 31:case 13:A=Ji(g,2),A!==null&&dr(A,g,2),_u(),wm(g,2)}if(g=xm(c),g===null&&sm(n,a,c,Wu,o),g===h)break;h=g}h!==null&&c.stopPropagation()}else sm(n,a,c,null,o)}}function xm(n){return n=Rf(n),Em(n)}var Wu=null;function Em(n){if(Wu=null,n=un(n),n!==null){var a=l(n);if(a===null)n=null;else{var o=a.tag;if(o===13){if(n=u(a),n!==null)return n;n=null}else if(o===31){if(n=d(a),n!==null)return n;n=null}else if(o===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;n=null}else a!==n&&(n=null)}}return Wu=n,null}function F0(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ot()){case Pt:return 2;case Ft:return 8;case tt:case ft:return 32;case Ct:return 268435456;default:return 32}default:return 32}}var Rm=!1,pi=null,gi=null,yi=null,Fl=new Map,Vl=new Map,vi=[],$C="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function V0(n,a){switch(n){case"focusin":case"focusout":pi=null;break;case"dragenter":case"dragleave":gi=null;break;case"mouseover":case"mouseout":yi=null;break;case"pointerover":case"pointerout":Fl.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vl.delete(a.pointerId)}}function Yl(n,a,o,c,h,g){return n===null||n.nativeEvent!==g?(n={blockedOn:a,domEventName:o,eventSystemFlags:c,nativeEvent:g,targetContainers:[h]},a!==null&&(a=Ot(a),a!==null&&H0(a)),n):(n.eventSystemFlags|=c,a=n.targetContainers,h!==null&&a.indexOf(h)===-1&&a.push(h),n)}function QC(n,a,o,c,h){switch(a){case"focusin":return pi=Yl(pi,n,a,o,c,h),!0;case"dragenter":return gi=Yl(gi,n,a,o,c,h),!0;case"mouseover":return yi=Yl(yi,n,a,o,c,h),!0;case"pointerover":var g=h.pointerId;return Fl.set(g,Yl(Fl.get(g)||null,n,a,o,c,h)),!0;case"gotpointercapture":return g=h.pointerId,Vl.set(g,Yl(Vl.get(g)||null,n,a,o,c,h)),!0}return!1}function Y0(n){var a=un(n.target);if(a!==null){var o=l(a);if(o!==null){if(a=o.tag,a===13){if(a=u(o),a!==null){n.blockedOn=a,We(n.priority,function(){B0(o)});return}}else if(a===31){if(a=d(o),a!==null){n.blockedOn=a,We(n.priority,function(){B0(o)});return}}else if(a===3&&o.stateNode.current.memoizedState.isDehydrated){n.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}n.blockedOn=null}function $u(n){if(n.blockedOn!==null)return!1;for(var a=n.targetContainers;0<a.length;){var o=xm(n.nativeEvent);if(o===null){o=n.nativeEvent;var c=new o.constructor(o.type,o);Ef=c,o.target.dispatchEvent(c),Ef=null}else return a=Ot(o),a!==null&&H0(a),n.blockedOn=o,!1;a.shift()}return!0}function q0(n,a,o){$u(n)&&o.delete(a)}function ZC(){Rm=!1,pi!==null&&$u(pi)&&(pi=null),gi!==null&&$u(gi)&&(gi=null),yi!==null&&$u(yi)&&(yi=null),Fl.forEach(q0),Vl.forEach(q0)}function Qu(n,a){n.blockedOn===a&&(n.blockedOn=null,Rm||(Rm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,ZC)))}var Zu=null;function G0(n){Zu!==n&&(Zu=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Zu===n&&(Zu=null);for(var a=0;a<n.length;a+=3){var o=n[a],c=n[a+1],h=n[a+2];if(typeof c!="function"){if(Em(c||o)===null)continue;break}var g=Ot(o);g!==null&&(n.splice(a,3),a-=3,xh(g,{pending:!0,data:h,method:o.method,action:c},c,h))}}))}function bs(n){function a(Y){return Qu(Y,n)}pi!==null&&Qu(pi,n),gi!==null&&Qu(gi,n),yi!==null&&Qu(yi,n),Fl.forEach(a),Vl.forEach(a);for(var o=0;o<vi.length;o++){var c=vi[o];c.blockedOn===n&&(c.blockedOn=null)}for(;0<vi.length&&(o=vi[0],o.blockedOn===null);)Y0(o),o.blockedOn===null&&vi.shift();if(o=(n.ownerDocument||n).$$reactFormReplay,o!=null)for(c=0;c<o.length;c+=3){var h=o[c],g=o[c+1],E=h[Ae]||null;if(typeof g=="function")E||G0(o);else if(E){var A=null;if(g&&g.hasAttribute("formAction")){if(h=g,E=g[Ae]||null)A=E.formAction;else if(Em(h)!==null)continue}else A=E.action;typeof A=="function"?o[c+1]=A:(o.splice(c,3),c-=3),G0(o)}}}function K0(){function n(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(E){return h=E})},focusReset:"manual",scroll:"manual"})}function a(){h!==null&&(h(),h=null),c||setTimeout(o,20)}function o(){if(!c&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,h=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(o,100),function(){c=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),h!==null&&(h(),h=null)}}}function Tm(n){this._internalRoot=n}Ju.prototype.render=Tm.prototype.render=function(n){var a=this._internalRoot;if(a===null)throw Error(i(409));var o=a.current,c=Rr();U0(o,c,n,a,null,null)},Ju.prototype.unmount=Tm.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var a=n.containerInfo;U0(n.current,2,null,n,null,null),_u(),a[Ue]=null}};function Ju(n){this._internalRoot=n}Ju.prototype.unstable_scheduleHydration=function(n){if(n){var a=Ce();n={blockedOn:null,target:n,priority:a};for(var o=0;o<vi.length&&a!==0&&a<vi[o].priority;o++);vi.splice(o,0,n),o===0&&Y0(n)}};var X0=t.version;if(X0!=="19.2.4")throw Error(i(527,X0,"19.2.4"));j.findDOMNode=function(n){var a=n._reactInternals;if(a===void 0)throw typeof n.render=="function"?Error(i(188)):(n=Object.keys(n).join(","),Error(i(268,n)));return n=f(a),n=n!==null?y(n):null,n=n===null?null:n.stateNode,n};var JC={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:_,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ed=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ed.isDisabled&&ed.supportsFiber)try{On=ed.inject(JC),Pe=ed}catch{}}return Gl.createRoot=function(n,a){if(!s(n))throw Error(i(299));var o=!1,c="",h=tb,g=nb,E=rb;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(h=a.onUncaughtError),a.onCaughtError!==void 0&&(g=a.onCaughtError),a.onRecoverableError!==void 0&&(E=a.onRecoverableError)),a=P0(n,1,!1,null,null,o,c,null,h,g,E,K0),n[Ue]=a.current,om(n),new Tm(a)},Gl.hydrateRoot=function(n,a,o){if(!s(n))throw Error(i(299));var c=!1,h="",g=tb,E=nb,A=rb,Y=null;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(h=o.identifierPrefix),o.onUncaughtError!==void 0&&(g=o.onUncaughtError),o.onCaughtError!==void 0&&(E=o.onCaughtError),o.onRecoverableError!==void 0&&(A=o.onRecoverableError),o.formState!==void 0&&(Y=o.formState)),a=P0(n,1,!0,a,o??null,c,h,Y,g,E,A,K0),a.context=I0(null),o=a.current,c=Rr(),c=le(c),h=ri(c),h.callback=null,ai(o,h,c),o=c,a.current.lanes=o,Gt(a,o),la(a),n[Ue]=a.current,om(n),new Ju(a)},Gl.version="19.2.4",Gl}var yw;function QO(){if(yw)return Dm.exports;yw=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Dm.exports=$O(),Dm.exports}var ZO=QO();/**
51
- * react-router v7.13.0
52
- *
53
- * Copyright (c) Remix Software Inc.
54
- *
55
- * This source code is licensed under the MIT license found in the
56
- * LICENSE.md file in the root directory of this source tree.
57
- *
58
- * @license MIT
59
- */var Gx=e=>{throw TypeError(e)},JO=(e,t,r)=>t.has(e)||Gx("Cannot "+r),_m=(e,t,r)=>(JO(e,t,"read from private field"),r?r.call(e):t.get(e)),eM=(e,t,r)=>t.has(e)?Gx("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),vw="popstate";function tM(e={}){function t(i,s){let{pathname:l,search:u,hash:d}=i.location;return pc("",{pathname:l,search:u,hash:d},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(i,s){return typeof s=="string"?s:ba(s)}return rM(t,r,null,e)}function bt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function En(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function nM(){return Math.random().toString(36).substring(2,10)}function bw(e,t){return{usr:e.state,key:e.key,idx:t}}function pc(e,t,r=null,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ji(t):t,state:r,key:t&&t.key||i||nM()}}function ba({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function ji(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let i=e.indexOf("?");i>=0&&(t.search=e.substring(i),e=e.substring(0,i)),e&&(t.pathname=e)}return t}function rM(e,t,r,i={}){let{window:s=document.defaultView,v5Compat:l=!1}=i,u=s.history,d="POP",m=null,f=y();f==null&&(f=0,u.replaceState({...u.state,idx:f},""));function y(){return(u.state||{idx:null}).idx}function p(){d="POP";let R=y(),T=R==null?null:R-f;f=R,m&&m({action:d,location:x.location,delta:T})}function v(R,T){d="PUSH";let M=pc(x.location,R,T);f=y()+1;let D=bw(M,f),C=x.createHref(M);try{u.pushState(D,"",C)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;s.location.assign(C)}l&&m&&m({action:d,location:x.location,delta:1})}function b(R,T){d="REPLACE";let M=pc(x.location,R,T);f=y();let D=bw(M,f),C=x.createHref(M);u.replaceState(D,"",C),l&&m&&m({action:d,location:x.location,delta:0})}function S(R){return Kx(R)}let x={get action(){return d},get location(){return e(s,u)},listen(R){if(m)throw new Error("A history only accepts one active listener");return s.addEventListener(vw,p),m=R,()=>{s.removeEventListener(vw,p),m=null}},createHref(R){return t(s,R)},createURL:S,encodeLocation(R){let T=S(R);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:v,replace:b,go(R){return u.go(R)}};return x}function Kx(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),bt(r,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:ba(e);return i=i.replace(/ $/,"%20"),!t&&i.startsWith("//")&&(i=r+i),new URL(i,r)}var nc,ww=class{constructor(e){if(eM(this,nc,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(_m(this,nc).has(e))return _m(this,nc).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){_m(this,nc).set(e,t)}};nc=new WeakMap;var aM=new Set(["lazy","caseSensitive","path","id","index","children"]);function iM(e){return aM.has(e)}var oM=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function sM(e){return oM.has(e)}function lM(e){return e.index===!0}function gc(e,t,r=[],i={},s=!1){return e.map((l,u)=>{let d=[...r,String(u)],m=typeof l.id=="string"?l.id:d.join("-");if(bt(l.index!==!0||!l.children,"Cannot specify children on an index route"),bt(s||!i[m],`Found a route id collision on id "${m}". Route id's must be globally unique within Data Router usages`),lM(l)){let f={...l,id:m};return i[m]=Sw(f,t(f)),f}else{let f={...l,id:m,children:void 0};return i[m]=Sw(f,t(f)),l.children&&(f.children=gc(l.children,t,d,i,s)),f}})}function Sw(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function xi(e,t,r="/"){return rc(e,t,r,!1)}function rc(e,t,r,i){let s=typeof t=="string"?ji(t):t,l=qr(s.pathname||"/",r);if(l==null)return null;let u=Xx(e);uM(u);let d=null;for(let m=0;d==null&&m<u.length;++m){let f=SM(l);d=bM(u[m],f,i)}return d}function cM(e,t){let{route:r,pathname:i,params:s}=e;return{id:r.id,pathname:i,params:s,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function Xx(e,t=[],r=[],i="",s=!1){let l=(u,d,m=s,f)=>{let y={relativePath:f===void 0?u.path||"":f,caseSensitive:u.caseSensitive===!0,childrenIndex:d,route:u};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(i)&&m)return;bt(y.relativePath.startsWith(i),`Absolute route path "${y.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(i.length)}let p=pa([i,y.relativePath]),v=r.concat(y);u.children&&u.children.length>0&&(bt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),Xx(u.children,t,v,p,m)),!(u.path==null&&!u.index)&&t.push({path:p,score:yM(p,u.index),routesMeta:v})};return e.forEach((u,d)=>{var m;if(u.path===""||!((m=u.path)!=null&&m.includes("?")))l(u,d);else for(let f of Wx(u.path))l(u,d,!0,f)}),t}function Wx(e){let t=e.split("/");if(t.length===0)return[];let[r,...i]=t,s=r.endsWith("?"),l=r.replace(/\?$/,"");if(i.length===0)return s?[l,""]:[l];let u=Wx(i.join("/")),d=[];return d.push(...u.map(m=>m===""?l:[l,m].join("/"))),s&&d.push(...u),d.map(m=>e.startsWith("/")&&m===""?"/":m)}function uM(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:vM(t.routesMeta.map(i=>i.childrenIndex),r.routesMeta.map(i=>i.childrenIndex)))}var dM=/^:[\w-]+$/,fM=3,hM=2,mM=1,pM=10,gM=-2,xw=e=>e==="*";function yM(e,t){let r=e.split("/"),i=r.length;return r.some(xw)&&(i+=gM),t&&(i+=hM),r.filter(s=>!xw(s)).reduce((s,l)=>s+(dM.test(l)?fM:l===""?mM:pM),i)}function vM(e,t){return e.length===t.length&&e.slice(0,-1).every((i,s)=>i===t[s])?e[e.length-1]-t[t.length-1]:0}function bM(e,t,r=!1){let{routesMeta:i}=e,s={},l="/",u=[];for(let d=0;d<i.length;++d){let m=i[d],f=d===i.length-1,y=l==="/"?t:t.slice(l.length)||"/",p=yc({path:m.relativePath,caseSensitive:m.caseSensitive,end:f},y),v=m.route;if(!p&&f&&r&&!i[i.length-1].route.index&&(p=yc({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},y)),!p)return null;Object.assign(s,p.params),u.push({params:s,pathname:pa([l,p.pathname]),pathnameBase:RM(pa([l,p.pathnameBase])),route:v}),p.pathnameBase!=="/"&&(l=pa([l,p.pathnameBase]))}return u}function yc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,i]=wM(e.path,e.caseSensitive,e.end),s=t.match(r);if(!s)return null;let l=s[0],u=l.replace(/(.)\/+$/,"$1"),d=s.slice(1);return{params:i.reduce((f,{paramName:y,isOptional:p},v)=>{if(y==="*"){let S=d[v]||"";u=l.slice(0,l.length-S.length).replace(/(.)\/+$/,"$1")}const b=d[v];return p&&!b?f[y]=void 0:f[y]=(b||"").replace(/%2F/g,"/"),f},{}),pathname:l,pathnameBase:u,pattern:e}}function wM(e,t=!1,r=!0){En(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let i=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,d,m)=>(i.push({paramName:d,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(i.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),i]}function SM(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return En(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function qr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,i=e.charAt(r);return i&&i!=="/"?null:e.slice(r)||"/"}function xM({basename:e,pathname:t}){return t==="/"?e:pa([e,t])}var $x=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fg=e=>$x.test(e);function EM(e,t="/"){let{pathname:r,search:i="",hash:s=""}=typeof e=="string"?ji(e):e,l;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?l=Ew(r.substring(1),"/"):l=Ew(r,t)):l=t,{pathname:l,search:TM(i),hash:CM(s)}}function Ew(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function Lm(e,t,r,i){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Qx(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function hg(e){let t=Qx(e);return t.map((r,i)=>i===t.length-1?r.pathname:r.pathnameBase)}function mg(e,t,r,i=!1){let s;typeof e=="string"?s=ji(e):(s={...e},bt(!s.pathname||!s.pathname.includes("?"),Lm("?","pathname","search",s)),bt(!s.pathname||!s.pathname.includes("#"),Lm("#","pathname","hash",s)),bt(!s.search||!s.search.includes("#"),Lm("#","search","hash",s)));let l=e===""||s.pathname==="",u=l?"/":s.pathname,d;if(u==null)d=r;else{let p=t.length-1;if(!i&&u.startsWith("..")){let v=u.split("/");for(;v[0]==="..";)v.shift(),p-=1;s.pathname=v.join("/")}d=p>=0?t[p]:"/"}let m=EM(s,d),f=u&&u!=="/"&&u.endsWith("/"),y=(l||u===".")&&r.endsWith("/");return!m.pathname.endsWith("/")&&(f||y)&&(m.pathname+="/"),m}var pa=e=>e.join("/").replace(/\/\/+/g,"/"),RM=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),TM=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,CM=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Ac=class{constructor(e,t,r,i=!1){this.status=e,this.statusText=t||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function vc(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Nc(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Zx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Jx(e,t){let r=e;if(typeof r!="string"||!$x.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let i=r,s=!1;if(Zx)try{let l=new URL(window.location.href),u=r.startsWith("//")?new URL(l.protocol+r):new URL(r),d=qr(u.pathname,t);u.origin===l.origin&&d!=null?r=d+u.search+u.hash:s=!0}catch{En(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:s,to:r}}var ki=Symbol("Uninstrumented");function OM(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(s=>s({id:t.id,index:t.index,path:t.path,instrument(l){let u=Object.keys(r);for(let d of u)l[d]&&r[d].push(l[d])}}));let i={};if(typeof t.lazy=="function"&&r.lazy.length>0){let s=Ts(r.lazy,t.lazy,()=>{});s&&(i.lazy=s)}if(typeof t.lazy=="object"){let s=t.lazy;["middleware","loader","action"].forEach(l=>{let u=s[l],d=r[`lazy.${l}`];if(typeof u=="function"&&d.length>0){let m=Ts(d,u,()=>{});m&&(i.lazy=Object.assign(i.lazy||{},{[l]:m}))}})}return["loader","action"].forEach(s=>{let l=t[s];if(typeof l=="function"&&r[s].length>0){let u=l[ki]??l,d=Ts(r[s],u,(...m)=>Rw(m[0]));d&&(s==="loader"&&u.hydrate===!0&&(d.hydrate=!0),d[ki]=u,i[s]=d)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(i.middleware=t.middleware.map(s=>{let l=s[ki]??s,u=Ts(r.middleware,l,(...d)=>Rw(d[0]));return u?(u[ki]=l,u):s})),i}function MM(e,t){let r={navigate:[],fetch:[]};if(t.forEach(i=>i({instrument(s){let l=Object.keys(s);for(let u of l)s[u]&&r[u].push(s[u])}})),r.navigate.length>0){let i=e.navigate[ki]??e.navigate,s=Ts(r.navigate,i,(...l)=>{let[u,d]=l;return{to:typeof u=="number"||typeof u=="string"?u:u?ba(u):".",...Tw(e,d??{})}});s&&(s[ki]=i,e.navigate=s)}if(r.fetch.length>0){let i=e.fetch[ki]??e.fetch,s=Ts(r.fetch,i,(...l)=>{let[u,,d,m]=l;return{href:d??".",fetcherKey:u,...Tw(e,m??{})}});s&&(s[ki]=i,e.fetch=s)}return e}function Ts(e,t,r){return e.length===0?null:async(...i)=>{let s=await eE(e,r(...i),()=>t(...i),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function eE(e,t,r,i){let s=e[i],l;if(s){let u,d=async()=>(u?console.error("You cannot call instrumented handlers more than once"):u=eE(e,t,r,i-1),l=await u,bt(l,"Expected a result"),l.type==="error"&&l.value instanceof Error?{status:"error",error:l.value}:{status:"success",error:void 0});try{await s(d,t)}catch(m){console.error("An instrumentation function threw an error:",m)}u||await d(),await u}else try{l={type:"success",value:await r()}}catch(u){l={type:"error",value:u}}return l||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Rw(e){let{request:t,context:r,params:i,unstable_pattern:s}=e;return{request:DM(t),params:{...i},unstable_pattern:s,context:AM(r)}}function Tw(e,t){return{currentUrl:ba(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function DM(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function AM(e){if(kM(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var NM=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function kM(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===NM}var tE=["POST","PUT","PATCH","DELETE"],_M=new Set(tE),LM=["GET",...tE],zM=new Set(LM),nE=new Set([301,302,303,307,308]),PM=new Set([307,308]),zm={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},IM={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Kl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},UM=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),rE="remix-router-transitions",aE=Symbol("ResetLoaderData");function jM(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";bt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i=e.hydrationRouteProperties||[],s=e.mapRouteProperties||UM,l=s;if(e.unstable_instrumentations){let B=e.unstable_instrumentations;l=Q=>({...s(Q),...OM(B.map(le=>le.route).filter(Boolean),Q)})}let u={},d=gc(e.routes,l,void 0,u),m,f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let y=e.dataStrategy||YM,p={...e.future},v=null,b=new Set,S=null,x=null,R=null,T=e.hydrationData!=null,M=xi(d,e.history.location,f),D=!1,C=null,N;if(M==null&&!e.patchRoutesOnNavigation){let B=Hr(404,{pathname:e.history.location.pathname}),{matches:Q,route:le}=rd(d);N=!0,M=Q,C={[le.id]:B}}else if(M&&!e.hydrationData&&qt(M,d,e.history.location.pathname).active&&(M=null),M)if(M.some(B=>B.route.lazy))N=!1;else if(!M.some(B=>pg(B.route)))N=!0;else{let B=e.hydrationData?e.hydrationData.loaderData:null,Q=e.hydrationData?e.hydrationData.errors:null;if(Q){let le=M.findIndex(be=>Q[be.route.id]!==void 0);N=M.slice(0,le+1).every(be=>!Np(be.route,B,Q))}else N=M.every(le=>!Np(le.route,B,Q))}else{N=!1,M=[];let B=qt(null,d,e.history.location.pathname);B.active&&B.matches&&(D=!0,M=B.matches)}let k,O={historyAction:e.history.action,location:e.history.location,matches:M,initialized:N,navigation:zm,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||C,fetchers:new Map,blockers:new Map},L="POP",G=null,J=!1,Z,z=!1,H=new Map,V=null,q=!1,_=!1,j=new Set,U=new Map,ie=0,ae=-1,P=new Map,X=new Set,$=new Map,F=new Map,te=new Set,ue=new Map,he,we=null;function ve(){if(v=e.history.listen(({action:B,location:Q,delta:le})=>{if(he){he(),he=void 0;return}En(ue.size===0||le!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let be=et({currentLocation:O.location,nextLocation:Q,historyAction:B});if(be&&le!=null){let Ce=new Promise(We=>{he=We});e.history.go(le*-1),wt(be,{state:"blocked",location:Q,proceed(){wt(be,{state:"proceeding",proceed:void 0,reset:void 0,location:Q}),Ce.then(()=>e.history.go(le))},reset(){let We=new Map(O.blockers);We.set(be,Kl),ne({blockers:We})}}),G==null||G.resolve(),G=null;return}return Te(B,Q)}),r){l2(t,H);let B=()=>c2(t,H);t.addEventListener("pagehide",B),V=()=>t.removeEventListener("pagehide",B)}return O.initialized||Te("POP",O.location,{initialHydration:!0}),k}function ke(){v&&v(),V&&V(),b.clear(),Z&&Z.abort(),O.fetchers.forEach((B,Q)=>ln(Q)),O.blockers.forEach((B,Q)=>lt(Q))}function Xe(B){return b.add(B),()=>b.delete(B)}function ne(B,Q={}){B.matches&&(B.matches=B.matches.map(Ce=>{let We=u[Ce.route.id],He=Ce.route;return He.element!==We.element||He.errorElement!==We.errorElement||He.hydrateFallbackElement!==We.hydrateFallbackElement?{...Ce,route:We}:Ce})),O={...O,...B};let le=[],be=[];O.fetchers.forEach((Ce,We)=>{Ce.state==="idle"&&(te.has(We)?le.push(We):be.push(We))}),te.forEach(Ce=>{!O.fetchers.has(Ce)&&!U.has(Ce)&&le.push(Ce)}),[...b].forEach(Ce=>Ce(O,{deletedFetchers:le,newErrors:B.errors??null,viewTransitionOpts:Q.viewTransitionOpts,flushSync:Q.flushSync===!0})),le.forEach(Ce=>ln(Ce)),be.forEach(Ce=>O.fetchers.delete(Ce))}function fe(B,Q,{flushSync:le}={}){var at,Qe;let be=O.actionData!=null&&O.navigation.formMethod!=null&&qn(O.navigation.formMethod)&&O.navigation.state==="loading"&&((at=B.state)==null?void 0:at._isRedirect)!==!0,Ce;Q.actionData?Object.keys(Q.actionData).length>0?Ce=Q.actionData:Ce=null:be?Ce=O.actionData:Ce=null;let We=Q.loaderData?zw(O.loaderData,Q.loaderData,Q.matches||[],Q.errors):O.loaderData,He=O.blockers;He.size>0&&(He=new Map(He),He.forEach((ut,St)=>He.set(St,Kl)));let Me=q?!1:Zt(B,Q.matches||O.matches),Ae=J===!0||O.navigation.formMethod!=null&&qn(O.navigation.formMethod)&&((Qe=B.state)==null?void 0:Qe._isRedirect)!==!0;m&&(d=m,m=void 0),q||L==="POP"||(L==="PUSH"?e.history.push(B,B.state):L==="REPLACE"&&e.history.replace(B,B.state));let Ue;if(L==="POP"){let ut=H.get(O.location.pathname);ut&&ut.has(B.pathname)?Ue={currentLocation:O.location,nextLocation:B}:H.has(B.pathname)&&(Ue={currentLocation:B,nextLocation:O.location})}else if(z){let ut=H.get(O.location.pathname);ut?ut.add(B.pathname):(ut=new Set([B.pathname]),H.set(O.location.pathname,ut)),Ue={currentLocation:O.location,nextLocation:B}}ne({...Q,actionData:Ce,loaderData:We,historyAction:L,location:B,initialized:!0,navigation:zm,revalidation:"idle",restoreScrollPosition:Me,preventScrollReset:Ae,blockers:He},{viewTransitionOpts:Ue,flushSync:le===!0}),L="POP",J=!1,z=!1,q=!1,_=!1,G==null||G.resolve(),G=null,we==null||we.resolve(),we=null}async function Se(B,Q){if(G==null||G.resolve(),G=null,typeof B=="number"){G||(G=jw());let St=G.promise;return e.history.go(B),St}let le=Ap(O.location,O.matches,f,B,Q==null?void 0:Q.fromRouteId,Q==null?void 0:Q.relative),{path:be,submission:Ce,error:We}=Cw(!1,le,Q),He=O.location,Me=pc(O.location,be,Q&&Q.state);Me={...Me,...e.history.encodeLocation(Me)};let Ae=Q&&Q.replace!=null?Q.replace:void 0,Ue="PUSH";Ae===!0?Ue="REPLACE":Ae===!1||Ce!=null&&qn(Ce.formMethod)&&Ce.formAction===O.location.pathname+O.location.search&&(Ue="REPLACE");let at=Q&&"preventScrollReset"in Q?Q.preventScrollReset===!0:void 0,Qe=(Q&&Q.flushSync)===!0,ut=et({currentLocation:He,nextLocation:Me,historyAction:Ue});if(ut){wt(ut,{state:"blocked",location:Me,proceed(){wt(ut,{state:"proceeding",proceed:void 0,reset:void 0,location:Me}),Se(B,Q)},reset(){let St=new Map(O.blockers);St.set(ut,Kl),ne({blockers:St})}});return}await Te(Ue,Me,{submission:Ce,pendingError:We,preventScrollReset:at,replace:Q&&Q.replace,enableViewTransition:Q&&Q.viewTransition,flushSync:Qe,callSiteDefaultShouldRevalidate:Q&&Q.unstable_defaultShouldRevalidate})}function Ne(){we||(we=jw()),Ft(),ne({revalidation:"loading"});let B=we.promise;return O.navigation.state==="submitting"?B:O.navigation.state==="idle"?(Te(O.historyAction,O.location,{startUninterruptedRevalidation:!0}),B):(Te(L||O.historyAction,O.navigation.location,{overrideNavigation:O.navigation,enableViewTransition:z===!0}),B)}async function Te(B,Q,le){Z&&Z.abort(),Z=null,L=B,q=(le&&le.startUninterruptedRevalidation)===!0,It(O.location,O.matches),J=(le&&le.preventScrollReset)===!0,z=(le&&le.enableViewTransition)===!0;let be=m||d,Ce=le&&le.overrideNavigation,We=le!=null&&le.initialHydration&&O.matches&&O.matches.length>0&&!D?O.matches:xi(be,Q,f),He=(le&&le.flushSync)===!0;if(We&&O.initialized&&!_&&ZM(O.location,Q)&&!(le&&le.submission&&qn(le.submission.formMethod))){fe(Q,{matches:We},{flushSync:He});return}let Me=qt(We,be,Q.pathname);if(Me.active&&Me.matches&&(We=Me.matches),!We){let{error:cn,notFoundMatches:un,route:Ot}=vt(Q.pathname);fe(Q,{matches:un,loaderData:{},errors:{[Ot.id]:cn}},{flushSync:He});return}Z=new AbortController;let Ae=Es(e.history,Q,Z.signal,le&&le.submission),Ue=e.getContext?await e.getContext():new ww,at;if(le&&le.pendingError)at=[Ei(We).route.id,{type:"error",error:le.pendingError}];else if(le&&le.submission&&qn(le.submission.formMethod)){let cn=await Ee(Ae,Q,le.submission,We,Ue,Me.active,le&&le.initialHydration===!0,{replace:le.replace,flushSync:He});if(cn.shortCircuited)return;if(cn.pendingActionResult){let[un,Ot]=cn.pendingActionResult;if(Tr(Ot)&&vc(Ot.error)&&Ot.error.status===404){Z=null,fe(Q,{matches:cn.matches,loaderData:{},errors:{[un]:Ot.error}});return}}We=cn.matches||We,at=cn.pendingActionResult,Ce=Pm(Q,le.submission),He=!1,Me.active=!1,Ae=Es(e.history,Ae.url,Ae.signal)}let{shortCircuited:Qe,matches:ut,loaderData:St,errors:an}=await Re(Ae,Q,We,Ue,Me.active,Ce,le&&le.submission,le&&le.fetcherSubmission,le&&le.replace,le&&le.initialHydration===!0,He,at,le&&le.callSiteDefaultShouldRevalidate);Qe||(Z=null,fe(Q,{matches:ut||We,...Pw(at),loaderData:St,errors:an}))}async function Ee(B,Q,le,be,Ce,We,He,Me={}){Ft();let Ae=o2(Q,le);if(ne({navigation:Ae},{flushSync:Me.flushSync===!0}),We){let Qe=await Xn(be,Q.pathname,B.signal);if(Qe.type==="aborted")return{shortCircuited:!0};if(Qe.type==="error"){if(Qe.partialMatches.length===0){let{matches:St,route:an}=rd(d);return{matches:St,pendingActionResult:[an.id,{type:"error",error:Qe.error}]}}let ut=Ei(Qe.partialMatches).route.id;return{matches:Qe.partialMatches,pendingActionResult:[ut,{type:"error",error:Qe.error}]}}else if(Qe.matches)be=Qe.matches;else{let{notFoundMatches:ut,error:St,route:an}=vt(Q.pathname);return{matches:ut,pendingActionResult:[an.id,{type:"error",error:St}]}}}let Ue,at=xd(be,Q);if(!at.route.action&&!at.route.lazy)Ue={type:"error",error:Hr(405,{method:B.method,pathname:Q.pathname,routeId:at.route.id})};else{let Qe=Os(l,u,B,be,at,He?[]:i,Ce),ut=await ot(B,Qe,Ce,null);if(Ue=ut[at.route.id],!Ue){for(let St of be)if(ut[St.route.id]){Ue=ut[St.route.id];break}}if(B.signal.aborted)return{shortCircuited:!0}}if(vo(Ue)){let Qe;return Me&&Me.replace!=null?Qe=Me.replace:Qe=kw(Ue.response.headers.get("Location"),new URL(B.url),f,e.history)===O.location.pathname+O.location.search,await Le(B,Ue,!0,{submission:le,replace:Qe}),{shortCircuited:!0}}if(Tr(Ue)){let Qe=Ei(be,at.route.id);return(Me&&Me.replace)!==!0&&(L="PUSH"),{matches:be,pendingActionResult:[Qe.route.id,Ue,at.route.id]}}return{matches:be,pendingActionResult:[at.route.id,Ue]}}async function Re(B,Q,le,be,Ce,We,He,Me,Ae,Ue,at,Qe,ut){let St=We||Pm(Q,He),an=He||Me||Uw(St),cn=!q&&!Ue;if(Ce){if(cn){let pn=pe(Qe);ne({navigation:St,...pn!==void 0?{actionData:pn}:{}},{flushSync:at})}let Mt=await Xn(le,Q.pathname,B.signal);if(Mt.type==="aborted")return{shortCircuited:!0};if(Mt.type==="error"){if(Mt.partialMatches.length===0){let{matches:$r,route:zn}=rd(d);return{matches:$r,loaderData:{},errors:{[zn.id]:Mt.error}}}let pn=Ei(Mt.partialMatches).route.id;return{matches:Mt.partialMatches,loaderData:{},errors:{[pn]:Mt.error}}}else if(Mt.matches)le=Mt.matches;else{let{error:pn,notFoundMatches:$r,route:zn}=vt(Q.pathname);return{matches:$r,loaderData:{},errors:{[zn.id]:pn}}}}let un=m||d,{dsMatches:Ot,revalidatingFetchers:Dn}=Ow(B,be,l,u,e.history,O,le,an,Q,Ue?[]:i,Ue===!0,_,j,te,$,X,un,f,e.patchRoutesOnNavigation!=null,Qe,ut);if(ae=++ie,!e.dataStrategy&&!Ot.some(Mt=>Mt.shouldLoad)&&!Ot.some(Mt=>Mt.route.middleware&&Mt.route.middleware.length>0)&&Dn.length===0){let Mt=gt();return fe(Q,{matches:le,loaderData:{},errors:Qe&&Tr(Qe[1])?{[Qe[0]]:Qe[1].error}:null,...Pw(Qe),...Mt?{fetchers:new Map(O.fetchers)}:{}},{flushSync:at}),{shortCircuited:!0}}if(cn){let Mt={};if(!Ce){Mt.navigation=St;let pn=pe(Qe);pn!==void 0&&(Mt.actionData=pn)}Dn.length>0&&(Mt.fetchers=De(Dn)),ne(Mt,{flushSync:at})}Dn.forEach(Mt=>{Pe(Mt.key),Mt.controller&&U.set(Mt.key,Mt.controller)});let ir=()=>Dn.forEach(Mt=>Pe(Mt.key));Z&&Z.signal.addEventListener("abort",ir);let{loaderResults:tn,fetcherResults:Xr}=await Pt(Ot,Dn,B,be);if(B.signal.aborted)return{shortCircuited:!0};Z&&Z.signal.removeEventListener("abort",ir),Dn.forEach(Mt=>U.delete(Mt.key));let yr=ad(tn);if(yr)return await Le(B,yr.result,!0,{replace:Ae}),{shortCircuited:!0};if(yr=ad(Xr),yr)return X.add(yr.key),await Le(B,yr.result,!0,{replace:Ae}),{shortCircuited:!0};let{loaderData:Wr,errors:Dr}=Lw(O,le,tn,Qe,Dn,Xr);Ue&&O.errors&&(Dr={...O.errors,...Dr});let Ra=gt(),Ki=Kn(ae),Xi=Ra||Ki||Dn.length>0;return{matches:le,loaderData:Wr,errors:Dr,...Xi?{fetchers:new Map(O.fetchers)}:{}}}function pe(B){if(B&&!Tr(B[1]))return{[B[0]]:B[1].data};if(O.actionData)return Object.keys(O.actionData).length===0?null:O.actionData}function De(B){return B.forEach(Q=>{let le=O.fetchers.get(Q.key),be=Xl(void 0,le?le.data:void 0);O.fetchers.set(Q.key,be)}),new Map(O.fetchers)}async function xe(B,Q,le,be){Pe(B);let Ce=(be&&be.flushSync)===!0,We=m||d,He=Ap(O.location,O.matches,f,le,Q,be==null?void 0:be.relative),Me=xi(We,He,f),Ae=qt(Me,We,He);if(Ae.active&&Ae.matches&&(Me=Ae.matches),!Me){ft(B,Q,Hr(404,{pathname:He}),{flushSync:Ce});return}let{path:Ue,submission:at,error:Qe}=Cw(!0,He,be);if(Qe){ft(B,Q,Qe,{flushSync:Ce});return}let ut=e.getContext?await e.getContext():new ww,St=(be&&be.preventScrollReset)===!0;if(at&&qn(at.formMethod)){await qe(B,Q,Ue,Me,ut,Ae.active,Ce,St,at,be&&be.unstable_defaultShouldRevalidate);return}$.set(B,{routeId:Q,path:Ue}),await Ge(B,Q,Ue,Me,ut,Ae.active,Ce,St,at)}async function qe(B,Q,le,be,Ce,We,He,Me,Ae,Ue){Ft(),$.delete(B);let at=O.fetchers.get(B);tt(B,s2(Ae,at),{flushSync:He});let Qe=new AbortController,ut=Es(e.history,le,Qe.signal,Ae);if(We){let Dt=await Xn(be,new URL(ut.url).pathname,ut.signal,B);if(Dt.type==="aborted")return;if(Dt.type==="error"){ft(B,Q,Dt.error,{flushSync:He});return}else if(Dt.matches)be=Dt.matches;else{ft(B,Q,Hr(404,{pathname:le}),{flushSync:He});return}}let St=xd(be,le);if(!St.route.action&&!St.route.lazy){let Dt=Hr(405,{method:Ae.formMethod,pathname:le,routeId:Q});ft(B,Q,Dt,{flushSync:He});return}U.set(B,Qe);let an=ie,cn=Os(l,u,ut,be,St,i,Ce),un=await ot(ut,cn,Ce,B),Ot=un[St.route.id];if(!Ot){for(let Dt of cn)if(un[Dt.route.id]){Ot=un[Dt.route.id];break}}if(ut.signal.aborted){U.get(B)===Qe&&U.delete(B);return}if(te.has(B)){if(vo(Ot)||Tr(Ot)){tt(B,Ya(void 0));return}}else{if(vo(Ot))if(U.delete(B),ae>an){tt(B,Ya(void 0));return}else return X.add(B),tt(B,Xl(Ae)),Le(ut,Ot,!1,{fetcherSubmission:Ae,preventScrollReset:Me});if(Tr(Ot)){ft(B,Q,Ot.error);return}}let Dn=O.navigation.location||O.location,ir=Es(e.history,Dn,Qe.signal),tn=m||d,Xr=O.navigation.state!=="idle"?xi(tn,O.navigation.location,f):O.matches;bt(Xr,"Didn't find any matches after fetcher action");let yr=++ie;P.set(B,yr);let Wr=Xl(Ae,Ot.data);O.fetchers.set(B,Wr);let{dsMatches:Dr,revalidatingFetchers:Ra}=Ow(ir,Ce,l,u,e.history,O,Xr,Ae,Dn,i,!1,_,j,te,$,X,tn,f,e.patchRoutesOnNavigation!=null,[St.route.id,Ot],Ue);Ra.filter(Dt=>Dt.key!==B).forEach(Dt=>{let Wi=Dt.key,Yc=O.fetchers.get(Wi),rl=Xl(void 0,Yc?Yc.data:void 0);O.fetchers.set(Wi,rl),Pe(Wi),Dt.controller&&U.set(Wi,Dt.controller)}),ne({fetchers:new Map(O.fetchers)});let Ki=()=>Ra.forEach(Dt=>Pe(Dt.key));Qe.signal.addEventListener("abort",Ki);let{loaderResults:Xi,fetcherResults:Mt}=await Pt(Dr,Ra,ir,Ce);if(Qe.signal.aborted)return;if(Qe.signal.removeEventListener("abort",Ki),P.delete(B),U.delete(B),Ra.forEach(Dt=>U.delete(Dt.key)),O.fetchers.has(B)){let Dt=Ya(Ot.data);O.fetchers.set(B,Dt)}let pn=ad(Xi);if(pn)return Le(ir,pn.result,!1,{preventScrollReset:Me});if(pn=ad(Mt),pn)return X.add(pn.key),Le(ir,pn.result,!1,{preventScrollReset:Me});let{loaderData:$r,errors:zn}=Lw(O,Xr,Xi,void 0,Ra,Mt);Kn(yr),O.navigation.state==="loading"&&yr>ae?(bt(L,"Expected pending action"),Z&&Z.abort(),fe(O.navigation.location,{matches:Xr,loaderData:$r,errors:zn,fetchers:new Map(O.fetchers)})):(ne({errors:zn,loaderData:zw(O.loaderData,$r,Xr,zn),fetchers:new Map(O.fetchers)}),_=!1)}async function Ge(B,Q,le,be,Ce,We,He,Me,Ae){let Ue=O.fetchers.get(B);tt(B,Xl(Ae,Ue?Ue.data:void 0),{flushSync:He});let at=new AbortController,Qe=Es(e.history,le,at.signal);if(We){let Ot=await Xn(be,new URL(Qe.url).pathname,Qe.signal,B);if(Ot.type==="aborted")return;if(Ot.type==="error"){ft(B,Q,Ot.error,{flushSync:He});return}else if(Ot.matches)be=Ot.matches;else{ft(B,Q,Hr(404,{pathname:le}),{flushSync:He});return}}let ut=xd(be,le);U.set(B,at);let St=ie,an=Os(l,u,Qe,be,ut,i,Ce),un=(await ot(Qe,an,Ce,B))[ut.route.id];if(U.get(B)===at&&U.delete(B),!Qe.signal.aborted){if(te.has(B)){tt(B,Ya(void 0));return}if(vo(un))if(ae>St){tt(B,Ya(void 0));return}else{X.add(B),await Le(Qe,un,!1,{preventScrollReset:Me});return}if(Tr(un)){ft(B,Q,un.error);return}tt(B,Ya(un.data))}}async function Le(B,Q,le,{submission:be,fetcherSubmission:Ce,preventScrollReset:We,replace:He}={}){le||(G==null||G.resolve(),G=null),Q.response.headers.has("X-Remix-Revalidate")&&(_=!0);let Me=Q.response.headers.get("Location");bt(Me,"Expected a Location header on the redirect Response"),Me=kw(Me,new URL(B.url),f,e.history);let Ae=pc(O.location,Me,{_isRedirect:!0});if(r){let an=!1;if(Q.response.headers.has("X-Remix-Reload-Document"))an=!0;else if(fg(Me)){const cn=Kx(Me,!0);an=cn.origin!==t.location.origin||qr(cn.pathname,f)==null}if(an){He?t.location.replace(Me):t.location.assign(Me);return}}Z=null;let Ue=He===!0||Q.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:at,formAction:Qe,formEncType:ut}=O.navigation;!be&&!Ce&&at&&Qe&&ut&&(be=Uw(O.navigation));let St=be||Ce;if(PM.has(Q.response.status)&&St&&qn(St.formMethod))await Te(Ue,Ae,{submission:{...St,formAction:Me},preventScrollReset:We||J,enableViewTransition:le?z:void 0});else{let an=Pm(Ae,be);await Te(Ue,Ae,{overrideNavigation:an,fetcherSubmission:Ce,preventScrollReset:We||J,enableViewTransition:le?z:void 0})}}async function ot(B,Q,le,be){var He;let Ce,We={};try{Ce=await GM(y,B,Q,be,le,!1)}catch(Me){return Q.filter(Ae=>Ae.shouldLoad).forEach(Ae=>{We[Ae.route.id]={type:"error",error:Me}}),We}if(B.signal.aborted)return We;if(!qn(B.method))for(let Me of Q){if(((He=Ce[Me.route.id])==null?void 0:He.type)==="error")break;!Ce.hasOwnProperty(Me.route.id)&&!O.loaderData.hasOwnProperty(Me.route.id)&&(!O.errors||!O.errors.hasOwnProperty(Me.route.id))&&Me.shouldCallHandler()&&(Ce[Me.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Me.route.id}`)})}for(let[Me,Ae]of Object.entries(Ce))if(n2(Ae)){let Ue=Ae.result;We[Me]={type:"redirect",response:$M(Ue,B,Me,Q,f)}}else We[Me]=await WM(Ae);return We}async function Pt(B,Q,le,be){let Ce=ot(le,B,be,null),We=Promise.all(Q.map(async Ae=>{if(Ae.matches&&Ae.match&&Ae.request&&Ae.controller){let at=(await ot(Ae.request,Ae.matches,be,Ae.key))[Ae.match.route.id];return{[Ae.key]:at}}else return Promise.resolve({[Ae.key]:{type:"error",error:Hr(404,{pathname:Ae.path})}})})),He=await Ce,Me=(await We).reduce((Ae,Ue)=>Object.assign(Ae,Ue),{});return{loaderResults:He,fetcherResults:Me}}function Ft(){_=!0,$.forEach((B,Q)=>{U.has(Q)&&j.add(Q),Pe(Q)})}function tt(B,Q,le={}){O.fetchers.set(B,Q),ne({fetchers:new Map(O.fetchers)},{flushSync:(le&&le.flushSync)===!0})}function ft(B,Q,le,be={}){let Ce=Ei(O.matches,Q);ln(B),ne({errors:{[Ce.route.id]:le},fetchers:new Map(O.fetchers)},{flushSync:(be&&be.flushSync)===!0})}function Ct(B){return F.set(B,(F.get(B)||0)+1),te.has(B)&&te.delete(B),O.fetchers.get(B)||IM}function sn(B,Q){Pe(B,Q==null?void 0:Q.reason),tt(B,Ya(null))}function ln(B){let Q=O.fetchers.get(B);U.has(B)&&!(Q&&Q.state==="loading"&&P.has(B))&&Pe(B),$.delete(B),P.delete(B),X.delete(B),te.delete(B),j.delete(B),O.fetchers.delete(B)}function On(B){let Q=(F.get(B)||0)-1;Q<=0?(F.delete(B),te.add(B)):F.set(B,Q),ne({fetchers:new Map(O.fetchers)})}function Pe(B,Q){let le=U.get(B);le&&(le.abort(Q),U.delete(B))}function st(B){for(let Q of B){let le=Ct(Q),be=Ya(le.data);O.fetchers.set(Q,be)}}function gt(){let B=[],Q=!1;for(let le of X){let be=O.fetchers.get(le);bt(be,`Expected fetcher: ${le}`),be.state==="loading"&&(X.delete(le),B.push(le),Q=!0)}return st(B),Q}function Kn(B){let Q=[];for(let[le,be]of P)if(be<B){let Ce=O.fetchers.get(le);bt(Ce,`Expected fetcher: ${le}`),Ce.state==="loading"&&(Pe(le),P.delete(le),Q.push(le))}return st(Q),Q.length>0}function rn(B,Q){let le=O.blockers.get(B)||Kl;return ue.get(B)!==Q&&ue.set(B,Q),le}function lt(B){O.blockers.delete(B),ue.delete(B)}function wt(B,Q){let le=O.blockers.get(B)||Kl;bt(le.state==="unblocked"&&Q.state==="blocked"||le.state==="blocked"&&Q.state==="blocked"||le.state==="blocked"&&Q.state==="proceeding"||le.state==="blocked"&&Q.state==="unblocked"||le.state==="proceeding"&&Q.state==="unblocked",`Invalid blocker state transition: ${le.state} -> ${Q.state}`);let be=new Map(O.blockers);be.set(B,Q),ne({blockers:be})}function et({currentLocation:B,nextLocation:Q,historyAction:le}){if(ue.size===0)return;ue.size>1&&En(!1,"A router only supports one blocker at a time");let be=Array.from(ue.entries()),[Ce,We]=be[be.length-1],He=O.blockers.get(Ce);if(!(He&&He.state==="proceeding")&&We({currentLocation:B,nextLocation:Q,historyAction:le}))return Ce}function vt(B){let Q=Hr(404,{pathname:B}),le=m||d,{matches:be,route:Ce}=rd(le);return{notFoundMatches:be,route:Ce,error:Q}}function Ht(B,Q,le){if(S=B,R=Q,x=le||null,!T&&O.navigation===zm){T=!0;let be=Zt(O.location,O.matches);be!=null&&ne({restoreScrollPosition:be})}return()=>{S=null,R=null,x=null}}function Ke(B,Q){return x&&x(B,Q.map(be=>cM(be,O.loaderData)))||B.key}function It(B,Q){if(S&&R){let le=Ke(B,Q);S[le]=R()}}function Zt(B,Q){if(S){let le=Ke(B,Q),be=S[le];if(typeof be=="number")return be}return null}function qt(B,Q,le){if(e.patchRoutesOnNavigation)if(B){if(Object.keys(B[0].params).length>0)return{active:!0,matches:rc(Q,le,f,!0)}}else return{active:!0,matches:rc(Q,le,f,!0)||[]};return{active:!1,matches:null}}async function Xn(B,Q,le,be){if(!e.patchRoutesOnNavigation)return{type:"success",matches:B};let Ce=B;for(;;){let We=m==null,He=m||d,Me=u;try{await e.patchRoutesOnNavigation({signal:le,path:Q,matches:Ce,fetcherKey:be,patch:(at,Qe)=>{le.aborted||Mw(at,Qe,He,Me,l,!1)}})}catch(at){return{type:"error",error:at,partialMatches:Ce}}finally{We&&!le.aborted&&(d=[...d])}if(le.aborted)return{type:"aborted"};let Ae=xi(He,Q,f),Ue=null;if(Ae){if(Object.keys(Ae[0].params).length===0)return{type:"success",matches:Ae};if(Ue=rc(He,Q,f,!0),!(Ue&&Ce.length<Ue.length&&Gt(Ce,Ue.slice(0,Ce.length))))return{type:"success",matches:Ae}}if(Ue||(Ue=rc(He,Q,f,!0)),!Ue||Gt(Ce,Ue))return{type:"success",matches:null};Ce=Ue}}function Gt(B,Q){return B.length===Q.length&&B.every((le,be)=>le.route.id===Q[be].route.id)}function Mn(B){u={},m=gc(B,l,void 0,u)}function Kr(B,Q,le=!1){let be=m==null;Mw(B,Q,m||d,u,l,le),be&&(d=[...d],ne({}))}return k={get basename(){return f},get future(){return p},get state(){return O},get routes(){return d},get window(){return t},initialize:ve,subscribe:Xe,enableScrollRestoration:Ht,navigate:Se,fetch:xe,revalidate:Ne,createHref:B=>e.history.createHref(B),encodeLocation:B=>e.history.encodeLocation(B),getFetcher:Ct,resetFetcher:sn,deleteFetcher:On,dispose:ke,getBlocker:rn,deleteBlocker:lt,patchRoutes:Kr,_internalFetchControllers:U,_internalSetRoutes:Mn,_internalSetStateDoNotUseOrYouWillBreakYourApp(B){ne(B)}},e.unstable_instrumentations&&(k=MM(k,e.unstable_instrumentations.map(B=>B.router).filter(Boolean))),k}function HM(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ap(e,t,r,i,s,l){let u,d;if(s){u=[];for(let f of t)if(u.push(f),f.route.id===s){d=f;break}}else u=t,d=t[t.length-1];let m=mg(i||".",hg(u),qr(e.pathname,r)||e.pathname,l==="path");if(i==null&&(m.search=e.search,m.hash=e.hash),(i==null||i===""||i===".")&&d){let f=yg(m.search);if(d.route.index&&!f)m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&f){let y=new URLSearchParams(m.search),p=y.getAll("index");y.delete("index"),p.filter(b=>b).forEach(b=>y.append("index",b));let v=y.toString();m.search=v?`?${v}`:""}}return r!=="/"&&(m.pathname=xM({basename:r,pathname:m.pathname})),ba(m)}function Cw(e,t,r){if(!r||!HM(r))return{path:t};if(r.formMethod&&!i2(r.formMethod))return{path:t,error:Hr(405,{method:r.formMethod})};let i=()=>({path:t,error:Hr(400,{type:"invalid-body"})}),l=(r.formMethod||"get").toUpperCase(),u=uE(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!qn(l))return i();let p=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((v,[b,S])=>`${v}${b}=${S}
60
- `,""):String(r.body);return{path:t,submission:{formMethod:l,formAction:u,formEncType:r.formEncType,formData:void 0,json:void 0,text:p}}}else if(r.formEncType==="application/json"){if(!qn(l))return i();try{let p=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:l,formAction:u,formEncType:r.formEncType,formData:void 0,json:p,text:void 0}}}catch{return i()}}}bt(typeof FormData=="function","FormData is not available in this environment");let d,m;if(r.formData)d=_p(r.formData),m=r.formData;else if(r.body instanceof FormData)d=_p(r.body),m=r.body;else if(r.body instanceof URLSearchParams)d=r.body,m=_w(d);else if(r.body==null)d=new URLSearchParams,m=new FormData;else try{d=new URLSearchParams(r.body),m=_w(d)}catch{return i()}let f={formMethod:l,formAction:u,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:m,json:void 0,text:void 0};if(qn(f.formMethod))return{path:t,submission:f};let y=ji(t);return e&&y.search&&yg(y.search)&&d.append("index",""),y.search=`?${d}`,{path:ba(y),submission:f}}function Ow(e,t,r,i,s,l,u,d,m,f,y,p,v,b,S,x,R,T,M,D,C){var q;let N=D?Tr(D[1])?D[1].error:D[1].data:void 0,k=s.createURL(l.location),O=s.createURL(m),L;if(y&&l.errors){let _=Object.keys(l.errors)[0];L=u.findIndex(j=>j.route.id===_)}else if(D&&Tr(D[1])){let _=D[0];L=u.findIndex(j=>j.route.id===_)-1}let G=D?D[1].statusCode:void 0,J=G&&G>=400,Z={currentUrl:k,currentParams:((q=l.matches[0])==null?void 0:q.params)||{},nextUrl:O,nextParams:u[0].params,...d,actionResult:N,actionStatus:G},z=Nc(u),H=u.map((_,j)=>{let{route:U}=_,ie=null;if(L!=null&&j>L?ie=!1:U.lazy?ie=!0:pg(U)?y?ie=Np(U,l.loaderData,l.errors):BM(l.loaderData,l.matches[j],_)&&(ie=!0):ie=!1,ie!==null)return kp(r,i,e,z,_,f,t,ie);let ae=!1;typeof C=="boolean"?ae=C:J?ae=!1:(p||k.pathname+k.search===O.pathname+O.search||k.search!==O.search||FM(l.matches[j],_))&&(ae=!0);let P={...Z,defaultShouldRevalidate:ae},X=ic(_,P);return kp(r,i,e,z,_,f,t,X,P,C)}),V=[];return S.forEach((_,j)=>{if(y||!u.some(te=>te.route.id===_.routeId)||b.has(j))return;let U=l.fetchers.get(j),ie=U&&U.state!=="idle"&&U.data===void 0,ae=xi(R,_.path,T);if(!ae){if(M&&ie)return;V.push({key:j,routeId:_.routeId,path:_.path,matches:null,match:null,request:null,controller:null});return}if(x.has(j))return;let P=xd(ae,_.path),X=new AbortController,$=Es(s,_.path,X.signal),F=null;if(v.has(j))v.delete(j),F=Os(r,i,$,ae,P,f,t);else if(ie)p&&(F=Os(r,i,$,ae,P,f,t));else{let te;typeof C=="boolean"?te=C:J?te=!1:te=p;let ue={...Z,defaultShouldRevalidate:te};ic(P,ue)&&(F=Os(r,i,$,ae,P,f,t,ue))}F&&V.push({key:j,routeId:_.routeId,path:_.path,matches:F,match:P,request:$,controller:X})}),{dsMatches:H,revalidatingFetchers:V}}function pg(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Np(e,t,r){if(e.lazy)return!0;if(!pg(e))return!1;let i=t!=null&&e.id in t,s=r!=null&&r[e.id]!==void 0;return!i&&s?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!i&&!s}function BM(e,t,r){let i=!t||r.route.id!==t.route.id,s=!e.hasOwnProperty(r.route.id);return i||s}function FM(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function ic(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function Mw(e,t,r,i,s,l){let u;if(e){let f=i[e];bt(f,`No route found to patch children into: routeId = ${e}`),f.children||(f.children=[]),u=f.children}else u=r;let d=[],m=[];if(t.forEach(f=>{let y=u.find(p=>iE(f,p));y?m.push({existingRoute:y,newRoute:f}):d.push(f)}),d.length>0){let f=gc(d,s,[e||"_","patch",String((u==null?void 0:u.length)||"0")],i);u.push(...f)}if(l&&m.length>0)for(let f=0;f<m.length;f++){let{existingRoute:y,newRoute:p}=m[f],v=y,[b]=gc([p],s,[],{},!0);Object.assign(v,{element:b.element?b.element:v.element,errorElement:b.errorElement?b.errorElement:v.errorElement,hydrateFallbackElement:b.hydrateFallbackElement?b.hydrateFallbackElement:v.hydrateFallbackElement})}}function iE(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,i)=>{var s;return(s=t.children)==null?void 0:s.some(l=>iE(r,l))}):!1}var Dw=new WeakMap,oE=({key:e,route:t,manifest:r,mapRouteProperties:i})=>{let s=r[t.id];if(bt(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let l=s.lazy[e];if(!l)return;let u=Dw.get(s);u||(u={},Dw.set(s,u));let d=u[e];if(d)return d;let m=(async()=>{let f=iM(e),p=s[e]!==void 0&&e!=="hasErrorBoundary";if(f)En(!f,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),u[e]=Promise.resolve();else if(p)En(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let v=await l();v!=null&&(Object.assign(s,{[e]:v}),Object.assign(s,i(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(v=>v===void 0)&&(s.lazy=void 0))})();return u[e]=m,m},Aw=new WeakMap;function VM(e,t,r,i,s){let l=r[e.id];if(bt(l,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let y=Aw.get(l);if(y)return{lazyRoutePromise:y,lazyHandlerPromise:y};let p=(async()=>{bt(typeof e.lazy=="function","No lazy route function found");let v=await e.lazy(),b={};for(let S in v){let x=v[S];if(x===void 0)continue;let R=sM(S),M=l[S]!==void 0&&S!=="hasErrorBoundary";R?En(!R,"Route property "+S+" is not a supported property to be returned from a lazy route function. This property will be ignored."):M?En(!M,`Route "${l.id}" has a static property "${S}" defined but its lazy function is also returning a value for this property. The lazy route property "${S}" will be ignored.`):b[S]=x}Object.assign(l,b),Object.assign(l,{...i(l),lazy:void 0})})();return Aw.set(l,p),p.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:p}}let u=Object.keys(e.lazy),d=[],m;for(let y of u){if(s&&s.includes(y))continue;let p=oE({key:y,route:e,manifest:r,mapRouteProperties:i});p&&(d.push(p),y===t&&(m=p))}let f=d.length>0?Promise.all(d).then(()=>{}):void 0;return f==null||f.catch(()=>{}),m==null||m.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:m}}async function Nw(e){let t=e.matches.filter(s=>s.shouldLoad),r={};return(await Promise.all(t.map(s=>s.resolve()))).forEach((s,l)=>{r[t[l].route.id]=s}),r}async function YM(e){return e.matches.some(t=>t.route.middleware)?sE(e,()=>Nw(e)):Nw(e)}function sE(e,t){return qM(e,t,i=>{if(a2(i))throw i;return i},e2,r);function r(i,s,l){if(l)return Promise.resolve(Object.assign(l.value,{[s]:{type:"error",result:i}}));{let{matches:u}=e,d=Math.min(Math.max(u.findIndex(f=>f.route.id===s),0),Math.max(u.findIndex(f=>f.shouldCallHandler()),0)),m=Ei(u,u[d].route.id).route.id;return Promise.resolve({[m]:{type:"error",result:i}})}}}async function qM(e,t,r,i,s){let{matches:l,request:u,params:d,context:m,unstable_pattern:f}=e,y=l.flatMap(v=>v.route.middleware?v.route.middleware.map(b=>[v.route.id,b]):[]);return await lE({request:u,params:d,context:m,unstable_pattern:f},y,t,r,i,s)}async function lE(e,t,r,i,s,l,u=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let m=t[u];if(!m)return await r();let[f,y]=m,p,v=async()=>{if(p)throw new Error("You may only call `next()` once per middleware");try{return p={value:await lE(e,t,r,i,s,l,u+1)},p.value}catch(b){return p={value:await l(b,f,p)},p.value}};try{let b=await y(e,v),S=b!=null?i(b):void 0;return s(S)?S:p?S??p.value:(p={value:await v()},p.value)}catch(b){return await l(b,f,p)}}function cE(e,t,r,i,s){let l=oE({key:"middleware",route:i.route,manifest:t,mapRouteProperties:e}),u=VM(i.route,qn(r.method)?"action":"loader",t,e,s);return{middleware:l,route:u.lazyRoutePromise,handler:u.lazyHandlerPromise}}function kp(e,t,r,i,s,l,u,d,m=null,f){let y=!1,p=cE(e,t,r,s,l);return{...s,_lazyPromises:p,shouldLoad:d,shouldRevalidateArgs:m,shouldCallHandler(v){return y=!0,m?typeof f=="boolean"?ic(s,{...m,defaultShouldRevalidate:f}):typeof v=="boolean"?ic(s,{...m,defaultShouldRevalidate:v}):ic(s,m):d},resolve(v){let{lazy:b,loader:S,middleware:x}=s.route,R=y||d||v&&!qn(r.method)&&(b||S),T=x&&x.length>0&&!S&&!b;return R&&(qn(r.method)||!T)?KM({request:r,unstable_pattern:i,match:s,lazyHandlerPromise:p==null?void 0:p.handler,lazyRoutePromise:p==null?void 0:p.route,handlerOverride:v,scopedContext:u}):Promise.resolve({type:"data",result:void 0})}}}function Os(e,t,r,i,s,l,u,d=null){return i.map(m=>m.route.id!==s.route.id?{...m,shouldLoad:!1,shouldRevalidateArgs:d,shouldCallHandler:()=>!1,_lazyPromises:cE(e,t,r,m,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:kp(e,t,r,Nc(i),m,l,u,!0,d))}async function GM(e,t,r,i,s,l){r.some(f=>{var y;return(y=f._lazyPromises)==null?void 0:y.middleware})&&await Promise.all(r.map(f=>{var y;return(y=f._lazyPromises)==null?void 0:y.middleware}));let u={request:t,unstable_pattern:Nc(r),params:r[0].params,context:s,matches:r},m=await e({...u,fetcherKey:i,runClientMiddleware:f=>{let y=u;return sE(y,()=>f({...y,fetcherKey:i,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(f=>{var y,p;return[(y=f._lazyPromises)==null?void 0:y.handler,(p=f._lazyPromises)==null?void 0:p.route]}))}catch{}return m}async function KM({request:e,unstable_pattern:t,match:r,lazyHandlerPromise:i,lazyRoutePromise:s,handlerOverride:l,scopedContext:u}){let d,m,f=qn(e.method),y=f?"action":"loader",p=v=>{let b,S=new Promise((T,M)=>b=M);m=()=>b(),e.signal.addEventListener("abort",m);let x=T=>typeof v!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${y}" [routeId: ${r.route.id}]`)):v({request:e,unstable_pattern:t,params:r.params,context:u},...T!==void 0?[T]:[]),R=(async()=>{try{return{type:"data",result:await(l?l(M=>x(M)):x())}}catch(T){return{type:"error",result:T}}})();return Promise.race([R,S])};try{let v=f?r.route.action:r.route.loader;if(i||s)if(v){let b,[S]=await Promise.all([p(v).catch(x=>{b=x}),i,s]);if(b!==void 0)throw b;d=S}else{await i;let b=f?r.route.action:r.route.loader;if(b)[d]=await Promise.all([p(b),s]);else if(y==="action"){let S=new URL(e.url),x=S.pathname+S.search;throw Hr(405,{method:e.method,pathname:x,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(v)d=await p(v);else{let b=new URL(e.url),S=b.pathname+b.search;throw Hr(404,{pathname:S})}}catch(v){return{type:"error",result:v}}finally{m&&e.signal.removeEventListener("abort",m)}return d}async function XM(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function WM(e){var i,s,l,u,d;let{result:t,type:r}=e;if(gg(t)){let m;try{m=await XM(t)}catch(f){return{type:"error",error:f}}return r==="error"?{type:"error",error:new Ac(t.status,t.statusText,m),statusCode:t.status,headers:t.headers}:{type:"data",data:m,statusCode:t.status,headers:t.headers}}return r==="error"?Iw(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(i=t.init)==null?void 0:i.status,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}:{type:"error",error:JM(t),statusCode:vc(t)?t.status:void 0,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:vc(t)?t.status:void 0}:Iw(t)?{type:"data",data:t.data,statusCode:(u=t.init)==null?void 0:u.status,headers:(d=t.init)!=null&&d.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function $M(e,t,r,i,s){let l=e.headers.get("Location");if(bt(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!fg(l)){let u=i.slice(0,i.findIndex(d=>d.route.id===r)+1);l=Ap(new URL(t.url),u,s,l),e.headers.set("Location",l)}return e}function kw(e,t,r,i){let s=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(fg(e)){let l=e,u=l.startsWith("//")?new URL(t.protocol+l):new URL(l);if(s.includes(u.protocol))throw new Error("Invalid redirect location");let d=qr(u.pathname,r)!=null;if(u.origin===t.origin&&d)return u.pathname+u.search+u.hash}try{let l=i.createURL(e);if(s.includes(l.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Es(e,t,r,i){let s=e.createURL(uE(t)).toString(),l={signal:r};if(i&&qn(i.formMethod)){let{formMethod:u,formEncType:d}=i;l.method=u.toUpperCase(),d==="application/json"?(l.headers=new Headers({"Content-Type":d}),l.body=JSON.stringify(i.json)):d==="text/plain"?l.body=i.text:d==="application/x-www-form-urlencoded"&&i.formData?l.body=_p(i.formData):l.body=i.formData}return new Request(s,l)}function _p(e){let t=new URLSearchParams;for(let[r,i]of e.entries())t.append(r,typeof i=="string"?i:i.name);return t}function _w(e){let t=new FormData;for(let[r,i]of e.entries())t.append(r,i);return t}function QM(e,t,r,i=!1,s=!1){let l={},u=null,d,m=!1,f={},y=r&&Tr(r[1])?r[1].error:void 0;return e.forEach(p=>{if(!(p.route.id in t))return;let v=p.route.id,b=t[v];if(bt(!vo(b),"Cannot handle redirect results in processLoaderData"),Tr(b)){let S=b.error;if(y!==void 0&&(S=y,y=void 0),u=u||{},s)u[v]=S;else{let x=Ei(e,v);u[x.route.id]==null&&(u[x.route.id]=S)}i||(l[v]=aE),m||(m=!0,d=vc(b.error)?b.error.status:500),b.headers&&(f[v]=b.headers)}else l[v]=b.data,b.statusCode&&b.statusCode!==200&&!m&&(d=b.statusCode),b.headers&&(f[v]=b.headers)}),y!==void 0&&r&&(u={[r[0]]:y},r[2]&&(l[r[2]]=void 0)),{loaderData:l,errors:u,statusCode:d||200,loaderHeaders:f}}function Lw(e,t,r,i,s,l){let{loaderData:u,errors:d}=QM(t,r,i);return s.filter(m=>!m.matches||m.matches.some(f=>f.shouldLoad)).forEach(m=>{let{key:f,match:y,controller:p}=m;if(p&&p.signal.aborted)return;let v=l[f];if(bt(v,"Did not find corresponding fetcher result"),Tr(v)){let b=Ei(e.matches,y==null?void 0:y.route.id);d&&d[b.route.id]||(d={...d,[b.route.id]:v.error}),e.fetchers.delete(f)}else if(vo(v))bt(!1,"Unhandled fetcher revalidation redirect");else{let b=Ya(v.data);e.fetchers.set(f,b)}}),{loaderData:u,errors:d}}function zw(e,t,r,i){let s=Object.entries(t).filter(([,l])=>l!==aE).reduce((l,[u,d])=>(l[u]=d,l),{});for(let l of r){let u=l.route.id;if(!t.hasOwnProperty(u)&&e.hasOwnProperty(u)&&l.route.loader&&(s[u]=e[u]),i&&i.hasOwnProperty(u))break}return s}function Pw(e){return e?Tr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ei(e,t){return(t?e.slice(0,e.findIndex(i=>i.route.id===t)+1):[...e]).reverse().find(i=>i.route.hasErrorBoundary===!0)||e[0]}function rd(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Hr(e,{pathname:t,routeId:r,method:i,type:s,message:l}={}){let u="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(u="Bad Request",i&&t&&r?d=`You made a ${i} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:s==="invalid-body"&&(d="Unable to encode submission body")):e===403?(u="Forbidden",d=`Route "${r}" does not match URL "${t}"`):e===404?(u="Not Found",d=`No route matches URL "${t}"`):e===405&&(u="Method Not Allowed",i&&t&&r?d=`You made a ${i.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:i&&(d=`Invalid request method "${i.toUpperCase()}"`)),new Ac(e||500,u,new Error(d),!0)}function ad(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[i,s]=t[r];if(vo(s))return{key:i,result:s}}}function uE(e){let t=typeof e=="string"?ji(e):e;return ba({...t,hash:""})}function ZM(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function JM(e){var t,r;return new Ac(((t=e.init)==null?void 0:t.status)??500,((r=e.init)==null?void 0:r.statusText)??"Internal Server Error",e.data)}function e2(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&t2(r))}function t2(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function n2(e){return gg(e.result)&&nE.has(e.result.status)}function Tr(e){return e.type==="error"}function vo(e){return(e&&e.type)==="redirect"}function Iw(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function gg(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function r2(e){return nE.has(e)}function a2(e){return gg(e)&&r2(e.status)&&e.headers.has("Location")}function i2(e){return zM.has(e.toUpperCase())}function qn(e){return _M.has(e.toUpperCase())}function yg(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function xd(e,t){let r=typeof t=="string"?ji(t).search:t.search;if(e[e.length-1].route.index&&yg(r||""))return e[e.length-1];let i=Qx(e);return i[i.length-1]}function Uw(e){let{formMethod:t,formAction:r,formEncType:i,text:s,formData:l,json:u}=e;if(!(!t||!r||!i)){if(s!=null)return{formMethod:t,formAction:r,formEncType:i,formData:void 0,json:void 0,text:s};if(l!=null)return{formMethod:t,formAction:r,formEncType:i,formData:l,json:void 0,text:void 0};if(u!==void 0)return{formMethod:t,formAction:r,formEncType:i,formData:void 0,json:u,text:void 0}}}function Pm(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function o2(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Xl(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function s2(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Ya(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function l2(e,t){try{let r=e.sessionStorage.getItem(rE);if(r){let i=JSON.parse(r);for(let[s,l]of Object.entries(i||{}))l&&Array.isArray(l)&&t.set(s,new Set(l||[]))}}catch{}}function c2(e,t){if(t.size>0){let r={};for(let[i,s]of t)r[i]=[...s];try{e.sessionStorage.setItem(rE,JSON.stringify(r))}catch(i){En(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function jw(){let e,t,r=new Promise((i,s)=>{e=async l=>{i(l);try{await r}catch{}},t=async l=>{s(l);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var Io=w.createContext(null);Io.displayName="DataRouter";var kc=w.createContext(null);kc.displayName="DataRouterState";var dE=w.createContext(!1);function u2(){return w.useContext(dE)}var vg=w.createContext({isTransitioning:!1});vg.displayName="ViewTransition";var fE=w.createContext(new Map);fE.displayName="Fetchers";var d2=w.createContext(null);d2.displayName="Await";var Gr=w.createContext(null);Gr.displayName="Navigation";var Jd=w.createContext(null);Jd.displayName="Location";var aa=w.createContext({outlet:null,matches:[],isDataRoute:!1});aa.displayName="Route";var bg=w.createContext(null);bg.displayName="RouteError";var hE="REACT_ROUTER_ERROR",f2="REDIRECT",h2="ROUTE_ERROR_RESPONSE";function m2(e){if(e.startsWith(`${hE}:${f2}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function p2(e){if(e.startsWith(`${hE}:${h2}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Ac(t.status,t.statusText,t.data)}catch{}}function g2(e,{relative:t}={}){bt(_c(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:i}=w.useContext(Gr),{hash:s,pathname:l,search:u}=Lc(e,{relative:t}),d=l;return r!=="/"&&(d=l==="/"?r:pa([r,l])),i.createHref({pathname:d,search:u,hash:s})}function _c(){return w.useContext(Jd)!=null}function Wa(){return bt(_c(),"useLocation() may be used only in the context of a <Router> component."),w.useContext(Jd).location}var mE="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function pE(e){w.useContext(Gr).static||w.useLayoutEffect(e)}function gE(){let{isDataRoute:e}=w.useContext(aa);return e?k2():y2()}function y2(){bt(_c(),"useNavigate() may be used only in the context of a <Router> component.");let e=w.useContext(Io),{basename:t,navigator:r}=w.useContext(Gr),{matches:i}=w.useContext(aa),{pathname:s}=Wa(),l=JSON.stringify(hg(i)),u=w.useRef(!1);return pE(()=>{u.current=!0}),w.useCallback((m,f={})=>{if(En(u.current,mE),!u.current)return;if(typeof m=="number"){r.go(m);return}let y=mg(m,JSON.parse(l),s,f.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:pa([t,y.pathname])),(f.replace?r.replace:r.push)(y,f.state,f)},[t,r,l,s,e])}var v2=w.createContext(null);function b2(e){let t=w.useContext(aa).outlet;return w.useMemo(()=>t&&w.createElement(v2.Provider,{value:e},t),[t,e])}function w2(){let{matches:e}=w.useContext(aa),t=e[e.length-1];return t?t.params:{}}function Lc(e,{relative:t}={}){let{matches:r}=w.useContext(aa),{pathname:i}=Wa(),s=JSON.stringify(hg(r));return w.useMemo(()=>mg(e,JSON.parse(s),i,t==="path"),[e,s,i,t])}function S2(e,t,r,i,s){bt(_c(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=w.useContext(Gr),{matches:u}=w.useContext(aa),d=u[u.length-1],m=d?d.params:{},f=d?d.pathname:"/",y=d?d.pathnameBase:"/",p=d&&d.route;{let M=p&&p.path||"";vE(f,!p||M.endsWith("*")||M.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${M}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
61
-
62
- Please change the parent <Route path="${M}"> to <Route path="${M==="/"?"*":`${M}/*`}">.`)}let v=Wa(),b;b=v;let S=b.pathname||"/",x=S;if(y!=="/"){let M=y.replace(/^\//,"").split("/");x="/"+S.replace(/^\//,"").split("/").slice(M.length).join("/")}let R=xi(e,{pathname:x});return En(p||R!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),En(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),C2(R&&R.map(M=>Object.assign({},M,{params:Object.assign({},m,M.params),pathname:pa([y,l.encodeLocation?l.encodeLocation(M.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathname]),pathnameBase:M.pathnameBase==="/"?y:pa([y,l.encodeLocation?l.encodeLocation(M.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathnameBase])})),u,r,i,s)}function x2(){let e=N2(),t=vc(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:i},l={padding:"2px 4px",backgroundColor:i},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:l},"ErrorBoundary")," or"," ",w.createElement("code",{style:l},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),r?w.createElement("pre",{style:s},r):null,u)}var E2=w.createElement(x2,null),yE=class extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=p2(e.digest);r&&(e=r)}let t=e!==void 0?w.createElement(aa.Provider,{value:this.props.routeContext},w.createElement(bg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?w.createElement(R2,{error:e},t):t}};yE.contextType=dE;var Im=new WeakMap;function R2({children:e,error:t}){let{basename:r}=w.useContext(Gr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let i=m2(t.digest);if(i){let s=Im.get(t);if(s)throw s;let l=Jx(i.location,r);if(Zx&&!Im.get(t))if(l.isExternal||i.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:i.replace}));throw Im.set(t,u),u}return w.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function T2({routeContext:e,match:t,children:r}){let i=w.useContext(Io);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),w.createElement(aa.Provider,{value:e},r)}function C2(e,t=[],r=null,i=null,s=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let l=e,u=r==null?void 0:r.errors;if(u!=null){let y=l.findIndex(p=>p.route.id&&(u==null?void 0:u[p.route.id])!==void 0);bt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),l=l.slice(0,Math.min(l.length,y+1))}let d=!1,m=-1;if(r)for(let y=0;y<l.length;y++){let p=l[y];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(m=y),p.route.id){let{loaderData:v,errors:b}=r,S=p.route.loader&&!v.hasOwnProperty(p.route.id)&&(!b||b[p.route.id]===void 0);if(p.route.lazy||S){d=!0,m>=0?l=l.slice(0,m+1):l=[l[0]];break}}}let f=r&&i?(y,p)=>{var v,b;i(y,{location:r.location,params:((b=(v=r.matches)==null?void 0:v[0])==null?void 0:b.params)??{},unstable_pattern:Nc(r.matches),errorInfo:p})}:void 0;return l.reduceRight((y,p,v)=>{let b,S=!1,x=null,R=null;r&&(b=u&&p.route.id?u[p.route.id]:void 0,x=p.route.errorElement||E2,d&&(m<0&&v===0?(vE("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,R=null):m===v&&(S=!0,R=p.route.hydrateFallbackElement||null)));let T=t.concat(l.slice(0,v+1)),M=()=>{let D;return b?D=x:S?D=R:p.route.Component?D=w.createElement(p.route.Component,null):p.route.element?D=p.route.element:D=y,w.createElement(T2,{match:p,routeContext:{outlet:y,matches:T,isDataRoute:r!=null},children:D})};return r&&(p.route.ErrorBoundary||p.route.errorElement||v===0)?w.createElement(yE,{location:r.location,revalidation:r.revalidation,component:x,error:b,children:M(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:f}):M()},null)}function wg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function O2(e){let t=w.useContext(Io);return bt(t,wg(e)),t}function M2(e){let t=w.useContext(kc);return bt(t,wg(e)),t}function D2(e){let t=w.useContext(aa);return bt(t,wg(e)),t}function Sg(e){let t=D2(e),r=t.matches[t.matches.length-1];return bt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function A2(){return Sg("useRouteId")}function N2(){var i;let e=w.useContext(bg),t=M2("useRouteError"),r=Sg("useRouteError");return e!==void 0?e:(i=t.errors)==null?void 0:i[r]}function k2(){let{router:e}=O2("useNavigate"),t=Sg("useNavigate"),r=w.useRef(!1);return pE(()=>{r.current=!0}),w.useCallback(async(s,l={})=>{En(r.current,mE),r.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...l}))},[e,t])}var Hw={};function vE(e,t,r){!t&&!Hw[e]&&(Hw[e]=!0,En(!1,r))}var Bw={};function Fw(e,t){!e&&!Bw[t]&&(Bw[t]=!0,console.warn(t))}var _2="useOptimistic",Vw=dg[_2],L2=()=>{};function z2(e){return Vw?Vw(e):[e,L2]}function P2(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&En(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:w.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&En(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:w.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&En(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:w.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var I2=["HydrateFallback","hydrateFallbackElement"],U2=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function j2({router:e,flushSync:t,onError:r,unstable_useTransitions:i}){i=u2()||i;let[l,u]=w.useState(e.state),[d,m]=z2(l),[f,y]=w.useState(),[p,v]=w.useState({isTransitioning:!1}),[b,S]=w.useState(),[x,R]=w.useState(),[T,M]=w.useState(),D=w.useRef(new Map),C=w.useCallback((L,{deletedFetchers:G,newErrors:J,flushSync:Z,viewTransitionOpts:z})=>{J&&r&&Object.values(J).forEach(V=>{var q;return r(V,{location:L.location,params:((q=L.matches[0])==null?void 0:q.params)??{},unstable_pattern:Nc(L.matches)})}),L.fetchers.forEach((V,q)=>{V.data!==void 0&&D.current.set(q,V.data)}),G.forEach(V=>D.current.delete(V)),Fw(Z===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let H=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(Fw(z==null||H,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!z||!H){t&&Z?t(()=>u(L)):i===!1?u(L):w.startTransition(()=>{i===!0&&m(V=>Yw(V,L)),u(L)});return}if(t&&Z){t(()=>{x&&(b==null||b.resolve(),x.skipTransition()),v({isTransitioning:!0,flushSync:!0,currentLocation:z.currentLocation,nextLocation:z.nextLocation})});let V=e.window.document.startViewTransition(()=>{t(()=>u(L))});V.finished.finally(()=>{t(()=>{S(void 0),R(void 0),y(void 0),v({isTransitioning:!1})})}),t(()=>R(V));return}x?(b==null||b.resolve(),x.skipTransition(),M({state:L,currentLocation:z.currentLocation,nextLocation:z.nextLocation})):(y(L),v({isTransitioning:!0,flushSync:!1,currentLocation:z.currentLocation,nextLocation:z.nextLocation}))},[e.window,t,x,b,i,m,r]);w.useLayoutEffect(()=>e.subscribe(C),[e,C]),w.useEffect(()=>{p.isTransitioning&&!p.flushSync&&S(new U2)},[p]),w.useEffect(()=>{if(b&&f&&e.window){let L=f,G=b.promise,J=e.window.document.startViewTransition(async()=>{i===!1?u(L):w.startTransition(()=>{i===!0&&m(Z=>Yw(Z,L)),u(L)}),await G});J.finished.finally(()=>{S(void 0),R(void 0),y(void 0),v({isTransitioning:!1})}),R(J)}},[f,b,e.window,i,m]),w.useEffect(()=>{b&&f&&d.location.key===f.location.key&&b.resolve()},[b,x,d.location,f]),w.useEffect(()=>{!p.isTransitioning&&T&&(y(T.state),v({isTransitioning:!0,flushSync:!1,currentLocation:T.currentLocation,nextLocation:T.nextLocation}),M(void 0))},[p.isTransitioning,T]);let N=w.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:L=>e.navigate(L),push:(L,G,J)=>e.navigate(L,{state:G,preventScrollReset:J==null?void 0:J.preventScrollReset}),replace:(L,G,J)=>e.navigate(L,{replace:!0,state:G,preventScrollReset:J==null?void 0:J.preventScrollReset})}),[e]),k=e.basename||"/",O=w.useMemo(()=>({router:e,navigator:N,static:!1,basename:k,onError:r}),[e,N,k,r]);return w.createElement(w.Fragment,null,w.createElement(Io.Provider,{value:O},w.createElement(kc.Provider,{value:d},w.createElement(fE.Provider,{value:D.current},w.createElement(vg.Provider,{value:p},w.createElement(V2,{basename:k,location:d.location,navigationType:d.historyAction,navigator:N,unstable_useTransitions:i},w.createElement(H2,{routes:e.routes,future:e.future,state:d,onError:r})))))),null)}function Yw(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var H2=w.memo(B2);function B2({routes:e,future:t,state:r,onError:i}){return S2(e,void 0,r,i,t)}function F2(e){return b2(e.context)}function V2({basename:e="/",children:t=null,location:r,navigationType:i="POP",navigator:s,static:l=!1,unstable_useTransitions:u}){bt(!_c(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),m=w.useMemo(()=>({basename:d,navigator:s,static:l,unstable_useTransitions:u,future:{}}),[d,s,l,u]);typeof r=="string"&&(r=ji(r));let{pathname:f="/",search:y="",hash:p="",state:v=null,key:b="default"}=r,S=w.useMemo(()=>{let x=qr(f,d);return x==null?null:{location:{pathname:x,search:y,hash:p,state:v,key:b},navigationType:i}},[d,f,y,p,v,b,i]);return En(S!=null,`<Router basename="${d}"> is not able to match the URL "${f}${y}${p}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:w.createElement(Gr.Provider,{value:m},w.createElement(Jd.Provider,{children:t,value:S}))}var Ed="get",Rd="application/x-www-form-urlencoded";function ef(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Y2(e){return ef(e)&&e.tagName.toLowerCase()==="button"}function q2(e){return ef(e)&&e.tagName.toLowerCase()==="form"}function G2(e){return ef(e)&&e.tagName.toLowerCase()==="input"}function K2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function X2(e,t){return e.button===0&&(!t||t==="_self")&&!K2(e)}var id=null;function W2(){if(id===null)try{new FormData(document.createElement("form"),0),id=!1}catch{id=!0}return id}var $2=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Um(e){return e!=null&&!$2.has(e)?(En(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Rd}"`),null):e}function Q2(e,t){let r,i,s,l,u;if(q2(e)){let d=e.getAttribute("action");i=d?qr(d,t):null,r=e.getAttribute("method")||Ed,s=Um(e.getAttribute("enctype"))||Rd,l=new FormData(e)}else if(Y2(e)||G2(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=e.getAttribute("formaction")||d.getAttribute("action");if(i=m?qr(m,t):null,r=e.getAttribute("formmethod")||d.getAttribute("method")||Ed,s=Um(e.getAttribute("formenctype"))||Um(d.getAttribute("enctype"))||Rd,l=new FormData(d,e),!W2()){let{name:f,type:y,value:p}=e;if(y==="image"){let v=f?`${f}.`:"";l.append(`${v}x`,"0"),l.append(`${v}y`,"0")}else f&&l.append(f,p)}}else{if(ef(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Ed,i=null,s=Rd,u=e}return l&&s==="text/plain"&&(u=l,l=void 0),{action:i,method:r.toLowerCase(),encType:s,formData:l,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function xg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Z2(e,t,r,i){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${i}`:s.pathname=`${s.pathname}.${i}`:s.pathname==="/"?s.pathname=`_root.${i}`:t&&qr(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${i}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${i}`,s}async function J2(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function eD(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function tD(e,t,r){let i=await Promise.all(e.map(async s=>{let l=t.routes[s.route.id];if(l){let u=await J2(l,r);return u.links?u.links():[]}return[]}));return iD(i.flat(1).filter(eD).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function qw(e,t,r,i,s,l){let u=(m,f)=>r[f]?m.route.id!==r[f].route.id:!0,d=(m,f)=>{var y;return r[f].pathname!==m.pathname||((y=r[f].route.path)==null?void 0:y.endsWith("*"))&&r[f].params["*"]!==m.params["*"]};return l==="assets"?t.filter((m,f)=>u(m,f)||d(m,f)):l==="data"?t.filter((m,f)=>{var p;let y=i.routes[m.route.id];if(!y||!y.hasLoader)return!1;if(u(m,f)||d(m,f))return!0;if(m.route.shouldRevalidate){let v=m.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((p=r[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function nD(e,t,{includeHydrateFallback:r}={}){return rD(e.map(i=>{let s=t.routes[i.route.id];if(!s)return[];let l=[s.module];return s.clientActionModule&&(l=l.concat(s.clientActionModule)),s.clientLoaderModule&&(l=l.concat(s.clientLoaderModule)),r&&s.hydrateFallbackModule&&(l=l.concat(s.hydrateFallbackModule)),s.imports&&(l=l.concat(s.imports)),l}).flat(1))}function rD(e){return[...new Set(e)]}function aD(e){let t={},r=Object.keys(e).sort();for(let i of r)t[i]=e[i];return t}function iD(e,t){let r=new Set;return new Set(t),e.reduce((i,s)=>{let l=JSON.stringify(aD(s));return r.has(l)||(r.add(l),i.push({key:l,link:s})),i},[])}function bE(){let e=w.useContext(Io);return xg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function oD(){let e=w.useContext(kc);return xg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Eg=w.createContext(void 0);Eg.displayName="FrameworkContext";function wE(){let e=w.useContext(Eg);return xg(e,"You must render this element inside a <HydratedRouter> element"),e}function sD(e,t){let r=w.useContext(Eg),[i,s]=w.useState(!1),[l,u]=w.useState(!1),{onFocus:d,onBlur:m,onMouseEnter:f,onMouseLeave:y,onTouchStart:p}=t,v=w.useRef(null);w.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let x=T=>{T.forEach(M=>{u(M.isIntersecting)})},R=new IntersectionObserver(x,{threshold:.5});return v.current&&R.observe(v.current),()=>{R.disconnect()}}},[e]),w.useEffect(()=>{if(i){let x=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(x)}}},[i]);let b=()=>{s(!0)},S=()=>{s(!1),u(!1)};return r?e!=="intent"?[l,v,{}]:[l,v,{onFocus:Wl(d,b),onBlur:Wl(m,S),onMouseEnter:Wl(f,b),onMouseLeave:Wl(y,S),onTouchStart:Wl(p,b)}]:[!1,v,{}]}function Wl(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function lD({page:e,...t}){let{router:r}=bE(),i=w.useMemo(()=>xi(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?w.createElement(uD,{page:e,matches:i,...t}):null}function cD(e){let{manifest:t,routeModules:r}=wE(),[i,s]=w.useState([]);return w.useEffect(()=>{let l=!1;return tD(e,t,r).then(u=>{l||s(u)}),()=>{l=!0}},[e,t,r]),i}function uD({page:e,matches:t,...r}){let i=Wa(),{future:s,manifest:l,routeModules:u}=wE(),{basename:d}=bE(),{loaderData:m,matches:f}=oD(),y=w.useMemo(()=>qw(e,t,f,l,i,"data"),[e,t,f,l,i]),p=w.useMemo(()=>qw(e,t,f,l,i,"assets"),[e,t,f,l,i]),v=w.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let x=new Set,R=!1;if(t.forEach(M=>{var C;let D=l.routes[M.route.id];!D||!D.hasLoader||(!y.some(N=>N.route.id===M.route.id)&&M.route.id in m&&((C=u[M.route.id])!=null&&C.shouldRevalidate)||D.hasClientLoader?R=!0:x.add(M.route.id))}),x.size===0)return[];let T=Z2(e,d,s.unstable_trailingSlashAwareDataRequests,"data");return R&&x.size>0&&T.searchParams.set("_routes",t.filter(M=>x.has(M.route.id)).map(M=>M.route.id).join(",")),[T.pathname+T.search]},[d,s.unstable_trailingSlashAwareDataRequests,m,i,l,y,t,e,u]),b=w.useMemo(()=>nD(p,l),[p,l]),S=cD(p);return w.createElement(w.Fragment,null,v.map(x=>w.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...r})),b.map(x=>w.createElement("link",{key:x,rel:"modulepreload",href:x,...r})),S.map(({key:x,link:R})=>w.createElement("link",{key:x,nonce:r.nonce,...R,crossOrigin:R.crossOrigin??r.crossOrigin})))}function dD(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var fD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{fD&&(window.__reactRouterVersion="7.13.0")}catch{}function hD(e,t){return jM({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:tM({window:t==null?void 0:t.window}),hydrationData:mD(),routes:e,mapRouteProperties:P2,hydrationRouteProperties:I2,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window,unstable_instrumentations:t==null?void 0:t.unstable_instrumentations}).initialize()}function mD(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:pD(e.errors)}),e}function pD(e){if(!e)return null;let t=Object.entries(e),r={};for(let[i,s]of t)if(s&&s.__type==="RouteErrorResponse")r[i]=new Ac(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let l=window[s.__subType];if(typeof l=="function")try{let u=new l(s.message);u.stack="",r[i]=u}catch{}}if(r[i]==null){let l=new Error(s.message);l.stack="",r[i]=l}}else r[i]=s;return r}var SE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Rg=w.forwardRef(function({onClick:t,discover:r="render",prefetch:i="none",relative:s,reloadDocument:l,replace:u,state:d,target:m,to:f,preventScrollReset:y,viewTransition:p,unstable_defaultShouldRevalidate:v,...b},S){let{basename:x,unstable_useTransitions:R}=w.useContext(Gr),T=typeof f=="string"&&SE.test(f),M=Jx(f,x);f=M.to;let D=g2(f,{relative:s}),[C,N,k]=sD(i,b),O=bD(f,{replace:u,state:d,target:m,preventScrollReset:y,relative:s,viewTransition:p,unstable_defaultShouldRevalidate:v,unstable_useTransitions:R});function L(J){t&&t(J),J.defaultPrevented||O(J)}let G=w.createElement("a",{...b,...k,href:M.absoluteURL||D,onClick:M.isExternal||l?t:L,ref:dD(S,N),target:m,"data-discover":!T&&r==="render"?"true":void 0});return C&&!T?w.createElement(w.Fragment,null,G,w.createElement(lD,{page:D})):G});Rg.displayName="Link";var gD=w.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:i="",end:s=!1,style:l,to:u,viewTransition:d,children:m,...f},y){let p=Lc(u,{relative:f.relative}),v=Wa(),b=w.useContext(kc),{navigator:S,basename:x}=w.useContext(Gr),R=b!=null&&RD(p)&&d===!0,T=S.encodeLocation?S.encodeLocation(p).pathname:p.pathname,M=v.pathname,D=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;r||(M=M.toLowerCase(),D=D?D.toLowerCase():null,T=T.toLowerCase()),D&&x&&(D=qr(D,x)||D);const C=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let N=M===T||!s&&M.startsWith(T)&&M.charAt(C)==="/",k=D!=null&&(D===T||!s&&D.startsWith(T)&&D.charAt(T.length)==="/"),O={isActive:N,isPending:k,isTransitioning:R},L=N?t:void 0,G;typeof i=="function"?G=i(O):G=[i,N?"active":null,k?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let J=typeof l=="function"?l(O):l;return w.createElement(Rg,{...f,"aria-current":L,className:G,ref:y,style:J,to:u,viewTransition:d},typeof m=="function"?m(O):m)});gD.displayName="NavLink";var yD=w.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:i,replace:s,state:l,method:u=Ed,action:d,onSubmit:m,relative:f,preventScrollReset:y,viewTransition:p,unstable_defaultShouldRevalidate:v,...b},S)=>{let{unstable_useTransitions:x}=w.useContext(Gr),R=xD(),T=ED(d,{relative:f}),M=u.toLowerCase()==="get"?"get":"post",D=typeof d=="string"&&SE.test(d),C=N=>{if(m&&m(N),N.defaultPrevented)return;N.preventDefault();let k=N.nativeEvent.submitter,O=(k==null?void 0:k.getAttribute("formmethod"))||u,L=()=>R(k||N.currentTarget,{fetcherKey:t,method:O,navigate:r,replace:s,state:l,relative:f,preventScrollReset:y,viewTransition:p,unstable_defaultShouldRevalidate:v});x&&r!==!1?w.startTransition(()=>L()):L()};return w.createElement("form",{ref:S,method:M,action:T,onSubmit:i?m:C,...b,"data-discover":!D&&e==="render"?"true":void 0})});yD.displayName="Form";function vD(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function xE(e){let t=w.useContext(Io);return bt(t,vD(e)),t}function bD(e,{target:t,replace:r,state:i,preventScrollReset:s,relative:l,viewTransition:u,unstable_defaultShouldRevalidate:d,unstable_useTransitions:m}={}){let f=gE(),y=Wa(),p=Lc(e,{relative:l});return w.useCallback(v=>{if(X2(v,t)){v.preventDefault();let b=r!==void 0?r:ba(y)===ba(p),S=()=>f(e,{replace:b,state:i,preventScrollReset:s,relative:l,viewTransition:u,unstable_defaultShouldRevalidate:d});m?w.startTransition(()=>S()):S()}},[y,f,p,r,i,t,e,s,l,u,d,m])}var wD=0,SD=()=>`__${String(++wD)}__`;function xD(){let{router:e}=xE("useSubmit"),{basename:t}=w.useContext(Gr),r=A2(),i=e.fetch,s=e.navigate;return w.useCallback(async(l,u={})=>{let{action:d,method:m,encType:f,formData:y,body:p}=Q2(l,t);if(u.navigate===!1){let v=u.fetcherKey||SD();await i(v,r,u.action||d,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:p,formMethod:u.method||m,formEncType:u.encType||f,flushSync:u.flushSync})}else await s(u.action||d,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:p,formMethod:u.method||m,formEncType:u.encType||f,replace:u.replace,state:u.state,fromRouteId:r,flushSync:u.flushSync,viewTransition:u.viewTransition})},[i,s,t,r])}function ED(e,{relative:t}={}){let{basename:r}=w.useContext(Gr),i=w.useContext(aa);bt(i,"useFormAction must be used inside a RouteContext");let[s]=i.matches.slice(-1),l={...Lc(e||".",{relative:t})},u=Wa();if(e==null){l.search=u.search;let d=new URLSearchParams(l.search),m=d.getAll("index");if(m.some(y=>y==="")){d.delete("index"),m.filter(p=>p).forEach(p=>d.append("index",p));let y=d.toString();l.search=y?`?${y}`:""}}return(!e||e===".")&&s.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(l.pathname=l.pathname==="/"?r:pa([r,l.pathname])),ba(l)}function RD(e,{relative:t}={}){let r=w.useContext(vg);bt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=xE("useViewTransitionState"),s=Lc(e,{relative:t});if(!r.isTransitioning)return!1;let l=qr(r.currentLocation.pathname,i)||r.currentLocation.pathname,u=qr(r.nextLocation.pathname,i)||r.nextLocation.pathname;return yc(s.pathname,u)!=null||yc(s.pathname,l)!=null}var ra=qx();const TD=_x(ra);function CD(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const OD=e=>{switch(e){case"success":return AD;case"info":return kD;case"warning":return ND;case"error":return _D;default:return null}},MD=Array(12).fill(0),DD=({visible:e,className:t})=>Oe.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Oe.createElement("div",{className:"sonner-spinner"},MD.map((r,i)=>Oe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),AD=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Oe.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),ND=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Oe.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),kD=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Oe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),_D=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Oe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),LD=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Oe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Oe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),zD=()=>{const[e,t]=Oe.useState(document.hidden);return Oe.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let Lp=1;class PD{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:i,...s}=t,l=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:Lp++,u=this.toasts.find(m=>m.id===l),d=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),u?this.toasts=this.toasts.map(m=>m.id===l?(this.publish({...m,...t,id:l,title:i}),{...m,...t,id:l,dismissible:d,title:i}):m):this.addToast({title:i,...s,dismissible:d,id:l}),l},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(i=>i({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let i;r.loading!==void 0&&(i=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let l=i!==void 0,u;const d=s.then(async f=>{if(u=["resolve",f],Oe.isValidElement(f))l=!1,this.create({id:i,type:"default",message:f});else if(UD(f)&&!f.ok){l=!1;const p=typeof r.error=="function"?await r.error(`HTTP error! status: ${f.status}`):r.error,v=typeof r.description=="function"?await r.description(`HTTP error! status: ${f.status}`):r.description,S=typeof p=="object"&&!Oe.isValidElement(p)?p:{message:p};this.create({id:i,type:"error",description:v,...S})}else if(f instanceof Error){l=!1;const p=typeof r.error=="function"?await r.error(f):r.error,v=typeof r.description=="function"?await r.description(f):r.description,S=typeof p=="object"&&!Oe.isValidElement(p)?p:{message:p};this.create({id:i,type:"error",description:v,...S})}else if(r.success!==void 0){l=!1;const p=typeof r.success=="function"?await r.success(f):r.success,v=typeof r.description=="function"?await r.description(f):r.description,S=typeof p=="object"&&!Oe.isValidElement(p)?p:{message:p};this.create({id:i,type:"success",description:v,...S})}}).catch(async f=>{if(u=["reject",f],r.error!==void 0){l=!1;const y=typeof r.error=="function"?await r.error(f):r.error,p=typeof r.description=="function"?await r.description(f):r.description,b=typeof y=="object"&&!Oe.isValidElement(y)?y:{message:y};this.create({id:i,type:"error",description:p,...b})}}).finally(()=>{l&&(this.dismiss(i),i=void 0),r.finally==null||r.finally.call(r)}),m=()=>new Promise((f,y)=>d.then(()=>u[0]==="reject"?y(u[1]):f(u[1])).catch(y));return typeof i!="string"&&typeof i!="number"?{unwrap:m}:Object.assign(i,{unwrap:m})},this.custom=(t,r)=>{const i=(r==null?void 0:r.id)||Lp++;return this.create({jsx:t(i),id:i,...r}),i},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const hr=new PD,ID=(e,t)=>{const r=(t==null?void 0:t.id)||Lp++;return hr.addToast({title:e,...t,id:r}),r},UD=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",jD=ID,HD=()=>hr.toasts,BD=()=>hr.getActiveToasts(),_d=Object.assign(jD,{success:hr.success,info:hr.info,warning:hr.warning,error:hr.error,custom:hr.custom,message:hr.message,promise:hr.promise,dismiss:hr.dismiss,loading:hr.loading},{getHistory:HD,getToasts:BD});CD("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function od(e){return e.label!==void 0}const FD=3,VD="24px",YD="16px",Gw=4e3,qD=356,GD=14,KD=45,XD=200;function ca(...e){return e.filter(Boolean).join(" ")}function WD(e){const[t,r]=e.split("-"),i=[];return t&&i.push(t),r&&i.push(r),i}const $D=e=>{var t,r,i,s,l,u,d,m,f;const{invert:y,toast:p,unstyled:v,interacting:b,setHeights:S,visibleToasts:x,heights:R,index:T,toasts:M,expanded:D,removeToast:C,defaultRichColors:N,closeButton:k,style:O,cancelButtonStyle:L,actionButtonStyle:G,className:J="",descriptionClassName:Z="",duration:z,position:H,gap:V,expandByDefault:q,classNames:_,icons:j,closeButtonAriaLabel:U="Close toast"}=e,[ie,ae]=Oe.useState(null),[P,X]=Oe.useState(null),[$,F]=Oe.useState(!1),[te,ue]=Oe.useState(!1),[he,we]=Oe.useState(!1),[ve,ke]=Oe.useState(!1),[Xe,ne]=Oe.useState(!1),[fe,Se]=Oe.useState(0),[Ne,Te]=Oe.useState(0),Ee=Oe.useRef(p.duration||z||Gw),Re=Oe.useRef(null),pe=Oe.useRef(null),De=T===0,xe=T+1<=x,qe=p.type,Ge=p.dismissible!==!1,Le=p.className||"",ot=p.descriptionClassName||"",Pt=Oe.useMemo(()=>R.findIndex(Ke=>Ke.toastId===p.id)||0,[R,p.id]),Ft=Oe.useMemo(()=>{var Ke;return(Ke=p.closeButton)!=null?Ke:k},[p.closeButton,k]),tt=Oe.useMemo(()=>p.duration||z||Gw,[p.duration,z]),ft=Oe.useRef(0),Ct=Oe.useRef(0),sn=Oe.useRef(0),ln=Oe.useRef(null),[On,Pe]=H.split("-"),st=Oe.useMemo(()=>R.reduce((Ke,It,Zt)=>Zt>=Pt?Ke:Ke+It.height,0),[R,Pt]),gt=zD(),Kn=p.invert||y,rn=qe==="loading";Ct.current=Oe.useMemo(()=>Pt*V+st,[Pt,st]),Oe.useEffect(()=>{Ee.current=tt},[tt]),Oe.useEffect(()=>{F(!0)},[]),Oe.useEffect(()=>{const Ke=pe.current;if(Ke){const It=Ke.getBoundingClientRect().height;return Te(It),S(Zt=>[{toastId:p.id,height:It,position:p.position},...Zt]),()=>S(Zt=>Zt.filter(qt=>qt.toastId!==p.id))}},[S,p.id]),Oe.useLayoutEffect(()=>{if(!$)return;const Ke=pe.current,It=Ke.style.height;Ke.style.height="auto";const Zt=Ke.getBoundingClientRect().height;Ke.style.height=It,Te(Zt),S(qt=>qt.find(Gt=>Gt.toastId===p.id)?qt.map(Gt=>Gt.toastId===p.id?{...Gt,height:Zt}:Gt):[{toastId:p.id,height:Zt,position:p.position},...qt])},[$,p.title,p.description,S,p.id,p.jsx,p.action,p.cancel]);const lt=Oe.useCallback(()=>{ue(!0),Se(Ct.current),S(Ke=>Ke.filter(It=>It.toastId!==p.id)),setTimeout(()=>{C(p)},XD)},[p,C,S,Ct]);Oe.useEffect(()=>{if(p.promise&&qe==="loading"||p.duration===1/0||p.type==="loading")return;let Ke;return D||b||gt?(()=>{if(sn.current<ft.current){const qt=new Date().getTime()-ft.current;Ee.current=Ee.current-qt}sn.current=new Date().getTime()})():(()=>{Ee.current!==1/0&&(ft.current=new Date().getTime(),Ke=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),lt()},Ee.current))})(),()=>clearTimeout(Ke)},[D,b,p,qe,gt,lt]),Oe.useEffect(()=>{p.delete&&(lt(),p.onDismiss==null||p.onDismiss.call(p,p))},[lt,p.delete]);function wt(){var Ke;if(j!=null&&j.loading){var It;return Oe.createElement("div",{className:ca(_==null?void 0:_.loader,p==null||(It=p.classNames)==null?void 0:It.loader,"sonner-loader"),"data-visible":qe==="loading"},j.loading)}return Oe.createElement(DD,{className:ca(_==null?void 0:_.loader,p==null||(Ke=p.classNames)==null?void 0:Ke.loader),visible:qe==="loading"})}const et=p.icon||(j==null?void 0:j[qe])||OD(qe);var vt,Ht;return Oe.createElement("li",{tabIndex:0,ref:pe,className:ca(J,Le,_==null?void 0:_.toast,p==null||(t=p.classNames)==null?void 0:t.toast,_==null?void 0:_.default,_==null?void 0:_[qe],p==null||(r=p.classNames)==null?void 0:r[qe]),"data-sonner-toast":"","data-rich-colors":(vt=p.richColors)!=null?vt:N,"data-styled":!(p.jsx||p.unstyled||v),"data-mounted":$,"data-promise":!!p.promise,"data-swiped":Xe,"data-removed":te,"data-visible":xe,"data-y-position":On,"data-x-position":Pe,"data-index":T,"data-front":De,"data-swiping":he,"data-dismissible":Ge,"data-type":qe,"data-invert":Kn,"data-swipe-out":ve,"data-swipe-direction":P,"data-expanded":!!(D||q&&$),"data-testid":p.testId,style:{"--index":T,"--toasts-before":T,"--z-index":M.length-T,"--offset":`${te?fe:Ct.current}px`,"--initial-height":q?"auto":`${Ne}px`,...O,...p.style},onDragEnd:()=>{we(!1),ae(null),ln.current=null},onPointerDown:Ke=>{Ke.button!==2&&(rn||!Ge||(Re.current=new Date,Se(Ct.current),Ke.target.setPointerCapture(Ke.pointerId),Ke.target.tagName!=="BUTTON"&&(we(!0),ln.current={x:Ke.clientX,y:Ke.clientY})))},onPointerUp:()=>{var Ke,It,Zt;if(ve||!Ge)return;ln.current=null;const qt=Number(((Ke=pe.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Xn=Number(((It=pe.current)==null?void 0:It.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Gt=new Date().getTime()-((Zt=Re.current)==null?void 0:Zt.getTime()),Mn=ie==="x"?qt:Xn,Kr=Math.abs(Mn)/Gt;if(Math.abs(Mn)>=KD||Kr>.11){Se(Ct.current),p.onDismiss==null||p.onDismiss.call(p,p),X(ie==="x"?qt>0?"right":"left":Xn>0?"down":"up"),lt(),ke(!0);return}else{var B,Q;(B=pe.current)==null||B.style.setProperty("--swipe-amount-x","0px"),(Q=pe.current)==null||Q.style.setProperty("--swipe-amount-y","0px")}ne(!1),we(!1),ae(null)},onPointerMove:Ke=>{var It,Zt,qt;if(!ln.current||!Ge||((It=window.getSelection())==null?void 0:It.toString().length)>0)return;const Gt=Ke.clientY-ln.current.y,Mn=Ke.clientX-ln.current.x;var Kr;const B=(Kr=e.swipeDirections)!=null?Kr:WD(H);!ie&&(Math.abs(Mn)>1||Math.abs(Gt)>1)&&ae(Math.abs(Mn)>Math.abs(Gt)?"x":"y");let Q={x:0,y:0};const le=be=>1/(1.5+Math.abs(be)/20);if(ie==="y"){if(B.includes("top")||B.includes("bottom"))if(B.includes("top")&&Gt<0||B.includes("bottom")&&Gt>0)Q.y=Gt;else{const be=Gt*le(Gt);Q.y=Math.abs(be)<Math.abs(Gt)?be:Gt}}else if(ie==="x"&&(B.includes("left")||B.includes("right")))if(B.includes("left")&&Mn<0||B.includes("right")&&Mn>0)Q.x=Mn;else{const be=Mn*le(Mn);Q.x=Math.abs(be)<Math.abs(Mn)?be:Mn}(Math.abs(Q.x)>0||Math.abs(Q.y)>0)&&ne(!0),(Zt=pe.current)==null||Zt.style.setProperty("--swipe-amount-x",`${Q.x}px`),(qt=pe.current)==null||qt.style.setProperty("--swipe-amount-y",`${Q.y}px`)}},Ft&&!p.jsx&&qe!=="loading"?Oe.createElement("button",{"aria-label":U,"data-disabled":rn,"data-close-button":!0,onClick:rn||!Ge?()=>{}:()=>{lt(),p.onDismiss==null||p.onDismiss.call(p,p)},className:ca(_==null?void 0:_.closeButton,p==null||(i=p.classNames)==null?void 0:i.closeButton)},(Ht=j==null?void 0:j.close)!=null?Ht:LD):null,(qe||p.icon||p.promise)&&p.icon!==null&&((j==null?void 0:j[qe])!==null||p.icon)?Oe.createElement("div",{"data-icon":"",className:ca(_==null?void 0:_.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||wt():null,p.type!=="loading"?et:null):null,Oe.createElement("div",{"data-content":"",className:ca(_==null?void 0:_.content,p==null||(l=p.classNames)==null?void 0:l.content)},Oe.createElement("div",{"data-title":"",className:ca(_==null?void 0:_.title,p==null||(u=p.classNames)==null?void 0:u.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?Oe.createElement("div",{"data-description":"",className:ca(Z,ot,_==null?void 0:_.description,p==null||(d=p.classNames)==null?void 0:d.description)},typeof p.description=="function"?p.description():p.description):null),Oe.isValidElement(p.cancel)?p.cancel:p.cancel&&od(p.cancel)?Oe.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||L,onClick:Ke=>{od(p.cancel)&&Ge&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Ke),lt())},className:ca(_==null?void 0:_.cancelButton,p==null||(m=p.classNames)==null?void 0:m.cancelButton)},p.cancel.label):null,Oe.isValidElement(p.action)?p.action:p.action&&od(p.action)?Oe.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||G,onClick:Ke=>{od(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Ke),!Ke.defaultPrevented&&lt())},className:ca(_==null?void 0:_.actionButton,p==null||(f=p.classNames)==null?void 0:f.actionButton)},p.action.label):null)};function Kw(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function QD(e,t){const r={};return[e,t].forEach((i,s)=>{const l=s===1,u=l?"--mobile-offset":"--offset",d=l?YD:VD;function m(f){["top","right","bottom","left"].forEach(y=>{r[`${u}-${y}`]=typeof f=="number"?`${f}px`:f})}typeof i=="number"||typeof i=="string"?m(i):typeof i=="object"?["top","right","bottom","left"].forEach(f=>{i[f]===void 0?r[`${u}-${f}`]=d:r[`${u}-${f}`]=typeof i[f]=="number"?`${i[f]}px`:i[f]}):m(d)}),r}const ZD=Oe.forwardRef(function(t,r){const{id:i,invert:s,position:l="bottom-right",hotkey:u=["altKey","KeyT"],expand:d,closeButton:m,className:f,offset:y,mobileOffset:p,theme:v="light",richColors:b,duration:S,style:x,visibleToasts:R=FD,toastOptions:T,dir:M=Kw(),gap:D=GD,icons:C,containerAriaLabel:N="Notifications"}=t,[k,O]=Oe.useState([]),L=Oe.useMemo(()=>i?k.filter($=>$.toasterId===i):k.filter($=>!$.toasterId),[k,i]),G=Oe.useMemo(()=>Array.from(new Set([l].concat(L.filter($=>$.position).map($=>$.position)))),[L,l]),[J,Z]=Oe.useState([]),[z,H]=Oe.useState(!1),[V,q]=Oe.useState(!1),[_,j]=Oe.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=Oe.useRef(null),ie=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),ae=Oe.useRef(null),P=Oe.useRef(!1),X=Oe.useCallback($=>{O(F=>{var te;return(te=F.find(ue=>ue.id===$.id))!=null&&te.delete||hr.dismiss($.id),F.filter(({id:ue})=>ue!==$.id)})},[]);return Oe.useEffect(()=>hr.subscribe($=>{if($.dismiss){requestAnimationFrame(()=>{O(F=>F.map(te=>te.id===$.id?{...te,delete:!0}:te))});return}setTimeout(()=>{TD.flushSync(()=>{O(F=>{const te=F.findIndex(ue=>ue.id===$.id);return te!==-1?[...F.slice(0,te),{...F[te],...$},...F.slice(te+1)]:[$,...F]})})})}),[k]),Oe.useEffect(()=>{if(v!=="system"){j(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?j("dark"):j("light")),typeof window>"u")return;const $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:F})=>{j(F?"dark":"light")})}catch{$.addListener(({matches:te})=>{try{j(te?"dark":"light")}catch(ue){console.error(ue)}})}},[v]),Oe.useEffect(()=>{k.length<=1&&H(!1)},[k]),Oe.useEffect(()=>{const $=F=>{var te;if(u.every(we=>F[we]||F.code===we)){var he;H(!0),(he=U.current)==null||he.focus()}F.code==="Escape"&&(document.activeElement===U.current||(te=U.current)!=null&&te.contains(document.activeElement))&&H(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[u]),Oe.useEffect(()=>{if(U.current)return()=>{ae.current&&(ae.current.focus({preventScroll:!0}),ae.current=null,P.current=!1)}},[U.current]),Oe.createElement("section",{ref:r,"aria-label":`${N} ${ie}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},G.map(($,F)=>{var te;const[ue,he]=$.split("-");return L.length?Oe.createElement("ol",{key:$,dir:M==="auto"?Kw():M,tabIndex:-1,ref:U,className:f,"data-sonner-toaster":!0,"data-sonner-theme":_,"data-y-position":ue,"data-x-position":he,style:{"--front-toast-height":`${((te=J[0])==null?void 0:te.height)||0}px`,"--width":`${qD}px`,"--gap":`${D}px`,...x,...QD(y,p)},onBlur:we=>{P.current&&!we.currentTarget.contains(we.relatedTarget)&&(P.current=!1,ae.current&&(ae.current.focus({preventScroll:!0}),ae.current=null))},onFocus:we=>{we.target instanceof HTMLElement&&we.target.dataset.dismissible==="false"||P.current||(P.current=!0,ae.current=we.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{V||H(!1)},onDragEnd:()=>H(!1),onPointerDown:we=>{we.target instanceof HTMLElement&&we.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},L.filter(we=>!we.position&&F===0||we.position===$).map((we,ve)=>{var ke,Xe;return Oe.createElement($D,{key:we.id,icons:C,index:ve,toast:we,defaultRichColors:b,duration:(ke=T==null?void 0:T.duration)!=null?ke:S,className:T==null?void 0:T.className,descriptionClassName:T==null?void 0:T.descriptionClassName,invert:s,visibleToasts:R,closeButton:(Xe=T==null?void 0:T.closeButton)!=null?Xe:m,interacting:V,position:$,style:T==null?void 0:T.style,unstyled:T==null?void 0:T.unstyled,classNames:T==null?void 0:T.classNames,cancelButtonStyle:T==null?void 0:T.cancelButtonStyle,actionButtonStyle:T==null?void 0:T.actionButtonStyle,closeButtonAriaLabel:T==null?void 0:T.closeButtonAriaLabel,removeToast:X,toasts:L.filter(ne=>ne.position==we.position),heights:J.filter(ne=>ne.position==we.position),setHeights:Z,expandByDefault:d,gap:D,expanded:z,swipeDirections:t.swipeDirections})})):null}))}),it=e=>typeof e=="string",$l=()=>{let e,t;const r=new Promise((i,s)=>{e=i,t=s});return r.resolve=e,r.reject=t,r},Xw=e=>e==null?"":""+e,JD=(e,t,r)=>{e.forEach(i=>{t[i]&&(r[i]=t[i])})},eA=/###/g,Ww=e=>e&&e.indexOf("###")>-1?e.replace(eA,"."):e,$w=e=>!e||it(e),oc=(e,t,r)=>{const i=it(t)?t.split("."):t;let s=0;for(;s<i.length-1;){if($w(e))return{};const l=Ww(i[s]);!e[l]&&r&&(e[l]=new r),Object.prototype.hasOwnProperty.call(e,l)?e=e[l]:e={},++s}return $w(e)?{}:{obj:e,k:Ww(i[s])}},Qw=(e,t,r)=>{const{obj:i,k:s}=oc(e,t,Object);if(i!==void 0||t.length===1){i[s]=r;return}let l=t[t.length-1],u=t.slice(0,t.length-1),d=oc(e,u,Object);for(;d.obj===void 0&&u.length;)l=`${u[u.length-1]}.${l}`,u=u.slice(0,u.length-1),d=oc(e,u,Object),d!=null&&d.obj&&typeof d.obj[`${d.k}.${l}`]<"u"&&(d.obj=void 0);d.obj[`${d.k}.${l}`]=r},tA=(e,t,r,i)=>{const{obj:s,k:l}=oc(e,t,Object);s[l]=s[l]||[],s[l].push(r)},Ld=(e,t)=>{const{obj:r,k:i}=oc(e,t);if(r&&Object.prototype.hasOwnProperty.call(r,i))return r[i]},nA=(e,t,r)=>{const i=Ld(e,r);return i!==void 0?i:Ld(t,r)},EE=(e,t,r)=>{for(const i in t)i!=="__proto__"&&i!=="constructor"&&(i in e?it(e[i])||e[i]instanceof String||it(t[i])||t[i]instanceof String?r&&(e[i]=t[i]):EE(e[i],t[i],r):e[i]=t[i]);return e},ws=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var rA={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const aA=e=>it(e)?e.replace(/[&<>"'\/]/g,t=>rA[t]):e;class iA{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const r=this.regExpMap.get(t);if(r!==void 0)return r;const i=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,i),this.regExpQueue.push(t),i}}const oA=[" ",",","?","!",";"],sA=new iA(20),lA=(e,t,r)=>{t=t||"",r=r||"";const i=oA.filter(u=>t.indexOf(u)<0&&r.indexOf(u)<0);if(i.length===0)return!0;const s=sA.getRegExp(`(${i.map(u=>u==="?"?"\\?":u).join("|")})`);let l=!s.test(e);if(!l){const u=e.indexOf(r);u>0&&!s.test(e.substring(0,u))&&(l=!0)}return l},zp=(e,t,r=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const i=t.split(r);let s=e;for(let l=0;l<i.length;){if(!s||typeof s!="object")return;let u,d="";for(let m=l;m<i.length;++m)if(m!==l&&(d+=r),d+=i[m],u=s[d],u!==void 0){if(["string","number","boolean"].indexOf(typeof u)>-1&&m<i.length-1)continue;l+=m-l+1;break}s=u}return s},bc=e=>e==null?void 0:e.replace("_","-"),cA={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var r,i;(i=(r=console==null?void 0:console[e])==null?void 0:r.apply)==null||i.call(r,console,t)}};class zd{constructor(t,r={}){this.init(t,r)}init(t,r={}){this.prefix=r.prefix||"i18next:",this.logger=t||cA,this.options=r,this.debug=r.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,r,i,s){return s&&!this.debug?null:(it(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[r](t))}create(t){return new zd(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new zd(this.logger,t)}}var ma=new zd;class tf{constructor(){this.observers={}}on(t,r){return t.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const s=this.observers[i].get(r)||0;this.observers[i].set(r,s+1)}),this}off(t,r){if(this.observers[t]){if(!r){delete this.observers[t];return}this.observers[t].delete(r)}}emit(t,...r){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([s,l])=>{for(let u=0;u<l;u++)s(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,l])=>{for(let u=0;u<l;u++)s.apply(s,[t,...r])})}}class Zw extends tf{constructor(t,r={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const r=this.options.ns.indexOf(t);r>-1&&this.options.ns.splice(r,1)}getResource(t,r,i,s={}){var f,y;const l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,u=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let d;t.indexOf(".")>-1?d=t.split("."):(d=[t,r],i&&(Array.isArray(i)?d.push(...i):it(i)&&l?d.push(...i.split(l)):d.push(i)));const m=Ld(this.data,d);return!m&&!r&&!i&&t.indexOf(".")>-1&&(t=d[0],r=d[1],i=d.slice(2).join(".")),m||!u||!it(i)?m:zp((y=(f=this.data)==null?void 0:f[t])==null?void 0:y[r],i,l)}addResource(t,r,i,s,l={silent:!1}){const u=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator;let d=[t,r];i&&(d=d.concat(u?i.split(u):i)),t.indexOf(".")>-1&&(d=t.split("."),s=r,r=d[1]),this.addNamespaces(r),Qw(this.data,d,s),l.silent||this.emit("added",t,r,i,s)}addResources(t,r,i,s={silent:!1}){for(const l in i)(it(i[l])||Array.isArray(i[l]))&&this.addResource(t,r,l,i[l],{silent:!0});s.silent||this.emit("added",t,r,i)}addResourceBundle(t,r,i,s,l,u={silent:!1,skipCopy:!1}){let d=[t,r];t.indexOf(".")>-1&&(d=t.split("."),s=i,i=r,r=d[1]),this.addNamespaces(r);let m=Ld(this.data,d)||{};u.skipCopy||(i=JSON.parse(JSON.stringify(i))),s?EE(m,i,l):m={...m,...i},Qw(this.data,d,m),u.silent||this.emit("added",t,r,i)}removeResourceBundle(t,r){this.hasResourceBundle(t,r)&&delete this.data[t][r],this.removeNamespaces(r),this.emit("removed",t,r)}hasResourceBundle(t,r){return this.getResource(t,r)!==void 0}getResourceBundle(t,r){return r||(r=this.options.defaultNS),this.getResource(t,r)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const r=this.getDataByLanguage(t);return!!(r&&Object.keys(r)||[]).find(s=>r[s]&&Object.keys(r[s]).length>0)}toJSON(){return this.data}}var RE={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,i,s){return e.forEach(l=>{var u;t=((u=this.processors[l])==null?void 0:u.process(t,r,i,s))??t}),t}};const TE=Symbol("i18next/PATH_KEY");function uA(){const e=[],t=Object.create(null);let r;return t.get=(i,s)=>{var l;return(l=r==null?void 0:r.revoke)==null||l.call(r),s===TE?e:(e.push(s),r=Proxy.revocable(i,t),r.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Pp(e,t){const{[TE]:r}=e(uA());return r.join((t==null?void 0:t.keySeparator)??".")}const Jw={},jm=e=>!it(e)&&typeof e!="boolean"&&typeof e!="number";class Pd extends tf{constructor(t,r={}){super(),JD(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ma.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,r={interpolation:{}}){const i={...r};if(t==null)return!1;const s=this.resolve(t,i);if((s==null?void 0:s.res)===void 0)return!1;const l=jm(s.res);return!(i.returnObjects===!1&&l)}extractFromKey(t,r){let i=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let l=r.ns||this.options.defaultNS||[];const u=i&&t.indexOf(i)>-1,d=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!lA(t,i,s);if(u&&!d){const m=t.match(this.interpolator.nestingRegexp);if(m&&m.length>0)return{key:t,namespaces:it(l)?[l]:l};const f=t.split(i);(i!==s||i===s&&this.options.ns.indexOf(f[0])>-1)&&(l=f.shift()),t=f.join(s)}return{key:t,namespaces:it(l)?[l]:l}}translate(t,r,i){let s=typeof r=="object"?{...r}:r;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof s=="object"&&(s={...s}),s||(s={}),t==null)return"";typeof t=="function"&&(t=Pp(t,{...this.options,...s})),Array.isArray(t)||(t=[String(t)]);const l=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,u=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:d,namespaces:m}=this.extractFromKey(t[t.length-1],s),f=m[m.length-1];let y=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;y===void 0&&(y=":");const p=s.lng||this.language,v=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((p==null?void 0:p.toLowerCase())==="cimode")return v?l?{res:`${f}${y}${d}`,usedKey:d,exactUsedKey:d,usedLng:p,usedNS:f,usedParams:this.getUsedParamsDetails(s)}:`${f}${y}${d}`:l?{res:d,usedKey:d,exactUsedKey:d,usedLng:p,usedNS:f,usedParams:this.getUsedParamsDetails(s)}:d;const b=this.resolve(t,s);let S=b==null?void 0:b.res;const x=(b==null?void 0:b.usedKey)||d,R=(b==null?void 0:b.exactUsedKey)||d,T=["[object Number]","[object Function]","[object RegExp]"],M=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,D=!this.i18nFormat||this.i18nFormat.handleAsObject,C=s.count!==void 0&&!it(s.count),N=Pd.hasDefaultValue(s),k=C?this.pluralResolver.getSuffix(p,s.count,s):"",O=s.ordinal&&C?this.pluralResolver.getSuffix(p,s.count,{ordinal:!1}):"",L=C&&!s.ordinal&&s.count===0,G=L&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${k}`]||s[`defaultValue${O}`]||s.defaultValue;let J=S;D&&!S&&N&&(J=G);const Z=jm(J),z=Object.prototype.toString.apply(J);if(D&&J&&Z&&T.indexOf(z)<0&&!(it(M)&&Array.isArray(J))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const H=this.options.returnedObjectHandler?this.options.returnedObjectHandler(x,J,{...s,ns:m}):`key '${d} (${this.language})' returned an object instead of string.`;return l?(b.res=H,b.usedParams=this.getUsedParamsDetails(s),b):H}if(u){const H=Array.isArray(J),V=H?[]:{},q=H?R:x;for(const _ in J)if(Object.prototype.hasOwnProperty.call(J,_)){const j=`${q}${u}${_}`;N&&!S?V[_]=this.translate(j,{...s,defaultValue:jm(G)?G[_]:void 0,joinArrays:!1,ns:m}):V[_]=this.translate(j,{...s,joinArrays:!1,ns:m}),V[_]===j&&(V[_]=J[_])}S=V}}else if(D&&it(M)&&Array.isArray(S))S=S.join(M),S&&(S=this.extendTranslation(S,t,s,i));else{let H=!1,V=!1;!this.isValidLookup(S)&&N&&(H=!0,S=G),this.isValidLookup(S)||(V=!0,S=d);const _=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&V?void 0:S,j=N&&G!==S&&this.options.updateMissing;if(V||H||j){if(this.logger.log(j?"updateKey":"missingKey",p,f,d,j?G:S),u){const P=this.resolve(d,{...s,keySeparator:!1});P&&P.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let U=[];const ie=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ie&&ie[0])for(let P=0;P<ie.length;P++)U.push(ie[P]);else this.options.saveMissingTo==="all"?U=this.languageUtils.toResolveHierarchy(s.lng||this.language):U.push(s.lng||this.language);const ae=(P,X,$)=>{var te;const F=N&&$!==S?$:_;this.options.missingKeyHandler?this.options.missingKeyHandler(P,f,X,F,j,s):(te=this.backendConnector)!=null&&te.saveMissing&&this.backendConnector.saveMissing(P,f,X,F,j,s),this.emit("missingKey",P,f,X,S)};this.options.saveMissing&&(this.options.saveMissingPlurals&&C?U.forEach(P=>{const X=this.pluralResolver.getSuffixes(P,s);L&&s[`defaultValue${this.options.pluralSeparator}zero`]&&X.indexOf(`${this.options.pluralSeparator}zero`)<0&&X.push(`${this.options.pluralSeparator}zero`),X.forEach($=>{ae([P],d+$,s[`defaultValue${$}`]||G)})}):ae(U,d,G))}S=this.extendTranslation(S,t,s,b,i),V&&S===d&&this.options.appendNamespaceToMissingKey&&(S=`${f}${y}${d}`),(V||H)&&this.options.parseMissingKeyHandler&&(S=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${f}${y}${d}`:d,H?S:void 0,s))}return l?(b.res=S,b.usedParams=this.getUsedParamsDetails(s),b):S}extendTranslation(t,r,i,s,l){var m,f;if((m=this.i18nFormat)!=null&&m.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const y=it(t)&&(((f=i==null?void 0:i.interpolation)==null?void 0:f.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(y){const b=t.match(this.interpolator.nestingRegexp);p=b&&b.length}let v=i.replace&&!it(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(v={...this.options.interpolation.defaultVariables,...v}),t=this.interpolator.interpolate(t,v,i.lng||this.language||s.usedLng,i),y){const b=t.match(this.interpolator.nestingRegexp),S=b&&b.length;p<S&&(i.nest=!1)}!i.lng&&s&&s.res&&(i.lng=this.language||s.usedLng),i.nest!==!1&&(t=this.interpolator.nest(t,(...b)=>(l==null?void 0:l[0])===b[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${b[0]} in key: ${r[0]}`),null):this.translate(...b,r),i)),i.interpolation&&this.interpolator.reset()}const u=i.postProcess||this.options.postProcess,d=it(u)?[u]:u;return t!=null&&(d!=null&&d.length)&&i.applyPostProcessor!==!1&&(t=RE.handle(d,t,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),t}resolve(t,r={}){let i,s,l,u,d;return it(t)&&(t=[t]),t.forEach(m=>{if(this.isValidLookup(i))return;const f=this.extractFromKey(m,r),y=f.key;s=y;let p=f.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const v=r.count!==void 0&&!it(r.count),b=v&&!r.ordinal&&r.count===0,S=r.context!==void 0&&(it(r.context)||typeof r.context=="number")&&r.context!=="",x=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);p.forEach(R=>{var T,M;this.isValidLookup(i)||(d=R,!Jw[`${x[0]}-${R}`]&&((T=this.utils)!=null&&T.hasLoadedNamespace)&&!((M=this.utils)!=null&&M.hasLoadedNamespace(d))&&(Jw[`${x[0]}-${R}`]=!0,this.logger.warn(`key "${s}" for languages "${x.join(", ")}" won't get resolved as namespace "${d}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),x.forEach(D=>{var k;if(this.isValidLookup(i))return;u=D;const C=[y];if((k=this.i18nFormat)!=null&&k.addLookupKeys)this.i18nFormat.addLookupKeys(C,y,D,R,r);else{let O;v&&(O=this.pluralResolver.getSuffix(D,r.count,r));const L=`${this.options.pluralSeparator}zero`,G=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(v&&(r.ordinal&&O.indexOf(G)===0&&C.push(y+O.replace(G,this.options.pluralSeparator)),C.push(y+O),b&&C.push(y+L)),S){const J=`${y}${this.options.contextSeparator||"_"}${r.context}`;C.push(J),v&&(r.ordinal&&O.indexOf(G)===0&&C.push(J+O.replace(G,this.options.pluralSeparator)),C.push(J+O),b&&C.push(J+L))}}let N;for(;N=C.pop();)this.isValidLookup(i)||(l=N,i=this.getResource(D,R,N,r))}))})}),{res:i,usedKey:s,exactUsedKey:l,usedLng:u,usedNS:d}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,r,i,s={}){var l;return(l=this.i18nFormat)!=null&&l.getResource?this.i18nFormat.getResource(t,r,i,s):this.resourceStore.getResource(t,r,i,s)}getUsedParamsDetails(t={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=t.replace&&!it(t.replace);let s=i?t.replace:t;if(i&&typeof t.count<"u"&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!i){s={...s};for(const l of r)delete s[l]}return s}static hasDefaultValue(t){const r="defaultValue";for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&r===i.substring(0,r.length)&&t[i]!==void 0)return!0;return!1}}class eS{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ma.create("languageUtils")}getScriptPartFromCode(t){if(t=bc(t),!t||t.indexOf("-")<0)return null;const r=t.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(t){if(t=bc(t),!t||t.indexOf("-")<0)return t;const r=t.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(t){if(it(t)&&t.indexOf("-")>-1){let r;try{r=Intl.getCanonicalLocales(t)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let r;return t.forEach(i=>{if(r)return;const s=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(s))&&(r=s)}),!r&&this.options.supportedLngs&&t.forEach(i=>{if(r)return;const s=this.getScriptPartFromCode(i);if(this.isSupportedCode(s))return r=s;const l=this.getLanguagePartFromCode(i);if(this.isSupportedCode(l))return r=l;r=this.options.supportedLngs.find(u=>{if(u===l)return u;if(!(u.indexOf("-")<0&&l.indexOf("-")<0)&&(u.indexOf("-")>0&&l.indexOf("-")<0&&u.substring(0,u.indexOf("-"))===l||u.indexOf(l)===0&&l.length>1))return u})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(t,r){if(!t)return[];if(typeof t=="function"&&(t=t(r)),it(t)&&(t=[t]),Array.isArray(t))return t;if(!r)return t.default||[];let i=t[r];return i||(i=t[this.getScriptPartFromCode(r)]),i||(i=t[this.formatLanguageCode(r)]),i||(i=t[this.getLanguagePartFromCode(r)]),i||(i=t.default),i||[]}toResolveHierarchy(t,r){const i=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],t),s=[],l=u=>{u&&(this.isSupportedCode(u)?s.push(u):this.logger.warn(`rejecting language code not found in supportedLngs: ${u}`))};return it(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&l(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&l(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&l(this.getLanguagePartFromCode(t))):it(t)&&l(this.formatLanguageCode(t)),i.forEach(u=>{s.indexOf(u)<0&&l(this.formatLanguageCode(u))}),s}}const tS={zero:0,one:1,two:2,few:3,many:4,other:5},nS={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class dA{constructor(t,r={}){this.languageUtils=t,this.options=r,this.logger=ma.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,r={}){const i=bc(t==="dev"?"en":t),s=r.ordinal?"ordinal":"cardinal",l=JSON.stringify({cleanedCode:i,type:s});if(l in this.pluralRulesCache)return this.pluralRulesCache[l];let u;try{u=new Intl.PluralRules(i,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),nS;if(!t.match(/-|_/))return nS;const m=this.languageUtils.getLanguagePartFromCode(t);u=this.getRule(m,r)}return this.pluralRulesCache[l]=u,u}needsPlural(t,r={}){let i=this.getRule(t,r);return i||(i=this.getRule("dev",r)),(i==null?void 0:i.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,r,i={}){return this.getSuffixes(t,i).map(s=>`${r}${s}`)}getSuffixes(t,r={}){let i=this.getRule(t,r);return i||(i=this.getRule("dev",r)),i?i.resolvedOptions().pluralCategories.sort((s,l)=>tS[s]-tS[l]).map(s=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(t,r,i={}){const s=this.getRule(t,i);return s?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${s.select(r)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",r,i))}}const rS=(e,t,r,i=".",s=!0)=>{let l=nA(e,t,r);return!l&&s&&it(r)&&(l=zp(e,r,i),l===void 0&&(l=zp(t,r,i))),l},Hm=e=>e.replace(/\$/g,"$$$$");class aS{constructor(t={}){var r;this.logger=ma.create("interpolator"),this.options=t,this.format=((r=t==null?void 0:t.interpolation)==null?void 0:r.format)||(i=>i),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:r,escapeValue:i,useRawValueToEscape:s,prefix:l,prefixEscaped:u,suffix:d,suffixEscaped:m,formatSeparator:f,unescapeSuffix:y,unescapePrefix:p,nestingPrefix:v,nestingPrefixEscaped:b,nestingSuffix:S,nestingSuffixEscaped:x,nestingOptionsSeparator:R,maxReplaces:T,alwaysFormat:M}=t.interpolation;this.escape=r!==void 0?r:aA,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=l?ws(l):u||"{{",this.suffix=d?ws(d):m||"}}",this.formatSeparator=f||",",this.unescapePrefix=y?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":y||"",this.nestingPrefix=v?ws(v):b||ws("$t("),this.nestingSuffix=S?ws(S):x||ws(")"),this.nestingOptionsSeparator=R||",",this.maxReplaces=T||1e3,this.alwaysFormat=M!==void 0?M:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(r,i)=>(r==null?void 0:r.source)===i?(r.lastIndex=0,r):new RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,r,i,s){var b;let l,u,d;const m=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=S=>{if(S.indexOf(this.formatSeparator)<0){const M=rS(r,m,S,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(M,void 0,i,{...s,...r,interpolationkey:S}):M}const x=S.split(this.formatSeparator),R=x.shift().trim(),T=x.join(this.formatSeparator).trim();return this.format(rS(r,m,R,this.options.keySeparator,this.options.ignoreJSONStructure),T,i,{...s,...r,interpolationkey:R})};this.resetRegExp();const y=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,p=((b=s==null?void 0:s.interpolation)==null?void 0:b.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:S=>Hm(S)},{regex:this.regexp,safeValue:S=>this.escapeValue?Hm(this.escape(S)):Hm(S)}].forEach(S=>{for(d=0;l=S.regex.exec(t);){const x=l[1].trim();if(u=f(x),u===void 0)if(typeof y=="function"){const T=y(t,l,s);u=it(T)?T:""}else if(s&&Object.prototype.hasOwnProperty.call(s,x))u="";else if(p){u=l[0];continue}else this.logger.warn(`missed to pass in variable ${x} for interpolating ${t}`),u="";else!it(u)&&!this.useRawValueToEscape&&(u=Xw(u));const R=S.safeValue(u);if(t=t.replace(l[0],R),p?(S.regex.lastIndex+=u.length,S.regex.lastIndex-=l[0].length):S.regex.lastIndex=0,d++,d>=this.maxReplaces)break}}),t}nest(t,r,i={}){let s,l,u;const d=(m,f)=>{const y=this.nestingOptionsSeparator;if(m.indexOf(y)<0)return m;const p=m.split(new RegExp(`${y}[ ]*{`));let v=`{${p[1]}`;m=p[0],v=this.interpolate(v,u);const b=v.match(/'/g),S=v.match(/"/g);(((b==null?void 0:b.length)??0)%2===0&&!S||S.length%2!==0)&&(v=v.replace(/'/g,'"'));try{u=JSON.parse(v),f&&(u={...f,...u})}catch(x){return this.logger.warn(`failed parsing options string in nesting for key ${m}`,x),`${m}${y}${v}`}return u.defaultValue&&u.defaultValue.indexOf(this.prefix)>-1&&delete u.defaultValue,m};for(;s=this.nestingRegexp.exec(t);){let m=[];u={...i},u=u.replace&&!it(u.replace)?u.replace:u,u.applyPostProcessor=!1,delete u.defaultValue;const f=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(f!==-1&&(m=s[1].slice(f).split(this.formatSeparator).map(y=>y.trim()).filter(Boolean),s[1]=s[1].slice(0,f)),l=r(d.call(this,s[1].trim(),u),u),l&&s[0]===t&&!it(l))return l;it(l)||(l=Xw(l)),l||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),l=""),m.length&&(l=m.reduce((y,p)=>this.format(y,p,i.lng,{...i,interpolationkey:s[1].trim()}),l.trim())),t=t.replace(s[0],l),this.regexp.lastIndex=0}return t}}const fA=e=>{let t=e.toLowerCase().trim();const r={};if(e.indexOf("(")>-1){const i=e.split("(");t=i[0].toLowerCase().trim();const s=i[1].substring(0,i[1].length-1);t==="currency"&&s.indexOf(":")<0?r.currency||(r.currency=s.trim()):t==="relativetime"&&s.indexOf(":")<0?r.range||(r.range=s.trim()):s.split(";").forEach(u=>{if(u){const[d,...m]=u.split(":"),f=m.join(":").trim().replace(/^'+|'+$/g,""),y=d.trim();r[y]||(r[y]=f),f==="false"&&(r[y]=!1),f==="true"&&(r[y]=!0),isNaN(f)||(r[y]=parseInt(f,10))}})}return{formatName:t,formatOptions:r}},iS=e=>{const t={};return(r,i,s)=>{let l=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(l={...l,[s.interpolationkey]:void 0});const u=i+JSON.stringify(l);let d=t[u];return d||(d=e(bc(i),s),t[u]=d),d(r)}},hA=e=>(t,r,i)=>e(bc(r),i)(t);class mA{constructor(t={}){this.logger=ma.create("formatter"),this.options=t,this.init(t)}init(t,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const i=r.cacheInBuiltFormats?iS:hA;this.formats={number:i((s,l)=>{const u=new Intl.NumberFormat(s,{...l});return d=>u.format(d)}),currency:i((s,l)=>{const u=new Intl.NumberFormat(s,{...l,style:"currency"});return d=>u.format(d)}),datetime:i((s,l)=>{const u=new Intl.DateTimeFormat(s,{...l});return d=>u.format(d)}),relativetime:i((s,l)=>{const u=new Intl.RelativeTimeFormat(s,{...l});return d=>u.format(d,l.range||"day")}),list:i((s,l)=>{const u=new Intl.ListFormat(s,{...l});return d=>u.format(d)})}}add(t,r){this.formats[t.toLowerCase().trim()]=r}addCached(t,r){this.formats[t.toLowerCase().trim()]=iS(r)}format(t,r,i,s={}){const l=r.split(this.formatSeparator);if(l.length>1&&l[0].indexOf("(")>1&&l[0].indexOf(")")<0&&l.find(d=>d.indexOf(")")>-1)){const d=l.findIndex(m=>m.indexOf(")")>-1);l[0]=[l[0],...l.splice(1,d)].join(this.formatSeparator)}return l.reduce((d,m)=>{var p;const{formatName:f,formatOptions:y}=fA(m);if(this.formats[f]){let v=d;try{const b=((p=s==null?void 0:s.formatParams)==null?void 0:p[s.interpolationkey])||{},S=b.locale||b.lng||s.locale||s.lng||i;v=this.formats[f](d,S,{...y,...s,...b})}catch(b){this.logger.warn(b)}return v}else this.logger.warn(`there was no format function for ${f}`);return d},t)}}const pA=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class gA extends tf{constructor(t,r,i,s={}){var l,u;super(),this.backend=t,this.store=r,this.services=i,this.languageUtils=i.languageUtils,this.options=s,this.logger=ma.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(u=(l=this.backend)==null?void 0:l.init)==null||u.call(l,i,s.backend,s)}queueLoad(t,r,i,s){const l={},u={},d={},m={};return t.forEach(f=>{let y=!0;r.forEach(p=>{const v=`${f}|${p}`;!i.reload&&this.store.hasResourceBundle(f,p)?this.state[v]=2:this.state[v]<0||(this.state[v]===1?u[v]===void 0&&(u[v]=!0):(this.state[v]=1,y=!1,u[v]===void 0&&(u[v]=!0),l[v]===void 0&&(l[v]=!0),m[p]===void 0&&(m[p]=!0)))}),y||(d[f]=!0)}),(Object.keys(l).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(l),pending:Object.keys(u),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(m)}}loaded(t,r,i){const s=t.split("|"),l=s[0],u=s[1];r&&this.emit("failedLoading",l,u,r),!r&&i&&this.store.addResourceBundle(l,u,i,void 0,void 0,{skipCopy:!0}),this.state[t]=r?-1:2,r&&i&&(this.state[t]=0);const d={};this.queue.forEach(m=>{tA(m.loaded,[l],u),pA(m,t),r&&m.errors.push(r),m.pendingCount===0&&!m.done&&(Object.keys(m.loaded).forEach(f=>{d[f]||(d[f]={});const y=m.loaded[f];y.length&&y.forEach(p=>{d[f][p]===void 0&&(d[f][p]=!0)})}),m.done=!0,m.errors.length?m.callback(m.errors):m.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(m=>!m.done)}read(t,r,i,s=0,l=this.retryTimeout,u){if(!t.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:r,fcName:i,tried:s,wait:l,callback:u});return}this.readingCalls++;const d=(f,y)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(f&&y&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,t,r,i,s+1,l*2,u)},l);return}u(f,y)},m=this.backend[i].bind(this.backend);if(m.length===2){try{const f=m(t,r);f&&typeof f.then=="function"?f.then(y=>d(null,y)).catch(d):d(null,f)}catch(f){d(f)}return}return m(t,r,d)}prepareLoading(t,r,i={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();it(t)&&(t=this.languageUtils.toResolveHierarchy(t)),it(r)&&(r=[r]);const l=this.queueLoad(t,r,i,s);if(!l.toLoad.length)return l.pending.length||s(),null;l.toLoad.forEach(u=>{this.loadOne(u)})}load(t,r,i){this.prepareLoading(t,r,{},i)}reload(t,r,i){this.prepareLoading(t,r,{reload:!0},i)}loadOne(t,r=""){const i=t.split("|"),s=i[0],l=i[1];this.read(s,l,"read",void 0,void 0,(u,d)=>{u&&this.logger.warn(`${r}loading namespace ${l} for language ${s} failed`,u),!u&&d&&this.logger.log(`${r}loaded namespace ${l} for language ${s}`,d),this.loaded(t,u,d)})}saveMissing(t,r,i,s,l,u={},d=()=>{}){var m,f,y,p,v;if((f=(m=this.services)==null?void 0:m.utils)!=null&&f.hasLoadedNamespace&&!((p=(y=this.services)==null?void 0:y.utils)!=null&&p.hasLoadedNamespace(r))){this.logger.warn(`did not save key "${i}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if((v=this.backend)!=null&&v.create){const b={...u,isUpdate:l},S=this.backend.create.bind(this.backend);if(S.length<6)try{let x;S.length===5?x=S(t,r,i,s,b):x=S(t,r,i,s),x&&typeof x.then=="function"?x.then(R=>d(null,R)).catch(d):d(null,x)}catch(x){d(x)}else S(t,r,i,s,d,b)}!t||!t[0]||this.store.addResource(t[0],r,i,s)}}}const Bm=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),it(e[1])&&(t.defaultValue=e[1]),it(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const r=e[3]||e[2];Object.keys(r).forEach(i=>{t[i]=r[i]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),oS=e=>{var t,r;return it(e.ns)&&(e.ns=[e.ns]),it(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),it(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((r=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:r.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},sd=()=>{},yA=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(r=>{typeof e[r]=="function"&&(e[r]=e[r].bind(e))})},vA=e=>{var t,r,i,s,l,u,d,m,f;return!!(((i=(r=(t=e==null?void 0:e.modules)==null?void 0:t.backend)==null?void 0:r.name)==null?void 0:i.indexOf("Locize"))>0||((d=(u=(l=(s=e==null?void 0:e.modules)==null?void 0:s.backend)==null?void 0:l.constructor)==null?void 0:u.name)==null?void 0:d.indexOf("Locize"))>0||(f=(m=e==null?void 0:e.options)==null?void 0:m.backend)!=null&&f.backends&&e.options.backend.backends.some(y=>{var p,v,b;return((p=y==null?void 0:y.name)==null?void 0:p.indexOf("Locize"))>0||((b=(v=y==null?void 0:y.constructor)==null?void 0:v.name)==null?void 0:b.indexOf("Locize"))>0}))};class sc extends tf{constructor(t={},r){if(super(),this.options=oS(t),this.services={},this.logger=ma,this.modules={external:[]},yA(this),r&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,r),this;setTimeout(()=>{this.init(t,r)},0)}}init(t={},r){this.isInitializing=!0,typeof t=="function"&&(r=t,t={}),t.defaultNS==null&&t.ns&&(it(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const i=Bm();this.options={...i,...this.options,...oS(t)},this.options.interpolation={...i.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=i.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!vA(this)&&typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙");const s=f=>f?typeof f=="function"?new f:f:null;if(!this.options.isClone){this.modules.logger?ma.init(s(this.modules.logger),this.options):ma.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:f=mA;const y=new eS(this.options);this.store=new Zw(this.options.resources,this.options);const p=this.services;p.logger=ma,p.resourceStore=this.store,p.languageUtils=y,p.pluralResolver=new dA(y,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),f&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(p.formatter=s(f),p.formatter.init&&p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new aS(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new gA(s(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",(b,...S)=>{this.emit(b,...S)}),this.modules.languageDetector&&(p.languageDetector=s(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=s(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new Pd(this.services,this.options),this.translator.on("*",(b,...S)=>{this.emit(b,...S)}),this.modules.external.forEach(b=>{b.init&&b.init(this)})}if(this.format=this.options.interpolation.format,r||(r=sd),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(f=>{this[f]=(...y)=>this.store[f](...y)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=(...y)=>(this.store[f](...y),this)});const d=$l(),m=()=>{const f=(y,p)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),d.resolve(p),r(y,p)};if(this.languages&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initAsync?m():setTimeout(m,0),d}loadResources(t,r=sd){var l,u;let i=r;const s=it(t)?t:this.language;if(typeof t=="function"&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const d=[],m=f=>{if(!f||f==="cimode")return;this.services.languageUtils.toResolveHierarchy(f).forEach(p=>{p!=="cimode"&&d.indexOf(p)<0&&d.push(p)})};s?m(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(y=>m(y)),(u=(l=this.options.preload)==null?void 0:l.forEach)==null||u.call(l,f=>m(f)),this.services.backendConnector.load(d,this.options.ns,f=>{!f&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(f)})}else i(null)}reloadResources(t,r,i){const s=$l();return typeof t=="function"&&(i=t,t=void 0),typeof r=="function"&&(i=r,r=void 0),t||(t=this.languages),r||(r=this.options.ns),i||(i=sd),this.services.backendConnector.reload(t,r,l=>{s.resolve(),i(l)}),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&RE.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let r=0;r<this.languages.length;r++){const i=this.languages[r];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,r){this.isLanguageChangingTo=t;const i=$l();this.emit("languageChanging",t);const s=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},l=(d,m)=>{m?this.isLanguageChangingTo===t&&(s(m),this.translator.changeLanguage(m),this.isLanguageChangingTo=void 0,this.emit("languageChanged",m),this.logger.log("languageChanged",m)):this.isLanguageChangingTo=void 0,i.resolve((...f)=>this.t(...f)),r&&r(d,(...f)=>this.t(...f))},u=d=>{var y,p;!t&&!d&&this.services.languageDetector&&(d=[]);const m=it(d)?d:d&&d[0],f=this.store.hasLanguageSomeTranslations(m)?m:this.services.languageUtils.getBestMatchFromCodes(it(d)?[d]:d);f&&(this.language||s(f),this.translator.language||this.translator.changeLanguage(f),(p=(y=this.services.languageDetector)==null?void 0:y.cacheUserLanguage)==null||p.call(y,f)),this.loadResources(f,v=>{l(v,f)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(u):this.services.languageDetector.detect(u):u(t),i}getFixedT(t,r,i){const s=(l,u,...d)=>{let m;typeof u!="object"?m=this.options.overloadTranslationOptionHandler([l,u].concat(d)):m={...u},m.lng=m.lng||s.lng,m.lngs=m.lngs||s.lngs,m.ns=m.ns||s.ns,m.keyPrefix!==""&&(m.keyPrefix=m.keyPrefix||i||s.keyPrefix);const f=this.options.keySeparator||".";let y;return m.keyPrefix&&Array.isArray(l)?y=l.map(p=>(typeof p=="function"&&(p=Pp(p,{...this.options,...u})),`${m.keyPrefix}${f}${p}`)):(typeof l=="function"&&(l=Pp(l,{...this.options,...u})),y=m.keyPrefix?`${m.keyPrefix}${f}${l}`:l),this.t(y,m)};return it(t)?s.lng=t:s.lngs=t,s.ns=r,s.keyPrefix=i,s}t(...t){var r;return(r=this.translator)==null?void 0:r.translate(...t)}exists(...t){var r;return(r=this.translator)==null?void 0:r.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,r={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=r.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,l=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const u=(d,m)=>{const f=this.services.backendConnector.state[`${d}|${m}`];return f===-1||f===0||f===2};if(r.precheck){const d=r.precheck(this,u);if(d!==void 0)return d}return!!(this.hasResourceBundle(i,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(i,t)&&(!s||u(l,t)))}loadNamespaces(t,r){const i=$l();return this.options.ns?(it(t)&&(t=[t]),t.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{i.resolve(),r&&r(s)}),i):(r&&r(),Promise.resolve())}loadLanguages(t,r){const i=$l();it(t)&&(t=[t]);const s=this.options.preload||[],l=t.filter(u=>s.indexOf(u)<0&&this.services.languageUtils.isSupportedCode(u));return l.length?(this.options.preload=s.concat(l),this.loadResources(u=>{i.resolve(),r&&r(u)}),i):(r&&r(),Promise.resolve())}dir(t){var s,l;if(t||(t=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const u=new Intl.Locale(t);if(u&&u.getTextInfo){const d=u.getTextInfo();if(d&&d.direction)return d.direction}}catch{}const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=((l=this.services)==null?void 0:l.languageUtils)||new eS(Bm());return t.toLowerCase().indexOf("-latn")>1?"ltr":r.indexOf(i.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},r){const i=new sc(t,r);return i.createInstance=sc.createInstance,i}cloneInstance(t={},r=sd){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},l=new sc(s);if((t.debug!==void 0||t.prefix!==void 0)&&(l.logger=l.logger.clone(t)),["store","services","language"].forEach(d=>{l[d]=this[d]}),l.services={...this.services},l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},i){const d=Object.keys(this.store.data).reduce((m,f)=>(m[f]={...this.store.data[f]},m[f]=Object.keys(m[f]).reduce((y,p)=>(y[p]={...m[f][p]},y),m[f]),m),{});l.store=new Zw(d,s),l.services.resourceStore=l.store}if(t.interpolation){const m={...Bm().interpolation,...this.options.interpolation,...t.interpolation},f={...s,interpolation:m};l.services.interpolator=new aS(f)}return l.translator=new Pd(l.services,s),l.translator.on("*",(d,...m)=>{l.emit(d,...m)}),l.init(s,r),l.translator.options=s,l.translator.backendConnector.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const kn=sc.createInstance();kn.createInstance;kn.dir;kn.init;kn.loadResources;kn.reloadResources;kn.use;kn.changeLanguage;kn.getFixedT;kn.t;kn.exists;kn.setDefaultNamespace;kn.hasLoadedNamespace;kn.loadNamespaces;kn.loadLanguages;const bA=(e,t,r,i)=>{var l,u,d,m;const s=[r,{code:t,...i||{}}];if((u=(l=e==null?void 0:e.services)==null?void 0:l.logger)!=null&&u.forward)return e.services.logger.forward(s,"warn","react-i18next::",!0);No(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),(m=(d=e==null?void 0:e.services)==null?void 0:d.logger)!=null&&m.warn?e.services.logger.warn(...s):console!=null&&console.warn&&console.warn(...s)},sS={},CE=(e,t,r,i)=>{No(r)&&sS[r]||(No(r)&&(sS[r]=new Date),bA(e,t,r,i))},OE=(e,t)=>()=>{if(e.isInitialized)t();else{const r=()=>{setTimeout(()=>{e.off("initialized",r)},0),t()};e.on("initialized",r)}},Ip=(e,t,r)=>{e.loadNamespaces(t,OE(e,r))},lS=(e,t,r,i)=>{if(No(r)&&(r=[r]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Ip(e,r,i);r.forEach(s=>{e.options.ns.indexOf(s)<0&&e.options.ns.push(s)}),e.loadLanguages(t,OE(e,i))},wA=(e,t,r={})=>!t.languages||!t.languages.length?(CE(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:r.lng,precheck:(i,s)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!s(i.isLanguageChangingTo,e))return!1}}),No=e=>typeof e=="string",SA=e=>typeof e=="object"&&e!==null,xA=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,EA={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},RA=e=>EA[e],TA=e=>e.replace(xA,RA);let Up={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:TA,transDefaultProps:void 0};const CA=(e={})=>{Up={...Up,...e}},OA=()=>Up;let ME;const MA=e=>{ME=e},DA=()=>ME,AA={type:"3rdParty",init(e){CA(e.options.react),MA(e)}},NA=w.createContext();class kA{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Fm={exports:{}},Vm={};/**
63
- * @license React
64
- * use-sync-external-store-shim.production.js
65
- *
66
- * Copyright (c) Meta Platforms, Inc. and affiliates.
67
- *
68
- * This source code is licensed under the MIT license found in the
69
- * LICENSE file in the root directory of this source tree.
70
- */var cS;function _A(){if(cS)return Vm;cS=1;var e=Dc();function t(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var r=typeof Object.is=="function"?Object.is:t,i=e.useState,s=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function d(p,v){var b=v(),S=i({inst:{value:b,getSnapshot:v}}),x=S[0].inst,R=S[1];return l(function(){x.value=b,x.getSnapshot=v,m(x)&&R({inst:x})},[p,b,v]),s(function(){return m(x)&&R({inst:x}),p(function(){m(x)&&R({inst:x})})},[p]),u(b),b}function m(p){var v=p.getSnapshot;p=p.value;try{var b=v();return!r(p,b)}catch{return!0}}function f(p,v){return v()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:d;return Vm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,Vm}var uS;function DE(){return uS||(uS=1,Fm.exports=_A()),Fm.exports}var Tg=DE();const LA=(e,t)=>No(t)?t:SA(t)&&No(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,zA={t:LA,ready:!1},PA=()=>()=>{},Qs=(e,t={})=>{var G,J,Z;const{i18n:r}=t,{i18n:i,defaultNS:s}=w.useContext(NA)||{},l=r||i||DA();l&&!l.reportNamespaces&&(l.reportNamespaces=new kA),l||CE(l,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const u=w.useMemo(()=>{var z;return{...OA(),...(z=l==null?void 0:l.options)==null?void 0:z.react,...t}},[l,t]),{useSuspense:d,keyPrefix:m}=u,f=s||((G=l==null?void 0:l.options)==null?void 0:G.defaultNS),y=No(f)?[f]:f||["translation"],p=w.useMemo(()=>y,y);(Z=(J=l==null?void 0:l.reportNamespaces)==null?void 0:J.addUsedNamespaces)==null||Z.call(J,p);const v=w.useRef(0),b=w.useCallback(z=>{if(!l)return PA;const{bindI18n:H,bindI18nStore:V}=u,q=()=>{v.current+=1,z()};return H&&l.on(H,q),V&&l.store.on(V,q),()=>{H&&H.split(" ").forEach(_=>l.off(_,q)),V&&V.split(" ").forEach(_=>l.store.off(_,q))}},[l,u]),S=w.useRef(),x=w.useCallback(()=>{if(!l)return zA;const z=!!(l.isInitialized||l.initializedStoreOnce)&&p.every(U=>wA(U,l,u)),H=t.lng||l.language,V=v.current,q=S.current;if(q&&q.ready===z&&q.lng===H&&q.keyPrefix===m&&q.revision===V)return q;const j={t:l.getFixedT(H,u.nsMode==="fallback"?p:p[0],m),ready:z,lng:H,keyPrefix:m,revision:V};return S.current=j,j},[l,p,m,u,t.lng]),[R,T]=w.useState(0),{t:M,ready:D}=Tg.useSyncExternalStore(b,x,x);w.useEffect(()=>{if(l&&!D&&!d){const z=()=>T(H=>H+1);t.lng?lS(l,t.lng,p,z):Ip(l,p,z)}},[l,t.lng,p,D,d,R]);const C=l||{},N=w.useRef(null),k=w.useRef(),O=z=>{const H=Object.getOwnPropertyDescriptors(z);H.__original&&delete H.__original;const V=Object.create(Object.getPrototypeOf(z),H);if(!Object.prototype.hasOwnProperty.call(V,"__original"))try{Object.defineProperty(V,"__original",{value:z,writable:!1,enumerable:!1,configurable:!1})}catch{}return V},L=w.useMemo(()=>{const z=C,H=z==null?void 0:z.language;let V=z;z&&(N.current&&N.current.__original===z?k.current!==H?(V=O(z),N.current=V,k.current=H):V=N.current:(V=O(z),N.current=V,k.current=H));const q=[M,V,D];return q.t=M,q.i18n=V,q.ready=D,q},[M,C,D,C.resolvedLanguage,C.language,C.languages]);if(l&&d&&!D)throw new Promise(z=>{const H=()=>z();t.lng?lS(l,t.lng,p,H):Ip(l,p,H)});return L},IA={en_US:{translation:{common:{loading:"Loading...",save:"Save",saving:"Saving...",cancel:"Cancel",add:"Add",delete:"Delete",edit:"Edit",confirm:"Confirm",close:"Close",expand:"Expand",collapse:"Collapse",refresh:"Refresh",test:"Test",send:"Send",success:"Success",error:"Error",warning:"Warning",info:"Info",yes:"Yes",no:"No",enabled:"Enabled",disabled:"Disabled",pending:"Pending",authorized:"Authorized",unknown:"Unknown",empty:"Empty",none:"None",default:"Default",optional:"Optional",required:"Required",pwaInstallTitle:"Install as app",pwaInstallHintIOSSafari:'iOS Safari does not show an automatic install prompt. Tap Share, then "Add to Home Screen".',pwaInstallHintIOSChrome:'iOS Chrome does not show an automatic install prompt. Tap Share, then "Add to Home Screen".'},nav:{manageDevices:"Manage Devices",settings:"Settings",sidebarExpand:"Expand Sidebar",sidebarCollapse:"Collapse Sidebar",openSidebar:"Open Sidebar",closeSidebar:"Close Sidebar",jumpToLatest:"Jump to Latest",switchToEditor:"Switch to Editor Input",switchToDirect:"Switch to Direct Input",refreshPage:"Refresh Page",refreshPageConfirm:"Are you sure you want to refresh the page? Unsaved content will be lost."},device:{title:"Device Management",devices:"Devices",addDevice:"Add Device",addDeviceDescription:"Fill in device details and choose a connection method",addFirstDevice:"Add First Device",editDevice:"Edit Device",editDeviceDescription:"Update device configuration",sectionBasic:"Basic Info",sectionConnection:"Connection",sectionAuth:"Authentication",noDevices:"No Devices",noDevicesDescription:"Add a local or SSH device to get started",name:"Device Name",namePlaceholder:"e.g., My Server",type:"Type",typeLocal:"Local Device",typeSSH:"SSH Remote Device",typeSSHBadge:"SSH",host:"Host",hostPlaceholder:"example.com",port:"Port",username:"Username",usernamePlaceholder:"root",session:"Tmux Session Name",sessionPlaceholder:"tmex",sessionHint:'Leave empty to use default "tmex"',authMode:"Authentication Mode",authPassword:"Password",authKey:"Private Key",authAgent:"SSH Agent",authConfigRef:"SSH Config",password:"Password",privateKey:"Private Key",privateKeyPlaceholder:"-----BEGIN OPENSSH PRIVATE KEY-----",privateKeyPassphrase:"Private Key Passphrase (Optional)",passphrase:"Passphrase",connect:"Connect",connected:"Connected",disconnect:"Disconnect",disconnected:"Disconnected",connecting:"Connecting...",deleteConfirm:"Delete this device?",deleteDescription:'Device "{{name}}" will be permanently removed. This action cannot be undone.',deleteSuccess:"Device deleted",createSuccess:"Device created",updateSuccess:"Device updated",deleteFailed:"Failed to delete device",createFailed:"Failed to create device",updateFailed:"Failed to update device",loadFailed:"Failed to load devices",localDevice:"Local Device",subtitle:"{{username}}@{{host}}:{{port}}",modify:"Modify Device",delete:"Delete"},terminal:{initializing:"Initializing terminal...",connecting:"Connecting to device...",initFailed:"Terminal initialization failed",inputPlaceholder:"Type command here...",clear:"Clear",deviceError:"Device Error",deviceErrorWithType:"[{{type}}] Device Error",noDeviceSelected:"No device selected",windowClosed:"Current window has been closed, please select a window from the sidebar.",paneClosed:"Current pane has been closed, please select a pane from the sidebar.",bellNotification:"Terminal Bell Notification",bellDescription:"Window {{window}} · Pane {{pane}}",bellFallback:"Received tmux bell",paneTitle:"Pane {{index}}",activePane:"Current Pane",activeWindow:"Current Window",editorPlaceholder:"Enter commands here...",editorClear:"Clear",editorSendWithEnter:"Send with Enter",editorSendLineByLine:"Send Line by Line",editorSend:"Send",sendShortcut:"Send {{key}}",inputModeDirect:"Direct Input",inputModeEditor:"Editor",newWindow:"New Window",closeWindow:"Close Window",closePane:"Close Pane",copy:"Copy",paste:"Paste",copied:"Copied to clipboard",copyFailed:"Copy failed",pasteFailed:"Could not read clipboard, check browser permissions",clearSelection:"Dismiss selection"},settings:{title:"System Settings",siteSettings:"Site Settings",siteName:"Site Name",siteNamePlaceholder:"tmex",siteUrl:"Site URL",siteUrlPlaceholder:"http://localhost:3000",bellThrottle:"Bell Throttle (seconds)",notificationThrottle:"Notification Throttle (seconds)",enableBrowserBellToast:"Enable Browser Bell Toast",enableBrowserNotificationToast:"Enable Browser Notification Toast",enableTelegramBellPush:"Enable Telegram Bell Push",enableTelegramNotificationPush:"Enable Telegram Notification Push",sshReconnectRetries:"SSH Reconnect Retries",sshReconnectDelay:"SSH Reconnect Delay (seconds)",language:"Language",languagePlaceholder:"Select language",language_en_US:"English",language_zh_CN:"简体中文",language_ja_JP:"日本語",theme:"Theme",themeLight:"Light",themeDark:"Dark",siteTab:"Site",notificationsTab:"Notifications",refreshToApply:"Refresh to apply language change",saveSettings:"Save Settings",settingsSaved:"Settings saved",saveFailed:"Failed to save settings",loadFailed:"Failed to load settings",restartGateway:"Restart Gateway",restartScheduled:"Gateway restart scheduled",restartConfirm:"Are you sure you want to restart Gateway? This will interrupt all active connections.",restartFailed:"Failed to restart gateway",sshReconnectMaxRetries:"SSH Reconnect Retries"},telegram:{title:"Telegram Bot Management",botName:"Bot Name",botNamePlaceholder:"e.g., ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"Add Bot",enableBot:"Enable Bot",allowAuthRequests:"Allow Authorization Requests",pendingChats:"Pending Authorization",chats:"Authorized Chats",authorizedChats:"Authorized",noPendingChats:"No pending chats",noAuthorizedChats:"No authorized chats",approve:"Approve",authorize:"Authorize",reject:"Reject",revokeAuth:"Revoke Authorization",testMessage:"Test Message",sendTestMessage:"Send Test Message",deleteBot:"Delete Bot",tokenOptional:"Token (leave empty to keep unchanged)",tokenPlaceholder:"Enter new token",botCreated:"Bot created",botUpdated:"Bot updated",botDeleted:"Bot deleted",authApproved:"Authorization approved",chatRemoved:"Chat removed",testMessageSent:"Test message sent",createFailed:"Failed to create bot",updateFailed:"Failed to update bot",deleteFailed:"Failed to delete bot",approveFailed:"Failed to approve authorization",removeFailed:"Failed to remove chat",testMessageFailed:"Failed to send test message",loadBotsFailed:"Failed to load bot list",loadChatsFailed:"Failed to load chat list",noBots:"No bots yet, add one first.",expand:"Expand",collapse:"Collapse",authCount:"{{authorized}} authorized / {{pending}} pending (max 8)",chatId:"Chat ID",applyTime:"Application Time",gatewayOnline:"🟢 Gateway online @ {{siteName}}",deviceConnectionError:`🔴 {{siteName}}: Connection error on device "{{deviceName}}" ({{host}}) [{{category}}]
71
- {{error}}`,authSuccess:"✅ Authorized. You will now receive notifications.",authPending:"⏳ Authorization request received. Please approve in tmex settings.",authFailed:"❌ Authorization request failed. Please contact administrator.",testMessageTemplate:`🧪 Test Message
72
- Site: {{siteName}}
73
- Time: {{time}}`,approveMessageTemplate:`✅ Authorized via tmex.
74
- Bot: {{botName}}
75
- Time: {{time}}`,botNotFound:"Bot not found or unavailable",botNotRunning:"Bot is not running or unavailable"},webhook:{title:"Webhooks",url:"Webhook URL",secret:"Secret",secretPlaceholder:"Used to sign payloads (HMAC-SHA256)",enabled:"Enabled",eventMask:"Events",add:"Add Webhook",empty:"No webhooks yet.",createFailed:"Failed to create webhook",deleteFailed:"Failed to delete webhook",loadFailed:"Failed to load webhooks"},sshError:{sshConfigRefNotSupported:"SSH Config reference is not supported in this version. Please use host + username with Agent/Key/Password authentication.",configRefNotSupported:"SSH Config reference is not supported in this version. Please use host + username with Agent/Key/Password authentication.",agentUnavailable:"SSH Agent unavailable: SSH_AUTH_SOCK not detected. Please check agent environment.",agentNoIdentity:"SSH Agent has no available keys. Please run ssh-add first.",agentNoIdentities:"SSH Agent has no available keys. Please run ssh-add first.",authFailed:"Authentication failed: incorrect username, password, or key. Please check device configuration.",authFailedGeneric:"Authentication failed: incorrect username, password, or key. Please check device configuration.",networkUnreachable:"Network unreachable: Please check routing, firewall, or VPN configuration.",connectionRefused:"Connection refused: Unable to connect to target host. Please check host address and port.",timeout:"Connection timeout: Unable to connect to device. Please check network or firewall settings.",connectionTimeout:"Connection timeout: Unable to connect to device. Please check network or firewall settings.",hostNotFound:"Host not found: Unable to resolve hostname. Please check DNS or hostname configuration.",handshakeFailed:"Handshake failed: Unable to establish secure connection. Possibly incompatible key exchange algorithm.",tmuxUnavailable:"Remote tmux unavailable or failed to start. Please ensure tmux is installed and available in the remote shell PATH.",connectionClosed:"Connection closed, attempting to reconnect",unknown:"Connection failed: {{message}}",reconnecting:"Connection interrupted, reconnecting in {{delay}} seconds ({{attempt}}/{{maxRetries}})",reconnectFailed:"Auto-reconnect failed, please retry manually",reconnected:"Device reconnected automatically"},deviceStatus:{reconnecting:"Reconnecting {{delay}}s",offline:"Offline",errorBadge:{authFailed:"Auth failed",agentUnavailable:"Agent unavailable",agentNoIdentity:"Agent has no keys",configRefNotSupported:"SSH Config unsupported",networkUnreachable:"Network unreachable",connectionRefused:"Refused",timeout:"Timeout",hostNotFound:"Host not found",handshakeFailed:"Handshake failed",tmuxUnavailable:"Tmux unavailable",connectionClosed:"Disconnected",unknown:"Connection error"}},websocket:{error:"WebSocket connection error",checkGateway:"Please check Gateway status",upgradeFailed:"Upgrade failed",invalidMessage:"Invalid message format"},wsError:{checkGateway:"Please check Gateway status"},apiError:{siteNameRequired:"Site name cannot be empty",siteUrlInvalid:"Site URL must start with http:// or https://",bellThrottleInvalid:"Bell throttle seconds must be between 0-300",sshRetriesInvalid:"SSH reconnect retries must be between 0-20",sshDelayInvalid:"SSH reconnect delay must be between 1-300 seconds",languageInvalid:"Language must be one of the supported locales",botNameRequired:"Bot name cannot be empty",botTokenRequired:"Bot token cannot be empty",missingFields:"Missing required fields",sshRequiresHost:"SSH device requires host or sshConfigRef",invalidRequest:"Invalid request",deviceNotFound:"Device not found",botNotFound:"Bot not found",chatNotFound:"Chat not found",urlAndSecretRequired:"URL and secret are required",notFound:"Not found"},notification:{clickToJump:"Click to jump to corresponding pane",eventType:{terminal_bell:"🔔 Terminal Bell",terminal_notification:"🔔 Terminal Notification",tmux_window_close:"🪟 Window Closed",tmux_pane_close:"📱 Pane Closed",device_tmux_missing:"⚠️ Tmux Missing",device_disconnect:"🔌 Device Disconnected",session_created:"🆕 Session Created",session_closed:"🚪 Session Closed"},site:"Site",device:"Device",window:"Window",pane:"Pane",time:"Time",directLink:"Direct Link",message:"Message",telegramBell:{title:"🔔 Bell from {{siteName}}: {{terminalTopbarLabel}}",viewLink:"Click to view",terminalTopbarLabel:"Window {{window}} · Pane {{pane}} @ {{device}}"},telegramNotification:{}},sidebar:{noWindows:"No windows",noDevices:"No devices",addDeviceLink:"Add Device",openSettingsLink:"Open Settings",openSettings:"Open Settings",manageDevices:"Manage Devices",settings:"Settings",currentWindow:"Current Window",currentPane:"Current Pane",newWindow:"Create Window",closeWindow:"Close Window",closePane:"Close Pane",addDevice:"Add Device"},window:{noWindows:"No windows",new:"New Window",close:"Close window",closePane:"Close pane",closeConfirmTitle:"Close this window?",closePaneConfirmTitle:"Close this pane?",closeConfirmDesc:'Processes running in "{{name}}" will be terminated. This action cannot be undone.',menu:"Window actions",rename:"Rename window",renamePlaceholder:"Enter a name",renameDesc:"The custom name overrides the title set by the terminal and is kept until the gateway restarts.",renameReset:"Use automatic name"},validation:{deviceNameRequired:"Device name is required",hostRequired:"Host is required for SSH devices"}}},zh_CN:{translation:{common:{loading:"加载中...",save:"保存",saving:"保存中...",cancel:"取消",add:"添加",delete:"删除",edit:"修改",confirm:"确认",close:"关闭",expand:"展开",collapse:"收起",refresh:"刷新",test:"测试",send:"发送",success:"成功",error:"错误",warning:"警告",info:"信息",yes:"是",no:"否",enabled:"已启用",disabled:"已禁用",pending:"待授权",authorized:"已授权",unknown:"未知",empty:"空",none:"无",default:"默认",optional:"可选",required:"必填",pwaInstallTitle:"安装为应用",pwaInstallHintIOSSafari:"iOS Safari 不会自动弹出安装提示。请点击「分享」,再选择「添加到主屏幕」。",pwaInstallHintIOSChrome:"iOS Chrome 不会自动弹出安装提示。请点击「分享」,再选择「添加到主屏幕」"},nav:{manageDevices:"管理设备",settings:"设置",sidebarExpand:"展开侧边栏",sidebarCollapse:"收起侧边栏",openSidebar:"打开侧边栏",closeSidebar:"关闭侧边栏",jumpToLatest:"跳转到最新",switchToEditor:"切换到编辑器输入",switchToDirect:"切换到直接输入",refreshPage:"刷新页面",refreshPageConfirm:"确定要刷新页面吗?未保存的内容将会丢失。"},device:{title:"设备管理",devices:"设备",addDevice:"添加设备",addDeviceDescription:"填写设备信息并选择连接方式",addFirstDevice:"添加第一个设备",editDevice:"修改设备",editDeviceDescription:"更新设备配置",sectionBasic:"基本信息",sectionConnection:"连接信息",sectionAuth:"认证信息",noDevices:"暂无设备",noDevicesDescription:"添加本地或 SSH 设备开始使用",name:"设备名称",namePlaceholder:"例如:我的服务器",type:"类型",typeLocal:"本地设备",typeSSH:"SSH 远程设备",typeSSHBadge:"SSH",host:"主机",hostPlaceholder:"example.com",port:"端口",username:"用户名",usernamePlaceholder:"root",session:"Tmux 会话名称",sessionPlaceholder:"tmex",sessionHint:'留空将使用默认值 "tmex"',authMode:"认证方式",authPassword:"密码",authKey:"私钥",authAgent:"SSH Agent",authConfigRef:"SSH Config",password:"密码",privateKey:"私钥",privateKeyPlaceholder:"-----BEGIN OPENSSH PRIVATE KEY-----",privateKeyPassphrase:"私钥密码(可选)",passphrase:"私钥密码(可选)",connect:"连接",connected:"已连接",disconnect:"断开",disconnected:"已断开",connecting:"连接中...",deleteConfirm:"删除此设备?",deleteDescription:'设备 "{{name}}" 将被永久移除,此操作无法撤销。',deleteSuccess:"设备已删除",createSuccess:"设备已创建",updateSuccess:"设备已更新",deleteFailed:"删除设备失败",createFailed:"创建设备失败",updateFailed:"更新设备失败",loadFailed:"加载设备列表失败",localDevice:"本地设备",subtitle:"{{username}}@{{host}}:{{port}}",modify:"修改设备",delete:"删除"},terminal:{initializing:"初始化终端...",connecting:"连接设备...",initFailed:"终端初始化失败",inputPlaceholder:"在此输入命令...",clear:"清空",deviceError:"设备错误",deviceErrorWithType:"[{{type}}] 设备错误",noDeviceSelected:"未选择设备",windowClosed:"当前窗口已关闭,请在侧边栏重新选择窗口。",paneClosed:"当前 Pane 已关闭,请在侧边栏重新选择 Pane。",bellNotification:"终端 Bell 提醒",bellDescription:"窗口 {{window}} · Pane {{pane}}",bellFallback:"收到 tmux bell",paneTitle:"Pane {{index}}",activePane:"当前 pane",activeWindow:"当前窗口",editorPlaceholder:"在此输入命令...",editorClear:"清空",editorSendWithEnter:"发送附带回车",editorSendLineByLine:"逐行发送",editorSend:"发送",sendShortcut:"发送 {{key}}",inputModeDirect:"直接输入",inputModeEditor:"编辑器",newWindow:"新建窗口",closeWindow:"关闭窗口",closePane:"关闭 pane",copy:"复制",paste:"粘贴",copied:"已复制到剪贴板",copyFailed:"复制失败",pasteFailed:"无法读取剪贴板,请检查浏览器权限",clearSelection:"取消选择"},settings:{title:"系统设置",siteSettings:"站点设置",siteName:"站点名称",siteNamePlaceholder:"tmex",siteUrl:"站点访问 URL",siteUrlPlaceholder:"http://localhost:3000",bellThrottle:"Bell 频控(秒)",notificationThrottle:"通知频控(秒)",enableBrowserBellToast:"开启浏览器 Bell Toast",enableBrowserNotificationToast:"开启浏览器通知 Toast",enableTelegramBellPush:"开启 Telegram Bell 推送",enableTelegramNotificationPush:"开启 Telegram 通知推送",sshReconnectRetries:"SSH 重连次数",sshReconnectDelay:"SSH 重连等待(秒)",language:"语言",languagePlaceholder:"选择语言",language_en_US:"English",language_zh_CN:"简体中文",language_ja_JP:"日本語",theme:"主题",themeLight:"浅色",themeDark:"深色",siteTab:"站点",notificationsTab:"通知",refreshToApply:"刷新后生效",saveSettings:"保存设置",settingsSaved:"站点设置已保存",saveFailed:"保存设置失败",loadFailed:"加载设置失败",restartGateway:"重启 Gateway",restartScheduled:"Gateway 重启请求已发送",restartConfirm:"确定要重启 Gateway 吗?这将中断所有活动连接。",restartFailed:"重启请求失败",sshReconnectMaxRetries:"SSH 重连次数"},telegram:{title:"Telegram Bot 管理",botName:"Bot 名称",botNamePlaceholder:"如:ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"新增 Bot",enableBot:"启用 Bot",allowAuthRequests:"允许申请授权",pendingChats:"待授权",chats:"已授权",authorizedChats:"已授权",noPendingChats:"暂无待授权 chat",noAuthorizedChats:"暂无已授权 chat",approve:"批准",authorize:"授权",reject:"拒绝",revokeAuth:"撤销授权",testMessage:"测试消息",sendTestMessage:"发送测试消息",deleteBot:"删除 Bot",tokenOptional:"Token(留空不改)",tokenPlaceholder:"输入新 token",botCreated:"Bot 已创建",botUpdated:"Bot 已更新",botDeleted:"Bot 已删除",authApproved:"授权已批准",chatRemoved:"chat 已移除",testMessageSent:"测试消息已发送",createFailed:"新增 Bot 失败",updateFailed:"更新 Bot 失败",deleteFailed:"删除 Bot 失败",approveFailed:"批准授权失败",removeFailed:"删除 chat 失败",testMessageFailed:"发送测试消息失败",loadBotsFailed:"加载 Bot 列表失败",loadChatsFailed:"加载 chat 列表失败",noBots:"暂无 Bot,先添加一个。",expand:"展开",collapse:"收起",authCount:"已授权 {{authorized}} / 待授权 {{pending}}(总上限 8)",chatId:"chatId",applyTime:"申请时间",gatewayOnline:"🟢 Gateway online @ {{siteName}}",deviceConnectionError:`🔴 {{siteName}}:设备「{{deviceName}}」({{host}}) 连接异常 [{{category}}]
76
- {{error}}`,authSuccess:"✅ 已授权,可接收通知。",authPending:"⏳ 已收到授权申请,请在 tmex 设置页审批。",authFailed:"❌ 授权申请失败,请联系管理员。",testMessageTemplate:`🧪 测试消息
77
- 站点:{{siteName}}
78
- 时间:{{time}}`,approveMessageTemplate:`✅ 已通过 tmex 授权。
79
- Bot:{{botName}}
80
- 时间:{{time}}`,botNotFound:"Bot 未启动或不可用",botNotRunning:"Bot 未启动或不可用"},webhook:{title:"Webhooks",url:"Webhook 地址",secret:"密钥",secretPlaceholder:"用于签名(HMAC-SHA256)",enabled:"启用",eventMask:"事件",add:"添加 Webhook",empty:"暂无 Webhook。",createFailed:"创建 Webhook 失败",deleteFailed:"删除 Webhook 失败",loadFailed:"加载 Webhook 失败"},sshError:{sshConfigRefNotSupported:"当前版本暂不支持 SSH Config 引用,请改为填写 host + username,并选择 Agent/私钥/密码认证",configRefNotSupported:"当前版本暂不支持 SSH Config 引用,请改为填写 host + username,并选择 Agent/私钥/密码认证",agentUnavailable:"SSH Agent 不可用:未检测到 SSH_AUTH_SOCK,请检查 agent 环境",agentNoIdentity:"SSH Agent 未加载可用密钥,请先执行 ssh-add",agentNoIdentities:"SSH Agent 未加载可用密钥,请先执行 ssh-add",authFailed:"认证失败:用户名、密码或密钥不正确,请检查设备配置",authFailedGeneric:"认证失败:用户名、密码或密钥不正确,请检查设备配置",networkUnreachable:"网络不可达:请检查路由、防火墙或 VPN 配置",connectionRefused:"连接被拒绝:无法连接到目标主机,请检查主机地址和端口是否正确",timeout:"连接超时:无法连接到设备,请检查网络或防火墙设置",connectionTimeout:"连接超时:无法连接到设备,请检查网络或防火墙设置",hostNotFound:"主机未找到:无法解析主机地址,请检查 DNS 或主机名是否正确",handshakeFailed:"握手失败:无法建立安全连接,可能是密钥交换算法不兼容",tmuxUnavailable:"远端 tmux 不可用或启动失败,请检查远端是否已安装 tmux,且远端 shell PATH 可找到 tmux",connectionClosed:"连接已断开,尝试重连中",unknown:"连接失败:{{message}}",reconnecting:"连接中断,{{delay}} 秒后自动重连({{attempt}}/{{maxRetries}})",reconnectFailed:"自动重连失败,请手动重试",reconnected:"设备已自动重连"},deviceStatus:{reconnecting:"重连中 {{delay}}s",offline:"离线",errorBadge:{authFailed:"认证失败",agentUnavailable:"Agent 不可用",agentNoIdentity:"Agent 无密钥",configRefNotSupported:"不支持 SSH Config",networkUnreachable:"网络不可达",connectionRefused:"连接被拒",timeout:"连接超时",hostNotFound:"主机未找到",handshakeFailed:"握手失败",tmuxUnavailable:"tmux 不可用",connectionClosed:"连接已断开",unknown:"连接异常"}},websocket:{error:"WebSocket 连接错误",checkGateway:"请检查 Gateway 状态",upgradeFailed:"Upgrade failed",invalidMessage:"Invalid message format"},wsError:{checkGateway:"请检查 Gateway 状态"},apiError:{siteNameRequired:"站点名称不能为空",siteUrlInvalid:"站点 URL 必须以 http:// 或 https:// 开头",bellThrottleInvalid:"Bell 频控秒数需在 0-300 之间",sshRetriesInvalid:"SSH 重连次数需在 0-20 之间",sshDelayInvalid:"SSH 重连等待时间需在 1-300 秒之间",languageInvalid:"语言必须是受支持的区域设置之一",botNameRequired:"Bot 名称不能为空",botTokenRequired:"Bot token 不能为空",missingFields:"缺少必填字段",sshRequiresHost:"SSH 设备需要 host 或 sshConfigRef",invalidRequest:"请求无效",deviceNotFound:"Device not found",botNotFound:"Bot 不存在",chatNotFound:"Chat 不存在",urlAndSecretRequired:"URL and secret required",notFound:"Not found"},notification:{clickToJump:"点击跳转到对应 Pane",eventType:{terminal_bell:"🔔 终端 Bell",terminal_notification:"🔔 终端通知",tmux_window_close:"🪟 窗口关闭",tmux_pane_close:"📱 Pane 关闭",device_tmux_missing:"⚠️ Tmux 不可用",device_disconnect:"🔌 设备断开",session_created:"🆕 会话创建",session_closed:"🚪 会话关闭"},site:"站点",device:"设备",window:"窗口",pane:"Pane",time:"时间",directLink:"直达",message:"信息",telegramBell:{title:"🔔 来自 {{siteName}} 的 Bell:{{terminalTopbarLabel}}",viewLink:"点击查看",terminalTopbarLabel:"窗口 {{window}} · Pane {{pane}} @ {{device}}"},telegramNotification:{}},sidebar:{noWindows:"暂无窗口",noDevices:"暂无设备",addDeviceLink:"添加设备",openSettingsLink:"打开设置",openSettings:"打开设置",manageDevices:"管理设备",settings:"设置",currentWindow:"当前窗口",currentPane:"当前 pane",newWindow:"新建窗口",closeWindow:"关闭窗口",closePane:"关闭 pane",addDevice:"添加设备"},window:{noWindows:"暂无窗口",new:"新建窗口",close:"关闭窗口",closePane:"关闭面板",closeConfirmTitle:"关闭此窗口?",closePaneConfirmTitle:"关闭此面板?",closeConfirmDesc:'"{{name}}" 中运行的进程将被终止,此操作无法撤销。',menu:"窗口操作",rename:"重命名窗口",renamePlaceholder:"输入名称",renameDesc:"自定义名称会覆盖终端设置的标题,并保留至 gateway 重启。",renameReset:"恢复自动名称"},validation:{deviceNameRequired:"设备名称为必填项",hostRequired:"SSH 设备需要填写主机地址"}}},ja_JP:{translation:{common:{loading:"読み込み中...",save:"保存",saving:"保存中...",cancel:"キャンセル",add:"追加",delete:"削除",edit:"編集",confirm:"確認",close:"閉じる",expand:"展開",collapse:"折りたたむ",refresh:"更新",test:"テスト",send:"送信",success:"成功",error:"エラー",warning:"警告",info:"情報",yes:"はい",no:"いいえ",enabled:"有効",disabled:"無効",pending:"保留中",authorized:"承認済み",unknown:"不明",empty:"空",none:"なし",default:"デフォルト",optional:"任意",required:"必須",pwaInstallTitle:"アプリとしてインストール",pwaInstallHintIOSSafari:"iOS Safari では自動的にインストールプロンプトが表示されません。共有ボタンをタップし、「ホーム画面に追加」を選択してください。",pwaInstallHintIOSChrome:"iOS Chrome では自動的にインストールプロンプトが表示されません。共有ボタンをタップし、「ホーム画面に追加」を選択してください。"},nav:{manageDevices:"デバイス管理",settings:"設定",sidebarExpand:"サイドバーを展開",sidebarCollapse:"サイドバーを折りたたむ",openSidebar:"サイドバーを開く",closeSidebar:"サイドバーを閉じる",jumpToLatest:"最新にジャンプ",switchToEditor:"エディタ入力に切り替え",switchToDirect:"直接入力に切り替え",refreshPage:"ページを更新",refreshPageConfirm:"ページを更新してもよろしいですか?保存されていない内容は失われます。"},device:{title:"デバイス管理",devices:"デバイス",addDevice:"デバイスを追加",addDeviceDescription:"デバイス情報を入力し、接続方法を選択してください",addFirstDevice:"最初のデバイスを追加",editDevice:"デバイスを編集",editDeviceDescription:"デバイス設定を更新",sectionBasic:"基本情報",sectionConnection:"接続情報",sectionAuth:"認証情報",noDevices:"デバイスがありません",noDevicesDescription:"ローカルまたは SSH デバイスを追加して開始",name:"デバイス名",namePlaceholder:"例:My Server",type:"タイプ",typeLocal:"ローカルデバイス",typeSSH:"SSH リモートデバイス",typeSSHBadge:"SSH",host:"ホスト",hostPlaceholder:"example.com",port:"ポート",username:"ユーザー名",usernamePlaceholder:"root",session:"Tmux セッション名",sessionPlaceholder:"tmex",sessionHint:"空の場合、デフォルトの「tmex」が使用されます",authMode:"認証モード",authPassword:"パスワード",authKey:"秘密鍵",authAgent:"SSH Agent",authConfigRef:"SSH Config",password:"パスワード",privateKey:"秘密鍵",privateKeyPlaceholder:"-----BEGIN OPENSSH PRIVATE KEY-----",privateKeyPassphrase:"秘密鍵のパスフレーズ(任意)",passphrase:"パスフレーズ",connect:"接続",connected:"接続済み",disconnect:"切断",disconnected:"切断済み",connecting:"接続中...",deleteConfirm:"このデバイスを削除しますか?",deleteDescription:"デバイス「{{name}}」は完全に削除されます。この操作は取り消せません。",deleteSuccess:"デバイスを削除しました",createSuccess:"デバイスを作成しました",updateSuccess:"デバイスを更新しました",deleteFailed:"デバイスの削除に失敗しました",createFailed:"デバイスの作成に失敗しました",updateFailed:"デバイスの更新に失敗しました",loadFailed:"デバイス一覧の読み込みに失敗しました",localDevice:"ローカルデバイス",subtitle:"{{username}}@{{host}}:{{port}}",modify:"デバイスを変更",delete:"削除"},terminal:{initializing:"ターミナルを初期化中...",connecting:"デバイスに接続中...",initFailed:"ターミナルの初期化に失敗しました",inputPlaceholder:"ここにコマンドを入力...",clear:"クリア",deviceError:"デバイスエラー",deviceErrorWithType:"[{{type}}] デバイスエラー",noDeviceSelected:"デバイスが選択されていません",windowClosed:"現在のウィンドウは閉じられました。サイドバーからウィンドウを選択してください。",paneClosed:"現在のペインは閉じられました。サイドバーからペインを選択してください。",bellNotification:"ターミナルベル通知",bellDescription:"ウィンドウ {{window}} · ペイン {{pane}}",bellFallback:"tmux ベルを受信",paneTitle:"ペイン {{index}}",activePane:"現在のペイン",activeWindow:"現在のウィンドウ",editorPlaceholder:"ここにコマンドを入力...",editorClear:"クリア",editorSendWithEnter:"Enter で送信",editorSendLineByLine:"1行ずつ送信",editorSend:"送信",sendShortcut:"{{key}} を送信",inputModeDirect:"直接入力",inputModeEditor:"エディタ",newWindow:"新規ウィンドウ",closeWindow:"ウィンドウを閉じる",closePane:"ペインを閉じる",copy:"コピー",paste:"貼り付け",copied:"クリップボードにコピーしました",copyFailed:"コピーに失敗しました",pasteFailed:"クリップボードを読み取れません。ブラウザの権限を確認してください",clearSelection:"選択を解除"},settings:{title:"システム設定",siteSettings:"サイト設定",siteName:"サイト名",siteNamePlaceholder:"tmex",siteUrl:"サイト URL",siteUrlPlaceholder:"http://localhost:3000",bellThrottle:"ベル制限(秒)",notificationThrottle:"通知制限(秒)",enableBrowserBellToast:"ブラウザベル Toast を有効にする",enableBrowserNotificationToast:"ブラウザ通知 Toast を有効にする",enableTelegramBellPush:"Telegram ベルプッシュを有効にする",enableTelegramNotificationPush:"Telegram 通知プッシュを有効にする",sshReconnectRetries:"SSH 再接続試行回数",sshReconnectDelay:"SSH 再接続待機(秒)",language:"言語",languagePlaceholder:"言語を選択",language_en_US:"English",language_zh_CN:"简体中文",language_ja_JP:"日本語",theme:"テーマ",themeLight:"ライト",themeDark:"ダーク",siteTab:"サイト",notificationsTab:"通知",refreshToApply:"言語変更を適用するには更新してください",saveSettings:"設定を保存",settingsSaved:"設定を保存しました",saveFailed:"設定の保存に失敗しました",loadFailed:"設定の読み込みに失敗しました",restartGateway:"Gateway を再起動",restartScheduled:"Gateway の再起動が予定されました",restartConfirm:"Gateway を再起動してもよろしいですか?すべてのアクティブ接続が中断されます。",restartFailed:"Gateway の再起動に失敗しました",sshReconnectMaxRetries:"SSH 再接続試行回数"},telegram:{title:"Telegram Bot 管理",botName:"Bot 名",botNamePlaceholder:"例:ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"Bot を追加",enableBot:"Bot を有効にする",allowAuthRequests:"認証リクエストを許可",pendingChats:"承認待ち",chats:"承認済み",authorizedChats:"承認済み",noPendingChats:"承認待ちのチャットはありません",noAuthorizedChats:"承認済みのチャットはありません",approve:"承認",authorize:"認証",reject:"拒否",revokeAuth:"認証を取り消す",testMessage:"テストメッセージ",sendTestMessage:"テストメッセージを送信",deleteBot:"Bot を削除",tokenOptional:"Token(変更しない場合は空)",tokenPlaceholder:"新しい token を入力",botCreated:"Bot を作成しました",botUpdated:"Bot を更新しました",botDeleted:"Bot を削除しました",authApproved:"認証が承認されました",chatRemoved:"チャットを削除しました",testMessageSent:"テストメッセージを送信しました",createFailed:"Bot の作成に失敗しました",updateFailed:"Bot の更新に失敗しました",deleteFailed:"Bot の削除に失敗しました",approveFailed:"認証の承認に失敗しました",removeFailed:"チャットの削除に失敗しました",testMessageFailed:"テストメッセージの送信に失敗しました",loadBotsFailed:"Bot 一覧の読み込みに失敗しました",loadChatsFailed:"チャット一覧の読み込みに失敗しました",noBots:"Bot がありません。まず追加してください。",expand:"展開",collapse:"折りたたむ",authCount:"承認済み {{authorized}} / 承認待ち {{pending}}(最大 8)",chatId:"Chat ID",applyTime:"申請時間",gatewayOnline:"🟢 Gateway online @ {{siteName}}",deviceConnectionError:`🔴 {{siteName}}:デバイス「{{deviceName}}」({{host}}) で接続エラー [{{category}}]
81
- {{error}}`,authSuccess:"✅ 承認されました。通知を受信できます。",authPending:"⏳ 認証リクエストを受信しました。tmex 設定ページで承認してください。",authFailed:"❌ 認証リクエストに失敗しました。管理者に連絡してください。",testMessageTemplate:`🧪 テストメッセージ
82
- サイト:{{siteName}}
83
- 時間:{{time}}`,approveMessageTemplate:`✅ tmex で承認されました。
84
- Bot:{{botName}}
85
- 時間:{{time}}`,botNotFound:"Bot が見つからないか利用できません",botNotRunning:"Bot が起動していないか利用できません"},webhook:{title:"Webhooks",url:"Webhook URL",secret:"シークレット",secretPlaceholder:"署名に使用(HMAC-SHA256)",enabled:"有効",eventMask:"イベント",add:"Webhook を追加",empty:"Webhook がありません。",createFailed:"Webhook の作成に失敗しました",deleteFailed:"Webhook の削除に失敗しました",loadFailed:"Webhook の読み込みに失敗しました"},sshError:{sshConfigRefNotSupported:"このバージョンでは SSH Config 参照はサポートされていません。host + username を使用し、Agent/秘密鍵/パスワード認証を選択してください。",configRefNotSupported:"このバージョンでは SSH Config 参照はサポートされていません。host + username を使用し、Agent/秘密鍵/パスワード認証を選択してください。",agentUnavailable:"SSH Agent が利用できません:SSH_AUTH_SOCK が検出されません。agent 環境を確認してください。",agentNoIdentity:"SSH Agent に利用可能な鍵がありません。ssh-add を実行してください。",agentNoIdentities:"SSH Agent に利用可能な鍵がありません。ssh-add を実行してください。",authFailed:"認証に失敗しました:ユーザー名、パスワード、または鍵が正しくありません。デバイス設定を確認してください。",authFailedGeneric:"認証に失敗しました:ユーザー名、パスワード、または鍵が正しくありません。デバイス設定を確認してください。",networkUnreachable:"ネットワークに到達できません:ルーティング、ファイアウォール、または VPN 設定を確認してください。",connectionRefused:"接続が拒否されました:ターゲットホストに接続できません。ホストアドレスとポートを確認してください。",timeout:"接続タイムアウト:デバイスに接続できません。ネットワークまたはファイアウォール設定を確認してください。",connectionTimeout:"接続タイムアウト:デバイスに接続できません。ネットワークまたはファイアウォール設定を確認してください。",hostNotFound:"ホストが見つかりません:ホスト名を解決できません。DNS またはホスト名設定を確認してください。",handshakeFailed:"ハンドシェイクに失敗しました:安全な接続を確立できません。キー交換アルゴリズムが互換性がない可能性があります。",tmuxUnavailable:"リモート tmux が利用できないか起動に失敗しました。tmux がインストールされ、リモート shell の PATH から参照できることを確認してください。",connectionClosed:"接続が切断されました。再接続を試みています",unknown:"接続に失敗しました:{{message}}",reconnecting:"接続が中断されました。{{delay}} 秒後に再接続します({{attempt}}/{{maxRetries}})",reconnectFailed:"自動再接続に失敗しました。手動で再試行してください",reconnected:"デバイスが自動的に再接続されました"},deviceStatus:{reconnecting:"再接続中 {{delay}}s",offline:"オフライン",errorBadge:{authFailed:"認証失敗",agentUnavailable:"Agent 利用不可",agentNoIdentity:"Agent に鍵なし",configRefNotSupported:"SSH Config 非対応",networkUnreachable:"ネットワーク不可達",connectionRefused:"接続拒否",timeout:"タイムアウト",hostNotFound:"ホスト未検出",handshakeFailed:"ハンドシェイク失敗",tmuxUnavailable:"tmux 利用不可",connectionClosed:"切断",unknown:"接続エラー"}},websocket:{error:"WebSocket 接続エラー",checkGateway:"Gateway 状態を確認してください",upgradeFailed:"アップグレードに失敗しました",invalidMessage:"無効なメッセージ形式"},wsError:{checkGateway:"Gateway 状態を確認してください"},apiError:{siteNameRequired:"サイト名は空にできません",siteUrlInvalid:"サイト URL は http:// または https:// で始まる必要があります",bellThrottleInvalid:"ベル制限秒数は 0-300 の間である必要があります",sshRetriesInvalid:"SSH 再接続試行回数は 0-20 の間である必要があります",sshDelayInvalid:"SSH 再接続待機時間は 1-300 秒の間である必要があります",languageInvalid:"言語はサポートされているロケールのいずれかである必要があります",botNameRequired:"Bot 名は空にできません",botTokenRequired:"Bot token は空にできません",missingFields:"必須フィールドがありません",sshRequiresHost:"SSH デバイスには host または sshConfigRef が必要です",invalidRequest:"無効なリクエスト",deviceNotFound:"デバイスが見つかりません",botNotFound:"Bot が見つかりません",chatNotFound:"チャットが見つかりません",urlAndSecretRequired:"URL とシークレットが必要です",notFound:"見つかりません"},notification:{clickToJump:"対応するペインにジャンプ",eventType:{terminal_bell:"🔔 ターミナルベル",terminal_notification:"🔔 ターミナル通知",tmux_window_close:"🪟 ウィンドウ閉じる",tmux_pane_close:"📱 ペイン閉じる",device_tmux_missing:"⚠️ Tmux がありません",device_disconnect:"🔌 デバイス切断",session_created:"🆕 セッション作成",session_closed:"🚪 セッション閉じる"},site:"サイト",device:"デバイス",window:"ウィンドウ",pane:"ペイン",time:"時間",directLink:"直接リンク",message:"メッセージ",telegramBell:{title:"🔔 {{siteName}} からのベル:{{terminalTopbarLabel}}",viewLink:"表示",terminalTopbarLabel:"ウィンドウ {{window}} · ペイン {{pane}} @ {{device}}"},telegramNotification:{}},sidebar:{noWindows:"ウィンドウがありません",noDevices:"デバイスがありません",addDeviceLink:"デバイスを追加",openSettingsLink:"設定を開く",openSettings:"設定を開く",manageDevices:"デバイス管理",settings:"設定",currentWindow:"現在のウィンドウ",currentPane:"現在のペイン",newWindow:"ウィンドウを作成",closeWindow:"ウィンドウを閉じる",closePane:"ペインを閉じる",addDevice:"デバイスを追加"},window:{noWindows:"ウィンドウがありません",new:"新規ウィンドウ",close:"ウィンドウを閉じる",closePane:"ペインを閉じる",closeConfirmTitle:"このウィンドウを閉じますか?",closePaneConfirmTitle:"このペインを閉じますか?",closeConfirmDesc:'"{{name}}" で実行中のプロセスは終了されます。この操作は取り消せません。',menu:"ウィンドウ操作",rename:"ウィンドウ名を変更",renamePlaceholder:"名前を入力",renameDesc:"カスタム名はターミナルが設定したタイトルを上書きし、ゲートウェイが再起動するまで保持されます。",renameReset:"自動名に戻す"},validation:{deviceNameRequired:"デバイス名は必須です",hostRequired:"SSH デバイスにはホストアドレスが必要です"}}}},Cg="en_US",Xj={locales:[{code:"en_US",name:"English",nativeName:"English",flag:"🇺🇸",isDefault:!0},{code:"zh_CN",name:"简体中文",nativeName:"简体中文",flag:"🇨🇳",isDefault:!1},{code:"ja_JP",name:"日本語",nativeName:"日本語",flag:"🇯🇵",isDefault:!1}]};function UA(e){return e.replace("_","-")}var Ym={},ho={},mo={},dS;function jA(){if(dS)return mo;dS=1,Object.defineProperty(mo,"__esModule",{value:!0}),mo.BinaryReader=mo.BinaryWriter=void 0;class e{constructor(i=1024){Be(this,"buffer");Be(this,"view");Be(this,"offset",0);this.buffer=new Uint8Array(i),this.view=new DataView(this.buffer.buffer)}ensureCapacity(i){const s=this.offset+i;if(s<=this.buffer.length)return;let l=this.buffer.length;for(;l<s;)l*=2;const u=new Uint8Array(l);u.set(this.buffer),this.buffer=u,this.view=new DataView(this.buffer.buffer)}writeUint8(i){this.ensureCapacity(1),this.view.setUint8(this.offset,i),this.offset+=1}writeUint16(i){this.ensureCapacity(2),this.view.setUint16(this.offset,i,!0),this.offset+=2}writeUint32(i){this.ensureCapacity(4),this.view.setUint32(this.offset,i,!0),this.offset+=4}writeUint64(i){this.ensureCapacity(8),this.view.setBigUint64(this.offset,i,!0),this.offset+=8}writeUint128(i){this.ensureCapacity(16);const s=i&BigInt("0xFFFFFFFFFFFFFFFF"),l=i>>BigInt(64);this.writeUint64(s),this.writeUint64(l)}writeInt8(i){this.ensureCapacity(1),this.view.setInt8(this.offset,i),this.offset+=1}writeInt16(i){this.ensureCapacity(2),this.view.setInt16(this.offset,i,!0),this.offset+=2}writeInt32(i){this.ensureCapacity(4),this.view.setInt32(this.offset,i,!0),this.offset+=4}writeInt64(i){this.ensureCapacity(8),this.view.setBigInt64(this.offset,i,!0),this.offset+=8}writeInt128(i){this.ensureCapacity(16);const s=i&BigInt("0xFFFFFFFFFFFFFFFF"),l=i>>BigInt(64);this.writeInt64(s),this.writeInt64(l)}writeFloat32(i){this.ensureCapacity(4),this.view.setFloat32(this.offset,i,!0),this.offset+=4}writeFloat64(i){this.ensureCapacity(8),this.view.setFloat64(this.offset,i,!0),this.offset+=8}writeBool(i){this.writeUint8(i?1:0)}writeString(i){const s=new TextEncoder().encode(i);this.writeUint32(s.length),this.ensureCapacity(s.length),this.buffer.set(s,this.offset),this.offset+=s.length}getBuffer(){return this.buffer.slice(0,this.offset)}}mo.BinaryWriter=e;class t{constructor(i){Be(this,"buffer");Be(this,"view");Be(this,"offset",0);this.buffer=i,this.view=new DataView(i.buffer,i.byteOffset,i.byteLength)}readUint8(){const i=this.view.getUint8(this.offset);return this.offset+=1,i}readUint16(){const i=this.view.getUint16(this.offset,!0);return this.offset+=2,i}readUint32(){const i=this.view.getUint32(this.offset,!0);return this.offset+=4,i}readUint64(){const i=this.view.getBigUint64(this.offset,!0);return this.offset+=8,i}readUint128(){const i=this.readUint64();return this.readUint64()<<BigInt(64)|i}readInt8(){const i=this.view.getInt8(this.offset);return this.offset+=1,i}readInt16(){const i=this.view.getInt16(this.offset,!0);return this.offset+=2,i}readInt32(){const i=this.view.getInt32(this.offset,!0);return this.offset+=4,i}readInt64(){const i=this.view.getBigInt64(this.offset,!0);return this.offset+=8,i}readInt128(){const i=this.readUint64();return this.readInt64()<<BigInt(64)|i}readFloat32(){const i=this.view.getFloat32(this.offset,!0);return this.offset+=4,i}readFloat64(){const i=this.view.getFloat64(this.offset,!0);return this.offset+=8,i}readBool(){return!!this.readUint8()}readString(){const i=this.readUint32(),s=this.buffer.slice(this.offset,this.offset+i);return this.offset+=i,new TextDecoder().decode(s)}getOffset(){return this.offset}}return mo.BinaryReader=t,mo}var qm={},fS;function HA(){return fS||(fS=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registry=e.TypeRegistry=void 0;class t{constructor(){Be(this,"handlers",new Map)}register(i,s){this.handlers.set(i,s)}getHandler(i){const s=this.handlers.get(i);if(!s)throw new Error(`No handler registered for type: ${i}`);return s}}e.TypeRegistry=t,e.registry=new t,e.registry.register("u8",{write:(r,i)=>{if(i<0||i>255||!Number.isInteger(i))throw new Error("Value out of range for u8");r.writeUint8(i)},read:r=>r.readUint8()}),e.registry.register("u16",{write:(r,i)=>{if(i<0||i>65535||!Number.isInteger(i))throw new Error("Value out of range for u16");r.writeUint16(i)},read:r=>r.readUint16()}),e.registry.register("u32",{write:(r,i)=>{if(i<0||i>4294967295||!Number.isInteger(i))throw new Error("Value out of range for u32");r.writeUint32(i)},read:r=>r.readUint32()}),e.registry.register("u64",{write:(r,i)=>{if(i<0n||i>18446744073709551615n)throw new Error("Value out of range for u64");r.writeUint64(i)},read:r=>r.readUint64()}),e.registry.register("u128",{write:(r,i)=>{if(i<0n||i>340282366920938463463374607431768211455n)throw new Error("Value out of range for u128");r.writeUint128(i)},read:r=>r.readUint128()}),e.registry.register("i8",{write:(r,i)=>{if(i<-128||i>127||!Number.isInteger(i))throw new Error("Value out of range for i8");r.writeInt8(i)},read:r=>r.readInt8()}),e.registry.register("i16",{write:(r,i)=>{if(i<-32768||i>32767||!Number.isInteger(i))throw new Error("Value out of range for i16");r.writeInt16(i)},read:r=>r.readInt16()}),e.registry.register("i32",{write:(r,i)=>{if(i<-2147483648||i>2147483647||!Number.isInteger(i))throw new Error("Value out of range for i32");r.writeInt32(i)},read:r=>r.readInt32()}),e.registry.register("i64",{write:(r,i)=>{if(i<-9223372036854775808n||i>9223372036854775807n)throw new Error("Value out of range for i64");r.writeInt64(i)},read:r=>r.readInt64()}),e.registry.register("i128",{write:(r,i)=>{if(i<-170141183460469231731687303715884105728n||i>170141183460469231731687303715884105727n)throw new Error("Value out of range for i128");r.writeInt128(i)},read:r=>r.readInt128()}),e.registry.register("f32",{write:(r,i)=>r.writeFloat32(i),read:r=>r.readFloat32()}),e.registry.register("f64",{write:(r,i)=>{if(Number.isNaN(i))throw new Error("For portability reasons we do not allow serializing NaN values.");r.writeFloat64(i)},read:r=>r.readFloat64()}),e.registry.register("bool",{write:(r,i)=>r.writeBool(i),read:r=>r.readBool()}),e.registry.register("string",{write:(r,i)=>r.writeString(i),read:r=>r.readString()}),e.registry.register("unit",{write:()=>{},read:()=>({})}),e.registry.register("struct",{write:(r,i,s)=>{if(s)for(const[l,u]of Object.entries(s))e.registry.getHandler(u.type).write(r,i[l],u.options)},read:(r,i)=>{if(!i)return{};const s={};for(const[l,u]of Object.entries(i)){const d=e.registry.getHandler(u.type);s[l]=d.read(r,u.options)}return s}}),e.registry.register("vec",{write:(r,i,s)=>{if(!s)return;const{elementType:l,elementOptions:u}=s,d=(ArrayBuffer.isView(i),i.length);r.writeUint32(d);const m=e.registry.getHandler(l);if(ArrayBuffer.isView(i))for(let f=0;f<d;f++)m.write(r,i[f],u);else for(const f of i)m.write(r,f,u)},read:(r,i)=>{if(!i)return[];const{elementType:s,elementOptions:l}=i,u=r.readUint32(),d=e.registry.getHandler(s),m=Array.from({length:u},()=>d.read(r,l));switch(s){case"u8":return new Uint8Array(m);case"u16":return new Uint16Array(m);case"u32":return new Uint32Array(m);case"i8":return new Int8Array(m);case"i16":return new Int16Array(m);case"i32":return new Int32Array(m);case"i64":return new BigInt64Array(m);case"f32":return new Float32Array(m);case"f64":return new Float64Array(m);default:return m}}}),e.registry.register("set",{write:(r,i,s)=>{if(!s)return;const{elementType:l,elementOptions:u}=s,d=Array.from(i).sort();r.writeUint32(d.length);const m=e.registry.getHandler(l);for(const f of d)m.write(r,f,u)},read:(r,i)=>{if(!i)return new Set;const{elementType:s,elementOptions:l}=i,u=r.readUint32(),d=e.registry.getHandler(s),m=Array.from({length:u},()=>d.read(r,l));return new Set(m)}}),e.registry.register("map",{write:(r,i,s)=>{if(!s)return;const{keyType:l,keyOptions:u,valueType:d,valueOptions:m}=s,f=Array.from(i.entries()).sort();r.writeUint32(f.length);const y=e.registry.getHandler(l),p=e.registry.getHandler(d);for(const[v,b]of f)y.write(r,v,u),p.write(r,b,m)},read:(r,i)=>{if(!i)return new Map;const{keyType:s,keyOptions:l,valueType:u,valueOptions:d}=i,m=r.readUint32(),f=e.registry.getHandler(s),y=e.registry.getHandler(u),p=Array.from({length:m},()=>{const v=f.read(r,l),b=y.read(r,d);return[v,b]});return new Map(p)}}),e.registry.register("option",{write:(r,i,s)=>{if(!s)return;const{valueType:l,valueOptions:u}=s,d=i!==null;r.writeUint8(d?1:0),d&&e.registry.getHandler(l).write(r,i,u)},read:(r,i)=>{if(!i)return null;const{valueType:s,valueOptions:l}=i;return r.readUint8()===1?e.registry.getHandler(s).read(r,l):null}}),e.registry.register("enum",{write:(r,i,s)=>{if(!s)return;const l=Object.keys(i)[0],u=i[l],d=s.variants.find(m=>m.name===l);if(!d)throw new Error(`Unknown enum variant: ${l}`);r.writeUint8(d.index),d.type!=="unit"&&e.registry.getHandler(d.type).write(r,u,d.options)},read:(r,i)=>{if(!i)return{};const s=r.readUint8(),l=i.variants.find(m=>m.index===s);if(!l)throw new Error(`Unknown enum variant index: ${s}`);if(l.type==="unit")return{[l.name]:{}};const d=e.registry.getHandler(l.type).read(r,l.options);return{[l.name]:d}}}),e.registry.register("tuple",{write:(r,i,s)=>{if(s){if(i.length!==s.length)throw new Error(`Tuple length mismatch: expected ${s.length}, got ${i.length}`);for(let l=0;l<s.length;l++){const u=s[l];if(!u)throw new Error(`Missing type information for tuple element at index ${l}`);e.registry.getHandler(u.type).write(r,i[l],u.options)}}},read:(r,i)=>{if(!i)return[];const s=[];for(const l of i){const u=e.registry.getHandler(l.type);s.push(u.read(r,l.options))}return s}}),e.registry.register("array",{write:(r,i,s)=>{if(!s)return;const{elementType:l,elementOptions:u,length:d}=s;if(i.length!==d)throw new Error(`Array length mismatch: expected ${d}, got ${i.length}`);const m=e.registry.getHandler(l);for(const f of i)m.write(r,f,u)},read:(r,i)=>{if(!i)return[];const{elementType:s,elementOptions:l,length:u}=i,d=e.registry.getHandler(s);return Array.from({length:u},()=>d.read(r,l))}}),e.registry.register("bytes",{write:(r,i,s)=>{const l=i.length;if((s==null?void 0:s.length)!=null){if(l!==s.length)throw new Error(`Bytes length mismatch: expected ${s.length}, got ${l}`);for(let u=0;u<l;u++)r.writeUint8(i[u])}else{r.writeUint32(l);for(let u=0;u<l;u++)r.writeUint8(i[u])}},read:(r,i)=>{const s=(i==null?void 0:i.length)!=null?i.length:r.readUint32(),l=new Uint8Array(s);for(let u=0;u<s;u++)l[u]=r.readUint8();return l}}),e.registry.register("nativeEnum",{write:(r,i,s)=>{if(!s)return;const{valueToIndexMap:l}=s,u=i,d=l.get(u);if(d===void 0)throw new Error(`Invalid enum value: ${String(i)}`);r.writeUint8(d)},read:(r,i)=>{if(!i)return null;const{indexToValueMap:s}=i,l=r.readUint8(),u=s.get(l);if(u===void 0)throw new Error(`Invalid enum index: ${l}`);return u}})})(qm)),qm}var hS;function BA(){if(hS)return ho;hS=1,Object.defineProperty(ho,"__esModule",{value:!0}),ho.b=ho.Schema=void 0;const e=jA(),t=HA();class r{constructor(s,l,u){Be(this,"type");Be(this,"options");Be(this,"registry");this.type=s,this.options=l,this.registry=u}serialize(s){const l=new e.BinaryWriter;return this.registry.getHandler(this.type).write(l,s,this.options),l.getBuffer()}deserialize(s){const l=new e.BinaryReader(s);return this.registry.getHandler(this.type).read(l,this.options)}}return ho.Schema=r,ho.b={u8:()=>new r("u8",null,t.registry),u16:()=>new r("u16",null,t.registry),u32:()=>new r("u32",null,t.registry),u64:()=>new r("u64",null,t.registry),u128:()=>new r("u128",null,t.registry),i8:()=>new r("i8",null,t.registry),i16:()=>new r("i16",null,t.registry),i32:()=>new r("i32",null,t.registry),i64:()=>new r("i64",null,t.registry),i128:()=>new r("i128",null,t.registry),f32:()=>new r("f32",null,t.registry),f64:()=>new r("f64",null,t.registry),bool:()=>new r("bool",null,t.registry),string:()=>new r("string",null,t.registry),unit:()=>new r("unit",null,t.registry),vec:i=>new r("vec",{elementType:i.type,elementOptions:i.options},t.registry),hashSet:i=>new r("set",{elementType:i.type,elementOptions:i.options},t.registry),hashMap:(i,s)=>new r("map",{keyType:i.type,keyOptions:i.options,valueType:s.type,valueOptions:s.options},t.registry),option:i=>new r("option",{valueType:i.type,valueOptions:i.options},t.registry),array:(i,s)=>new r("array",{elementType:i.type,elementOptions:i.options,length:s},t.registry),bytes:i=>new r("bytes",i!=null?{length:i}:{},t.registry),enum:i=>{const s=Object.entries(i).map(([l,u],d)=>({index:d,name:l,type:u.type,options:u.options}));return new r("enum",{variants:s},t.registry)},struct:i=>{const s=Object.fromEntries(Object.entries(i).map(([l,u])=>[l,{type:u.type,options:u.options}]));return new r("struct",s,t.registry)},tuple:(...i)=>{const s=i.map(l=>({type:l.type,options:l.options}));return new r("tuple",s,t.registry)},nativeEnum:i=>{const s=Object.entries(i).filter(([y])=>typeof y=="string"&&Number.isNaN(Number(y))),l=s.map(([y,p])=>p),u=l.some(y=>typeof y=="string"),d=l.some(y=>typeof y=="number");if(u&&d)throw new Error("Mixed string/numeric enums are not supported");const m=new Map,f=new Map;if(s.forEach(([y,p],v)=>{m.set(p,v),f.set(v,p)}),s.length>255)throw new Error("Borsh only supports enums with up to 255 variants");return new r("nativeEnum",{enumObj:i,valueToIndexMap:m,indexToValueMap:f},t.registry)}},ho}var mS;function FA(){return mS||(mS=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Schema=e.b=void 0;var t=BA();Object.defineProperty(e,"b",{enumerable:!0,get:function(){return t.b}}),Object.defineProperty(e,"Schema",{enumerable:!0,get:function(){return t.Schema}})})(Ym)),Ym}var re=FA();const VA=1,YA=2,qA=3,GA=4,KA=5,XA=257,WA=258,$A=259,QA=260,ZA=261,JA=513,eN=514,tN=515,nN=516,rN=517,aN=518,iN=519,oN=520,sN=522,lN=769,cN=770,uN=771,dN=772,fN=773,hN=774,mN=1025,pN=1026,gN=1281,yN=1001,ha=1002,vN=1003,AE=1004,Td=1005,bN=1101,wN=1102,SN=1201,xN=1202,EN=1301,RN=1302,TN=1401,CN={[yN]:"Unsupported protocol version",[ha]:"Invalid frame format",[vN]:"Unknown message kind",[AE]:"Failed to decode payload",[Td]:"Frame exceeds maximum size",[bN]:"Device not found",[wN]:"Failed to connect device",[SN]:"Tmux target not found",[xN]:"Tmux not ready",[EN]:"Select conflict",[RN]:"Select token mismatch",[TN]:"Internal server error"};function ON(e){return CN[e]??`Unknown error code: ${e}`}class Cr extends Error{constructor(t,r=!1,i){super(i??ON(t)),this.code=t,this.retryable=r,this.name="WsBorshError"}}const NE=re.b.struct({magic:re.b.bytes(2),version:re.b.u16(),kind:re.b.u16(),flags:re.b.u16(),seq:re.b.u32(),payload:re.b.bytes()}),MN=re.b.option(re.b.u32()),Ys=re.b.option(re.b.u16()),tr=re.b.option(re.b.string()),DN=re.b.struct({clientImpl:re.b.string(),clientVersion:re.b.string(),maxFrameBytes:re.b.u32(),supportsCompression:re.b.bool(),supportsDiffSnapshot:re.b.bool()}),AN=re.b.struct({serverImpl:re.b.string(),serverVersion:re.b.string(),selectedVersion:re.b.u16(),maxFrameBytes:re.b.u32(),heartbeatIntervalMs:re.b.u32(),capabilities:re.b.vec(re.b.string())}),NN=re.b.struct({nonce:re.b.u32(),timeMs:re.b.u64()});re.b.struct({refSeq:MN,code:re.b.u16(),message:re.b.string(),retryable:re.b.bool()});const kN=re.b.struct({deviceId:re.b.string()}),_N=re.b.struct({deviceId:re.b.string()}),LN=re.b.struct({deviceId:re.b.string()}),zN=re.b.struct({deviceId:re.b.string()}),PN=re.b.struct({deviceId:re.b.string(),eventType:re.b.u8(),errorType:tr,message:tr,rawMessage:tr}),IN=re.b.struct({deviceId:re.b.string(),windowId:tr,paneId:tr,selectToken:re.b.bytes(16),wantHistory:re.b.bool(),cols:Ys,rows:Ys}),UN=re.b.struct({deviceId:re.b.string(),windowId:re.b.string()}),jN=re.b.struct({deviceId:re.b.string(),name:tr}),HN=re.b.struct({deviceId:re.b.string(),windowId:re.b.string()}),BN=re.b.struct({deviceId:re.b.string(),paneId:re.b.string()}),FN=re.b.struct({deviceId:re.b.string(),windowId:re.b.string(),name:re.b.string()}),VN=re.b.struct({deviceId:re.b.string(),style:re.b.string()}),YN=re.b.struct({deviceId:re.b.string(),eventType:re.b.u8(),eventData:re.b.bytes()}),qN=re.b.struct({deviceId:re.b.string(),paneId:re.b.string(),encoding:re.b.u8(),data:re.b.bytes(),isComposing:re.b.bool()}),GN=re.b.struct({deviceId:re.b.string(),paneId:re.b.string(),encoding:re.b.u8(),data:re.b.bytes(),isComposing:re.b.bool()}),kE=re.b.struct({deviceId:re.b.string(),paneId:re.b.string(),cols:re.b.u16(),rows:re.b.u16()}),KN=kE,XN=re.b.struct({deviceId:re.b.string(),paneId:re.b.string(),encoding:re.b.u8(),data:re.b.bytes()}),WN=re.b.struct({deviceId:re.b.string(),paneId:re.b.string(),selectToken:re.b.bytes(16),encoding:re.b.u8(),alternateScreen:re.b.bool(),data:re.b.bytes()}),$N=re.b.struct({deviceId:re.b.string(),windowId:re.b.string(),paneId:re.b.string(),selectToken:re.b.bytes(16)}),QN=re.b.struct({deviceId:re.b.string(),paneId:re.b.string(),selectToken:re.b.bytes(16)}),_E=re.b.struct({chunkStreamId:re.b.u32(),originalKind:re.b.u16(),originalSeq:re.b.u32(),totalChunks:re.b.u16(),chunkIndex:re.b.u16(),data:re.b.bytes()}),ZN=re.b.struct({id:re.b.string(),windowId:re.b.string(),index:re.b.u16(),title:tr,active:re.b.bool(),width:re.b.u16(),height:re.b.u16()}),JN=re.b.struct({id:re.b.string(),name:re.b.string(),customName:tr,index:re.b.u16(),active:re.b.bool(),panes:re.b.vec(ZN)}),ek=re.b.struct({id:re.b.string(),name:re.b.string(),windows:re.b.vec(JN)}),tk=re.b.struct({deviceId:re.b.string(),session:re.b.option(ek)});re.b.struct({deviceId:re.b.string(),baseRevision:re.b.u32(),revision:re.b.u32(),diffFormat:re.b.u8(),diffBytes:re.b.bytes()});const nk=re.b.struct({windowId:re.b.string()}),rk=re.b.struct({windowId:re.b.string()}),ak=re.b.struct({windowId:re.b.string(),name:re.b.string()}),ik=re.b.struct({windowId:re.b.string()}),ok=re.b.struct({paneId:re.b.string(),windowId:re.b.string()}),sk=re.b.struct({paneId:re.b.string()}),lk=re.b.struct({windowId:re.b.string(),paneId:re.b.string()}),ck=re.b.struct({windowId:re.b.string(),layout:re.b.string()}),uk=re.b.struct({windowId:tr,paneId:tr,windowIndex:Ys,paneIndex:Ys,paneUrl:tr}),dk=re.b.struct({source:re.b.u8(),title:tr,body:re.b.string(),windowId:tr,paneId:tr,windowIndex:Ys,paneIndex:Ys,paneUrl:tr}),wc=new Uint8Array([84,88]),fk=1;function Cd(e,t,r,i=0,s=fk){const l={magic:wc,version:s,kind:e,flags:i,seq:r,payload:t};return NE.serialize(l)}function nr(e,t){return e.serialize(t)}function hk(e){if(e.length<12)throw new Cr(ha,!1,"Envelope too small");if(e[0]!==wc[0]||e[1]!==wc[1])throw new Cr(ha,!1,"Invalid magic bytes");try{return NE.deserialize(e)}catch(t){throw new Cr(ha,!1,t instanceof Error?t.message:"Failed to decode envelope")}}function go(e,t){try{return e.deserialize(t)}catch(r){throw new Cr(AE,!1,r instanceof Error?r.message:"Failed to decode payload")}}function mk(e,t){const r=_E.serialize(e);return Cd(1281,r,t)}function pk(e){return _E.deserialize(e)}function gk(e){return e.length>=2&&e[0]===wc[0]&&e[1]===wc[1]}const yk=5e3,pS=100,jp=1e3;class vk{constructor(){Be(this,"streams",new Map);Be(this,"lastCleanup",Date.now())}addChunk(t){if(this.cleanup(),t.totalChunks>jp)throw new Cr(ha,!1,`Too many chunks: ${t.totalChunks} > ${jp}`);if(t.chunkIndex>=t.totalChunks)throw new Cr(ha,!1,`Chunk index out of bounds: ${t.chunkIndex} >= ${t.totalChunks}`);let r=this.streams.get(t.chunkStreamId);if(!r){if(this.streams.size>=pS&&(this.cleanup(!0),this.streams.size>=pS))throw new Cr(ha,!1,"Too many concurrent chunk streams");r={chunks:new Map,totalChunks:t.totalChunks,createdAt:Date.now(),originalKind:t.originalKind,originalSeq:t.originalSeq},this.streams.set(t.chunkStreamId,r)}if(r.totalChunks!==t.totalChunks)throw this.streams.delete(t.chunkStreamId),new Cr(ha,!1,"Chunk total count mismatch");if(r.chunks.has(t.chunkIndex))throw new Cr(ha,!1,`Duplicate chunk index: ${t.chunkIndex}`);return r.chunks.set(t.chunkIndex,t),r.chunks.size===r.totalChunks?this.reassemble(t.chunkStreamId,r):null}reassemble(t,r){const i=[];let s=0;for(let d=0;d<r.totalChunks;d++){const m=r.chunks.get(d);if(!m)throw this.streams.delete(t),new Cr(ha,!1,`Missing chunk index: ${d}`);i.push(m.data),s+=m.data.length}const l=new Uint8Array(s);let u=0;for(const d of i)l.set(d,u),u+=d.length;return this.streams.delete(t),{kind:r.originalKind,seq:r.originalSeq,payload:l}}cleanup(t=!1){const r=Date.now();if(!t&&r-this.lastCleanup<5e3)return;this.lastCleanup=r;const i=r-yk;for(const[s,l]of this.streams)l.createdAt<i&&this.streams.delete(s)}getActiveStreamCount(){return this.streams.size}clear(){this.streams.clear()}}function bk(e,t,r,i){const{maxFrameBytes:s,chunkStreamId:l}=i,u=16,d=18,m=s-u;if(m<=0)throw new Cr(Td,!1,`maxFrameBytes too small: ${s}`);if(e.length<=m)return{chunks:[],totalChunks:0};const f=s-u-d;if(f<=0)throw new Cr(Td,!1,`maxFrameBytes too small for chunking: ${s}`);const y=Math.ceil(e.length/f);if(y>jp)throw new Cr(Td,!1,`Too many chunks: ${y}`);const p=[];for(let v=0;v<y;v++){const b=v*f,S=Math.min(b+f,e.length);p.push({chunkStreamId:l,originalKind:t,originalSeq:r,totalChunks:y,chunkIndex:v,data:e.slice(b,S)})}return{chunks:p,totalChunks:y}}let Gm=1;function wk(){const e=Gm;return Gm=Gm%4294967295+1,e}const Sk={1:"osc9",2:"osc777",3:"osc1337",4:"osc99"};function xk(e){const t=PN.deserialize(e),r={1:"tmux-missing",2:"disconnected",3:"error",4:"reconnected"};return{deviceId:t.deviceId,type:r[t.eventType]??"error",errorType:t.errorType??void 0,message:t.message??void 0,rawMessage:t.rawMessage??void 0}}function Ek(e){const t=YN.deserialize(e),i={1:"window-add",2:"window-close",3:"window-renamed",4:"window-active",5:"pane-add",6:"pane-close",7:"pane-active",8:"layout-change",9:"bell",10:"output",11:"notification"}[t.eventType];if(!i)throw new Error(`Unknown tmux event type: ${t.eventType}`);return{deviceId:t.deviceId,type:i,data:Rk(i,t.eventData)}}function Rk(e,t){if(t.length===0)return{};try{switch(e){case"window-add":return nk.deserialize(t);case"window-close":return rk.deserialize(t);case"window-renamed":return ak.deserialize(t);case"window-active":return ik.deserialize(t);case"pane-add":return ok.deserialize(t);case"pane-close":return sk.deserialize(t);case"pane-active":return lk.deserialize(t);case"layout-change":return ck.deserialize(t);case"bell":{const r=uk.deserialize(t);return{windowId:r.windowId??void 0,paneId:r.paneId??void 0,windowIndex:r.windowIndex??void 0,paneIndex:r.paneIndex??void 0,paneUrl:r.paneUrl??void 0}}case"notification":{const r=dk.deserialize(t);return{source:Sk[r.source]??"osc9",title:r.title??void 0,body:r.body,windowId:r.windowId??void 0,paneId:r.paneId??void 0,windowIndex:r.windowIndex??void 0,paneIndex:r.paneIndex??void 0,paneUrl:r.paneUrl??void 0}}default:return{}}}catch{return{}}}function Tk(e){const t=tk.deserialize(e);return{deviceId:t.deviceId,session:t.session?Ck(t.session):null}}function Ck(e){return{id:e.id,name:e.name,windows:e.windows.map(Ok)}}function Ok(e){return{id:e.id,name:e.name,customName:e.customName??void 0,index:e.index,active:e.active,panes:e.panes.map(Mk)}}function Mk(e){return{id:e.id,windowId:e.windowId,index:e.index,title:e.title??void 0,active:e.active,width:e.width,height:e.height}}function Dk(){const e=navigator.language;return e.startsWith("zh")?"zh_CN":e.startsWith("ja")?"ja_JP":Cg}kn.use(AA).init({resources:IA,lng:Dk(),fallbackLng:Cg,interpolation:{escapeValue:!1},returnNull:!1});const Ak={background:"#e1e1e1",foreground:"#616161",cursor:"#616161",selectionBackground:"rgba(97, 97, 97, 0.25)",black:"#171717",red:"#bf2172",green:"#009799",yellow:"#9a7200",blue:"#007299",magenta:"#9b1d72",cyan:"#007173",white:"#d9d9d9",brightBlack:"#4e4e4e",brightRed:"#e12672",brightGreen:"#00bddf",brightYellow:"#ffdd00",brightBlue:"#7299bc",brightMagenta:"#e17899",brightCyan:"#6fbcbd",brightWhite:"#f1f1f1"},Nk={background:"#262626",foreground:"#d0d0d0",cursor:"#c5c5c5",selectionBackground:"rgba(197, 197, 197, 0.25)",black:"#000000",red:"#ba3c3c",green:"#5d876d",yellow:"#d5a54e",blue:"#887c8d",magenta:"#cd6d6d",cyan:"#618484",white:"#cfcdc3",brightBlack:"#000000",brightRed:"#ea7171",brightGreen:"#7aab7a",brightYellow:"#d1d194",brightBlue:"#afa3b5",brightMagenta:"#e29f9f",brightCyan:"#a0aea3",brightWhite:"#d0d0d0"};function kk(e){const t=e==="light"?Ak:Nk;return`fg=${t.foreground},bg=${t.background}`}const Wj='"JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Noto Sans Mono CJK SC", "Source Han Mono SC", "Sarasa Mono SC", "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", monospace',_k=`${typeof window<"u"&&window.location.protocol==="https:"?"wss:":"ws:"}//${typeof window<"u"?window.location.host:""}/ws`,Lk={clientImpl:"tmex-fe",clientVersion:"0.1.0",maxFrameBytes:1048576,reconnectDelayMs:1e3,maxReconnectAttempts:5,heartbeatIntervalMs:15e3};class zk{constructor(t={}){Be(this,"ws",null);Be(this,"options");Be(this,"state","IDLE");Be(this,"seq",0);Be(this,"chunkReassembler",new vk);Be(this,"reconnectAttempts",0);Be(this,"reconnectTimer",null);Be(this,"heartbeatTimer",null);Be(this,"messageHandlers",new Set);Be(this,"stateChangeHandlers",new Set);Be(this,"errorHandlers",new Set);Be(this,"pendingMessages",[]);Be(this,"maxPendingMessages",100);this.options={...Lk,...t}}setState(t){if(this.state!==t){console.log(`[borsh-client] State: ${this.state} -> ${t}`),this.state=t;for(const r of this.stateChangeHandlers)try{r(t)}catch(i){console.error("[borsh-client] State change handler error:",i)}t==="READY"&&this.flushPendingMessages()}}getState(){return this.state}isReady(){return this.state==="READY"}onMessage(t){return this.messageHandlers.add(t),()=>this.messageHandlers.delete(t)}onStateChange(t){return this.stateChangeHandlers.add(t),()=>this.stateChangeHandlers.delete(t)}onError(t){return this.errorHandlers.add(t),()=>this.errorHandlers.delete(t)}connect(){var t,r;if(!(((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN||((r=this.ws)==null?void 0:r.readyState)===WebSocket.CONNECTING)){this.setState("WS_CONNECTING");try{this.ws=new WebSocket(_k),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{this.sendHello()},this.ws.onmessage=i=>{this.handleMessage(i.data)},this.ws.onclose=()=>{this.handleClose()},this.ws.onerror=()=>{this.handleError(new Error("WebSocket error"))}}catch(i){this.handleError(i instanceof Error?i:new Error(String(i)))}}}disconnect(){this.setState("CLOSED"),this.clearTimers(),this.ws&&(this.ws.close(),this.ws=null)}handleMessage(t){if(typeof t=="string")return;const r=new Uint8Array(t);if(!gk(r)){console.warn("[borsh-client] Received message without magic, ignoring");return}try{const i=hk(r);if(i.kind===gN){const s=pk(i.payload),l=this.chunkReassembler.addChunk(s);l&&this.dispatchMessage({kind:l.kind,seq:l.seq,payload:l.payload});return}if(i.kind===YA){this.handleHelloS2C(i.payload);return}if(i.kind===GA)return;this.dispatchMessage({kind:i.kind,seq:i.seq,payload:i.payload})}catch(i){console.error("[borsh-client] Failed to decode message:",i)}}dispatchMessage(t){for(const r of this.messageHandlers)try{r(t)}catch(i){console.error("[borsh-client] Message handler error:",i)}}handleHelloS2C(t){try{const r=go(AN,t);console.log("[borsh-client] HELLO_S2C received:",r),this.setState("READY"),this.startHeartbeat(),this.reconnectAttempts=0}catch(r){console.error("[borsh-client] Failed to decode HELLO_S2C:",r),this.handleError(new Error("HELLO negotiation failed"))}}handleClose(){this.stopHeartbeat(),this.state!=="CLOSED"&&(this.reconnectAttempts<this.options.maxReconnectAttempts?this.scheduleReconnect():(this.setState("CLOSED"),this.handleError(new Error("Max reconnection attempts reached"))))}handleError(t){console.error("[borsh-client] Error:",t);for(const r of this.errorHandlers)try{r(t)}catch(i){console.error("[borsh-client] Error handler error:",i)}}sendHello(){const t={clientImpl:this.options.clientImpl,clientVersion:this.options.clientVersion,maxFrameBytes:this.options.maxFrameBytes,supportsCompression:!1,supportsDiffSnapshot:!1},r=nr(DN,t),i=this.nextSeq(),s=Cd(VA,r,i);this.sendRaw(s),this.setState("HELLO_NEGOTIATING")}send(t,r){if(!this.isReady())return this.pendingMessages.length<this.maxPendingMessages&&this.pendingMessages.push({kind:t,payload:r}),!1;const i=this.nextSeq(),s=bk(r,t,i,{maxFrameBytes:this.options.maxFrameBytes,chunkStreamId:wk()});if(s.totalChunks===0){const l=Cd(t,r,i);this.sendRaw(l)}else for(const l of s.chunks){const u=mk(l,this.nextSeq());this.sendRaw(u)}return!0}sendRaw(t){var r;((r=this.ws)==null?void 0:r.readyState)===WebSocket.OPEN&&this.ws.send(t)}flushPendingMessages(){for(;this.pendingMessages.length>0;){const t=this.pendingMessages.shift();t&&this.send(t.kind,t.payload)}}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.sendPing()},this.options.heartbeatIntervalMs)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}sendPing(){if(!this.isReady())return;const t={nonce:Math.floor(Math.random()*4294967295),timeMs:BigInt(Date.now())},r=nr(NN,t),i=this.nextSeq(),s=Cd(qA,r,i);this.sendRaw(s)}scheduleReconnect(){if(this.reconnectTimer)return;this.reconnectAttempts++,this.setState("RECONNECT_BACKOFF");const t=Math.min(this.options.reconnectDelayMs*2**(this.reconnectAttempts-1),3e4);console.log(`[borsh-client] Reconnecting in ${t}ms (attempt ${this.reconnectAttempts})`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}clearTimers(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.stopHeartbeat()}nextSeq(){return this.seq=(this.seq+1)%4294967295,this.seq}}let Km=null;function $n(){return Km||(Km=new zk),Km}class Pk{constructor(t={}){Be(this,"transactions",new Map);Be(this,"outputGates",new Map);Be(this,"deferredResets",new Set);Be(this,"deferredHistories",new Map);Be(this,"deferredFlushes",new Map);Be(this,"deferredOutputs",new Map);Be(this,"callbacks");Be(this,"ackTimeoutMs",1500);Be(this,"liveResumeTimeoutMs",2e3);Be(this,"timers",new Map);this.callbacks=t}setCallbacks(t){this.callbacks=t;for(const r of this.transactions.keys())this.replayDeferred(r);for(const r of this.deferredResets)this.replayDeferred(r);for(const r of this.deferredHistories.keys())this.replayDeferred(r);for(const r of this.deferredFlushes.keys())this.replayDeferred(r);for(const r of this.deferredOutputs.keys())this.replayDeferred(r)}getTransaction(t){return this.transactions.get(t)}getState(t){var r;return((r=this.transactions.get(t))==null?void 0:r.state)??"STABLE"}isStable(t){return this.getState(t)==="STABLE"}isBuffering(t){var r;return((r=this.outputGates.get(t))==null?void 0:r.state)==="BUFFERING"}dispatch(t){switch(t.type){case"SELECT_START":this.handleSelectStart(t);break;case"SWITCH_ACK":this.handleSwitchAck(t);break;case"HISTORY":this.handleHistory(t);break;case"LIVE_RESUME":this.handleLiveResume(t);break;case"OUTPUT":this.handleOutput(t);break;case"SELECT_FAILED":this.handleSelectFailed(t);break}}handleSelectStart(t){const{deviceId:r,windowId:i,paneId:s,selectToken:l,wantHistory:u}=t;this.cancelTransaction(r),this.clearDeferred(r);const d={state:"SELECTING",deviceId:r,windowId:i,paneId:s,selectToken:new Uint8Array(l),wantHistory:u,startedAt:Date.now()};this.transactions.set(r,d),this.startOutputBuffering(r),this.setTimer(r,()=>{this.handleTimeout(r,"ack")},this.ackTimeoutMs)}handleSwitchAck(t){const{deviceId:r,selectToken:i}=t,s=this.transactions.get(r);!s||!this.validateToken(s.selectToken,i)||s.state==="SELECTING"&&(this.clearTimer(r),s.state="ACKED",this.callbacks.onResetTerminal?this.callbacks.onResetTerminal(r):this.deferredResets.add(r),this.setTimer(r,()=>{this.handleTimeout(r,"live")},this.liveResumeTimeoutMs))}handleHistory(t){const{deviceId:r,selectToken:i,data:s}=t,l=this.transactions.get(r);!l||!this.validateToken(l.selectToken,i)||l.state==="ACKED"&&(l.state="HISTORY_APPLIED",this.callbacks.onApplyHistory?this.callbacks.onApplyHistory(r,s,t.alternateScreen):this.deferredHistories.set(r,{data:s,alternateScreen:t.alternateScreen}),this.setTimer(r,()=>{this.handleTimeout(r,"live")},this.liveResumeTimeoutMs))}handleLiveResume(t){const{deviceId:r,selectToken:i}=t,s=this.transactions.get(r);if(!s||!this.validateToken(s.selectToken,i)||s.state!=="ACKED"&&s.state!=="HISTORY_APPLIED")return;this.clearTimer(r),s.state="LIVE";const l=this.stopOutputBuffering(r);this.completeTransaction(r),this.callbacks.onFlushBuffer?this.callbacks.onFlushBuffer(r,l):l.length>0&&this.deferredFlushes.set(r,l),this.replayDeferred(r)}handleOutput(t){const{deviceId:r,paneId:i,data:s}=t,l=this.transactions.get(r);if(l&&l.paneId!==i)return;if(this.isBuffering(r)){this.bufferOutput(r,s);return}if(this.callbacks.onOutput){this.callbacks.onOutput(r,i,s);return}const u=this.deferredOutputs.get(r)??[];u.push({paneId:i,data:new Uint8Array(s)}),this.deferredOutputs.set(r,u)}handleSelectFailed(t){const{deviceId:r}=t;this.failTransaction(r)}handleTimeout(t,r){console.warn(`[select-sm] Timeout at ${r} for ${t}`),this.failTransaction(t)}completeTransaction(t){const r=this.transactions.get(t);r&&(r.state="STABLE",this.transactions.delete(t))}failTransaction(t){var i,s;const r=this.transactions.get(t);r&&(r.state="SELECT_FAILED",this.stopOutputBuffering(t),(s=(i=this.callbacks).onSelectFailed)==null||s.call(i,t),this.transactions.delete(t),this.clearTimer(t),this.clearDeferred(t))}cancelTransaction(t){this.transactions.get(t)&&(this.stopOutputBuffering(t),this.transactions.delete(t),this.clearTimer(t),this.clearDeferred(t))}startOutputBuffering(t){this.outputGates.set(t,{state:"BUFFERING",buffer:[]})}stopOutputBuffering(t){const r=this.outputGates.get(t);if(!r)return[];const i=[...r.buffer];return this.outputGates.delete(t),i}bufferOutput(t,r){const i=this.outputGates.get(t);i&&(i.buffer.length>=1e3&&i.buffer.shift(),i.buffer.push(new Uint8Array(r)))}validateToken(t,r){if(t.length!==r.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==r[i])return!1;return!0}replayDeferred(t){var l,u;this.deferredResets.has(t)&&(this.deferredResets.delete(t),(u=(l=this.callbacks).onResetTerminal)==null||u.call(l,t));const r=this.deferredHistories.get(t);r!==void 0&&this.callbacks.onApplyHistory&&(this.callbacks.onApplyHistory(t,r.data,r.alternateScreen),this.deferredHistories.delete(t));const i=this.deferredFlushes.get(t);i&&this.callbacks.onFlushBuffer&&(this.callbacks.onFlushBuffer(t,i),this.deferredFlushes.delete(t));const s=this.deferredOutputs.get(t);if(s&&this.callbacks.onOutput){for(const d of s)this.callbacks.onOutput(t,d.paneId,d.data);this.deferredOutputs.delete(t)}}clearDeferred(t){this.deferredResets.delete(t),this.deferredHistories.delete(t),this.deferredFlushes.delete(t),this.deferredOutputs.delete(t)}setTimer(t,r,i){this.clearTimer(t);const s=setTimeout(r,i);this.timers.set(t,s)}clearTimer(t){const r=this.timers.get(t);r&&(clearTimeout(r),this.timers.delete(t))}cleanup(t){this.cancelTransaction(t),this.outputGates.delete(t),this.clearDeferred(t)}cleanupAll(){for(const t of this.transactions.keys())this.cleanup(t);this.transactions.clear(),this.outputGates.clear(),this.deferredResets.clear(),this.deferredHistories.clear(),this.deferredFlushes.clear(),this.deferredOutputs.clear();for(const t of this.timers.values())clearTimeout(t);this.timers.clear()}}let Ql=null;function Sc(e){return Ql?(e&&Ql.setCallbacks(e),Ql):(Ql=new Pk(e),Ql)}function Ik(){return crypto.getRandomValues(new Uint8Array(16))}function LE(e){const t=nr(kN,{deviceId:e});return{kind:XA,payload:t}}function Uk(e){const t=nr(LN,{deviceId:e});return{kind:$A,payload:t}}function jk(e){const t=nr(IN,{deviceId:e.deviceId,windowId:e.windowId??null,paneId:e.paneId??null,selectToken:e.selectToken,wantHistory:e.wantHistory,cols:e.cols??null,rows:e.rows??null});return{kind:JA,payload:t}}function Hk(e,t){const r=nr(UN,{deviceId:e,windowId:t});return{kind:eN,payload:r}}function Bk(e,t){const r=nr(jN,{deviceId:e,name:t??null});return{kind:tN,payload:r}}function Fk(e,t){const r=nr(HN,{deviceId:e,windowId:t});return{kind:nN,payload:r}}function Vk(e,t){const r=nr(BN,{deviceId:e,paneId:t});return{kind:rN,payload:r}}function Yk(e,t,r){const i=nr(FN,{deviceId:e,windowId:t,name:r});return{kind:aN,payload:i}}function qk(e,t){const r=nr(VN,{deviceId:e,style:t});return{kind:sN,payload:r}}function Gk(e,t,r,i=!1){const s=new TextEncoder,l=nr(qN,{deviceId:e,paneId:t,encoding:2,data:s.encode(r),isComposing:i});return{kind:lN,payload:l}}function Kk(e,t,r){const i=new TextEncoder,s=nr(GN,{deviceId:e,paneId:t,encoding:2,data:i.encode(r),isComposing:!1});return{kind:cN,payload:s}}function Xk(e,t,r,i){const s=nr(kE,{deviceId:e,paneId:t,cols:r,rows:i});return{kind:uN,payload:s}}function Wk(e,t,r,i){const s=nr(KN,{deviceId:e,paneId:t,cols:r,rows:i});return{kind:dN,payload:s}}const gS=e=>{let t;const r=new Set,i=(f,y)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const v=t;t=y??(typeof p!="object"||p===null)?p:Object.assign({},t,p),r.forEach(b=>b(t,v))}},s=()=>t,d={setState:i,getState:s,getInitialState:()=>m,subscribe:f=>(r.add(f),()=>r.delete(f))},m=t=e(i,s,d);return d},$k=(e=>e?gS(e):gS),Qk=e=>e;function Zk(e,t=Qk){const r=Oe.useSyncExternalStore(e.subscribe,Oe.useCallback(()=>t(e.getState()),[e,t]),Oe.useCallback(()=>t(e.getInitialState()),[e,t]));return Oe.useDebugValue(r),r}const yS=e=>{const t=$k(e),r=i=>Zk(t,i);return Object.assign(r,t),r},Og=(e=>e?yS(e):yS),Xm={siteName:"tmex",siteUrl:typeof window<"u"?window.location.origin:"http://localhost:9663",bellThrottleSeconds:6,notificationThrottleSeconds:3,enableBrowserBellToast:!0,enableBrowserNotificationToast:!0,enableTelegramBellPush:!0,enableTelegramNotificationPush:!0,sshReconnectMaxRetries:2,sshReconnectDelaySeconds:10,language:Cg,updatedAt:new Date(0).toISOString()};async function vS(){const e=await fetch("/api/settings/site");if(!e.ok)throw new Error("Failed to load site settings");return(await e.json()).settings}const qs=Og((e,t)=>({settings:null,loading:!1,fetchSettings:async()=>{const r=t().settings;if(r)return r;e({loading:!0});try{const i=await vS();return e({settings:i,loading:!1}),kn.changeLanguage(i.language),i}catch(i){return console.error("[site] failed to fetch settings:",i),e({settings:Xm,loading:!1}),kn.changeLanguage(Xm.language),Xm}},refreshSettings:async()=>{e({loading:!0});try{const r=await vS();return e({settings:r,loading:!1}),kn.changeLanguage(r.language),r}catch(r){throw console.error("[site] failed to refresh settings:",r),e({loading:!1}),r}}}));function Jk(e){const t=typeof e.windowIndex=="number"?`Window ${e.windowIndex}`:typeof e.windowId=="string"&&e.windowId?`Window ${e.windowId}`:"",r=typeof e.paneIndex=="number"?`Pane ${e.paneIndex}`:typeof e.paneId=="string"&&e.paneId?`Pane ${e.paneId}`:"";return[t,r].filter(Boolean).join(" · ")}function e_(e){const t=typeof e.title=="string"&&e.title?e.title:"Terminal Notification",r=Jk(e),i=typeof e.body=="string"&&e.body?e.body:typeof e.source=="string"&&e.source?`From ${e.source}`:"Terminal notification";return{title:t,description:r?`${r}
86
- ${i}`:i}}function t_(e,t){let r;try{r=e()}catch{return}return{getItem:s=>{var l;const u=m=>m===null?null:JSON.parse(m,void 0),d=(l=r.getItem(s))!=null?l:null;return d instanceof Promise?d.then(u):u(d)},setItem:(s,l)=>r.setItem(s,JSON.stringify(l,void 0)),removeItem:s=>r.removeItem(s)}}const Hp=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(i){return Hp(i)(r)},catch(i){return this}}}catch(r){return{then(i){return this},catch(i){return Hp(i)(r)}}}},n_=(e,t)=>(r,i,s)=>{let l={storage:t_(()=>window.localStorage),partialize:R=>R,version:0,merge:(R,T)=>({...T,...R}),...t},u=!1,d=0;const m=new Set,f=new Set;let y=l.storage;if(!y)return e((...R)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),r(...R)},i,s);const p=()=>{const R=l.partialize({...i()});return y.setItem(l.name,{state:R,version:l.version})},v=s.setState;s.setState=(R,T)=>(v(R,T),p());const b=e((...R)=>(r(...R),p()),i,s);s.getInitialState=()=>b;let S;const x=()=>{var R,T;if(!y)return;const M=++d;u=!1,m.forEach(C=>{var N;return C((N=i())!=null?N:b)});const D=((T=l.onRehydrateStorage)==null?void 0:T.call(l,(R=i())!=null?R:b))||void 0;return Hp(y.getItem.bind(y))(l.name).then(C=>{if(C)if(typeof C.version=="number"&&C.version!==l.version){if(l.migrate){const N=l.migrate(C.state,C.version);return N instanceof Promise?N.then(k=>[!0,k]):[!0,N]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,C.state];return[!1,void 0]}).then(C=>{var N;if(M!==d)return;const[k,O]=C;if(S=l.merge(O,(N=i())!=null?N:b),r(S,!0),k)return p()}).then(()=>{M===d&&(D==null||D(S,void 0),S=i(),u=!0,f.forEach(C=>C(S)))}).catch(C=>{M===d&&(D==null||D(void 0,C))})};return s.persist={setOptions:R=>{l={...l,...R},R.storage&&(y=R.storage)},clearStorage:()=>{y==null||y.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>x(),hasHydrated:()=>u,onHydrate:R=>(m.add(R),()=>{m.delete(R)}),onFinishHydration:R=>(f.add(R),()=>{f.delete(R)})},l.skipHydration||x(),S||b},r_=n_,xc=Og()(r_(e=>({sidebarCollapsed:!1,inputMode:"direct",editorSendWithEnter:!0,theme:"dark",editorHistory:[],editorDrafts:{},setSidebarCollapsed:t=>e({sidebarCollapsed:t}),setInputMode:t=>e({inputMode:t}),setEditorSendWithEnter:t=>e({editorSendWithEnter:t}),setTheme:t=>e({theme:t}),addEditorHistory:t=>e(r=>({editorHistory:[t,...r.editorHistory.slice(0,49)]})),setEditorDraft:(t,r)=>e(i=>({editorDrafts:{...i.editorDrafts,[t]:r}})),removeEditorDraft:t=>e(r=>{if(!(t in r.editorDrafts))return r;const i={...r.editorDrafts};return delete i[t],{editorDrafts:i}})}),{name:"tmex-ui",partialize:e=>({sidebarCollapsed:e.sidebarCollapsed,inputMode:e.inputMode,editorSendWithEnter:e.editorSendWithEnter,theme:e.theme,editorHistory:e.editorHistory,editorDrafts:e.editorDrafts})})),a_=500,bS=new Map,Wm=new Map;function zE(e){const t=Date.now(),r=bS.get(e);return r!==void 0&&t-r<a_?!0:(bS.set(e,t),!1)}let wS=!1;function $m(e){const t=kk(xc.getState().theme),r=qk(e,t);$n().send(r.kind,r.payload)}function Qm(e,t){if(typeof e!="number"||typeof t!="number")return null;const r=Math.max(2,Math.floor(e)),i=Math.max(2,Math.floor(t));return{cols:r,rows:i}}function i_(e,t){if(wS)return;wS=!0;const r=$n(),i=l=>{const u=t().selectedPanes[l];!u||Sc().getTransaction(l)||t().selectPane(l,u.windowId,u.paneId)};r.onStateChange(l=>{e({socketReady:l==="READY"})}),r.onMessage(l=>{const u=Sc();switch(l.kind){case WA:{const d=go(_N,l.payload);e(m=>({deviceConnected:{...m.deviceConnected,[d.deviceId]:!0},deviceErrors:{...m.deviceErrors,[d.deviceId]:void 0},deviceReconnecting:{...m.deviceReconnecting,[d.deviceId]:void 0}})),$m(d.deviceId),i(d.deviceId);return}case QA:{const d=go(zN,l.payload);u.cleanup(d.deviceId),e(m=>({deviceConnected:{...m.deviceConnected,[d.deviceId]:!1}}));return}case ZA:{const d=xk(l.payload);o_(e,d),d.type==="reconnected"&&($m(d.deviceId),i(d.deviceId));return}case oN:{const d=Tk(l.payload);e(m=>({snapshots:{...m.snapshots,[d.deviceId]:d}}));return}case iN:{const d=Ek(l.payload);s_(e,d);return}case mN:{const d=go($N,l.payload);u.dispatch({type:"SWITCH_ACK",deviceId:d.deviceId,selectToken:d.selectToken});return}case hN:{const d=go(WN,l.payload),m=new TextDecoder().decode(d.data);u.dispatch({type:"HISTORY",deviceId:d.deviceId,selectToken:d.selectToken,data:m,alternateScreen:d.alternateScreen});return}case pN:{const d=go(QN,l.payload);u.dispatch({type:"LIVE_RESUME",deviceId:d.deviceId,selectToken:d.selectToken});return}case fN:{const d=go(XN,l.payload);u.dispatch({type:"OUTPUT",deviceId:d.deviceId,paneId:d.paneId,data:d.data});return}case KA:return}}),r.onError(l=>{console.error("[tmux] borsh ws error:",l),e({socketReady:!1}),_d.error("WebSocket Connection Error",{description:"Please check Gateway status"})}),r.onStateChange(l=>{if(l!=="READY")return;const u=t().connectedDevices;for(const d of u){if(zE(d))continue;const m=LE(d);r.send(m.kind,m.payload)}});let s=xc.getState().theme;xc.subscribe(l=>{if(l.theme===s)return;s=l.theme;const u=t();for(const d of u.connectedDevices)u.deviceConnected[d]&&$m(d)})}function o_(e,t){if(t.type==="error"){const r=t.message??"Device Error",i=t.errorType??"unknown";if(i==="reconnecting"){e(s=>({deviceReconnecting:{...s.deviceReconnecting,[t.deviceId]:{message:r,at:Date.now()}}}));return}e(s=>{const l=s.deviceErrors[t.deviceId];return(!l||l.type!==i)&&_d.error(r),{deviceErrors:{...s.deviceErrors,[t.deviceId]:{message:r,type:i,rawMessage:t.rawMessage,at:Date.now()}},deviceReconnecting:{...s.deviceReconnecting,[t.deviceId]:void 0}}});return}if(t.type==="disconnected"){Sc().cleanup(t.deviceId),e(r=>({deviceConnected:{...r.deviceConnected,[t.deviceId]:!1}}));return}t.type==="reconnected"&&e(r=>({deviceConnected:{...r.deviceConnected,[t.deviceId]:!0},deviceErrors:{...r.deviceErrors,[t.deviceId]:void 0},deviceReconnecting:{...r.deviceReconnecting,[t.deviceId]:void 0}}))}function s_(e,t){if(t.type==="bell"){console.log("[tmex] bell",t.data);const r=qs.getState().settings;if((r==null?void 0:r.enableBrowserBellToast)===!1)return;const i=t.data??{},s="Terminal Bell",l=[typeof i.windowIndex=="number"?`Window ${i.windowIndex}`:void 0,typeof i.paneIndex=="number"?`Pane ${i.paneIndex}`:void 0].filter(Boolean).join(" · "),u=typeof i.paneUrl=="string"?i.paneUrl:void 0;_d(s,{description:l||"Received tmux bell",action:u?{label:"Open",onClick:()=>{window.location.href=u}}:void 0})}if(t.type==="notification"){console.log("[tmex] notification",t.data);const r=qs.getState().settings;if((r==null?void 0:r.enableBrowserNotificationToast)===!1)return;const i=t.data??{},{title:s,description:l}=e_(i),u=typeof i.paneUrl=="string"?i.paneUrl:void 0;_d(s,{description:l,action:u?{label:"Open",onClick:()=>{window.location.href=u}}:void 0})}if(t.type==="pane-active"){const r=t.data;r!=null&&r.windowId&&(r!=null&&r.paneId)&&e(i=>({activePaneFromEvent:{...i.activePaneFromEvent,[t.deviceId]:{windowId:r.windowId,paneId:r.paneId}}}))}}const Vn=Og((e,t)=>({socketReady:!1,snapshots:{},connectedDevices:new Set,deviceConnected:{},deviceErrors:{},deviceReconnecting:{},selectedPanes:{},activePaneFromEvent:{},pendingCreateWindowAt:{},ensureSocketConnected(){i_(e,t),$n().connect()},connectDevice(r){if(!r||(e(s=>{const l=new Set(s.connectedDevices);return l.add(r),{connectedDevices:l}}),t().ensureSocketConnected(),zE(r)))return;const i=LE(r);$n().send(i.kind,i.payload)},disconnectDevice(r){if(!r)return;e(s=>{const l=new Set(s.connectedDevices);return l.delete(r),{connectedDevices:l}}),Sc().cleanup(r);const i=Uk(r);$n().send(i.kind,i.payload)},clearDeviceError(r){e(i=>({deviceErrors:{...i.deviceErrors,[r]:void 0},deviceReconnecting:{...i.deviceReconnecting,[r]:void 0}}))},hydrateDeviceErrors(r){e(i=>{const s={...i.deviceErrors};for(const l of r)s[l.deviceId]||!l.lastError||!l.lastErrorType||(s[l.deviceId]={message:l.lastError,type:l.lastErrorType,at:0});return{deviceErrors:s}})},selectPane(r,i,s,l){if(!r||!i||!s)return;e(y=>({selectedPanes:{...y.selectedPanes,[r]:{windowId:i,paneId:s}}}));const u=Ik(),d=!0;Sc().dispatch({type:"SELECT_START",deviceId:r,windowId:i,paneId:s,selectToken:u,wantHistory:d});const m=Qm(l==null?void 0:l.cols,l==null?void 0:l.rows)??Wm.get(r)??null,f=jk({deviceId:r,windowId:i,paneId:s,selectToken:u,wantHistory:d,cols:m==null?void 0:m.cols,rows:m==null?void 0:m.rows});$n().send(f.kind,f.payload)},selectWindow(r,i){if(!r||!i)return;const s=Hk(r,i);$n().send(s.kind,s.payload)},sendInput(r,i,s,l=!1){if(!r||!i)return;const u=Gk(r,i,s,l);$n().send(u.kind,u.payload)},resizePane(r,i,s,l){if(!r||!i)return;const u=Qm(s,l);u&&Wm.set(r,{...u,at:Date.now()});const d=Xk(r,i,s,l);$n().send(d.kind,d.payload)},syncPaneSize(r,i,s,l){if(!r||!i)return;const u=Qm(s,l);u&&Wm.set(r,{...u,at:Date.now()});const d=Wk(r,i,s,l);$n().send(d.kind,d.payload)},paste(r,i,s){if(!r||!i)return;const l=Kk(r,i,s);$n().send(l.kind,l.payload)},createWindow(r,i){if(!r)return;const s=Bk(r,i);$n().send(s.kind,s.payload),e(l=>({pendingCreateWindowAt:{...l.pendingCreateWindowAt,[r]:Date.now()}}))},clearPendingCreateWindow(r){r&&e(i=>{if(i.pendingCreateWindowAt[r]===void 0)return i;const s={...i.pendingCreateWindowAt};return delete s[r],{pendingCreateWindowAt:s}})},closeWindow(r,i){if(!r||!i)return;const s=Fk(r,i);$n().send(s.kind,s.payload)},closePane(r,i){if(!r||!i)return;const s=Vk(r,i);$n().send(s.kind,s.payload)},renameWindow(r,i,s){if(!r||!i)return;const l=Yk(r,i,s);$n().send(l.kind,l.payload)}})),SS="tmex:connectedDevices",PE=w.createContext(null);function l_(){const e=w.useContext(PE);if(!e)throw new Error("useGlobalDevice must be used within GlobalDeviceProvider");return e}function c_({children:e}){const t=Wa(),[r,i]=w.useState(()=>{try{const p=localStorage.getItem(SS);if(p){const v=JSON.parse(p);return new Set(v)}}catch{}return new Set}),s=Vn(p=>p.connectDevice),l=Vn(p=>p.disconnectDevice),u=Vn(p=>p.connectedDevices);w.useEffect(()=>{try{localStorage.setItem(SS,JSON.stringify([...r]))}catch{}},[r]),w.useEffect(()=>{const p=t.pathname.match(/^\/devices\/([^/]+)/),v=p==null?void 0:p[1];v&&!u.has(v)&&s(v)},[t.pathname,u,s]);const d=w.useCallback(p=>{i(v=>{const b=new Set(v);return b.add(p),b}),u.has(p)||s(p)},[u,s]),m=w.useCallback(p=>{i(v=>{const b=new Set(v);return b.delete(p),b}),u.has(p)&&l(p)},[u,l]),f=w.useCallback((p,v)=>{v?m(p):d(p)},[d,m]),y=w.useMemo(()=>({persistedDevices:r,connectDevice:d,disconnectDevice:m,toggleDevice:f}),[r,d,m,f]);return I.jsx(PE.Provider,{value:y,children:e})}/**
87
- * @license lucide-react v0.564.0 - ISC
88
- *
89
- * This source code is licensed under the ISC license.
90
- * See the LICENSE file in the root directory of this source tree.
91
- */const IE=(...e)=>e.filter((t,r,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===r).join(" ").trim();/**
92
- * @license lucide-react v0.564.0 - ISC
93
- *
94
- * This source code is licensed under the ISC license.
95
- * See the LICENSE file in the root directory of this source tree.
96
- */const u_=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
97
- * @license lucide-react v0.564.0 - ISC
98
- *
99
- * This source code is licensed under the ISC license.
100
- * See the LICENSE file in the root directory of this source tree.
101
- */const d_=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,i)=>i?i.toUpperCase():r.toLowerCase());/**
102
- * @license lucide-react v0.564.0 - ISC
103
- *
104
- * This source code is licensed under the ISC license.
105
- * See the LICENSE file in the root directory of this source tree.
106
- */const xS=e=>{const t=d_(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
107
- * @license lucide-react v0.564.0 - ISC
108
- *
109
- * This source code is licensed under the ISC license.
110
- * See the LICENSE file in the root directory of this source tree.
111
- */var f_={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
112
- * @license lucide-react v0.564.0 - ISC
113
- *
114
- * This source code is licensed under the ISC license.
115
- * See the LICENSE file in the root directory of this source tree.
116
- */const h_=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
117
- * @license lucide-react v0.564.0 - ISC
118
- *
119
- * This source code is licensed under the ISC license.
120
- * See the LICENSE file in the root directory of this source tree.
121
- */const m_=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:s="",children:l,iconNode:u,...d},m)=>w.createElement("svg",{ref:m,...f_,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:IE("lucide",s),...!l&&!h_(d)&&{"aria-hidden":"true"},...d},[...u.map(([f,y])=>w.createElement(f,y)),...Array.isArray(l)?l:[l]]));/**
122
- * @license lucide-react v0.564.0 - ISC
123
- *
124
- * This source code is licensed under the ISC license.
125
- * See the LICENSE file in the root directory of this source tree.
126
- */const ar=(e,t)=>{const r=w.forwardRef(({className:i,...s},l)=>w.createElement(m_,{ref:l,iconNode:t,className:IE(`lucide-${u_(xS(e))}`,`lucide-${e}`,i),...s}));return r.displayName=xS(e),r};/**
127
- * @license lucide-react v0.564.0 - ISC
128
- *
129
- * This source code is licensed under the ISC license.
130
- * See the LICENSE file in the root directory of this source tree.
131
- */const p_=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],g_=ar("chevron-right",p_);/**
132
- * @license lucide-react v0.564.0 - ISC
133
- *
134
- * This source code is licensed under the ISC license.
135
- * See the LICENSE file in the root directory of this source tree.
136
- */const y_=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],v_=ar("circle-alert",y_);/**
137
- * @license lucide-react v0.564.0 - ISC
138
- *
139
- * This source code is licensed under the ISC license.
140
- * See the LICENSE file in the root directory of this source tree.
141
- */const b_=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],w_=ar("ellipsis-vertical",b_);/**
142
- * @license lucide-react v0.564.0 - ISC
143
- *
144
- * This source code is licensed under the ISC license.
145
- * See the LICENSE file in the root directory of this source tree.
146
- */const S_=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],x_=ar("globe",S_);/**
147
- * @license lucide-react v0.564.0 - ISC
148
- *
149
- * This source code is licensed under the ISC license.
150
- * See the LICENSE file in the root directory of this source tree.
151
- */const E_=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],UE=ar("monitor",E_);/**
152
- * @license lucide-react v0.564.0 - ISC
153
- *
154
- * This source code is licensed under the ISC license.
155
- * See the LICENSE file in the root directory of this source tree.
156
- */const R_=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],T_=ar("moon",R_);/**
157
- * @license lucide-react v0.564.0 - ISC
158
- *
159
- * This source code is licensed under the ISC license.
160
- * See the LICENSE file in the root directory of this source tree.
161
- */const C_=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],O_=ar("panel-left",C_);/**
162
- * @license lucide-react v0.564.0 - ISC
163
- *
164
- * This source code is licensed under the ISC license.
165
- * See the LICENSE file in the root directory of this source tree.
166
- */const M_=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],D_=ar("pencil",M_);/**
167
- * @license lucide-react v0.564.0 - ISC
168
- *
169
- * This source code is licensed under the ISC license.
170
- * See the LICENSE file in the root directory of this source tree.
171
- */const A_=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],N_=ar("plus",A_);/**
172
- * @license lucide-react v0.564.0 - ISC
173
- *
174
- * This source code is licensed under the ISC license.
175
- * See the LICENSE file in the root directory of this source tree.
176
- */const k_=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],__=ar("power-off",k_);/**
177
- * @license lucide-react v0.564.0 - ISC
178
- *
179
- * This source code is licensed under the ISC license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */const L_=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],z_=ar("power",L_);/**
182
- * @license lucide-react v0.564.0 - ISC
183
- *
184
- * This source code is licensed under the ISC license.
185
- * See the LICENSE file in the root directory of this source tree.
186
- */const P_=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],I_=ar("refresh-ccw",P_);/**
187
- * @license lucide-react v0.564.0 - ISC
188
- *
189
- * This source code is licensed under the ISC license.
190
- * See the LICENSE file in the root directory of this source tree.
191
- */const U_=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],j_=ar("settings",U_);/**
192
- * @license lucide-react v0.564.0 - ISC
193
- *
194
- * This source code is licensed under the ISC license.
195
- * See the LICENSE file in the root directory of this source tree.
196
- */const H_=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],B_=ar("sun",H_);/**
197
- * @license lucide-react v0.564.0 - ISC
198
- *
199
- * This source code is licensed under the ISC license.
200
- * See the LICENSE file in the root directory of this source tree.
201
- */const F_=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],zc=ar("x",F_),ES={};function _n(e,t){const r=w.useRef(ES);return r.current===ES&&(r.current=e(t)),r}const Zm=dg[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],V_=Zm&&Zm!==w.useLayoutEffect?Zm:e=>e();function ze(e){const t=_n(Y_).current;return t.next=e,V_(t.effect),t.trampoline}function Y_(){const e={next:void 0,callback:q_,trampoline:(...t)=>{var r;return(r=e.callback)==null?void 0:r.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function q_(){}function Ln(e,...t){const r=new URL("https://base-ui.com/production-error");return r.searchParams.set("code",e.toString()),t.forEach(i=>r.searchParams.append("args[]",i)),`Base UI error #${e}; visit ${r} for the full message.`}function ko(e,t,r,i){const s=_n(jE).current;return K_(s,e,t,r,i)&&HE(s,[e,t,r,i]),s.callback}function G_(e){const t=_n(jE).current;return X_(t,e)&&HE(t,e),t.callback}function jE(){return{callback:null,cleanup:null,refs:[]}}function K_(e,t,r,i,s){return e.refs[0]!==t||e.refs[1]!==r||e.refs[2]!==i||e.refs[3]!==s}function X_(e,t){return e.refs.length!==t.length||e.refs.some((r,i)=>r!==t[i])}function HE(e,t){if(e.refs=t,t.every(r=>r==null)){e.callback=null;return}e.callback=r=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),r!=null){const i=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const l=t[s];if(l!=null)switch(typeof l){case"function":{const u=l(r);typeof u=="function"&&(i[s]=u);break}case"object":{l.current=r;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const l=t[s];if(l!=null)switch(typeof l){case"function":{const u=i[s];typeof u=="function"?u():l(null);break}case"object":{l.current=null;break}}}}}}}const W_=parseInt(w.version,10);function Mg(e){return W_>=e}function RS(e){if(!w.isValidElement(e))return null;const t=e,r=t.props;return(Mg(19)?r==null?void 0:r.ref:t.ref)??null}function Bp(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function $_(e,t){const r={};for(const i in e){const s=e[i];if(t!=null&&t.hasOwnProperty(i)){const l=t[i](s);l!=null&&Object.assign(r,l);continue}s===!0?r[`data-${i.toLowerCase()}`]="":s&&(r[`data-${i.toLowerCase()}`]=s.toString())}return r}function Q_(e,t){return typeof e=="function"?e(t):e}function Z_(e,t){return typeof e=="function"?e(t):e}const lc={};function wa(e,t,r,i,s){let l={...Fp(e,lc)};return t&&(l=ac(l,t)),r&&(l=ac(l,r)),i&&(l=ac(l,i)),s&&(l=ac(l,s)),l}function J_(e){if(e.length===0)return lc;if(e.length===1)return Fp(e[0],lc);let t={...Fp(e[0],lc)};for(let r=1;r<e.length;r+=1)t=ac(t,e[r]);return t}function ac(e,t){return BE(t)?t(e):eL(e,t)}function eL(e,t){if(!t)return e;for(const r in t){const i=t[r];switch(r){case"style":{e[r]=Bp(e.style,i);break}case"className":{e[r]=FE(e.className,i);break}default:tL(r,i)?e[r]=nL(e[r],i):e[r]=i}}return e}function tL(e,t){const r=e.charCodeAt(0),i=e.charCodeAt(1),s=e.charCodeAt(2);return r===111&&i===110&&s>=65&&s<=90&&(typeof t=="function"||typeof t>"u")}function BE(e){return typeof e=="function"}function Fp(e,t){return BE(e)?e(t):e??lc}function nL(e,t){return t?e?r=>{if(rL(r)){const s=r;Vp(s);const l=t(s);return s.baseUIHandlerPrevented||e==null||e(s),l}const i=t(r);return e==null||e(r),i}:t:e}function Vp(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function FE(e,t){return t?e?t+" "+e:t:e}function rL(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function pr(){}const Yp=Object.freeze([]),xn=Object.freeze({}),aL=500,iL=500,oL={style:{transition:"none"}},sL="data-base-ui-click-trigger",lL={fallbackAxisSide:"none"},VE={fallbackAxisSide:"end"},cL={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Qt(e,t,r={}){const i=t.render,s=uL(t,r);if(r.enabled===!1)return null;const l=r.state??xn;return fL(e,i,s,l)}function uL(e,t={}){const{className:r,style:i,render:s}=e,{state:l=xn,ref:u,props:d,stateAttributesMapping:m,enabled:f=!0}=t,y=f?Q_(r,l):void 0,p=f?Z_(i,l):void 0,v=f?$_(l,m):xn,b=f?Bp(v,Array.isArray(d)?J_(d):d)??xn:xn;return typeof document<"u"&&(f?Array.isArray(u)?b.ref=G_([b.ref,RS(s),...u]):b.ref=ko(b.ref,RS(s),u):ko(null,null)),f?(y!==void 0&&(b.className=FE(b.className,y)),p!==void 0&&(b.style=Bp(b.style,p)),b):xn}const dL=Symbol.for("react.lazy");function fL(e,t,r,i){if(t){if(typeof t=="function")return t(r,i);const s=wa(r,t.props);s.ref=r.ref;let l=t;return(l==null?void 0:l.$$typeof)===dL&&(l=w.Children.toArray(t)[0]),w.cloneElement(l,s)}if(e&&typeof e=="string")return hL(e,r);throw new Error(Ln(8))}function hL(e,t){return e==="button"?w.createElement("button",{type:"button",...t,key:t.key}):e==="img"?w.createElement("img",{alt:"",...t,key:t.key}):w.createElement(e,t)}function YE({controlled:e,default:t,name:r,state:i="value"}){const{current:s}=w.useRef(e!==void 0),[l,u]=w.useState(t),d=s?e:l,m=w.useCallback(f=>{s||u(f)},[]);return[d,m]}const mL=()=>{},_e=typeof document<"u"?w.useLayoutEffect:mL,pL={...dg};let TS=0;function gL(e,t="mui"){const[r,i]=w.useState(e),s=e||r;return w.useEffect(()=>{r==null&&(TS+=1,i(`${t}-${TS}`))},[r,t]),s}const CS=pL.useId;function Uo(e,t){if(CS!==void 0){const r=CS();return e??(t?`${t}-${r}`:r)}return gL(e,t)}function Hi(e){return Uo(e,"base-ui")}const Pc="none",_o="trigger-press",Zn="trigger-hover",Ms="trigger-focus",Dg="outside-press",qE="item-press",yL="close-press",Gs="focus-out",nf="escape-key",Od="list-navigation",vL="cancel-open",Md="sibling-open",bL="disabled",Ag="imperative-action",$j="window-resize";function pt(e,t,r,i){let s=!1,l=!1;const u=xn;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){l=!0},get isCanceled(){return s},get isPropagationAllowed(){return l},trigger:r,...u}}const wL=[];function rf(e){w.useEffect(e,wL)}const ld=null;class SL{constructor(){Be(this,"callbacks",[]);Be(this,"callbacksCount",0);Be(this,"nextId",1);Be(this,"startId",1);Be(this,"isScheduled",!1);Be(this,"tick",t=>{var s;this.isScheduled=!1;const r=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let l=0;l<r.length;l+=1)(s=r[l])==null||s.call(r,t)})}request(t){const r=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),r}cancel(t){const r=t-this.startId;r<0||r>=this.callbacks.length||(this.callbacks[r]=null,this.callbacksCount-=1)}}const cd=new SL;class mn{constructor(){Be(this,"currentId",ld);Be(this,"cancel",()=>{this.currentId!==ld&&(cd.cancel(this.currentId),this.currentId=ld)});Be(this,"disposeEffect",()=>this.cancel)}static create(){return new mn}static request(t){return cd.request(t)}static cancel(t){return cd.cancel(t)}request(t){this.cancel(),this.currentId=cd.request(()=>{this.currentId=ld,t()})}}function af(){const e=_n(mn.create).current;return rf(e.disposeEffect),e}function qa(e){return e==null?e:"current"in e?e.current:e}let Lo=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const xL={[Lo.startingStyle]:""},EL={[Lo.endingStyle]:""},Zs={transitionStatus(e){return e==="starting"?xL:e==="ending"?EL:null}};function GE(e,t=!1,r=!0){const i=af();return ze((s,l=null)=>{i.cancel();function u(){ra.flushSync(s)}const d=qa(e);if(d==null)return;const m=d;if(typeof m.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)s();else{let f=function(){const p=Lo.startingStyle;if(!m.hasAttribute(p)){i.request(y);return}const v=new MutationObserver(()=>{m.hasAttribute(p)||(v.disconnect(),y())});v.observe(m,{attributes:!0,attributeFilter:[p]}),l==null||l.addEventListener("abort",()=>v.disconnect(),{once:!0})},y=function(){Promise.all(m.getAnimations().map(p=>p.finished)).then(()=>{l!=null&&l.aborted||u()}).catch(()=>{const p=m.getAnimations();if(r){if(l!=null&&l.aborted)return;u()}else p.length>0&&p.some(v=>v.pending||v.playState!=="finished")&&y()})};if(t){f();return}i.request(y)}})}function KE(e,t=!1,r=!1){const[i,s]=w.useState(e&&t?"idle":void 0),[l,u]=w.useState(e);return e&&!l&&(u(!0),s("starting")),!e&&l&&i!=="ending"&&!r&&s("ending"),!e&&!l&&i==="ending"&&s(void 0),_e(()=>{if(!e&&l&&i!=="ending"&&r){const d=mn.request(()=>{s("ending")});return()=>{mn.cancel(d)}}},[e,l,i,r]),_e(()=>{if(!e||t)return;const d=mn.request(()=>{s(void 0)});return()=>{mn.cancel(d)}},[t,e]),_e(()=>{if(!e||!t)return;e&&l&&i!=="idle"&&s("starting");const d=mn.request(()=>{s("idle")});return()=>{mn.cancel(d)}},[t,e,l,s,i]),w.useMemo(()=>({mounted:l,setMounted:u,transitionStatus:i}),[l,i])}function RL(e){const{open:t,defaultOpen:r,onOpenChange:i,disabled:s}=e,l=t!==void 0,[u,d]=YE({controlled:t,default:r,name:"Collapsible",state:"open"}),{mounted:m,setMounted:f,transitionStatus:y}=KE(u,!0,!0),[p,v]=w.useState(u),[{height:b,width:S},x]=w.useState({height:void 0,width:void 0}),R=Hi(),[T,M]=w.useState(),D=T??R,[C,N]=w.useState(!1),[k,O]=w.useState(!1),L=w.useRef(null),G=w.useRef(null),J=w.useRef(null),Z=w.useRef(null),z=GE(Z,!1),H=ze(V=>{const q=!u,_=pt(_o,V.nativeEvent);if(i(q,_),_.isCanceled)return;const j=Z.current;G.current==="css-animation"&&j!=null&&j.style.removeProperty("animation-name"),!C&&!k&&(G.current!=null&&G.current!=="css-animation"&&!m&&q&&f(!0),G.current==="css-animation"&&(!p&&q&&v(!0),!m&&q&&f(!0))),d(q),G.current==="none"&&m&&!q&&f(!1)});return _e(()=>{l&&G.current==="none"&&!k&&!u&&f(!1)},[l,k,u,t,f]),w.useMemo(()=>({abortControllerRef:L,animationTypeRef:G,disabled:s,handleTrigger:H,height:b,mounted:m,open:u,panelId:D,panelRef:Z,runOnceAnimationsFinish:z,setDimensions:x,setHiddenUntilFound:N,setKeepMounted:O,setMounted:f,setOpen:d,setPanelIdState:M,setVisible:v,transitionDimensionRef:J,transitionStatus:y,visible:p,width:S}),[L,G,s,H,b,m,u,D,Z,z,x,N,O,f,d,v,J,y,p,S])}const XE=w.createContext(void 0);function WE(){const e=w.useContext(XE);if(e===void 0)throw new Error(Ln(15));return e}let cc=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Lo.startingStyle]="startingStyle",e[e.endingStyle=Lo.endingStyle]="endingStyle",e})({}),TL=(function(e){return e.panelOpen="data-panel-open",e})({});const CL={[cc.open]:""},OL={[cc.closed]:""},ML={open(e){return e?{[TL.panelOpen]:""}:null}},DL={open(e){return e?CL:OL}},$E={...DL,...Zs},AL=w.forwardRef(function(t,r){const{render:i,className:s,defaultOpen:l=!1,disabled:u=!1,onOpenChange:d,open:m,...f}=t,y=ze(d),p=RL({open:m,defaultOpen:l,onOpenChange:y,disabled:u}),v=w.useMemo(()=>({open:p.open,disabled:p.disabled,transitionStatus:p.transitionStatus}),[p.open,p.disabled,p.transitionStatus]),b=w.useMemo(()=>({...p,onOpenChange:y,state:v}),[p,y,v]),S=Qt("div",t,{state:v,ref:r,props:f,stateAttributesMapping:$E});return I.jsx(XE.Provider,{value:b,children:S})});function of(){return typeof window<"u"}function Bi(e){return Ng(e)?(e.nodeName||"").toLowerCase():"#document"}function Rn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ea(e){var t;return(t=(Ng(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ng(e){return of()?e instanceof Node||e instanceof Rn(e).Node:!1}function zt(e){return of()?e instanceof Element||e instanceof Rn(e).Element:!1}function on(e){return of()?e instanceof HTMLElement||e instanceof Rn(e).HTMLElement:!1}function qp(e){return!of()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Rn(e).ShadowRoot}const NL=new Set(["inline","contents"]);function Fi(e){const{overflow:t,overflowX:r,overflowY:i,display:s}=Mr(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+r)&&!NL.has(s)}const kL=new Set(["table","td","th"]);function _L(e){return kL.has(Bi(e))}const LL=[":popover-open",":modal"];function sf(e){return LL.some(t=>{try{return e.matches(t)}catch{return!1}})}const zL=["transform","translate","scale","rotate","perspective"],PL=["transform","translate","scale","rotate","perspective","filter"],IL=["paint","layout","strict","content"];function kg(e){const t=lf(),r=zt(e)?Mr(e):e;return zL.some(i=>r[i]?r[i]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||PL.some(i=>(r.willChange||"").includes(i))||IL.some(i=>(r.contain||"").includes(i))}function UL(e){let t=Sa(e);for(;on(t)&&!ga(t);){if(kg(t))return t;if(sf(t))return null;t=Sa(t)}return null}function lf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const jL=new Set(["html","body","#document"]);function ga(e){return jL.has(Bi(e))}function Mr(e){return Rn(e).getComputedStyle(e)}function cf(e){return zt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Sa(e){if(Bi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qp(e)&&e.host||Ea(e);return qp(t)?t.host:t}function QE(e){const t=Sa(e);return ga(t)?e.ownerDocument?e.ownerDocument.body:e.body:on(t)&&Fi(t)?t:QE(t)}function Pi(e,t,r){var i;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=QE(e),l=s===((i=e.ownerDocument)==null?void 0:i.body),u=Rn(s);if(l){const d=Gp(u);return t.concat(u,u.visualViewport||[],Fi(s)?s:[],d&&r?Pi(d):[])}return t.concat(s,Pi(s,[],r))}function Gp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const HL=w.createContext(void 0);function _g(e=!1){const t=w.useContext(HL);if(t===void 0&&!e)throw new Error(Ln(16));return t}function BL(e){const{focusableWhenDisabled:t,disabled:r,composite:i=!1,tabIndex:s=0,isNativeButton:l}=e,u=i&&t!==!1,d=i&&t===!1;return{props:w.useMemo(()=>{const f={onKeyDown(y){r&&t&&y.key!=="Tab"&&y.preventDefault()}};return i||(f.tabIndex=s,!l&&r&&(f.tabIndex=t?s:-1)),(l&&(t||u)||!l&&r)&&(f["aria-disabled"]=r),l&&(!t||d)&&(f.disabled=r),f},[i,r,t,u,d,l,s])}}function Ic(e={}){const{disabled:t=!1,focusableWhenDisabled:r,tabIndex:i=0,native:s=!0}=e,l=w.useRef(null),u=_g(!0)!==void 0,d=ze(()=>{const v=l.current;return!!((v==null?void 0:v.tagName)==="A"&&(v!=null&&v.href))}),{props:m}=BL({focusableWhenDisabled:r,disabled:t,composite:u,tabIndex:i,isNativeButton:s}),f=w.useCallback(()=>{const v=l.current;FL(v)&&u&&t&&m.disabled===void 0&&v.disabled&&(v.disabled=!1)},[t,m.disabled,u]);_e(f,[f]);const y=w.useCallback((v={})=>{const{onClick:b,onMouseDown:S,onKeyUp:x,onKeyDown:R,onPointerDown:T,...M}=v;return wa({type:s?"button":void 0,onClick(C){if(t){C.preventDefault();return}b==null||b(C)},onMouseDown(C){t||S==null||S(C)},onKeyDown(C){if(t||(Vp(C),R==null||R(C)),C.baseUIHandlerPrevented)return;const N=C.target===C.currentTarget&&!s&&!d()&&!t,k=C.key==="Enter",O=C.key===" ";N&&((O||k)&&C.preventDefault(),k&&(b==null||b(C)))},onKeyUp(C){t||(Vp(C),x==null||x(C)),!C.baseUIHandlerPrevented&&C.target===C.currentTarget&&!s&&!t&&C.key===" "&&(b==null||b(C))},onPointerDown(C){if(t){C.preventDefault();return}T==null||T(C)}},s?void 0:{role:"button"},m,M)},[t,m,s,d]),p=ze(v=>{l.current=v,f()});return{getButtonProps:y,buttonRef:p}}function FL(e){return on(e)&&e.tagName==="BUTTON"}const VL={...ML,...Zs},YL=w.forwardRef(function(t,r){const{panelId:i,open:s,handleTrigger:l,state:u,disabled:d}=WE(),{className:m,disabled:f=d,id:y,render:p,nativeButton:v=!0,...b}=t,{getButtonProps:S,buttonRef:x}=Ic({disabled:f,focusableWhenDisabled:!0,native:v}),R=w.useMemo(()=>({"aria-controls":s?i:void 0,"aria-expanded":s,onClick:l}),[i,s,l]);return Qt("button",t,{state:u,ref:[r,x],props:[R,b,S],stateAttributesMapping:VL})});let qL=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e})({});function GL(e){const{abortControllerRef:t,animationTypeRef:r,externalRef:i,height:s,hiddenUntilFound:l,keepMounted:u,id:d,mounted:m,onOpenChange:f,open:y,panelRef:p,runOnceAnimationsFinish:v,setDimensions:b,setMounted:S,setOpen:x,setVisible:R,transitionDimensionRef:T,visible:M,width:D}=e,C=w.useRef(!1),N=w.useRef(null),k=w.useRef(y),O=w.useRef(y),L=af(),G=w.useMemo(()=>r.current==="css-animation"?!M:!y&&!m,[y,m,M,r]),J=ze(z=>{if(!z)return;if(r.current==null||T.current==null){const q=getComputedStyle(z),_=q.animationName!=="none"&&q.animationName!=="",j=q.transitionDuration!=="0s"&&q.transitionDuration!=="";_&&j||(q.animationName==="none"&&q.transitionDuration!=="0s"?r.current="css-transition":q.animationName!=="none"&&q.transitionDuration==="0s"?r.current="css-animation":r.current="none"),z.getAttribute(qL.orientation)==="horizontal"||q.transitionProperty.indexOf("width")>-1?T.current="width":T.current="height"}if(r.current!=="css-transition")return;(s===void 0||D===void 0)&&(b({height:z.scrollHeight,width:z.scrollWidth}),O.current&&z.style.setProperty("transition-duration","0s"));let H=-1,V=-1;return H=mn.request(()=>{O.current=!1,V=mn.request(()=>{setTimeout(()=>{z.style.removeProperty("transition-duration")})})}),()=>{mn.cancel(H),mn.cancel(V)}}),Z=ko(i,p,J);return _e(()=>{if(r.current!=="css-transition")return;const z=p.current;if(!z)return;let H=-1;if(t.current!=null&&(t.current.abort(),t.current=null),y){const V={"justify-content":z.style.justifyContent,"align-items":z.style.alignItems,"align-content":z.style.alignContent,"justify-items":z.style.justifyItems};Object.keys(V).forEach(q=>{z.style.setProperty(q,"initial","important")}),!O.current&&!u&&z.setAttribute(cc.startingStyle,""),b({height:z.scrollHeight,width:z.scrollWidth}),H=mn.request(()=>{Object.entries(V).forEach(([q,_])=>{_===""?z.style.removeProperty(q):z.style.setProperty(q,_)})})}else{if(z.scrollHeight===0&&z.scrollWidth===0)return;b({height:z.scrollHeight,width:z.scrollWidth});const V=new AbortController;t.current=V;const q=V.signal;let _=null;const j=cc.endingStyle;return _=new MutationObserver(U=>{U.some(ae=>ae.type==="attributes"&&ae.attributeName===j)&&(_==null||_.disconnect(),_=null,v(()=>{b({height:0,width:0}),z.style.removeProperty("content-visibility"),S(!1),t.current===V&&(t.current=null)},q))}),_.observe(z,{attributes:!0,attributeFilter:[j]}),()=>{_==null||_.disconnect(),L.cancel(),t.current===V&&(V.abort(),t.current=null)}}return()=>{mn.cancel(H)}},[t,r,L,l,u,m,y,p,v,b,S]),_e(()=>{if(r.current!=="css-animation")return;const z=p.current;z&&(N.current=z.style.animationName||N.current,z.style.setProperty("animation-name","none"),b({height:z.scrollHeight,width:z.scrollWidth}),!k.current&&!C.current&&z.style.removeProperty("animation-name"),y?(t.current!=null&&(t.current.abort(),t.current=null),S(!0),R(!0)):(t.current=new AbortController,v(()=>{S(!1),R(!1),t.current=null},t.current.signal)))},[t,r,y,p,v,b,S,R,M]),rf(()=>{const z=mn.request(()=>{k.current=!1});return()=>mn.cancel(z)}),_e(()=>{if(!l)return;const z=p.current;if(!z)return;let H=-1,V=-1;return y&&C.current&&(z.style.transitionDuration="0s",b({height:z.scrollHeight,width:z.scrollWidth}),H=mn.request(()=>{C.current=!1,V=mn.request(()=>{setTimeout(()=>{z.style.removeProperty("transition-duration")})})})),()=>{mn.cancel(H),mn.cancel(V)}},[l,y,p,b]),_e(()=>{const z=p.current;z&&l&&G&&(z.setAttribute("hidden","until-found"),r.current==="css-transition"&&z.setAttribute(cc.startingStyle,""))},[l,G,r,p]),w.useEffect(function(){const H=p.current;if(!H)return;function V(q){C.current=!0,x(!0),f(!0,pt(Pc,q))}return H.addEventListener("beforematch",V),()=>{H.removeEventListener("beforematch",V)}},[f,p,x]),w.useMemo(()=>({props:{hidden:G,id:d,ref:Z}}),[G,d,Z])}let OS=(function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e})({});function Uc(e){const{enabled:t=!0,open:r,ref:i,onComplete:s}=e,l=ze(s),u=GE(i,r,!1);w.useEffect(()=>{if(!t)return;const d=new AbortController;return u(l,d.signal),()=>{d.abort()}},[t,r,l,u])}const KL=w.forwardRef(function(t,r){const{className:i,hiddenUntilFound:s,keepMounted:l,render:u,id:d,...m}=t,{abortControllerRef:f,animationTypeRef:y,height:p,mounted:v,onOpenChange:b,open:S,panelId:x,panelRef:R,runOnceAnimationsFinish:T,setDimensions:M,setHiddenUntilFound:D,setKeepMounted:C,setMounted:N,setPanelIdState:k,setOpen:O,setVisible:L,state:G,transitionDimensionRef:J,visible:Z,width:z,transitionStatus:H}=WE(),V=s??!1,q=l??!1;_e(()=>{if(d)return k(d),()=>{k(void 0)}},[d,k]),_e(()=>{D(V)},[D,V]),_e(()=>{C(q)},[C,q]);const{props:_}=GL({abortControllerRef:f,animationTypeRef:y,externalRef:r,height:p,hiddenUntilFound:V,id:x,keepMounted:q,mounted:v,onOpenChange:b,open:S,panelRef:R,runOnceAnimationsFinish:T,setDimensions:M,setMounted:N,setOpen:O,setVisible:L,transitionDimensionRef:J,visible:Z,width:z});Uc({open:S&&H==="idle",ref:R,onComplete(){S&&M({height:void 0,width:void 0})}});const j=w.useMemo(()=>({...G,transitionStatus:H}),[G,H]),U=Qt("div",t,{state:j,ref:[r,R],props:[_,{style:{[OS.collapsiblePanelHeight]:p===void 0?"auto":`${p}px`,[OS.collapsiblePanelWidth]:z===void 0?"auto":`${z}px`}},m],stateAttributesMapping:$E});return q||V||!q&&v?U:null});function XL({...e}){return I.jsx(AL,{"data-slot":"collapsible",...e})}function WL({...e}){return I.jsx(YL,{"data-slot":"collapsible-trigger",...e})}function $L({...e}){return I.jsx(KL,{"data-slot":"collapsible-content",...e})}function jc(e){return Qt(e.defaultTagName??"div",e,e)}function ZE(e){var t,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=ZE(e[t]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function JE(){for(var e,t,r=0,i="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=ZE(e))&&(i&&(i+=" "),i+=t);return i}const MS=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,DS=JE,Lg=(e,t)=>r=>{var i;if((t==null?void 0:t.variants)==null)return DS(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:l}=t,u=Object.keys(s).map(f=>{const y=r==null?void 0:r[f],p=l==null?void 0:l[f];if(y===null)return null;const v=MS(y)||MS(p);return s[f][v]}),d=r&&Object.entries(r).reduce((f,y)=>{let[p,v]=y;return v===void 0||(f[p]=v),f},{}),m=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((f,y)=>{let{class:p,className:v,...b}=y;return Object.entries(b).every(S=>{let[x,R]=S;return Array.isArray(R)?R.includes({...l,...d}[x]):{...l,...d}[x]===R})?[...f,p,v]:f},[]);return DS(e,u,m,r==null?void 0:r.class,r==null?void 0:r.className)},Jm=768;function QL(){const[e,t]=w.useState(void 0);return w.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Jm-1}px)`),i=()=>{t(window.innerWidth<Jm)};return r.addEventListener("change",i),t(window.innerWidth<Jm),()=>r.removeEventListener("change",i)},[]),!!e}const ZL=(e,t)=>{const r=new Array(e.length+t.length);for(let i=0;i<e.length;i++)r[i]=e[i];for(let i=0;i<t.length;i++)r[e.length+i]=t[i];return r},JL=(e,t)=>({classGroupId:e,validator:t}),e1=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Id="-",AS=[],ez="arbitrary..",tz=e=>{const t=rz(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return nz(u);const d=u.split(Id),m=d[0]===""&&d.length>1?1:0;return t1(d,m,t)},getConflictingClassGroupIds:(u,d)=>{if(d){const m=i[u],f=r[u];return m?f?ZL(f,m):m:f||AS}return r[u]||AS}}},t1=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],l=r.nextPart.get(s);if(l){const f=t1(e,t+1,l);if(f)return f}const u=r.validators;if(u===null)return;const d=t===0?e.join(Id):e.slice(t).join(Id),m=u.length;for(let f=0;f<m;f++){const y=u[f];if(y.validator(d))return y.classGroupId}},nz=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),i=t.slice(0,r);return i?ez+i:void 0})(),rz=e=>{const{theme:t,classGroups:r}=e;return az(r,t)},az=(e,t)=>{const r=e1();for(const i in e){const s=e[i];zg(s,r,i,t)}return r},zg=(e,t,r,i)=>{const s=e.length;for(let l=0;l<s;l++){const u=e[l];iz(u,t,r,i)}},iz=(e,t,r,i)=>{if(typeof e=="string"){oz(e,t,r);return}if(typeof e=="function"){sz(e,t,r,i);return}lz(e,t,r,i)},oz=(e,t,r)=>{const i=e===""?t:n1(t,e);i.classGroupId=r},sz=(e,t,r,i)=>{if(cz(e)){zg(e(i),t,r,i);return}t.validators===null&&(t.validators=[]),t.validators.push(JL(r,e))},lz=(e,t,r,i)=>{const s=Object.entries(e),l=s.length;for(let u=0;u<l;u++){const[d,m]=s[u];zg(m,n1(t,d),r,i)}},n1=(e,t)=>{let r=e;const i=t.split(Id),s=i.length;for(let l=0;l<s;l++){const u=i[l];let d=r.nextPart.get(u);d||(d=e1(),r.nextPart.set(u,d)),r=d}return r},cz=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,uz=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),i=Object.create(null);const s=(l,u)=>{r[l]=u,t++,t>e&&(t=0,i=r,r=Object.create(null))};return{get(l){let u=r[l];if(u!==void 0)return u;if((u=i[l])!==void 0)return s(l,u),u},set(l,u){l in r?r[l]=u:s(l,u)}}},Kp="!",NS=":",dz=[],kS=(e,t,r,i,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:i,isExternal:s}),fz=e=>{const{prefix:t,experimentalParseClassName:r}=e;let i=s=>{const l=[];let u=0,d=0,m=0,f;const y=s.length;for(let x=0;x<y;x++){const R=s[x];if(u===0&&d===0){if(R===NS){l.push(s.slice(m,x)),m=x+1;continue}if(R==="/"){f=x;continue}}R==="["?u++:R==="]"?u--:R==="("?d++:R===")"&&d--}const p=l.length===0?s:s.slice(m);let v=p,b=!1;p.endsWith(Kp)?(v=p.slice(0,-1),b=!0):p.startsWith(Kp)&&(v=p.slice(1),b=!0);const S=f&&f>m?f-m:void 0;return kS(l,b,v,S)};if(t){const s=t+NS,l=i;i=u=>u.startsWith(s)?l(u.slice(s.length)):kS(dz,!1,u,void 0,!0)}if(r){const s=i;i=l=>r({className:l,parseClassName:s})}return i},hz=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,i)=>{t.set(r,1e6+i)}),r=>{const i=[];let s=[];for(let l=0;l<r.length;l++){const u=r[l],d=u[0]==="[",m=t.has(u);d||m?(s.length>0&&(s.sort(),i.push(...s),s=[]),i.push(u)):s.push(u)}return s.length>0&&(s.sort(),i.push(...s)),i}},mz=e=>({cache:uz(e.cacheSize),parseClassName:fz(e),sortModifiers:hz(e),...tz(e)}),pz=/\s+/,gz=(e,t)=>{const{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:s,sortModifiers:l}=t,u=[],d=e.trim().split(pz);let m="";for(let f=d.length-1;f>=0;f-=1){const y=d[f],{isExternal:p,modifiers:v,hasImportantModifier:b,baseClassName:S,maybePostfixModifierPosition:x}=r(y);if(p){m=y+(m.length>0?" "+m:m);continue}let R=!!x,T=i(R?S.substring(0,x):S);if(!T){if(!R){m=y+(m.length>0?" "+m:m);continue}if(T=i(S),!T){m=y+(m.length>0?" "+m:m);continue}R=!1}const M=v.length===0?"":v.length===1?v[0]:l(v).join(":"),D=b?M+Kp:M,C=D+T;if(u.indexOf(C)>-1)continue;u.push(C);const N=s(T,R);for(let k=0;k<N.length;++k){const O=N[k];u.push(D+O)}m=y+(m.length>0?" "+m:m)}return m},yz=(...e)=>{let t=0,r,i,s="";for(;t<e.length;)(r=e[t++])&&(i=r1(r))&&(s&&(s+=" "),s+=i);return s},r1=e=>{if(typeof e=="string")return e;let t,r="";for(let i=0;i<e.length;i++)e[i]&&(t=r1(e[i]))&&(r&&(r+=" "),r+=t);return r},vz=(e,...t)=>{let r,i,s,l;const u=m=>{const f=t.reduce((y,p)=>p(y),e());return r=mz(f),i=r.cache.get,s=r.cache.set,l=d,d(m)},d=m=>{const f=i(m);if(f)return f;const y=gz(m,r);return s(m,y),y};return l=u,(...m)=>l(yz(...m))},bz=[],Cn=e=>{const t=r=>r[e]||bz;return t.isThemeGetter=!0,t},a1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,i1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,wz=/^\d+\/\d+$/,Sz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xz=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ez=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Rz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Tz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ss=e=>wz.test(e),yt=e=>!!e&&!Number.isNaN(Number(e)),wi=e=>!!e&&Number.isInteger(Number(e)),ep=e=>e.endsWith("%")&&yt(e.slice(0,-1)),Fa=e=>Sz.test(e),Cz=()=>!0,Oz=e=>xz.test(e)&&!Ez.test(e),o1=()=>!1,Mz=e=>Rz.test(e),Dz=e=>Tz.test(e),Az=e=>!Fe(e)&&!Ve(e),Nz=e=>Js(e,c1,o1),Fe=e=>a1.test(e),po=e=>Js(e,u1,Oz),tp=e=>Js(e,Pz,yt),_S=e=>Js(e,s1,o1),kz=e=>Js(e,l1,Dz),ud=e=>Js(e,d1,Mz),Ve=e=>i1.test(e),Zl=e=>el(e,u1),_z=e=>el(e,Iz),LS=e=>el(e,s1),Lz=e=>el(e,c1),zz=e=>el(e,l1),dd=e=>el(e,d1,!0),Js=(e,t,r)=>{const i=a1.exec(e);return i?i[1]?t(i[1]):r(i[2]):!1},el=(e,t,r=!1)=>{const i=i1.exec(e);return i?i[1]?t(i[1]):r:!1},s1=e=>e==="position"||e==="percentage",l1=e=>e==="image"||e==="url",c1=e=>e==="length"||e==="size"||e==="bg-size",u1=e=>e==="length",Pz=e=>e==="number",Iz=e=>e==="family-name",d1=e=>e==="shadow",Uz=()=>{const e=Cn("color"),t=Cn("font"),r=Cn("text"),i=Cn("font-weight"),s=Cn("tracking"),l=Cn("leading"),u=Cn("breakpoint"),d=Cn("container"),m=Cn("spacing"),f=Cn("radius"),y=Cn("shadow"),p=Cn("inset-shadow"),v=Cn("text-shadow"),b=Cn("drop-shadow"),S=Cn("blur"),x=Cn("perspective"),R=Cn("aspect"),T=Cn("ease"),M=Cn("animate"),D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...C(),Ve,Fe],k=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],L=()=>[Ve,Fe,m],G=()=>[Ss,"full","auto",...L()],J=()=>[wi,"none","subgrid",Ve,Fe],Z=()=>["auto",{span:["full",wi,Ve,Fe]},wi,Ve,Fe],z=()=>[wi,"auto",Ve,Fe],H=()=>["auto","min","max","fr",Ve,Fe],V=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],_=()=>["auto",...L()],j=()=>[Ss,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],U=()=>[e,Ve,Fe],ie=()=>[...C(),LS,_S,{position:[Ve,Fe]}],ae=()=>["no-repeat",{repeat:["","x","y","space","round"]}],P=()=>["auto","cover","contain",Lz,Nz,{size:[Ve,Fe]}],X=()=>[ep,Zl,po],$=()=>["","none","full",f,Ve,Fe],F=()=>["",yt,Zl,po],te=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>[yt,ep,LS,_S],we=()=>["","none",S,Ve,Fe],ve=()=>["none",yt,Ve,Fe],ke=()=>["none",yt,Ve,Fe],Xe=()=>[yt,Ve,Fe],ne=()=>[Ss,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fa],breakpoint:[Fa],color:[Cz],container:[Fa],"drop-shadow":[Fa],ease:["in","out","in-out"],font:[Az],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fa],shadow:[Fa],spacing:["px",yt],text:[Fa],"text-shadow":[Fa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ss,Fe,Ve,R]}],container:["container"],columns:[{columns:[yt,Fe,Ve,d]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:G()}],"inset-x":[{"inset-x":G()}],"inset-y":[{"inset-y":G()}],start:[{start:G()}],end:[{end:G()}],top:[{top:G()}],right:[{right:G()}],bottom:[{bottom:G()}],left:[{left:G()}],visibility:["visible","invisible","collapse"],z:[{z:[wi,"auto",Ve,Fe]}],basis:[{basis:[Ss,"full","auto",d,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[yt,Ss,"auto","initial","none",Fe]}],grow:[{grow:["",yt,Ve,Fe]}],shrink:[{shrink:["",yt,Ve,Fe]}],order:[{order:[wi,"first","last","none",Ve,Fe]}],"grid-cols":[{"grid-cols":J()}],"col-start-end":[{col:Z()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":J()}],"row-start-end":[{row:Z()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:j()}],w:[{w:[d,"screen",...j()]}],"min-w":[{"min-w":[d,"screen","none",...j()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...j()]}],h:[{h:["screen","lh",...j()]}],"min-h":[{"min-h":["screen","lh","none",...j()]}],"max-h":[{"max-h":["screen","lh",...j()]}],"font-size":[{text:["base",r,Zl,po]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,Ve,tp]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ep,Fe]}],"font-family":[{font:[_z,Fe,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Ve,Fe]}],"line-clamp":[{"line-clamp":[yt,"none",Ve,tp]}],leading:[{leading:[l,...L()]}],"list-image":[{"list-image":["none",Ve,Fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ve,Fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[yt,"from-font","auto",Ve,po]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[yt,"auto",Ve,Fe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ve,Fe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ve,Fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},wi,Ve,Fe],radial:["",Ve,Fe],conic:[wi,Ve,Fe]},zz,kz]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:$()}],"rounded-s":[{"rounded-s":$()}],"rounded-e":[{"rounded-e":$()}],"rounded-t":[{"rounded-t":$()}],"rounded-r":[{"rounded-r":$()}],"rounded-b":[{"rounded-b":$()}],"rounded-l":[{"rounded-l":$()}],"rounded-ss":[{"rounded-ss":$()}],"rounded-se":[{"rounded-se":$()}],"rounded-ee":[{"rounded-ee":$()}],"rounded-es":[{"rounded-es":$()}],"rounded-tl":[{"rounded-tl":$()}],"rounded-tr":[{"rounded-tr":$()}],"rounded-br":[{"rounded-br":$()}],"rounded-bl":[{"rounded-bl":$()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":F()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[yt,Ve,Fe]}],"outline-w":[{outline:["",yt,Zl,po]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",y,dd,ud]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",p,dd,ud]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[yt,po]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",v,dd,ud]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[yt,Ve,Fe]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[yt]}],"mask-image-linear-from-pos":[{"mask-linear-from":he()}],"mask-image-linear-to-pos":[{"mask-linear-to":he()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":he()}],"mask-image-t-to-pos":[{"mask-t-to":he()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":he()}],"mask-image-r-to-pos":[{"mask-r-to":he()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":he()}],"mask-image-b-to-pos":[{"mask-b-to":he()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":he()}],"mask-image-l-to-pos":[{"mask-l-to":he()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":he()}],"mask-image-x-to-pos":[{"mask-x-to":he()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":he()}],"mask-image-y-to-pos":[{"mask-y-to":he()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[Ve,Fe]}],"mask-image-radial-from-pos":[{"mask-radial-from":he()}],"mask-image-radial-to-pos":[{"mask-radial-to":he()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[yt]}],"mask-image-conic-from-pos":[{"mask-conic-from":he()}],"mask-image-conic-to-pos":[{"mask-conic-to":he()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ve,Fe]}],filter:[{filter:["","none",Ve,Fe]}],blur:[{blur:we()}],brightness:[{brightness:[yt,Ve,Fe]}],contrast:[{contrast:[yt,Ve,Fe]}],"drop-shadow":[{"drop-shadow":["","none",b,dd,ud]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",yt,Ve,Fe]}],"hue-rotate":[{"hue-rotate":[yt,Ve,Fe]}],invert:[{invert:["",yt,Ve,Fe]}],saturate:[{saturate:[yt,Ve,Fe]}],sepia:[{sepia:["",yt,Ve,Fe]}],"backdrop-filter":[{"backdrop-filter":["","none",Ve,Fe]}],"backdrop-blur":[{"backdrop-blur":we()}],"backdrop-brightness":[{"backdrop-brightness":[yt,Ve,Fe]}],"backdrop-contrast":[{"backdrop-contrast":[yt,Ve,Fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",yt,Ve,Fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[yt,Ve,Fe]}],"backdrop-invert":[{"backdrop-invert":["",yt,Ve,Fe]}],"backdrop-opacity":[{"backdrop-opacity":[yt,Ve,Fe]}],"backdrop-saturate":[{"backdrop-saturate":[yt,Ve,Fe]}],"backdrop-sepia":[{"backdrop-sepia":["",yt,Ve,Fe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ve,Fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[yt,"initial",Ve,Fe]}],ease:[{ease:["linear","initial",T,Ve,Fe]}],delay:[{delay:[yt,Ve,Fe]}],animate:[{animate:["none",M,Ve,Fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,Ve,Fe]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:ke()}],"scale-x":[{"scale-x":ke()}],"scale-y":[{"scale-y":ke()}],"scale-z":[{"scale-z":ke()}],"scale-3d":["scale-3d"],skew:[{skew:Xe()}],"skew-x":[{"skew-x":Xe()}],"skew-y":[{"skew-y":Xe()}],transform:[{transform:[Ve,Fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ne()}],"translate-x":[{"translate-x":ne()}],"translate-y":[{"translate-y":ne()}],"translate-z":[{"translate-z":ne()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ve,Fe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ve,Fe]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[yt,Zl,po,tp]}],stroke:[{stroke:["none",...U()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},jz=vz(Uz);function Ye(...e){return jz(JE(e))}const Hz=w.forwardRef(function(t,r){const{render:i,className:s,disabled:l=!1,focusableWhenDisabled:u=!1,nativeButton:d=!0,...m}=t,{getButtonProps:f,buttonRef:y}=Ic({disabled:l,focusableWhenDisabled:u,native:d});return Qt("button",t,{state:{disabled:l},ref:[r,y],props:[m,f]})}),Bz=Lg("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",destructive:"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function ya({className:e,variant:t="default",size:r="default",...i}){return I.jsx(Hz,{"data-slot":"button",className:Ye(Bz({variant:t,size:r,className:e})),...i})}let zS=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const Fz={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Vz={valid(e){return e===null?null:e?{[zS.valid]:""}:{[zS.invalid]:""}}},Yz=w.createContext({invalid:void 0,name:void 0,validityData:{state:Fz,errors:[],error:"",value:"",initialValue:null},setValidityData:pr,disabled:void 0,touched:!1,setTouched:pr,dirty:!1,setDirty:pr,filled:!1,setFilled:pr,focused:!1,setFocused:pr,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=xn)=>e,getInputValidationProps:(e=xn)=>e,inputRef:{current:null},commit:async()=>{}}});function f1(e=!0){const t=w.useContext(Yz);if(t.setValidityData===pr&&!e)throw new Error(Ln(28));return t}const qz=w.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:pr,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function Gz(){return w.useContext(qz)}const Kz=w.createContext({controlId:void 0,registerControlId:pr,labelId:void 0,setLabelId:pr,messageIds:[],setMessageIds:pr,getDescriptionProps:e=>e});function h1(){return w.useContext(Kz)}const Jl=0;class xa{constructor(){Be(this,"currentId",Jl);Be(this,"clear",()=>{this.currentId!==Jl&&(clearTimeout(this.currentId),this.currentId=Jl)});Be(this,"disposeEffect",()=>this.clear)}static create(){return new xa}start(t,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Jl,r()},t)}isStarted(){return this.currentId!==Jl}}function rr(){const e=_n(xa.create).current;return rf(e.disposeEffect),e}function Xz(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function jt(e){return(e==null?void 0:e.ownerDocument)||document}const tl=typeof navigator<"u",np=$z(),m1=Zz(),p1=Qz(),Pg=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),g1=np.platform==="MacIntel"&&np.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(np.platform),y1=tl&&/apple/i.test(navigator.vendor),Xp=tl&&/android/i.test(m1)||/android/i.test(p1),Wz=tl&&m1.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,v1=p1.includes("jsdom/");function $z(){if(!tl)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Qz(){if(!tl)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:r})=>`${t}/${r}`).join(" "):navigator.userAgent}function Zz(){if(!tl)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}const Wp="data-base-ui-focusable",b1="active",w1="selected",S1="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Ii="ArrowLeft",Ui="ArrowRight",Ig="ArrowUp",Hc="ArrowDown";function Fr(e){var r;let t=e.activeElement;for(;((r=t==null?void 0:t.shadowRoot)==null?void 0:r.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function mt(e,t){var i;if(!e||!t)return!1;const r=(i=t.getRootNode)==null?void 0:i.call(t);if(e.contains(t))return!0;if(r&&qp(r)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Ud(e,t){if(!zt(e))return!1;const r=e;if(t.hasElement(r))return!r.hasAttribute("data-trigger-disabled");for(const[,i]of t.entries())if(mt(i,r))return!i.hasAttribute("data-trigger-disabled");return!1}function Jn(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ea(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const r=e;return r.target!=null&&t.contains(r.target)}function Jz(e){return e.matches("html,body")}function uf(e){return on(e)&&e.matches(S1)}function $p(e){return e?e.getAttribute("role")==="combobox"&&uf(e):!1}function e3(e){if(!e||v1)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function jd(e){return e?e.hasAttribute(Wp)?e:e.querySelector(`[${Wp}]`)||e:null}function Do(e,t,r=!0){return e.filter(s=>{var l;return s.parentId===t&&(!r||((l=s.context)==null?void 0:l.open))}).flatMap(s=>[s,...Do(e,s.id,r)])}function PS(e,t){var s;let r=[],i=(s=e.find(l=>l.id===t))==null?void 0:s.parentId;for(;i;){const l=e.find(u=>u.id===i);i=l==null?void 0:l.parentId,l&&(r=r.concat(l))}return r}function Gn(e){e.preventDefault(),e.stopPropagation()}function t3(e){return"nativeEvent"in e}function x1(e){return e.pointerType===""&&e.isTrusted?!0:Xp&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function E1(e){return v1?!1:!Xp&&e.width===0&&e.height===0||Xp&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function zo(e,t){const r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}function R1(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const n3=["top","right","bottom","left"],Ks=Math.min,Or=Math.max,Hd=Math.round,Cs=Math.floor,va=e=>({x:e,y:e}),r3={left:"right",right:"left",bottom:"top",top:"bottom"},a3={start:"end",end:"start"};function Qp(e,t,r){return Or(e,Ks(t,r))}function Xa(e,t){return typeof e=="function"?e(t):e}function gr(e){return e.split("-")[0]}function Vi(e){return e.split("-")[1]}function Ug(e){return e==="x"?"y":"x"}function jg(e){return e==="y"?"height":"width"}const i3=new Set(["top","bottom"]);function Vr(e){return i3.has(gr(e))?"y":"x"}function Hg(e){return Ug(Vr(e))}function o3(e,t,r){r===void 0&&(r=!1);const i=Vi(e),s=Hg(e),l=jg(s);let u=s==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(u=Bd(u)),[u,Bd(u)]}function s3(e){const t=Bd(e);return[Zp(e),t,Zp(t)]}function Zp(e){return e.replace(/start|end/g,t=>a3[t])}const IS=["left","right"],US=["right","left"],l3=["top","bottom"],c3=["bottom","top"];function u3(e,t,r){switch(e){case"top":case"bottom":return r?t?US:IS:t?IS:US;case"left":case"right":return t?l3:c3;default:return[]}}function d3(e,t,r,i){const s=Vi(e);let l=u3(gr(e),r==="start",i);return s&&(l=l.map(u=>u+"-"+s),t&&(l=l.concat(l.map(Zp)))),l}function Bd(e){return e.replace(/left|right|bottom|top/g,t=>r3[t])}function f3(e){return{top:0,right:0,bottom:0,left:0,...e}}function T1(e){return typeof e!="number"?f3(e):{top:e,right:e,bottom:e,left:e}}function Fd(e){const{x:t,y:r,width:i,height:s}=e;return{width:i,height:s,top:r,left:t,right:t+i,bottom:r+s,x:t,y:r}}function fd(e,t,r){return Math.floor(e/t)!==r}function uc(e,t){return t<0||t>=e.current.length}function rp(e,t){return Yn(e,{disabledIndices:t})}function jS(e,t){return Yn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Yn(e,{startingIndex:t=-1,decrement:r=!1,disabledIndices:i,amount:s=1}={}){let l=t;do l+=r?-s:s;while(l>=0&&l<=e.current.length-1&&dc(e,l,i));return l}function h3(e,{event:t,orientation:r,loopFocus:i,rtl:s,cols:l,disabledIndices:u,minIndex:d,maxIndex:m,prevIndex:f,stopEvent:y=!1}){let p=f;const v=[],b={};let S=!1;{let T=null,M=-1;e.current.forEach((D,C)=>{if(D==null)return;const N=D.closest('[role="row"]');N&&(S=!0),(N!==T||M===-1)&&(T=N,M+=1,v[M]=[]),v[M].push(C),b[C]=M})}const x=S&&v.length>0&&v.some(T=>T.length!==l);function R(T){if(!x||f===-1)return;const M=b[f];if(M==null)return;const D=v[M].indexOf(f);let C=T==="up"?M-1:M+1;i&&(C<0?C=v.length-1:C>=v.length&&(C=0));const N=new Set;for(;C>=0&&C<v.length&&!N.has(C);){N.add(C);const k=v[C];if(k.length===0){C=T==="up"?C-1:C+1;continue}const O=Math.min(D,k.length-1);for(let L=O;L>=0;L-=1){const G=k[L];if(!dc(e,G,u))return G}C=T==="up"?C-1:C+1,i&&(C<0?C=v.length-1:C>=v.length&&(C=0))}}if(t.key===Ig){const T=R("up");if(T!==void 0)y&&Gn(t),p=T;else{if(y&&Gn(t),f===-1)p=m;else if(p=Yn(e,{startingIndex:p,amount:l,decrement:!0,disabledIndices:u}),i&&(f-l<d||p<0)){const M=f%l,D=m%l,C=m-(D-M);D===M?p=m:p=D>M?C:C-l}uc(e,p)&&(p=f)}}if(t.key===Hc){const T=R("down");T!==void 0?(y&&Gn(t),p=T):(y&&Gn(t),f===-1?p=d:(p=Yn(e,{startingIndex:f,amount:l,disabledIndices:u}),i&&f+l>m&&(p=Yn(e,{startingIndex:f%l-l,amount:l,disabledIndices:u}))),uc(e,p)&&(p=f))}if(r==="both"){const T=Cs(f/l);t.key===(s?Ii:Ui)&&(y&&Gn(t),f%l!==l-1?(p=Yn(e,{startingIndex:f,disabledIndices:u}),i&&fd(p,l,T)&&(p=Yn(e,{startingIndex:f-f%l-1,disabledIndices:u}))):i&&(p=Yn(e,{startingIndex:f-f%l-1,disabledIndices:u})),fd(p,l,T)&&(p=f)),t.key===(s?Ui:Ii)&&(y&&Gn(t),f%l!==0?(p=Yn(e,{startingIndex:f,decrement:!0,disabledIndices:u}),i&&fd(p,l,T)&&(p=Yn(e,{startingIndex:f+(l-f%l),decrement:!0,disabledIndices:u}))):i&&(p=Yn(e,{startingIndex:f+(l-f%l),decrement:!0,disabledIndices:u})),fd(p,l,T)&&(p=f));const M=Cs(m/l)===T;uc(e,p)&&(i&&M?p=t.key===(s?Ui:Ii)?m:Yn(e,{startingIndex:f-f%l-1,disabledIndices:u}):p=f)}return p}function m3(e,t,r){const i=[];let s=0;return e.forEach(({width:l,height:u},d)=>{let m=!1;for(;!m;){const f=[];for(let y=0;y<l;y+=1)for(let p=0;p<u;p+=1)f.push(s+y+p*t);s%t+l<=t&&f.every(y=>i[y]==null)?(f.forEach(y=>{i[y]=d}),m=!0):s+=1}}),[...i]}function p3(e,t,r,i,s){if(e===-1)return-1;const l=r.indexOf(e),u=t[e];switch(s){case"tl":return l;case"tr":return u?l+u.width-1:l;case"bl":return u?l+(u.height-1)*i:l;case"br":return r.lastIndexOf(e);default:return-1}}function g3(e,t){return t.flatMap((r,i)=>e.includes(r)?[i]:[])}function dc(e,t,r){if(typeof r=="function")return r(t);if(r)return r.includes(t);const i=e.current[t];return i?i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true":!1}/*!
202
- * tabbable 6.4.0
203
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
204
- */var y3=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Vd=y3.join(","),C1=typeof Element>"u",Xs=C1?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Yd=!C1&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},qd=function(t,r){var i;r===void 0&&(r=!0);var s=t==null||(i=t.getAttribute)===null||i===void 0?void 0:i.call(t,"inert"),l=s===""||s==="true",u=l||r&&t&&(typeof t.closest=="function"?t.closest("[inert]"):qd(t.parentNode));return u},v3=function(t){var r,i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"contenteditable");return i===""||i==="true"},O1=function(t,r,i){if(qd(t))return[];var s=Array.prototype.slice.apply(t.querySelectorAll(Vd));return r&&Xs.call(t,Vd)&&s.unshift(t),s=s.filter(i),s},Gd=function(t,r,i){for(var s=[],l=Array.from(t);l.length;){var u=l.shift();if(!qd(u,!1))if(u.tagName==="SLOT"){var d=u.assignedElements(),m=d.length?d:u.children,f=Gd(m,!0,i);i.flatten?s.push.apply(s,f):s.push({scopeParent:u,candidates:f})}else{var y=Xs.call(u,Vd);y&&i.filter(u)&&(r||!t.includes(u))&&s.push(u);var p=u.shadowRoot||typeof i.getShadowRoot=="function"&&i.getShadowRoot(u),v=!qd(p,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(u));if(p&&v){var b=Gd(p===!0?u.children:p.children,!0,i);i.flatten?s.push.apply(s,b):s.push({scopeParent:u,candidates:b})}else l.unshift.apply(l,u.children)}}return s},M1=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},D1=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||v3(t))&&!M1(t)?0:t.tabIndex},b3=function(t,r){var i=D1(t);return i<0&&r&&!M1(t)?0:i},w3=function(t,r){return t.tabIndex===r.tabIndex?t.documentOrder-r.documentOrder:t.tabIndex-r.tabIndex},A1=function(t){return t.tagName==="INPUT"},S3=function(t){return A1(t)&&t.type==="hidden"},x3=function(t){var r=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(i){return i.tagName==="SUMMARY"});return r},E3=function(t,r){for(var i=0;i<t.length;i++)if(t[i].checked&&t[i].form===r)return t[i]},R3=function(t){if(!t.name)return!0;var r=t.form||Yd(t),i=function(d){return r.querySelectorAll('input[type="radio"][name="'+d+'"]')},s;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")s=i(window.CSS.escape(t.name));else try{s=i(t.name)}catch(u){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",u.message),!1}var l=E3(s,t.form);return!l||l===t},T3=function(t){return A1(t)&&t.type==="radio"},C3=function(t){return T3(t)&&!R3(t)},O3=function(t){var r,i=t&&Yd(t),s=(r=i)===null||r===void 0?void 0:r.host,l=!1;if(i&&i!==t){var u,d,m;for(l=!!((u=s)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(s)||t!=null&&(m=t.ownerDocument)!==null&&m!==void 0&&m.contains(t));!l&&s;){var f,y,p;i=Yd(s),s=(f=i)===null||f===void 0?void 0:f.host,l=!!((y=s)!==null&&y!==void 0&&(p=y.ownerDocument)!==null&&p!==void 0&&p.contains(s))}}return l},HS=function(t){var r=t.getBoundingClientRect(),i=r.width,s=r.height;return i===0&&s===0},M3=function(t,r){var i=r.displayCheck,s=r.getShadowRoot;if(i==="full-native"&&"checkVisibility"in t){var l=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!l}if(getComputedStyle(t).visibility==="hidden")return!0;var u=Xs.call(t,"details>summary:first-of-type"),d=u?t.parentElement:t;if(Xs.call(d,"details:not([open]) *"))return!0;if(!i||i==="full"||i==="full-native"||i==="legacy-full"){if(typeof s=="function"){for(var m=t;t;){var f=t.parentElement,y=Yd(t);if(f&&!f.shadowRoot&&s(f)===!0)return HS(t);t.assignedSlot?t=t.assignedSlot:!f&&y!==t.ownerDocument?t=y.host:t=f}t=m}if(O3(t))return!t.getClientRects().length;if(i!=="legacy-full")return!0}else if(i==="non-zero-area")return HS(t);return!1},D3=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var r=t.parentElement;r;){if(r.tagName==="FIELDSET"&&r.disabled){for(var i=0;i<r.children.length;i++){var s=r.children.item(i);if(s.tagName==="LEGEND")return Xs.call(r,"fieldset[disabled] *")?!0:!s.contains(t)}return!0}r=r.parentElement}return!1},Jp=function(t,r){return!(r.disabled||S3(r)||M3(r,t)||x3(r)||D3(r))},eg=function(t,r){return!(C3(r)||D1(r)<0||!Jp(t,r))},A3=function(t){var r=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(r)||r>=0)},N1=function(t){var r=[],i=[];return t.forEach(function(s,l){var u=!!s.scopeParent,d=u?s.scopeParent:s,m=b3(d,u),f=u?N1(s.candidates):d;m===0?u?r.push.apply(r,f):r.push(d):i.push({documentOrder:l,tabIndex:m,item:s,isScope:u,content:f})}),i.sort(w3).reduce(function(s,l){return l.isScope?s.push.apply(s,l.content):s.push(l.content),s},[]).concat(r)},Bc=function(t,r){r=r||{};var i;return r.getShadowRoot?i=Gd([t],r.includeContainer,{filter:eg.bind(null,r),flatten:!1,getShadowRoot:r.getShadowRoot,shadowRootFilter:A3}):i=O1(t,r.includeContainer,eg.bind(null,r)),N1(i)},N3=function(t,r){r=r||{};var i;return r.getShadowRoot?i=Gd([t],r.includeContainer,{filter:Jp.bind(null,r),flatten:!0,getShadowRoot:r.getShadowRoot}):i=O1(t,r.includeContainer,Jp.bind(null,r)),i},k1=function(t,r){if(r=r||{},!t)throw new Error("No node provided");return Xs.call(t,Vd)===!1?!1:eg(r,t)};const nl=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function _1(e,t){const r=Bc(e,nl()),i=r.length;if(i===0)return;const s=Fr(jt(e)),l=r.indexOf(s),u=l===-1?t===1?0:i-1:l+t;return r[u]}function Bg(e){return _1(jt(e).body,1)||e}function L1(e){return _1(jt(e).body,-1)||e}function z1(e,t){if(!e)return null;const r=Bc(jt(e).body,nl()),i=r.length;if(i===0)return null;const s=r.indexOf(e);if(s===-1)return null;const l=(s+t+i)%i;return r[l]}function k3(e){return z1(e,1)}function _3(e){return z1(e,-1)}function Ds(e,t){const r=t||e.currentTarget,i=e.relatedTarget;return!i||!mt(r,i)}function L3(e){Bc(e,nl()).forEach(r=>{r.dataset.tabindex=r.getAttribute("tabindex")||"",r.setAttribute("tabindex","-1")})}function BS(e){e.querySelectorAll("[data-tabindex]").forEach(r=>{const i=r.dataset.tabindex;delete r.dataset.tabindex,i?r.setAttribute("tabindex",i):r.removeAttribute("tabindex")})}function z3(e={}){const{id:t,implicit:r=!1,controlRef:i}=e,{controlId:s,registerControlId:l}=h1(),u=Hi(t),d=r?s:void 0,m=_n(()=>Symbol("labelable-control")),f=w.useRef(!1),y=w.useRef(t!=null),p=ze(()=>{!f.current||l===pr||(f.current=!1,l(m.current,void 0))});return _e(()=>{if(l===pr)return;let v;if(r){const b=i==null?void 0:i.current;zt(b)&&b.closest("label")!=null?v=t??null:v=d??u}else if(t!=null)y.current=!0,v=t;else if(y.current)v=u;else{p();return}if(v===void 0){p();return}f.current=!0,l(m.current,v)},[t,i,d,l,r,u,m,p]),w.useEffect(()=>p,[p]),s??u}function P3(e){const{enabled:t=!0,value:r,id:i,name:s,controlRef:l,commit:u}=e,{formRef:d}=Gz(),{invalid:m,markedDirtyRef:f,validityData:y,setValidityData:p}=f1(),v=ze(e.getValue);_e(()=>{if(!t)return;let b=r;b===void 0&&(b=v()),y.initialValue===null&&b!==null&&p(S=>({...S,initialValue:b}))},[t,p,r,y.initialValue,v]),_e(()=>{!t||!i||d.current.fields.set(i,{getValue:v,name:s,controlRef:l,validityData:Xz(y,m),validate(b=!0){let S=r;S===void 0&&(S=v()),f.current=!0,b?ra.flushSync(()=>u(S)):u(S)}})},[u,l,t,d,v,i,m,f,s,y,r]),_e(()=>{const b=d.current.fields;return()=>{i&&b.delete(i)}},[d,i])}const I3=w.forwardRef(function(t,r){const{render:i,className:s,id:l,name:u,value:d,disabled:m=!1,onValueChange:f,defaultValue:y,autoFocus:p=!1,...v}=t,{state:b,name:S,disabled:x,setTouched:R,setDirty:T,validityData:M,setFocused:D,setFilled:C,validationMode:N,validation:k}=f1(),O=x||m,L=S??u,G={...b,disabled:O},{labelId:J}=h1(),Z=z3({id:l});_e(()=>{var U;const j=d!=null;(U=k.inputRef.current)!=null&&U.value||j&&d!==""?C(!0):j&&d===""&&C(!1)},[k.inputRef,C,d]);const z=w.useRef(null);_e(()=>{p&&z.current===Fr(jt(z.current))&&D(!0)},[p,D]);const[H]=YE({controlled:d,default:y,name:"FieldControl",state:"value"}),V=d!==void 0,q=V?H:void 0;return P3({id:Z,name:L,commit:k.commit,value:q,getValue:()=>{var j;return(j=k.inputRef.current)==null?void 0:j.value},controlRef:k.inputRef}),Qt("input",t,{ref:[r,z],state:G,props:[{id:Z,disabled:O,name:L,ref:k.inputRef,"aria-labelledby":J,autoFocus:p,...V?{value:q}:{defaultValue:y},onChange(j){const U=j.currentTarget.value;f==null||f(U,pt(Pc,j.nativeEvent)),T(U!==M.initialValue),C(U!=="")},onFocus(){D(!0)},onBlur(j){R(!0),D(!1),N==="onBlur"&&k.commit(j.currentTarget.value)},onKeyDown(j){j.currentTarget.tagName==="INPUT"&&j.key==="Enter"&&(R(!0),k.commit(j.currentTarget.value))}},k.getInputValidationProps(),v],stateAttributesMapping:Vz})}),U3=w.forwardRef(function(t,r){return I.jsx(I3,{ref:r,...t})});function j3({className:e,type:t,...r}){return I.jsx(U3,{type:t,"data-slot":"input",className:Ye("dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-2 aria-invalid:ring-2 md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",e),...r})}const P1=w.forwardRef(function(t,r){const{className:i,render:s,orientation:l="horizontal",...u}=t;return Qt("div",t,{state:{orientation:l},ref:r,props:[{role:"separator","aria-orientation":l},u]})});function H3({className:e,orientation:t="horizontal",...r}){return I.jsx(P1,{"data-slot":"separator",orientation:t,className:Ye("bg-border shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...r})}const Fg=w.createContext(void 0);function Yi(e){const t=w.useContext(Fg);if(e===!1&&t===void 0)throw new Error(Ln(27));return t}let bo=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Lo.startingStyle]="startingStyle",e[e.endingStyle=Lo.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),Kd=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const B3={[Kd.popupOpen]:""},F3={[Kd.popupOpen]:"",[Kd.pressed]:""},V3={[bo.open]:""},Y3={[bo.closed]:""},q3={[bo.anchorHidden]:""},G3={open(e){return e?B3:null}},FS={open(e){return e?F3:null}},jo={open(e){return e?V3:Y3},anchorHidden(e){return e?q3:null}},K3={...jo,...Zs},Vg=w.forwardRef(function(t,r){const{render:i,className:s,forceRender:l=!1,...u}=t,{store:d}=Yi(),m=d.useState("open"),f=d.useState("nested"),y=d.useState("mounted"),p=d.useState("transitionStatus");return Qt("div",t,{state:{open:m,transitionStatus:p},ref:[d.context.backdropRef,r],stateAttributesMapping:K3,props:[{role:"presentation",hidden:!y,style:{userSelect:"none",WebkitUserSelect:"none"}},u],enabled:l||!f})}),df=w.forwardRef(function(t,r){const{render:i,className:s,disabled:l=!1,nativeButton:u=!0,...d}=t,{store:m}=Yi(),f=m.useState("open");function y(S){f&&m.setOpen(!1,pt(yL,S.nativeEvent))}const{getButtonProps:p,buttonRef:v}=Ic({disabled:l,native:u});return Qt("button",t,{state:{disabled:l},ref:[r,v],props:[{onClick:y},d,p]})}),Yg=w.forwardRef(function(t,r){const{render:i,className:s,id:l,...u}=t,{store:d}=Yi(),m=Hi(l);return d.useSyncedValueWithCleanup("descriptionElementId",m),Qt("p",t,{ref:r,props:[{id:m},u]})});function er(e){const t=_n(X3,e).current;return t.next=e,_e(t.effect),t}function X3(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function I1(){const e=new Map;return{emit(t,r){var i;(i=e.get(t))==null||i.forEach(s=>s(r))},on(t,r){e.has(t)||e.set(t,new Set),e.get(t).add(r)},off(t,r){var i;(i=e.get(t))==null||i.delete(r)}}}class qg{constructor(){Be(this,"nodesRef",{current:[]});Be(this,"events",I1())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const r=this.nodesRef.current.findIndex(i=>i===t);r!==-1&&this.nodesRef.current.splice(r,1)}}const U1=w.createContext(null),j1=w.createContext(null),$a=()=>{var e;return((e=w.useContext(U1))==null?void 0:e.id)||null},qi=e=>{const t=w.useContext(j1);return e??t};function H1(e){const t=Uo(),r=qi(e),i=$a();return _e(()=>{if(!t)return;const s={id:t,parentId:i};return r==null||r.addNode(s),()=>{r==null||r.removeNode(s)}},[r,t,i]),t}function W3(e){const{children:t,id:r}=e,i=$a();return I.jsx(U1.Provider,{value:w.useMemo(()=>({id:r,parentId:i}),[r,i]),children:t})}function $3(e){const{children:t,externalTree:r}=e,i=_n(()=>r??new qg).current;return I.jsx(j1.Provider,{value:i,children:t})}function Ws(e){return`data-base-ui-${e}`}function Dd(e,t,r){if(r&&!zo(r))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const i=e();return typeof i=="number"?i:i==null?void 0:i[t]}return e==null?void 0:e[t]}const Q3=w.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new xa,currentIdRef:{current:null},currentContextRef:{current:null}});function Z3(e,t={open:!1}){const r="rootStore"in e?e.rootStore:e,i=r.useState("floatingId"),{open:s}=t,l=w.useContext(Q3),{currentIdRef:u,delayRef:d,timeoutMs:m,initialDelayRef:f,currentContextRef:y,hasProvider:p,timeout:v}=l,[b,S]=w.useState(!1);return _e(()=>{function x(){var R;S(!1),(R=y.current)==null||R.setIsInstantPhase(!1),u.current=null,y.current=null,d.current=f.current}if(u.current&&!s&&u.current===i){if(S(!1),m){const R=i;return v.start(m,()=>{r.select("open")||u.current&&u.current!==R||x()}),()=>{v.clear()}}x()}},[s,i,u,d,m,f,y,v,r]),_e(()=>{if(!s)return;const x=y.current,R=u.current;v.clear(),y.current={onOpenChange:r.setOpen,setIsInstantPhase:S},u.current=i,d.current={open:0,close:Dd(f.current,"close")},R!==null&&R!==i?(S(!0),x==null||x.setIsInstantPhase(!0),x==null||x.onOpenChange(!1,pt(Pc))):(S(!1),x==null||x.setIsInstantPhase(!1))},[s,i,r,u,d,m,f,y,v]),_e(()=>()=>{y.current=null},[y]),w.useMemo(()=>({hasProvider:p,delayRef:d,isInstantPhase:b}),[p,d,b])}const B1={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},F1={...B1,position:"fixed",top:0,left:0},Qj={...B1,position:"absolute"},$s=w.forwardRef(function(t,r){const[i,s]=w.useState();_e(()=>{y1&&s("button")},[]);const l={tabIndex:0,role:i};return I.jsx("span",{...t,ref:r,style:F1,"aria-hidden":i?void 0:!0,...l,"data-base-ui-focus-guard":""})});let VS=0;function fc(e,t={}){const{preventScroll:r=!1,cancelPrevious:i=!0,sync:s=!1}=t;i&&cancelAnimationFrame(VS);const l=()=>e==null?void 0:e.focus({preventScroll:r});s?l():VS=requestAnimationFrame(l)}const As={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function YS(e){return e==="inert"?As.inert:e==="aria-hidden"?As["aria-hidden"]:As.none}let hd=new WeakSet,md={},ap=0;const V1=e=>e&&(e.host||V1(e.parentNode)),J3=(e,t)=>t.map(r=>{if(e.contains(r))return r;const i=V1(r);return e.contains(i)?i:null}).filter(r=>r!=null);function e4(e,t,r,i){const s="data-base-ui-inert",l=i?"inert":r?"aria-hidden":null,u=J3(t,e),d=new Set,m=new Set(u),f=[];md[s]||(md[s]=new WeakMap);const y=md[s];u.forEach(p),v(t),d.clear();function p(b){!b||d.has(b)||(d.add(b),b.parentNode&&p(b.parentNode))}function v(b){!b||m.has(b)||[].forEach.call(b.children,S=>{if(Bi(S)!=="script")if(d.has(S))v(S);else{const x=l?S.getAttribute(l):null,R=x!==null&&x!=="false",T=YS(l),M=(T.get(S)||0)+1,D=(y.get(S)||0)+1;T.set(S,M),y.set(S,D),f.push(S),M===1&&R&&hd.add(S),D===1&&S.setAttribute(s,""),!R&&l&&S.setAttribute(l,l==="inert"?"":"true")}})}return ap+=1,()=>{f.forEach(b=>{const S=YS(l),R=(S.get(b)||0)-1,T=(y.get(b)||0)-1;S.set(b,R),y.set(b,T),R||(!hd.has(b)&&l&&b.removeAttribute(l),hd.delete(b)),T||b.removeAttribute(s)}),ap-=1,ap||(As.inert=new WeakMap,As["aria-hidden"]=new WeakMap,As.none=new WeakMap,hd=new WeakSet,md={})}}function t4(e,t=!1,r=!1){const i=jt(e[0]).body;return e4(e.concat(Array.from(i.querySelectorAll("[aria-live]"))),i,t,r)}const Y1=w.createContext(null),q1=()=>w.useContext(Y1),n4=Ws("portal");function G1(e={}){const{ref:t,container:r,componentProps:i=xn,elementProps:s}=e,l=Uo(),u=q1(),d=u==null?void 0:u.portalNode,[m,f]=w.useState(null),[y,p]=w.useState(null),v=ze(R=>{R!==null&&p(R)}),b=w.useRef(null);_e(()=>{if(r===null){b.current&&(b.current=null,p(null),f(null));return}if(l==null)return;const R=(r&&(Ng(r)?r:r.current))??d??document.body;if(R==null){b.current&&(b.current=null,p(null),f(null));return}b.current!==R&&(b.current=R,p(null),f(R))},[r,d,l]);const S=Qt("div",i,{ref:[t,v],props:[{id:l,[n4]:""},s]});return{portalNode:y,portalSubtree:m&&S?ra.createPortal(S,m):null}}const K1=w.forwardRef(function(t,r){const{children:i,container:s,className:l,render:u,renderGuards:d,...m}=t,{portalNode:f,portalSubtree:y}=G1({container:s,ref:r,componentProps:t,elementProps:m}),p=w.useRef(null),v=w.useRef(null),b=w.useRef(null),S=w.useRef(null),[x,R]=w.useState(null),T=x==null?void 0:x.modal,M=x==null?void 0:x.open,D=typeof d=="boolean"?d:!!x&&!x.modal&&x.open&&!!f;w.useEffect(()=>{if(!f||T)return;function N(k){f&&k.relatedTarget&&Ds(k)&&(k.type==="focusin"?BS:L3)(f)}return f.addEventListener("focusin",N,!0),f.addEventListener("focusout",N,!0),()=>{f.removeEventListener("focusin",N,!0),f.removeEventListener("focusout",N,!0)}},[f,T]),w.useEffect(()=>{!f||M||BS(f)},[M,f]);const C=w.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:v,beforeInsideRef:b,afterInsideRef:S,portalNode:f,setFocusManagerState:R}),[f]);return I.jsxs(w.Fragment,{children:[y,I.jsxs(Y1.Provider,{value:C,children:[D&&f&&I.jsx($s,{"data-type":"outside",ref:p,onFocus:N=>{var k;if(Ds(N,f))(k=b.current)==null||k.focus();else{const O=x?x.domReference:null,L=L1(O);L==null||L.focus()}}}),D&&f&&I.jsx("span",{"aria-owns":f.id,style:cL}),f&&ra.createPortal(i,f),D&&f&&I.jsx($s,{"data-type":"outside",ref:v,onFocus:N=>{var k;if(Ds(N,f))(k=S.current)==null||k.focus();else{const O=x?x.domReference:null,L=Bg(O);L==null||L.focus(),x!=null&&x.closeOnFocusOut&&(x==null||x.onOpenChange(!1,pt(Gs,N.nativeEvent)))}}})]})]})});function r4(e,t){const r=Rn(e.target);return e instanceof r.KeyboardEvent?"keyboard":e instanceof r.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof r.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const qS=20;let _i=[];function Gg(){_i=_i.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function a4(e){Gg(),e&&Bi(e)!=="body"&&(_i.push(new WeakRef(e)),_i.length>qS&&(_i=_i.slice(-qS)))}function ip(){var e;return Gg(),(e=_i[_i.length-1])==null?void 0:e.deref()}function i4(e){if(!e)return null;const t=nl();return k1(e,t)?e:Bc(e,t)[0]||e}function o4(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Mr(e).display!=="none"}function GS(e,t){var u;if(!t.current.includes("floating")&&!((u=e.getAttribute("role"))!=null&&u.includes("dialog")))return;const r=nl(),s=N3(e,r).filter(d=>{const m=d.getAttribute("data-tabindex")||"";return k1(d,r)||d.hasAttribute("data-tabindex")&&!m.startsWith("-")}),l=e.getAttribute("tabindex");t.current.includes("floating")||s.length===0?l!=="0"&&e.setAttribute("tabindex","0"):(l!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function X1(e){const{context:t,children:r,disabled:i=!1,initialFocus:s=!0,returnFocus:l=!0,restoreFocus:u=!1,modal:d=!0,closeOnFocusOut:m=!0,openInteractionType:f="",nextFocusableElement:y,previousFocusableElement:p,beforeContentFocusGuardRef:v,externalTree:b}=e,S="rootStore"in t?t.rootStore:t,x=S.useState("open"),R=S.useState("domReferenceElement"),T=S.useState("floatingElement"),{events:M,dataRef:D}=S.context,C=ze(()=>{var fe;return(fe=D.current.floatingContext)==null?void 0:fe.nodeId}),N=s===!1,k=$p(R)&&N,O=w.useRef(["content"]),L=er(s),G=er(l),J=er(f),Z=qi(b),z=q1(),H=w.useRef(null),V=w.useRef(null),q=w.useRef(!1),_=w.useRef(!1),j=w.useRef(!1),U=w.useRef(-1),ie=w.useRef(""),ae=w.useRef(""),P=w.useRef(null),X=w.useRef(null),$=ko(P,v,z==null?void 0:z.beforeInsideRef),F=ko(X,z==null?void 0:z.afterInsideRef),te=rr(),ue=rr(),he=af(),we=z!=null,ve=jd(T),ke=ze((fe=ve)=>fe?Bc(fe,nl()):[]),Xe=ze(fe=>{const Se=ke(fe);return O.current.map(()=>Se).filter(Boolean).flat()});w.useEffect(()=>{if(i||!d)return;function fe(Ne){Ne.key==="Tab"&&mt(ve,Fr(jt(ve)))&&ke().length===0&&!k&&Gn(Ne)}const Se=jt(ve);return Se.addEventListener("keydown",fe),()=>{Se.removeEventListener("keydown",fe)}},[i,R,ve,d,O,k,ke,Xe]),w.useEffect(()=>{if(i||!x)return;const fe=jt(ve);function Se(){j.current=!1}function Ne(Ee){const Re=Jn(Ee),pe=mt(T,Re)||mt(R,Re)||mt(z==null?void 0:z.portalNode,Re);j.current=!pe,ae.current=Ee.pointerType||"keyboard",Re!=null&&Re.closest(`[${sL}]`)&&(_.current=!0)}function Te(){ae.current="keyboard"}return fe.addEventListener("pointerdown",Ne,!0),fe.addEventListener("pointerup",Se,!0),fe.addEventListener("pointercancel",Se,!0),fe.addEventListener("keydown",Te,!0),()=>{fe.removeEventListener("pointerdown",Ne,!0),fe.removeEventListener("pointerup",Se,!0),fe.removeEventListener("pointercancel",Se,!0),fe.removeEventListener("keydown",Te,!0)}},[i,T,R,ve,x,z]),w.useEffect(()=>{if(i||!m)return;const fe=jt(ve);function Se(){_.current=!0,ue.start(0,()=>{_.current=!1})}function Ne(De){const xe=Jn(De),Ge=ke().indexOf(xe);Ge!==-1&&(U.current=Ge)}function Te(De){const xe=De.relatedTarget,qe=De.currentTarget,Ge=Jn(De);queueMicrotask(()=>{const Le=C(),ot=S.context.triggerElements,Pt=(xe==null?void 0:xe.hasAttribute(Ws("focus-guard")))&&[P.current,X.current,z==null?void 0:z.beforeInsideRef.current,z==null?void 0:z.afterInsideRef.current,z==null?void 0:z.beforeOutsideRef.current,z==null?void 0:z.afterOutsideRef.current,qa(p),qa(y)].includes(xe),Ft=!(mt(R,xe)||mt(T,xe)||mt(xe,T)||mt(z==null?void 0:z.portalNode,xe)||xe!=null&&ot.hasElement(xe)||ot.hasMatchingElement(tt=>mt(tt,xe))||Pt||Z&&(Do(Z.nodesRef.current,Le).find(tt=>{var ft,Ct;return mt((ft=tt.context)==null?void 0:ft.elements.floating,xe)||mt((Ct=tt.context)==null?void 0:Ct.elements.domReference,xe)})||PS(Z.nodesRef.current,Le).find(tt=>{var ft,Ct,sn;return[(ft=tt.context)==null?void 0:ft.elements.floating,jd((Ct=tt.context)==null?void 0:Ct.elements.floating)].includes(xe)||((sn=tt.context)==null?void 0:sn.elements.domReference)===xe})));if(qe===R&&ve&&GS(ve,O),u&&qe!==R&&!o4(Ge)&&Fr(fe)===fe.body){if(on(ve)&&(ve.focus(),u==="popup")){he.request(()=>{ve.focus()});return}const tt=U.current,ft=ke(),Ct=ft[tt]||ft[ft.length-1]||ve;on(Ct)&&Ct.focus()}if(D.current.insideReactTree){D.current.insideReactTree=!1;return}(k||!d)&&xe&&Ft&&!_.current&&(k||xe!==ip())&&(q.current=!0,S.setOpen(!1,pt(Gs,De)))})}function Ee(){j.current||(D.current.insideReactTree=!0,te.start(0,()=>{D.current.insideReactTree=!1}))}const Re=on(R)?R:null,pe=[];if(!(!T&&!Re))return Re&&(Re.addEventListener("focusout",Te),Re.addEventListener("pointerdown",Se),pe.push(()=>{Re.removeEventListener("focusout",Te),Re.removeEventListener("pointerdown",Se)})),T&&(T.addEventListener("focusin",Ne),T.addEventListener("focusout",Te),z&&(T.addEventListener("focusout",Ee,!0),pe.push(()=>{T.removeEventListener("focusout",Ee,!0)})),pe.push(()=>{T.removeEventListener("focusin",Ne),T.removeEventListener("focusout",Te)})),()=>{pe.forEach(De=>{De()})}},[i,R,T,ve,d,Z,z,S,m,u,ke,k,C,O,D,te,ue,he,y,p]),w.useEffect(()=>{var Ee,Re,pe;if(i||!T||!x)return;const fe=Array.from(((Ee=z==null?void 0:z.portalNode)==null?void 0:Ee.querySelectorAll(`[${Ws("portal")}]`))||[]),Ne=(pe=(Re=(Z?PS(Z.nodesRef.current,C()):[]).find(De=>{var xe;return $p(((xe=De.context)==null?void 0:xe.elements.domReference)||null)}))==null?void 0:Re.context)==null?void 0:pe.elements.domReference,Te=[T,Ne,...fe,H.current,V.current,P.current,X.current,z==null?void 0:z.beforeOutsideRef.current,z==null?void 0:z.afterOutsideRef.current,qa(p),qa(y),k?R:null].filter(De=>De!=null);return t4(Te,d||k)},[x,i,R,T,d,O,z,k,Z,C,y,p]),_e(()=>{if(!x||i||!on(ve))return;const fe=jt(ve),Se=Fr(fe);queueMicrotask(()=>{const Ne=Xe(ve),Te=L.current,Ee=typeof Te=="function"?Te(J.current||""):Te;if(Ee===void 0||Ee===!1)return;let Re;Ee===!0||Ee===null?Re=Ne[0]||ve:Re=qa(Ee),Re=Re||Ne[0]||ve,!mt(ve,Se)&&fc(Re,{preventScroll:Re===ve})})},[i,x,ve,N,Xe,L,J]),_e(()=>{if(i||!ve)return;const fe=jt(ve),Se=Fr(fe);a4(Se);function Ne(Re){if(Re.open||(ie.current=r4(Re.nativeEvent,ae.current)),Re.reason===Zn&&Re.nativeEvent.type==="mouseleave"&&(q.current=!0),Re.reason===Dg)if(Re.nested)q.current=!1;else if(x1(Re.nativeEvent)||E1(Re.nativeEvent))q.current=!1;else{let pe=!1;document.createElement("div").focus({get preventScroll(){return pe=!0,!1}}),pe?q.current=!1:q.current=!0}}M.on("openchange",Ne);const Te=fe.createElement("span");Te.setAttribute("tabindex","-1"),Te.setAttribute("aria-hidden","true"),Object.assign(Te.style,F1),we&&R&&R.insertAdjacentElement("afterend",Te);function Ee(){const Re=G.current;let pe=typeof Re=="function"?Re(ie.current):Re;if(pe===void 0||pe===!1)return null;if(pe===null&&(pe=!0),typeof pe=="boolean"){const xe=R||ip();return xe&&xe.isConnected?xe:Te}const De=R||ip()||Te;return qa(pe)||De}return()=>{M.off("openchange",Ne);const Re=Fr(fe),pe=mt(T,Re)||Z&&Do(Z.nodesRef.current,C(),!1).some(xe=>{var qe;return mt((qe=xe.context)==null?void 0:qe.elements.floating,Re)}),De=Ee();queueMicrotask(()=>{const xe=i4(De),qe=typeof G.current!="boolean";G.current&&!q.current&&on(xe)&&(!(!qe&&xe!==Re&&Re!==fe.body)||pe)&&xe.focus({preventScroll:!0}),Te.remove(),q.current=!1})}},[i,T,ve,G,D,M,Z,we,R,C]),_e(()=>{if(!Pg||x||!T)return;const fe=Fr(jt(T));!on(fe)||!uf(fe)||mt(T,fe)&&fe.blur()},[x,T]),_e(()=>{if(!(i||!z))return z.setFocusManagerState({modal:d,closeOnFocusOut:m,open:x,onOpenChange:S.setOpen,domReference:R}),()=>{z.setFocusManagerState(null)}},[i,z,d,x,S,m,R]),_e(()=>{if(!(i||!ve))return GS(ve,O),()=>{queueMicrotask(Gg)}},[i,ve,O]);const ne=!i&&(d?!k:!0)&&(we||d);return I.jsxs(w.Fragment,{children:[ne&&I.jsx($s,{"data-type":"inside",ref:$,onFocus:fe=>{var Se;if(d){const Ne=Xe();fc(Ne[Ne.length-1])}else if(z!=null&&z.portalNode)if(q.current=!1,Ds(fe,z.portalNode)){const Ne=Bg(R);Ne==null||Ne.focus()}else(Se=qa(p??z.beforeOutsideRef))==null||Se.focus()}}),r,ne&&I.jsx($s,{"data-type":"inside",ref:F,onFocus:fe=>{var Se;if(d)fc(Xe()[0]);else if(z!=null&&z.portalNode)if(m&&(q.current=!0),Ds(fe,z.portalNode)){const Ne=L1(R);Ne==null||Ne.focus()}else(Se=qa(y??z.afterOutsideRef))==null||Se.focus()}})]})}function s4(e,t={}){const r="rootStore"in e?e.rootStore:e,i=r.context.dataRef,{enabled:s=!0,event:l="click",toggle:u=!0,ignoreMouse:d=!1,stickIfOpen:m=!0,touchOpenDelay:f=0,reason:y=_o}=t,p=w.useRef(void 0),v=af(),b=rr(),S=w.useMemo(()=>({onPointerDown(x){p.current=x.pointerType},onMouseDown(x){const R=p.current,T=x.nativeEvent,M=r.select("open");if(x.button!==0||l==="click"||zo(R,!0)&&d)return;const D=i.current.openEvent,C=D==null?void 0:D.type,N=r.select("domReferenceElement")!==x.currentTarget,k=M&&N||!(M&&u&&(!(D&&m)||C==="click"||C==="mousedown"));if(uf(T.target)){const L=pt(y,T,T.target);k&&R==="touch"&&f>0?b.start(f,()=>{r.setOpen(!0,L)}):r.setOpen(k,L);return}const O=x.currentTarget;v.request(()=>{const L=pt(y,T,O);k&&R==="touch"&&f>0?b.start(f,()=>{r.setOpen(!0,L)}):r.setOpen(k,L)})},onClick(x){if(l==="mousedown-only")return;const R=p.current;if(l==="mousedown"&&R){p.current=void 0;return}if(zo(R,!0)&&d)return;const T=r.select("open"),M=i.current.openEvent,D=r.select("domReferenceElement")!==x.currentTarget,C=T&&D||!(T&&u&&(!(M&&m)||R1(M))),N=pt(y,x.nativeEvent,x.currentTarget);C&&R==="touch"&&f>0?b.start(f,()=>{r.setOpen(!0,N)}):r.setOpen(C,N)},onKeyDown(){p.current=void 0}}),[i,l,d,r,m,u,v,b,f,y]);return w.useMemo(()=>s?{reference:S}:xn,[s,S])}function l4(e,t){let r=null,i=null,s=!1;return{contextElement:e||void 0,getBoundingClientRect(){var b;const l=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},u=t.axis==="x"||t.axis==="both",d=t.axis==="y"||t.axis==="both",m=["mouseenter","mousemove"].includes(((b=t.dataRef.current.openEvent)==null?void 0:b.type)||"")&&t.pointerType!=="touch";let f=l.width,y=l.height,p=l.x,v=l.y;return r==null&&t.x&&u&&(r=l.x-t.x),i==null&&t.y&&d&&(i=l.y-t.y),p-=r||0,v-=i||0,f=0,y=0,!s||m?(f=t.axis==="y"?l.width:0,y=t.axis==="x"?l.height:0,p=u&&t.x!=null?t.x:p,v=d&&t.y!=null?t.y:v):s&&!m&&(y=t.axis==="x"?l.height:y,f=t.axis==="y"?l.width:f),s=!0,{width:f,height:y,x:p,y:v,top:v,right:p+f,bottom:v+y,left:p}}}}function KS(e){return e!=null&&e.clientX!=null}function c4(e,t={}){const r="rootStore"in e?e.rootStore:e,i=r.useState("open"),s=r.useState("floatingElement"),l=r.useState("domReferenceElement"),u=r.context.dataRef,{enabled:d=!0,axis:m="both"}=t,f=w.useRef(!1),y=w.useRef(null),[p,v]=w.useState(),[b,S]=w.useState([]),x=ze((C,N,k)=>{f.current||u.current.openEvent&&!KS(u.current.openEvent)||r.set("positionReference",l4(k??l,{x:C,y:N,axis:m,dataRef:u,pointerType:p}))}),R=ze(C=>{i?y.current||S([]):x(C.clientX,C.clientY,C.currentTarget)}),T=zo(p)?s:i,M=w.useCallback(()=>{if(!T||!d)return;const C=Rn(s);function N(k){const O=Jn(k);mt(s,O)?(C.removeEventListener("mousemove",N),y.current=null):x(k.clientX,k.clientY)}if(!u.current.openEvent||KS(u.current.openEvent)){C.addEventListener("mousemove",N);const k=()=>{C.removeEventListener("mousemove",N),y.current=null};return y.current=k,k}r.set("positionReference",l)},[T,d,s,u,l,r,x]);w.useEffect(()=>M(),[M,b]),w.useEffect(()=>{d&&!s&&(f.current=!1)},[d,s]),w.useEffect(()=>{!d&&i&&(f.current=!0)},[d,i]);const D=w.useMemo(()=>{function C(N){v(N.pointerType)}return{onPointerDown:C,onPointerEnter:C,onMouseMove:R,onMouseEnter:R}},[R]);return w.useMemo(()=>d?{reference:D,trigger:D}:{},[d,D])}function XS(e,t,r){let{reference:i,floating:s}=e;const l=Vr(t),u=Hg(t),d=jg(u),m=gr(t),f=l==="y",y=i.x+i.width/2-s.width/2,p=i.y+i.height/2-s.height/2,v=i[d]/2-s[d]/2;let b;switch(m){case"top":b={x:y,y:i.y-s.height};break;case"bottom":b={x:y,y:i.y+i.height};break;case"right":b={x:i.x+i.width,y:p};break;case"left":b={x:i.x-s.width,y:p};break;default:b={x:i.x,y:i.y}}switch(Vi(t)){case"start":b[u]-=v*(r&&f?-1:1);break;case"end":b[u]+=v*(r&&f?-1:1);break}return b}async function u4(e,t){var r;t===void 0&&(t={});const{x:i,y:s,platform:l,rects:u,elements:d,strategy:m}=e,{boundary:f="clippingAncestors",rootBoundary:y="viewport",elementContext:p="floating",altBoundary:v=!1,padding:b=0}=Xa(t,e),S=T1(b),R=d[v?p==="floating"?"reference":"floating":p],T=Fd(await l.getClippingRect({element:(r=await(l.isElement==null?void 0:l.isElement(R)))==null||r?R:R.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:f,rootBoundary:y,strategy:m})),M=p==="floating"?{x:i,y:s,width:u.floating.width,height:u.floating.height}:u.reference,D=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),C=await(l.isElement==null?void 0:l.isElement(D))?await(l.getScale==null?void 0:l.getScale(D))||{x:1,y:1}:{x:1,y:1},N=Fd(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:M,offsetParent:D,strategy:m}):M);return{top:(T.top-N.top+S.top)/C.y,bottom:(N.bottom-T.bottom+S.bottom)/C.y,left:(T.left-N.left+S.left)/C.x,right:(N.right-T.right+S.right)/C.x}}const d4=async(e,t,r)=>{const{placement:i="bottom",strategy:s="absolute",middleware:l=[],platform:u}=r,d=l.filter(Boolean),m=await(u.isRTL==null?void 0:u.isRTL(t));let f=await u.getElementRects({reference:e,floating:t,strategy:s}),{x:y,y:p}=XS(f,i,m),v=i,b={},S=0;for(let R=0;R<d.length;R++){var x;const{name:T,fn:M}=d[R],{x:D,y:C,data:N,reset:k}=await M({x:y,y:p,initialPlacement:i,placement:v,strategy:s,middlewareData:b,rects:f,platform:{...u,detectOverflow:(x=u.detectOverflow)!=null?x:u4},elements:{reference:e,floating:t}});y=D??y,p=C??p,b={...b,[T]:{...b[T],...N}},k&&S<=50&&(S++,typeof k=="object"&&(k.placement&&(v=k.placement),k.rects&&(f=k.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:s}):k.rects),{x:y,y:p}=XS(f,v,m)),R=-1)}return{x:y,y:p,placement:v,strategy:s,middlewareData:b}},f4=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,i;const{placement:s,middlewareData:l,rects:u,initialPlacement:d,platform:m,elements:f}=t,{mainAxis:y=!0,crossAxis:p=!0,fallbackPlacements:v,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:x=!0,...R}=Xa(e,t);if((r=l.arrow)!=null&&r.alignmentOffset)return{};const T=gr(s),M=Vr(d),D=gr(d)===d,C=await(m.isRTL==null?void 0:m.isRTL(f.floating)),N=v||(D||!x?[Bd(d)]:s3(d)),k=S!=="none";!v&&k&&N.push(...d3(d,x,S,C));const O=[d,...N],L=await m.detectOverflow(t,R),G=[];let J=((i=l.flip)==null?void 0:i.overflows)||[];if(y&&G.push(L[T]),p){const V=o3(s,u,C);G.push(L[V[0]],L[V[1]])}if(J=[...J,{placement:s,overflows:G}],!G.every(V=>V<=0)){var Z,z;const V=(((Z=l.flip)==null?void 0:Z.index)||0)+1,q=O[V];if(q&&(!(p==="alignment"?M!==Vr(q):!1)||J.every(U=>Vr(U.placement)===M?U.overflows[0]>0:!0)))return{data:{index:V,overflows:J},reset:{placement:q}};let _=(z=J.filter(j=>j.overflows[0]<=0).sort((j,U)=>j.overflows[1]-U.overflows[1])[0])==null?void 0:z.placement;if(!_)switch(b){case"bestFit":{var H;const j=(H=J.filter(U=>{if(k){const ie=Vr(U.placement);return ie===M||ie==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(ie=>ie>0).reduce((ie,ae)=>ie+ae,0)]).sort((U,ie)=>U[1]-ie[1])[0])==null?void 0:H[0];j&&(_=j);break}case"initialPlacement":_=d;break}if(s!==_)return{reset:{placement:_}}}return{}}}};function WS(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function $S(e){return n3.some(t=>e[t]>=0)}const h4=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:i}=t,{strategy:s="referenceHidden",...l}=Xa(e,t);switch(s){case"referenceHidden":{const u=await i.detectOverflow(t,{...l,elementContext:"reference"}),d=WS(u,r.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:$S(d)}}}case"escaped":{const u=await i.detectOverflow(t,{...l,altBoundary:!0}),d=WS(u,r.floating);return{data:{escapedOffsets:d,escaped:$S(d)}}}default:return{}}}}},W1=new Set(["left","top"]);async function m4(e,t){const{placement:r,platform:i,elements:s}=e,l=await(i.isRTL==null?void 0:i.isRTL(s.floating)),u=gr(r),d=Vi(r),m=Vr(r)==="y",f=W1.has(u)?-1:1,y=l&&m?-1:1,p=Xa(t,e);let{mainAxis:v,crossAxis:b,alignmentAxis:S}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return d&&typeof S=="number"&&(b=d==="end"?S*-1:S),m?{x:b*y,y:v*f}:{x:v*f,y:b*y}}const p4=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,i;const{x:s,y:l,placement:u,middlewareData:d}=t,m=await m4(t,e);return u===((r=d.offset)==null?void 0:r.placement)&&(i=d.arrow)!=null&&i.alignmentOffset?{}:{x:s+m.x,y:l+m.y,data:{...m,placement:u}}}}},g4=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:i,placement:s,platform:l}=t,{mainAxis:u=!0,crossAxis:d=!1,limiter:m={fn:T=>{let{x:M,y:D}=T;return{x:M,y:D}}},...f}=Xa(e,t),y={x:r,y:i},p=await l.detectOverflow(t,f),v=Vr(gr(s)),b=Ug(v);let S=y[b],x=y[v];if(u){const T=b==="y"?"top":"left",M=b==="y"?"bottom":"right",D=S+p[T],C=S-p[M];S=Qp(D,S,C)}if(d){const T=v==="y"?"top":"left",M=v==="y"?"bottom":"right",D=x+p[T],C=x-p[M];x=Qp(D,x,C)}const R=m.fn({...t,[b]:S,[v]:x});return{...R,data:{x:R.x-r,y:R.y-i,enabled:{[b]:u,[v]:d}}}}}},y4=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:i,placement:s,rects:l,middlewareData:u}=t,{offset:d=0,mainAxis:m=!0,crossAxis:f=!0}=Xa(e,t),y={x:r,y:i},p=Vr(s),v=Ug(p);let b=y[v],S=y[p];const x=Xa(d,t),R=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(m){const D=v==="y"?"height":"width",C=l.reference[v]-l.floating[D]+R.mainAxis,N=l.reference[v]+l.reference[D]-R.mainAxis;b<C?b=C:b>N&&(b=N)}if(f){var T,M;const D=v==="y"?"width":"height",C=W1.has(gr(s)),N=l.reference[p]-l.floating[D]+(C&&((T=u.offset)==null?void 0:T[p])||0)+(C?0:R.crossAxis),k=l.reference[p]+l.reference[D]+(C?0:((M=u.offset)==null?void 0:M[p])||0)-(C?R.crossAxis:0);S<N?S=N:S>k&&(S=k)}return{[v]:b,[p]:S}}}},v4=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,i;const{placement:s,rects:l,platform:u,elements:d}=t,{apply:m=()=>{},...f}=Xa(e,t),y=await u.detectOverflow(t,f),p=gr(s),v=Vi(s),b=Vr(s)==="y",{width:S,height:x}=l.floating;let R,T;p==="top"||p==="bottom"?(R=p,T=v===(await(u.isRTL==null?void 0:u.isRTL(d.floating))?"start":"end")?"left":"right"):(T=p,R=v==="end"?"top":"bottom");const M=x-y.top-y.bottom,D=S-y.left-y.right,C=Ks(x-y[R],M),N=Ks(S-y[T],D),k=!t.middlewareData.shift;let O=C,L=N;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(L=D),(i=t.middlewareData.shift)!=null&&i.enabled.y&&(O=M),k&&!v){const J=Or(y.left,0),Z=Or(y.right,0),z=Or(y.top,0),H=Or(y.bottom,0);b?L=S-2*(J!==0||Z!==0?J+Z:Or(y.left,y.right)):O=x-2*(z!==0||H!==0?z+H:Or(y.top,y.bottom))}await m({...t,availableWidth:L,availableHeight:O});const G=await u.getDimensions(d.floating);return S!==G.width||x!==G.height?{reset:{rects:!0}}:{}}}};function $1(e){const t=Mr(e);let r=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const s=on(e),l=s?e.offsetWidth:r,u=s?e.offsetHeight:i,d=Hd(r)!==l||Hd(i)!==u;return d&&(r=l,i=u),{width:r,height:i,$:d}}function Kg(e){return zt(e)?e:e.contextElement}function Ns(e){const t=Kg(e);if(!on(t))return va(1);const r=t.getBoundingClientRect(),{width:i,height:s,$:l}=$1(t);let u=(l?Hd(r.width):r.width)/i,d=(l?Hd(r.height):r.height)/s;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const b4=va(0);function Q1(e){const t=Rn(e);return!lf()||!t.visualViewport?b4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function w4(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Rn(e)?!1:t}function Po(e,t,r,i){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),l=Kg(e);let u=va(1);t&&(i?zt(i)&&(u=Ns(i)):u=Ns(e));const d=w4(l,r,i)?Q1(l):va(0);let m=(s.left+d.x)/u.x,f=(s.top+d.y)/u.y,y=s.width/u.x,p=s.height/u.y;if(l){const v=Rn(l),b=i&&zt(i)?Rn(i):i;let S=v,x=Gp(S);for(;x&&i&&b!==S;){const R=Ns(x),T=x.getBoundingClientRect(),M=Mr(x),D=T.left+(x.clientLeft+parseFloat(M.paddingLeft))*R.x,C=T.top+(x.clientTop+parseFloat(M.paddingTop))*R.y;m*=R.x,f*=R.y,y*=R.x,p*=R.y,m+=D,f+=C,S=Rn(x),x=Gp(S)}}return Fd({width:y,height:p,x:m,y:f})}function ff(e,t){const r=cf(e).scrollLeft;return t?t.left+r:Po(Ea(e)).left+r}function Z1(e,t){const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-ff(e,r),s=r.top+t.scrollTop;return{x:i,y:s}}function S4(e){let{elements:t,rect:r,offsetParent:i,strategy:s}=e;const l=s==="fixed",u=Ea(i),d=t?sf(t.floating):!1;if(i===u||d&&l)return r;let m={scrollLeft:0,scrollTop:0},f=va(1);const y=va(0),p=on(i);if((p||!p&&!l)&&((Bi(i)!=="body"||Fi(u))&&(m=cf(i)),on(i))){const b=Po(i);f=Ns(i),y.x=b.x+i.clientLeft,y.y=b.y+i.clientTop}const v=u&&!p&&!l?Z1(u,m):va(0);return{width:r.width*f.x,height:r.height*f.y,x:r.x*f.x-m.scrollLeft*f.x+y.x+v.x,y:r.y*f.y-m.scrollTop*f.y+y.y+v.y}}function x4(e){return Array.from(e.getClientRects())}function E4(e){const t=Ea(e),r=cf(e),i=e.ownerDocument.body,s=Or(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),l=Or(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let u=-r.scrollLeft+ff(e);const d=-r.scrollTop;return Mr(i).direction==="rtl"&&(u+=Or(t.clientWidth,i.clientWidth)-s),{width:s,height:l,x:u,y:d}}const QS=25;function R4(e,t){const r=Rn(e),i=Ea(e),s=r.visualViewport;let l=i.clientWidth,u=i.clientHeight,d=0,m=0;if(s){l=s.width,u=s.height;const y=lf();(!y||y&&t==="fixed")&&(d=s.offsetLeft,m=s.offsetTop)}const f=ff(i);if(f<=0){const y=i.ownerDocument,p=y.body,v=getComputedStyle(p),b=y.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,S=Math.abs(i.clientWidth-p.clientWidth-b);S<=QS&&(l-=S)}else f<=QS&&(l+=f);return{width:l,height:u,x:d,y:m}}const T4=new Set(["absolute","fixed"]);function C4(e,t){const r=Po(e,!0,t==="fixed"),i=r.top+e.clientTop,s=r.left+e.clientLeft,l=on(e)?Ns(e):va(1),u=e.clientWidth*l.x,d=e.clientHeight*l.y,m=s*l.x,f=i*l.y;return{width:u,height:d,x:m,y:f}}function ZS(e,t,r){let i;if(t==="viewport")i=R4(e,r);else if(t==="document")i=E4(Ea(e));else if(zt(t))i=C4(t,r);else{const s=Q1(e);i={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Fd(i)}function J1(e,t){const r=Sa(e);return r===t||!zt(r)||ga(r)?!1:Mr(r).position==="fixed"||J1(r,t)}function O4(e,t){const r=t.get(e);if(r)return r;let i=Pi(e,[],!1).filter(d=>zt(d)&&Bi(d)!=="body"),s=null;const l=Mr(e).position==="fixed";let u=l?Sa(e):e;for(;zt(u)&&!ga(u);){const d=Mr(u),m=kg(u);!m&&d.position==="fixed"&&(s=null),(l?!m&&!s:!m&&d.position==="static"&&!!s&&T4.has(s.position)||Fi(u)&&!m&&J1(e,u))?i=i.filter(y=>y!==u):s=d,u=Sa(u)}return t.set(e,i),i}function M4(e){let{element:t,boundary:r,rootBoundary:i,strategy:s}=e;const u=[...r==="clippingAncestors"?sf(t)?[]:O4(t,this._c):[].concat(r),i],d=u[0],m=u.reduce((f,y)=>{const p=ZS(t,y,s);return f.top=Or(p.top,f.top),f.right=Ks(p.right,f.right),f.bottom=Ks(p.bottom,f.bottom),f.left=Or(p.left,f.left),f},ZS(t,d,s));return{width:m.right-m.left,height:m.bottom-m.top,x:m.left,y:m.top}}function D4(e){const{width:t,height:r}=$1(e);return{width:t,height:r}}function A4(e,t,r){const i=on(t),s=Ea(t),l=r==="fixed",u=Po(e,!0,l,t);let d={scrollLeft:0,scrollTop:0};const m=va(0);function f(){m.x=ff(s)}if(i||!i&&!l)if((Bi(t)!=="body"||Fi(s))&&(d=cf(t)),i){const b=Po(t,!0,l,t);m.x=b.x+t.clientLeft,m.y=b.y+t.clientTop}else s&&f();l&&!i&&s&&f();const y=s&&!i&&!l?Z1(s,d):va(0),p=u.left+d.scrollLeft-m.x-y.x,v=u.top+d.scrollTop-m.y-y.y;return{x:p,y:v,width:u.width,height:u.height}}function op(e){return Mr(e).position==="static"}function JS(e,t){if(!on(e)||Mr(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ea(e)===r&&(r=r.ownerDocument.body),r}function eR(e,t){const r=Rn(e);if(sf(e))return r;if(!on(e)){let s=Sa(e);for(;s&&!ga(s);){if(zt(s)&&!op(s))return s;s=Sa(s)}return r}let i=JS(e,t);for(;i&&_L(i)&&op(i);)i=JS(i,t);return i&&ga(i)&&op(i)&&!kg(i)?r:i||UL(e)||r}const N4=async function(e){const t=this.getOffsetParent||eR,r=this.getDimensions,i=await r(e.floating);return{reference:A4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function k4(e){return Mr(e).direction==="rtl"}const _4={convertOffsetParentRelativeRectToViewportRelativeRect:S4,getDocumentElement:Ea,getClippingRect:M4,getOffsetParent:eR,getElementRects:N4,getClientRects:x4,getDimensions:D4,getScale:Ns,isElement:zt,isRTL:k4};function tR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function L4(e,t){let r=null,i;const s=Ea(e);function l(){var d;clearTimeout(i),(d=r)==null||d.disconnect(),r=null}function u(d,m){d===void 0&&(d=!1),m===void 0&&(m=1),l();const f=e.getBoundingClientRect(),{left:y,top:p,width:v,height:b}=f;if(d||t(),!v||!b)return;const S=Cs(p),x=Cs(s.clientWidth-(y+v)),R=Cs(s.clientHeight-(p+b)),T=Cs(y),D={rootMargin:-S+"px "+-x+"px "+-R+"px "+-T+"px",threshold:Or(0,Ks(1,m))||1};let C=!0;function N(k){const O=k[0].intersectionRatio;if(O!==m){if(!C)return u();O?u(!1,O):i=setTimeout(()=>{u(!1,1e-7)},1e3)}O===1&&!tR(f,e.getBoundingClientRect())&&u(),C=!1}try{r=new IntersectionObserver(N,{...D,root:s.ownerDocument})}catch{r=new IntersectionObserver(N,D)}r.observe(e)}return u(!0),l}function ex(e,t,r,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:m=!1}=i,f=Kg(e),y=s||l?[...f?Pi(f):[],...Pi(t)]:[];y.forEach(T=>{s&&T.addEventListener("scroll",r,{passive:!0}),l&&T.addEventListener("resize",r)});const p=f&&d?L4(f,r):null;let v=-1,b=null;u&&(b=new ResizeObserver(T=>{let[M]=T;M&&M.target===f&&b&&(b.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var D;(D=b)==null||D.observe(t)})),r()}),f&&!m&&b.observe(f),b.observe(t));let S,x=m?Po(e):null;m&&R();function R(){const T=Po(e);x&&!tR(x,T)&&r(),x=T,S=requestAnimationFrame(R)}return r(),()=>{var T;y.forEach(M=>{s&&M.removeEventListener("scroll",r),l&&M.removeEventListener("resize",r)}),p==null||p(),(T=b)==null||T.disconnect(),b=null,m&&cancelAnimationFrame(S)}}const z4=p4,P4=g4,I4=f4,U4=v4,j4=h4,H4=y4,B4=(e,t,r)=>{const i=new Map,s={platform:_4,...r},l={...s.platform,_c:i};return d4(e,t,{...s,platform:l})};var F4=typeof document<"u",V4=function(){},Ad=F4?w.useLayoutEffect:V4;function Xd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,i,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(i=r;i--!==0;)if(!Xd(e[i],t[i]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(t,s[i]))return!1;for(i=r;i--!==0;){const l=s[i];if(!(l==="_owner"&&e.$$typeof)&&!Xd(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function nR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tx(e,t){const r=nR(e);return Math.round(t*r)/r}function sp(e){const t=w.useRef(e);return Ad(()=>{t.current=e}),t}function Y4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:i=[],platform:s,elements:{reference:l,floating:u}={},transform:d=!0,whileElementsMounted:m,open:f}=e,[y,p]=w.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[v,b]=w.useState(i);Xd(v,i)||b(i);const[S,x]=w.useState(null),[R,T]=w.useState(null),M=w.useCallback(U=>{U!==k.current&&(k.current=U,x(U))},[]),D=w.useCallback(U=>{U!==O.current&&(O.current=U,T(U))},[]),C=l||S,N=u||R,k=w.useRef(null),O=w.useRef(null),L=w.useRef(y),G=m!=null,J=sp(m),Z=sp(s),z=sp(f),H=w.useCallback(()=>{if(!k.current||!O.current)return;const U={placement:t,strategy:r,middleware:v};Z.current&&(U.platform=Z.current),B4(k.current,O.current,U).then(ie=>{const ae={...ie,isPositioned:z.current!==!1};V.current&&!Xd(L.current,ae)&&(L.current=ae,ra.flushSync(()=>{p(ae)}))})},[v,t,r,Z,z]);Ad(()=>{f===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,p(U=>({...U,isPositioned:!1})))},[f]);const V=w.useRef(!1);Ad(()=>(V.current=!0,()=>{V.current=!1}),[]),Ad(()=>{if(C&&(k.current=C),N&&(O.current=N),C&&N){if(J.current)return J.current(C,N,H);H()}},[C,N,H,J,G]);const q=w.useMemo(()=>({reference:k,floating:O,setReference:M,setFloating:D}),[M,D]),_=w.useMemo(()=>({reference:C,floating:N}),[C,N]),j=w.useMemo(()=>{const U={position:r,left:0,top:0};if(!_.floating)return U;const ie=tx(_.floating,y.x),ae=tx(_.floating,y.y);return d?{...U,transform:"translate("+ie+"px, "+ae+"px)",...nR(_.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:ie,top:ae}},[r,d,_.floating,y.x,y.y]);return w.useMemo(()=>({...y,update:H,refs:q,elements:_,floatingStyles:j}),[y,H,q,_,j])}const q4=(e,t)=>({...z4(e),options:[e,t]}),G4=(e,t)=>({...P4(e),options:[e,t]}),K4=(e,t)=>({...H4(e),options:[e,t]}),X4=(e,t)=>({...I4(e),options:[e,t]}),W4=(e,t)=>({...U4(e),options:[e,t]}),$4=(e,t)=>({...j4(e),options:[e,t]}),Q4={intentional:"onClick",sloppy:"onPointerDown"};function Z4(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function Xg(e,t={}){const r="rootStore"in e?e.rootStore:e,i=r.useState("open"),s=r.useState("floatingElement"),l=r.useState("referenceElement"),u=r.useState("domReferenceElement"),{onOpenChange:d,dataRef:m}=r.context,{enabled:f=!0,escapeKey:y=!0,outsidePress:p=!0,outsidePressEvent:v="sloppy",referencePress:b=!1,referencePressEvent:S="sloppy",ancestorScroll:x=!1,bubbles:R,externalTree:T}=t,M=qi(T),D=ze(typeof p=="function"?p:()=>!1),C=typeof p=="function"?D:p,N=w.useRef(!1),{escapeKey:k,outsidePress:O}=Z4(R),L=w.useRef(null),G=rr(),J=rr(),Z=ze(()=>{J.clear(),m.current.insideReactTree=!1}),z=w.useRef(!1),H=w.useRef(""),V=ze(ne=>{H.current=ne.pointerType}),q=ze(()=>{const ne=H.current,fe=ne==="pen"||!ne?"mouse":ne,Se=typeof v=="function"?v():v;return typeof Se=="string"?Se:Se[fe]}),_=ze(ne=>{var Ee;if(!i||!f||!y||ne.key!=="Escape"||z.current)return;const fe=(Ee=m.current.floatingContext)==null?void 0:Ee.nodeId,Se=M?Do(M.nodesRef.current,fe):[];if(!k&&Se.length>0){let Re=!0;if(Se.forEach(pe=>{var De;(De=pe.context)!=null&&De.open&&!pe.context.dataRef.current.__escapeKeyBubbles&&(Re=!1)}),!Re)return}const Ne=t3(ne)?ne.nativeEvent:ne,Te=pt(nf,Ne);r.setOpen(!1,Te),!k&&!Te.isPropagationAllowed&&ne.stopPropagation()}),j=ze(ne=>{const fe=q();return fe==="intentional"&&ne.type!=="click"||fe==="sloppy"&&ne.type==="click"}),U=ze(()=>{m.current.insideReactTree=!0,J.start(0,Z)}),ie=ze((ne,fe=!1)=>{var qe;if(j(ne)){Z();return}if(m.current.insideReactTree){Z();return}if(q()==="intentional"&&fe||typeof C=="function"&&!C(ne))return;const Se=Jn(ne),Ne=`[${Ws("inert")}]`,Te=jt(r.select("floatingElement")).querySelectorAll(Ne),Ee=r.context.triggerElements;if(Se&&(Ee.hasElement(Se)||Ee.hasMatchingElement(Ge=>mt(Ge,Se))))return;let Re=zt(Se)?Se:null;for(;Re&&!ga(Re);){const Ge=Sa(Re);if(ga(Ge)||!zt(Ge))break;Re=Ge}if(Te.length&&zt(Se)&&!Jz(Se)&&!mt(Se,r.select("floatingElement"))&&Array.from(Te).every(Ge=>!mt(Re,Ge)))return;if(on(Se)&&!("touches"in ne)){const Ge=ga(Se),Le=Mr(Se),ot=/auto|scroll/,Pt=Ge||ot.test(Le.overflowX),Ft=Ge||ot.test(Le.overflowY),tt=Pt&&Se.clientWidth>0&&Se.scrollWidth>Se.clientWidth,ft=Ft&&Se.clientHeight>0&&Se.scrollHeight>Se.clientHeight,Ct=Le.direction==="rtl",sn=ft&&(Ct?ne.offsetX<=Se.offsetWidth-Se.clientWidth:ne.offsetX>Se.clientWidth),ln=tt&&ne.offsetY>Se.clientHeight;if(sn||ln)return}const pe=(qe=m.current.floatingContext)==null?void 0:qe.nodeId,De=M&&Do(M.nodesRef.current,pe).some(Ge=>{var Le;return ea(ne,(Le=Ge.context)==null?void 0:Le.elements.floating)});if(ea(ne,r.select("floatingElement"))||ea(ne,r.select("domReferenceElement"))||De)return;const xe=M?Do(M.nodesRef.current,pe):[];if(xe.length>0){let Ge=!0;if(xe.forEach(Le=>{var ot;(ot=Le.context)!=null&&ot.open&&!Le.context.dataRef.current.__outsidePressBubbles&&(Ge=!1)}),!Ge)return}r.setOpen(!1,pt(Dg,ne)),Z()}),ae=ze(ne=>{q()!=="sloppy"||ne.pointerType==="touch"||!r.select("open")||!f||ea(ne,r.select("floatingElement"))||ea(ne,r.select("domReferenceElement"))||ie(ne)}),P=ze(ne=>{if(q()!=="sloppy"||!r.select("open")||!f||ea(ne,r.select("floatingElement"))||ea(ne,r.select("domReferenceElement")))return;const fe=ne.touches[0];fe&&(L.current={startTime:Date.now(),startX:fe.clientX,startY:fe.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},G.start(1e3,()=>{L.current&&(L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1)}))}),X=ze(ne=>{const fe=Jn(ne);function Se(){P(ne),fe==null||fe.removeEventListener(ne.type,Se)}fe==null||fe.addEventListener(ne.type,Se)}),$=ze(ne=>{const fe=N.current;if(N.current=!1,G.clear(),ne.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)return;const Se=Jn(ne);function Ne(){ne.type==="pointerdown"?ae(ne):ie(ne,fe),Se==null||Se.removeEventListener(ne.type,Ne)}Se==null||Se.addEventListener(ne.type,Ne)}),F=ze(ne=>{if(q()!=="sloppy"||!L.current||ea(ne,r.select("floatingElement"))||ea(ne,r.select("domReferenceElement")))return;const fe=ne.touches[0];if(!fe)return;const Se=Math.abs(fe.clientX-L.current.startX),Ne=Math.abs(fe.clientY-L.current.startY),Te=Math.sqrt(Se*Se+Ne*Ne);Te>5&&(L.current.dismissOnTouchEnd=!0),Te>10&&(ie(ne),G.clear(),L.current=null)}),te=ze(ne=>{const fe=Jn(ne);function Se(){F(ne),fe==null||fe.removeEventListener(ne.type,Se)}fe==null||fe.addEventListener(ne.type,Se)}),ue=ze(ne=>{q()!=="sloppy"||!L.current||ea(ne,r.select("floatingElement"))||ea(ne,r.select("domReferenceElement"))||(L.current.dismissOnTouchEnd&&ie(ne),G.clear(),L.current=null)}),he=ze(ne=>{const fe=Jn(ne);function Se(){ue(ne),fe==null||fe.removeEventListener(ne.type,Se)}fe==null||fe.addEventListener(ne.type,Se)});w.useEffect(()=>{if(!i||!f)return;m.current.__escapeKeyBubbles=k,m.current.__outsidePressBubbles=O;const ne=new xa;function fe(Re){r.setOpen(!1,pt(Pc,Re))}function Se(){ne.clear(),z.current=!0}function Ne(){ne.start(lf()?5:0,()=>{z.current=!1})}const Te=jt(s);Te.addEventListener("pointerdown",V,!0),y&&(Te.addEventListener("keydown",_),Te.addEventListener("compositionstart",Se),Te.addEventListener("compositionend",Ne)),C&&(Te.addEventListener("click",$,!0),Te.addEventListener("pointerdown",$,!0),Te.addEventListener("touchstart",X,!0),Te.addEventListener("touchmove",te,!0),Te.addEventListener("touchend",he,!0),Te.addEventListener("mousedown",$,!0));let Ee=[];return x&&(zt(u)&&(Ee=Pi(u)),zt(s)&&(Ee=Ee.concat(Pi(s))),!zt(l)&&l&&l.contextElement&&(Ee=Ee.concat(Pi(l.contextElement)))),Ee=Ee.filter(Re=>{var pe;return Re!==((pe=Te.defaultView)==null?void 0:pe.visualViewport)}),Ee.forEach(Re=>{Re.addEventListener("scroll",fe,{passive:!0})}),()=>{Te.removeEventListener("pointerdown",V,!0),y&&(Te.removeEventListener("keydown",_),Te.removeEventListener("compositionstart",Se),Te.removeEventListener("compositionend",Ne)),C&&(Te.removeEventListener("click",$,!0),Te.removeEventListener("pointerdown",$,!0),Te.removeEventListener("touchstart",X,!0),Te.removeEventListener("touchmove",te,!0),Te.removeEventListener("touchend",he,!0),Te.removeEventListener("mousedown",$,!0)),Ee.forEach(Re=>{Re.removeEventListener("scroll",fe)}),ne.clear(),N.current=!1}},[m,s,l,u,y,C,i,d,x,f,k,O,_,ie,$,ae,X,te,he,V,r]),w.useEffect(Z,[C,Z]);const we=w.useMemo(()=>({onKeyDown:_,...b&&{[Q4[S]]:ne=>{r.setOpen(!1,pt(_o,ne.nativeEvent))},...S!=="intentional"&&{onClick(ne){r.setOpen(!1,pt(_o,ne.nativeEvent))}}}}),[_,r,b,S]),ve=ze(ne=>{const fe=Jn(ne.nativeEvent);!mt(r.select("floatingElement"),fe)||ne.button!==0||(N.current=!0)}),ke=ze(ne=>{!i||!f||ne.button!==0||(N.current=!0)}),Xe=w.useMemo(()=>({onKeyDown:_,onPointerDown:ve,onMouseDown:ve,onMouseUp:ve,onClickCapture:U,onMouseDownCapture(ne){U(),ke(ne)},onPointerDownCapture(ne){U(),ke(ne)},onMouseUpCapture:U,onTouchEndCapture:U,onTouchMoveCapture:U}),[_,ve,U,ke]);return w.useMemo(()=>f?{reference:we,floating:Xe,trigger:we}:{},[f,we,Xe])}var Wd=Symbol("NOT_FOUND");function J4(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function eP(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function tP(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(i=>typeof i=="function"?`function ${i.name||"unnamed"}()`:typeof i).join(", ");throw new TypeError(`${t}[${r}]`)}}var nx=e=>Array.isArray(e)?e:[e];function nP(e){const t=Array.isArray(e[0])?e[0]:e;return tP(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function rP(e,t){const r=[],{length:i}=e;for(let s=0;s<i;s++)r.push(e[s].apply(null,t));return r}function aP(e){let t;return{get(r){return t&&e(t.key,r)?t.value:Wd},put(r,i){t={key:r,value:i}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function iP(e,t){let r=[];function i(d){const m=r.findIndex(f=>t(d,f.key));if(m>-1){const f=r[m];return m>0&&(r.splice(m,1),r.unshift(f)),f.value}return Wd}function s(d,m){i(d)===Wd&&(r.unshift({key:d,value:m}),r.length>e&&r.pop())}function l(){return r}function u(){r=[]}return{get:i,put:s,getEntries:l,clear:u}}var oP=(e,t)=>e===t;function sP(e){return function(r,i){if(r===null||i===null||r.length!==i.length)return!1;const{length:s}=r;for(let l=0;l<s;l++)if(!e(r[l],i[l]))return!1;return!0}}function lP(e,t){const r=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:i=oP,maxSize:s=1,resultEqualityCheck:l}=r,u=sP(i);let d=0;const m=s<=1?aP(u):iP(s,u);function f(){let y=m.get(arguments);if(y===Wd){if(y=e.apply(null,arguments),d++,l){const v=m.getEntries().find(b=>l(b.value,y));v&&(y=v.value,d!==0&&d--)}m.put(arguments,y)}return y}return f.clearCache=()=>{m.clear(),f.resetResultsCount()},f.resultsCount=()=>d,f.resetResultsCount=()=>{d=0},f}var cP=class{constructor(e){this.value=e}deref(){return this.value}},uP=typeof WeakRef<"u"?WeakRef:cP,dP=0,rx=1;function pd(){return{s:dP,v:void 0,o:null,p:null}}function rR(e,t={}){let r=pd();const{resultEqualityCheck:i}=t;let s,l=0;function u(){var p;let d=r;const{length:m}=arguments;for(let v=0,b=m;v<b;v++){const S=arguments[v];if(typeof S=="function"||typeof S=="object"&&S!==null){let x=d.o;x===null&&(d.o=x=new WeakMap);const R=x.get(S);R===void 0?(d=pd(),x.set(S,d)):d=R}else{let x=d.p;x===null&&(d.p=x=new Map);const R=x.get(S);R===void 0?(d=pd(),x.set(S,d)):d=R}}const f=d;let y;if(d.s===rx)y=d.v;else if(y=e.apply(null,arguments),l++,i){const v=((p=s==null?void 0:s.deref)==null?void 0:p.call(s))??s;v!=null&&i(v,y)&&(y=v,l!==0&&l--),s=typeof y=="object"&&y!==null||typeof y=="function"?new uP(y):y}return f.s=rx,f.v=y,y}return u.clearCache=()=>{r=pd(),u.resetResultsCount()},u.resultsCount=()=>l,u.resetResultsCount=()=>{l=0},u}function aR(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,i=(...s)=>{let l=0,u=0,d,m={},f=s.pop();typeof f=="object"&&(m=f,f=s.pop()),J4(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const y={...r,...m},{memoize:p,memoizeOptions:v=[],argsMemoize:b=rR,argsMemoizeOptions:S=[]}=y,x=nx(v),R=nx(S),T=nP(s),M=p(function(){return l++,f.apply(null,arguments)},...x),D=b(function(){u++;const N=rP(T,arguments);return d=M.apply(null,N),d},...R);return Object.assign(D,{resultFunc:f,memoizedResultFunc:M,dependencies:T,dependencyRecomputations:()=>u,resetDependencyRecomputations:()=>{u=0},lastResult:()=>d,recomputations:()=>l,resetRecomputations:()=>{l=0},memoize:p,argsMemoize:b})};return Object.assign(i,{withTypes:()=>i}),i}var fP=aR(rR),hP=Object.assign((e,t=fP)=>{eP(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const r=Object.keys(e),i=r.map(l=>e[l]);return t(i,(...l)=>l.reduce((u,d,m)=>(u[r[m]]=d,u),{}))},{withTypes:()=>hP});aR({memoize:lP,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Je=(e,t,r,i,s,l,...u)=>{if(u.length>0)throw new Error(Ln(1));let d;if(e)d=e;else throw new Error("Missing arguments");return d};var lp={exports:{}},cp={};/**
205
- * @license React
206
- * use-sync-external-store-shim/with-selector.production.js
207
- *
208
- * Copyright (c) Meta Platforms, Inc. and affiliates.
209
- *
210
- * This source code is licensed under the MIT license found in the
211
- * LICENSE file in the root directory of this source tree.
212
- */var ax;function mP(){if(ax)return cp;ax=1;var e=Dc(),t=DE();function r(f,y){return f===y&&(f!==0||1/f===1/y)||f!==f&&y!==y}var i=typeof Object.is=="function"?Object.is:r,s=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,d=e.useMemo,m=e.useDebugValue;return cp.useSyncExternalStoreWithSelector=function(f,y,p,v,b){var S=l(null);if(S.current===null){var x={hasValue:!1,value:null};S.current=x}else x=S.current;S=d(function(){function T(k){if(!M){if(M=!0,D=k,k=v(k),b!==void 0&&x.hasValue){var O=x.value;if(b(O,k))return C=O}return C=k}if(O=C,i(D,k))return O;var L=v(k);return b!==void 0&&b(O,L)?(D=k,O):(D=k,C=L)}var M=!1,D,C,N=p===void 0?null:p;return[function(){return T(y())},N===null?void 0:function(){return T(N())}]},[y,p,v,b]);var R=s(f,S[0],S[1]);return u(function(){x.hasValue=!0,x.value=R},[R]),m(R),R},cp}var ix;function pP(){return ix||(ix=1,lp.exports=mP()),lp.exports}var gP=pP();const tg=[];let ng;function yP(){return ng}function vP(e){tg.push(e)}function Wg(e){const t=(r,i)=>{const s=_n(bP).current;let l;try{ng=s;for(const u of tg)u.before(s);l=e(r,i);for(const u of tg)u.after(s);s.didInitialize=!0}finally{ng=void 0}return l};return t.displayName=e.displayName||e.name,t}function iR(e){return w.forwardRef(Wg(e))}function bP(){return{didInitialize:!1}}const wP=Mg(19),SP=wP?EP:RP;function oR(e,t,r,i,s){return SP(e,t,r,i,s)}function xP(e,t,r,i,s){const l=w.useCallback(()=>t(e.getSnapshot(),r,i,s),[e,t,r,i,s]);return Tg.useSyncExternalStore(e.subscribe,l,l)}vP({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let r=0;r<e.syncHooks.length;r+=1){const i=e.syncHooks[r],s=i.selector(i.store.state,i.a1,i.a2,i.a3);(i.didChange||!Object.is(i.value,s))&&(t=!0,i.value=s,i.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const r=new Set;for(const s of e.syncHooks)r.add(s.store);const i=[];for(const s of r)i.push(s.subscribe(t));return()=>{for(const s of i)s()}}),Tg.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function EP(e,t,r,i,s){const l=yP();if(!l)return xP(e,t,r,i,s);const u=l.syncIndex;l.syncIndex+=1;let d;return l.didInitialize?(d=l.syncHooks[u],(d.store!==e||d.selector!==t||!Object.is(d.a1,r)||!Object.is(d.a2,i)||!Object.is(d.a3,s))&&(d.store!==e&&(l.didChangeStore=!0),d.store=e,d.selector=t,d.a1=r,d.a2=i,d.a3=s,d.didChange=!0)):(d={store:e,selector:t,a1:r,a2:i,a3:s,value:t(e.getSnapshot(),r,i,s),didChange:!1},l.syncHooks.push(d)),d.value}function RP(e,t,r,i,s){return gP.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,l=>t(l,r,i,s))}class TP{constructor(t){Be(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Be(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const r=this.updateTick;for(const i of this.listeners){if(r!==this.updateTick)return;i(t)}}update(t){for(const r in t)if(!Object.is(this.state[r],t[r])){this.setState({...this.state,...t});return}}set(t,r){Object.is(this.state[t],r)||this.setState({...this.state,[t]:r})}notifyAll(){const t={...this.state};this.setState(t)}use(t,r,i,s){return oR(this,t,r,i,s)}}class hf extends TP{constructor(t,r={},i){super(t),this.context=r,this.selectors=i}useSyncedValue(t,r){w.useDebugValue(t),_e(()=>{this.state[t]!==r&&this.set(t,r)},[t,r])}useSyncedValueWithCleanup(t,r){const i=this;_e(()=>(i.state[t]!==r&&i.set(t,r),()=>{i.set(t,void 0)}),[i,t,r])}useSyncedValues(t){const r=this,i=Object.values(t);_e(()=>{r.update(t)},[r,...i])}useControlledProp(t,r){w.useDebugValue(t);const i=r!==void 0;_e(()=>{i&&!Object.is(this.state[t],r)&&super.setState({...this.state,[t]:r})},[t,r,i])}select(t,r,i,s){const l=this.selectors[t];return l(this.state,r,i,s)}useState(t,r,i,s){return w.useDebugValue(t),oR(this,this.selectors[t],r,i,s)}useContextCallback(t,r){w.useDebugValue(t);const i=ze(r??pr);this.context[t]=i}useStateSetter(t){const r=w.useRef(void 0);return r.current===void 0&&(r.current=i=>{this.set(t,i)}),r.current}observe(t,r){let i;typeof t=="function"?i=t:i=this.selectors[t];let s=i(this.state);return r(s,s,this),this.subscribe(l=>{const u=i(l);if(!Object.is(s,u)){const d=s;s=u,r(u,d,this)}})}}const CP={open:Je(e=>e.open),domReferenceElement:Je(e=>e.domReferenceElement),referenceElement:Je(e=>e.positionReference??e.referenceElement),floatingElement:Je(e=>e.floatingElement),floatingId:Je(e=>e.floatingId)};class $g extends hf{constructor(r){const{nested:i,noEmit:s,onOpenChange:l,triggerElements:u,...d}=r;super({...d,positionReference:d.referenceElement,domReferenceElement:d.referenceElement},{onOpenChange:l,dataRef:{current:{}},events:I1(),nested:i,noEmit:s,triggerElements:u},CP);Be(this,"setOpen",(r,i)=>{var s,l;if((!r||!this.state.open||R1(i.event))&&(this.context.dataRef.current.openEvent=r?i.event:void 0),!this.context.noEmit){const u={open:r,reason:i.reason,nativeEvent:i.event,nested:this.context.nested,triggerElement:i.trigger};this.context.events.emit("openchange",u)}(l=(s=this.context).onOpenChange)==null||l.call(s,r,i)})}}function OP(e,t){const r=w.useRef(null),i=w.useRef(null);return w.useCallback(s=>{if(e!==void 0){if(r.current!==null){const l=r.current,u=i.current,d=t.context.triggerElements.getById(l);u&&d===u&&t.context.triggerElements.delete(l),r.current=null,i.current=null}s!==null&&(r.current=e,i.current=s,t.context.triggerElements.add(e,s))}},[t,e])}function sR(e,t,r,i){const s=r.useState("isMountedByTrigger",e),l=OP(e,r),u=ze(d=>{if(l(d),!d||!r.select("open"))return;const m=r.select("activeTriggerId");if(m===e){r.update({activeTriggerElement:d,...i});return}m==null&&r.update({activeTriggerId:e,activeTriggerElement:d,...i})});return _e(()=>{s&&r.update({activeTriggerElement:t.current,...i})},[s,r,t,...Object.values(i)]),{registerTrigger:u,isMountedByThisTrigger:s}}function Qg(e){const t=e.useState("open");_e(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const r=e.context.triggerElements.entries().next();if(!r.done){const[i,s]=r.value;e.update({activeTriggerId:i,activeTriggerElement:s})}}},[t,e])}function Zg(e,t,r){const{mounted:i,setMounted:s,transitionStatus:l}=KE(e);t.useSyncedValues({mounted:i,transitionStatus:l});const u=ze(()=>{var m,f;s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),r==null||r(),(f=(m=t.context).onOpenChangeComplete)==null||f.call(m,!1)}),d=t.useState("preventUnmountingOnClose");return Uc({enabled:!d,open:e,ref:t.context.popupRef,onComplete(){e||u()}}),{forceUnmount:u,transitionStatus:l}}class Fc{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,r){const i=this.idMap.get(t);i!==r&&(i!==void 0&&this.elementsSet.delete(i),this.elementsSet.add(r),this.idMap.set(t,r))}delete(t){const r=this.idMap.get(t);r&&(this.elementsSet.delete(r),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const r of this.elementsSet)if(t(r))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function MP(){return new $g({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Fc,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Jg(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:MP(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:xn,inactiveTriggerProps:xn,popupProps:xn}}const gd=Je(e=>e.triggerIdProp??e.activeTriggerId),ey={open:Je(e=>e.openProp??e.open),mounted:Je(e=>e.mounted),transitionStatus:Je(e=>e.transitionStatus),floatingRootContext:Je(e=>e.floatingRootContext),preventUnmountingOnClose:Je(e=>e.preventUnmountingOnClose),payload:Je(e=>e.payload),activeTriggerId:gd,activeTriggerElement:Je(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:Je((e,t)=>t!==void 0&&gd(e)===t),isOpenedByTrigger:Je((e,t)=>t!==void 0&&gd(e)===t&&e.open),isMountedByTrigger:Je((e,t)=>t!==void 0&&gd(e)===t&&e.mounted),triggerProps:Je((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:Je(e=>e.popupProps),popupElement:Je(e=>e.popupElement),positionerElement:Je(e=>e.positionerElement)};function DP(e){const{open:t=!1,onOpenChange:r,elements:i={}}=e,s=Uo(),l=$a()!=null,u=_n(()=>new $g({open:t,onOpenChange:r,referenceElement:i.reference??null,floatingElement:i.floating??null,triggerElements:new Fc,floatingId:s,nested:l,noEmit:!1})).current;return _e(()=>{const d={open:t,floatingId:s};i.reference!==void 0&&(d.referenceElement=i.reference,d.domReferenceElement=zt(i.reference)?i.reference:null),i.floating!==void 0&&(d.floatingElement=i.floating),u.update(d)},[t,s,i.reference,i.floating,u]),u.context.onOpenChange=r,u.context.nested=l,u.context.noEmit=!1,u}function AP(e={}){const{nodeId:t,externalTree:r}=e,i=DP(e),s=e.rootContext||i,l={reference:s.useState("referenceElement"),floating:s.useState("floatingElement"),domReference:s.useState("domReferenceElement")},[u,d]=w.useState(null),m=w.useRef(null),f=qi(r);_e(()=>{l.domReference&&(m.current=l.domReference)},[l.domReference]);const y=Y4({...e,elements:{...l,...u&&{reference:u}}}),p=w.useCallback(O=>{const L=zt(O)?{getBoundingClientRect:()=>O.getBoundingClientRect(),getClientRects:()=>O.getClientRects(),contextElement:O}:O;d(L),y.refs.setReference(L)},[y.refs]),[v,b]=w.useState(null),[S,x]=w.useState(null);s.useSyncedValue("referenceElement",v),s.useSyncedValue("domReferenceElement",zt(v)?v:null),s.useSyncedValue("floatingElement",S);const R=w.useCallback(O=>{(zt(O)||O===null)&&(m.current=O,b(O)),(zt(y.refs.reference.current)||y.refs.reference.current===null||O!==null&&!zt(O))&&y.refs.setReference(O)},[y.refs,b]),T=w.useCallback(O=>{x(O),y.refs.setFloating(O)},[y.refs]),M=w.useMemo(()=>({...y.refs,setReference:R,setFloating:T,setPositionReference:p,domReference:m}),[y.refs,R,T,p]),D=w.useMemo(()=>({...y.elements,domReference:l.domReference}),[y.elements,l.domReference]),C=s.useState("open"),N=s.useState("floatingId"),k=w.useMemo(()=>({...y,dataRef:s.context.dataRef,open:C,onOpenChange:s.setOpen,events:s.context.events,floatingId:N,refs:M,elements:D,nodeId:t,rootStore:s}),[y,M,D,t,s,C,N]);return _e(()=>{s.context.dataRef.current.floatingContext=k;const O=f==null?void 0:f.nodesRef.current.find(L=>L.id===t);O&&(O.context=k)}),w.useMemo(()=>({...y,context:k,refs:M,elements:D,rootStore:s}),[y,M,D,k,s])}function ty(e){const{popupStore:t,noEmit:r=!1,treatPopupAsFloatingElement:i=!1,onOpenChange:s}=e,l=Uo(),u=$a()!=null,d=t.useState("open"),m=t.useState("activeTriggerElement"),f=t.useState(i?"popupElement":"positionerElement"),y=t.context.triggerElements,p=_n(()=>new $g({open:d,referenceElement:m,floatingElement:f,triggerElements:y,onOpenChange:s,floatingId:l,nested:u,noEmit:r})).current;return _e(()=>{const v={open:d,floatingId:l,referenceElement:m,floatingElement:f};zt(m)&&(v.domReferenceElement=m),p.state.positionReference===p.state.referenceElement&&(v.positionReference=m),p.update(v)},[d,l,m,f,p]),p.context.onOpenChange=s,p.context.nested=u,p.context.noEmit=r,p}const up=Wz&&y1;function lR(e,t={}){const r="rootStore"in e?e.rootStore:e,{events:i,dataRef:s}=r.context,{enabled:l=!0,delay:u}=t,d=w.useRef(!1),m=w.useRef(null),f=rr(),y=w.useRef(!0);w.useEffect(()=>{const v=r.select("domReferenceElement");if(!l)return;const b=Rn(v);function S(){const T=r.select("domReferenceElement");!r.select("open")&&on(T)&&T===Fr(jt(T))&&(d.current=!0)}function x(){y.current=!0}function R(){y.current=!1}return b.addEventListener("blur",S),up&&(b.addEventListener("keydown",x,!0),b.addEventListener("pointerdown",R,!0)),()=>{b.removeEventListener("blur",S),up&&(b.removeEventListener("keydown",x,!0),b.removeEventListener("pointerdown",R,!0))}},[r,l]),w.useEffect(()=>{if(!l)return;function v(b){if(b.reason===_o||b.reason===nf){const S=r.select("domReferenceElement");zt(S)&&(m.current=S,d.current=!0)}}return i.on("openchange",v),()=>{i.off("openchange",v)}},[i,l,r]);const p=w.useMemo(()=>({onMouseLeave(){d.current=!1,m.current=null},onFocus(v){const b=v.currentTarget;if(d.current){if(m.current===b)return;d.current=!1,m.current=null}const S=Jn(v.nativeEvent);if(zt(S)){if(up&&!v.relatedTarget){if(!y.current&&!uf(S))return}else if(!e3(S))return}const x=Ud(v.relatedTarget,r.context.triggerElements),{nativeEvent:R,currentTarget:T}=v,M=typeof u=="function"?u():u;if(r.select("open")&&x||M===0||M===void 0){r.setOpen(!0,pt(Ms,R,T));return}f.start(M,()=>{d.current||r.setOpen(!0,pt(Ms,R,T))})},onBlur(v){d.current=!1,m.current=null;const b=v.relatedTarget,S=v.nativeEvent,x=zt(b)&&b.hasAttribute(Ws("focus-guard"))&&b.getAttribute("data-type")==="outside";f.start(0,()=>{var D;const R=r.select("domReferenceElement"),T=Fr(R?R.ownerDocument:document);!b&&T===R||mt((D=s.current.floatingContext)==null?void 0:D.refs.floating.current,T)||mt(R,T)||x||Ud(b??T,r.context.triggerElements)||r.setOpen(!1,pt(Ms,S))})}}),[s,r,f,u]);return w.useMemo(()=>l?{reference:p,trigger:p}:{},[l,p])}const rg=Ws("safe-polygon"),NP=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${S1}`;function kP(e){return e?!!e.closest(NP):!1}class ny{constructor(){Be(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});Be(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.unbindMouseMove=()=>{},this.restTimeoutPending=!1,this.openChangeTimeout=new xa,this.restTimeout=new xa,this.handleCloseOptions=void 0}static create(){return new ny}}function cR(e){const t=_n(ny.create).current,r=e.context.dataRef.current;return r.hoverInteractionState||(r.hoverInteractionState=t),rf(r.hoverInteractionState.disposeEffect),r.hoverInteractionState}const _P=new Set(["click","mousedown"]);function uR(e,t={}){const r="rootStore"in e?e.rootStore:e,i=r.useState("open"),s=r.useState("floatingElement"),l=r.useState("domReferenceElement"),{dataRef:u}=r.context,{enabled:d=!0,closeDelay:m=0}=t,f=cR(r),y=qi(),p=$a(),v=ze(()=>f.interactedInside?!0:u.current.openEvent?_P.has(u.current.openEvent.type):!1),b=ze(()=>{var C;const D=(C=u.current.openEvent)==null?void 0:C.type;return(D==null?void 0:D.includes("mouse"))&&D!=="mousedown"}),S=ze(D=>Ud(D,r.context.triggerElements)),x=w.useCallback((D,C=!0)=>{const N=LP(m,f.pointerType);N&&!f.handler?f.openChangeTimeout.start(N,()=>r.setOpen(!1,pt(Zn,D))):C&&(f.openChangeTimeout.clear(),r.setOpen(!1,pt(Zn,D)))},[m,r,f]),R=ze(()=>{f.unbindMouseMove(),f.handler=void 0}),T=ze(()=>{if(f.performedPointerEventsMutation){const D=jt(s).body;D.style.pointerEvents="",D.removeAttribute(rg),f.performedPointerEventsMutation=!1}}),M=ze(D=>{const C=Jn(D);if(!kP(C)){f.interactedInside=!1;return}f.interactedInside=!0});_e(()=>{i||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,R(),T())},[i,f,R,T]),w.useEffect(()=>()=>{R()},[R]),w.useEffect(()=>T,[T]),_e(()=>{var D,C,N;if(d&&i&&(D=f.handleCloseOptions)!=null&&D.blockPointerEvents&&b()&&zt(l)&&s){f.performedPointerEventsMutation=!0;const k=jt(s).body;k.setAttribute(rg,"");const O=l,L=s,G=(N=(C=y==null?void 0:y.nodesRef.current.find(J=>J.id===p))==null?void 0:C.context)==null?void 0:N.elements.floating;return G&&(G.style.pointerEvents=""),k.style.pointerEvents="none",O.style.pointerEvents="auto",L.style.pointerEvents="auto",()=>{k.style.pointerEvents="",O.style.pointerEvents="",L.style.pointerEvents=""}}},[d,i,l,s,f,b,y,p]),w.useEffect(()=>{if(!d)return;function D(O){v()||!u.current.floatingContext||!r.select("open")||S(O.relatedTarget)||(T(),R(),v()||x(O))}function C(O){var L;f.openChangeTimeout.clear(),T(),(L=f.handler)==null||L.call(f,O),R()}function N(O){v()||x(O,!1)}const k=s;return k&&(k.addEventListener("mouseleave",D),k.addEventListener("mouseenter",C),k.addEventListener("mouseleave",N),k.addEventListener("pointerdown",M,!0)),()=>{k&&(k.removeEventListener("mouseleave",D),k.removeEventListener("mouseenter",C),k.removeEventListener("mouseleave",N),k.removeEventListener("pointerdown",M,!0))}},[d,s,r,u,v,S,x,T,R,M,f])}function LP(e,t){return t&&!zo(t)?0:typeof e=="function"?e():e}function dp(e){return typeof e=="function"?e():e}const zP={current:null};function dR(e,t={}){var J;const r="rootStore"in e?e.rootStore:e,{dataRef:i,events:s}=r.context,{enabled:l=!0,delay:u=0,handleClose:d=null,mouseOnly:m=!1,restMs:f=0,move:y=!0,triggerElementRef:p=zP,externalTree:v,isActiveTrigger:b=!0}=t,S=qi(v),x=cR(r),R=er(d),T=er(u),M=er(f),D=er(l);b&&(x.handleCloseOptions=(J=R.current)==null?void 0:J.__options);const C=ze(()=>x.interactedInside?!0:i.current.openEvent?["click","mousedown"].includes(i.current.openEvent.type):!1),N=ze(Z=>Ud(Z,r.context.triggerElements)),k=w.useCallback((Z,z=!0)=>{const H=Dd(T.current,"close",x.pointerType);H&&!x.handler?x.openChangeTimeout.start(H,()=>r.setOpen(!1,pt(Zn,Z))):z&&(x.openChangeTimeout.clear(),r.setOpen(!1,pt(Zn,Z)))},[T,r,x]),O=ze(()=>{x.unbindMouseMove(),x.handler=void 0}),L=ze(()=>{if(x.performedPointerEventsMutation){const Z=jt(r.select("domReferenceElement")).body;Z.style.pointerEvents="",Z.removeAttribute(rg),x.performedPointerEventsMutation=!1}});w.useEffect(()=>{if(!l)return;function Z(z){z.open||(x.openChangeTimeout.clear(),x.restTimeout.clear(),x.blockMouseMove=!0,x.restTimeoutPending=!1)}return s.on("openchange",Z),()=>{s.off("openchange",Z)}},[l,s,x]);const G=ze(Z=>{var H;if(C()||!i.current.floatingContext||N(Z.relatedTarget))return;const z=p.current;(H=R.current)==null||H.call(R,{...i.current.floatingContext,tree:S,x:Z.clientX,y:Z.clientY,onClose(){L(),O(),!C()&&z===r.select("domReferenceElement")&&k(Z)}})(Z)});return w.useEffect(()=>{if(!l)return;const Z=p.current??(b?r.select("domReferenceElement"):null);if(!zt(Z))return;function z(q){if(x.openChangeTimeout.clear(),x.blockMouseMove=!1,m&&!zo(x.pointerType)||dp(M.current)>0&&!Dd(T.current,"open"))return;const _=Dd(T.current,"open",x.pointerType),j=r.select("domReferenceElement"),U=r.context.triggerElements,ie=(U.hasElement(q.target)||U.hasMatchingElement($=>mt($,q.target)))&&(!j||!mt(j,q.target)),ae=q.currentTarget??null,P=r.select("open"),X=!P||ie;ie&&P?r.setOpen(!0,pt(Zn,q,ae)):_?x.openChangeTimeout.start(_,()=>{X&&r.setOpen(!0,pt(Zn,q,ae))}):X&&r.setOpen(!0,pt(Zn,q,ae))}function H(q){if(C()){L();return}x.unbindMouseMove();const _=r.select("domReferenceElement"),j=jt(_);if(x.restTimeout.clear(),x.restTimeoutPending=!1,N(q.relatedTarget))return;if(R.current&&i.current.floatingContext){r.select("open")||x.openChangeTimeout.clear();const ie=p.current;x.handler=R.current({...i.current.floatingContext,tree:S,x:q.clientX,y:q.clientY,onClose(){L(),O(),D.current&&!C()&&ie===r.select("domReferenceElement")&&k(q,!0)}});const ae=x.handler;ae(q),j.addEventListener("mousemove",ae),x.unbindMouseMove=()=>{j.removeEventListener("mousemove",ae)};return}(x.pointerType==="touch"?!mt(r.select("floatingElement"),q.relatedTarget):!0)&&k(q)}function V(q){G(q)}return r.select("open")&&Z.addEventListener("mouseleave",V),y&&Z.addEventListener("mousemove",z,{once:!0}),Z.addEventListener("mouseenter",z),Z.addEventListener("mouseleave",H),()=>{Z.removeEventListener("mouseleave",V),y&&Z.removeEventListener("mousemove",z),Z.removeEventListener("mouseenter",z),Z.removeEventListener("mouseleave",H)}},[O,L,i,T,k,r,l,R,G,x,b,C,N,m,y,M,p,S,D]),w.useMemo(()=>{if(!l)return;function Z(z){x.pointerType=z.pointerType}return{onPointerDown:Z,onPointerEnter:Z,onMouseMove(z){const{nativeEvent:H}=z,V=z.currentTarget,q=r.select("domReferenceElement"),_=r.context.triggerElements,j=r.select("open"),U=(_.hasElement(z.target)||_.hasMatchingElement(ae=>mt(ae,z.target)))&&(!q||!mt(q,z.target));if(m&&!zo(x.pointerType)||j&&!U||dp(M.current)===0||!U&&x.restTimeoutPending&&z.movementX**2+z.movementY**2<2)return;x.restTimeout.clear();function ie(){if(x.restTimeoutPending=!1,C())return;const ae=r.select("open");!x.blockMouseMove&&(!ae||U)&&r.setOpen(!0,pt(Zn,H,V))}x.pointerType==="touch"?ra.flushSync(()=>{ie()}):U&&j?ie():(x.restTimeoutPending=!0,x.restTimeout.start(dp(M.current),ie))}}},[l,x,C,m,r,M])}function mf(e=[]){const t=e.map(f=>f==null?void 0:f.reference),r=e.map(f=>f==null?void 0:f.floating),i=e.map(f=>f==null?void 0:f.item),s=e.map(f=>f==null?void 0:f.trigger),l=w.useCallback(f=>yd(f,e,"reference"),t),u=w.useCallback(f=>yd(f,e,"floating"),r),d=w.useCallback(f=>yd(f,e,"item"),i),m=w.useCallback(f=>yd(f,e,"trigger"),s);return w.useMemo(()=>({getReferenceProps:l,getFloatingProps:u,getItemProps:d,getTriggerProps:m}),[l,u,d,m])}function yd(e,t,r){var u;const i=new Map,s=r==="item",l={};r==="floating"&&(l.tabIndex=-1,l[Wp]="");for(const d in e)s&&e&&(d===b1||d===w1)||(l[d]=e[d]);for(let d=0;d<t.length;d+=1){let m;const f=(u=t[d])==null?void 0:u[r];typeof f=="function"?m=e?f(e):null:m=f,m&&ox(l,m,s,i)}return ox(l,e,s,i),l}function ox(e,t,r,i){var s;for(const l in t){const u=t[l];r&&(l===b1||l===w1)||(l.startsWith("on")?(i.has(l)||i.set(l,[]),typeof u=="function"&&((s=i.get(l))==null||s.push(u),e[l]=(...d)=>{var m;return(m=i.get(l))==null?void 0:m.map(f=>f(...d)).find(f=>f!==void 0)})):e[l]=u)}}const PP="Escape";function pf(e,t,r){switch(e){case"vertical":return t;case"horizontal":return r;default:return t||r}}function vd(e,t){return pf(t,e===Ig||e===Hc,e===Ii||e===Ui)}function fp(e,t,r){return pf(t,e===Hc,r?e===Ii:e===Ui)||e==="Enter"||e===" "||e===""}function IP(e,t,r){return pf(t,r?e===Ii:e===Ui,e===Hc)}function UP(e,t,r,i){const s=r?e===Ui:e===Ii,l=e===Ig;return t==="both"||t==="horizontal"&&i&&i>1?e===PP:pf(t,s,l)}function jP(e,t){const r="rootStore"in e?e.rootStore:e,i=r.useState("open"),s=r.useState("floatingElement"),l=r.useState("domReferenceElement"),u=r.context.dataRef,{listRef:d,activeIndex:m,onNavigate:f=()=>{},enabled:y=!0,selectedIndex:p=null,allowEscape:v=!1,loopFocus:b=!1,nested:S=!1,rtl:x=!1,virtual:R=!1,focusItemOnOpen:T="auto",focusItemOnHover:M=!0,openOnArrowKeyDown:D=!0,disabledIndices:C=void 0,orientation:N="vertical",parentOrientation:k,cols:O=1,id:L,resetOnPointerLeave:G=!0,externalTree:J}=t,Z=jd(s),z=er(Z),H=$a(),V=qi(J);_e(()=>{u.current.orientation=N},[u,N]);const q=$p(l),_=w.useRef(T),j=w.useRef(p??-1),U=w.useRef(null),ie=w.useRef(!0),ae=ze(pe=>{f(j.current===-1?null:j.current,pe)}),P=w.useRef(ae),X=w.useRef(!!s),$=w.useRef(i),F=w.useRef(!1),te=w.useRef(!1),ue=er(C),he=er(i),we=er(p),ve=er(G),ke=ze(()=>{function pe(Ge){R?V==null||V.events.emit("virtualfocus",Ge):fc(Ge,{sync:F.current,preventScroll:!0})}const De=d.current[j.current],xe=te.current;De&&pe(De),(F.current?Ge=>Ge():requestAnimationFrame)(()=>{var ot;const Ge=d.current[j.current]||De;if(!Ge)return;De||pe(Ge),ne&&(xe||!ie.current)&&((ot=Ge.scrollIntoView)==null||ot.call(Ge,{block:"nearest",inline:"nearest"}))})});_e(()=>{y&&(i&&s?(j.current=p??-1,_.current&&p!=null&&(te.current=!0,ae())):X.current&&(j.current=-1,P.current()))},[y,i,s,p,ae]),_e(()=>{if(y){if(!i){F.current=!1;return}if(s)if(m==null){if(F.current=!1,we.current!=null)return;if(X.current&&(j.current=-1,ke()),(!$.current||!X.current)&&_.current&&(U.current!=null||_.current===!0&&U.current==null)){let pe=0;const De=()=>{d.current[0]==null?(pe<2&&(pe?requestAnimationFrame:queueMicrotask)(De),pe+=1):(j.current=U.current==null||fp(U.current,N,x)||S?rp(d):jS(d),U.current=null,ae())};De()}}else uc(d,m)||(j.current=m,ke(),te.current=!1)}},[y,i,s,m,we,S,d,N,x,ae,ke,ue]),_e(()=>{var Ge,Le;if(!y||s||!V||R||!X.current)return;const pe=V.nodesRef.current,De=(Le=(Ge=pe.find(ot=>ot.id===H))==null?void 0:Ge.context)==null?void 0:Le.elements.floating,xe=Fr(jt(s)),qe=pe.some(ot=>ot.context&&mt(ot.context.elements.floating,xe));De&&!qe&&ie.current&&De.focus({preventScroll:!0})},[y,s,V,H,R]),_e(()=>{P.current=ae,$.current=i,X.current=!!s}),_e(()=>{i||(U.current=null,_.current=T)},[i,T]);const Xe=m!=null,ne=w.useMemo(()=>{function pe(xe){if(!he.current)return;const qe=d.current.indexOf(xe.currentTarget);qe!==-1&&j.current!==qe&&(j.current=qe,ae(xe))}return{onFocus(xe){F.current=!0,pe(xe)},onClick:({currentTarget:xe})=>xe.focus({preventScroll:!0}),onMouseMove(xe){F.current=!0,te.current=!1,M&&pe(xe)},onPointerLeave(xe){var Ge;if(!he.current||!ie.current||xe.pointerType==="touch")return;F.current=!0;const qe=xe.relatedTarget;!M||d.current.includes(qe)||ve.current&&(fc(null,{sync:!0}),j.current=-1,ae(xe),R||(Ge=z.current)==null||Ge.focus({preventScroll:!0}))}}},[he,z,M,d,ae,ve,R]),fe=w.useCallback(()=>{var pe,De,xe;return k??((xe=(De=(pe=V==null?void 0:V.nodesRef.current.find(qe=>qe.id===H))==null?void 0:pe.context)==null?void 0:De.dataRef)==null?void 0:xe.current.orientation)},[H,V,k]),Se=ze(pe=>{if(ie.current=!1,F.current=!0,pe.which===229||!he.current&&pe.currentTarget===z.current)return;if(S&&UP(pe.key,N,x,O)){vd(pe.key,fe())||Gn(pe),r.setOpen(!1,pt(Od,pe.nativeEvent)),on(l)&&(R?V==null||V.events.emit("virtualfocus",l):l.focus());return}const De=j.current,xe=rp(d,C),qe=jS(d,C);if(q||(pe.key==="Home"&&(Gn(pe),j.current=xe,ae(pe)),pe.key==="End"&&(Gn(pe),j.current=qe,ae(pe))),O>1){const Ge=Array.from({length:d.current.length},()=>({width:1,height:1})),Le=m3(Ge,O),ot=Le.findIndex(tt=>tt!=null&&!dc(d,tt,C)),Pt=Le.reduce((tt,ft,Ct)=>ft!=null&&!dc(d,ft,C)?Ct:tt,-1),Ft=Le[h3({current:Le.map(tt=>tt!=null?d.current[tt]:null)},{event:pe,orientation:N,loopFocus:b,rtl:x,cols:O,disabledIndices:g3([...(typeof C!="function"?C:null)||d.current.map((tt,ft)=>dc(d,ft,C)?ft:void 0),void 0],Le),minIndex:ot,maxIndex:Pt,prevIndex:p3(j.current>qe?xe:j.current,Ge,Le,O,pe.key===Hc?"bl":pe.key===(x?Ii:Ui)?"tr":"tl"),stopEvent:!0})];if(Ft!=null&&(j.current=Ft,ae(pe)),N==="both")return}if(vd(pe.key,N)){if(Gn(pe),i&&!R&&Fr(pe.currentTarget.ownerDocument)===pe.currentTarget){j.current=fp(pe.key,N,x)?xe:qe,ae(pe);return}fp(pe.key,N,x)?b?De>=qe?v&&De!==d.current.length?j.current=-1:(F.current=!1,j.current=xe):j.current=Yn(d,{startingIndex:De,disabledIndices:C}):j.current=Math.min(qe,Yn(d,{startingIndex:De,disabledIndices:C})):b?De<=xe?v&&De!==-1?j.current=d.current.length:(F.current=!1,j.current=qe):j.current=Yn(d,{startingIndex:De,decrement:!0,disabledIndices:C}):j.current=Math.max(xe,Yn(d,{startingIndex:De,decrement:!0,disabledIndices:C})),uc(d,j.current)&&(j.current=-1),ae(pe)}}),Ne=w.useMemo(()=>R&&i&&Xe&&{"aria-activedescendant":`${L}-${m}`},[R,i,Xe,L,m]),Te=w.useMemo(()=>({"aria-orientation":N==="both"?void 0:N,...q?{}:Ne,onKeyDown(pe){if(pe.key==="Tab"&&pe.shiftKey&&i&&!R){const De=Jn(pe.nativeEvent);if(De&&!mt(z.current,De))return;Gn(pe),r.setOpen(!1,pt(Gs,pe.nativeEvent)),on(l)&&l.focus();return}Se(pe)},onPointerMove(){ie.current=!0}}),[Ne,Se,z,N,q,r,i,R,l]),Ee=w.useMemo(()=>{function pe(xe){T==="auto"&&x1(xe.nativeEvent)&&(_.current=!R)}function De(xe){_.current=T,T==="auto"&&E1(xe.nativeEvent)&&(_.current=!0)}return{onKeyDown(xe){const qe=r.select("open");ie.current=!1;const Ge=xe.key.startsWith("Arrow"),Le=IP(xe.key,fe(),x),ot=vd(xe.key,N),Pt=(S?Le:ot)||xe.key==="Enter"||xe.key.trim()==="";if(R&&qe)return Se(xe);if(!(!qe&&!D&&Ge)){if(Pt){const Ft=vd(xe.key,fe());U.current=S&&Ft?null:xe.key}if(S){Le&&(Gn(xe),qe?(j.current=rp(d,ue.current),ae(xe)):r.setOpen(!0,pt(Od,xe.nativeEvent,xe.currentTarget)));return}ot&&(we.current!=null&&(j.current=we.current),Gn(xe),!qe&&D?r.setOpen(!0,pt(Od,xe.nativeEvent,xe.currentTarget)):Se(xe),qe&&ae(xe))}},onFocus(xe){r.select("open")&&!R&&(j.current=-1,ae(xe))},onPointerDown:De,onPointerEnter:De,onMouseDown:pe,onClick:pe}},[Se,ue,T,d,S,ae,r,D,N,fe,x,we,R]),Re=w.useMemo(()=>({...Ne,...Ee}),[Ne,Ee]);return w.useMemo(()=>y?{reference:Re,floating:Te,item:ne,trigger:Ee}:{},[y,Re,Te,Ee,ne])}const HP=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function fR(e,t={}){const r="rootStore"in e?e.rootStore:e,i=r.useState("open"),s=r.useState("floatingId"),l=r.useState("domReferenceElement"),u=r.useState("floatingElement"),{role:d="dialog"}=t,m=Uo(),f=(l==null?void 0:l.id)||m,y=w.useMemo(()=>{var M;return((M=jd(u))==null?void 0:M.id)||s},[u,s]),p=HP.get(d)??d,b=$a()!=null,S=w.useMemo(()=>p==="tooltip"||d==="label"?xn:{"aria-haspopup":p==="alertdialog"?"dialog":p,"aria-expanded":"false",...p==="listbox"&&{role:"combobox"},...p==="menu"&&b&&{role:"menuitem"},...d==="select"&&{"aria-autocomplete":"none"},...d==="combobox"&&{"aria-autocomplete":"list"}},[p,b,d]),x=w.useMemo(()=>p==="tooltip"||d==="label"?{[`aria-${d==="label"?"labelledby":"describedby"}`]:i?y:void 0}:{...S,"aria-expanded":i?"true":"false","aria-controls":i?y:void 0,...p==="menu"&&{id:f}},[p,y,i,f,d,S]),R=w.useMemo(()=>{const M={id:y,...p&&{role:p}};return p==="tooltip"||d==="label"?M:{...M,...p==="menu"&&{"aria-labelledby":f}}},[p,y,f,d]),T=w.useCallback(({active:M,selected:D})=>{const C={role:"option",...M&&{id:`${y}-fui-option`}};switch(d){case"select":case"combobox":return{...C,"aria-selected":D}}return{}},[y,d]);return w.useMemo(()=>({reference:x,floating:R,item:T,trigger:S}),[x,R,S,T])}function BP(e,t){const r="rootStore"in e?e.rootStore:e,i=r.context.dataRef,s=r.useState("open"),{listRef:l,activeIndex:u,onMatch:d,onTypingChange:m,enabled:f=!0,resetMs:y=750,selectedIndex:p=null}=t,v=rr(),b=w.useRef(""),S=w.useRef(p??u??-1),x=w.useRef(null);_e(()=>{!s&&p!==null||(v.clear(),x.current=null,b.current!==""&&(b.current=""))},[s,p,v]),_e(()=>{s&&b.current===""&&(S.current=p??u??-1)},[s,p,u]);const R=ze(N=>{N?i.current.typing||(i.current.typing=N,m==null||m(N)):i.current.typing&&(i.current.typing=N,m==null||m(N))}),T=ze(N=>{function k(z,H,V){const q=H.find(_=>(_==null?void 0:_.toLocaleLowerCase().indexOf(V.toLocaleLowerCase()))===0);return q?z.indexOf(q):-1}const O=l.current;if(b.current.length>0&&b.current[0]!==" "&&(k(O,O,b.current)===-1?R(!1):N.key===" "&&Gn(N)),O==null||N.key.length!==1||N.ctrlKey||N.metaKey||N.altKey)return;s&&N.key!==" "&&(Gn(N),R(!0));const L=b.current==="";L&&(S.current=p??u??-1),O.every(z=>{var H,V;return z?((H=z[0])==null?void 0:H.toLocaleLowerCase())!==((V=z[1])==null?void 0:V.toLocaleLowerCase()):!0})&&b.current===N.key&&(b.current="",S.current=x.current),b.current+=N.key,v.start(y,()=>{b.current="",S.current=x.current,R(!1)});const J=L?p??u??-1:S.current,Z=k(O,[...O.slice((J||0)+1),...O.slice(0,(J||0)+1)],b.current);Z!==-1?(d==null||d(Z),x.current=Z):N.key!==" "&&(b.current="",R(!1))}),M=ze(N=>{const k=N.relatedTarget,O=r.select("domReferenceElement"),L=r.select("floatingElement"),G=mt(O,k),J=mt(L,k);G||J||(v.clear(),b.current="",S.current=x.current,R(!1))}),D=w.useMemo(()=>({onKeyDown:T,onBlur:M}),[T,M]),C=w.useMemo(()=>({onKeyDown:T,onKeyUp(N){N.key===" "&&R(!1)},onBlur:M}),[T,M,R]);return w.useMemo(()=>f?{reference:D,floating:C}:{},[f,D,C])}function sx(e,t){const[r,i]=e;let s=!1;const l=t.length;for(let u=0,d=l-1;u<l;d=u++){const[m,f]=t[u]||[0,0],[y,p]=t[d]||[0,0];f>=i!=p>=i&&r<=(y-m)*(i-f)/(p-f)+m&&(s=!s)}return s}function FP(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function hR(e={}){const{buffer:t=.5,blockPointerEvents:r=!1,requireIntent:i=!0}=e,s=new xa;let l=!1,u=null,d=null,m=typeof performance<"u"?performance.now():0;function f(p,v){const b=performance.now(),S=b-m;if(u===null||d===null||S===0)return u=p,d=v,m=b,null;const x=p-u,R=v-d,M=Math.sqrt(x*x+R*R)/S;return u=p,d=v,m=b,M}const y=({x:p,y:v,placement:b,elements:S,onClose:x,nodeId:R,tree:T})=>function(D){function C(){s.clear(),x()}if(s.clear(),!S.domReference||!S.floating||b==null||p==null||v==null)return;const{clientX:N,clientY:k}=D,O=[N,k],L=Jn(D),G=D.type==="mouseleave",J=mt(S.floating,L),Z=mt(S.domReference,L),z=S.domReference.getBoundingClientRect(),H=S.floating.getBoundingClientRect(),V=b.split("-")[0],q=p>H.right-H.width/2,_=v>H.bottom-H.height/2,j=FP(O,z),U=H.width>z.width,ie=H.height>z.height,ae=(U?z:H).left,P=(U?z:H).right,X=(ie?z:H).top,$=(ie?z:H).bottom;if(J&&(l=!0,!G))return;if(Z&&(l=!1),Z&&!G){l=!0;return}if(G&&zt(D.relatedTarget)&&mt(S.floating,D.relatedTarget)||T&&Do(T.nodesRef.current,R).some(({context:ue})=>ue==null?void 0:ue.open))return;if(V==="top"&&v>=z.bottom-1||V==="bottom"&&v<=z.top+1||V==="left"&&p>=z.right-1||V==="right"&&p<=z.left+1)return C();let F=[];switch(V){case"top":F=[[ae,z.top+1],[ae,H.bottom-1],[P,H.bottom-1],[P,z.top+1]];break;case"bottom":F=[[ae,H.top+1],[ae,z.bottom-1],[P,z.bottom-1],[P,H.top+1]];break;case"left":F=[[H.right-1,$],[H.right-1,X],[z.left+1,X],[z.left+1,$]];break;case"right":F=[[z.right-1,$],[z.right-1,X],[H.left+1,X],[H.left+1,$]];break}function te([ue,he]){switch(V){case"top":{const we=[U?ue+t/2:q?ue+t*4:ue-t*4,he+t+1],ve=[U?ue-t/2:q?ue+t*4:ue-t*4,he+t+1],ke=[[H.left,q||U?H.bottom-t:H.top],[H.right,q?U?H.bottom-t:H.top:H.bottom-t]];return[we,ve,...ke]}case"bottom":{const we=[U?ue+t/2:q?ue+t*4:ue-t*4,he-t],ve=[U?ue-t/2:q?ue+t*4:ue-t*4,he-t],ke=[[H.left,q||U?H.top+t:H.bottom],[H.right,q?U?H.top+t:H.bottom:H.top+t]];return[we,ve,...ke]}case"left":{const we=[ue+t+1,ie?he+t/2:_?he+t*4:he-t*4],ve=[ue+t+1,ie?he-t/2:_?he+t*4:he-t*4];return[...[[_||ie?H.right-t:H.left,H.top],[_?ie?H.right-t:H.left:H.right-t,H.bottom]],we,ve]}case"right":{const we=[ue-t,ie?he+t/2:_?he+t*4:he-t*4],ve=[ue-t,ie?he-t/2:_?he+t*4:he-t*4],ke=[[_||ie?H.left+t:H.right,H.top],[_?ie?H.left+t:H.right:H.left+t,H.bottom]];return[we,ve,...ke]}default:return[]}}if(!sx([N,k],F)){if(l&&!j)return C();if(!G&&i){const ue=f(D.clientX,D.clientY);if(ue!==null&&ue<.1)return C()}sx([N,k],te([p,v]))?!l&&i&&s.start(40,C):C()}};return y.__options={blockPointerEvents:r},y}let VP=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),YP=(function(e){return e[e.open=bo.open]="open",e[e.closed=bo.closed]="closed",e[e.startingStyle=bo.startingStyle]="startingStyle",e[e.endingStyle=bo.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const mR=w.createContext(void 0);function qP(){const e=w.useContext(mR);if(e===void 0)throw new Error(Ln(26));return e}const pR="ArrowUp",gR="ArrowDown",yR="ArrowLeft",vR="ArrowRight",bR="Home",wR="End",GP=new Set([yR,vR]),KP=new Set([pR,gR]),XP=new Set([...GP,...KP]);[...XP];const SR=new Set([pR,gR,yR,vR,bR,wR]),WP={...jo,...Zs,nestedDialogOpen(e){return e?{[YP.nestedDialogOpen]:""}:null}},ry=w.forwardRef(function(t,r){const{className:i,finalFocus:s,initialFocus:l,render:u,...d}=t,{store:m}=Yi(),f=m.useState("descriptionElementId"),y=m.useState("disablePointerDismissal"),p=m.useState("floatingRootContext"),v=m.useState("popupProps"),b=m.useState("modal"),S=m.useState("mounted"),x=m.useState("nested"),R=m.useState("nestedOpenDialogCount"),T=m.useState("open"),M=m.useState("openMethod"),D=m.useState("titleElementId"),C=m.useState("transitionStatus"),N=m.useState("role");qP(),Uc({open:T,ref:m.context.popupRef,onComplete(){var Z,z;T&&((z=(Z=m.context).onOpenChangeComplete)==null||z.call(Z,!0))}});function k(Z){return Z==="touch"?m.context.popupRef.current:!0}const O=l===void 0?k:l,L=R>0,J=Qt("div",t,{state:{open:T,nested:x,transitionStatus:C,nestedDialogOpen:L},props:[v,{"aria-labelledby":D??void 0,"aria-describedby":f??void 0,role:N,tabIndex:-1,hidden:!S,onKeyDown(Z){SR.has(Z.key)&&Z.stopPropagation()},style:{[VP.nestedDialogs]:R}},d],ref:[r,m.context.popupRef,m.useStateSetter("popupElement")],stateAttributesMapping:WP});return I.jsx(X1,{context:p,openInteractionType:M,disabled:!S,closeOnFocusOut:!y,initialFocus:O,returnFocus:s,modal:b!==!1,restoreFocus:"popup",children:J})});function xR(e){return Mg(19)?e:e?"true":void 0}const ER=w.forwardRef(function(t,r){const{cutout:i,...s}=t;let l;if(i){const u=i==null?void 0:i.getBoundingClientRect();l=`polygon(
213
- 0% 0%,
214
- 100% 0%,
215
- 100% 100%,
216
- 0% 100%,
217
- 0% 0%,
218
- ${u.left}px ${u.top}px,
219
- ${u.left}px ${u.bottom}px,
220
- ${u.right}px ${u.bottom}px,
221
- ${u.right}px ${u.top}px,
222
- ${u.left}px ${u.top}px
223
- )`}return I.jsx("div",{ref:r,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:l}})}),ay=w.forwardRef(function(t,r){const{keepMounted:i=!1,...s}=t,{store:l}=Yi(),u=l.useState("mounted"),d=l.useState("modal"),m=l.useState("open");return u||i?I.jsx(mR.Provider,{value:i,children:I.jsxs(K1,{ref:r,...s,children:[u&&d===!0&&I.jsx(ER,{ref:l.context.internalBackdropRef,inert:xR(!m)}),t.children]})}):null});function iy(e){const t=w.useRef(!0);t.current&&(t.current=!1,e())}let lx={},cx={},ux="";function $P(e){if(typeof document>"u")return!1;const t=jt(e);return Rn(t).innerWidth-t.documentElement.clientWidth>0}function QP(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const r=jt(e),i=r.documentElement,s=r.body,l=Fi(i)?i:s,u=l.style.overflowY,d=i.style.scrollbarGutter;i.style.scrollbarGutter="stable",l.style.overflowY="scroll";const m=l.offsetWidth;l.style.overflowY="hidden";const f=l.offsetWidth;return l.style.overflowY=u,i.style.scrollbarGutter=d,m===f}function ZP(e){const t=jt(e),r=t.documentElement,i=t.body,s=Fi(r)?r:i,l={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,l)}}function JP(e){var v;const t=jt(e),r=t.documentElement,i=t.body,s=Rn(r);let l=0,u=0,d=!1;const m=mn.create();if(Pg&&(((v=s.visualViewport)==null?void 0:v.scale)??1)!==1)return()=>{};function f(){const b=s.getComputedStyle(r),S=s.getComputedStyle(i),T=(b.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";l=r.scrollTop,u=r.scrollLeft,lx={scrollbarGutter:r.style.scrollbarGutter,overflowY:r.style.overflowY,overflowX:r.style.overflowX},ux=r.style.scrollBehavior,cx={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};const M=r.scrollHeight>r.clientHeight,D=r.scrollWidth>r.clientWidth,C=b.overflowY==="scroll"||S.overflowY==="scroll",N=b.overflowX==="scroll"||S.overflowX==="scroll",k=Math.max(0,s.innerWidth-i.clientWidth),O=Math.max(0,s.innerHeight-i.clientHeight),L=parseFloat(S.marginTop)+parseFloat(S.marginBottom),G=parseFloat(S.marginLeft)+parseFloat(S.marginRight),J=Fi(r)?r:i;if(d=QP(e),d){r.style.scrollbarGutter=T,J.style.overflowY="hidden",J.style.overflowX="hidden";return}Object.assign(r.style,{scrollbarGutter:T,overflowY:"hidden",overflowX:"hidden"}),(M||C)&&(r.style.overflowY="scroll"),(D||N)&&(r.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:L||O?`calc(100dvh - ${L+O}px)`:"100dvh",width:G||k?`calc(100vw - ${G+k}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),i.scrollTop=l,i.scrollLeft=u,r.setAttribute("data-base-ui-scroll-locked",""),r.style.scrollBehavior="unset"}function y(){Object.assign(r.style,lx),Object.assign(i.style,cx),d||(r.scrollTop=l,r.scrollLeft=u,r.removeAttribute("data-base-ui-scroll-locked"),r.style.scrollBehavior=ux)}function p(){y(),m.request(f)}return f(),s.addEventListener("resize",p),()=>{m.cancel(),y(),typeof s.removeEventListener=="function"&&s.removeEventListener("resize",p)}}class eI{constructor(){Be(this,"lockCount",0);Be(this,"restore",null);Be(this,"timeoutLock",xa.create());Be(this,"timeoutUnlock",xa.create());Be(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Be(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const i=jt(t).documentElement,s=Rn(i).getComputedStyle(i).overflowY;if(s==="hidden"||s==="clip"){this.restore=pr;return}const l=g1||!$P(t);this.restore=l?ZP(t):JP(t)}}const tI=new eI;function RR(e=!0,t=null){_e(()=>{if(e)return tI.acquire(t)},[e,t])}function nI(e){const t=w.useRef(""),r=w.useCallback(s=>{s.defaultPrevented||(t.current=s.pointerType,e(s,s.pointerType))},[e]);return{onClick:w.useCallback(s=>{if(s.detail===0){e(s,"keyboard");return}"pointerType"in s?e(s,s.pointerType):e(s,t.current),t.current=""},[e]),onPointerDown:r}}function TR(e){const[t,r]=w.useState(null),i=ze((d,m)=>{e||r(m||(g1?"touch":""))}),s=w.useCallback(()=>{r(null)},[]),{onClick:l,onPointerDown:u}=nI(i);return w.useMemo(()=>({openMethod:t,reset:s,triggerProps:{onClick:l,onPointerDown:u}}),[t,s,l,u])}function CR(e){const{store:t,parentContext:r,actionsRef:i}=e,s=t.useState("open"),l=t.useState("disablePointerDismissal"),u=t.useState("modal"),d=t.useState("popupElement"),{openMethod:m,triggerProps:f,reset:y}=TR(s);Qg(t);const{forceUnmount:p}=Zg(s,t,()=>{y()}),v=ze(J=>{const Z=pt(J);return Z.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},Z}),b=w.useCallback(()=>{t.setOpen(!1,v(Ag))},[t,v]);w.useImperativeHandle(i,()=>({unmount:p,close:b}),[p,b]);const S=ty({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[x,R]=w.useState(0),T=x===0,M=fR(S),D=Xg(S,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:u==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(J){if(!t.context.outsidePressEnabledRef.current||"button"in J&&J.button!==0||"touches"in J&&J.touches.length!==1)return!1;const Z=Jn(J);if(T&&!l){const z=Z;return u&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===z||t.context.backdropRef.current===z||mt(z,d)&&!(z!=null&&z.hasAttribute("data-base-ui-portal")):!0}return!1},escapeKey:T});RR(s&&u===!0,d);const{getReferenceProps:C,getFloatingProps:N,getTriggerProps:k}=mf([M,D]);t.useContextCallback("onNestedDialogOpen",J=>{R(J+1)}),t.useContextCallback("onNestedDialogClose",()=>{R(0)}),w.useEffect(()=>(r!=null&&r.onNestedDialogOpen&&s&&r.onNestedDialogOpen(x),r!=null&&r.onNestedDialogClose&&!s&&r.onNestedDialogClose(),()=>{r!=null&&r.onNestedDialogClose&&s&&r.onNestedDialogClose()}),[s,r,x]);const O=w.useMemo(()=>C(f),[C,f]),L=w.useMemo(()=>k(f),[k,f]),G=w.useMemo(()=>N(),[N]);t.useSyncedValues({openMethod:m,activeTriggerProps:O,inactiveTriggerProps:L,popupProps:G,floatingRootContext:S,nestedOpenDialogCount:x})}const rI={...ey,modal:Je(e=>e.modal),nested:Je(e=>e.nested),nestedOpenDialogCount:Je(e=>e.nestedOpenDialogCount),disablePointerDismissal:Je(e=>e.disablePointerDismissal),openMethod:Je(e=>e.openMethod),descriptionElementId:Je(e=>e.descriptionElementId),titleElementId:Je(e=>e.titleElementId),viewportElement:Je(e=>e.viewportElement),role:Je(e=>e.role)};class OR extends hf{constructor(r){super(aI(r),{popupRef:w.createRef(),backdropRef:w.createRef(),internalBackdropRef:w.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new Fc,onOpenChange:void 0,onOpenChangeComplete:void 0},rI);Be(this,"setOpen",(r,i)=>{var d,m,f,y;if(i.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!r&&i.trigger==null&&this.state.activeTriggerId!=null&&(i.trigger=this.state.activeTriggerElement??void 0),(m=(d=this.context).onOpenChange)==null||m.call(d,r,i),i.isCanceled)return;const s={open:r,nativeEvent:i.event,reason:i.reason,nested:this.state.nested};(f=this.state.floatingRootContext.context.events)==null||f.emit("openchange",s);const l={open:r},u=((y=i.trigger)==null?void 0:y.id)??null;(u||r)&&(l.activeTriggerId=u,l.activeTriggerElement=i.trigger??null),this.update(l)})}}function aI(e={}){return{...Jg(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function MR(e){const{children:t,open:r,defaultOpen:i=!1,onOpenChange:s,onOpenChangeComplete:l,disablePointerDismissal:u=!1,modal:d=!0,actionsRef:m,handle:f,triggerId:y,defaultTriggerId:p=null}=e,v=Yi(!0),b=!!v,S=_n(()=>(f==null?void 0:f.store)??new OR({open:i,openProp:r,activeTriggerId:p,triggerIdProp:y,modal:d,disablePointerDismissal:u,nested:b})).current;iy(()=>{r===void 0&&S.state.open===!1&&i===!0&&S.update({open:!0,activeTriggerId:p})}),S.useControlledProp("openProp",r),S.useControlledProp("triggerIdProp",y),S.useSyncedValues({disablePointerDismissal:u,nested:b,modal:d}),S.useContextCallback("onOpenChange",s),S.useContextCallback("onOpenChangeComplete",l);const x=S.useState("payload");CR({store:S,actionsRef:m,parentContext:v==null?void 0:v.store.context});const R=w.useMemo(()=>({store:S}),[S]);return I.jsx(Fg.Provider,{value:R,children:typeof t=="function"?t({payload:x}):t})}const oy=w.forwardRef(function(t,r){const{render:i,className:s,id:l,...u}=t,{store:d}=Yi(),m=Hi(l);return d.useSyncedValueWithCleanup("titleElementId",m),Qt("h2",t,{ref:r,props:[{id:m},u]})});function iI({...e}){return I.jsx(MR,{"data-slot":"sheet",...e})}function oI({...e}){return I.jsx(ay,{"data-slot":"sheet-portal",...e})}function sI({className:e,...t}){return I.jsx(Vg,{"data-slot":"sheet-overlay",className:Ye("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50",e),...t})}function lI({className:e,children:t,side:r="right",showCloseButton:i=!0,...s}){return I.jsxs(oI,{children:[I.jsx(sI,{}),I.jsxs(ry,{"data-slot":"sheet-content","data-side":r,className:Ye("bg-background data-open:animate-in data-closed:animate-out data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...s,children:[t,i&&I.jsxs(df,{"data-slot":"sheet-close",render:I.jsx(ya,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[I.jsx(zc,{}),I.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function cI({className:e,...t}){return I.jsx("div",{"data-slot":"sheet-header",className:Ye("gap-0.5 p-4 flex flex-col",e),...t})}function uI({className:e,...t}){return I.jsx(oy,{"data-slot":"sheet-title",className:Ye("text-foreground text-base font-medium",e),...t})}function dI({className:e,...t}){return I.jsx(Yg,{"data-slot":"sheet-description",className:Ye("text-muted-foreground text-sm",e),...t})}const DR=w.createContext(void 0);function Vc(e){const t=w.useContext(DR);if(t===void 0&&!e)throw new Error(Ln(72));return t}const fI={...ey,disabled:Je(e=>e.disabled),instantType:Je(e=>e.instantType),isInstantPhase:Je(e=>e.isInstantPhase),trackCursorAxis:Je(e=>e.trackCursorAxis),disableHoverablePopup:Je(e=>e.disableHoverablePopup),lastOpenChangeReason:Je(e=>e.openChangeReason),closeDelay:Je(e=>e.closeDelay),hasViewport:Je(e=>e.hasViewport)};class sy extends hf{constructor(r){super({...hI(),...r},{popupRef:w.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Fc},fI);Be(this,"setOpen",(r,i)=>{var f,y;const s=i.reason,l=s===Zn,u=r&&s===Ms,d=!r&&(s===_o||s===nf);if(i.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},(y=(f=this.context).onOpenChange)==null||y.call(f,r,i),i.isCanceled)return;const m=()=>{var b;const p={open:r,openChangeReason:s};u?p.instantType="focus":d?p.instantType="dismiss":s===Zn&&(p.instantType=void 0);const v=((b=i.trigger)==null?void 0:b.id)??null;(v||r)&&(p.activeTriggerId=v,p.activeTriggerElement=i.trigger??null),this.update(p)};l?ra.flushSync(m):m()})}static useStore(r,i){const s=_n(()=>new sy(i)).current,l=r??s,u=ty({popupStore:l,onOpenChange:l.setOpen});return l.state.floatingRootContext=u,l}}function hI(){return{...Jg(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}const mI=Wg(function(t){const{disabled:r=!1,defaultOpen:i=!1,open:s,disableHoverablePopup:l=!1,trackCursorAxis:u="none",actionsRef:d,onOpenChange:m,onOpenChangeComplete:f,handle:y,triggerId:p,defaultTriggerId:v=null,children:b}=t,S=sy.useStore(y==null?void 0:y.store,{open:i,openProp:s,activeTriggerId:v,triggerIdProp:p});iy(()=>{s===void 0&&S.state.open===!1&&i===!0&&S.update({open:!0,activeTriggerId:v})}),S.useControlledProp("openProp",s),S.useControlledProp("triggerIdProp",p),S.useContextCallback("onOpenChange",m),S.useContextCallback("onOpenChangeComplete",f);const x=S.useState("open"),R=!r&&x,T=S.useState("activeTriggerId"),M=S.useState("payload");S.useSyncedValues({trackCursorAxis:u,disableHoverablePopup:l}),_e(()=>{x&&r&&S.setOpen(!1,pt(bL))},[x,r,S]),S.useSyncedValue("disabled",r),Qg(S);const{forceUnmount:D,transitionStatus:C}=Zg(R,S),N=S.useState("isInstantPhase"),k=S.useState("instantType"),O=S.useState("lastOpenChangeReason"),L=w.useRef(null);_e(()=>{C==="ending"&&O===Pc||C!=="ending"&&N?(k!=="delay"&&(L.current=k),S.set("instantType","delay")):L.current!==null&&(S.set("instantType",L.current),L.current=null)},[C,N,O,k,S]),_e(()=>{R&&T==null&&S.set("payload",void 0)},[S,T,R]);const G=w.useCallback(()=>{S.setOpen(!1,pI(S,Ag))},[S]);w.useImperativeHandle(d,()=>({unmount:D,close:G}),[D,G]);const J=S.useState("floatingRootContext"),Z=Xg(J,{enabled:!r,referencePress:!0}),z=c4(J,{enabled:!r&&u!=="none",axis:u==="none"?void 0:u}),{getReferenceProps:H,getFloatingProps:V,getTriggerProps:q}=mf([Z,z]),_=w.useMemo(()=>H(),[H]),j=w.useMemo(()=>q(),[q]),U=w.useMemo(()=>V(),[V]);return S.useSyncedValues({activeTriggerProps:_,inactiveTriggerProps:j,popupProps:U}),I.jsx(DR.Provider,{value:S,children:typeof b=="function"?b({payload:M}):b})});function pI(e,t){const r=pt(t);return r.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},r}const gI=w.createContext(void 0);function yI(){return w.useContext(gI)}let vI=(function(e){return e[e.popupOpen=Kd.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const bI=600,wI=iR(function(t,r){const{className:i,render:s,handle:l,payload:u,disabled:d,delay:m,closeDelay:f,id:y,...p}=t,v=Vc(!0),b=(l==null?void 0:l.store)??v;if(!b)throw new Error(Ln(82));const S=Hi(y),x=b.useState("isTriggerActive",S),R=b.useState("isOpenedByTrigger",S),T=b.useState("floatingRootContext"),M=w.useRef(null),D=m??bI,C=f??0,{registerTrigger:N,isMountedByThisTrigger:k}=sR(S,M,b,{payload:u,closeDelay:C}),O=yI(),{delayRef:L,isInstantPhase:G,hasProvider:J}=Z3(T,{open:R});b.useSyncedValue("isInstantPhase",G);const Z=b.useState("disabled"),z=d??Z,H=b.useState("trackCursorAxis"),V=b.useState("disableHoverablePopup"),q=dR(T,{enabled:!z,mouseOnly:!0,move:!1,handleClose:!V&&H!=="both"?hR():null,restMs(){const ae=O==null?void 0:O.delay,P=typeof L.current=="object"?L.current.open:void 0;let X=D;return J&&(P!==0?X=m??ae??D:X=0),X},delay(){const ae=typeof L.current=="object"?L.current.close:void 0;let P=C;return f==null&&J&&(P=ae),{close:P}},triggerElementRef:M,isActiveTrigger:x}),_=lR(T,{enabled:!z}).reference,j={open:R},U=b.useState("triggerProps",k);return Qt("button",t,{state:j,ref:[r,N,M],props:[q,_,U,{id:S,[vI.triggerDisabled]:z?"":void 0},p],stateAttributesMapping:G3})}),AR=w.createContext(void 0);function SI(){const e=w.useContext(AR);if(e===void 0)throw new Error(Ln(70));return e}const xI=w.forwardRef(function(t,r){const{children:i,container:s,className:l,render:u,...d}=t,{portalNode:m,portalSubtree:f}=G1({container:s,ref:r,componentProps:t,elementProps:d});return!f&&!m?null:I.jsxs(w.Fragment,{children:[f,m&&ra.createPortal(i,m)]})}),EI=w.forwardRef(function(t,r){const{keepMounted:i=!1,...s}=t;return Vc().useState("mounted")||i?I.jsx(AR.Provider,{value:i,children:I.jsx(xI,{ref:r,...s})}):null}),NR=w.createContext(void 0);function kR(){const e=w.useContext(NR);if(e===void 0)throw new Error(Ln(71));return e}const RI=w.createContext(void 0);function gf(){const e=w.useContext(RI);return(e==null?void 0:e.direction)??"ltr"}const TI=e=>({name:"arrow",options:e,async fn(t){var ie,ae;const{x:r,y:i,placement:s,rects:l,platform:u,elements:d,middlewareData:m}=t,{element:f,padding:y=0,offsetParent:p="real"}=Xa(e,t)||{};if(f==null)return{};const v=T1(y),b={x:r,y:i},S=Hg(s),x=jg(S),R=await u.getDimensions(f),T=S==="y",M=T?"top":"left",D=T?"bottom":"right",C=T?"clientHeight":"clientWidth",N=l.reference[x]+l.reference[S]-b[S]-l.floating[x],k=b[S]-l.reference[S],O=p==="real"?await((ie=u.getOffsetParent)==null?void 0:ie.call(u,f)):d.floating;let L=d.floating[C]||l.floating[x];(!L||!await((ae=u.isElement)==null?void 0:ae.call(u,O)))&&(L=d.floating[C]||l.floating[x]);const G=N/2-k/2,J=L/2-R[x]/2-1,Z=Math.min(v[M],J),z=Math.min(v[D],J),H=Z,V=L-R[x]-z,q=L/2-R[x]/2+G,_=Qp(H,q,V),j=!m.arrow&&Vi(s)!=null&&q!==_&&l.reference[x]/2-(q<H?Z:z)-R[x]/2<0,U=j?q<H?q-H:q-V:0;return{[S]:b[S]+U,data:{[S]:_,centerOffset:q-_-U,...j&&{alignmentOffset:U}},reset:j}}}),CI=(e,t)=>({...TI(e),options:[e,t]}),OI={name:"hide",async fn(e){var d;const{width:t,height:r,x:i,y:s}=e.rects.reference,l=t===0&&r===0&&i===0&&s===0;return{data:{referenceHidden:((d=(await $4().fn(e)).data)==null?void 0:d.referenceHidden)||l}}}},Nd={sideX:"left",sideY:"top"},MI={name:"adaptiveOrigin",async fn(e){var M,D;const{x:t,y:r,rects:{floating:i},elements:{floating:s},platform:l,strategy:u,placement:d}=e,m=Rn(s),f=m.getComputedStyle(s);if(!(f.transitionDuration!=="0s"&&f.transitionDuration!==""))return{x:t,y:r,data:Nd};const p=await((M=l.getOffsetParent)==null?void 0:M.call(l,s));let v={width:0,height:0};if(u==="fixed"&&(m!=null&&m.visualViewport))v={width:m.visualViewport.width,height:m.visualViewport.height};else if(p===m){const C=jt(s);v={width:C.documentElement.clientWidth,height:C.documentElement.clientHeight}}else await((D=l.isElement)==null?void 0:D.call(l,p))&&(v=await l.getDimensions(p));const b=gr(d);let S=t,x=r;b==="left"&&(S=v.width-(t+i.width)),b==="top"&&(x=v.height-(r+i.height));const R=b==="left"?"right":Nd.sideX,T=b==="top"?"bottom":Nd.sideY;return{x:S,y:x,data:{sideX:R,sideY:T}}}};function _R(e,t,r){const i=e==="inline-start"||e==="inline-end";return{top:"top",right:i?r?"inline-start":"inline-end":"right",bottom:"bottom",left:i?r?"inline-end":"inline-start":"left"}[t]}function dx(e,t,r){const{rects:i,placement:s}=e;return{side:_R(t,gr(s),r),align:Vi(s)||"center",anchor:{width:i.reference.width,height:i.reference.height},positioner:{width:i.floating.width,height:i.floating.height}}}function LR(e){var Kn,rn;const{anchor:t,positionMethod:r="absolute",side:i="bottom",sideOffset:s=0,align:l="center",alignOffset:u=0,collisionBoundary:d,collisionPadding:m=5,sticky:f=!1,arrowPadding:y=5,disableAnchorTracking:p=!1,keepMounted:v=!1,floatingRootContext:b,mounted:S,collisionAvoidance:x,shiftCrossAxis:R=!1,nodeId:T,adaptiveOrigin:M,lazyFlip:D=!1,externalTree:C}=e,[N,k]=w.useState(null);!S&&N!==null&&k(null);const O=x.side||"flip",L=x.align||"flip",G=x.fallbackAxisSide||"end",J=typeof t=="function"?t:void 0,Z=ze(J),z=J?Z:t,H=er(t),q=gf()==="rtl",_=N||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":q?"left":"right","inline-start":q?"right":"left"}[i],j=l==="center"?_:`${_}-${l}`;let U=m;const ie=1,ae=i==="bottom"?ie:0,P=i==="top"?ie:0,X=i==="right"?ie:0,$=i==="left"?ie:0;typeof U=="number"?U={top:U+ae,right:U+$,bottom:U+P,left:U+X}:U&&(U={top:(U.top||0)+ae,right:(U.right||0)+$,bottom:(U.bottom||0)+P,left:(U.left||0)+X});const F={boundary:d==="clipping-ancestors"?"clippingAncestors":d,padding:U},te=w.useRef(null),ue=er(s),he=er(u),ke=[q4(lt=>{const wt=dx(lt,i,q),et=typeof ue.current=="function"?ue.current(wt):ue.current,vt=typeof he.current=="function"?he.current(wt):he.current;return{mainAxis:et,crossAxis:vt,alignmentAxis:vt}},[typeof s!="function"?s:0,typeof u!="function"?u:0,q,i])],Xe=L==="none"&&O!=="shift",ne=!Xe&&(f||R||O==="shift"),fe=O==="none"?null:X4({...F,padding:{top:U.top+ie,right:U.right+ie,bottom:U.bottom+ie,left:U.left+ie},mainAxis:!R&&O==="flip",crossAxis:L==="flip"?"alignment":!1,fallbackAxisSideDirection:G}),Se=Xe?null:G4(lt=>{const wt=jt(lt.elements.floating).documentElement;return{...F,rootBoundary:R?{x:0,y:0,width:wt.clientWidth,height:wt.clientHeight}:void 0,mainAxis:L!=="none",crossAxis:ne,limiter:f||R?void 0:K4(et=>{if(!te.current)return{};const{width:vt,height:Ht}=te.current.getBoundingClientRect(),Ke=Vr(gr(et.placement)),It=Ke==="y"?vt:Ht,Zt=Ke==="y"?U.left+U.right:U.top+U.bottom;return{offset:It/2+Zt/2}})}},[F,f,R,U,L]);O==="shift"||L==="shift"||l==="center"?ke.push(Se,fe):ke.push(fe,Se),ke.push(W4({...F,apply({elements:{floating:lt},rects:{reference:wt},availableWidth:et,availableHeight:vt}){const Ht=lt.style;Ht.setProperty("--available-width",`${et}px`),Ht.setProperty("--available-height",`${vt}px`),Ht.setProperty("--anchor-width",`${wt.width}px`),Ht.setProperty("--anchor-height",`${wt.height}px`)}}),CI(()=>({element:te.current||document.createElement("div"),padding:y,offsetParent:"floating"}),[y]),{name:"transformOrigin",fn(lt){var Ae,Ue,at;const{elements:wt,middlewareData:et,placement:vt,rects:Ht,y:Ke}=lt,It=gr(vt),Zt=Vr(It),qt=te.current,Xn=((Ae=et.arrow)==null?void 0:Ae.x)||0,Gt=((Ue=et.arrow)==null?void 0:Ue.y)||0,Mn=(qt==null?void 0:qt.clientWidth)||0,Kr=(qt==null?void 0:qt.clientHeight)||0,B=Xn+Mn/2,Q=Gt+Kr/2,le=Math.abs(((at=et.shift)==null?void 0:at.y)||0),be=Ht.reference.height/2,Ce=typeof s=="function"?s(dx(lt,i,q)):s,We=le>Ce,He={top:`${B}px calc(100% + ${Ce}px)`,bottom:`${B}px ${-Ce}px`,left:`calc(100% + ${Ce}px) ${Q}px`,right:`${-Ce}px ${Q}px`}[It],Me=`${B}px ${Ht.reference.y+be-Ke}px`;return wt.floating.style.setProperty("--transform-origin",ne&&Zt==="y"&&We?Me:He),{}}},OI,M),_e(()=>{!S&&b&&b.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[S,b]);const Ne=w.useMemo(()=>({elementResize:!p&&typeof ResizeObserver<"u",layoutShift:!p&&typeof IntersectionObserver<"u"}),[p]),{refs:Te,elements:Ee,x:Re,y:pe,middlewareData:De,update:xe,placement:qe,context:Ge,isPositioned:Le,floatingStyles:ot}=AP({rootContext:b,placement:j,middleware:ke,strategy:r,whileElementsMounted:v?void 0:(...lt)=>ex(...lt,Ne),nodeId:T,externalTree:C}),{sideX:Pt,sideY:Ft}=De.adaptiveOrigin||Nd,tt=Le?r:"fixed",ft=w.useMemo(()=>{const lt=M?{position:tt,[Pt]:Re,[Ft]:pe}:{position:tt,...ot};return Le||(lt.opacity=0),lt},[M,tt,Pt,Re,Ft,pe,ot,Le]),Ct=w.useRef(null);_e(()=>{if(!S)return;const lt=H.current,wt=typeof lt=="function"?lt():lt,vt=(fx(wt)?wt.current:wt)||null||null;vt!==Ct.current&&(Te.setPositionReference(vt),Ct.current=vt)},[S,Te,z,H]),w.useEffect(()=>{if(!S)return;const lt=H.current;typeof lt!="function"&&fx(lt)&&lt.current!==Ct.current&&(Te.setPositionReference(lt.current),Ct.current=lt.current)},[S,Te,z,H]),w.useEffect(()=>{if(v&&S&&Ee.domReference&&Ee.floating)return ex(Ee.domReference,Ee.floating,xe,Ne)},[v,S,Ee,xe,Ne]);const sn=gr(qe),ln=_R(i,sn,q),On=Vi(qe)||"center",Pe=!!((Kn=De.hide)!=null&&Kn.referenceHidden);_e(()=>{D&&S&&Le&&k(sn)},[D,S,Le,sn]);const st=w.useMemo(()=>{var lt,wt;return{position:"absolute",top:(lt=De.arrow)==null?void 0:lt.y,left:(wt=De.arrow)==null?void 0:wt.x}},[De.arrow]),gt=((rn=De.arrow)==null?void 0:rn.centerOffset)!==0;return w.useMemo(()=>({positionerStyles:ft,arrowStyles:st,arrowRef:te,arrowUncentered:gt,side:ln,align:On,physicalSide:sn,anchorHidden:Pe,refs:Te,context:Ge,isPositioned:Le,update:xe}),[ft,st,te,gt,ln,On,sn,Pe,Te,Ge,Le,xe])}function fx(e){return e!=null&&"current"in e}function yf(e){return e==="starting"?oL:xn}const DI=w.forwardRef(function(t,r){const{render:i,className:s,anchor:l,positionMethod:u="absolute",side:d="top",align:m="center",sideOffset:f=0,alignOffset:y=0,collisionBoundary:p="clipping-ancestors",collisionPadding:v=5,arrowPadding:b=5,sticky:S=!1,disableAnchorTracking:x=!1,collisionAvoidance:R=VE,...T}=t,M=Vc(),D=SI(),C=M.useState("open"),N=M.useState("mounted"),k=M.useState("trackCursorAxis"),O=M.useState("disableHoverablePopup"),L=M.useState("floatingRootContext"),G=M.useState("instantType"),J=M.useState("transitionStatus"),Z=M.useState("hasViewport"),z=LR({anchor:l,positionMethod:u,floatingRootContext:L,mounted:N,side:d,sideOffset:f,align:m,alignOffset:y,collisionBoundary:p,collisionPadding:v,sticky:S,arrowPadding:b,disableAnchorTracking:x,keepMounted:D,collisionAvoidance:R,adaptiveOrigin:Z?MI:void 0}),H=w.useMemo(()=>{const j={};return(!C||k==="both"||O)&&(j.pointerEvents="none"),{role:"presentation",hidden:!N,style:{...z.positionerStyles,...j}}},[C,k,O,N,z.positionerStyles]),V=w.useMemo(()=>({open:C,side:z.side,align:z.align,anchorHidden:z.anchorHidden,instant:k!=="none"?"tracking-cursor":G}),[C,z.side,z.align,z.anchorHidden,k,G]),q=w.useMemo(()=>({...V,arrowRef:z.arrowRef,arrowStyles:z.arrowStyles,arrowUncentered:z.arrowUncentered}),[V,z.arrowRef,z.arrowStyles,z.arrowUncentered]),_=Qt("div",t,{state:V,props:[H,yf(J),T],ref:[r,M.useStateSetter("positionerElement")],stateAttributesMapping:jo});return I.jsx(NR.Provider,{value:q,children:_})}),AI={...jo,...Zs},NI=w.forwardRef(function(t,r){const{className:i,render:s,...l}=t,u=Vc(),{side:d,align:m}=kR(),f=u.useState("open"),y=u.useState("instantType"),p=u.useState("transitionStatus"),v=u.useState("popupProps"),b=u.useState("floatingRootContext");Uc({open:f,ref:u.context.popupRef,onComplete(){var M,D;f&&((D=(M=u.context).onOpenChangeComplete)==null||D.call(M,!0))}});const S=u.useState("disabled"),x=u.useState("closeDelay");return uR(b,{enabled:!S,closeDelay:x}),Qt("div",t,{state:{open:f,side:d,align:m,instant:y,transitionStatus:p},ref:[r,u.context.popupRef,u.useStateSetter("popupElement")],props:[v,yf(p),l],stateAttributesMapping:AI})}),kI=w.forwardRef(function(t,r){const{className:i,render:s,...l}=t,d=Vc().useState("instantType"),{open:m,arrowRef:f,side:y,align:p,arrowUncentered:v,arrowStyles:b}=kR();return Qt("div",t,{state:{open:m,side:y,align:p,uncentered:v,instant:d},ref:[r,f],props:[{style:b,"aria-hidden":!0},l],stateAttributesMapping:jo})});function _I({...e}){return I.jsx(mI,{"data-slot":"tooltip",...e})}function LI({...e}){return I.jsx(wI,{"data-slot":"tooltip-trigger",...e})}function zI({className:e,side:t="top",sideOffset:r=4,align:i="center",alignOffset:s=0,children:l,...u}){return I.jsx(EI,{children:I.jsx(DI,{align:i,alignOffset:s,side:t,sideOffset:r,className:"isolate z-50",children:I.jsxs(NI,{"data-slot":"tooltip-content",className:Ye("data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 bg-foreground text-background z-50 w-fit max-w-xs origin-(--transform-origin)",e),...u,children:[l,I.jsx(kI,{className:"size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 bg-foreground fill-foreground z-50 data-[side=bottom]:top-1 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const PI="sidebar_state",II=3600*24*7,hp="100vw",UI="3rem",jI="b",mp=256,HI=192,BI=480,pp="tmex_sidebar_width";function hx(e){return Math.min(BI,Math.max(HI,Math.round(e)))}const zR=w.createContext(null);function Gi(){const e=w.useContext(zR);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function FI({defaultOpen:e=!0,open:t,onOpenChange:r,className:i,style:s,children:l,...u}){const d=QL(),[m,f]=w.useState(!1),[y,p]=w.useState(()=>{if(typeof window>"u")return mp;const O=Number(window.localStorage.getItem(pp));return Number.isFinite(O)&&O>0?hx(O):mp}),[v,b]=w.useState(!1),S=w.useCallback(O=>{const L=hx(O);p(L),window.localStorage.setItem(pp,String(L))},[]),x=w.useCallback(()=>{p(mp),window.localStorage.removeItem(pp)},[]),[R,T]=w.useState(e),M=t??R,D=w.useCallback(O=>{const L=typeof O=="function"?O(M):O;r?r(L):T(L),document.cookie=`${PI}=${L}; path=/; max-age=${II}`},[r,M]),C=w.useCallback(()=>d?f(O=>!O):D(O=>!O),[d,D,f]);w.useEffect(()=>{const O=L=>{L.defaultPrevented||L.target instanceof HTMLElement&&L.target.closest(".xterm")||L.key===jI&&(L.metaKey||L.ctrlKey)&&(L.preventDefault(),C())};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[C]);const N=M?"expanded":"collapsed",k=w.useMemo(()=>({state:N,open:M,setOpen:D,isMobile:d,openMobile:m,setOpenMobile:f,toggleSidebar:C,width:y,setWidth:S,resetWidth:x,isResizing:v,setIsResizing:b}),[N,M,D,d,m,f,C,y,S,x,v]);return I.jsx(zR.Provider,{value:k,children:I.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":`${y}px`,"--sidebar-width-icon":UI,...s},className:Ye("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",i),...u,children:l})})}function VI({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:i,children:s,dir:l,...u}){const{isMobile:d,state:m,openMobile:f,setOpenMobile:y,isResizing:p}=Gi();return r==="none"?I.jsx("div",{"data-slot":"sidebar",className:Ye("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",i),...u,children:s}):d?I.jsx(iI,{open:f,onOpenChange:y,...u,children:I.jsxs(lI,{dir:l,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true","data-testid":"mobile-sidebar-sheet",className:"bg-sidebar text-sidebar-foreground p-0 [&>button]:hidden",style:{"--sidebar-width":hp,width:hp,maxWidth:hp},side:e,children:[I.jsxs(cI,{className:"sr-only",children:[I.jsx(uI,{children:"Sidebar"}),I.jsx(dI,{children:"Displays the mobile sidebar."})]}),I.jsx("div",{className:"flex h-full w-full flex-col","data-testid":"sidebar",style:{paddingBottom:"var(--tmex-safe-area-bottom)"},children:s})]})}):I.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":m,"data-collapsible":m==="collapsed"?r:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[I.jsx("div",{"data-slot":"sidebar-gap",className:Ye(!p&&"transition-[width] duration-200 ease-linear","relative w-(--sidebar-width) bg-transparent","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),I.jsxs("div",{"data-slot":"sidebar-container","data-side":e,className:Ye(!p&&"transition-[left,right,width] duration-200 ease-linear","fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",i),...u,children:[I.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner","data-testid":"sidebar",className:"bg-sidebar group-data-[variant=floating]:ring-sidebar-border group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col",style:{paddingBottom:"var(--tmex-safe-area-bottom)"},children:s}),m==="expanded"&&I.jsx(YI,{side:e})]})]})}function YI({side:e}){const{width:t,setWidth:r,resetWidth:i,setIsResizing:s}=Gi(),l=w.useRef(null);return I.jsx("div",{"data-slot":"sidebar-resizer","data-testid":"sidebar-resizer","aria-hidden":"true",className:Ye("absolute inset-y-0 z-30 w-2 cursor-col-resize touch-none select-none","after:absolute after:inset-y-0 after:w-[2px] after:bg-transparent hover:after:bg-sidebar-border active:after:bg-sidebar-border",e==="left"?"-right-1 after:right-[3px]":"-left-1 after:left-[3px]"),onPointerDown:u=>{u.preventDefault(),l.current={pointerId:u.pointerId,startX:u.clientX,startWidth:t},u.currentTarget.setPointerCapture(u.pointerId),s(!0)},onPointerMove:u=>{const d=l.current;if(!d||d.pointerId!==u.pointerId)return;const m=u.clientX-d.startX;r(d.startWidth+(e==="left"?m:-m))},onPointerUp:u=>{var d;((d=l.current)==null?void 0:d.pointerId)===u.pointerId&&(l.current=null,s(!1))},onPointerCancel:u=>{var d;((d=l.current)==null?void 0:d.pointerId)===u.pointerId&&(l.current=null,s(!1))},onDoubleClick:i})}function qI({className:e,onClick:t,...r}){const{toggleSidebar:i}=Gi();return I.jsxs(ya,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:Ye(e),onClick:s=>{t==null||t(s),i()},...r,children:[I.jsx(O_,{}),I.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function GI({className:e,...t}){return I.jsx("main",{"data-slot":"sidebar-inset",className:Ye("bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 relative flex w-full flex-1 flex-col",e),...t})}function KI({className:e,...t}){return I.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:Ye("gap-2 p-2 flex flex-col",e),...t})}function XI({className:e,...t}){return I.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:Ye("gap-2 p-2 flex flex-col",e),...t})}function WI({className:e,...t}){return I.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:Ye("no-scrollbar gap-0 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function PR({className:e,...t}){return I.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:Ye("p-2 relative flex w-full min-w-0 flex-col",e),...t})}function $I({className:e,render:t,...r}){return jc({defaultTagName:"div",props:wa({className:Ye("text-sidebar-foreground/70 ring-sidebar-ring h-8 rounded-md px-2 text-xs font-medium transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 flex shrink-0 items-center outline-hidden [&>svg]:shrink-0",e)},r),render:t,state:{slot:"sidebar-group-label",sidebar:"group-label"}})}function QI({className:e,...t}){return I.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:Ye("gap-0 flex w-full min-w-0 flex-col",e),...t})}function ZI({className:e,...t}){return I.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:Ye("group/menu-item relative",e),...t})}const JI=Lg("ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground gap-2 rounded-md p-2 text-left text-sm transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 data-active:font-medium peer/menu-button flex w-full items-center overflow-hidden outline-hidden group/menu-button disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function eU({render:e,isActive:t=!1,variant:r="default",size:i="default",tooltip:s,className:l,...u}){const{isMobile:d,state:m}=Gi(),f=jc({defaultTagName:"button",props:wa({className:Ye(JI({variant:r,size:i}),l)},u),render:s?LI:e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:i,active:t}});return s?(typeof s=="string"&&(s={children:s}),I.jsxs(_I,{children:[f,I.jsx(zI,{side:"right",align:"center",hidden:m!=="collapsed"||d,...s})]})):f}function tU({className:e,render:t,showOnHover:r=!1,...i}){return jc({defaultTagName:"button",props:wa({className:Ye("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 aspect-square w-5 rounded-md p-0 peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 focus-visible:ring-2 [&>svg]:size-4 flex items-center justify-center outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden [&>svg]:shrink-0",r&&"peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 aria-expanded:opacity-100 md:opacity-0",e)},i),render:t,state:{slot:"sidebar-menu-action",sidebar:"menu-action"}})}function nU({className:e,...t}){return I.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:Ye("border-sidebar-border mx-3.5 translate-x-px gap-1 border-l px-2.5 py-0.5 group-data-[collapsible=icon]:hidden flex min-w-0 flex-col",e),...t})}function rU({className:e,...t}){return I.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:Ye("group/menu-sub-item relative",e),...t})}function aU({render:e,size:t="md",isActive:r=!1,className:i,...s}){return jc({defaultTagName:"a",props:wa({className:Ye("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground h-7 gap-2 rounded-md px-2 focus-visible:ring-2 data-[size=md]:text-sm data-[size=sm]:text-xs [&>svg]:size-4 flex min-w-0 -translate-x-px items-center overflow-hidden outline-hidden group-data-[collapsible=icon]:hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:shrink-0",i)},s),render:e,state:{slot:"sidebar-menu-sub-button",sidebar:"menu-sub-button",size:t,active:r}})}function $d({children:e,onClick:t,...r}){const{isMobile:i,setOpenMobile:s}=Gi(),l=u=>{i&&s(!1),t==null||t(u)};return I.jsx(Rg,{...r,onClick:l,children:e})}function iU({items:e}){const{t}=Qs();return I.jsx(PR,{children:I.jsx(QI,{children:e.map(r=>{var i,s;return I.jsxs(XL,{defaultOpen:r.isActive,render:I.jsx(ZI,{}),children:[I.jsx($d,{to:r.url,children:I.jsxs(eU,{tooltip:t(r.title),children:[I.jsx(r.icon,{}),I.jsx("span",{children:t(r.title)})]})}),(i=r.items)!=null&&i.length?I.jsxs(I.Fragment,{children:[I.jsxs(WL,{render:I.jsx(tU,{className:"data-[state=open]:rotate-90"}),children:[I.jsx(g_,{}),I.jsx("span",{className:"sr-only",children:"Toggle"})]}),I.jsx($L,{children:I.jsx(nU,{children:(s=r.items)==null?void 0:s.map(l=>I.jsx(rU,{children:I.jsx($d,{to:l.url,children:I.jsx(aU,{children:I.jsx("span",{children:t(l.title)})})})},l.title))})})]}):null]},r.title)})})})}const oU=Lg("h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive overflow-hidden group/badge",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function ag({className:e,variant:t="default",render:r,...i}){return jc({defaultTagName:"span",props:wa({className:Ye(oU({className:e,variant:t}))},i),render:r,state:{slot:"badge",variant:t}})}const sU={auth_failed:"authFailed",agent_unavailable:"agentUnavailable",agent_no_identity:"agentNoIdentity",ssh_config_ref_not_supported:"configRefNotSupported",network_unreachable:"networkUnreachable",connection_refused:"connectionRefused",timeout:"timeout",host_not_found:"hostNotFound",handshake_failed:"handshakeFailed",tmux_unavailable:"tmuxUnavailable",connection_closed:"connectionClosed"};function lU({deviceId:e,className:t}){const{t:r}=Qs(),i=Vn(l=>l.deviceReconnecting[e]),s=Vn(l=>l.deviceErrors[e]);if(i)return I.jsxs(ag,{variant:"outline",title:i.message,className:Ye("h-5 gap-1 border-amber-400/40 bg-amber-500/10 px-1.5 text-[10px] font-normal text-amber-700 dark:text-amber-300",t),children:[I.jsx(I_,{className:"h-3 w-3 animate-spin"}),I.jsx("span",{className:"truncate max-w-[120px]",children:i.message})]});if(s){const l=sU[s.type]??"unknown",u=r(`deviceStatus.errorBadge.${l}`),d=[u,s.message,s.rawMessage].filter(Boolean).join(`
224
- `);return I.jsxs(ag,{variant:"outline",title:d,className:Ye("h-5 gap-1 border-red-400/40 bg-red-500/10 px-1.5 text-[10px] font-normal text-red-700 dark:text-red-300",t),children:[I.jsx(v_,{className:"h-3 w-3"}),I.jsx("span",{className:"truncate max-w-[120px]",children:u})]})}return null}function cU(e){const{children:t,open:r,defaultOpen:i=!1,onOpenChange:s,onOpenChangeComplete:l,actionsRef:u,handle:d,triggerId:m,defaultTriggerId:f=null}=e,y=Yi(),p=!!y,v=_n(()=>(d==null?void 0:d.store)??new OR({open:i,openProp:r,activeTriggerId:f,triggerIdProp:m,modal:!0,disablePointerDismissal:!0,nested:p,role:"alertdialog"})).current;v.useControlledProp("openProp",r),v.useControlledProp("triggerIdProp",m),v.useSyncedValue("nested",p),v.useContextCallback("onOpenChange",s),v.useContextCallback("onOpenChangeComplete",l);const b=v.useState("payload");CR({store:v,actionsRef:u,parentContext:y==null?void 0:y.store.context});const S=w.useMemo(()=>({store:v}),[v]);return I.jsx(Fg.Provider,{value:S,children:typeof t=="function"?t({payload:b}):t})}function uU({...e}){return I.jsx(cU,{"data-slot":"alert-dialog",...e})}function dU({...e}){return I.jsx(ay,{"data-slot":"alert-dialog-portal",...e})}function fU({className:e,...t}){return I.jsx(Vg,{"data-slot":"alert-dialog-overlay",className:Ye("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function hU({className:e,size:t="default",...r}){return I.jsxs(dU,{children:[I.jsx(fU,{}),I.jsx(ry,{"data-slot":"alert-dialog-content","data-size":t,className:Ye("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-foreground/10 gap-4 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...r})]})}function mU({className:e,...t}){return I.jsx("div",{"data-slot":"alert-dialog-header",className:Ye("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function pU({className:e,...t}){return I.jsx("div",{"data-slot":"alert-dialog-footer",className:Ye("bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function gU({className:e,...t}){return I.jsx("div",{"data-slot":"alert-dialog-media",className:Ye("bg-muted mb-2 inline-flex size-10 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6",e),...t})}function yU({className:e,...t}){return I.jsx(oy,{"data-slot":"alert-dialog-title",className:Ye("text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function vU({className:e,...t}){return I.jsx(Yg,{"data-slot":"alert-dialog-description",className:Ye("text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3",e),...t})}function bU({className:e,...t}){return I.jsx(ya,{"data-slot":"alert-dialog-action",className:Ye(e),...t})}function wU({className:e,variant:t="outline",size:r="default",...i}){return I.jsx(df,{"data-slot":"alert-dialog-cancel",className:Ye(e),render:I.jsx(ya,{variant:t,size:r}),...i})}function SU({...e}){return I.jsx(MR,{"data-slot":"dialog",...e})}function xU({...e}){return I.jsx(ay,{"data-slot":"dialog-portal",...e})}function EU({className:e,...t}){return I.jsx(Vg,{"data-slot":"dialog-overlay",className:Ye("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function RU({className:e,children:t,showCloseButton:r=!0,...i}){return I.jsxs(xU,{children:[I.jsx(EU,{}),I.jsxs(ry,{"data-slot":"dialog-content",className:Ye("bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...i,children:[t,r&&I.jsxs(df,{"data-slot":"dialog-close",render:I.jsx(ya,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[I.jsx(zc,{}),I.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function TU({className:e,...t}){return I.jsx("div",{"data-slot":"dialog-header",className:Ye("gap-2 flex flex-col",e),...t})}function CU({className:e,showCloseButton:t=!1,children:r,...i}){return I.jsxs("div",{"data-slot":"dialog-footer",className:Ye("bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...i,children:[r,t&&I.jsx(df,{render:I.jsx(ya,{variant:"outline"}),children:"Close"})]})}function OU({className:e,...t}){return I.jsx(oy,{"data-slot":"dialog-title",className:Ye("text-base leading-none font-medium",e),...t})}function MU({className:e,...t}){return I.jsx(Yg,{"data-slot":"dialog-description",className:Ye("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",e),...t})}const IR=w.createContext(void 0);function UR(e){const t=w.useContext(IR);if(t===void 0&&!e)throw new Error(Ln(33));return t}const jR=w.createContext(void 0);function Ho(e){const t=w.useContext(jR);if(t===void 0&&!e)throw new Error(Ln(36));return t}const DU=w.createContext(void 0);function vf(e=!0){const t=w.useContext(DU);if(t===void 0&&!e)throw new Error(Ln(25));return t}function AU(e){const{closeOnClick:t,highlighted:r,id:i,nodeId:s,store:l,itemRef:u,itemMetadata:d}=e,{events:m}=l.useState("floatingTreeRoot"),f=vf(!0),y=f!==void 0;return w.useMemo(()=>({id:i,role:"menuitem",tabIndex:r?0:-1,onMouseMove(p){s&&m.emit("itemhover",{nodeId:s,target:p.currentTarget})},onClick(p){t&&m.emit("close",{domEvent:p,reason:qE})},onMouseUp(p){if(f){const v=f.initialCursorPointRef.current;if(f.initialCursorPointRef.current=null,y&&v&&Math.abs(p.clientX-v.x)<=1&&Math.abs(p.clientY-v.y)<=1)return}u.current&&l.context.allowMouseUpTriggerRef.current&&(!y||p.button===2)&&(!d||d.type==="regular-item")&&u.current.click()}}),[t,r,i,m,s,l,u,f,y,d])}const NU={type:"regular-item"};function kU(e){const{closeOnClick:t,disabled:r=!1,highlighted:i,id:s,store:l,nativeButton:u,itemMetadata:d,nodeId:m}=e,f=w.useRef(null),{getButtonProps:y,buttonRef:p}=Ic({disabled:r,focusableWhenDisabled:!0,native:u}),v=AU({closeOnClick:t,highlighted:i,id:s,nodeId:m,store:l,itemRef:f,itemMetadata:d}),b=w.useCallback(x=>wa(v,{onMouseEnter(){d.type==="submenu-trigger"&&d.setActive()},onKeyUp(R){R.key===" "&&l.context.typingRef.current&&R.preventBaseUIHandler()}},x,y),[v,y,l,d]),S=ko(f,p);return w.useMemo(()=>({getItemProps:b,itemRef:S}),[b,S])}const HR=w.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function _U(){return w.useContext(HR)}let LU=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function BR(e={}){const{label:t,metadata:r,textRef:i,indexGuessBehavior:s,index:l}=e,{register:u,unregister:d,subscribeMapChange:m,elementsRef:f,labelsRef:y,nextIndexRef:p}=_U(),v=w.useRef(-1),[b,S]=w.useState(l??(s===LU.GuessFromOrder?()=>{if(v.current===-1){const T=p.current;p.current+=1,v.current=T}return v.current}:-1)),x=w.useRef(null),R=w.useCallback(T=>{var M;if(x.current=T,b!==-1&&T!==null&&(f.current[b]=T,y)){const D=t!==void 0;y.current[b]=D?t:((M=i==null?void 0:i.current)==null?void 0:M.textContent)??T.textContent}},[b,f,y,t,i]);return _e(()=>{if(l!=null)return;const T=x.current;if(T)return u(T,r),()=>{d(T)}},[l,u,d,r]),_e(()=>{if(l==null)return m(T=>{var D;const M=x.current?(D=T.get(x.current))==null?void 0:D.index:null;M!=null&&S(M)})},[l,m,S]),w.useMemo(()=>({ref:R,index:b}),[b,R])}const zU=w.forwardRef(function(t,r){const{render:i,className:s,id:l,label:u,nativeButton:d=!1,disabled:m=!1,closeOnClick:f=!0,...y}=t,p=BR({label:u}),v=UR(!0),b=Hi(l),{store:S}=Ho(),x=S.useState("isActive",p.index),R=S.useState("itemProps"),{getItemProps:T,itemRef:M}=kU({closeOnClick:f,disabled:m,highlighted:x,id:b,store:S,nativeButton:d,nodeId:v==null?void 0:v.nodeId,itemMetadata:NU});return Qt("div",t,{state:{disabled:m,highlighted:x},props:[R,y,T],ref:[M,r,p.ref]})}),PU=w.createContext(void 0);function IU(e){return w.useContext(PU)}const UU={...jo,...Zs},jU=w.forwardRef(function(t,r){const{render:i,className:s,finalFocus:l,...u}=t,{store:d}=Ho(),{side:m,align:f}=UR(),y=IU()!=null,p=d.useState("open"),v=d.useState("transitionStatus"),b=d.useState("popupProps"),S=d.useState("mounted"),x=d.useState("instantType"),R=d.useState("activeTriggerElement"),T=d.useState("parent"),M=d.useState("lastOpenChangeReason"),D=d.useState("rootId"),C=d.useState("floatingRootContext"),N=d.useState("floatingTreeRoot"),k=d.useState("closeDelay"),O=d.useState("activeTriggerElement"),L=T.type==="context-menu";Uc({open:p,ref:d.context.popupRef,onComplete(){var V,q;p&&((q=(V=d.context).onOpenChangeComplete)==null||q.call(V,!0))}}),w.useEffect(()=>{function V(q){d.setOpen(!1,pt(q.reason,q.domEvent))}return N.events.on("close",V),()=>{N.events.off("close",V)}},[N.events,d]);const G=d.useState("hoverEnabled"),J=d.useState("disabled");uR(C,{enabled:G&&!J&&!L&&T.type!=="menubar",closeDelay:k});const Z={transitionStatus:v,side:m,align:f,open:p,nested:T.type==="menu",instant:x},z=Qt("div",t,{state:Z,ref:[r,d.context.popupRef],stateAttributesMapping:UU,props:[b,{onKeyDown(V){y&&SR.has(V.key)&&V.stopPropagation()}},yf(v),u,{"data-rootownerid":D}]});let H=T.type===void 0||L;return(R||T.type==="menubar"&&M!==Dg)&&(H=!0),I.jsx(X1,{context:C,modal:L,disabled:!S,returnFocus:l===void 0?H:l,initialFocus:T.type!=="menu",restoreFocus:!0,externalTree:T.type!=="menubar"?N:void 0,previousFocusableElement:O,nextFocusableElement:T.type===void 0?d.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:T.type===void 0?d.context.beforeContentFocusGuardRef:void 0,children:z})}),FR=w.createContext(void 0);function HU(){const e=w.useContext(FR);if(e===void 0)throw new Error(Ln(32));return e}const BU=w.forwardRef(function(t,r){const{keepMounted:i=!1,...s}=t,{store:l}=Ho();return l.useState("mounted")||i?I.jsx(FR.Provider,{value:i,children:I.jsx(K1,{ref:r,...s})}):null});function FU(e){const{children:t,elementsRef:r,labelsRef:i,onMapChange:s}=e,l=ze(s),u=w.useRef(0),d=_n(YU).current,m=_n(VU).current,[f,y]=w.useState(0),p=w.useRef(f),v=ze((T,M)=>{m.set(T,M??null),p.current+=1,y(p.current)}),b=ze(T=>{m.delete(T),p.current+=1,y(p.current)}),S=w.useMemo(()=>{const T=new Map;return Array.from(m.keys()).filter(D=>D.isConnected).sort(qU).forEach((D,C)=>{const N=m.get(D)??{};T.set(D,{...N,index:C})}),T},[m,f]);_e(()=>{if(typeof MutationObserver!="function"||S.size===0)return;const T=new MutationObserver(M=>{const D=new Set,C=N=>D.has(N)?D.delete(N):D.add(N);M.forEach(N=>{N.removedNodes.forEach(C),N.addedNodes.forEach(C)}),D.size===0&&(p.current+=1,y(p.current))});return S.forEach((M,D)=>{D.parentElement&&T.observe(D.parentElement,{childList:!0})}),()=>{T.disconnect()}},[S]),_e(()=>{p.current===f&&(r.current.length!==S.size&&(r.current.length=S.size),i&&i.current.length!==S.size&&(i.current.length=S.size),u.current=S.size),l(S)},[l,S,r,i,f]),_e(()=>()=>{r.current=[]},[r]),_e(()=>()=>{i&&(i.current=[])},[i]);const x=ze(T=>(d.add(T),()=>{d.delete(T)}));_e(()=>{d.forEach(T=>T(S))},[d,S]);const R=w.useMemo(()=>({register:v,unregister:b,subscribeMapChange:x,elementsRef:r,labelsRef:i,nextIndexRef:u}),[v,b,x,r,i,u]);return I.jsx(HR.Provider,{value:R,children:t})}function VU(){return new Map}function YU(){return new Set}function qU(e,t){const r=e.compareDocumentPosition(t);return r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS?1:0}const GU=w.forwardRef(function(t,r){var Xe;const{anchor:i,positionMethod:s="absolute",className:l,render:u,side:d,align:m,sideOffset:f=0,alignOffset:y=0,collisionBoundary:p="clipping-ancestors",collisionPadding:v=5,arrowPadding:b=5,sticky:S=!1,disableAnchorTracking:x=!1,collisionAvoidance:R=lL,...T}=t,{store:M}=Ho(),D=HU(),C=vf(!0),N=M.useState("parent"),k=M.useState("floatingRootContext"),O=M.useState("floatingTreeRoot"),L=M.useState("mounted"),G=M.useState("open"),J=M.useState("modal"),Z=M.useState("activeTriggerElement"),z=M.useState("transitionStatus"),H=M.useState("lastOpenChangeReason"),V=M.useState("floatingNodeId"),q=M.useState("floatingParentNodeId");let _=i,j=f,U=y,ie=m,ae=R;N.type==="context-menu"&&(_=i??((Xe=N.context)==null?void 0:Xe.anchor),ie=ie??"start",!d&&ie!=="center"&&(U=t.alignOffset??2,j=t.sideOffset??-5));let P=d,X=ie;N.type==="menu"?(P=P??"inline-end",X=X??"start",ae=t.collisionAvoidance??VE):N.type==="menubar"&&(P=P??"bottom",X=X??"start");const $=N.type==="context-menu",F=LR({anchor:_,floatingRootContext:k,positionMethod:C?"fixed":s,mounted:L,side:P,sideOffset:j,align:X,alignOffset:U,arrowPadding:$?0:b,collisionBoundary:p,collisionPadding:v,sticky:S,nodeId:V,keepMounted:D,disableAnchorTracking:x,collisionAvoidance:ae,shiftCrossAxis:$&&!("side"in ae&&ae.side==="flip"),externalTree:O}),te=w.useMemo(()=>{const ne={};return G||(ne.pointerEvents="none"),{role:"presentation",hidden:!L,style:{...F.positionerStyles,...ne}}},[G,L,F.positionerStyles]);w.useEffect(()=>{function ne(fe){fe.open&&(fe.parentNodeId===V&&M.set("hoverEnabled",!1),fe.nodeId!==V&&fe.parentNodeId===M.select("floatingParentNodeId")&&M.setOpen(!1,pt(Md)))}return O.events.on("menuopenchange",ne),()=>{O.events.off("menuopenchange",ne)}},[M,O.events,V]),w.useEffect(()=>{if(M.select("floatingParentNodeId")==null)return;function ne(fe){if(fe.open||fe.nodeId!==M.select("floatingParentNodeId"))return;const Se=fe.reason??Md;M.setOpen(!1,pt(Se))}return O.events.on("menuopenchange",ne),()=>{O.events.off("menuopenchange",ne)}},[O.events,M]),w.useEffect(()=>{function ne(fe){!G||fe.nodeId!==M.select("floatingParentNodeId")||fe.target&&Z&&Z!==fe.target&&M.setOpen(!1,pt(Md))}return O.events.on("itemhover",ne),()=>{O.events.off("itemhover",ne)}},[O.events,G,Z,M]),w.useEffect(()=>{const ne={open:G,nodeId:V,parentNodeId:q,reason:M.select("lastOpenChangeReason")};O.events.emit("menuopenchange",ne)},[O.events,G,M,V,q]);const ue={open:G,side:F.side,align:F.align,anchorHidden:F.anchorHidden,nested:N.type==="menu"},he=w.useMemo(()=>({side:F.side,align:F.align,arrowRef:F.arrowRef,arrowUncentered:F.arrowUncentered,arrowStyles:F.arrowStyles,nodeId:F.context.nodeId}),[F.side,F.align,F.arrowRef,F.arrowUncentered,F.arrowStyles,F.context.nodeId]),we=Qt("div",t,{state:ue,stateAttributesMapping:jo,ref:[r,M.useStateSetter("positionerElement")],props:[te,yf(z),T]}),ve=L&&N.type!=="menu"&&(N.type!=="menubar"&&J&&H!==Zn||N.type==="menubar"&&N.context.modal);let ke=null;return N.type==="menubar"?ke=N.context.contentElement:N.type===void 0&&(ke=Z),I.jsxs(IR.Provider,{value:he,children:[ve&&I.jsx(ER,{ref:N.type==="context-menu"||N.type==="nested-context-menu"?N.context.internalBackdropRef:null,inert:xR(!G),cutout:ke}),I.jsx(W3,{id:V,children:I.jsx(FU,{elementsRef:M.context.itemDomElements,labelsRef:M.context.itemLabels,children:we})})]})}),KU=w.createContext(null);function VR(e){return w.useContext(KU)}const XU={...ey,disabled:Je(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:Je(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:Je(e=>e.allowMouseEnter),stickIfOpen:Je(e=>e.stickIfOpen),parent:Je(e=>e.parent),rootId:Je(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:Je(e=>e.activeIndex),isActive:Je((e,t)=>e.activeIndex===t),hoverEnabled:Je(e=>e.hoverEnabled),instantType:Je(e=>e.instantType),lastOpenChangeReason:Je(e=>e.openChangeReason),floatingTreeRoot:Je(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:Je(e=>e.floatingNodeId),floatingParentNodeId:Je(e=>e.floatingParentNodeId),itemProps:Je(e=>e.itemProps),closeDelay:Je(e=>e.closeDelay),keyboardEventRelay:Je(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class ly extends hf{constructor(r){super({...WU(),...r},{positionerRef:w.createRef(),popupRef:w.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:w.createRef(),beforeContentFocusGuardRef:w.createRef(),onOpenChangeComplete:void 0,triggerElements:new Fc},XU);Be(this,"unsubscribeParentListener",null);this.unsubscribeParentListener=this.observe("parent",i=>{var s;if((s=this.unsubscribeParentListener)==null||s.call(this),i.type==="menu"){this.unsubscribeParentListener=i.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=i.store.context.allowMouseUpTriggerRef;return}i.type!==void 0&&(this.context.allowMouseUpTriggerRef=i.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(r,i){this.state.floatingRootContext.context.events.emit("setOpen",{open:r,eventDetails:i})}static useStore(r,i){const s=_n(()=>new ly(i)).current;return r??s}}function WU(){return{...Jg(),disabled:!1,modal:!0,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new qg,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:xn,keyboardEventRelay:void 0,closeDelay:0}}const $U=w.createContext(void 0);function QU(){return w.useContext($U)}const ZU=Wg(function(t){const{children:r,open:i,onOpenChange:s,onOpenChangeComplete:l,defaultOpen:u=!1,disabled:d=!1,modal:m,loopFocus:f=!0,orientation:y="vertical",actionsRef:p,closeParentOnEsc:v=!1,handle:b,triggerId:S,defaultTriggerId:x=null,highlightItemOnHover:R=!0}=t,T=vf(!0),M=Ho(!0),D=VR(!0),C=QU(),N=w.useMemo(()=>C&&M?{type:"menu",store:M.store}:D?{type:"menubar",context:D}:T&&!M?{type:"context-menu",context:T}:{type:void 0},[T,M,D,C]),k=ly.useStore(b==null?void 0:b.store,{open:u,openProp:i,activeTriggerId:x,triggerIdProp:S,parent:N});iy(()=>{i===void 0&&k.state.open===!1&&u===!0&&k.update({open:!0,activeTriggerId:x})}),k.useControlledProp("openProp",i),k.useControlledProp("triggerIdProp",S),k.useContextCallback("onOpenChangeComplete",l);const O=k.useState("floatingTreeRoot"),L=H1(O),G=$a();_e(()=>{T&&!M?k.update({parent:{type:"context-menu",context:T},floatingNodeId:L,floatingParentNodeId:G}):M&&k.update({floatingNodeId:L,floatingParentNodeId:G})},[T,M,L,G,k]);const J=k.useState("open"),Z=k.useState("activeTriggerElement"),z=k.useState("positionerElement"),H=k.useState("hoverEnabled"),V=k.useState("modal"),q=k.useState("disabled"),_=k.useState("lastOpenChangeReason"),j=k.useState("parent"),U=k.useState("activeIndex"),ie=k.useState("payload"),ae=k.useState("floatingParentNodeId"),P=w.useRef(null),X=ae!=null;let $;k.useSyncedValues({disabled:d,modal:j.type===void 0?m:void 0,rootId:Uo()});const{openMethod:F,triggerProps:te,reset:ue}=TR(J);Qg(k);const{forceUnmount:he}=Zg(J,k,()=>{k.update({allowMouseEnter:!1,stickIfOpen:!0}),ue()}),we=w.useRef(j.type!=="context-menu"),ve=rr();w.useEffect(()=>{if(J||(P.current=null),j.type==="context-menu"){if(!J){ve.clear(),we.current=!1;return}ve.start(500,()=>{we.current=!0})}},[ve,J,j.type]),RR(J&&V&&_!==Zn&&F!=="touch",z),_e(()=>{!J&&!H&&k.set("hoverEnabled",!0)},[J,H,k]);const ke=w.useRef(!0),Xe=rr(),ne=ze((Pe,st)=>{var Ht;const gt=st.reason;if(J===Pe&&st.trigger===Z&&_===gt||(st.preventUnmountOnClose=()=>{k.set("preventUnmountingOnClose",!0)},!Pe&&st.trigger==null&&(st.trigger=Z??void 0),s==null||s(Pe,st),st.isCanceled))return;const Kn={open:Pe,nativeEvent:st.event,reason:st.reason,nested:X};$==null||$.emit("openchange",Kn);const rn=st.event;if(Pe===!1&&(rn==null?void 0:rn.type)==="click"&&rn.pointerType==="touch"&&!ke.current)return;if(!Pe&&U!==null){const Ke=k.context.itemDomElements.current[U];queueMicrotask(()=>{Ke==null||Ke.setAttribute("tabindex","-1")})}Pe&&gt===Ms?(ke.current=!1,Xe.start(300,()=>{ke.current=!0})):(ke.current=!0,Xe.clear());const lt=(gt===_o||gt===qE)&&rn.detail===0&&(rn==null?void 0:rn.isTrusted),wt=!Pe&&(gt===nf||gt==null),et={open:Pe,openChangeReason:gt};P.current=st.event??null;const vt=((Ht=st.trigger)==null?void 0:Ht.id)??null;(vt||Pe)&&(et.activeTriggerId=vt,et.activeTriggerElement=st.trigger??null),k.update(et),j.type==="menubar"&&(gt===Ms||gt===Gs||gt===Zn||gt===Od||gt===Md)?k.set("instantType","group"):lt||wt?k.set("instantType",lt?"click":"dismiss"):k.set("instantType",void 0)}),fe=w.useCallback(Pe=>{const st=pt(Pe);return st.preventUnmountOnClose=()=>{k.set("preventUnmountingOnClose",!0)},st},[k]),Se=w.useCallback(()=>{k.setOpen(!1,fe(Ag))},[k,fe]);w.useImperativeHandle(p,()=>({unmount:he,close:Se}),[he,Se]);let Ne;j.type==="context-menu"&&(Ne=j.context),w.useImperativeHandle(Ne==null?void 0:Ne.positionerRef,()=>z,[z]),w.useImperativeHandle(Ne==null?void 0:Ne.actionsRef,()=>({setOpen:ne}),[ne]);const Te=ty({popupStore:k,onOpenChange:ne});$=Te.context.events,w.useEffect(()=>{const Pe=({open:st,eventDetails:gt})=>ne(st,gt);return $.on("setOpen",Pe),()=>{$==null||$.off("setOpen",Pe)}},[$,ne]);const Ee=Xg(Te,{enabled:!q,bubbles:{escapeKey:v&&j.type==="menu"},outsidePress(){var Pe;return j.type!=="context-menu"||((Pe=P.current)==null?void 0:Pe.type)==="contextmenu"?!0:we.current},externalTree:X?O:void 0}),Re=fR(Te,{role:"menu"}),pe=gf(),De=w.useCallback(Pe=>{k.select("activeIndex")!==Pe&&k.set("activeIndex",Pe)},[k]),xe=jP(Te,{enabled:!q,listRef:k.context.itemDomElements,activeIndex:U,nested:j.type!==void 0,loopFocus:f,orientation:y,parentOrientation:j.type==="menubar"?j.context.orientation:void 0,rtl:pe==="rtl",disabledIndices:Yp,onNavigate:De,openOnArrowKeyDown:j.type!=="context-menu",externalTree:X?O:void 0,focusItemOnHover:R}),qe=w.useCallback(Pe=>{k.context.typingRef.current=Pe},[k]),Ge=BP(Te,{listRef:k.context.itemLabels,activeIndex:U,resetMs:aL,onMatch:Pe=>{J&&Pe!==U&&k.set("activeIndex",Pe)},onTypingChange:qe}),{getReferenceProps:Le,getFloatingProps:ot,getItemProps:Pt,getTriggerProps:Ft}=mf([Ee,Re,xe,Ge]),tt=w.useMemo(()=>{const Pe=wa(Le(),{onMouseMove(){k.set("allowMouseEnter",!0)}},te);return delete Pe.role,Pe},[Le,k,te]),ft=w.useMemo(()=>{const Pe=Ft();if(!Pe)return Pe;const st=wa(Pe,te);return delete st.role,delete st["aria-controls"],st},[Ft,te]),Ct=w.useMemo(()=>ot({onMouseMove(){k.set("allowMouseEnter",!0),j.type==="menu"&&k.set("hoverEnabled",!1)},onClick(){k.select("hoverEnabled")&&k.set("hoverEnabled",!1)},onKeyDown(Pe){const st=k.select("keyboardEventRelay");st&&!Pe.isPropagationStopped()&&st(Pe)}}),[ot,j.type,k]),sn=w.useMemo(()=>Pt(),[Pt]);k.useSyncedValues({floatingRootContext:Te,activeTriggerProps:tt,inactiveTriggerProps:ft,popupProps:Ct,itemProps:sn});const ln=w.useMemo(()=>({store:k,parent:N}),[k,N]),On=I.jsx(jR.Provider,{value:ln,children:typeof r=="function"?r({payload:ie}):r});return j.type===void 0||j.type==="context-menu"?I.jsx($3,{externalTree:O,children:On}):On});function JU(e){const t=e.getBoundingClientRect(),r=window.getComputedStyle(e,"::before"),i=window.getComputedStyle(e,"::after");if(!(r.content!=="none"||i.content!=="none"))return t;const l=parseFloat(r.width)||0,u=parseFloat(r.height)||0,d=parseFloat(i.width)||0,m=parseFloat(i.height)||0,f=Math.max(t.width,l,d),y=Math.max(t.height,u,m),p=f-t.width,v=y-t.height;return{left:t.left-p/2,right:t.right+p/2,top:t.top-v/2,bottom:t.bottom+v/2}}function ej(e={}){const{highlightItemOnHover:t,highlightedIndex:r,onHighlightedIndexChange:i}=_g(),{ref:s,index:l}=BR(e),u=r===l,d=w.useRef(null),m=ko(s,d);return{compositeProps:w.useMemo(()=>({tabIndex:u?0:-1,onFocus(){i(l)},onMouseMove(){const y=d.current;if(!t||!y)return;const p=y.hasAttribute("disabled")||y.ariaDisabled==="true";!u&&!p&&y.focus()}}),[u,i,l,t]),compositeRef:m,index:l}}function tj(e){const{render:t,className:r,state:i=xn,props:s=Yp,refs:l=Yp,metadata:u,stateAttributesMapping:d,tag:m="div",...f}=e,{compositeProps:y,compositeRef:p}=ej({metadata:u});return Qt(m,e,{state:i,ref:[...l,p],props:[y,...s,f],stateAttributesMapping:d})}function YR(e){if(on(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!ga(e))return YR(Sa(e))}function nj(e){const{enabled:t=!0,mouseDownAction:r,open:i}=e,s=w.useRef(!1);return w.useMemo(()=>t?{onMouseDown:l=>{(r==="open"&&!i||r==="close"&&i)&&(s.current=!0,jt(l.currentTarget).addEventListener("click",()=>{s.current=!1},{once:!0}))},onClick:l=>{s.current&&(s.current=!1,l.preventBaseUIHandler())}}:xn,[t,r,i])}const bd=2,rj=iR(function(t,r){const{render:i,className:s,disabled:l=!1,nativeButton:u=!0,id:d,openOnHover:m,delay:f=100,closeDelay:y=0,handle:p,payload:v,...b}=t,S=Ho(!0),x=(p==null?void 0:p.store)??(S==null?void 0:S.store);if(!x)throw new Error(Ln(85));const R=Hi(d),T=x.useState("isTriggerActive",R),M=x.useState("floatingRootContext"),D=x.useState("isOpenedByTrigger",R),C=w.useRef(null),N=ij(),k=_g(!0),O=qi(),L=w.useMemo(()=>O??new qg,[O]),G=H1(L),J=$a(),{registerTrigger:Z,isMountedByThisTrigger:z}=sR(R,C,x,{payload:v,closeDelay:y,parent:N,floatingTreeRoot:L,floatingNodeId:G,floatingParentNodeId:J,keyboardEventRelay:k==null?void 0:k.relayKeyboardEvent}),H=N.type==="menubar",V=x.useState("disabled"),q=l||V||H&&N.context.disabled,{getButtonProps:_,buttonRef:j}=Ic({disabled:q,native:u});w.useEffect(()=>{!D&&N.type===void 0&&(x.context.allowMouseUpTriggerRef.current=!1)},[x,D,N.type]);const U=w.useRef(null),ie=rr(),ae=ze(Ee=>{if(!U.current)return;ie.clear(),x.context.allowMouseUpTriggerRef.current=!1;const Re=Ee.target;if(mt(U.current,Re)||mt(x.select("positionerElement"),Re)||Re===U.current||Re!=null&&YR(Re)===x.select("rootId"))return;const pe=JU(U.current);Ee.clientX>=pe.left-bd&&Ee.clientX<=pe.right+bd&&Ee.clientY>=pe.top-bd&&Ee.clientY<=pe.bottom+bd||L.events.emit("close",{domEvent:Ee,reason:vL})});w.useEffect(()=>{D&&x.select("lastOpenChangeReason")===Zn&&jt(U.current).addEventListener("mouseup",ae,{once:!0})},[D,ae,x]);const P=H&&N.context.hasSubmenuOpen,$=dR(M,{enabled:(m??P)&&!q&&N.type!=="context-menu"&&(!H||P&&!z),handleClose:hR({blockPointerEvents:!H}),mouseOnly:!0,move:!1,restMs:N.type===void 0?f:void 0,delay:{close:y},triggerElementRef:C,externalTree:L,isActiveTrigger:T}),F=aj(D,x.select("lastOpenChangeReason")),te=s4(M,{enabled:!q&&N.type!=="context-menu",event:D&&H?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:N.type===void 0?F:!1}),ue=lR(M,{enabled:!q&&P}),he=nj({open:D,enabled:H,mouseDownAction:"open"}),we=mf([te,ue]),ve={disabled:q,open:D},ke=x.useState("triggerProps",z),Xe=[U,r,j,Z,C],ne=[we.getReferenceProps(),$??xn,ke,{"aria-haspopup":"menu",id:R,onMouseDown:Ee=>{if(x.select("open"))return;ie.start(200,()=>{x.context.allowMouseUpTriggerRef.current=!0}),jt(Ee.currentTarget).addEventListener("mouseup",ae,{once:!0})}},H?{role:"menuitem"}:{},he,b,_],fe=w.useRef(null),Se=ze(Ee=>{ra.flushSync(()=>{x.setOpen(!1,pt(Gs,Ee.nativeEvent,Ee.currentTarget))});const Re=_3(fe.current);Re==null||Re.focus()}),Ne=ze(Ee=>{var pe;const Re=x.select("positionerElement");if(Re&&Ds(Ee,Re))(pe=x.context.beforeContentFocusGuardRef.current)==null||pe.focus();else{ra.flushSync(()=>{x.setOpen(!1,pt(Gs,Ee.nativeEvent,Ee.currentTarget))});let De=k3(x.context.triggerFocusTargetRef.current||C.current);for(;De!==null&&mt(Re,De);){const xe=De;if(De=Bg(De),De===xe)break}De==null||De.focus()}}),Te=Qt("button",t,{enabled:!H,stateAttributesMapping:FS,state:ve,ref:Xe,props:ne});return H?I.jsx(tj,{tag:"button",render:i,className:s,state:ve,refs:Xe,props:ne,stateAttributesMapping:FS}):D?I.jsxs(w.Fragment,{children:[I.jsx($s,{ref:fe,onFocus:Se},`${R}-pre-focus-guard`),I.jsx(w.Fragment,{children:Te},R),I.jsx($s,{ref:x.context.triggerFocusTargetRef,onFocus:Ne},`${R}-post-focus-guard`)]}):I.jsx(w.Fragment,{children:Te},R)});function aj(e,t){const r=rr(),[i,s]=w.useState(!1);return _e(()=>{e&&t==="trigger-hover"?(s(!0),r.start(iL,()=>{s(!1)})):e||(r.clear(),s(!1))},[e,t,r]),i}function ij(){const e=vf(!0),t=Ho(!0),r=VR();return w.useMemo(()=>r?{type:"menubar",context:r}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,r])}function oj({...e}){return I.jsx(ZU,{"data-slot":"dropdown-menu",...e})}function sj({...e}){return I.jsx(rj,{"data-slot":"dropdown-menu-trigger",...e})}function lj({align:e="start",alignOffset:t=0,side:r="bottom",sideOffset:i=4,className:s,...l}){return I.jsx(BU,{children:I.jsx(GU,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:r,sideOffset:i,children:I.jsx(jU,{"data-slot":"dropdown-menu-content",className:Ye("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden",s),...l})})})}function mx({className:e,inset:t,variant:r="default",...i}){return I.jsx(zU,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":r,className:Ye("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md px-1.5 py-1 text-sm data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...i})}function Zj({className:e,...t}){return I.jsx(P1,{"data-slot":"dropdown-menu-separator",className:Ye("bg-border -mx-1 my-1 h-px",e),...t})}const qR=w.createContext(void 0);function bf(){const e=w.useContext(qR);if(e===void 0)throw new Error(Ln(53));return e}let Qd=(function(e){return e.scrollAreaCornerHeight="--scroll-area-corner-height",e.scrollAreaCornerWidth="--scroll-area-corner-width",e})({});const wd=500,px=16;function Yr(e,t,r){if(!e)return 0;const i=getComputedStyle(e),s=r==="x"?"Inline":"Block";return r==="x"&&t==="margin"?parseFloat(i[`${t}InlineStart`])*2:parseFloat(i[`${t}${s}Start`])+parseFloat(i[`${t}${s}End`])}let cj=(function(e){return e.orientation="data-orientation",e.hovering="data-hovering",e.scrolling="data-scrolling",e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({});const Sd="base-ui-disable-scrollbar",GR={className:Sd,getElement(e){return I.jsx("style",{nonce:e,href:Sd,precedence:"base-ui:low",children:`.${Sd}{scrollbar-width:none}.${Sd}::-webkit-scrollbar{display:none}`})}};let xs=(function(e){return e.scrolling="data-scrolling",e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({});const cy={hasOverflowX:e=>e?{[xs.hasOverflowX]:""}:null,hasOverflowY:e=>e?{[xs.hasOverflowY]:""}:null,overflowXStart:e=>e?{[xs.overflowXStart]:""}:null,overflowXEnd:e=>e?{[xs.overflowXEnd]:""}:null,overflowYStart:e=>e?{[xs.overflowYStart]:""}:null,overflowYEnd:e=>e?{[xs.overflowYEnd]:""}:null,cornerHidden:()=>null},uj=w.createContext(void 0),dj={disableStyleElements:!1};function fj(){return w.useContext(uj)??dj}const hj={x:0,y:0},gx={width:0,height:0},mj={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},pj={x:!1,y:!1,corner:!1},gj=w.forwardRef(function(t,r){const{render:i,className:s,overflowEdgeThreshold:l,...u}=t,d=yj(l),m=Hi(),f=rr(),y=rr(),{nonce:p,disableStyleElements:v}=fj(),[b,S]=w.useState(!1),[x,R]=w.useState(!1),[T,M]=w.useState(!1),[D,C]=w.useState(!1),[N,k]=w.useState(gx),[O,L]=w.useState(gx),[G,J]=w.useState(mj),[Z,z]=w.useState(pj),H=w.useRef(null),V=w.useRef(null),q=w.useRef(null),_=w.useRef(null),j=w.useRef(null),U=w.useRef(null),ie=w.useRef(null),ae=w.useRef(!1),P=w.useRef(0),X=w.useRef(0),$=w.useRef(0),F=w.useRef(0),te=w.useRef("vertical"),ue=w.useRef(hj),he=ze(Ee=>{const Re=Ee.x-ue.current.x,pe=Ee.y-ue.current.y;ue.current=Ee,pe!==0&&(M(!0),f.start(wd,()=>{M(!1)})),Re!==0&&(R(!0),y.start(wd,()=>{R(!1)}))}),we=ze(Ee=>{Ee.button===0&&(ae.current=!0,P.current=Ee.clientY,X.current=Ee.clientX,te.current=Ee.currentTarget.getAttribute(cj.orientation),V.current&&($.current=V.current.scrollTop,F.current=V.current.scrollLeft),j.current&&te.current==="vertical"&&j.current.setPointerCapture(Ee.pointerId),U.current&&te.current==="horizontal"&&U.current.setPointerCapture(Ee.pointerId))}),ve=ze(Ee=>{if(!ae.current)return;const Re=Ee.clientY-P.current,pe=Ee.clientX-X.current;if(V.current){const De=V.current.scrollHeight,xe=V.current.clientHeight,qe=V.current.scrollWidth,Ge=V.current.clientWidth;if(j.current&&q.current&&te.current==="vertical"){const Le=Yr(q.current,"padding","y"),ot=Yr(j.current,"margin","y"),Pt=j.current.offsetHeight,Ft=q.current.offsetHeight-Pt-Le-ot,tt=Re/Ft;V.current.scrollTop=$.current+tt*(De-xe),Ee.preventDefault(),M(!0),f.start(wd,()=>{M(!1)})}if(U.current&&_.current&&te.current==="horizontal"){const Le=Yr(_.current,"padding","x"),ot=Yr(U.current,"margin","x"),Pt=U.current.offsetWidth,Ft=_.current.offsetWidth-Pt-Le-ot,tt=pe/Ft;V.current.scrollLeft=F.current+tt*(qe-Ge),Ee.preventDefault(),R(!0),y.start(wd,()=>{R(!1)})}}}),ke=ze(Ee=>{ae.current=!1,j.current&&te.current==="vertical"&&j.current.releasePointerCapture(Ee.pointerId),U.current&&te.current==="horizontal"&&U.current.releasePointerCapture(Ee.pointerId)});function Xe(Ee){C(Ee.pointerType==="touch")}function ne(Ee){if(Xe(Ee),Ee.pointerType!=="touch"){const Re=mt(H.current,Ee.target);S(Re)}}const fe=w.useMemo(()=>({scrolling:x||T,hasOverflowX:!Z.x,hasOverflowY:!Z.y,overflowXStart:G.xStart,overflowXEnd:G.xEnd,overflowYStart:G.yStart,overflowYEnd:G.yEnd,cornerHidden:Z.corner}),[x,T,Z.x,Z.y,Z.corner,G]),Se={role:"presentation",onPointerEnter:ne,onPointerMove:ne,onPointerDown:Xe,onPointerLeave(){S(!1)},style:{position:"relative",[Qd.scrollAreaCornerHeight]:`${N.height}px`,[Qd.scrollAreaCornerWidth]:`${N.width}px`}},Ne=Qt("div",t,{state:fe,ref:[r,H],props:[Se,u],stateAttributesMapping:cy}),Te=w.useMemo(()=>({handlePointerDown:we,handlePointerMove:ve,handlePointerUp:ke,handleScroll:he,cornerSize:N,setCornerSize:k,thumbSize:O,setThumbSize:L,touchModality:D,cornerRef:ie,scrollingX:x,setScrollingX:R,scrollingY:T,setScrollingY:M,hovering:b,setHovering:S,viewportRef:V,rootRef:H,scrollbarYRef:q,scrollbarXRef:_,thumbYRef:j,thumbXRef:U,rootId:m,hiddenState:Z,setHiddenState:z,overflowEdges:G,setOverflowEdges:J,viewportState:fe,overflowEdgeThreshold:d}),[we,ve,ke,he,N,O,D,x,R,T,M,b,S,m,Z,G,fe,d]);return I.jsxs(qR.Provider,{value:Te,children:[!v&&GR.getElement(p),Ne]})});function yj(e){if(typeof e=="number"){const t=Math.max(0,e);return{xStart:t,xEnd:t,yStart:t,yEnd:t}}return{xStart:Math.max(0,(e==null?void 0:e.xStart)||0),xEnd:Math.max(0,(e==null?void 0:e.xEnd)||0),yStart:Math.max(0,(e==null?void 0:e.yStart)||0),yEnd:Math.max(0,(e==null?void 0:e.yEnd)||0)}}const vj=w.createContext(void 0);function Rs(e,t=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,r))}function bj(e,t){if(typeof IntersectionObserver>"u")return()=>{};const r=new IntersectionObserver(i=>{i.forEach(s=>{s.intersectionRatio>0&&(t(),r.disconnect())})});return r.observe(e),()=>{r.disconnect()}}let Li=(function(e){return e.scrollAreaOverflowXStart="--scroll-area-overflow-x-start",e.scrollAreaOverflowXEnd="--scroll-area-overflow-x-end",e.scrollAreaOverflowYStart="--scroll-area-overflow-y-start",e.scrollAreaOverflowYEnd="--scroll-area-overflow-y-end",e})({});const yx=1;function vx(e,t){if(t<=0)return 0;const r=Rs(e,0,t),i=r,s=t-r,l=i<=yx,u=s<=yx;return l&&u?i<=s?0:t:l?0:u?t:r}let bx=!1;function wj(){bx||Pg||(typeof CSS<"u"&&"registerProperty"in CSS&&[Li.scrollAreaOverflowXStart,Li.scrollAreaOverflowXEnd,Li.scrollAreaOverflowYStart,Li.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),bx=!0)}const Sj=w.forwardRef(function(t,r){const{render:i,className:s,...l}=t,{viewportRef:u,scrollbarYRef:d,scrollbarXRef:m,thumbYRef:f,thumbXRef:y,cornerRef:p,cornerSize:v,setCornerSize:b,setThumbSize:S,rootId:x,setHiddenState:R,hiddenState:T,handleScroll:M,setHovering:D,setOverflowEdges:C,overflowEdges:N,overflowEdgeThreshold:k,scrollingX:O,scrollingY:L}=bf(),G=gf(),J=w.useRef(!0),Z=rr(),z=rr(),H=ze(()=>{const ie=u.current,ae=d.current,P=m.current,X=f.current,$=y.current,F=p.current;if(!ie)return;const te=ie.scrollHeight,ue=ie.scrollWidth,he=ie.clientHeight,we=ie.clientWidth,ve=ie.scrollTop,ke=ie.scrollLeft;if(te===0||ue===0)return;const Xe=he>=te,ne=we>=ue,fe=we/ue,Se=he/te,Ne=Math.max(0,ue-we),Te=Math.max(0,te-he);let Ee=0,Re=0;if(!ne){let et=0;G==="rtl"?et=Rs(-ke,0,Ne):et=Rs(ke,0,Ne),Ee=vx(et,Ne),Re=Ne-Ee}const pe=Xe?0:Rs(ve,0,Te),De=Xe?0:vx(pe,Te),xe=Xe?0:Te-De,qe=ne?0:we,Ge=Xe?0:he;let Le=0,ot=0;!ne&&!Xe&&(Le=(ae==null?void 0:ae.offsetWidth)||0,ot=(P==null?void 0:P.offsetHeight)||0);const Pt=v.width===0&&v.height===0,Ft=Pt?Le:0,tt=Pt?ot:0,ft=Yr(P,"padding","x"),Ct=Yr(ae,"padding","y"),sn=Yr($,"margin","x"),ln=Yr(X,"margin","y"),On=qe-ft-sn,Pe=Ge-Ct-ln,st=P?Math.min(P.offsetWidth-Ft,On):On,gt=ae?Math.min(ae.offsetHeight-tt,Pe):Pe,Kn=Math.max(px,st*fe),rn=Math.max(px,gt*Se);if(S(et=>et.height===rn&&et.width===Kn?et:{width:Kn,height:rn}),ae&&X){const et=ae.offsetHeight-rn-Ct-ln,vt=te-he,Ht=vt===0?0:ve/vt,Ke=Math.min(et,Math.max(0,Ht*et));X.style.transform=`translate3d(0,${Ke}px,0)`}if(P&&$){const et=P.offsetWidth-Kn-ft-sn,vt=ue-we,Ht=vt===0?0:ke/vt,Ke=G==="rtl"?Rs(Ht*et,-et,0):Rs(Ht*et,0,et);$.style.transform=`translate3d(${Ke}px,0,0)`}const lt=[[Li.scrollAreaOverflowXStart,Ee],[Li.scrollAreaOverflowXEnd,Re],[Li.scrollAreaOverflowYStart,De],[Li.scrollAreaOverflowYEnd,xe]];for(const[et,vt]of lt)ie.style.setProperty(et,`${vt}px`);F&&(ne||Xe?b({width:0,height:0}):!ne&&!Xe&&b({width:Le,height:ot})),R(et=>{const vt=Xe||ne;return et.y===Xe&&et.x===ne&&et.corner===vt?et:{y:Xe,x:ne,corner:vt}});const wt={xStart:!ne&&Ee>k.xStart,xEnd:!ne&&Re>k.xEnd,yStart:!Xe&&De>k.yStart,yEnd:!Xe&&xe>k.yEnd};C(et=>et.xStart===wt.xStart&&et.xEnd===wt.xEnd&&et.yStart===wt.yStart&&et.yEnd===wt.yEnd?et:wt)});_e(()=>{if(!u.current)return;wj();let ie=!1;return bj(u.current,()=>{if(!ie){ie=!0;return}H()})},[H,u]),_e(()=>{queueMicrotask(H)},[H,T,G]),_e(()=>{var ie;(ie=u.current)!=null&&ie.matches(":hover")&&D(!0)},[u,D]),w.useEffect(()=>{const ie=u.current;if(typeof ResizeObserver>"u"||!ie)return;let ae=!1;const P=new ResizeObserver(()=>{if(!ae){ae=!0;return}H()});return P.observe(ie),z.start(0,()=>{const X=ie.getAnimations({subtree:!0});X.length!==0&&Promise.allSettled(X.map($=>$.finished)).then(H).catch(()=>{})}),()=>{P.disconnect(),z.clear()}},[H,u,z]);function V(){J.current=!1}const q={role:"presentation",...x&&{"data-id":`${x}-viewport`},...(!T.x||!T.y)&&{tabIndex:0},className:GR.className,style:{overflow:"scroll"},onScroll(){u.current&&(H(),J.current||M({x:u.current.scrollLeft,y:u.current.scrollTop}),Z.start(100,()=>{J.current=!0}))},onWheel:V,onTouchMove:V,onPointerMove:V,onPointerEnter:V,onKeyDown:V},_=w.useMemo(()=>({scrolling:O||L,hasOverflowX:!T.x,hasOverflowY:!T.y,overflowXStart:N.xStart,overflowXEnd:N.xEnd,overflowYStart:N.yStart,overflowYEnd:N.yEnd,cornerHidden:T.corner}),[O,L,T.x,T.y,T.corner,N]),j=Qt("div",t,{ref:[r,u],state:_,props:[q,l],stateAttributesMapping:cy}),U=w.useMemo(()=>({computeThumbPosition:H}),[H]);return I.jsx(vj.Provider,{value:U,children:j})}),KR=w.createContext(void 0);function xj(){const e=w.useContext(KR);if(e===void 0)throw new Error(Ln(54));return e}let Zd=(function(e){return e.scrollAreaThumbHeight="--scroll-area-thumb-height",e.scrollAreaThumbWidth="--scroll-area-thumb-width",e})({});const Ej=w.forwardRef(function(t,r){const{render:i,className:s,orientation:l="vertical",keepMounted:u=!1,...d}=t,{hovering:m,scrollingX:f,scrollingY:y,hiddenState:p,overflowEdges:v,scrollbarYRef:b,scrollbarXRef:S,viewportRef:x,thumbYRef:R,thumbXRef:T,handlePointerDown:M,handlePointerUp:D,rootId:C,thumbSize:N}=bf(),k={hovering:m,scrolling:{horizontal:f,vertical:y}[l],orientation:l,hasOverflowX:!p.x,hasOverflowY:!p.y,overflowXStart:v.xStart,overflowXEnd:v.xEnd,overflowYStart:v.yStart,overflowYEnd:v.yEnd,cornerHidden:p.corner},O=gf();w.useEffect(()=>{const H=x.current,V=l==="vertical"?b.current:S.current;if(!V)return;function q(_){if(!(!H||!V||_.ctrlKey)){if(_.preventDefault(),l==="vertical"){if(H.scrollTop===0&&_.deltaY<0)return}else if(H.scrollLeft===0&&_.deltaX<0)return;if(l==="vertical"){if(H.scrollTop===H.scrollHeight-H.clientHeight&&_.deltaY>0)return}else if(H.scrollLeft===H.scrollWidth-H.clientWidth&&_.deltaX>0)return;l==="vertical"?H.scrollTop+=_.deltaY:H.scrollLeft+=_.deltaX}}return V.addEventListener("wheel",q,{passive:!1}),()=>{V.removeEventListener("wheel",q)}},[l,S,b,x]);const L={...C&&{"data-id":`${C}-scrollbar`},onPointerDown(H){if(H.button===0&&H.currentTarget===H.target&&x.current){if(R.current&&b.current&&l==="vertical"){const V=Yr(R.current,"margin","y"),q=Yr(b.current,"padding","y"),_=R.current.offsetHeight,j=b.current.getBoundingClientRect(),U=H.clientY-j.top-_/2-q+V/2,ie=x.current.scrollHeight,ae=x.current.clientHeight,P=b.current.offsetHeight-_-q-V,$=U/P*(ie-ae);x.current.scrollTop=$}if(T.current&&S.current&&l==="horizontal"){const V=Yr(T.current,"margin","x"),q=Yr(S.current,"padding","x"),_=T.current.offsetWidth,j=S.current.getBoundingClientRect(),U=H.clientX-j.left-_/2-q+V/2,ie=x.current.scrollWidth,ae=x.current.clientWidth,P=S.current.offsetWidth-_-q-V,X=U/P;let $;O==="rtl"?($=(1-X)*(ie-ae),x.current.scrollLeft<=0&&($=-$)):$=X*(ie-ae),x.current.scrollLeft=$}M(H)}},onPointerUp:D,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",...l==="vertical"&&{top:0,bottom:`var(${Qd.scrollAreaCornerHeight})`,insetInlineEnd:0,[Zd.scrollAreaThumbHeight]:`${N.height}px`},...l==="horizontal"&&{insetInlineStart:0,insetInlineEnd:`var(${Qd.scrollAreaCornerWidth})`,bottom:0,[Zd.scrollAreaThumbWidth]:`${N.width}px`}}},G=Qt("div",t,{ref:[r,l==="vertical"?b:S],state:k,props:[L,d],stateAttributesMapping:cy}),J=w.useMemo(()=>({orientation:l}),[l]),Z=l==="vertical"?p.y:p.x;return u||!Z?I.jsx(KR.Provider,{value:J,children:G}):null}),Rj=w.forwardRef(function(t,r){const{render:i,className:s,...l}=t,{thumbYRef:u,thumbXRef:d,handlePointerDown:m,handlePointerMove:f,handlePointerUp:y,setScrollingX:p,setScrollingY:v}=bf(),{orientation:b}=xj();return Qt("div",t,{ref:[r,b==="vertical"?u:d],state:{orientation:b},props:[{onPointerDown:m,onPointerMove:f,onPointerUp(R){b==="vertical"&&v(!1),b==="horizontal"&&p(!1),y(R)},style:{...b==="vertical"&&{height:`var(${Zd.scrollAreaThumbHeight})`},...b==="horizontal"&&{width:`var(${Zd.scrollAreaThumbWidth})`}}},l]})}),Tj=w.forwardRef(function(t,r){const{render:i,className:s,...l}=t,{cornerRef:u,cornerSize:d,hiddenState:m}=bf(),f=Qt("div",t,{ref:[r,u],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:d.width,height:d.height}},l]});return m.corner?null:f});function Cj({className:e,children:t,...r}){return I.jsxs(gj,{"data-slot":"scroll-area",className:Ye("relative",e),...r,children:[I.jsx(Sj,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),I.jsx(Oj,{}),I.jsx(Tj,{})]})}function Oj({className:e,orientation:t="vertical",...r}){return I.jsx(Ej,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:Ye("data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none","[@media(any-pointer:coarse)]:hidden",e),...r,children:I.jsx(Rj,{"data-slot":"scroll-area-thumb",className:"rounded-full bg-border relative flex-1"})})}function Mj(){const e=qs.getState().settings;return(e==null?void 0:e.siteName)||"tmex"}function wx(e){const t=e==null?void 0:e.trim();return t&&t.length>0?t:"?"}function Jj({paneIdx:e,windowIdx:t,paneTitle:r,windowName:i,windowCustomName:s,deviceName:l}){const u=t??"?",d=e??"?",m=wx(s??r??i),f=wx(l);return`${u}/${d}: ${m}@${f}`}function uy(e){var d,m;const t=(d=e.customName)==null?void 0:d.trim(),r=e.panes.find(f=>f.active)??e.panes[0],i=e.name.trim(),s=(m=r==null?void 0:r.title)==null?void 0:m.trim(),l=t||s||i;return{title:l,processName:!!i&&i!==l?i:void 0}}function Dj(e){const{title:t,processName:r}=uy(e);return r?`${r}: ${t}`:t}function e5(e){const t=Mj();return e!=null&&e.trim()?`[${t}]${e}`:t}function t5(e){return e}function Aj(e){return encodeURIComponent(e)}function Nj(){const{t:e}=Qs(),t=Wa(),r=gE(),{isMobile:i,setOpenMobile:s}=Gi(),{toggleDevice:l}=l_(),u=yc("/devices/:deviceId/windows/:windowId/panes/:paneId",t.pathname),d=u==null?void 0:u.params.deviceId,m=u==null?void 0:u.params.windowId,f=u==null?void 0:u.params.paneId,y=Vn(F=>F.snapshots),p=Vn(F=>F.connectedDevices),v=Vn(F=>F.closeWindow),b=Vn(F=>F.closePane),S=Vn(F=>F.renameWindow),x=qs(F=>{var te;return((te=F.settings)==null?void 0:te.language)??"en_US"}),{data:R}=GO({queryKey:["devices"],queryFn:async()=>{const F=await fetch("/api/devices");if(!F.ok)throw new Error("Failed to fetch devices");return F.json()},throwOnError:!1}),T=Vn(F=>F.hydrateDeviceErrors);w.useEffect(()=>{R!=null&&R.devices&&T(R.devices.map(F=>({deviceId:F.id,lastError:F.lastError??null,lastErrorType:F.lastErrorType??null})))},[R,T]);const M=w.useCallback((F,te)=>{r(F,{replace:(te==null?void 0:te.replace)??!0}),i&&s(!1)},[r,i,s]),D=w.useCallback((F,te,ue)=>{N.current=null,window.dispatchEvent(new CustomEvent("tmex:user-initiated-selection",{detail:{deviceId:F,windowId:te,paneId:ue}})),M(`/devices/${F}/windows/${te}/panes/${Aj(ue)}`)},[M]),C=Vn(F=>F.selectWindow),N=w.useRef(null);w.useEffect(()=>{var Xe,ne;const F=N.current;if(!F)return;if(Date.now()-F.at>5e3){N.current=null;return}const{deviceId:te,windowId:ue}=F,he=y[te],we=(Xe=he==null?void 0:he.session)==null?void 0:Xe.windows;if(!we)return;const ve=we.find(fe=>fe.id===ue);if(!((ne=ve==null?void 0:ve.panes)!=null&&ne.length))return;N.current=null;const ke=ve.panes.find(fe=>fe.active)??ve.panes[0];D(te,ue,ke.id)},[y,D]);const k=w.useCallback((F,te,ue)=>{C(F,te);const he=ue.find(we=>we.active)??ue[0];he?(D(F,te,he.id),N.current=null):N.current={deviceId:F,windowId:te,at:Date.now()}},[D,C]),O=w.useCallback((F,te)=>{te?F===d&&M("/devices"):M(`/devices/${F}`),l(F,te)},[l,d,M]),L=w.useCallback((F,te)=>{F===d&&te===m&&M("/devices"),v(F,te)},[v,d,m,M]),[G,J]=w.useState(null),Z=w.useCallback((F,te)=>{var we,ve;const ue=(ve=(we=Vn.getState().snapshots[F])==null?void 0:we.session)==null?void 0:ve.windows,he=ue==null?void 0:ue.find(ke=>ke.id===te);J({kind:"window",deviceId:F,windowId:te,name:he?Dj(he):""})},[]),z=w.useCallback((F,te,ue)=>{var ve,ke,Xe,ne;const he=(ke=(ve=Vn.getState().snapshots[F])==null?void 0:ve.session)==null?void 0:ke.windows,we=(ne=(Xe=he==null?void 0:he.find(fe=>fe.id===te))==null?void 0:Xe.panes)==null?void 0:ne.find(fe=>fe.id===ue);J({kind:"pane",deviceId:F,paneId:ue,name:(we==null?void 0:we.title)||`Pane ${(we==null?void 0:we.index)??""}`})},[]),H=w.useCallback(()=>{G&&(G.kind==="window"?L(G.deviceId,G.windowId):b(G.deviceId,G.paneId),J(null))},[G,L,b]),[V,q]=w.useState(null),[_,j]=w.useState(""),U=w.useCallback((F,te)=>{var we,ve;const ue=(ve=(we=Vn.getState().snapshots[F])==null?void 0:we.session)==null?void 0:ve.windows,he=ue==null?void 0:ue.find(ke=>ke.id===te);he&&(j(he.customName??uy(he).title),q({deviceId:F,windowId:te,hasCustomName:!!he.customName}))},[]),ie=w.useCallback(()=>{if(!V)return;const F=_.trim();F&&(S(V.deviceId,V.windowId,F),q(null))},[V,_,S]),ae=w.useCallback(()=>{V&&(S(V.deviceId,V.windowId,""),q(null))},[V,S]),P=w.useCallback(F=>{Vn.getState().createWindow(F)},[]),X=(R==null?void 0:R.devices)??[],$=w.useMemo(()=>[...X].sort((F,te)=>F.name.localeCompare(te.name,UA(x),{numeric:!0,sensitivity:"base"})),[X,x]);return I.jsxs(PR,{className:"flex flex-col flex-1 min-h-0",children:[I.jsx($I,{children:e("device.devices")}),I.jsx(Cj,{className:"flex-1 min-h-0",children:I.jsxs("div",{className:"space-y-1.5 py-2",children:[$.map(F=>{var te,ue;return I.jsx(kj,{device:F,windows:((ue=(te=y[F.id])==null?void 0:te.session)==null?void 0:ue.windows)??null,isConnected:p.has(F.id),isSelected:F.id===d,selectedWindowId:m,selectedPaneId:f,onConnectToggle:()=>O(F.id,p.has(F.id)),onCreateWindow:P,onCloseWindow:Z,onClosePane:z,onRenameWindow:U,onPaneClick:D,onWindowClick:k},F.id)}),$.length===0&&I.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:e("sidebar.noDevices")})]})}),I.jsx(uU,{open:G!==null,onOpenChange:F=>!F&&J(null),children:I.jsxs(hU,{children:[I.jsxs(mU,{children:[I.jsx(gU,{className:"bg-destructive/10",children:I.jsx(zc,{className:"h-5 w-5 text-destructive"})}),I.jsx(yU,{children:(G==null?void 0:G.kind)==="pane"?e("window.closePaneConfirmTitle"):e("window.closeConfirmTitle")}),I.jsx(vU,{children:e("window.closeConfirmDesc",{name:(G==null?void 0:G.name)??""})})]}),I.jsxs(pU,{children:[I.jsx(wU,{children:e("common.cancel")}),I.jsx(bU,{variant:"destructive",disabled:!G,onClick:H,children:e("common.close")})]})]})}),I.jsx(SU,{open:V!==null,onOpenChange:F=>!F&&q(null),children:I.jsx(RU,{"data-testid":"window-rename-dialog",children:I.jsxs("form",{onSubmit:F=>{F.preventDefault(),ie()},children:[I.jsxs(TU,{children:[I.jsx(OU,{children:e("window.rename")}),I.jsx(MU,{children:e("window.renameDesc")})]}),I.jsx("div",{className:"py-4",children:I.jsx(j3,{autoFocus:!0,maxLength:64,value:_,onChange:F=>j(F.target.value),placeholder:e("window.renamePlaceholder"),"data-testid":"window-rename-input"})}),I.jsxs(CU,{children:[(V==null?void 0:V.hasCustomName)&&I.jsx(ya,{type:"button",variant:"ghost",onClick:ae,"data-testid":"window-rename-reset",children:e("window.renameReset")}),I.jsx(ya,{type:"button",variant:"outline",onClick:()=>q(null),children:e("common.cancel")}),I.jsx(ya,{type:"submit",disabled:!_.trim(),"data-testid":"window-rename-save",children:e("common.save")})]})]})})})]})}function kj({device:e,windows:t,isConnected:r,isSelected:i,selectedWindowId:s,selectedPaneId:l,onConnectToggle:u,onCreateWindow:d,onCloseWindow:m,onClosePane:f,onRenameWindow:y,onPaneClick:p,onWindowClick:v}){const{t:b}=Qs(),S=e.type==="local"?UE:x_;return I.jsxs("div",{"data-testid":`device-item-${e.id}`,className:Ye("rounded-lg border overflow-hidden text-select-none",i?"bg-card":r?"bg-card/50":"bg-muted/20"),onClick:r?void 0:u,children:[I.jsxs("div",{className:"relative px-3 py-1 border-b bg-muted/30",children:[i&&I.jsx("span",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-muted-foreground/70"}),I.jsxs("div",{className:"flex items-center gap-2",children:[I.jsx(S,{className:"ml-1 h-4 w-4 text-muted-foreground shrink-0"}),I.jsx("span",{className:"flex-1 truncate text-xs font-medium text-select-none",children:e.name}),I.jsx(lU,{deviceId:e.id,className:"shrink-0"}),I.jsx("div",{className:Ye("h-2 w-2 rounded-full shrink-0",r?"bg-emerald-500":"bg-gray-400")}),I.jsx(ya,{variant:"ghost",size:"icon-xs",onClick:x=>{x.stopPropagation(),u()},"data-testid":r?`device-disconnect-${e.id}`:`device-connect-${e.id}`,title:b(r?"device.disconnect":"device.connect"),children:r?I.jsx(__,{className:"h-3.5 w-3.5 text-orange-500"}):I.jsx(z_,{className:"h-3.5 w-3.5 text-emerald-500"})})]})]}),r&&I.jsxs("div",{className:"p-1.5 space-y-1.5 [@media(any-pointer:coarse)]:space-y-2",children:[!t&&I.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:b("device.connecting")}),(t==null?void 0:t.length)===0&&I.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:b("window.noWindows")}),t==null?void 0:t.map(x=>I.jsx(_j,{deviceId:e.id,window:x,isSelected:x.id===s,selectedPaneId:l,onPaneClick:p,onWindowClick:v,onCloseWindow:m,onClosePane:f,onRenameWindow:y},x.id)),I.jsxs("button",{type:"button","data-testid":`window-create-${e.id}`,onPointerDown:x=>x.stopPropagation(),onMouseDown:x=>x.stopPropagation(),onClick:()=>d(e.id),className:"w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left transition-colors text-muted-foreground hover:text-foreground hover:bg-accent/30 border border-dashed border-border/50 hover:border-border",children:[I.jsx(N_,{className:"h-3.5 w-3.5 shrink-0"}),I.jsx("span",{className:"text-xs",children:b("window.new")})]})]})]})}function _j({deviceId:e,window:t,isSelected:r,selectedPaneId:i,onPaneClick:s,onWindowClick:l,onCloseWindow:u,onClosePane:d,onRenameWindow:m}){const{t:f}=Qs(),{isMobile:y}=Gi(),p=t.panes.length>1,v=uy(t),b=t.panes.find(x=>x.id===i),S=r&&!!b;return I.jsxs("div",{className:"space-y-1",children:[I.jsxs("div",{className:"group relative",children:[I.jsxs("button",{type:"button",onClick:()=>l(e,t.id,t.panes),"data-testid":`window-item-${t.id}`,className:Ye("w-full flex items-center gap-2 px-2 py-1.5 rounded-lg text-left transition-colors pr-7 [@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:pr-12",y&&"py-2.5 pr-13",S?"bg-primary/15 text-primary border border-primary/30":t.active?"bg-accent text-accent-foreground border border-border/70":"hover:bg-accent/50 text-foreground border border-transparent"),children:[I.jsx(ag,{variant:S?"default":"outline",className:"h-5 text-[10px] px-1.5 shrink-0",children:t.index}),I.jsxs("span",{className:"flex-1 min-w-0",children:[I.jsx("span",{className:"font-mono text-[11px] leading-tight font-medium line-clamp-2 [overflow-wrap:break-word]",children:v.title}),v.processName&&I.jsx("span",{className:"font-mono text-[10.5px] leading-tight text-muted-foreground line-clamp-1 break-all",children:v.processName})]})]}),I.jsxs(oj,{children:[I.jsx(sj,{"data-testid":`window-menu-${t.id}`,"aria-label":f("window.menu"),title:f("window.menu"),className:Ye("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded text-muted-foreground hover:bg-background hover:text-foreground transition-opacity data-popup-open:opacity-100",y?"h-11 w-11 right-0 rounded-lg bg-background/40 opacity-100":"h-5 w-5 right-1.5 [@media(any-pointer:coarse)]:h-10 [@media(any-pointer:coarse)]:w-10 [@media(any-pointer:coarse)]:right-0.5 [@media(any-pointer:coarse)]:rounded-lg",S?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),children:I.jsx(w_,{className:Ye(y?"h-5 w-5":"h-3.5 w-3.5 [@media(any-pointer:coarse)]:h-4.5 [@media(any-pointer:coarse)]:w-4.5")})}),I.jsxs(lj,{align:"end",className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:[I.jsxs(mx,{"data-testid":`window-menu-rename-${t.id}`,className:Ye("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",y&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>m(e,t.id),children:[I.jsx(D_,{className:Ye("h-4 w-4",y&&"h-5 w-5")}),f("window.rename")]}),I.jsxs(mx,{variant:"destructive","data-testid":`window-menu-close-${t.id}`,className:Ye("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",y&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>u(e,t.id),children:[I.jsx(zc,{className:Ye("h-4 w-4",y&&"h-5 w-5")}),f("window.close")]})]})]})]}),p&&I.jsx("div",{className:"ml-4 pl-2 border-l border-border/50 space-y-1 [@media(any-pointer:coarse)]:space-y-1.5",children:t.panes.map(x=>{const R=x.id===i;return I.jsxs("div",{className:"group relative",children:[I.jsxs("button",{type:"button",onClick:()=>s(e,t.id,x.id),"data-testid":`pane-item-${x.id}`,className:Ye("w-full flex items-center gap-2 px-2 py-1 rounded-lg text-left transition-colors pr-7 [@media(any-pointer:coarse)]:py-2 [@media(any-pointer:coarse)]:pr-12",y&&"py-2.5 pr-13",R?"bg-primary/10 text-primary border border-primary/20":x.active?"bg-accent text-accent-foreground border border-border/70":"hover:bg-accent/30 text-muted-foreground border border-transparent"),children:[I.jsx("span",{className:"text-[10px] font-mono opacity-60 w-4",children:x.index}),I.jsx("span",{className:"flex-1 text-xs line-clamp-2 break-all",children:x.title||`Pane ${x.index}`})]}),I.jsx("button",{type:"button",onClick:T=>{T.stopPropagation(),d(e,t.id,x.id)},"data-testid":`pane-close-${x.id}`,className:Ye("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded text-muted-foreground hover:bg-background hover:text-foreground transition-opacity",y?"h-11 w-11 right-0 rounded-lg bg-background/40 opacity-100":"h-5 w-5 right-1.5 [@media(any-pointer:coarse)]:h-10 [@media(any-pointer:coarse)]:w-10 [@media(any-pointer:coarse)]:right-0.5 [@media(any-pointer:coarse)]:rounded-lg",R?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),title:f("window.closePane"),children:I.jsx("span",{className:Ye("leading-none",y?"text-base":"text-xs"),children:"×"})})]},x.id)})})]})}function Lj(){const{t:e}=Qs(),{isMobile:t,setOpenMobile:r}=Gi(),i=qs(y=>{var p;return(p=y.settings)==null?void 0:p.siteName}),s=qs(y=>y.fetchSettings);w.useEffect(()=>{s()},[s]);const l=i??"tmex",u=xc(y=>y.theme),d=xc(y=>y.setTheme),m=u==="dark",f=()=>{const y=m?"light":"dark";d(y),document.documentElement.classList.toggle("dark",y==="dark")};return I.jsxs("div",{className:"flex items-center gap-2 px-2",children:[I.jsxs($d,{to:"/",className:"flex flex-1 items-center gap-3 overflow-hidden",children:[I.jsx("div",{className:"h-8 w-8 shrink-0 overflow-hidden rounded-lg border-2 border-black",children:I.jsx("img",{src:"/logo.png",alt:l,className:"h-full w-full object-cover"})}),I.jsx("span",{className:"truncate text-sm font-semibold tracking-tight",children:l})]}),I.jsx("button",{type:"button",onClick:f,className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":e(m?"settings.themeLight":"settings.themeDark"),title:e(m?"settings.themeLight":"settings.themeDark"),children:m?I.jsx(B_,{className:"h-4 w-4"}):I.jsx(T_,{className:"h-4 w-4"})}),I.jsx($d,{to:"/settings",className:"inline-flex h-8 w-8 mr-[-8px] shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":e("sidebar.settings"),title:e("sidebar.settings"),children:I.jsx(j_,{className:"h-4 w-4"})}),t&&I.jsx("button",{type:"button","data-testid":"mobile-sidebar-close",onClick:()=>r(!1),className:"inline-flex h-8 w-8 mr-[-8px] shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":e("nav.closeSidebar"),title:e("nav.closeSidebar"),children:I.jsx(zc,{className:"h-4 w-4"})})]})}const zj=[{title:"nav.manageDevices",url:"/devices",icon:UE}];function Pj({...e}){return I.jsxs(VI,{variant:"inset",...e,children:[I.jsx("div",{className:"h-[var(--tmex-safe-area-top)]"}),I.jsx(KI,{className:"py-3",children:I.jsx(Lj,{})}),I.jsx(WI,{className:"flex flex-col",children:I.jsx(Nj,{})}),I.jsxs(XI,{children:[I.jsx(iU,{items:zj}),I.jsx("div",{className:"h-[var(--tmex-safe-area-bottom)]"})]})]})}const Ij=60,Uj=.02;function jj(e){if(Math.abs(e.viewportScale-1)>Uj)return 0;const t=Math.round(e.windowInnerHeight-e.viewportHeight-e.viewportOffsetTop);return t>=Ij?t:0}function n5(){if(typeof navigator>"u")return!1;const e=navigator.userAgent,t=/iPad|iPhone|iPod/.test(e),r=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return t||r}function Hj(){return typeof window>"u"||typeof navigator>"u"?!1:"ontouchstart"in window||navigator.maxTouchPoints>0}function Bj(){const[e,t]=w.useState(0);return w.useEffect(()=>{if(!Hj())return;const r=window.visualViewport;if(!r)return;let i=null;const s=()=>{const u=document.activeElement;if(!(u instanceof Element&&u.closest("[data-virtual-keyboard-avoid]")!==null)){t(0);return}t(jj({windowInnerHeight:window.innerHeight,viewportHeight:r.height,viewportOffsetTop:r.offsetTop,viewportScale:r.scale}))},l=()=>{i===null&&(i=window.requestAnimationFrame(()=>{i=null,s()}))};return s(),r.addEventListener("resize",l),r.addEventListener("scroll",l),window.addEventListener("resize",l),document.addEventListener("focusin",l),document.addEventListener("focusout",l),()=>{r.removeEventListener("resize",l),r.removeEventListener("scroll",l),window.removeEventListener("resize",l),document.removeEventListener("focusin",l),document.removeEventListener("focusout",l),i!==null&&window.cancelAnimationFrame(i)}},[]),e}function Fj(){var e;try{const t=localStorage.getItem("tmex-ui");if(!t){document.documentElement.classList.add("dark");return}const r=JSON.parse(t),i=(e=r==null?void 0:r.state)==null?void 0:e.theme,s=i==="dark"||i===void 0;document.documentElement.classList.toggle("dark",s)}catch{document.documentElement.classList.add("dark")}}Fj();const Vj=new NO({defaultOptions:{queries:{staleTime:5e3,retry:1}}});function Yj(){const e=Bj();return I.jsx(c_,{children:I.jsxs(FI,{children:[I.jsx(Pj,{}),I.jsxs(GI,{className:"h-dvh overflow-hidden",style:e>0?{transform:`translateY(-${e}px)`,transition:"transform 0.12s ease-out"}:void 0,children:[I.jsx("div",{className:"h-[var(--tmex-safe-area-top)]"}),I.jsx(F2,{}),I.jsx("div",{className:"h-[var(--tmex-safe-area-bottom)]"})]})]})})}function ec({moduleLoader:e}){const[t,r]=w.useState(null),i=w2();w.useEffect(()=>{e().then(r)},[e]);const s=t==null?void 0:t.default,l=t==null?void 0:t.PageTitle,u=t==null?void 0:t.PageActions;return I.jsxs(I.Fragment,{children:[I.jsxs("header",{className:"sticky top-0 z-10 flex h-12 md:h-16 shrink-0 items-center justify-between gap-2 bg-background/95 backdrop-blur-sm","data-testid":"mobile-topbar",children:[I.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-4",children:[I.jsx(qI,{className:"-ml-1 shrink-0","data-testid":"mobile-sidebar-open"}),I.jsx(H3,{orientation:"vertical",className:"mr-2 shrink-0 data-[orientation=vertical]:h-4"}),I.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:l?I.jsx(l,{...i}):""})]}),I.jsx("div",{className:"flex shrink-0 items-center gap-1 px-4",children:u&&I.jsx(u,{...i})})]}),I.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4 !pt-0 p-2 md:p-4 mb-2",children:I.jsx("div",{className:"bg-muted/50 min-h-0 flex-1 overflow-auto overscroll-auto rounded-xl [-webkit-overflow-scrolling:touch]",children:s?I.jsx(s,{}):null})})]})}const qj=()=>og(()=>import("./SettingsPage-BU-Jjd2f.js"),__vite__mapDeps([0,1,2,3])),Sx=()=>og(()=>import("./DevicesPage-BvCZBCO1.js"),__vite__mapDeps([4,1,2])),xx=()=>og(()=>import("./DevicePage-CJEjk7rL.js"),__vite__mapDeps([5,3,2])),Gj=hD([{path:"/",Component:Yj,children:[{index:!0,element:I.jsx(ec,{moduleLoader:Sx})},{path:"devices",element:I.jsx(ec,{moduleLoader:Sx})},{path:"devices/:deviceId",element:I.jsx(ec,{moduleLoader:xx})},{path:"devices/:deviceId/windows/:windowId/panes/:paneId",element:I.jsx(ec,{moduleLoader:xx})},{path:"settings",element:I.jsx(ec,{moduleLoader:qj})}]}]),XR=document.getElementById("root");if(!XR)throw new Error("Root element not found");ZO.createRoot(XR).render(I.jsx(w.StrictMode,{children:I.jsxs(LO,{client:Vj,children:[I.jsx(j2,{router:Gj}),I.jsx(ZD,{richColors:!0,position:"top-right",closeButton:!0,offset:{top:"calc(16px + var(--tmex-safe-area-top))",right:"16px",bottom:"16px",left:"16px"},mobileOffset:{top:"calc(12px + var(--tmex-safe-area-top))",right:"12px",bottom:"12px",left:"12px"},toastOptions:{duration:6e3}})]})}));export{Je as $,uU as A,ya as B,Zj as C,oj as D,ag as E,lU as F,x_ as G,Bz as H,j3 as I,SU as J,RU as K,Rg as L,UE as M,TU as N,OU as O,N_ as P,MU as Q,CU as R,H3 as S,Mc as T,yp as U,hc as V,MO as W,Hn as X,mr as Y,Ix as Z,Ln as _,_O as a,SR as a$,Gz as a0,f1 as a1,z3 as a2,YE as a3,KE as a4,TR as a5,_n as a6,oR as a7,er as a8,P3 as a9,Vz as aA,FS as aB,jt as aC,mt as aD,JU as aE,vL as aF,G3 as aG,K1 as aH,lL as aI,RR as aJ,LR as aK,FU as aL,ER as aM,xR as aN,jo as aO,yf as aP,IU as aQ,fj as aR,af as aS,Rs as aT,Rn as aU,Pg as aV,ra as aW,GR as aX,X1 as aY,$j as aZ,Zs as a_,_e as aa,ze as ab,Uc as ac,DP as ad,s4 as ae,Xg as af,jP as ag,BP as ah,mf as ai,wa as aj,iy as ak,ko as al,Qj as am,F1 as an,pt as ao,Pc as ap,Yp as aq,TP as ar,xn as as,Gs as at,Dg as au,h1 as av,Ic as aw,rr as ax,jd as ay,Qt as az,qs as b,BR as b0,LU as b1,qE as b2,zc as b3,Nk as b4,Ak as b5,Sc as b6,Wj as b7,w2 as b8,gE as b9,t5 as ba,n5 as bb,Jj as bc,Aj as bd,e5 as be,Hi as bf,ar as c,xc as d,GO as e,Xj as f,_d as g,hU as h,mU as i,I as j,yU as k,vU as l,pU as m,wU as n,bU as o,kn as p,Ye as q,w as r,Vn as s,UA as t,Qs as u,gU as v,sj as w,lj as x,mx as y,D_ as z};
225
- //# sourceMappingURL=index-YVZKH9DX.js.map