@dhzh/foundry 10.0.1 → 10.1.1

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.
@@ -0,0 +1,254 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/code-editor-DR4jlIG5.js","assets/code-editor-DMeNDIaI.css"])))=>i.map(i=>d[i]);
2
+ function vj(e,t){for(var s=0;s<t.length;s++){const i=t[s];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in e)){const l=Object.getOwnPropertyDescriptor(i,o);l&&Object.defineProperty(e,o,l.get?l:{enumerable:!0,get:()=>i[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const l of o)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 s(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(o){if(o.ep)return;o.ep=!0;const l=s(o);fetch(o.href,l)}})();function KR(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var V0={exports:{}},uu={};var iw;function bj(){if(iw)return uu;iw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(i,o,l){var u=null;if(l!==void 0&&(u=""+l),o.key!==void 0&&(u=""+o.key),"key"in o){l={};for(var d in o)d!=="key"&&(l[d]=o[d])}else l=o;return o=l.ref,{$$typeof:e,type:i,key:u,ref:o!==void 0?o:null,props:l}}return uu.Fragment=t,uu.jsx=s,uu.jsxs=s,uu}var aw;function xj(){return aw||(aw=1,V0.exports=bj()),V0.exports}var v=xj(),K0={exports:{}},Mt={};var ow;function Sj(){if(ow)return Mt;ow=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),x=Symbol.for("react.view_transition"),S=Symbol.iterator;function w(I){return I===null||typeof I!="object"?null:(I=S&&I[S]||I["@@iterator"],typeof I=="function"?I:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,R={};function k(I,V,W){this.props=I,this.context=V,this.refs=R,this.updater=W||C}k.prototype.isReactComponent={},k.prototype.setState=function(I,V){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,V,"setState")},k.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function O(){}O.prototype=k.prototype;function A(I,V,W){this.props=I,this.context=V,this.refs=R,this.updater=W||C}var N=A.prototype=new O;N.constructor=A,E(N,k.prototype),N.isPureReactComponent=!0;var j=Array.isArray;function D(){}var M={H:null,A:null,T:null,S:null},_=Object.prototype.hasOwnProperty;function L(I,V,W){var re=W.ref;return{$$typeof:e,type:I,key:V,ref:re!==void 0?re:null,props:W}}function q(I,V){return L(I.type,V,I.props)}function X(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function B(I){var V={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(W){return V[W]})}var H=/\/+/g;function U(I,V){return typeof I=="object"&&I!==null&&I.key!=null?B(""+I.key):V.toString(36)}function z(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(D,D):(I.status="pending",I.then(function(V){I.status==="pending"&&(I.status="fulfilled",I.value=V)},function(V){I.status==="pending"&&(I.status="rejected",I.reason=V)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function Q(I,V,W,re,Ee){var le=typeof I;(le==="undefined"||le==="boolean")&&(I=null);var me=!1;if(I===null)me=!0;else switch(le){case"bigint":case"string":case"number":me=!0;break;case"object":switch(I.$$typeof){case e:case t:me=!0;break;case m:return me=I._init,Q(me(I._payload),V,W,re,Ee)}}if(me)return Ee=Ee(I),me=re===""?"."+U(I,0):re,j(Ee)?(W="",me!=null&&(W=me.replace(H,"$&/")+"/"),Q(Ee,V,W,"",function(Te){return Te})):Ee!=null&&(X(Ee)&&(Ee=q(Ee,W+(Ee.key==null||I&&I.key===Ee.key?"":(""+Ee.key).replace(H,"$&/")+"/")+me)),V.push(Ee)),1;me=0;var ge=re===""?".":re+":";if(j(I))for(var ue=0;ue<I.length;ue++)re=I[ue],le=ge+U(re,ue),me+=Q(re,V,W,le,Ee);else if(ue=w(I),typeof ue=="function")for(I=ue.call(I),ue=0;!(re=I.next()).done;)re=re.value,le=ge+U(re,ue++),me+=Q(re,V,W,le,Ee);else if(le==="object"){if(typeof I.then=="function")return Q(z(I),V,W,re,Ee);throw V=String(I),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return me}function $(I,V,W){if(I==null)return I;var re=[],Ee=0;return Q(I,re,"","",function(le){return V.call(W,le,Ee++)}),re}function K(I){if(I._status===-1){var V=I._result,W=V();W.then(function(re){(I._status===0||I._status===-1)&&(I._status=1,I._result=re,W.status===void 0&&(W.status="fulfilled",W.value=re))},function(re){(I._status===0||I._status===-1)&&(I._status=2,I._result=re,W.status===void 0&&(W.status="rejected",W.reason=re))}),I._status===-1&&(I._status=0,I._result=W)}if(I._status===1)return I._result.default;throw I._result}var Y=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)};function ee(I){var V=M.T,W={};W.types=V!==null?V.types:null,M.T=W;try{var re=I(),Ee=M.S;Ee!==null&&Ee(W,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(D,Y)}catch(le){Y(le)}finally{V!==null&&W.types!==null&&(V.types=W.types),M.T=V}}function G(I){var V=M.T;if(V!==null){var W=V.types;W===null?V.types=[I]:W.indexOf(I)===-1&&W.push(I)}else ee(G.bind(null,I))}var oe={map:$,forEach:function(I,V,W){$(I,function(){V.apply(this,arguments)},W)},count:function(I){var V=0;return $(I,function(){V++}),V},toArray:function(I){return $(I,function(V){return V})||[]},only:function(I){if(!X(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return Mt.Activity=h,Mt.Children=oe,Mt.Component=k,Mt.Fragment=s,Mt.Profiler=o,Mt.PureComponent=A,Mt.StrictMode=i,Mt.Suspense=f,Mt.ViewTransition=x,Mt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Mt.__COMPILER_RUNTIME={__proto__:null,c:function(I){return M.H.useMemoCache(I)}},Mt.addTransitionType=G,Mt.cache=function(I){return function(){return I.apply(null,arguments)}},Mt.cacheSignal=function(){return null},Mt.cloneElement=function(I,V,W){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var re=E({},I.props),Ee=I.key;if(V!=null)for(le in V.key!==void 0&&(Ee=""+V.key),V)!_.call(V,le)||le==="key"||le==="__self"||le==="__source"||le==="ref"&&V.ref===void 0||(re[le]=V[le]);var le=arguments.length-2;if(le===1)re.children=W;else if(1<le){for(var me=Array(le),ge=0;ge<le;ge++)me[ge]=arguments[ge+2];re.children=me}return L(I.type,Ee,re)},Mt.createContext=function(I){return I={$$typeof:u,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:l,_context:I},I},Mt.createElement=function(I,V,W){var re,Ee={},le=null;if(V!=null)for(re in V.key!==void 0&&(le=""+V.key),V)_.call(V,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(Ee[re]=V[re]);var me=arguments.length-2;if(me===1)Ee.children=W;else if(1<me){for(var ge=Array(me),ue=0;ue<me;ue++)ge[ue]=arguments[ue+2];Ee.children=ge}if(I&&I.defaultProps)for(re in me=I.defaultProps,me)Ee[re]===void 0&&(Ee[re]=me[re]);return L(I,le,Ee)},Mt.createRef=function(){return{current:null}},Mt.forwardRef=function(I){return{$$typeof:d,render:I}},Mt.isValidElement=X,Mt.lazy=function(I){return{$$typeof:m,_payload:{_status:-1,_result:I},_init:K}},Mt.memo=function(I,V){return{$$typeof:g,type:I,compare:V===void 0?null:V}},Mt.startTransition=ee,Mt.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Mt.use=function(I){return M.H.use(I)},Mt.useActionState=function(I,V,W){return M.H.useActionState(I,V,W)},Mt.useCallback=function(I,V){return M.H.useCallback(I,V)},Mt.useContext=function(I){return M.H.useContext(I)},Mt.useDebugValue=function(){},Mt.useDeferredValue=function(I,V){return M.H.useDeferredValue(I,V)},Mt.useEffect=function(I,V){return M.H.useEffect(I,V)},Mt.useEffectEvent=function(I){return M.H.useEffectEvent(I)},Mt.useId=function(){return M.H.useId()},Mt.useImperativeHandle=function(I,V,W){return M.H.useImperativeHandle(I,V,W)},Mt.useInsertionEffect=function(I,V){return M.H.useInsertionEffect(I,V)},Mt.useLayoutEffect=function(I,V){return M.H.useLayoutEffect(I,V)},Mt.useMemo=function(I,V){return M.H.useMemo(I,V)},Mt.useOptimistic=function(I,V){return M.H.useOptimistic(I,V)},Mt.useReducer=function(I,V,W){return M.H.useReducer(I,V,W)},Mt.useRef=function(I){return M.H.useRef(I)},Mt.useState=function(I){return M.H.useState(I)},Mt.useSyncExternalStore=function(I,V,W){return M.H.useSyncExternalStore(I,V,W)},Mt.useTransition=function(){return M.H.useTransition()},Mt.version="19.3.1",Mt}var lw;function Qu(){return lw||(lw=1,K0.exports=Sj()),K0.exports}var b=Qu();const Ne=KR(b),qR=vj({__proto__:null,default:Ne},[b]);var q0={exports:{}},du={},Y0={exports:{}},G0={};var cw;function wj(){return cw||(cw=1,(function(e){function t(z,Q){var $=z.length;z.push(Q);e:for(;0<$;){var K=$-1>>>1,Y=z[K];if(0<o(Y,Q))z[K]=Q,z[$]=Y,$=K;else break e}}function s(z){return z.length===0?null:z[0]}function i(z){if(z.length===0)return null;var Q=z[0],$=z.pop();if($!==Q){z[0]=$;e:for(var K=0,Y=z.length,ee=Y>>>1;K<ee;){var G=2*(K+1)-1,oe=z[G],I=G+1,V=z[I];if(0>o(oe,$))I<Y&&0>o(V,oe)?(z[K]=V,z[I]=$,K=I):(z[K]=oe,z[G]=$,K=G);else if(I<Y&&0>o(V,$))z[K]=V,z[I]=$,K=I;else break e}}return Q}function o(z,Q){var $=z.sortIndex-Q.sortIndex;return $!==0?$:z.id-Q.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 f=[],g=[],m=1,h=null,x=3,S=!1,w=!1,C=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function A(z){for(var Q=s(g);Q!==null;){if(Q.callback===null)i(g);else if(Q.startTime<=z)i(g),Q.sortIndex=Q.expirationTime,t(f,Q);else break;Q=s(g)}}function N(z){if(C=!1,A(z),!w)if(s(f)!==null)w=!0,j||(j=!0,X());else{var Q=s(g);Q!==null&&U(N,Q.startTime-z)}}var j=!1,D=-1,M=5,_=-1;function L(){return E?!0:!(e.unstable_now()-_<M)}function q(){if(E=!1,j){var z=e.unstable_now();_=z;var Q=!0;try{e:{w=!1,C&&(C=!1,k(D),D=-1),S=!0;var $=x;try{t:{for(A(z),h=s(f);h!==null&&!(h.expirationTime>z&&L());){var K=h.callback;if(typeof K=="function"){h.callback=null,x=h.priorityLevel;var Y=K(h.expirationTime<=z);if(z=e.unstable_now(),typeof Y=="function"){h.callback=Y,A(z),Q=!0;break t}h===s(f)&&i(f),A(z)}else i(f);h=s(f)}if(h!==null)Q=!0;else{var ee=s(g);ee!==null&&U(N,ee.startTime-z),Q=!1}}break e}finally{h=null,x=$,S=!1}Q=void 0}}finally{Q?X():j=!1}}}var X;if(typeof O=="function")X=function(){O(q)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,H=B.port2;B.port1.onmessage=q,X=function(){H.postMessage(null)}}else X=function(){R(q,0)};function U(z,Q){D=R(function(){z(e.unstable_now())},Q)}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(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(z){switch(x){case 1:case 2:case 3:var Q=3;break;default:Q=x}var $=x;x=Q;try{return z()}finally{x=$}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(z,Q){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var $=x;x=z;try{return Q()}finally{x=$}},e.unstable_scheduleCallback=function(z,Q,$){var K=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?K+$:K):$=K,z){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=$+Y,z={id:m++,callback:Q,priorityLevel:z,startTime:$,expirationTime:Y,sortIndex:-1},$>K?(z.sortIndex=$,t(g,z),s(f)===null&&z===s(g)&&(C?(k(D),D=-1):C=!0,U(N,$-K))):(z.sortIndex=Y,t(f,z),w||S||(w=!0,j||(j=!0,X()))),z},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(z){var Q=x;return function(){var $=x;x=Q;try{return z.apply(this,arguments)}finally{x=$}}}})(G0)),G0}var uw;function Ej(){return uw||(uw=1,Y0.exports=wj()),Y0.exports}var $0={exports:{}},Er={};var dw;function Rj(){if(dw)return Er;dw=1;var e=Qu();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)h+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var i={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal"),l=Symbol.for("react.recoverable"),u=Symbol.for("react.optimistic_key");function d(m,h,x){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:S==null?null:S===u?u:""+S,children:m,containerInfo:h,implementation:x}}var f=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Er.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Er.browser=function(m){return{$$typeof:l,_reason:m}},Er.createPortal=function(m,h){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return d(m,h,null,x)},Er.flushSync=function(m){var h=f.T,x=i.p;try{if(f.T=null,i.p=2,m)return m()}finally{f.T=h,i.p=x,i.d.f()}},Er.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(m,h))},Er.prefetchDNS=function(m){typeof m=="string"&&i.d.D(m)},Er.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var x=h.as,S=g(x,h.crossOrigin),w=typeof h.integrity=="string"?h.integrity:void 0,C=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;x==="style"?i.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:S,integrity:w,fetchPriority:C}):x==="script"&&i.d.X(m,{crossOrigin:S,integrity:w,fetchPriority:C,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Er.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var x=g(h.as,h.crossOrigin);i.d.M(m,{crossOrigin:x,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0})}}else h==null&&i.d.M(m)},Er.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var x=h.as,S=g(x,h.crossOrigin);i.d.L(m,x,{crossOrigin:S,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Er.preloadModule=function(m,h){if(typeof m=="string")if(h){var x=g(h.as,h.crossOrigin);i.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:x,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0})}else i.d.m(m)},Er.requestFormReset=function(m){i.d.r(m)},Er.unstable_batchedUpdates=function(m,h){return m(h)},Er.useFormState=function(m,h,x){return f.H.useFormState(m,h,x)},Er.useFormStatus=function(){return f.H.useHostTransitionStatus()},Er.version="19.3.1",Er}var fw;function YR(){if(fw)return $0.exports;fw=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(),$0.exports=Rj(),$0.exports}var hw;function Cj(){if(hw)return du;hw=1;var e=Ej(),t=Qu(),s=YR();function i(n){var r="https://react.dev/errors/"+n;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+n+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function l(n){for(var r=n,a=r;a&&!a.alternate;)r=a,(r.flags&4098)!==0&&(n=r.return),a=r.return;for(;r.return;)r=r.return;return r.tag===3?n:null}function u(n){if(n.tag===13){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function d(n){if(n.tag===31){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function f(n){if(l(n)!==n)throw Error(i(188))}function g(n){var r=n.alternate;if(!r){if(r=l(n),r===null)throw Error(i(188));return r!==n?null:n}for(var a=n,c=r;;){var p=a.return;if(p===null)break;var y=p.alternate;if(y===null){if(c=p.return,c!==null){a=c;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===a)return f(p),n;if(y===c)return f(p),r;y=y.sibling}throw Error(i(188))}if(a.return!==c.return)a=p,c=y;else{for(var T=!1,P=p.child;P;){if(P===a){T=!0,a=p,c=y;break}if(P===c){T=!0,c=p,a=y;break}P=P.sibling}if(!T){for(P=y.child;P;){if(P===a){T=!0,a=y,c=p;break}if(P===c){T=!0,c=y,a=p;break}P=P.sibling}if(!T)throw Error(i(189))}}if(a.alternate!==c)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?n:r}function m(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n;for(n=n.child;n!==null;){if(r=m(n),r!==null)return r;n=n.sibling}return null}function h(n,r,a,c,p,y){for(;n!==null;){if((n.tag===5||n.tag===27||n.tag===6)&&a(n,c,p,y)||(n.tag!==22||n.memoizedState===null)&&(r||n.tag!==5&&n.tag!==27)&&h(n.child,r,a,c,p,y))return!0;n=n.sibling}return!1}function x(n){for(n=n.return;n!==null;){if(n.tag===3||n.tag===5||n.tag===27)return n;n=n.return}return null}function S(n){var r=!1;for(n=n.return;n!==null&&(n.tag===4&&(r=!0),!(n.tag===3||n.tag===5||n.tag===27));)n=n.return;return r}function w(n){var r=[null,null],a=x(n);return a===null||C(r,n,a.child,{foundSelf:!1}),r}function C(n,r,a,c){for(;a!==null;){if(a===r)c.foundSelf=!0;else if(a.tag===5||a.tag===27||a.tag===6){if(c.foundSelf)return n[1]=a,!0;n[0]=a}else if((a.tag!==22||a.memoizedState===null)&&C(n,r,a.child,c))return!0;a=a.sibling}return!1}function E(n){switch(n.tag){case 5:case 27:case 6:return n.stateNode;case 3:return n.stateNode.containerInfo;default:throw Error(i(559))}}var R=null,k=null;function O(n,r,a){return n===a?!0:n===r?(R=n,!0):!1}function A(n,r,a){return n===a?(k=n,!1):n===r?(k!==null&&(R=n),!0):!1}function N(n){if(n===null)return null;do n=n===null?null:n.return;while(n&&n.tag!==5&&n.tag!==27&&n.tag!==3);return n||null}function j(n,r,a){for(var c=0,p=n;p;p=a(p))c++;p=0;for(var y=r;y;y=a(y))p++;for(;0<c-p;)n=a(n),c--;for(;0<p-c;)r=a(r),p--;for(;c--;){if(n===r||r!==null&&n===r.alternate)return n;n=a(n),r=a(r)}return null}var D=Object.assign,M=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),X=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),H=Symbol.for("react.consumer"),U=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),G=Symbol.for("react.legacy_hidden"),oe=Symbol.for("react.memo_cache_sentinel"),I=Symbol.for("react.view_transition"),V=Symbol.for("react.recoverable"),W=Symbol.iterator;function re(n){return n===null||typeof n!="object"?null:(n=W&&n[W]||n["@@iterator"],typeof n=="function"?n:null)}var Ee=Symbol.for("react.client.reference");function le(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===Ee?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case q:return"Fragment";case B:return"Profiler";case X:return"StrictMode";case Q:return"Suspense";case $:return"SuspenseList";case ee:return"Activity";case I:return"ViewTransition"}if(typeof n=="object")switch(n.$$typeof){case L:return"Portal";case U:return n.displayName||"Context";case H:return(n._context.displayName||"Context")+".Consumer";case z:var r=n.render;return n=n.displayName,n||(n=r.displayName||r.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case K:return r=n.displayName||null,r!==null?r:le(n.type)||"Memo";case Y:r=n._payload,n=n._init;try{return le(n(r))}catch{}}return null}var me=Array.isArray,ge=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Te={pending:!1,data:null,method:null,action:null},ve=[],Pe=-1;function Oe(n){return{current:n}}function Le(n){0>Pe||(n.current=ve[Pe],ve[Pe]=null,Pe--)}function Ve(n,r){Pe++,ve[Pe]=n.current,n.current=r}var ke=Oe(null),Ue=Oe(null),be=Oe(null),He=Oe(null);function Ze(n,r){switch(Ve(be,r),Ve(Ue,n),Ve(ke,null),r.nodeType){case 9:case 11:n=(n=r.documentElement)&&(n=n.namespaceURI)?pS(n):0;break;default:if(n=r.tagName,r=r.namespaceURI)r=pS(r),n=gS(r,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}Le(ke),Ve(ke,n)}function ot(){Le(ke),Le(Ue),Le(be)}function de(n){var r=n.memoizedState;r!==null&&(Al._currentValue=r.memoizedState,Ve(He,n)),r=ke.current;var a=gS(r,n.type);r!==a&&(Ve(Ue,n),Ve(ke,a))}function we(n){Ue.current===n&&(Le(ke),Le(Ue)),He.current===n&&(Le(He),Al._currentValue=Te)}var Ge,Me;function De(n){if(Ge===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);Ge=r&&r[1]||"",Me=-1<a.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+Ge+n+Me}var bt=!1;function dt(n,r){if(!n||bt)return"";bt=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(r){var Ce=function(){throw Error()};if(Object.defineProperty(Ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ce,[])}catch(Ye){var se=Ye}Reflect.construct(n,[],Ce)}else{try{Ce.call()}catch(Ye){se=Ye}Ce=!1;try{var fe=Object.getOwnPropertyDescriptor(n.prototype,"props");Object.defineProperty(n.prototype,"props",{configurable:!0,set:function(){throw Error()}}),Ce=!0,new n}finally{Ce&&(fe!==void 0?Object.defineProperty(n.prototype,"props",fe):delete n.prototype.props)}}}else{try{throw Error()}catch(Ye){se=Ye}(Ce=n())&&typeof Ce.catch=="function"&&Ce.catch(function(){})}}catch(Ye){if(Ye&&se&&typeof Ye.stack=="string")return[Ye.stack,se.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=c.DetermineComponentFrameRoot(),T=y[0],P=y[1];if(T&&P){var Z=T.split(`
5
+ `),ae=P.split(`
6
+ `);for(p=c=0;c<Z.length&&!Z[c].includes("DetermineComponentFrameRoot");)c++;for(;p<ae.length&&!ae[p].includes("DetermineComponentFrameRoot");)p++;if(c===Z.length||p===ae.length)for(c=Z.length-1,p=ae.length-1;1<=c&&0<=p&&Z[c]!==ae[p];)p--;for(;1<=c&&0<=p;c--,p--)if(Z[c]!==ae[p]){if(c!==1||p!==1)do if(c--,p--,0>p||Z[c]!==ae[p]){var pe=`
7
+ `+Z[c].replace(" at new "," at ");return n.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",n.displayName)),pe}while(1<=c&&0<=p);break}}}finally{bt=!1,Error.prepareStackTrace=a}return(a=n?n.displayName||n.name:"")?De(a):""}function gt(n,r){switch(n.tag){case 26:case 27:case 5:return De(n.type);case 16:return De("Lazy");case 13:return n.child!==r&&r!==null?De("Suspense Fallback"):De("Suspense");case 19:return De("SuspenseList");case 0:case 15:return dt(n.type,!1);case 11:return dt(n.type.render,!1);case 1:return dt(n.type,!0);case 31:return De("Activity");case 30:return De("ViewTransition");default:return""}}function Nt(n){try{var r="",a=null;do r+=gt(n,a),a=n,n=n.return;while(n);return r}catch(c){return`
8
+ Error generating stack: `+c.message+`
9
+ `+c.stack}}var jt=Object.prototype.hasOwnProperty,tn=e.unstable_scheduleCallback,an=e.unstable_cancelCallback,nn=e.unstable_shouldYield,We=e.unstable_requestPaint,wt=e.unstable_now,Zt=e.unstable_getCurrentPriorityLevel,ht=e.unstable_ImmediatePriority,xt=e.unstable_UserBlockingPriority,yt=e.unstable_NormalPriority,Ut=e.unstable_LowPriority,un=e.unstable_IdlePriority,je=e.log,at=e.unstable_setDisableYieldValue,Ie=null,ze=null;function $e(n){if(typeof je=="function"&&at(n),ze&&typeof ze.setStrictMode=="function")try{ze.setStrictMode(Ie,n)}catch{}}var et=Math.clz32?Math.clz32:J,Tt=Math.log,F=Math.LN2;function J(n){return n>>>=0,n===0?32:31-(Tt(n)/F|0)|0}var ne=256,ye=262144,xe=4194304;function qe(n){var r=n&42;if(r!==0)return r;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&-n;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,r,a){var c=n.pendingLanes;if(c===0)return 0;var p=0,y=n.suspendedLanes,T=n.pingedLanes;n=n.warmLanes;var P=c&134217727;return P!==0?(c=P&~y,c!==0?p=qe(c):(T&=P,T!==0?p=qe(T):a||(a=P&~n,a!==0&&(p=qe(a))))):(P=c&~y,P!==0?p=qe(P):T!==0?p=qe(T):a||(a=c&~n,a!==0&&(p=qe(a)))),p===0?0:r!==0&&r!==p&&(r&y)===0&&(y=p&-p,a=r&-r,y>=a||y===32&&(a&4194048)!==0)?r:p}function Xe(n,r){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&r)===0}function Qe(n,r){(r&8)!==0&&(r|=r&32);var a=n.entangledLanes;if(a!==0)for(n=n.entanglements,a&=r;0<a;){var c=31-et(a),p=1<<c;r|=n[c],a&=~p}return r}function lt(n,r){switch(n){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 tt(){var n=xe;return xe<<=1,(xe&62914560)===0&&(xe=4194304),n}function Et(n){for(var r=[],a=0;31>a;a++)r.push(n);return r}function ft(n,r){n.pendingLanes|=r,r!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function qt(n,r,a,c,p,y){var T=n.pendingLanes;n.pendingLanes=a,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=a,n.entangledLanes&=a,n.errorRecoveryDisabledLanes&=a,n.shellSuspendCounter=0;var P=n.entanglements,Z=n.expirationTimes,ae=n.hiddenUpdates;for(a=T&~a;0<a;){var pe=31-et(a),Ce=1<<pe;P[pe]=0,Z[pe]=-1;var se=ae[pe];if(se!==null)for(ae[pe]=null,pe=0;pe<se.length;pe++){var fe=se[pe];fe!==null&&(fe.lane&=-536870913)}a&=~Ce}c!==0&&Ft(n,c,0),y!==0&&p===0&&n.tag!==0&&(n.suspendedLanes|=y&~(T&~r))}function Ft(n,r,a){n.pendingLanes|=r,n.suspendedLanes&=~r;var c=31-et(r);n.entangledLanes|=r,n.entanglements[c]=n.entanglements[c]|1073741824|a&261930}function On(n,r){var a=n.entangledLanes|=r;for(n=n.entanglements;a;){var c=31-et(a),p=1<<c;p&r|n[c]&r&&(n[c]|=r),a&=~p}}function Yt(n,r){var a=r&-r;return a=(a&42)!==0?1:Bt(a),(a&(n.suspendedLanes|r))!==0?0:a}function Bt(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 Cn(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Tn(){var n=ue.p;return n!==0?n:(n=window.event,n===void 0?32:JS(n.type))}function ns(n,r){var a=ue.p;try{return ue.p=n,r()}finally{ue.p=a}}var dn=Math.random().toString(36).slice(2),fn="__reactFiber$"+dn,An="__reactProps$"+dn,jn="__reactContainer$"+dn,Oi="__reactEvents$"+dn,jr="__reactListeners$"+dn,_s="__reactHandles$"+dn,rs="__reactResources$"+dn,xs="__reactMarker$"+dn,zt="__reactLoad$"+dn;function qn(n){delete n[fn],delete n[An],delete n[jr],delete n[_s]}function Fn(n){var r;if(r=n[fn])return r;for(var a=n.parentNode;a;){if(r=a[jn]||a[fn]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(n=DS(n);n!==null;){if(a=n[fn])return a;n=DS(n)}return r}n=a,a=n.parentNode}return null}function gr(n){if(n=n[fn]||n[jn]){var r=n.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return n}return null}function he(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n.stateNode;throw Error(i(33))}function Ae(n){var r=n[rs];return r||(r=n[rs]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Se(n){n[xs]=!0}function rt(n){n[zt]=void 0}var Ot=new Set,Rt={};function Ht(n,r){xn(n,r),xn(n+"Capture",r)}function xn(n,r){for(Rt[n]=r,n=0;n<r.length;n++)Ot.add(r[n])}var hn=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]*$"),vt={},Dt={};function on(n){return jt.call(Dt,n)?!0:jt.call(vt,n)?!1:hn.test(n)?Dt[n]=!0:(vt[n]=!0,!1)}var mt=!1;function rr(){var n=mt;return mt=!1,n}function zn(n,r,a){if(on(r))if(a===null)n.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":n.removeAttribute(r);return;case"boolean":var c=r.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){n.removeAttribute(r);return}}n.setAttribute(r,a)}}function ss(n,r,a){if(a===null)n.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(r);return}n.setAttribute(r,a)}}function Gn(n,r,a,c){if(c===null)n.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(a);return}n.setAttributeNS(r,a,c)}}function $n(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Go(n){var r=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function bc(n,r,a){var c=Object.getOwnPropertyDescriptor(n.constructor.prototype,r);if(!n.hasOwnProperty(r)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,y=c.set;return Object.defineProperty(n,r,{configurable:!0,get:function(){return p.call(this)},set:function(T){a=""+T,y.call(this,T)}}),Object.defineProperty(n,r,{enumerable:c.enumerable}),{getValue:function(){return a},setValue:function(T){a=""+T},stopTracking:function(){n._valueTracker=null,delete n[r]}}}}function Ai(n){if(!n._valueTracker){var r=Go(n)?"checked":"value";n._valueTracker=bc(n,r,""+n[r])}}function $o(n){if(!n)return!1;var r=n._valueTracker;if(!r)return!0;var a=r.getValue(),c="";return n&&(c=Go(n)?n.checked?"true":"false":n.value),n=c,n!==a?(r.setValue(n),!0):!1}var Ad=/[\n"\\]/g;function Dn(n){return n.replace(Ad,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Cr(n,r,a,c,p,y,T,P){n.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?n.type=T:n.removeAttribute("type"),r!=null?T==="number"?(r===0&&n.value===""||n.value!=r)&&(n.value=""+$n(r)):n.value!==""+$n(r)&&(n.value=""+$n(r)):T!=="submit"&&T!=="reset"||n.removeAttribute("value"),r!=null?T==="number"&&n.value==r?Qo(n,$n(n.value)):Qo(n,$n(r)):a!=null?Qo(n,$n(a)):c!=null&&n.removeAttribute("value"),p==null&&y!=null&&(n.defaultChecked=!!y),p!=null&&(n.checked=p&&typeof p!="function"&&typeof p!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?n.name=""+$n(P):n.removeAttribute("name")}function ia(n,r,a,c,p,y,T,P){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(n.type=y),r!=null||a!=null){if(!(y!=="submit"&&y!=="reset"||r!=null)){Ai(n);return}a=a!=null?""+$n(a):"",r=r!=null?""+$n(r):a,P||r===n.value||(n.value=r),n.defaultValue=r}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=P?n.checked:!!c,n.defaultChecked=!!c,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(n.name=T),Ai(n)}function Qo(n,r){n.defaultValue!==""+r&&(n.defaultValue=""+r)}function qr(n,r,a,c){if(n=n.options,r){r={};for(var p=0;p<a.length;p++)r["$"+a[p]]=!0;for(a=0;a<n.length;a++)p=r.hasOwnProperty("$"+n[a].value),n[a].selected!==p&&(n[a].selected=p),p&&c&&(n[a].defaultSelected=!0)}else{for(a=""+$n(a),r=null,p=0;p<n.length;p++){if(n[p].value===a){n[p].selected=!0,c&&(n[p].defaultSelected=!0);return}r!==null||n[p].disabled||(r=n[p])}r!==null&&(r.selected=!0)}}function Xo(n,r,a){if(r!=null&&(r=""+$n(r),r!==n.value&&(n.value=r),a==null)){n.defaultValue!==r&&(n.defaultValue=r);return}n.defaultValue=a!=null?""+$n(a):""}function is(n,r,a,c){if(r==null){if(c!=null){if(a!=null)throw Error(i(92));if(me(c)){if(1<c.length)throw Error(i(93));c=c[0]}a=c}a==null&&(a=""),r=a}a=$n(r),n.defaultValue=a,c=n.textContent,c===a&&c!==""&&c!==null&&(n.value=c),Ai(n)}function Ir(n,r){if(r){var a=n.firstChild;if(a&&a===n.lastChild&&a.nodeType===3){a.nodeValue=r;return}}n.textContent=r}var aa=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function xc(n,r,a){var c=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?c?n.setProperty(r,""):r==="float"?n.cssFloat="":n[r]="":c?n.setProperty(r,a):typeof a!="number"||a===0||aa.has(r)?r==="float"?n.cssFloat=a:n[r]=(""+a).trim():n[r]=a+"px"}function as(n,r,a){if(r!=null&&typeof r!="object")throw Error(i(62));if(n=n.style,a!=null){for(var c in a)!a.hasOwnProperty(c)||r!=null&&r.hasOwnProperty(c)||(c.indexOf("--")===0?n.setProperty(c,""):c==="float"?n.cssFloat="":n[c]="",mt=!0);for(var p in r)c=r[p],r.hasOwnProperty(p)&&a[p]!==c&&(xc(n,p,c),mt=!0)}else for(var y in r)r.hasOwnProperty(y)&&xc(n,y,r[y])}function Ja(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 Sc=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"],["maskType","mask-type"],["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"]]),wc=/^[\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 mr(n){return wc.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function Pr(){}var Wa=null;function eo(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var rn=null,or=null;function Ss(n){var r=gr(n);if(r&&(n=r.stateNode)){var a=n[An]||null;e:switch(n=r.stateNode,r.type){case"input":if(Cr(n,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=n;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Dn(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var c=a[r];if(c!==n&&c.form===n.form){var p=c[An]||null;if(!p)throw Error(i(90));Cr(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<a.length;r++)c=a[r],c.form===n.form&&$o(c)}break e;case"textarea":Xo(n,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&qr(n,!!a.multiple,r,!1)}}}var os=!1;function to(n,r,a){if(os)return n(r,a);os=!0;try{var c=n(r);return c}finally{if(os=!1,(rn!==null||or!==null)&&(Mf(),rn&&(r=rn,n=or,or=rn=null,Ss(r),n)))for(r=0;r<n.length;r++)Ss(n[r])}}function Mi(n,r){var a=n.stateNode;if(a===null)return null;var c=a[An]||null;if(c===null)return null;a=c[r];e:switch(r){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(a&&typeof a!="function")throw Error(i(231,r,typeof a));return a}var yr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),no=!1;if(yr)try{var Ec={};Object.defineProperty(Ec,"passive",{get:function(){no=!0}}),window.addEventListener("test",Ec,Ec),window.removeEventListener("test",Ec,Ec)}catch{no=!1}var oa=null,kg=null,Md=null;function ux(){if(Md)return Md;var n,r=kg,a=r.length,c,p="value"in oa?oa.value:oa.textContent,y=p.length;for(n=0;n<a&&r[n]===p[n];n++);var T=a-n;for(c=1;c<=T&&r[a-c]===p[y-c];c++);return Md=p.slice(n,1<c?1-c:void 0)}function Nd(n){var r=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&r===13&&(n=13)):n=r,n===10&&(n=13),32<=n||n===13?n:0}function Dd(){return!0}function dx(){return!1}function Lr(n){function r(a,c,p,y,T){this._reactName=a,this._targetInst=p,this.type=c,this.nativeEvent=y,this.target=T,this.currentTarget=null;for(var P in n)n.hasOwnProperty(P)&&(a=n[P],this[P]=a?a(y):y[P]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Dd:dx,this.isPropagationStopped=dx,this}return D(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Dd)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Dd)},persist:function(){},isPersistent:Dd}),r}var la={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jd=Lr(la),Rc=D({},la,{view:0,detail:0}),VM=Lr(Rc),Og,Ag,Cc,Id=D({},Rc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ng,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!==Cc&&(Cc&&n.type==="mousemove"?(Og=n.screenX-Cc.screenX,Ag=n.screenY-Cc.screenY):Ag=Og=0,Cc=n),Og)},movementY:function(n){return"movementY"in n?n.movementY:Ag}}),fx=Lr(Id),KM=D({},Id,{dataTransfer:0}),qM=Lr(KM),YM=D({},Rc,{relatedTarget:0}),Mg=Lr(YM),GM=D({},la,{animationName:0,elapsedTime:0,pseudoElement:0}),$M=Lr(GM),QM=D({},la,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),XM=Lr(QM),ZM=D({},la,{data:0}),hx=Lr(ZM),JM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},WM={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"},eN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tN(n){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(n):(n=eN[n])?!!r[n]:!1}function Ng(){return tN}var nN=D({},Rc,{key:function(n){if(n.key){var r=JM[n.key]||n.key;if(r!=="Unidentified")return r}return n.type==="keypress"?(n=Nd(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?WM[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ng,charCode:function(n){return n.type==="keypress"?Nd(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Nd(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),rN=Lr(nN),sN=D({},Id,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),px=Lr(sN),iN=D({},la,{submitter:0}),aN=Lr(iN),oN=D({},Rc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ng}),lN=Lr(oN),cN=D({},la,{propertyName:0,elapsedTime:0,pseudoElement:0}),uN=Lr(cN),dN=D({},Id,{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}),fN=Lr(dN),hN=D({},la,{newState:0,oldState:0,source:0}),pN=Lr(hN),gN=[9,13,27,32],Dg=yr&&"CompositionEvent"in window,Tc=null;yr&&"documentMode"in document&&(Tc=document.documentMode);var mN=yr&&"TextEvent"in window&&!Tc,gx=yr&&(!Dg||Tc&&8<Tc&&11>=Tc),mx=" ",yx=!1;function vx(n,r){switch(n){case"keyup":return gN.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bx(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Zo=!1;function yN(n,r){switch(n){case"compositionend":return bx(r);case"keypress":return r.which!==32?null:(yx=!0,mx);case"textInput":return n=r.data,n===mx&&yx?null:n;default:return null}}function vN(n,r){if(Zo)return n==="compositionend"||!Dg&&vx(n,r)?(n=ux(),Md=kg=oa=null,Zo=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return gx&&r.locale!=="ko"?null:r.data;default:return null}}var bN={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 xx(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r==="input"?!!bN[n.type]:r==="textarea"}function Sx(n,r,a,c){rn?or?or.push(c):or=[c]:rn=c,r=Lf(r,"onChange"),0<r.length&&(a=new jd("onChange","change",null,a,c),n.push({event:a,listeners:r}))}var kc=null,Oc=null;function xN(n){lS(n,0)}function Pd(n){var r=he(n);if($o(r))return n}function wx(n,r){if(n==="change")return r}var Ex=!1;if(yr){var jg;if(yr){var Ig="oninput"in document;if(!Ig){var Rx=document.createElement("div");Rx.setAttribute("oninput","return;"),Ig=typeof Rx.oninput=="function"}jg=Ig}else jg=!1;Ex=jg&&(!document.documentMode||9<document.documentMode)}function Cx(){kc&&(kc.detachEvent("onpropertychange",Tx),Oc=kc=null)}function Tx(n){if(n.propertyName==="value"&&Pd(Oc)){var r=[];Sx(r,Oc,n,eo(n)),to(xN,r)}}function SN(n,r,a){n==="focusin"?(Cx(),kc=r,Oc=a,kc.attachEvent("onpropertychange",Tx)):n==="focusout"&&Cx()}function wN(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Pd(Oc)}function EN(n,r){if(n==="click")return Pd(r)}function RN(n,r){if(n==="input"||n==="change")return Pd(r)}function CN(n,r){return n===r&&(n!==0||1/n===1/r)||n!==n&&r!==r}var ls=typeof Object.is=="function"?Object.is:CN;function Ac(n,r){if(ls(n,r))return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var a=Object.keys(n),c=Object.keys(r);if(a.length!==c.length)return!1;for(c=0;c<a.length;c++){var p=a[c];if(!jt.call(r,p)||!ls(n[p],r[p]))return!1}return!0}function Pg(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}}function kx(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Ox(n,r){var a=kx(n);n=0;for(var c;a;){if(a.nodeType===3){if(c=n+a.textContent.length,n<=r&&c>=r)return{node:a,offset:r-n};n=c}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=kx(a)}}function Ax(n,r){return n&&r?n===r?!0:n&&n.nodeType===3?!1:r&&r.nodeType===3?Ax(n,r.parentNode):"contains"in n?n.contains(r):n.compareDocumentPosition?!!(n.compareDocumentPosition(r)&16):!1:!1}function Mx(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var r=Pg(n.document);r instanceof n.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)n=r.contentWindow;else break;r=Pg(n.document)}return r}function Lg(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r&&(r==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||r==="textarea"||n.contentEditable==="true")}var TN=yr&&"documentMode"in document&&11>=document.documentMode,Jo=null,zg=null,Mc=null,_g=!1;function Nx(n,r,a){var c=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;_g||Jo==null||Jo!==Pg(c)||(c=Jo,"selectionStart"in c&&Lg(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}),Mc&&Ac(Mc,c)||(Mc=c,c=Lf(zg,"onSelect"),0<c.length&&(r=new jd("onSelect","select",null,r,a),n.push({event:r,listeners:c}),r.target=Jo)))}function ro(n,r){var a={};return a[n.toLowerCase()]=r.toLowerCase(),a["Webkit"+n]="webkit"+r,a["Moz"+n]="moz"+r,a}var Wo={animationend:ro("Animation","AnimationEnd"),animationiteration:ro("Animation","AnimationIteration"),animationstart:ro("Animation","AnimationStart"),transitionrun:ro("Transition","TransitionRun"),transitionstart:ro("Transition","TransitionStart"),transitioncancel:ro("Transition","TransitionCancel"),transitionend:ro("Transition","TransitionEnd")},Ug={},Dx={};yr&&(Dx=document.createElement("div").style,"AnimationEvent"in window||(delete Wo.animationend.animation,delete Wo.animationiteration.animation,delete Wo.animationstart.animation),"TransitionEvent"in window||delete Wo.transitionend.transition);function so(n){if(Ug[n])return Ug[n];if(!Wo[n])return n;var r=Wo[n],a;for(a in r)if(r.hasOwnProperty(a)&&a in Dx)return Ug[n]=r[a];return n}var jx=so("animationend"),Ix=so("animationiteration"),Px=so("animationstart"),kN=so("transitionrun"),ON=so("transitionstart"),AN=so("transitioncancel"),Lx=so("transitionend"),zx=new Map,Hg="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");Hg.push("scrollEnd");function Us(n,r){zx.set(n,r),Ht(r,[n])}var MN=0;function Ni(n,r){if(n.name!=null&&n.name!=="auto")return n.name;if(r.autoName!==null)return r.autoName;n=Vs.identifierPrefix;var a=MN++;return n="_"+n+"t_"+a.toString(32)+"_",r.autoName=n}function _x(n){if(n==null||typeof n=="string")return n;var r=null,a=bl;if(a!==null)for(var c=0;c<a.length;c++){var p=n[a[c]];if(p!=null){if(p==="none")return"none";r=r==null?p:r+(" "+p)}}return r??n.default}function Di(n,r){return n=_x(n),r=_x(r),r==null?n==="auto"?null:n:r==="auto"?null:r}var Ld=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=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(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},ws=[],el=0,Fg=0;function zd(){for(var n=el,r=Fg=el=0;r<n;){var a=ws[r];ws[r++]=null;var c=ws[r];ws[r++]=null;var p=ws[r];ws[r++]=null;var y=ws[r];if(ws[r++]=null,c!==null&&p!==null){var T=c.pending;T===null?p.next=p:(p.next=T.next,T.next=p),c.pending=p}y!==0&&Ux(a,p,y)}}function _d(n,r,a,c){ws[el++]=n,ws[el++]=r,ws[el++]=a,ws[el++]=c,Fg|=c,n.lanes|=c,n=n.alternate,n!==null&&(n.lanes|=c)}function Bg(n,r,a,c){return _d(n,r,a,c),Ud(n)}function io(n,r){return _d(n,null,null,r),Ud(n)}function Ux(n,r,a){n.lanes|=a;var c=n.alternate;c!==null&&(c.lanes|=a);for(var p=!1,y=n.return;y!==null;)y.childLanes|=a,c=y.alternate,c!==null&&(c.childLanes|=a),y.tag===22&&(n=y.stateNode,n===null||n._visibility&1||(p=!0)),n=y,y=y.return;return n.tag===3?(y=n.stateNode,p&&r!==null&&(p=31-et(a),n=y.hiddenUpdates,c=n[p],c===null?n[p]=[r]:c.push(r),r.lane=a|536870912),y):null}function Ud(n){if(50<Jc)throw Jc=0,Af=null,Error(i(185));for(var r=n.return;r!==null;)n=r,r=n.return;return n.tag===3?n.stateNode:null}var tl={};function NN(n,r,a,c){this.tag=n,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,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 Yr(n,r,a,c){return new NN(n,r,a,c)}function Vg(n){return n=n.prototype,!(!n||!n.isReactComponent)}function ji(n,r){var a=n.alternate;return a===null?(a=Yr(n.tag,r,n.key,n.mode),a.elementType=n.elementType,a.type=n.type,a.stateNode=n.stateNode,a.alternate=n,n.alternate=a):(a.pendingProps=r,a.type=n.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=n.flags&1206910976,a.childLanes=n.childLanes,a.lanes=n.lanes,a.child=n.child,a.memoizedProps=n.memoizedProps,a.memoizedState=n.memoizedState,a.updateQueue=n.updateQueue,r=n.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=n.sibling,a.index=n.index,a.ref=n.ref,a.refCleanup=n.refCleanup,a}function Hx(n,r){n.flags&=1206910978;var a=n.alternate;return a===null?(n.childLanes=0,n.lanes=r,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=a.childLanes,n.lanes=a.lanes,n.child=a.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=a.memoizedProps,n.memoizedState=a.memoizedState,n.updateQueue=a.updateQueue,n.type=a.type,r=a.dependencies,n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),n}function Hd(n,r,a,c,p,y){var T=0;if(c=n,typeof c=="function")Vg(c)&&(T=1);else if(typeof c=="string")T=ij(n,a,ke.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(c){case ee:return n=Yr(31,a,r,p),n.elementType=ee,n.lanes=y,n;case q:return ao(a.children,p,y,r);case X:T=8,p|=24;break;case B:return n=Yr(12,a,r,p|2),n.elementType=B,n.lanes=y,n;case Q:return n=Yr(13,a,r,p),n.elementType=Q,n.lanes=y,n;case $:return n=Yr(19,a,r,p),n.elementType=$,n.lanes=y,n;case G:case I:return n=p|32,n=Yr(30,a,r,n),n.elementType=I,n.lanes=y,n.stateNode={autoName:null,paired:null,clones:null,ref:null},n;default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case U:T=10;break e;case H:T=9;break e;case z:T=11;break e;case K:T=14;break e;case Y:T=16,c=null;break e}T=29,a=Error(i(130,n===null?"null":typeof n,"")),c=null}return r=Yr(T,a,r,p),r.elementType=n,r.type=c,r.lanes=y,r}function ao(n,r,a,c){return n=Yr(7,n,c,r),n.lanes=a,n}function Kg(n,r,a){return n=Yr(6,n,null,r),n.lanes=a,n}function Fx(n){var r=Yr(18,null,null,0);return r.stateNode=n,r}function qg(n,r,a){return r=Yr(4,n.children!==null?n.children:[],n.key,r),r.lanes=a,r.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},r}var Bx=new WeakMap;function Es(n,r){if(typeof n=="object"&&n!==null){var a=Bx.get(n);return a!==void 0?a:(r={value:n,source:r,stack:Nt(r)},Bx.set(n,r),r)}return{value:n,source:r,stack:Nt(r)}}var nl=[],rl=0,Fd=null,Nc=0,Rs=[],Cs=0,ca=null,ti=1,ni="";function Ii(n,r){nl[rl++]=Nc,nl[rl++]=Fd,Fd=n,Nc=r}function Vx(n,r,a){Rs[Cs++]=ti,Rs[Cs++]=ni,Rs[Cs++]=ca,ca=n;var c=ti;n=ni;var p=32-et(c)-1;c&=~(1<<p),a+=1;var y=32-et(r)+p;if(30<y){var T=p-p%5;y=(c&(1<<T)-1).toString(32),c>>=T,p-=T,ti=1<<32-et(r)+p|a<<p|c,ni=y+n}else ti=1<<y|a<<p|c,ni=n}function Bd(n){n.return!==null&&(Ii(n,1),Vx(n,1,0))}function Yg(n){for(;n===Fd;)Fd=nl[--rl],nl[rl]=null,Nc=nl[--rl],nl[rl]=null;for(;n===ca;)ca=Rs[--Cs],Rs[Cs]=null,ni=Rs[--Cs],Rs[Cs]=null,ti=Rs[--Cs],Rs[Cs]=null}function Kx(n,r){Rs[Cs++]=ti,Rs[Cs++]=ni,Rs[Cs++]=ca,ti=r.id,ni=r.overflow,ca=n}var lr=null,Mn=null,Vt=!1,ua=null,Ts=!1,Gg=Error(i(519));function da(n){var r=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Dc(Es(r,n)),Gg}function qx(n){var r=n.stateNode,a=n.type,c=n.memoizedProps;switch(r[fn]=n,r[An]=c,a){case"dialog":$t("cancel",r),$t("close",r);break;case"iframe":case"object":case"embed":$t("load",r);break;case"video":case"audio":for(a=0;a<eu.length;a++)$t(eu[a],r);break;case"source":$t("error",r);break;case"img":case"image":case"link":$t("error",r),$t("load",r);break;case"details":$t("toggle",r);break;case"input":$t("invalid",r),ia(r,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":$t("invalid",r);break;case"textarea":$t("invalid",r),is(r,c.value,c.defaultValue,c.children)}a=c.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||c.suppressHydrationWarning===!0||fS(r.textContent,a)?(c.popover!=null&&($t("beforetoggle",r),$t("toggle",r)),c.onScroll!=null&&$t("scroll",r),c.onScrollEnd!=null&&$t("scrollend",r),c.onClick!=null&&(r.onclick=Pr),r=!0):r=!1,r||da(n,!0)}function Vd(n){for(lr=n.return;lr;)switch(lr.tag){case 5:case 31:case 13:Ts=!1;return;case 27:case 3:Ts=!0;return;default:lr=lr.return}}function sl(n){if(n!==lr)return!1;if(!Vt)return Vd(n),Vt=!0,!1;var r=n.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=n.type,a=!(a!=="form"&&a!=="button")||E0(n.type,n.memoizedProps)),a=!a),a&&Mn&&da(n),Vd(n),r===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));Mn=NS(n)}else if(r===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(317));Mn=NS(n)}else r===27?(r=Mn,ka(n.type)?(n=D0,D0=null,Mn=n):Mn=r):Mn=lr?Os(n.stateNode.nextSibling):null;return!0}function oo(){Mn=lr=null,Vt=!1}function $g(){var n=ua;return n!==null&&(Qr===null?Qr=n:Qr.push.apply(Qr,n),ua=null),n}function Dc(n){ua===null?ua=[n]:ua.push(n)}var Qg=Oe(null),lo=null,Pi=null;function fa(n,r,a){Ve(Qg,r._currentValue),r._currentValue=a}function Li(n){n._currentValue=Qg.current,Le(Qg)}function Kd(n,r,a){for(;n!==null;){var c=n.alternate;if((n.childLanes&r)!==r?(n.childLanes|=r,c!==null&&(c.childLanes|=r)):c!==null&&(c.childLanes&r)!==r&&(c.childLanes|=r),n===a)break;n=n.return}}function Xg(n,r,a,c){var p=n.child;for(p!==null&&(p.return=n);p!==null;){var y=p.dependencies;if(y!==null){var T=p.child;y=y.firstContext;e:for(;y!==null;){var P=y;y=p;for(var Z=0;Z<r.length;Z++)if(P.context===r[Z]){y.lanes|=a,P=y.alternate,P!==null&&(P.lanes|=a),Kd(y.return,a,n),c||(T=null);break e}y=P.next}}else if(p.tag===18){if(T=p.return,T===null)throw Error(i(341));T.lanes|=a,y=T.alternate,y!==null&&(y.lanes|=a),Kd(T,a,n),T=null}else p.tag===13&&p.memoizedState!==null&&p.memoizedState.dehydrated===null?(p.lanes|=a,T=p.alternate,T!==null&&(T.lanes|=a),Kd(p.return,a,n),T=p.child,T=T!==null?T.sibling:null):T=p.child;if(T!==null)T.return=p;else for(T=p;T!==null;){if(T===n){T=null;break}if(p=T.sibling,p!==null){p.return=T.return,T=p;break}T=T.return}p=T}}function co(n,r,a,c){n=null;for(var p=r,y=!1;p!==null;){if(!y){if((p.flags&524288)!==0)y=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var T=p.alternate;if(T===null)throw Error(i(387));if(T=T.memoizedProps,T!==null){var P=p.type;ls(p.pendingProps.value,T.value)||(n!==null?n.push(P):n=[P])}}else if(p===He.current){if(T=p.alternate,T===null)throw Error(i(387));T.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(n!==null?n.push(Al):n=[Al])}p=p.return}return n!==null&&Xg(r,n,a,c),r.flags|=262144,n!==null}function qd(n){for(n=n.firstContext;n!==null;){if(!ls(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function uo(n){lo=n,Pi=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function vr(n){return Yx(lo,n)}function Yd(n,r){return lo===null&&uo(n),Yx(n,r)}function Yx(n,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},Pi===null){if(n===null)throw Error(i(308));Pi=r,n.dependencies={lanes:0,firstContext:r},n.flags|=524288}else Pi=Pi.next=r;return a}var DN=typeof AbortController<"u"?AbortController:function(){var n=[],r=this.signal={aborted:!1,addEventListener:function(a,c){n.push(c)}};this.abort=function(){r.aborted=!0,n.forEach(function(a){return a()})}},jN=e.unstable_scheduleCallback,IN=e.unstable_NormalPriority,Qn={$$typeof:U,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Zg(){return{controller:new DN,data:new Map,refCount:0}}function jc(n){n.refCount--,n.refCount===0&&jN(IN,function(){n.controller.abort()})}function Gx(n,r){if((n.pendingLanes&4194048)!==0){var a=n.transitionTypes;for(a===null&&(a=n.transitionTypes=[]),n=0;n<r.length;n++){var c=r[n];a.indexOf(c)===-1&&a.push(c)}}}var Ic=null;function PN(n){var r=n.transitionTypes;return n.transitionTypes=null,r}var Pc=null,Jg=0,fo=0,il=null;function LN(n,r){if(Pc===null){var a=Pc=[];Jg=0,fo=p0(),il={status:"pending",value:void 0,then:function(c){a.push(c)}}}return Jg++,r.then($x,$x),r}function $x(){if(--Jg===0&&(Ic=null,Pc!==null)){il!==null&&(il.status="fulfilled");var n=Pc;Pc=null,fo=0,il=null;for(var r=0;r<n.length;r++)(0,n[r])()}}function zN(n,r){var a=[],c={status:"pending",value:null,reason:null,then:function(p){a.push(p)}};return n.then(function(){c.status="fulfilled",c.value=r;for(var p=0;p<a.length;p++)(0,a[p])(r)},function(p){for(c.status="rejected",c.reason=p,p=0;p<a.length;p++)(0,a[p])(void 0)}),c}var Qx=ge.S;ge.S=function(n,r){if(F1=wt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&LN(n,r),Ic!==null)for(var a=El;a!==null;)Gx(a,Ic),a=a.next;if(a=n.types,a!==null){for(var c=El;c!==null;)Gx(c,a),c=c.next;if(fo!==0){c=Ic,c===null&&(c=Ic=[]);for(var p=0;p<a.length;p++){var y=a[p];c.indexOf(y)===-1&&c.push(y)}}}Qx!==null&&Qx(n,r)};var ho=Oe(null);function Wg(){var n=ho.current;return n!==null?n:kn.pooledCache}function Gd(n,r){r===null?Ve(ho,ho.current):Ve(ho,r.pool)}function Xx(){var n=Wg();return n===null?null:{parent:Qn._currentValue,pool:n}}var al=Error(i(460)),em=Error(i(474)),$d=Error(i(542)),Qd={then:function(){}};function Zx(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Jx(n,r,a){switch(a=n[a],a===void 0?n.push(r):a!==r&&(r.then(Pr,Pr),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,e2(n),n===void 0&&!("reason"in r)?Error(i(600)):n;default:if(typeof r.status=="string")r.then(Pr,Pr);else{if(n=kn,n!==null&&100<n.shellSuspendCounter)throw Error(i(482));n=r,n.status="pending",n.then(function(c){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=c}},function(c){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=c}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,e2(n),n}throw go=r,al}}function po(n){try{var r=n._init;return r(n._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(go=a,al):a}}var go=null;function Wx(){if(go===null)throw Error(i(459));var n=go;return go=null,n}function e2(n){if(n===al||n===$d)throw Error(i(483))}var ol=null,Lc=0;function Xd(n){var r=Lc;return Lc+=1,ol===null&&(ol=[]),Jx(ol,n,r)}function ha(n,r){r=r.props.ref,n.ref=r!==void 0?r:null}function Zd(n,r){throw r.$$typeof===M?Error(i(525)):(n=Object.prototype.toString.call(r),Error(i(31,n==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":n)))}function t2(n){function r(ie,te){if(n){var ce=ie.deletions;ce===null?(ie.deletions=[te],ie.flags|=16):ce.push(te)}}function a(ie,te){if(!n)return null;for(;te!==null;)r(ie,te),te=te.sibling;return null}function c(ie){for(var te=new Map;ie!==null;)ie.key===null?te.set(ie.index,ie):te.set(ie.key,ie),ie=ie.sibling;return te}function p(ie,te){return ie=ji(ie,te),ie.index=0,ie.sibling=null,ie}function y(ie,te,ce){return ie.index=ce,n?(ce=ie.alternate,ce!==null?(ce=ce.index,ce<te?(ie.flags|=2,te):ce):(ie.flags|=134217730,te)):(ie.flags|=1048576,te)}function T(ie){return n&&ie.alternate===null&&(ie.flags|=134217730),ie}function P(ie,te,ce,Re){return te===null||te.tag!==6?(te=Kg(ce,ie.mode,Re),te.return=ie,te):(te=p(te,ce),te.return=ie,te)}function Z(ie,te,ce,Re){var Je=ce.type;return Je===q?(ie=pe(ie,te,ce.props.children,Re,ce.key),ha(ie,ce),ie):te!==null&&(te.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===Y&&po(Je)===te.type)?(te=p(te,ce.props),ha(te,ce),te.return=ie,te):(te=Hd(ce.type,ce.key,ce.props,null,ie.mode,Re),ha(te,ce),te.return=ie,te)}function ae(ie,te,ce,Re){return te===null||te.tag!==4||te.stateNode.containerInfo!==ce.containerInfo||te.stateNode.implementation!==ce.implementation?(te=qg(ce,ie.mode,Re),te.return=ie,te):(te=p(te,ce.children||[]),te.return=ie,te)}function pe(ie,te,ce,Re,Je){return te===null||te.tag!==7?(te=ao(ce,ie.mode,Re,Je),te.return=ie,te):(te=p(te,ce),te.return=ie,te)}function Ce(ie,te,ce){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Kg(""+te,ie.mode,ce),te.return=ie,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case _:return ce=Hd(te.type,te.key,te.props,null,ie.mode,ce),ha(ce,te),ce.return=ie,ce;case L:return te=qg(te,ie.mode,ce),te.return=ie,te;case Y:return te=po(te),Ce(ie,te,ce)}if(me(te)||re(te))return te=ao(te,ie.mode,ce,null),te.return=ie,te;if(typeof te.then=="function")return Ce(ie,Xd(te),ce);if(te.$$typeof===U)return Ce(ie,Yd(ie,te),ce);Zd(ie,te)}return null}function se(ie,te,ce,Re){var Je=te!==null?te.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Je!==null?null:P(ie,te,""+ce,Re);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case _:return ce.key===Je?Z(ie,te,ce,Re):null;case L:return ce.key===Je?ae(ie,te,ce,Re):null;case Y:return ce=po(ce),se(ie,te,ce,Re)}if(me(ce)||re(ce))return Je!==null?null:pe(ie,te,ce,Re,null);if(typeof ce.then=="function")return se(ie,te,Xd(ce),Re);if(ce.$$typeof===U)return se(ie,te,Yd(ie,ce),Re);Zd(ie,ce)}return null}function fe(ie,te,ce,Re,Je){if(typeof Re=="string"&&Re!==""||typeof Re=="number"||typeof Re=="bigint")return ie=ie.get(ce)||null,P(te,ie,""+Re,Je);if(typeof Re=="object"&&Re!==null){switch(Re.$$typeof){case _:return ie=ie.get(Re.key===null?ce:Re.key)||null,Z(te,ie,Re,Je);case L:return ie=ie.get(Re.key===null?ce:Re.key)||null,ae(te,ie,Re,Je);case Y:return Re=po(Re),fe(ie,te,ce,Re,Je)}if(me(Re)||re(Re))return ie=ie.get(ce)||null,pe(te,ie,Re,Je,null);if(typeof Re.then=="function")return fe(ie,te,ce,Xd(Re),Je);if(Re.$$typeof===U)return fe(ie,te,ce,Yd(te,Re),Je);Zd(te,Re)}return null}function Ye(ie,te,ce,Re){for(var Je=null,Wt=null,ct=te,St=te=0,Jn=null;ct!==null&&St<ce.length;St++){ct.index>St?(Jn=ct,ct=null):Jn=ct.sibling;var sn=se(ie,ct,ce[St],Re);if(sn===null){ct===null&&(ct=Jn);break}n&&ct&&sn.alternate===null&&r(ie,ct),te=y(sn,te,St),Wt===null?Je=sn:Wt.sibling=sn,Wt=sn,ct=Jn}if(St===ce.length)return a(ie,ct),Vt&&Ii(ie,St),Je;if(ct===null){for(;St<ce.length;St++)ct=Ce(ie,ce[St],Re),ct!==null&&(te=y(ct,te,St),Wt===null?Je=ct:Wt.sibling=ct,Wt=ct);return Vt&&Ii(ie,St),Je}for(ct=c(ct);St<ce.length;St++)Jn=fe(ct,ie,St,ce[St],Re),Jn!==null&&(n&&(sn=Jn.alternate,sn!==null&&ct.delete(sn.key===null?St:sn.key)),te=y(Jn,te,St),Wt===null?Je=Jn:Wt.sibling=Jn,Wt=Jn);return n&&ct.forEach(function(Da){return r(ie,Da)}),Vt&&Ii(ie,St),Je}function st(ie,te,ce,Re){if(ce==null)throw Error(i(151));for(var Je=null,Wt=null,ct=te,St=te=0,Jn=null,sn=ce.next();ct!==null&&!sn.done;St++,sn=ce.next()){ct.index>St?(Jn=ct,ct=null):Jn=ct.sibling;var Da=se(ie,ct,sn.value,Re);if(Da===null){ct===null&&(ct=Jn);break}n&&ct&&Da.alternate===null&&r(ie,ct),te=y(Da,te,St),Wt===null?Je=Da:Wt.sibling=Da,Wt=Da,ct=Jn}if(sn.done)return a(ie,ct),Vt&&Ii(ie,St),Je;if(ct===null){for(;!sn.done;St++,sn=ce.next())sn=Ce(ie,sn.value,Re),sn!==null&&(te=y(sn,te,St),Wt===null?Je=sn:Wt.sibling=sn,Wt=sn);return Vt&&Ii(ie,St),Je}for(ct=c(ct);!sn.done;St++,sn=ce.next())sn=fe(ct,ie,St,sn.value,Re),sn!==null&&(n&&(Jn=sn.alternate,Jn!==null&&ct.delete(Jn.key===null?St:Jn.key)),te=y(sn,te,St),Wt===null?Je=sn:Wt.sibling=sn,Wt=sn);return n&&ct.forEach(function(yj){return r(ie,yj)}),Vt&&Ii(ie,St),Je}function Pt(ie,te,ce,Re){if(typeof ce=="object"&&ce!==null&&ce.type===q&&ce.key===null&&ce.props.ref===void 0&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case _:e:{for(var Je=ce.key;te!==null;){if(te.key===Je){if(Je=ce.type,Je===q){if(te.tag===7){a(ie,te.sibling),Re=p(te,ce.props.children),ha(Re,ce),Re.return=ie,ie=Re;break e}}else if(te.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===Y&&po(Je)===te.type){a(ie,te.sibling),Re=p(te,ce.props),ha(Re,ce),Re.return=ie,ie=Re;break e}a(ie,te);break}else r(ie,te);te=te.sibling}ce.type===q?(Re=ao(ce.props.children,ie.mode,Re,ce.key),ha(Re,ce),Re.return=ie,ie=Re):(Re=Hd(ce.type,ce.key,ce.props,null,ie.mode,Re),ha(Re,ce),Re.return=ie,ie=Re)}return T(ie);case L:e:{for(Je=ce.key;te!==null;){if(te.key===Je)if(te.tag===4&&te.stateNode.containerInfo===ce.containerInfo&&te.stateNode.implementation===ce.implementation){a(ie,te.sibling),Re=p(te,ce.children||[]),Re.return=ie,ie=Re;break e}else{a(ie,te);break}else r(ie,te);te=te.sibling}Re=qg(ce,ie.mode,Re),Re.return=ie,ie=Re}return T(ie);case Y:return ce=po(ce),Pt(ie,te,ce,Re)}if(me(ce))return Ye(ie,te,ce,Re);if(re(ce)){if(Je=re(ce),typeof Je!="function")throw Error(i(150));return ce=Je.call(ce),st(ie,te,ce,Re)}if(typeof ce.then=="function")return Pt(ie,te,Xd(ce),Re);if(ce.$$typeof===U)return Pt(ie,te,Yd(ie,ce),Re);Zd(ie,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,te!==null&&te.tag===6?(a(ie,te.sibling),Re=p(te,ce),Re.return=ie,ie=Re):(a(ie,te),Re=Kg(ce,ie.mode,Re),Re.return=ie,ie=Re),T(ie)):a(ie,te)}return function(ie,te,ce,Re){try{Lc=0;var Je=Pt(ie,te,ce,Re);return ol=null,Je}catch(ct){if(ct===al||ct===$d)throw ct;var Wt=Yr(29,ct,null,ie.mode);return Wt.lanes=Re,Wt.return=ie,Wt}}}var mo=t2(!0),n2=t2(!1),pa=!1;function tm(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function nm(n,r){n=n.updateQueue,r.updateQueue===n&&(r.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function ga(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function ma(n,r,a){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(cn&2)!==0){var p=c.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),c.pending=r,r=Ud(n),Ux(n,null,a),r}return _d(n,c,r,a),Ud(n)}function zc(n,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194048)!==0)){var c=r.lanes;c&=n.pendingLanes,a|=c,r.lanes=a,On(n,a)}}function rm(n,r){var a=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,a===c)){var p=null,y=null;if(a=a.firstBaseUpdate,a!==null){do{var T={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};y===null?p=y=T:y=y.next=T,a=a.next}while(a!==null);y===null?p=y=r:y=y.next=r}else p=y=r;a={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:c.shared,callbacks:c.callbacks},n.updateQueue=a;return}n=a.lastBaseUpdate,n===null?a.firstBaseUpdate=r:n.next=r,a.lastBaseUpdate=r}var sm=!1;function _c(){if(sm){var n=il;if(n!==null)throw n}}function Uc(n,r,a,c){sm=!1;var p=n.updateQueue;pa=!1;var y=p.firstBaseUpdate,T=p.lastBaseUpdate,P=p.shared.pending;if(P!==null){p.shared.pending=null;var Z=P,ae=Z.next;Z.next=null,T===null?y=ae:T.next=ae,T=Z;var pe=n.alternate;pe!==null&&(pe=pe.updateQueue,P=pe.lastBaseUpdate,P!==T&&(P===null?pe.firstBaseUpdate=ae:P.next=ae,pe.lastBaseUpdate=Z))}if(y!==null){var Ce=p.baseState;T=0,pe=ae=Z=null,P=y;do{var se=P.lane&-536870913,fe=se!==P.lane;if(fe?(Jt&se)===se:(c&se)===se){se!==0&&se===fo&&(sm=!0),pe!==null&&(pe=pe.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Ye=n,st=P;se=r;var Pt=a;switch(st.tag){case 1:if(Ye=st.payload,typeof Ye=="function"){Ce=Ye.call(Pt,Ce,se);break e}Ce=Ye;break e;case 3:Ye.flags=Ye.flags&-65537|128;case 0:if(Ye=st.payload,se=typeof Ye=="function"?Ye.call(Pt,Ce,se):Ye,se==null)break e;Ce=D({},Ce,se);break e;case 2:pa=!0}}se=P.callback,se!==null&&(n.flags|=64,fe&&(n.flags|=8192),fe=p.callbacks,fe===null?p.callbacks=[se]:fe.push(se))}else fe={lane:se,tag:P.tag,payload:P.payload,callback:P.callback,next:null},pe===null?(ae=pe=fe,Z=Ce):pe=pe.next=fe,T|=se;if(P=P.next,P===null){if(P=p.shared.pending,P===null)break;fe=P,P=fe.next,fe.next=null,p.lastBaseUpdate=fe,p.shared.pending=null}}while(!0);pe===null&&(Z=Ce),p.baseState=Z,p.firstBaseUpdate=ae,p.lastBaseUpdate=pe,y===null&&(p.shared.lanes=0),Ea|=T,n.lanes=T,n.memoizedState=Ce}}function r2(n,r){if(typeof n!="function")throw Error(i(191,n));n.call(r)}function s2(n,r){var a=n.callbacks;if(a!==null)for(n.callbacks=null,n=0;n<a.length;n++)r2(a[n],r)}var ya=Oe(null),Jd=Oe(0);function i2(n,r){n=Fi,Ve(Jd,n),Ve(ya,r),Fi=n|r.baseLanes}function im(){Ve(Jd,Fi),Ve(ya,ya.current)}function am(){Fi=Jd.current,Le(ya),Le(Jd)}var br=Oe(null),Tr=null;function va(n){var r=n.alternate;Ve(xr,xr.current&1),Ve(br,n),Tr===null&&(r===null||ya.current!==null||r.memoizedState!==null)&&(Tr=n)}function om(n){Ve(xr,xr.current),Ve(br,n),Tr===null&&(Tr=n)}function a2(n){n.tag===22?(Ve(xr,xr.current),Ve(br,n),Tr===null&&(Tr=n)):ba()}function ba(){Ve(xr,xr.current),Ve(br,br.current)}function cs(n){Le(br),Tr===n&&(Tr=null),Le(xr)}var xr=Oe(0);function Hc(n,r){Ve(br,br.current),Ve(xr,r)}function lm(n){Le(xr),Le(br),Tr===n&&(Tr=null)}function Wd(n){for(var r=n;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||M0(a)||N0(a)))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!=="independent"){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var zi=0,It=null,Sn=null,Xn=null,ef=!1,ll=!1,yo=!1,tf=0,Fc=0,cl=null,_N=0;function Bn(){throw Error(i(321))}function cm(n,r){if(r===null)return!1;for(var a=0;a<r.length&&a<n.length;a++)if(!ls(n[a],r[a]))return!1;return!0}function um(n,r,a,c,p,y){return zi=y,It=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,ge.H=n===null||n.memoizedState===null?V2:K2,yo=!1,y=a(c,p),yo=!1,ll&&(y=l2(r,a,c,p)),o2(n),y}function o2(n){ge.H=cf;var r=Sn!==null&&Sn.next!==null;if(zi=0,Xn=Sn=It=null,ef=!1,Fc=0,cl=null,r)throw Error(i(300));n===null||Zn||(n=n.dependencies,n!==null&&qd(n)&&(Zn=!0))}function l2(n,r,a,c){It=n;var p=0;do{if(ll&&(cl=null),Fc=0,ll=!1,25<=p)throw Error(i(301));if(p+=1,Xn=Sn=null,n.updateQueue!=null){var y=n.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}ge.H=YN,y=r(a,c)}while(ll);return y}function UN(){var n=ge.H,r=n.useState()[0];return r=typeof r.then=="function"?Bc(r):r,n=n.useState()[0],(Sn!==null?Sn.memoizedState:null)!==n&&(It.flags|=1024),r}function dm(){var n=tf!==0;return tf=0,n}function fm(n,r,a){r.updateQueue=n.updateQueue,r.flags&=-2053,n.lanes&=~a}function hm(n){if(ef){for(n=n.memoizedState;n!==null;){var r=n.queue;r!==null&&(r.pending=null),n=n.next}ef=!1}zi=0,Xn=Sn=It=null,ll=!1,Fc=tf=0,cl=null}function zr(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xn===null?It.memoizedState=Xn=n:Xn=Xn.next=n,Xn}function Yn(){if(Sn===null){var n=It.alternate;n=n!==null?n.memoizedState:null}else n=Sn.next;var r=Xn===null?It.memoizedState:Xn.next;if(r!==null)Xn=r,Sn=n;else{if(n===null)throw It.alternate===null?Error(i(467)):Error(i(310));Sn=n,n={memoizedState:Sn.memoizedState,baseState:Sn.baseState,baseQueue:Sn.baseQueue,queue:Sn.queue,next:null},Xn===null?It.memoizedState=Xn=n:Xn=Xn.next=n}return Xn}function nf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bc(n){var r=Fc;return Fc+=1,cl===null&&(cl=[]),n=Jx(cl,n,r),r=It,(Xn===null?r.memoizedState:Xn.next)===null&&(r=r.alternate,ge.H=r===null||r.memoizedState===null?V2:K2),n}function rf(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Bc(n);if(n.$$typeof===V)return;if(n.$$typeof===U)return vr(n)}throw Error(i(438,String(n)))}function pm(n){var r=null,a=It.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var c=It.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(r={data:c.data.map(function(p){return p.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),a===null&&(a=nf(),It.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(n),c=0;c<n;c++)a[c]=oe;return r.index++,a}function _i(n,r){return typeof r=="function"?r(n):r}function sf(n){var r=Yn();return gm(r,Sn,n)}function gm(n,r,a){var c=n.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=a;var p=n.baseQueue,y=c.pending;if(y!==null){if(p!==null){var T=p.next;p.next=y.next,y.next=T}r.baseQueue=p=y,c.pending=null}if(y=n.baseState,p===null)n.memoizedState=y;else{r=p.next;var P=T=null,Z=null,ae=r,pe=!1;do{var Ce=ae.lane&-536870913;if(Ce!==ae.lane?(Jt&Ce)===Ce:(zi&Ce)===Ce){var se=ae.revertLane;if(se===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),Ce===fo&&(pe=!0);else if((zi&se)===se){ae=ae.next,se===fo&&(pe=!0);continue}else Ce={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},Z===null?(P=Z=Ce,T=y):Z=Z.next=Ce,It.lanes|=se,Ea|=se;Ce=ae.action,yo&&a(y,Ce),y=ae.hasEagerState?ae.eagerState:a(y,Ce)}else se={lane:Ce,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},Z===null?(P=Z=se,T=y):Z=Z.next=se,It.lanes|=Ce,Ea|=Ce;ae=ae.next}while(ae!==null&&ae!==r);if(Z===null?T=y:Z.next=P,!ls(y,n.memoizedState)&&(Zn=!0,pe&&(a=il,a!==null)))throw a;n.memoizedState=y,n.baseState=T,n.baseQueue=Z,c.lastRenderedState=y}return p===null&&(c.lanes=0),[n.memoizedState,c.dispatch]}function mm(n){var r=Yn(),a=r.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=n;var c=a.dispatch,p=a.pending,y=r.memoizedState;if(p!==null){a.pending=null;var T=p=p.next;do y=n(y,T.action),T=T.next;while(T!==p);ls(y,r.memoizedState)||(Zn=!0),r.memoizedState=y,r.baseQueue===null&&(r.baseState=y),a.lastRenderedState=y}return[y,c]}function c2(n,r,a){var c=It,p=Yn(),y=Vt;if(y){if(a===void 0)throw Error(i(407));a=a()}else a=r();var T=!ls((Sn||p).memoizedState,a);if(T&&(p.memoizedState=a,Zn=!0),p=p.queue,bm(f2.bind(null,c,p,n),[n]),n=p.getSnapshot!==r||T||Xn!==null&&(Xn.memoizedState.tag&1)!==0,ul(n?9:8,{destroy:void 0},d2.bind(null,c,p,a,r),null),n){if(c.flags|=2048,kn===null)throw Error(i(349));y||(zi&127)!==0||u2(c,r,a)}return a}function u2(n,r,a){n.flags|=16384,n={getSnapshot:r,value:a},r=It.updateQueue,r===null?(r=nf(),It.updateQueue=r,r.stores=[n]):(a=r.stores,a===null?r.stores=[n]:a.push(n))}function d2(n,r,a,c){r.value=a,r.getSnapshot=c,h2(r)&&p2(n)}function f2(n,r,a){return a(function(){h2(r)&&p2(n)})}function h2(n){var r=n.getSnapshot;n=n.value;try{var a=r();return!ls(n,a)}catch{return!0}}function p2(n){var r=io(n,2);r!==null&&Xr(r,n,2)}function ym(n){var r=zr();if(typeof n=="function"){var a=n;if(n=a(),yo){$e(!0);try{a()}finally{$e(!1)}}}return r.memoizedState=r.baseState=n,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_i,lastRenderedState:n},r}function g2(n,r,a,c){return n.baseState=a,gm(n,Sn,typeof c=="function"?c:_i)}function HN(n,r,a,c,p){if(lf(n))throw Error(i(485));if(n=r.action,n!==null){var y={payload:p,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){y.listeners.push(T)}};ge.T!==null?a(!0):y.isTransition=!1,c(y),a=r.pending,a===null?(y.next=r.pending=y,m2(r,y)):(y.next=a.next,r.pending=a.next=y)}}function m2(n,r){var a=r.action,c=r.payload,p=n.state;if(r.isTransition){var y=ge.T,T={};T.types=y!==null?y.types:null,ge.T=T;try{var P=a(p,c),Z=ge.S;Z!==null&&Z(T,P),y2(n,r,P)}catch(ae){vm(n,r,ae)}finally{y!==null&&T.types!==null&&(y.types=T.types),ge.T=y}}else try{y=a(p,c),y2(n,r,y)}catch(ae){vm(n,r,ae)}}function y2(n,r,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(c){v2(n,r,c)},function(c){return vm(n,r,c)}):v2(n,r,a)}function v2(n,r,a){r.status="fulfilled",r.value=a,b2(r),n.state=a,r=n.pending,r!==null&&(a=r.next,a===r?n.pending=null:(a=a.next,r.next=a,m2(n,a)))}function vm(n,r,a){var c=n.pending;if(n.pending=null,c!==null){c=c.next;do r.status="rejected",r.reason=a,b2(r),r=r.next;while(r!==c)}n.action=null}function b2(n){n=n.listeners;for(var r=0;r<n.length;r++)(0,n[r])()}function x2(n,r){return r}function S2(n,r){if(Vt){var a=kn.formState;if(a!==null){e:{var c=It;if(Vt){if(Mn){t:{for(var p=Mn,y=Ts;p.nodeType!==8;){if(!y){p=null;break t}if(p=Os(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){Mn=Os(p.nextSibling),c=p.data==="F!";break e}}da(c)}c=!1}c&&(r=a[0])}}return a=zr(),a.memoizedState=a.baseState=r,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:x2,lastRenderedState:r},a.queue=c,a=H2.bind(null,It,c),c.dispatch=a,c=ym(!1),y=Rm.bind(null,It,!1,c.queue),c=zr(),p={state:r,dispatch:null,action:n,pending:null},c.queue=p,a=HN.bind(null,It,p,y,a),p.dispatch=a,c.memoizedState=n,[r,a,!1]}function w2(n){var r=Yn();return E2(r,Sn,n)}function E2(n,r,a){if(r=gm(n,r,x2)[0],n=sf(_i)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var c=Bc(r)}catch(T){throw T===al?$d:T}else c=r;r=Yn();var p=r.queue,y=p.dispatch;return a!==r.memoizedState&&(It.flags|=2048,ul(9,{destroy:void 0},FN.bind(null,p,a),null)),[c,y,n]}function FN(n,r){n.action=r}function R2(n){var r=Yn(),a=Sn;if(a!==null)return E2(r,a,n);Yn(),r=r.memoizedState,a=Yn();var c=a.queue.dispatch;return a.memoizedState=n,[r,c,!1]}function ul(n,r,a,c){return n={tag:n,create:a,deps:c,inst:r,next:null},r=It.updateQueue,r===null&&(r=nf(),It.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=n.next=n:(c=a.next,a.next=n,n.next=c,r.lastEffect=n),n}function C2(){return Yn().memoizedState}function af(n,r,a,c){var p=zr();It.flags|=n,p.memoizedState=ul(1|r,{destroy:void 0},a,c===void 0?null:c)}function of(n,r,a,c){var p=Yn();c=c===void 0?null:c;var y=p.memoizedState.inst;Sn!==null&&c!==null&&cm(c,Sn.memoizedState.deps)?p.memoizedState=ul(r,y,a,c):(It.flags|=n,p.memoizedState=ul(1|r,y,a,c))}function T2(n,r){af(8390656,8,n,r)}function bm(n,r){of(2048,8,n,r)}function BN(n){It.flags|=4;var r=It.updateQueue;if(r===null)r=nf(),It.updateQueue=r,r.events=[n];else{var a=r.events;a===null?r.events=[n]:a.push(n)}}function k2(n){var r=Yn().memoizedState;return BN({ref:r,nextImpl:n}),function(){if((cn&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}function O2(n,r){return of(4,2,n,r)}function A2(n,r){return of(4,4,n,r)}function M2(n,r){if(typeof r=="function"){n=n();var a=r(n);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return n=n(),r.current=n,function(){r.current=null}}function N2(n,r,a){a=a!=null?a.concat([n]):null,of(4,4,M2.bind(null,r,n),a)}function xm(){}function D2(n,r){var a=Yn();r=r===void 0?null:r;var c=a.memoizedState;return r!==null&&cm(r,c[1])?c[0]:(a.memoizedState=[n,r],n)}function j2(n,r){var a=Yn();r=r===void 0?null:r;var c=a.memoizedState;if(r!==null&&cm(r,c[1]))return c[0];if(c=n(),yo){$e(!0);try{n()}finally{$e(!1)}}return a.memoizedState=[c,r],c}function Sm(n,r,a){return a===void 0||(zi&1073741824)!==0&&(Jt&261930)===0?n.memoizedState=r:(n.memoizedState=a,n=V1(),It.lanes|=n,Ea|=n,a)}function I2(n,r,a,c){return ls(a,r)?a:ya.current!==null?(n=Sm(n,a,c),ls(n,r)||(Zn=!0),n):(zi&106)===0||(zi&1073741824)!==0&&(Jt&261930)===0?(Zn=!0,n.memoizedState=a):(n=V1(),It.lanes|=n,Ea|=n,r)}function P2(n,r,a,c,p){var y=ue.p;ue.p=y!==0&&8>y?y:8;var T=ge.T,P={};P.types=T!==null?T.types:null,ge.T=P,Rm(n,!1,r,a);try{var Z=p(),ae=ge.S;if(ae!==null&&ae(P,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var pe=zN(Z,c);Vc(n,r,pe,hs(n))}else Vc(n,r,c,hs(n))}catch(Ce){Vc(n,r,{then:function(){},status:"rejected",reason:Ce},hs())}finally{ue.p=y,T!==null&&P.types!==null&&(T.types=P.types),ge.T=T}}function VN(){}function wm(n,r,a,c){if(n.tag!==5)throw Error(i(476));var p=L2(n).queue;P2(n,p,r,Te,a===null?VN:function(){return z2(n),a(c)})}function L2(n){var r=n.memoizedState;if(r!==null)return r;r={memoizedState:Te,baseState:Te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_i,lastRenderedState:Te},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_i,lastRenderedState:a},next:null},n.memoizedState=r,n=n.alternate,n!==null&&(n.memoizedState=r),r}function z2(n){var r=L2(n);r.next===null&&(r=n.alternate.memoizedState),Vc(n,r.next.queue,{},hs())}function Em(){return vr(Al)}function _2(){return Yn().memoizedState}function U2(){return Yn().memoizedState}function KN(n){for(var r=n.return;r!==null;){switch(r.tag){case 24:case 3:var a=hs();n=ga(a);var c=ma(r,n,a);c!==null&&(Xr(c,r,a),zc(c,r,a)),r={cache:Zg()},n.payload=r;return}r=r.return}}function qN(n,r,a){var c=hs();a={lane:c,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},lf(n)?F2(r,a):(a=Bg(n,r,a,c),a!==null&&(Xr(a,n,c),B2(a,r,c)))}function H2(n,r,a){var c=hs();Vc(n,r,a,c)}function Vc(n,r,a,c){var p={lane:c,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(lf(n))F2(r,p);else{var y=n.alternate;if(n.lanes===0&&(y===null||y.lanes===0)&&(y=r.lastRenderedReducer,y!==null))try{var T=r.lastRenderedState,P=y(T,a);if(p.hasEagerState=!0,p.eagerState=P,ls(P,T))return _d(n,r,p,0),kn===null&&zd(),!1}catch{}if(a=Bg(n,r,p,c),a!==null)return Xr(a,n,c),B2(a,r,c),!0}return!1}function Rm(n,r,a,c){if(c={lane:2,revertLane:p0(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},lf(n)){if(r)throw Error(i(479))}else r=Bg(n,a,c,2),r!==null&&Xr(r,n,2)}function lf(n){var r=n.alternate;return n===It||r!==null&&r===It}function F2(n,r){ll=ef=!0;var a=n.pending;a===null?r.next=r:(r.next=a.next,a.next=r),n.pending=r}function B2(n,r,a){if((a&4194048)!==0){var c=r.lanes;c&=n.pendingLanes,a|=c,r.lanes=a,On(n,a)}}var cf={readContext:vr,use:rf,useCallback:Bn,useContext:Bn,useEffect:Bn,useImperativeHandle:Bn,useLayoutEffect:Bn,useInsertionEffect:Bn,useMemo:Bn,useReducer:Bn,useRef:Bn,useState:Bn,useDebugValue:Bn,useDeferredValue:Bn,useTransition:Bn,useSyncExternalStore:Bn,useId:Bn,useHostTransitionStatus:Bn,useFormState:Bn,useActionState:Bn,useOptimistic:Bn,useMemoCache:Bn,useCacheRefresh:Bn,useEffectEvent:Bn},V2={readContext:vr,use:rf,useCallback:function(n,r){return zr().memoizedState=[n,r===void 0?null:r],n},useContext:vr,useEffect:T2,useImperativeHandle:function(n,r,a){a=a!=null?a.concat([n]):null,af(4194308,4,M2.bind(null,r,n),a)},useLayoutEffect:function(n,r){return af(4194308,4,n,r)},useInsertionEffect:function(n,r){af(4,2,n,r)},useMemo:function(n,r){var a=zr();r=r===void 0?null:r;var c=n();if(yo){$e(!0);try{n()}finally{$e(!1)}}return a.memoizedState=[c,r],c},useReducer:function(n,r,a){var c=zr();if(a!==void 0){var p=a(r);if(yo){$e(!0);try{a(r)}finally{$e(!1)}}}else p=r;return c.memoizedState=c.baseState=p,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:p},c.queue=n,n=n.dispatch=qN.bind(null,It,n),[c.memoizedState,n]},useRef:function(n){var r=zr();return n={current:n},r.memoizedState=n},useState:function(n){n=ym(n);var r=n.queue,a=H2.bind(null,It,r);return r.dispatch=a,[n.memoizedState,a]},useDebugValue:xm,useDeferredValue:function(n,r){var a=zr();return Sm(a,n,r)},useTransition:function(){var n=ym(!1);return n=P2.bind(null,It,n.queue,!0,!1),zr().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,r,a){var c=It,p=zr();if(Vt){if(a===void 0)throw Error(i(407));a=a()}else{if(a=r(),kn===null)throw Error(i(349));(Jt&127)!==0||u2(c,r,a)}p.memoizedState=a;var y={value:a,getSnapshot:r};return p.queue=y,T2(f2.bind(null,c,y,n),[n]),c.flags|=2048,ul(9,{destroy:void 0},d2.bind(null,c,y,a,r),null),a},useId:function(){var n=zr(),r=kn.identifierPrefix;if(Vt){var a=ni,c=ti;a=(c&~(1<<32-et(c)-1)).toString(32)+a,r="_"+r+"R_"+a,a=tf++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=_N++,r="_"+r+"r_"+a.toString(32)+"_";return n.memoizedState=r},useHostTransitionStatus:Em,useFormState:S2,useActionState:S2,useOptimistic:function(n){var r=zr();r.memoizedState=r.baseState=n;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=Rm.bind(null,It,!0,a),a.dispatch=r,[n,r]},useMemoCache:pm,useCacheRefresh:function(){return zr().memoizedState=KN.bind(null,It)},useEffectEvent:function(n){var r=zr(),a={impl:n};return r.memoizedState=a,function(){if((cn&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},K2={readContext:vr,use:rf,useCallback:D2,useContext:vr,useEffect:bm,useImperativeHandle:N2,useInsertionEffect:O2,useLayoutEffect:A2,useMemo:j2,useReducer:sf,useRef:C2,useState:function(){return sf(_i)},useDebugValue:xm,useDeferredValue:function(n,r){var a=Yn();return I2(a,Sn.memoizedState,n,r)},useTransition:function(){var n=sf(_i)[0],r=Yn().memoizedState;return[typeof n=="boolean"?n:Bc(n),r]},useSyncExternalStore:c2,useId:_2,useHostTransitionStatus:Em,useFormState:w2,useActionState:w2,useOptimistic:function(n,r){var a=Yn();return g2(a,Sn,n,r)},useMemoCache:pm,useCacheRefresh:U2,useEffectEvent:k2},YN={readContext:vr,use:rf,useCallback:D2,useContext:vr,useEffect:bm,useImperativeHandle:N2,useInsertionEffect:O2,useLayoutEffect:A2,useMemo:j2,useReducer:mm,useRef:C2,useState:function(){return mm(_i)},useDebugValue:xm,useDeferredValue:function(n,r){var a=Yn();return Sn===null?Sm(a,n,r):I2(a,Sn.memoizedState,n,r)},useTransition:function(){var n=mm(_i)[0],r=Yn().memoizedState;return[typeof n=="boolean"?n:Bc(n),r]},useSyncExternalStore:c2,useId:_2,useHostTransitionStatus:Em,useFormState:R2,useActionState:R2,useOptimistic:function(n,r){var a=Yn();return Sn!==null?g2(a,Sn,n,r):(a.baseState=n,[n,a.queue.dispatch])},useMemoCache:pm,useCacheRefresh:U2,useEffectEvent:k2};function Cm(n,r,a,c){r=n.memoizedState,a=a(c,r),a=a==null?r:D({},r,a),n.memoizedState=a,n.lanes===0&&(n.updateQueue.baseState=a)}var Tm={enqueueSetState:function(n,r,a){n=n._reactInternals;var c=hs(),p=ga(c);p.payload=r,a!=null&&(p.callback=a),r=ma(n,p,c),r!==null&&(Xr(r,n,c),zc(r,n,c))},enqueueReplaceState:function(n,r,a){n=n._reactInternals;var c=hs(),p=ga(c);p.tag=1,p.payload=r,a!=null&&(p.callback=a),r=ma(n,p,c),r!==null&&(Xr(r,n,c),zc(r,n,c))},enqueueForceUpdate:function(n,r){n=n._reactInternals;var a=hs(),c=ga(a);c.tag=2,r!=null&&(c.callback=r),r=ma(n,c,a),r!==null&&(Xr(r,n,a),zc(r,n,a))}};function q2(n,r,a,c,p,y,T){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(c,y,T):r.prototype&&r.prototype.isPureReactComponent?!Ac(a,c)||!Ac(p,y):!0}function Y2(n,r,a,c){n=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,c),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,c),r.state!==n&&Tm.enqueueReplaceState(r,r.state,null)}function vo(n,r){var a=r;if("ref"in r){a={};for(var c in r)c!=="ref"&&(a[c]=r[c])}if(n=n.defaultProps){a===r&&(a=D({},a));for(var p in n)a[p]===void 0&&(a[p]=n[p])}return a}function G2(n){Ld(n)}function $2(n){console.error(n)}function Q2(n){Ld(n)}function uf(n,r){try{var a=n.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(c){setTimeout(function(){throw c})}}function X2(n,r,a){try{var c=n.onCaughtError;c(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function km(n,r,a){return a=ga(a),a.tag=3,a.payload={element:null},a.callback=function(){uf(n,r)},a}function Z2(n){return n=ga(n),n.tag=3,n}function J2(n,r,a,c){var p=a.type.getDerivedStateFromError;if(typeof p=="function"){var y=c.value;n.payload=function(){return p(y)},n.callback=function(){X2(r,a,c)}}var T=a.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(n.callback=function(){X2(r,a,c),typeof p!="function"&&(Ra===null?Ra=new Set([this]):Ra.add(this));var P=c.stack;this.componentDidCatch(c.value,{componentStack:P!==null?P:""})})}function GN(n,r,a,c,p){if(a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(r=a.alternate,r!==null&&co(r,a,p,!0),a=br.current,a!==null){switch(a.tag){case 31:case 13:case 19:return Tr===null?Nf():a.alternate===null&&Vn===0&&(Vn=3),a.flags&=-257,a.flags|=65536,a.lanes=p,c===Qd?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([c]):r.add(c),d0(n,c,p)),!1;case 22:return a.flags|=65536,c===Qd?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([c])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([c]):a.add(c)),d0(n,c,p)),!1}throw Error(i(435,a.tag))}return d0(n,c,p),Nf(),!1}if(Vt)return r=br.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=p,c!==Gg&&(n=Error(i(422),{cause:c}),Dc(Es(n,a)))):(c!==Gg&&(r=Error(i(423),{cause:c}),Dc(Es(r,a))),n=n.current.alternate,n.flags|=65536,p&=-p,n.lanes|=p,c=Es(c,a),p=km(n.stateNode,c,p),rm(n,p),Vn!==4&&(Vn=2)),!1;var y=Error(i(520),{cause:c});if(y=Es(y,a),Zc===null?Zc=[y]:Zc.push(y),Vn!==4&&(Vn=2),r===null)return!0;c=Es(c,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,n=p&-p,a.lanes|=n,n=km(a.stateNode,c,n),rm(a,n),!1;case 1:if(r=a.type,y=a.stateNode,(a.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Ra===null||!Ra.has(y))))return a.flags|=65536,p&=-p,a.lanes|=p,p=Z2(p),J2(p,n,a,c),rm(a,p),!1;break;case 22:if(a.memoizedState!==null)return a.flags|=65536,!1}a=a.return}while(a!==null);return!1}var Om=Error(i(461)),Zn=!1;function sr(n,r,a,c){r.child=n===null?n2(r,null,a,c):mo(r,n.child,a,c)}function W2(n,r,a,c,p){a=a.render;var y=r.ref;if("ref"in c){var T={};for(var P in c)P!=="ref"&&(T[P]=c[P])}else T=c;return uo(r),c=um(n,r,a,T,y,p),P=dm(),n!==null&&!Zn?(fm(n,r,p),Ui(n,r,p)):(Vt&&P&&Bd(r),r.flags|=1,sr(n,r,c,p),r.child)}function e1(n,r,a,c,p){if(n===null){var y=a.type;return typeof y=="function"&&!Vg(y)&&y.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=y,t1(n,r,y,c,p)):(n=Hd(a.type,null,c,r,r.mode,p),n.ref=r.ref,n.return=r,r.child=n)}if(y=n.child,!Lm(n,p)){var T=y.memoizedProps;if(a=a.compare,a=a!==null?a:Ac,a(T,c)&&n.ref===r.ref)return Ui(n,r,p)}return r.flags|=1,n=ji(y,c),n.ref=r.ref,n.return=r,r.child=n}function t1(n,r,a,c,p){if(n!==null){var y=n.memoizedProps;if(Ac(y,c)&&n.ref===r.ref)if(Zn=!1,r.pendingProps=c=y,Lm(n,p))(n.flags&131072)!==0&&(Zn=!0);else return r.lanes=n.lanes,Ui(n,r,p)}return Am(n,r,a,c,p)}function n1(n,r,a,c){var p=c.children,y=n!==null?n.memoizedState:null;if(n===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((r.flags&128)!==0){if(y=y!==null?y.baseLanes|a:a,n!==null){for(c=r.child=n.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~y}else c=0,r.child=null;return r1(n,r,y,a,c)}if((a&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},n!==null&&Gd(r,y!==null?y.cachePool:null),y!==null?i2(r,y):im(),a2(r);else return c=r.lanes=536870912,r1(n,r,y!==null?y.baseLanes|a:a,a,c)}else y!==null?(Gd(r,y.cachePool),i2(r,y),ba(),r.memoizedState=null):(n!==null&&Gd(r,null),im(),ba());return sr(n,r,p,a),r.child}function Kc(n,r){return n!==null&&n.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function r1(n,r,a,c,p){var y=Wg();return y=y===null?null:{parent:Qn._currentValue,pool:y},r.memoizedState={baseLanes:a,cachePool:y},n!==null&&Gd(r,null),im(),a2(r),n!==null&&co(n,r,c,!0),r.childLanes=p,null}function df(n,r){return r=ff({mode:r.mode,children:r.children},n.mode),r.ref=n.ref,n.child=r,r.return=n,r}function s1(n,r,a){return mo(r,n.child,null,a),n=df(r,r.pendingProps),n.flags|=2,cs(r),r.memoizedState=null,n}function $N(n,r,a){var c=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,n===null){if(Vt){if(c.mode==="hidden")return n=df(r,c),r.lanes=536870912,n.memoizedState={baseLanes:0,cachePool:null},Kc(null,n);if(om(r),(n=Mn)?(n=MS(n,Ts),n=n!==null&&n.data==="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:ca!==null?{id:ti,overflow:ni}:null,retryLane:536870912,hydrationErrors:null},a=Fx(n),a.return=r,r.child=a,lr=r,Mn=null)):n=null,n===null)throw da(r);return r.lanes=536870912,null}return df(r,c)}var y=n.memoizedState;if(y!==null){var T=y.dehydrated;if(om(r),p)if(r.flags&256)r.flags&=-257,r=s1(n,r,a);else if(r.memoizedState!==null)r.child=n.child,r.flags|=128,r=null;else throw Error(i(558));else if(Zn||co(n,r,a,!1),p=(a&n.childLanes)!==0,Zn||p){if(ya.current===null){if(c=kn,c!==null&&(T=Yt(c,a),T!==0&&T!==y.retryLane))throw y.retryLane=T,io(n,T),Xr(c,n,T),Om;Nf()}r=s1(n,r,a)}else n=y.treeContext,Mn=Os(T.nextSibling),lr=r,Vt=!0,ua=null,Ts=!1,n!==null&&Kx(r,n),r=df(r,c),r.flags|=134221824;return r}return n=ji(n.child,{mode:c.mode,children:c.children}),n.ref=r.ref,r.child=n,n.return=r,n}function dl(n,r){var a=r.ref;if(a===null)n!==null&&n.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(n===null||n.ref!==a)&&(r.flags|=4194816)}}function Am(n,r,a,c,p){return uo(r),a=um(n,r,a,c,void 0,p),c=dm(),n!==null&&!Zn?(fm(n,r,p),Ui(n,r,p)):(Vt&&c&&Bd(r),r.flags|=1,sr(n,r,a,p),r.child)}function i1(n,r,a,c,p,y){return uo(r),r.updateQueue=null,a=l2(r,c,a,p),o2(n),c=dm(),n!==null&&!Zn?(fm(n,r,y),Ui(n,r,y)):(Vt&&c&&Bd(r),r.flags|=1,sr(n,r,a,y),r.child)}function a1(n,r,a,c,p){if(uo(r),r.stateNode===null){var y=tl,T=a.contextType;typeof T=="object"&&T!==null&&(y=vr(T)),y=new a(c,y),r.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Tm,r.stateNode=y,y._reactInternals=r,y=r.stateNode,y.props=c,y.state=r.memoizedState,y.refs={},tm(r),T=a.contextType,y.context=typeof T=="object"&&T!==null?vr(T):tl,y.state=r.memoizedState,T=a.getDerivedStateFromProps,typeof T=="function"&&(Cm(r,a,T,c),y.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(T=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),T!==y.state&&Tm.enqueueReplaceState(y,y.state,null),Uc(r,c,y,p),_c(),y.state=r.memoizedState),typeof y.componentDidMount=="function"&&(r.flags|=4194308),c=!0}else if(n===null){y=r.stateNode;var P=r.memoizedProps,Z=vo(a,P);y.props=Z;var ae=y.context,pe=a.contextType;T=tl,typeof pe=="object"&&pe!==null&&(T=vr(pe));var Ce=a.getDerivedStateFromProps;pe=typeof Ce=="function"||typeof y.getSnapshotBeforeUpdate=="function",P=r.pendingProps!==P,pe||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(P||ae!==T)&&Y2(r,y,c,T),pa=!1;var se=r.memoizedState;y.state=se,Uc(r,c,y,p),_c(),ae=r.memoizedState,P||se!==ae||pa?(typeof Ce=="function"&&(Cm(r,a,Ce,c),ae=r.memoizedState),(Z=pa||q2(r,a,Z,c,se,ae,T))?(pe||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(r.flags|=4194308)):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=c,r.memoizedState=ae),y.props=c,y.state=ae,y.context=T,c=Z):(typeof y.componentDidMount=="function"&&(r.flags|=4194308),c=!1)}else{y=r.stateNode,nm(n,r),T=r.memoizedProps,pe=vo(a,T),y.props=pe,Ce=r.pendingProps,se=y.context,ae=a.contextType,Z=tl,typeof ae=="object"&&ae!==null&&(Z=vr(ae)),P=a.getDerivedStateFromProps,(ae=typeof P=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(T!==Ce||se!==Z)&&Y2(r,y,c,Z),pa=!1,se=r.memoizedState,y.state=se,Uc(r,c,y,p),_c();var fe=r.memoizedState;T!==Ce||se!==fe||pa||n!==null&&n.dependencies!==null&&qd(n.dependencies)?(typeof P=="function"&&(Cm(r,a,P,c),fe=r.memoizedState),(pe=pa||q2(r,a,pe,c,se,fe,Z)||n!==null&&n.dependencies!==null&&qd(n.dependencies))?(ae||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(c,fe,Z),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(c,fe,Z)),typeof y.componentDidUpdate=="function"&&(r.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof y.componentDidUpdate!="function"||T===n.memoizedProps&&se===n.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||T===n.memoizedProps&&se===n.memoizedState||(r.flags|=1024),r.memoizedProps=c,r.memoizedState=fe),y.props=c,y.state=fe,y.context=Z,c=pe):(typeof y.componentDidUpdate!="function"||T===n.memoizedProps&&se===n.memoizedState||(r.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||T===n.memoizedProps&&se===n.memoizedState||(r.flags|=1024),c=!1)}return y=c,dl(n,r),c=(r.flags&128)!==0,y||c?(y=r.stateNode,a=c&&typeof a.getDerivedStateFromError!="function"?null:y.render(),r.flags|=1,n!==null&&c?(r.child=mo(r,n.child,null,p),r.child=mo(r,null,a,p)):sr(n,r,a,p),r.memoizedState=y.state,n=r.child):n=Ui(n,r,p),n}function o1(n,r,a,c){return oo(),r.flags|=256,sr(n,r,a,c),r.child}var Mm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Nm(n){return{baseLanes:n,cachePool:Xx()}}function Dm(n,r,a){return n=n!==null?n.childLanes&~a:0,r&&(n|=fs),n}function l1(n,r,a){var c=r.pendingProps,p=!1,y=(r.flags&128)!==0,T;if((T=y)||(T=n!==null&&n.memoizedState===null?!1:(xr.current&2)!==0),T&&(p=!0,r.flags&=-129),T=(r.flags&32)!==0,r.flags&=-33,n===null){if(Vt){if(p?va(r):ba(),(n=Mn)?(n=MS(n,Ts),n=n!==null&&n.data!=="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:ca!==null?{id:ti,overflow:ni}:null,retryLane:536870912,hydrationErrors:null},a=Fx(n),a.return=r,r.child=a,lr=r,Mn=null)):n=null,n===null)throw da(r);return N0(n)?r.lanes=32:r.lanes=536870912,null}return y=c.children,c=c.fallback,p?(ba(),p=r.mode,y=ff({mode:"hidden",children:y},p),c=ao(c,p,a,null),y.return=r,c.return=r,y.sibling=c,r.child=y,c=r.child,c.memoizedState=Nm(a),c.childLanes=Dm(n,T,a),r.memoizedState=Mm,Kc(null,c)):(va(r),jm(r,y))}var P=n.memoizedState;if(P!==null){var Z=P.dehydrated;if(Z!==null)return QN(n,r,y,T,c,Z,P,a)}return p?(ba(),p=c.fallback,y=r.mode,P=n.child,Z=P.sibling,c=ji(P,{mode:"hidden",children:c.children}),c.subtreeFlags=P.subtreeFlags&1206910976,Z!==null?p=ji(Z,p):(p=ao(p,y,a,null),p.flags|=2),p.return=r,c.return=r,c.sibling=p,r.child=c,Kc(null,c),c=r.child,p=n.child.memoizedState,p===null?p=Nm(a):(y=p.cachePool,y!==null?(P=Qn._currentValue,y=y.parent!==P?{parent:P,pool:P}:y):y=Xx(),p={baseLanes:p.baseLanes|a,cachePool:y}),c.memoizedState=p,c.childLanes=Dm(n,T,a),r.memoizedState=Mm,Kc(n.child,c)):(va(r),a=n.child,n=a.sibling,a=ji(a,{mode:"visible",children:c.children}),a.return=r,a.sibling=null,n!==null&&(T=r.deletions,T===null?(r.deletions=[n],r.flags|=16):T.push(n)),r.child=a,r.memoizedState=null,a)}function jm(n,r){return r=ff({mode:"visible",children:r},n.mode),r.return=n,n.child=r}function ff(n,r){return n=Yr(22,n,null,r),n.lanes=0,n}function hf(n,r,a){return mo(r,n.child,null,a),n=jm(r,r.pendingProps.children),n.flags|=2,r.memoizedState=null,n}function QN(n,r,a,c,p,y,T,P){if(a)return r.flags&256?(va(r),r.flags&=-257,hf(n,r,P)):r.memoizedState!==null?(ba(),r.child=n.child,r.flags|=128,null):(ba(),y=p.fallback,T=r.mode,p=ff({mode:"visible",children:p.children},T),y=ao(y,T,P,null),y.flags|=2,p.return=r,y.return=r,p.sibling=y,r.child=p,mo(r,n.child,null,P),p=r.child,p.memoizedState=Nm(P),p.childLanes=Dm(n,c,P),r.memoizedState=Mm,Kc(null,p));if(va(r),N0(y)){if(c=y.nextSibling&&y.nextSibling.dataset,c)var Z=c.dgst;return c=Z,c!==""&&(p=Error(i(419)),p.stack="",p.digest=c,Dc({value:p,source:null,stack:null})),hf(n,r,P)}if(Zn||co(n,r,P,!1),c=(P&n.childLanes)!==0,Zn||c){if(ya.current!==null)return hf(n,r,P);if(c=kn,c!==null&&(p=Yt(c,P),p!==0&&p!==T.retryLane))throw T.retryLane=p,io(n,p),Xr(c,n,p),Om;return M0(y)||Nf(),hf(n,r,P)}return M0(y)?(r.flags|=192,r.child=n.child,null):(n=T.treeContext,Mn=Os(y.nextSibling),lr=r,Vt=!0,ua=null,Ts=!1,n!==null&&Kx(r,n),r=jm(r,p.children),r.flags|=134221824,r)}function c1(n,r,a){n.lanes|=r;var c=n.alternate;c!==null&&(c.lanes|=r),Kd(n.return,r,a)}function u1(n){for(var r=null;n!==null;){var a=n.alternate;a!==null&&Wd(a)===null&&(r=n),n=n.sibling}return r}function pf(n,r,a,c,p,y){var T=n.memoizedState;T===null?n.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:c,tail:a,tailMode:p,treeForkCount:y}:(T.isBackwards=r,T.rendering=null,T.renderingStartTime=0,T.last=c,T.tail=a,T.tailMode=p,T.treeForkCount=y)}function Im(n){var r=n.child;for(n.child=null;r!==null;){var a=r.sibling;r.sibling=n.child,n.child=r,r=a}}function Pm(n,r,a){var c=r.pendingProps,p=c.revealOrder,y=c.tail;c=c.children;var T=xr.current;if(r.flags&128)return Hc(r,T),null;var P=(T&2)!==0;if(P?(T=T&1|2,r.flags|=128):T&=1,Hc(r,T),p==="backwards"&&n!==null?(Im(n),sr(n,r,c,a),Im(n)):sr(n,r,c,a),c=Vt?Nc:0,!P&&n!==null&&(n.flags&128)!==0)e:for(n=r.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&c1(n,a,r);else if(n.tag===19)c1(n,a,r);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===r)break e;for(;n.sibling===null;){if(n.return===null||n.return===r)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(p){case"backwards":a=u1(r.child),a===null?(p=r.child,r.child=null):(p=a.sibling,a.sibling=null,Im(r)),pf(r,!0,p,null,y,c);break;case"unstable_legacy-backwards":for(a=null,p=r.child,r.child=null;p!==null;){if(n=p.alternate,n!==null&&Wd(n)===null){r.child=p;break}n=p.sibling,p.sibling=a,a=p,p=n}pf(r,!0,a,null,y,c);break;case"together":pf(r,!1,null,null,void 0,c);break;case"independent":r.memoizedState=null;break;default:a=u1(r.child),a===null?(p=r.child,r.child=null):(p=a.sibling,a.sibling=null),pf(r,!1,p,a,y,c)}return r.child}function d1(n,r,a){var c=r.pendingProps;return fa(r,r.type,c.value),sr(n,r,c.children,a),r.child}function Ui(n,r,a){if(n!==null&&(r.dependencies=n.dependencies),Ea|=r.lanes,(a&r.childLanes)===0)if(n!==null){if(co(n,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(n!==null&&r.child!==n.child)throw Error(i(153));if(r.child!==null){for(n=r.child,a=ji(n,n.pendingProps),r.child=a,a.return=r;n.sibling!==null;)n=n.sibling,a=a.sibling=ji(n,n.pendingProps),a.return=r;a.sibling=null}return r.child}function Lm(n,r){return(n.lanes&r)!==0?!0:(n=n.dependencies,!!(n!==null&&qd(n)))}function XN(n,r,a){switch(r.tag){case 3:Ze(r,r.stateNode.containerInfo),fa(r,Qn,n.memoizedState.cache),oo();break;case 27:case 5:de(r);break;case 4:Ze(r,r.stateNode.containerInfo);break;case 10:fa(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,om(r),null;break;case 13:var c=r.memoizedState;if(c!==null){if(c.dehydrated!==null)return va(r),r.flags|=128,null;c=co(n,r,a,!1);var p=r.child.childLanes;return c||(a&p)!==0?l1(n,r,a):(va(r),n=Ui(n,r,a),n!==null?n.sibling:null)}va(r);break;case 19:if(r.flags&128)return Pm(n,r,a);if(p=(n.flags&128)!==0,c=(a&r.childLanes)!==0,c||(co(n,r,a,!1),c=(a&r.childLanes)!==0),p){if(c)return Pm(n,r,a);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Hc(r,xr.current),c)break;return null;case 22:return r.lanes=0,n1(n,r,a,r.pendingProps);case 24:fa(r,Qn,n.memoizedState.cache)}return Ui(n,r,a)}function f1(n,r,a){if(n!==null)if(n.memoizedProps!==r.pendingProps)Zn=!0;else{if(!Lm(n,a)&&(r.flags&128)===0)return Zn=!1,XN(n,r,a);Zn=(n.flags&131072)!==0}else Zn=!1,Vt&&(r.flags&1048576)!==0&&Vx(r,Nc,r.index);switch(r.lanes=0,r.tag){case 16:e:{var c=r.pendingProps;if(n=po(r.elementType),r.type=n,typeof n=="function")Vg(n)?(c=vo(n,c),r.tag=1,r=a1(null,r,n,c,a)):(r.tag=0,r=Am(null,r,n,c,a));else{if(n!=null){var p=n.$$typeof;if(p===z){r.tag=11,r=W2(null,r,n,c,a);break e}else if(p===K){r.tag=14,r=e1(null,r,n,c,a);break e}else if(p===U){r.tag=10,r.type=n,r=d1(null,r,a);break e}}throw r=le(n)||n,Error(i(306,r,""))}}return r;case 0:return Am(n,r,r.type,r.pendingProps,a);case 1:return c=r.type,p=vo(c,r.pendingProps),a1(n,r,c,p,a);case 3:e:{if(Ze(r,r.stateNode.containerInfo),n===null)throw Error(i(387));c=r.pendingProps;var y=r.memoizedState;p=y.element,nm(n,r),Uc(r,c,null,a);var T=r.memoizedState;if(c=T.cache,fa(r,Qn,c),c!==y.cache&&Xg(r,[Qn],a,!0),_c(),c=T.element,y.isDehydrated)if(y={element:c,isDehydrated:!1,cache:T.cache},r.updateQueue.baseState=y,r.memoizedState=y,r.flags&256){r=o1(n,r,c,a);break e}else if(c!==p){p=Es(Error(i(424)),r),Dc(p),r=o1(n,r,c,a);break e}else for(n=r.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,Mn=Os(n.firstChild),lr=r,Vt=!0,ua=null,Ts=!0,a=n2(r,null,c,a),r.child=a;a;)a.flags=a.flags&-3|134221824,a=a.sibling;else{if(oo(),c===p){r=Ui(n,r,a);break e}sr(n,r,c,a)}r=r.child}return r;case 26:return dl(n,r),n===null?(a=zS(r.type,null,r.pendingProps,null))?r.memoizedState=a:Vt||(r.stateNode=mS(r.type,r.pendingProps,be.current,r)):r.memoizedState=zS(r.type,n.memoizedProps,r.pendingProps,n.memoizedState),null;case 27:return de(r),n===null&&Vt&&(c=r.stateNode=jS(r.type,r.pendingProps,be.current),lr=r,Ts=!0,p=Mn,ka(r.type)?(D0=p,Mn=Os(c.firstChild)):Mn=p),sr(n,r,r.pendingProps.children,a),dl(n,r),n===null&&(r.flags|=4194304),r.child;case 5:return n===null&&Vt&&((p=c=Mn)&&(c=KD(c,r.type,r.pendingProps,Ts),c!==null?(r.stateNode=c,lr=r,Mn=Os(c.firstChild),Ts=!1,p=!0):p=!1),p||da(r)),de(r),p=r.type,y=r.pendingProps,T=n!==null?n.memoizedProps:null,c=y.children,E0(p,y)?c=null:T!==null&&E0(p,T)&&(r.flags|=32),r.memoizedState!==null&&(p=um(n,r,UN,null,null,a),Al._currentValue=p),dl(n,r),sr(n,r,c,a),r.child;case 6:return n===null&&Vt&&((n=a=Mn)&&(a=qD(a,r.pendingProps,Ts),a!==null?(r.stateNode=a,lr=r,Mn=null,n=!0):n=!1),n||da(r)),null;case 13:return l1(n,r,a);case 4:return Ze(r,r.stateNode.containerInfo),c=r.pendingProps,n===null?r.child=mo(r,null,c,a):sr(n,r,c,a),r.child;case 11:return W2(n,r,r.type,r.pendingProps,a);case 7:return c=r.pendingProps,dl(n,r),sr(n,r,c,a),r.child;case 8:return sr(n,r,r.pendingProps.children,a),r.child;case 12:return sr(n,r,r.pendingProps.children,a),r.child;case 10:return d1(n,r,a);case 9:return p=r.type._context,c=r.pendingProps.children,uo(r),p=vr(p),c=c(p),r.flags|=1,sr(n,r,c,a),r.child;case 14:return e1(n,r,r.type,r.pendingProps,a);case 15:return t1(n,r,r.type,r.pendingProps,a);case 19:return Pm(n,r,a);case 31:return $N(n,r,a);case 22:return n1(n,r,a,r.pendingProps);case 24:return uo(r),c=vr(Qn),n===null?(p=Wg(),p===null&&(p=kn,y=Zg(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=a),p=y),r.memoizedState={parent:c,cache:p},tm(r),fa(r,Qn,p)):((n.lanes&a)!==0&&(nm(n,r),Uc(r,null,null,a),_c()),p=n.memoizedState,y=r.memoizedState,p.parent!==c?(p={parent:c,cache:c},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),fa(r,Qn,c)):(c=y.cache,fa(r,Qn,c),c!==p.cache&&Xg(r,[Qn],a,!0))),sr(n,r,r.pendingProps.children,a),r.child;case 30:return r.stateNode===null&&(r.stateNode={autoName:null,paired:null,clones:null,ref:null}),c=r.pendingProps,c.name!=null&&c.name!=="auto"?r.flags|=n===null?18882560:18874368:Vt&&Bd(r),n!==null&&n.memoizedProps.name!==c.name?r.flags|=4194816:dl(n,r),sr(n,r,c.children,a),r.child;case 29:throw r.pendingProps}throw Error(i(156,r.tag))}function Hi(n){n.flags|=4}function zm(n,r,a,c,p){var y;if((y=(n.mode&32)!==0)&&(y=a===null?FS(r,c):FS(r,c)&&(c.src!==a.src||c.srcSet!==a.srcSet)),y){if(n.flags|=16777216,(p&335544128)===p)if(n.stateNode.complete)n.flags|=8192;else if(G1())n.flags|=8192;else throw go=Qd,em}else n.flags&=-16777217}function h1(n,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!BS(r))if(G1())n.flags|=8192;else throw go=Qd,em}function gf(n,r){r!==null&&(n.flags|=4),n.flags&16384&&(r=n.tag!==22?tt():536870912,n.lanes|=r,ml|=r)}function qc(n,r){if(!Vt)switch(n.tailMode){case"visible":break;case"collapsed":for(var a=n.tail,c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?r||n.tail===null?n.tail=null:n.tail.sibling=null:c.sibling=null;break;default:for(r=n.tail,a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?n.tail=null:a.sibling=null}}function Nn(n){var r=n.alternate!==null&&n.alternate.child===n.child,a=0,c=0;if(r)for(var p=n.child;p!==null;)a|=p.lanes|p.childLanes,c|=p.subtreeFlags&1206910976,c|=p.flags&1206910976,p.return=n,p=p.sibling;else for(p=n.child;p!==null;)a|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=n,p=p.sibling;return n.subtreeFlags|=c,n.childLanes=a,r}function ZN(n,r,a){var c=r.pendingProps;switch(Yg(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nn(r),null;case 1:return Nn(r),null;case 3:return a=r.stateNode,c=null,n!==null&&(c=n.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),Li(Qn),ot(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(n===null||n.child===null)&&(sl(r)?Hi(r):n===null||n.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,$g())),Nn(r),null;case 26:var p=r.type,y=r.memoizedState;return n===null?(Hi(r),y!==null?(Nn(r),h1(r,y)):(Nn(r),zm(r,p,null,c,a))):y?y!==n.memoizedState?(Hi(r),Nn(r),h1(r,y)):(Nn(r),r.flags&=-16777217):(n=n.memoizedProps,n!==c&&Hi(r),Nn(r),zm(r,p,n,c,a)),null;case 27:if(we(r),a=be.current,p=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==c&&Hi(r);else{if(!c){if(r.stateNode===null)throw Error(i(166));return Nn(r),r.subtreeFlags&=-33554433,null}n=ke.current,sl(r)?qx(r):(n=jS(p,c,a),r.stateNode=n,Hi(r))}return Nn(r),r.subtreeFlags&=-33554433,null;case 5:if(we(r),p=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==c&&Hi(r);else{if(!c){if(r.stateNode===null)throw Error(i(166));return Nn(r),r.subtreeFlags&=-33554433,null}if(y=ke.current,sl(r))qx(r);else{var T=nu(be.current);switch(y){case 1:y=T.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:y=T.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":y=T.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":y=T.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":y=T.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof c.is=="string"?T.createElement("select",{is:c.is}):T.createElement("select"),c.multiple?y.multiple=!0:c.size&&(y.size=c.size);break;default:y=typeof c.is=="string"?T.createElement(p,{is:c.is}):T.createElement(p)}}y[fn]=r,y[An]=c;e:for(T=r.child;T!==null;){if(T.tag===5||T.tag===6)y.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===r)break e;for(;T.sibling===null;){if(T.return===null||T.return===r)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}r.stateNode=y;e:switch(wr(y,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Hi(r)}}return Nn(r),r.subtreeFlags&=-33554433,zm(r,r.type,n===null?null:n.memoizedProps,r.pendingProps,a),null;case 6:if(n&&r.stateNode!=null)n.memoizedProps!==c&&Hi(r);else{if(typeof c!="string"&&r.stateNode===null)throw Error(i(166));if(n=be.current,sl(r)){if(n=r.stateNode,a=r.memoizedProps,c=null,p=lr,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}n[fn]=r,n=!!(n.nodeValue===a||c!==null&&c.suppressHydrationWarning===!0||fS(n.nodeValue,a)),n||da(r,!0)}else n=nu(n).createTextNode(c),n[fn]=r,r.stateNode=n}return Nn(r),null;case 31:if(a=r.memoizedState,n===null||n.memoizedState!==null){if(c=sl(r),a!==null){if(n===null){if(!c)throw Error(i(318));if(n=r.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(557));n[fn]=r}else oo(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Nn(r),n=!1}else a=$g(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=a),n=!0;if(!n)return r.flags&256?(cs(r),r):(cs(r),null);if((r.flags&128)!==0)throw Error(i(558))}return Nn(r),null;case 13:if(c=r.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(p=sl(r),c!==null&&c.dehydrated!==null){if(n===null){if(!p)throw Error(i(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(i(317));p[fn]=r}else oo(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Nn(r),p=!1}else p=$g(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(cs(r),r):(cs(r),null)}return cs(r),(r.flags&128)!==0?(r.lanes=a,r):(a=c!==null,n=n!==null&&n.memoizedState!==null,a&&(c=r.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==p&&(c.flags|=2048)),a!==n&&a&&(r.child.flags|=8192),gf(r,r.updateQueue),Nn(r),null);case 4:return ot(),n===null&&v0(r.stateNode.containerInfo),r.flags|=67108864,Nn(r),null;case 10:return Li(r.type),Nn(r),null;case 19:if(lm(r),c=r.memoizedState,c===null)return Nn(r),null;if(p=(r.flags&128)!==0,y=c.rendering,y===null)if(p)qc(c,!1);else{if(Vn!==0||n!==null&&(n.flags&128)!==0)for(n=r.child;n!==null;){if(y=Wd(n),y!==null){for(r.flags|=128,qc(c,!1),n=y.updateQueue,r.updateQueue=n,gf(r,n),r.subtreeFlags=0,n=a,a=r.child;a!==null;)Hx(a,n),a=a.sibling;return Hc(r,xr.current&1|2),Vt&&Ii(r,c.treeForkCount),r.child}n=n.sibling}c.tail!==null&&wt()>kf&&(r.flags|=128,p=!0,qc(c,!1),r.lanes=4194304)}else{if(!p)if(n=Wd(y),n!==null){if(r.flags|=128,p=!0,n=n.updateQueue,r.updateQueue=n,gf(r,n),qc(c,!0),c.tail===null&&c.tailMode!=="collapsed"&&c.tailMode!=="visible"&&!y.alternate&&!Vt)return Nn(r),null}else 2*wt()-c.renderingStartTime>kf&&a!==536870912&&(r.flags|=128,p=!0,qc(c,!1),r.lanes=4194304);c.isBackwards?(y.sibling=r.child,r.child=y):(n=c.last,n!==null?n.sibling=y:r.child=y,c.last=y)}if(c.tail!==null){n=c.tail;e:{for(a=n;a!==null;){if(a.alternate!==null){a=!1;break e}a=a.sibling}a=!0}return c.rendering=n,c.tail=n.sibling,c.renderingStartTime=wt(),n.sibling=null,y=xr.current,y=p?y&1|2:y&1,c.tailMode==="visible"||c.tailMode==="collapsed"||!a||Vt?Hc(r,y):(a=y,Ve(br,r),Ve(xr,a),Tr===null&&(Tr=r)),Vt&&Ii(r,c.treeForkCount),n}return Nn(r),null;case 22:case 23:return cs(r),am(),c=r.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(r.flags|=8192):c&&(r.flags|=8192),c?(a&536870912)!==0&&(r.flags&128)===0&&(Nn(r),r.subtreeFlags&6&&(r.flags|=8192)):Nn(r),a=r.updateQueue,a!==null&&gf(r,a.retryQueue),a=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),c=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),c!==a&&(r.flags|=2048),n!==null&&Le(ho),null;case 24:return a=null,n!==null&&(a=n.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),Li(Qn),Nn(r),null;case 25:return null;case 30:return r.flags|=33554432,Nn(r),null}throw Error(i(156,r.tag))}function JN(n,r){switch(Yg(r),r.tag){case 1:return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 3:return Li(Qn),ot(),n=r.flags,(n&65536)!==0&&(n&128)===0?(r.flags=n&-65537|128,r):null;case 26:case 27:case 5:return we(r),null;case 31:if(r.memoizedState!==null){if(cs(r),r.alternate===null)throw Error(i(340));oo()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 13:if(cs(r),n=r.memoizedState,n!==null&&n.dehydrated!==null){if(r.alternate===null)throw Error(i(340));oo()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return lm(r),n=r.flags,n&65536?(r.flags=n&-65537|128,n=r.memoizedState,n!==null&&(n.rendering=null,n.tail=null),r.flags|=4,r):null;case 4:return ot(),null;case 10:return Li(r.type),null;case 22:case 23:return cs(r),am(),n!==null&&Le(ho),n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 24:return Li(Qn),null;case 25:return null;default:return null}}function p1(n,r){switch(Yg(r),r.tag){case 3:Li(Qn),ot();break;case 26:case 27:case 5:we(r);break;case 4:ot();break;case 31:r.memoizedState!==null&&cs(r);break;case 13:cs(r);break;case 19:lm(r);break;case 10:Li(r.type);break;case 22:case 23:cs(r),am(),n!==null&&Le(ho);break;case 24:Li(Qn)}}function Yc(n,r){try{var a=r.updateQueue,c=a!==null?a.lastEffect:null;if(c!==null){var p=c.next;a=p;do{if((a.tag&n)===n){c=void 0;var y=a.create,T=a.inst;c=y(),T.destroy=c}a=a.next}while(a!==p)}}catch(P){yn(r,r.return,P)}}function xa(n,r,a){try{var c=r.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var y=p.next;c=y;do{if((c.tag&n)===n){var T=c.inst,P=T.destroy;if(P!==void 0){T.destroy=void 0,p=r;var Z=a,ae=P;try{ae()}catch(pe){yn(p,Z,pe)}}}c=c.next}while(c!==y)}}catch(pe){yn(r,r.return,pe)}}function g1(n){var r=n.updateQueue;if(r!==null){var a=n.stateNode;try{s2(r,a)}catch(c){yn(n,n.return,c)}}}function m1(n,r,a){a.props=vo(n.type,n.memoizedProps),a.state=n.memoizedState;try{a.componentWillUnmount()}catch(c){yn(n,r,c)}}function ri(n,r){try{var a=n.ref;if(a!==null){switch(n.tag){case 26:case 27:case 5:var c=n.stateNode;break;case 30:var p=n.stateNode,y=Ni(n.memoizedProps,p);(p.ref===null||p.ref.name!==y)&&(p.ref=ES(y)),c=p.ref;break;case 7:if(n.stateNode===null){var T=new ps(n);h(n.child,!1,BD,T,void 0,void 0),n.stateNode=T}c=n.stateNode;break;default:c=n.stateNode}typeof a=="function"?n.refCleanup=a(c):a.current=c}}catch(P){yn(n,r,P)}}function Sr(n,r){var a=n.ref,c=n.refCleanup;if(a!==null)if(typeof c=="function")try{c()}catch(p){yn(n,r,p)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(p){yn(n,r,p)}else a.current=null}function mf(n,r){if((n.tag===5||n.tag===27||n.tag===6)&&n.alternate===null&&r!==null)for(var a=0;a<r.length;a++)AS(n.stateNode,r[a])}function y1(n){for(var r=n.return;r!==null&&(Um(r)&&AS(n.stateNode,r.stateNode),!_m(r));)r=r.return}function Gc(n){for(var r=n.return;r!==null&&(Um(r)&&VD(n.stateNode,r.stateNode),!_m(r));)r=r.return}function _m(n){return n.tag===5||n.tag===3||n.tag===27}function Um(n){return n&&n.tag===7&&n.stateNode!==null}function Hm(n){var r=n.type,a=n.memoizedProps,c=n.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&c.focus();break e;case"img":a.src?c.src=a.src:a.srcSet&&(c.srcset=a.srcSet)}}catch(p){yn(n,n.return,p)}}function Fm(n,r,a){try{var c=n.stateNode;RD(c,n.type,a,r),c[An]=r}catch(p){yn(n,n.return,p)}}function v1(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&ka(n.type)||n.tag===4}function Bm(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||v1(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&&ka(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 Vm(n,r,a,c){var p=n.tag;if(p===5||p===6)p=n.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(p,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(p),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=Pr)),mf(n,c),mt=!0;else if(p!==4&&(p===27&&(mf(n,c),c=null,ka(n.type)&&(a=n.stateNode,r=null)),n=n.child,n!==null))for(Vm(n,r,a,c),n=n.sibling;n!==null;)Vm(n,r,a,c),n=n.sibling}function yf(n,r,a,c){var p=n.tag;if(p===5||p===6)p=n.stateNode,r?a.insertBefore(p,r):a.appendChild(p),mf(n,c),mt=!0;else if(p!==4&&(p===27&&(mf(n,c),c=null,ka(n.type)&&(a=n.stateNode)),n=n.child,n!==null))for(yf(n,r,a,c),n=n.sibling;n!==null;)yf(n,r,a,c),n=n.sibling}function b1(n){var r=n.stateNode,a=n.memoizedProps;try{for(var c=n.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);wr(r,c,a),r[fn]=n,r[An]=a}catch(y){yn(n,n.return,y)}}var vf=!1,us=null;function x1(n){(n.tag===30||(n.subtreeFlags&33554432)!==0)&&(vf=!0)}var si=null;function S1(){var n=si;return si=null,n}var Gr=0;function fl(n,r,a,c,p){return Gr=0,w1(n.child,r,a,c,p)}function w1(n,r,a,c,p){for(var y=!1;n!==null;){if(n.tag===5){var T=n.stateNode;if(c!==null){var P=T0(T);c.push(P),P.view&&(y=!0)}else y||T0(T).view&&(y=!0);vf=!0,SS(T,Gr===0?r:r+"_"+Gr,a),Gr++}else(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&p||w1(n.child,r,a,c,p)&&(y=!0));n=n.sibling}return y}function ii(n,r){for(;n!==null;)n.tag===5?wS(n.stateNode,n.memoizedProps):(n.tag!==22||n.memoizedState===null)&&(n.tag===30&&r||ii(n.child,r)),n=n.sibling}function bf(n){if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if((n.tag!==22||n.memoizedState===null)&&(bf(n),n.tag===30&&(n.flags&18874368)!==0&&n.stateNode.paired)){var r=n.memoizedProps;if(r.name==null||r.name==="auto")throw Error(i(544));var a=r.name;r=Di(r.default,r.share),r!=="none"&&(fl(n,a,r,null,!1)||ii(n.child,!1))}n=n.sibling}}function Km(n,r){if(n.tag===30){var a=n.stateNode,c=n.memoizedProps,p=Ni(c,a),y=Di(c.default,a.paired?c.share:c.enter);y!=="none"?fl(n,p,y,null,!1)?(bf(n),a.paired||r||xl(n,c.onEnter)):ii(n.child,!1):bf(n)}else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)Km(n,r),n=n.sibling;else bf(n)}function qm(n){if(us!==null&&us.size!==0){var r=us;if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if(n.tag!==22||n.memoizedState===null){if(n.tag===30&&(n.flags&18874368)!==0){var a=n.memoizedProps,c=a.name;if(c!=null&&c!=="auto"){var p=r.get(c);if(p!==void 0){var y=Di(a.default,a.share);if(y!=="none"&&(fl(n,c,y,null,!1)?(y=n.stateNode,p.paired=y,y.paired=p,xl(n,a.onShare)):ii(n.child,!1)),r.delete(c),r.size===0)break}}}qm(n)}n=n.sibling}}}function Ym(n){if(n.tag===30){var r=n.memoizedProps,a=Ni(r,n.stateNode),c=us!==null?us.get(a):void 0,p=Di(r.default,c!==void 0?r.share:r.exit);p!=="none"&&(fl(n,a,p,null,!1)?c!==void 0?(p=n.stateNode,c.paired=p,p.paired=c,us.delete(a),xl(n,r.onShare)):xl(n,r.onExit):ii(n.child,!1)),us!==null&&qm(n)}else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)Ym(n),n=n.sibling;else us!==null&&qm(n)}function E1(n){for(n=n.child;n!==null;){if(n.tag===30){var r=n.memoizedProps,a=Ni(r,n.stateNode);r=Di(r.default,r.update),n.flags&=-5,r!=="none"&&fl(n,a,r,n.memoizedState=[],!1)}else(n.subtreeFlags&33554432)!==0&&E1(n);n=n.sibling}}function Gm(n){if((n.subtreeFlags&18874368)!==0)for(n=n.child;n!==null;){if(n.tag!==22||n.memoizedState===null){if(n.tag===30&&(n.flags&18874368)!==0){var r=n.stateNode;r.paired!==null&&(r.paired=null,ii(n.child,!1))}Gm(n)}n=n.sibling}}function xf(n){if(n.tag===30)n.stateNode.paired=null,ii(n.child,!1),Gm(n);else if((n.subtreeFlags&33554432)!==0)for(n=n.child;n!==null;)xf(n),n=n.sibling;else Gm(n)}function R1(n){for(n=n.child;n!==null;)n.tag===30?ii(n.child,!1):(n.subtreeFlags&33554432)!==0&&R1(n),n=n.sibling}function $m(n,r,a,c,p,y,T){for(var P=!1;r!==null;){if(r.tag===5){var Z=r.stateNode;if(y!==null&&Gr<y.length){var ae=y[Gr],pe=T0(Z);(ae.view||pe.view)&&(P=!0);var Ce;if(Ce=(n.flags&4)===0)if(pe.clip)Ce=!0;else{Ce=ae.rect;var se=pe.rect;Ce=Ce.y!==se.y||Ce.x!==se.x||Ce.height!==se.height||Ce.width!==se.width}Ce&&(n.flags|=4),pe.abs?pe=!ae.abs:(ae=ae.rect,pe=pe.rect,pe=ae.height!==pe.height||ae.width!==pe.width),pe&&(n.flags|=32)}else n.flags|=32;(n.flags&4)!==0&&SS(Z,Gr===0?a:a+"_"+Gr,p),P&&(n.flags&4)!==0||(si===null&&(si=[]),si.push(Z,Gr===0?c:c+"_"+Gr,r.memoizedProps)),Gr++}else(r.tag!==22||r.memoizedState===null)&&(r.tag===30&&T?n.flags|=r.flags&32:$m(n,r.child,a,c,p,y,T)&&(P=!0));r=r.sibling}return P}function C1(n,r){for(n=n.child;n!==null;){if(n.tag===30){var a=n.memoizedProps,c=n.stateNode,p=Ni(a,c),y=Di(a.default,a.update),T;T=n.memoizedState,n.memoizedState=null,c=n;var P=n.child;Gr=0,p=$m(c,P,p,p,y,T,!1),(n.flags&4)!==0&&p&&xl(n,a.onUpdate)}else(n.subtreeFlags&33554432)!==0&&C1(n);n=n.sibling}}var cr=!1,pn=!1,ai=!1,Qm=!1,T1=typeof WeakSet=="function"?WeakSet:Set,ur=null,oi=!1,$c=!1,Sf=!1,Xm=!1;function WN(n,r,a){if(n=n.containerInfo,S0=Ml,n=Mx(n),Lg(n)){if("selectionStart"in n)var c={start:n.selectionStart,end:n.selectionEnd};else e:{c=(c=n.ownerDocument)&&c.defaultView||window;var p=c.getSelection&&c.getSelection();if(p&&p.rangeCount!==0){c=p.anchorNode;var y=p.anchorOffset,T=p.focusNode;p=p.focusOffset;try{c.nodeType,T.nodeType}catch{c=null;break e}var P=0,Z=-1,ae=-1,pe=0,Ce=0,se=n,fe=null;t:for(;;){for(var Ye;se!==c||y!==0&&se.nodeType!==3||(Z=P+y),se!==T||p!==0&&se.nodeType!==3||(ae=P+p),se.nodeType===3&&(P+=se.nodeValue.length),(Ye=se.firstChild)!==null;)fe=se,se=Ye;for(;;){if(se===n)break t;if(fe===c&&++pe===y&&(Z=P),fe===T&&++Ce===p&&(ae=P),(Ye=se.nextSibling)!==null)break;se=fe,fe=se.parentNode}se=Ye}c=Z===-1||ae===-1?null:{start:Z,end:ae}}else c=null}c=c||{start:0,end:0}}else c=null;for(w0={focusedElem:n,selectionRange:c},Ml=!1,a=(a&335544064)===a,ur=r,r=a?9270:1024;ur!==null;){if(n=ur,a&&(c=n.deletions,c!==null))for(y=0;y<c.length;y++)a&&Ym(c[y]);if(n.alternate===null&&(n.flags&2)!==0)a&&x1(n),wf(a);else{if(n.tag===22){if(c=n.alternate,n.memoizedState!==null){c!==null&&c.memoizedState===null&&a&&Ym(c),wf(a);continue}else if(c!==null&&c.memoizedState!==null){a&&x1(n),wf(a);continue}}c=n.child,(n.subtreeFlags&r)!==0&&c!==null?(c.return=n,ur=c):(a&&E1(n),wf(a))}}us=null}function wf(n){for(;ur!==null;){var r=ur,a=n,c=r.alternate,p=r.flags;switch(r.tag){case 0:case 11:case 15:break;case 1:if((p&1024)!==0&&c!==null){a=void 0,p=c.memoizedProps,c=c.memoizedState;var y=r.stateNode;try{var T=vo(r.type,p);a=y.getSnapshotBeforeUpdate(T,c),y.__reactInternalSnapshotBeforeUpdate=a}catch(P){yn(r,r.return,P)}}break;case 3:if((p&1024)!==0){if(c=r.stateNode.containerInfo,a=c.nodeType,a===9)A0(c);else if(a===1)switch(c.nodeName){case"HEAD":case"HTML":case"BODY":A0(c);break;default:c.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:a&&c!==null&&(a=Ni(c.memoizedProps,c.stateNode),p=r.memoizedProps,p=Di(p.default,p.update),p!=="none"&&fl(c,a,p,c.memoizedState=[],!0));break;default:if((p&1024)!==0)throw Error(i(163))}if(c=r.sibling,c!==null){c.return=r.return,ur=c;break}ur=r.return}}function k1(n,r,a){var c=a.flags;switch(a.tag){case 0:case 11:case 15:li(n,a),c&4&&Yc(5,a);break;case 1:if(li(n,a),c&4)if(n=a.stateNode,r===null)try{n.componentDidMount()}catch(T){yn(a,a.return,T)}else{var p=vo(a.type,r.memoizedProps);r=r.memoizedState;try{n.componentDidUpdate(p,r,n.__reactInternalSnapshotBeforeUpdate)}catch(T){yn(a,a.return,T)}}c&64&&g1(a),c&512&&ri(a,a.return);break;case 3:if(li(n,a),c&64&&(n=a.updateQueue,n!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{s2(n,r)}catch(T){yn(a,a.return,T)}}break;case 27:r===null&&c&4&&b1(a);case 26:case 5:li(n,a),r===null&&c&4&&Hm(a),c&512&&ri(a,a.return);break;case 12:li(n,a);break;case 31:li(n,a),c&4&&N1(n,a);break;case 13:li(n,a),c&4&&D1(n,a),c&64&&(n=a.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(a=dD.bind(null,a),YD(n,a))));break;case 22:if(c=a.memoizedState!==null||cr,!c){var y=r!==null&&r.memoizedState!==null||pn;r=cr,p=pn,cr=c,(pn=y)&&!p?(c=2,(a.subtreeFlags&8772)!==0&&(c|=1),Bs(n,a,c)):li(n,a),cr=r,pn=p}break;case 30:li(n,a),c&512&&ri(a,a.return);break;case 7:c&512&&ri(a,a.return);default:li(n,a)}}function Zm(n,r){for(n=n.child;n!==null;)O1(n,r),n=n.sibling}function O1(n,r){switch(n.tag){case 5:case 26:try{var a=n.stateNode;if(r){var c=a.style;typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none"}else{var p=n.stateNode,y=n.memoizedProps.style,T=y!=null&&y.hasOwnProperty("display")?y.display:null;p.style.display=T==null||typeof T=="boolean"?"":(""+T).trim()}}catch(Z){yn(n,n.return,Z)}Jm(n,r);break;case 6:try{n.stateNode.nodeValue=r?"":n.memoizedProps,mt=!0}catch(Z){yn(n,n.return,Z)}break;case 18:try{var P=n.stateNode;r?xS(P,!0):xS(n.stateNode,!1)}catch(Z){yn(n,n.return,Z)}break;case 22:case 23:n.memoizedState===null&&Zm(n,r);break;default:Zm(n,r)}}function Jm(n,r){if(n.subtreeFlags&67108864)for(n=n.child;n!==null;){e:{var a=n,c=r;switch(a.tag){case 4:O1(a,c);break e;case 22:a.memoizedState===null&&Jm(a,c);break e;default:Jm(a,c)}}n=n.sibling}}function A1(n){var r=n.alternate;r!==null&&(n.alternate=null,A1(r)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(r=n.stateNode,r!==null&&qn(r)),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 In=null,$r=!1;function Hs(n,r,a){for(a=a.child;a!==null;)M1(n,r,a),a=a.sibling}function M1(n,r,a){if(ze&&typeof ze.onCommitFiberUnmount=="function")try{ze.onCommitFiberUnmount(Ie,a)}catch{}switch(a.tag){case 26:pn||Sr(a,r),Hs(n,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&!pn&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:pn||Sr(a,r),Gc(a);var c=In,p=$r;ka(a.type)&&(In=a.stateNode,$r=!1),Hs(n,r,a),IS(a.stateNode,a.type,a.memoizedProps),In=c,$r=p;break;case 5:pn||Sr(a,r),Gc(a);case 6:if(a.tag===6&&Gc(a),c=In,p=$r,In=null,Hs(n,r,a),In=c,$r=p,In!==null)if($r)try{(In.nodeType===9?In.body:In.nodeName==="HTML"?In.ownerDocument.body:In).removeChild(a.stateNode),mt=!0}catch(y){yn(a,r,y)}else try{In.removeChild(a.stateNode),mt=!0}catch(y){yn(a,r,y)}break;case 18:In!==null&&($r?(n=In,bS(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,a.stateNode),Nl(n)):bS(In,a.stateNode));break;case 4:c=In,p=$r,In=a.stateNode.containerInfo,$r=!0,Hs(n,r,a),In=c,$r=p;break;case 0:case 11:case 14:case 15:xa(2,a,r),pn||xa(4,a,r),Hs(n,r,a);break;case 1:pn||(Sr(a,r),c=a.stateNode,typeof c.componentWillUnmount=="function"&&m1(a,r,c)),Hs(n,r,a);break;case 21:Hs(n,r,a);break;case 22:pn=(c=pn)||a.memoizedState!==null,Hs(n,r,a),pn=c;break;case 30:Sr(a,r),Hs(n,r,a);break;case 7:pn||Sr(a,r),Hs(n,r,a);break;default:Hs(n,r,a)}}function N1(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Nl(n)}catch(a){yn(r,r.return,a)}}}function D1(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Nl(n)}catch(a){yn(r,r.return,a)}}function eD(n){switch(n.tag){case 31:case 13:case 19:var r=n.stateNode;return r===null&&(r=n.stateNode=new T1),r;case 22:return n=n.stateNode,r=n._retryCache,r===null&&(r=n._retryCache=new T1),r;default:throw Error(i(435,n.tag))}}function Ef(n,r){var a=eD(n);r.forEach(function(c){if(!a.has(c)){a.add(c);var p=fD.bind(null,n,c);c.then(p,p)}})}function _r(n,r,a){var c=r.deletions;if(c!==null)for(var p=0;p<c.length;p++){var y=c[p],T=n,P=r,Z=P;e:for(;Z!==null;){switch(Z.tag){case 27:if(ka(Z.type)){In=Z.stateNode,$r=!1;break e}break;case 5:In=Z.stateNode,$r=!1;break e;case 3:case 4:In=Z.stateNode.containerInfo,$r=!0;break e}Z=Z.return}if(In===null)throw Error(i(160));M1(T,P,y),In=null,$r=!1,T=y.alternate,T!==null&&(T.return=null),y.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)j1(r,n,a),r=r.sibling}var Fs=null;function j1(n,r,a){var c=n.alternate,p=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(p&4&&(c=n.updateQueue,c=c!==null?c.events:null,c!==null))for(var y=0;y<c.length;y++){var T=c[y];T.ref.impl=T.nextImpl}_r(r,n,a),Ur(n),p&4&&(xa(3,n,n.return),Yc(3,n),xa(5,n,n.return));break;case 1:_r(r,n,a),Ur(n),p&512&&(pn||c===null||Sr(c,c.return)),p&64&&cr&&(n=n.updateQueue,n!==null&&(r=n.callbacks,r!==null&&(a=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=a===null?r:a.concat(r))));break;case 26:if(y=Fs,_r(r,n,a),Ur(n),p&512&&(pn||c===null||Sr(c,c.return)),p&4)if(p=c!==null?c.memoizedState:null,a=n.memoizedState,c===null)if(a===null)if(n.stateNode===null)if(cr)n.stateNode=mS(n.type,n.memoizedProps,r.containerInfo,n);else{e:{r=n.type,a=n.memoizedProps,p=y.ownerDocument||y;t:switch(r){case"title":c=p.getElementsByTagName("title")[0],(!c||c[xs]||c[fn]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=p.createElement(r),p.head.insertBefore(c,p.querySelector("head > title"))),wr(c,r,a),c[fn]=n,Se(c),r=c;break e;case"link":if(y=HS("link","href",p).get(r+(a.href||""))){for(T=0;T<y.length;T++)if(c=y[T],c.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&c.getAttribute("rel")===(a.rel==null?null:a.rel)&&c.getAttribute("title")===(a.title==null?null:a.title)&&c.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){y.splice(T,1);break t}}c=p.createElement(r),wr(c,r,a),p.head.appendChild(c);break;case"meta":if(y=HS("meta","content",p).get(r+(a.content||""))){for(T=0;T<y.length;T++)if(c=y[T],c.getAttribute("content")===(a.content==null?null:""+a.content)&&c.getAttribute("name")===(a.name==null?null:a.name)&&c.getAttribute("property")===(a.property==null?null:a.property)&&c.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&c.getAttribute("charset")===(a.charSet==null?null:a.charSet)){y.splice(T,1);break t}}c=p.createElement(r),wr(c,r,a),p.head.appendChild(c);break;default:throw Error(i(468,r))}c[fn]=n,Se(c),r=c}n.stateNode=r}else cr||L0(y,n.type,n.stateNode);else n.stateNode=US(y,a,n.memoizedProps);else p!==a?(p===null?(r=c.stateNode,r===null||pn||r.parentNode.removeChild(r)):p.count--,a===null?cr||L0(y,n.type,n.stateNode):US(y,a,n.memoizedProps)):a===null&&n.stateNode!==null&&Fm(n,n.memoizedProps,c.memoizedProps);break;case 27:_r(r,n,a),Ur(n),p&512&&(pn||c===null||Sr(c,c.return)),c!==null&&p&4&&Fm(n,n.memoizedProps,c.memoizedProps);break;case 5:if(y=ai,ai=!1,_r(r,n,a),ai=y,Ur(n),p&512&&(pn||c===null||Sr(c,c.return)),n.flags&32){r=n.stateNode;try{Ir(r,""),mt=!0}catch(pe){yn(n,n.return,pe)}}p&4&&n.stateNode!=null&&(r=n.memoizedProps,Fm(n,r,c!==null?c.memoizedProps:r)),p&1024&&(Qm=!0);break;case 6:if(_r(r,n,a),Ur(n),p&4){if(n.stateNode===null)throw Error(i(162));r=n.memoizedProps,a=n.stateNode;try{a.nodeValue=r,mt=!0}catch(pe){yn(n,n.return,pe)}}break;case 3:if(mt=!1,_f=null,y=Fs,Fs=ru(r.containerInfo),_r(r,n,a),Fs=y,Ur(n),p&4&&c!==null&&c.memoizedState.isDehydrated)try{Nl(r.containerInfo)}catch(pe){yn(n,n.return,pe)}Qm&&(Qm=!1,I1(n)),mt=!1;break;case 4:p=ai,ai=cr,c=rr(),y=Fs,Fs=ru(n.stateNode.containerInfo),_r(r,n,a),Ur(n),Fs=y,mt&&$c&&(Sf=!0),mt=c,ai=p;break;case 12:_r(r,n,a),Ur(n);break;case 31:_r(r,n,a),Ur(n),p&4&&(r=n.updateQueue,r!==null&&(n.updateQueue=null,Ef(n,r)));break;case 13:_r(r,n,a),Ur(n),n.child.flags&8192&&n.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Tf=wt()),p&4&&(r=n.updateQueue,r!==null&&(n.updateQueue=null,Ef(n,r)));break;case 22:y=n.memoizedState!==null,T=c!==null&&c.memoizedState!==null;var P=cr,Z=pn,ae=ai;cr=P||y,ai=ae||y,pn=Z||T,_r(r,n,a),pn=Z,ai=ae,cr=P,Ur(n),p&8192&&(r=n.stateNode,r._visibility=y?r._visibility&-2:r._visibility|1,!y||c===null||T||cr||pn||(r=T||pn,a=cr,c=pn,cr=y||cr,pn=r,Sa(n,2),cr=a,pn=c),!y&&ai||Zm(n,y)),p&4&&(r=n.updateQueue,r!==null&&(a=r.retryQueue,a!==null&&(r.retryQueue=null,Ef(n,a))));break;case 19:_r(r,n,a),Ur(n),p&4&&(r=n.updateQueue,r!==null&&(n.updateQueue=null,Ef(n,r)));break;case 30:p&512&&(pn||c===null||Sr(c,c.return)),p=rr(),y=$c,T=(a&335544064)===a,P=n.memoizedProps,$c=T&&Di(P.default,P.update)!=="none",_r(r,n,a),Ur(n),T&&c!==null&&mt&&(n.flags|=4),$c=y,mt=p;break;case 21:break;case 7:p&512&&(pn||c===null||Sr(c,c.return)),c&&c.stateNode!==null&&(c.stateNode._fragmentFiber=n);default:_r(r,n,a),Ur(n)}}function Ur(n){var r=n.flags;if(r&2){try{for(var a,c=n.return;c!==null;){if(v1(c)){a=c;break}c=c.return}c=null;for(var p=n.return;p!==null;){if(Um(p)){var y=p.stateNode;c===null?c=[y]:c.push(y)}if(_m(p))break;p=p.return}var T=c;if(a==null)throw Error(i(160));switch(a.tag){case 27:var P=a.stateNode,Z=Bm(n);yf(n,Z,P,T);break;case 5:var ae=a.stateNode;a.flags&32&&(Ir(ae,""),a.flags&=-33);var pe=Bm(n);yf(n,pe,ae,T);break;case 3:case 4:var Ce=a.stateNode.containerInfo,se=Bm(n);Vm(n,se,Ce,T);break;default:throw Error(i(161))}}catch(fe){yn(n,n.return,fe)}n.flags&=-3}r&4096&&(n.flags&=-4097)}function I1(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var r=n;I1(r),r.tag===5&&r.flags&1024&&(r=r.stateNode,Ml=!0,r.reset(),Ml=!1),n=n.sibling}}function hl(n,r){if(r.subtreeFlags&9270)for(r=r.child;r!==null;)P1(r,n),r=r.sibling;else C1(r)}function P1(n,r){var a=n.alternate;if(a===null)Km(n,!1);else switch(n.tag){case 3:if(Xm=oi=!1,S1(),hl(r,n),!oi&&!Sf){if(n=si,n!==null)for(var c=0;c<n.length;c+=3){a=n[c];var p=n[c+1];wS(a,n[c+2]),a=a.ownerDocument.documentElement,a!==null&&a.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+p+")"})}n=r.containerInfo,n=n.nodeType===9?n.documentElement:n.ownerDocument.documentElement,n!==null&&n.style.viewTransitionName===""&&(n.style.viewTransitionName="none",n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),n.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Xm=!0}si=null;break;case 5:hl(r,n);break;case 4:c=oi,oi=!1,hl(r,n),oi&&(Sf=!0),oi=c;break;case 22:n.memoizedState===null&&(a.memoizedState!==null?Km(n,!1):hl(r,n));break;case 30:c=oi,p=S1(),oi=!1,hl(r,n),oi&&(n.flags|=4);var y=n.memoizedProps,T=n.stateNode;r=Ni(y,T),T=Ni(a.memoizedProps,T);var P=Di(y.default,y.update);P==="none"?r=!1:(y=a.memoizedState,a.memoizedState=null,a=n.child,Gr=0,r=$m(n,a,r,T,P,y,!0),Gr!==(y===null?0:y.length)&&(n.flags|=32)),(n.flags&4)!==0&&r?(xl(n,n.memoizedProps.onUpdate),si=p):p!==null&&(p.push.apply(p,si),si=p),oi=(n.flags&32)!==0?!0:c;break;default:hl(r,n)}}function li(n,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)k1(n,r.alternate,r),r=r.sibling}function Sa(n,r){for(n=n.child;n!==null;){var a=n,c=r;switch(a.tag){case 0:case 11:case 14:case 15:xa(4,a,a.return),Sa(a,c);break;case 1:Sr(a,a.return);var p=a.stateNode;typeof p.componentWillUnmount=="function"&&m1(a,a.return,p),Sa(a,c);break;case 27:(c&2)!==0&&IS(a.stateNode,a.type,a.memoizedProps);case 5:Sr(a,a.return),a.tag!==5&&a.tag!==27||Gc(a),Sa(a,c);break;case 6:Gc(a);break;case 26:Sr(a,a.return),p=a.stateNode,a.memoizedState!==null||p===null||pn||p.parentNode.removeChild(p),Sa(a,c);break;case 22:a.memoizedState===null&&Sa(a,c);break;case 30:Sr(a,a.return),Sa(a,c);break;case 7:Sr(a,a.return);default:Sa(a,c)}n=n.sibling}}function Bs(n,r,a){for(a=(r.subtreeFlags&8772)!==0?a:a&-2,r=r.child;r!==null;){var c=r.alternate,p=n,y=r,T=y.flags,P=(a&1)!==0;switch(y.tag){case 0:case 11:case 15:Bs(p,y,a),Yc(4,y);break;case 1:if(Bs(p,y,a),c=y,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(pe){yn(c,c.return,pe)}if(c=y,p=c.updateQueue,p!==null){var Z=c.stateNode;try{var ae=p.shared.hiddenCallbacks;if(ae!==null)for(p.shared.hiddenCallbacks=null,p=0;p<ae.length;p++)r2(ae[p],Z)}catch(pe){yn(c,c.return,pe)}}P&&T&64&&g1(y),ri(y,y.return);break;case 27:(a&2)!==0&&b1(y);case 5:y.tag!==5&&y.tag!==27||y1(y),Bs(p,y,a),P&&c===null&&T&4&&Hm(y),ri(y,y.return);break;case 6:y1(y);break;case 26:Z=y.stateNode,y.memoizedState!==null||Z===null||cr||L0(ru(Z.ownerDocument),y.type,Z),Bs(p,y,a),P&&c===null&&T&4&&Hm(y),ri(y,y.return);break;case 12:Bs(p,y,a);break;case 31:Bs(p,y,a),P&&T&4&&N1(p,y);break;case 13:Bs(p,y,a),P&&T&4&&D1(p,y);break;case 22:y.memoizedState===null&&Bs(p,y,a),ri(y,y.return);break;case 30:Bs(p,y,a),ri(y,y.return);break;case 7:ri(y,y.return);default:Bs(p,y,a)}r=r.sibling}}function Wm(n,r){var a=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==a&&(n!=null&&n.refCount++,a!=null&&jc(a))}function e0(n,r){n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&jc(n))}function ks(n,r,a,c){var p=(a&335544064)===a;if(r.subtreeFlags&(p?10262:10256))for(r=r.child;r!==null;)L1(n,r,a,c),r=r.sibling;else p&&R1(r)}function L1(n,r,a,c){var p=(a&335544064)===a;p&&r.alternate===null&&r.return!==null&&r.return.alternate!==null&&xf(r);var y=r.flags;switch(r.tag){case 0:case 11:case 15:ks(n,r,a,c),y&2048&&Yc(9,r);break;case 1:ks(n,r,a,c);break;case 3:ks(n,r,a,c),p&&Xm&&(n=n.containerInfo,n=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,n.style.viewTransitionName==="root"&&(n.style.viewTransitionName=""),n=n.ownerDocument.documentElement,n!==null&&n.style.viewTransitionName==="none"&&(n.style.viewTransitionName="")),y&2048&&(y=null,r.alternate!==null&&(y=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==y&&(r.refCount++,y!=null&&jc(y)));break;case 12:if(y&2048){ks(n,r,a,c),y=r.stateNode;try{var T=r.memoizedProps,P=T.id,Z=T.onPostCommit;typeof Z=="function"&&Z(P,r.alternate===null?"mount":"update",y.passiveEffectDuration,-0)}catch(ae){yn(r,r.return,ae)}}else ks(n,r,a,c);break;case 31:ks(n,r,a,c);break;case 13:ks(n,r,a,c);break;case 23:break;case 22:T=r.stateNode,P=r.alternate,r.memoizedState!==null?(p&&P!==null&&P.memoizedState===null&&xf(P),T._visibility&2?ks(n,r,a,c):Qc(n,r)):(p&&P!==null&&P.memoizedState!==null&&xf(r),T._visibility&2?ks(n,r,a,c):(T._visibility|=2,pl(n,r,a,c,(r.subtreeFlags&10256)!==0||!1))),y&2048&&Wm(P,r);break;case 24:ks(n,r,a,c),y&2048&&e0(r.alternate,r);break;case 30:p&&(y=r.alternate,y!==null&&(ii(y.child,!0),ii(r.child,!0))),ks(n,r,a,c);break;default:ks(n,r,a,c)}}function pl(n,r,a,c,p){for(p=p&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var y=n,T=r,P=a,Z=c,ae=T.flags;switch(T.tag){case 0:case 11:case 15:pl(y,T,P,Z,p),Yc(8,T);break;case 23:break;case 22:var pe=T.stateNode;T.memoizedState!==null?pe._visibility&2?pl(y,T,P,Z,p):Qc(y,T):(pe._visibility|=2,pl(y,T,P,Z,p)),p&&ae&2048&&Wm(T.alternate,T);break;case 24:pl(y,T,P,Z,p),p&&ae&2048&&e0(T.alternate,T);break;default:pl(y,T,P,Z,p)}r=r.sibling}}function Qc(n,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=n,c=r,p=c.flags;switch(c.tag){case 22:Qc(a,c),p&2048&&Wm(c.alternate,c);break;case 24:Qc(a,c),p&2048&&e0(c.alternate,c);break;default:Qc(a,c)}r=r.sibling}}var bo=8192;function xo(n,r,a){if(n.subtreeFlags&bo)for(n=n.child;n!==null;)z1(n,r,a),n=n.sibling}function z1(n,r,a){switch(n.tag){case 26:xo(n,r,a),n.flags&bo&&(n.memoizedState!==null?aj(a,Fs,n.memoizedState,n.memoizedProps):(n=n.stateNode,(r&335544128)===r&&KS(a,n)));break;case 5:xo(n,r,a),n.flags&bo&&(n=n.stateNode,(r&335544128)===r&&KS(a,n));break;case 3:case 4:var c=Fs;Fs=ru(n.stateNode.containerInfo),xo(n,r,a),Fs=c;break;case 22:n.memoizedState===null&&(c=n.alternate,c!==null&&c.memoizedState!==null?(c=bo,bo=16777216,xo(n,r,a),bo=c):xo(n,r,a));break;case 30:if((n.flags&bo)!==0&&(c=n.memoizedProps.name,c!=null&&c!=="auto")){var p=n.stateNode;p.paired=null,us===null&&(us=new Map),us.set(c,p)}xo(n,r,a);break;default:xo(n,r,a)}}function _1(n){var r=n.alternate;if(r!==null&&(n=r.child,n!==null)){r.child=null;do r=n.sibling,n.sibling=null,n=r;while(n!==null)}}function Xc(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var c=r[a];ur=c,H1(c,n)}_1(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)U1(n),n=n.sibling}function U1(n){switch(n.tag){case 0:case 11:case 15:Xc(n),n.flags&2048&&xa(9,n,n.return);break;case 3:Xc(n);break;case 12:Xc(n);break;case 22:var r=n.stateNode;n.memoizedState!==null&&r._visibility&2&&(n.return===null||n.return.tag!==13)?(r._visibility&=-3,Rf(n)):Xc(n);break;default:Xc(n)}}function Rf(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var c=r[a];ur=c,H1(c,n)}_1(n)}for(n=n.child;n!==null;){switch(r=n,r.tag){case 0:case 11:case 15:xa(8,r,r.return),Rf(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,Rf(r));break;default:Rf(r)}n=n.sibling}}function H1(n,r){for(;ur!==null;){var a=ur;switch(a.tag){case 0:case 11:case 15:xa(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var c=a.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:jc(a.memoizedState.cache)}if(c=a.child,c!==null)c.return=a,ur=c;else e:for(a=n;ur!==null;){c=ur;var p=c.sibling,y=c.return;if(A1(c),c===a){ur=null;break e}if(p!==null){p.return=y,ur=p;break e}ur=y}}}var tD={getCacheForType:function(n){var r=vr(Qn),a=r.data.get(n);return a===void 0&&(a=n(),r.data.set(n,a)),a},cacheSignal:function(){return vr(Qn).controller.signal}},nD=typeof WeakMap=="function"?WeakMap:Map,cn=0,kn=null,Gt=null,Jt=0,mn=0,ds=null,wa=!1,gl=!1,t0=!1,Fi=0,Vn=0,Ea=0,So=0,Cf=0,fs=0,ml=0,Zc=null,Qr=null,n0=!1,Tf=0,F1=0,kf=1/0,Of=null,Ra=null,_n=0,Vs=null,wo=null,ci=0,r0=0,s0=null,B1=null,yl=null,vl=null,bl=null,Jc=0,Af=null;function hs(){return(cn&2)!==0&&Jt!==0?Jt&-Jt:ge.T!==null?p0():Tn()}function V1(){if(fs===0)if((Jt&536870912)===0||Vt){var n=ye;ye<<=1,(ye&3932160)===0&&(ye=262144),fs=n}else fs=536870912;return n=br.current,n!==null&&(n.flags|=32),fs}function xl(n,r){if(r!=null){var a=n.stateNode,c=a.ref;c===null&&(c=a.ref=ES(Ni(n.memoizedProps,a))),vl===null&&(vl=[]),vl.push(r.bind(null,c))}}function Xr(n,r,a){(n===kn&&(mn===2||mn===9)||n.cancelPendingCommit!==null)&&(Sl(n,0),Ca(n,Jt,fs,!1)),ft(n,a),((cn&2)===0||n!==kn)&&(n===kn&&((cn&2)===0&&(So|=a),Vn===4&&Ca(n,Jt,fs,!1)),ui(n))}function K1(n,r,a){if((cn&6)!==0)throw Error(i(327));var c=!a&&(r&127)===0&&(r&n.expiredLanes)===0||Xe(n,r),p=c?iD(n,r):a0(n,r,!0),y=c;do{if(p===0){gl&&!c&&Ca(n,r,0,!1);break}else{if(a=n.current.alternate,y&&!rD(a)){p=a0(n,r,!1),y=!1;continue}if(p===2){if(y=r,n.errorRecoveryDisabledLanes&y)var T=0;else T=n.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){r=T;e:{var P=n;p=Zc;var Z=P.current.memoizedState.isDehydrated;if(Z&&(Sl(P,T).flags|=256),T=a0(P,T,!1),T!==2&&T!==6){if(t0&&!Z){P.errorRecoveryDisabledLanes|=y,So|=y,p=4;break e}y=Qr,Qr=p,y!==null&&(Qr===null?Qr=y:Qr.push.apply(Qr,y))}p=T}if(y=!1,p!==2)continue}}if(p===1){Sl(n,0),Ca(n,r,0,!0);break}e:{switch(c=n,y=p,y){case 0:case 1:throw Error(i(345));case 4:if((r&4194048)!==r&&(r&62914560)!==r)break;case 6:Ca(c,r,fs,!wa);break e;case 2:Qr=null;break;case 3:case 5:break;default:throw Error(i(329))}if((r&62914560)===r&&(p=Tf+300-wt(),10<p)){if(Ca(c,r,fs,!wa),Ke(c,0,!0)!==0)break e;ci=r,c.timeoutHandle=C0(q1.bind(null,c,a,Qr,Of,n0,r,fs,So,ml,wa,y,"Throttled",-0,0),p);break e}q1(c,a,Qr,Of,n0,r,fs,So,ml,wa,y,null,-0,0)}}break}while(!0);ui(n)}function q1(n,r,a,c,p,y,T,P,Z,ae,pe,Ce,se,fe){n.timeoutHandle=-1;var Ye=r.subtreeFlags,st=(y&335544064)===y;if(Ce=null,(st||Ye&8192||(Ye&16785408)===16785408)&&(Ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Pr},us=null,z1(r,y,Ce),st&&(Ye=Ce,st=n.containerInfo,st=(st.nodeType===9?st:st.ownerDocument).__reactViewTransition,st!=null&&(Ye.count++,Ye.waitingForViewTransition=!0,Ye=au.bind(Ye),st.finished.then(Ye,Ye))),Ye=(y&62914560)===y?Tf-wt():(y&4194048)===y?F1-wt():0,Ye=oj(Ce,Ye),Ye!==null)){ci=y,n.cancelPendingCommit=Ye(W1.bind(null,n,r,y,a,c,p,T,P,Z,ae,pe,Ce,null,se,fe)),Ca(n,y,T,!ae);return}W1(n,r,y,a,c,p,T,P,Z,ae,pe,Ce)}function rD(n){for(var r=n;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var c=0;c<a.length;c++){var p=a[c],y=p.getSnapshot;p=p.value;try{if(!ls(y(),p))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Ca(n,r,a,c){r=Qe(n,r),r&=~Cf,r&=~So,n.suspendedLanes|=r,n.pingedLanes&=~r,c&&(n.warmLanes|=r),c=n.expirationTimes;for(var p=r;0<p;){var y=31-et(p),T=1<<y;c[y]=-1,p&=~T}a!==0&&Ft(n,a,r)}function Mf(){return(cn&6)===0?(Wc(0),!1):!0}function i0(){if(Gt!==null){if(mn===0)var n=Gt.return;else n=Gt,Pi=lo=null,hm(n),ol=null,Lc=0,n=Gt;for(;n!==null;)p1(n.alternate,n),n=n.return;Gt=null}}function Sl(n,r){var a=n.timeoutHandle;return a!==-1&&(n.timeoutHandle=-1,kD(a)),a=n.cancelPendingCommit,a!==null&&(n.cancelPendingCommit=null,a()),ci=0,i0(),kn=n,Gt=a=ji(n.current,null),Jt=r,mn=0,ds=null,wa=!1,gl=Xe(n,r),t0=!1,ml=fs=Cf=So=Ea=Vn=0,Qr=Zc=null,n0=!1,Fi=Qe(n,r),zd(),a}function Y1(n,r){It=null,ge.H=cf,r===al||r===$d?(r=Wx(),mn=3):r===em?(r=Wx(),mn=4):mn=r===Om?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,ds=r,Gt===null&&(Vn=1,uf(n,Es(r,n.current)))}function G1(){var n=br.current;return n===null?!0:(Jt&4194048)===Jt?Tr===null:(Jt&62914560)===Jt||(Jt&536870912)!==0?n===Tr:!1}function $1(){var n=ge.H;return ge.H=cf,n===null?cf:n}function Q1(){var n=ge.A;return ge.A=tD,n}function Nf(){Vn=4,wa||(Jt&4194048)!==Jt&&br.current!==null||(gl=!0),(Ea&134217727)===0&&(So&134217727)===0||kn===null||Ca(kn,Jt,fs,!1)}function a0(n,r,a){var c=cn;cn|=2;var p=$1(),y=Q1();(kn!==n||Jt!==r)&&(Of=null,Sl(n,r)),r=!1;var T=Vn;e:do try{if(mn!==0&&Gt!==null){var P=Gt,Z=ds;switch(mn){case 8:i0(),T=6;break e;case 3:case 2:case 9:case 6:br.current===null&&(r=!0);var ae=mn;if(mn=0,ds=null,wl(n,P,Z,ae),a&&gl){T=0;break e}break;default:ae=mn,mn=0,ds=null,wl(n,P,Z,ae)}}sD(),T=Vn;break}catch(pe){Y1(n,pe)}while(!0);return r&&n.shellSuspendCounter++,Pi=lo=null,cn=c,ge.H=p,ge.A=y,Gt===null&&(kn=null,Jt=0,zd()),T}function sD(){for(;Gt!==null;)X1(Gt)}function iD(n,r){var a=cn;cn|=2;var c=$1(),p=Q1();kn!==n||Jt!==r?(Of=null,kf=wt()+500,Sl(n,r)):gl=Xe(n,r);e:do try{if(mn!==0&&Gt!==null){r=Gt;var y=ds;t:switch(mn){case 1:mn=0,ds=null,wl(n,r,y,1);break;case 2:case 9:if(Zx(y)){mn=0,ds=null,Z1(r);break}r=function(){mn!==2&&mn!==9||kn!==n||(mn=7),ui(n)},y.then(r,r);break e;case 3:mn=7;break e;case 4:mn=5;break e;case 7:Zx(y)?(mn=0,ds=null,Z1(r)):(mn=0,ds=null,wl(n,r,y,7));break;case 5:var T=null;switch(Gt.tag){case 26:T=Gt.memoizedState;case 5:case 27:var P=Gt;if(T?BS(T):P.stateNode.complete){mn=0,ds=null;var Z=P.sibling;if(Z!==null)Gt=Z;else{var ae=P.return;ae!==null?(Gt=ae,Df(ae)):Gt=null}break t}}mn=0,ds=null,wl(n,r,y,5);break;case 6:mn=0,ds=null,wl(n,r,y,6);break;case 8:i0(),Vn=6;break e;default:throw Error(i(462))}}aD();break}catch(pe){Y1(n,pe)}while(!0);return Pi=lo=null,ge.H=c,ge.A=p,cn=a,Gt!==null?0:(kn=null,Jt=0,zd(),Vn)}function aD(){for(;Gt!==null&&!nn();)X1(Gt)}function X1(n){var r=f1(n.alternate,n,Fi);n.memoizedProps=n.pendingProps,r===null?Df(n):Gt=r}function Z1(n){var r=n,a=r.alternate;switch(r.tag){case 15:case 0:r=i1(a,r,r.pendingProps,r.type,void 0,Jt);break;case 11:r=i1(a,r,r.pendingProps,r.type.render,r.ref,Jt);break;case 5:hm(r);var c=r;c===lr&&(Vt?(Vd(c),c.tag===5&&c.stateNode!=null&&(Mn=c.stateNode)):(Vd(c),Vt=!0));default:p1(a,r),r=Gt=Hx(r,Fi),r=f1(a,r,Fi)}n.memoizedProps=n.pendingProps,r===null?Df(n):Gt=r}function wl(n,r,a,c){Pi=lo=null,hm(r),ol=null,Lc=0;var p=r.return;try{if(GN(n,p,r,a,Jt)){Vn=1,uf(n,Es(a,n.current)),Gt=null;return}}catch(y){if(p!==null)throw Gt=p,y;Vn=1,uf(n,Es(a,n.current)),Gt=null;return}r.flags&32768?(Vt||c===1?n=!0:gl||(Jt&536870912)!==0?n=!1:(wa=n=!0,(c===2||c===9||c===3||c===6)&&(c=br.current,c!==null&&c.tag===13&&(c.flags|=16384))),J1(r,n)):Df(r)}function Df(n){var r=n;do{if((r.flags&32768)!==0){J1(r,wa);return}n=r.return;var a=ZN(r.alternate,r,Fi);if(a!==null){Gt=a;return}if(r=r.sibling,r!==null){Gt=r;return}Gt=r=n}while(r!==null);Vn===0&&(Vn=5)}function J1(n,r){do{var a=JN(n.alternate,n);if(a!==null){a.flags&=32767,Gt=a;return}if(a=n.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(n=n.sibling,n!==null)){Gt=n;return}Gt=n=a}while(n!==null);Vn=6,Gt=null}function W1(n,r,a,c,p,y,T,P,Z,ae,pe,Ce){n.cancelPendingCommit=null;do jf();while(_n!==0);if((cn&6)!==0)throw Error(i(327));if(r!==null){if(r===n.current)throw Error(i(177));n===kn&&(Gt=kn=null,Jt=0),wo=r,Vs=n,ci=a,s0=p,B1=c,oD(n,r,a,T,P,Z,Ce)}}function oD(n,r,a,c,p,y,T){var P=r.lanes|r.childLanes;if(r0=P,P|=Fg,qt(n,a,P,c,p,y),vl=null,(a&335544064)===a?(bl=PN(n),c=10262):(bl=null,c=10256),(r.subtreeFlags&c)!==0||(r.flags&c)!==0?(n.callbackNode=null,n.callbackPriority=0,hD(yt,function(){return u0(),null})):(n.callbackNode=null,n.callbackPriority=0),vf=!1,c=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||c){c=ge.T,ge.T=null,p=ue.p,ue.p=2,y=cn,cn|=4;try{WN(n,r,a)}finally{cn=y,ue.p=p,ge.T=c}}_n=1,vf?yl=jD(T,n.containerInfo,bl,o0,l0,cD,c0,u0,lD):(o0(),l0(),c0())}function lD(n){if(_n!==0){var r=Vs.onRecoverableError;r(n,{componentStack:null})}}function cD(){_n===3&&(_n=0,P1(wo,Vs),_n=4)}function o0(){if(_n===1){_n=0;var n=Vs,r=wo,a=ci,c=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||c){c=ge.T,ge.T=null;var p=ue.p;ue.p=2;var y=cn;cn|=4;try{$c=Sf=!1,j1(r,n,a),a=w0;var T=Mx(n.containerInfo),P=a.focusedElem,Z=a.selectionRange;if(T!==P&&P&&P.ownerDocument&&Ax(P.ownerDocument.documentElement,P)){if(Z!==null&&Lg(P)){var ae=Z.start,pe=Z.end;if(pe===void 0&&(pe=ae),"selectionStart"in P)P.selectionStart=ae,P.selectionEnd=Math.min(pe,P.value.length);else{var Ce=P.ownerDocument||document,se=Ce&&Ce.defaultView||window;if(se.getSelection){var fe=se.getSelection(),Ye=P.textContent.length,st=Math.min(Z.start,Ye),Pt=Z.end===void 0?st:Math.min(Z.end,Ye);!fe.extend&&st>Pt&&(T=Pt,Pt=st,st=T);var ie=Ox(P,st),te=Ox(P,Pt);if(ie&&te&&(fe.rangeCount!==1||fe.anchorNode!==ie.node||fe.anchorOffset!==ie.offset||fe.focusNode!==te.node||fe.focusOffset!==te.offset)){var ce=Ce.createRange();ce.setStart(ie.node,ie.offset),fe.removeAllRanges(),st>Pt?(fe.addRange(ce),fe.extend(te.node,te.offset)):(ce.setEnd(te.node,te.offset),fe.addRange(ce))}}}}for(Ce=[],fe=P;fe=fe.parentNode;)fe.nodeType===1&&Ce.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<Ce.length;P++){var Re=Ce[P];Re.element.scrollLeft=Re.left,Re.element.scrollTop=Re.top}}Ml=!!S0,w0=S0=null}finally{cn=y,ue.p=p,ge.T=c}}n.current=r,_n=2}}function l0(){if(_n===2){_n=0;var n=Vs,r=wo,a=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||a){a=ge.T,ge.T=null;var c=ue.p;ue.p=2;var p=cn;cn|=4;try{k1(n,r.alternate,r)}finally{cn=p,ue.p=c,ge.T=a}}_n=3}}function c0(){if(_n===4||_n===3){_n=0;var n=yl;yl=null,We();var r=Vs,a=wo,c=ci,p=B1,y=(c&335544064)===c?10262:10256;if((a.subtreeFlags&y)!==0||(a.flags&y)!==0?_n=5:(_n=0,wo=Vs=null,eS(r,r.pendingLanes)),y=r.pendingLanes,y===0&&(Ra=null),Cn(c),a=a.stateNode,ze&&typeof ze.onCommitFiberRoot=="function")try{ze.onCommitFiberRoot(Ie,a,void 0,(a.current.flags&128)===128)}catch{}if(p!==null){a=ge.T,y=ue.p,ue.p=2,ge.T=null;try{for(var T=r.onRecoverableError,P=0;P<p.length;P++){var Z=p[P];T(Z.value,{componentStack:Z.stack})}}finally{ge.T=a,ue.p=y}}if(p=vl,T=bl,bl=null,p!==null&&(vl=null,T===null&&(T=[]),n!==null))for(Z=0;Z<p.length;Z++)a=(0,p[Z])(T),a!==void 0&&n.finished.finally(a);(ci&3)!==0&&jf(),ui(r),y=r.pendingLanes,(c&261930)!==0&&(y&42)!==0?r===Af?Jc++:(Jc=0,Af=r):(Jc=0,Af=null),Wc(0)}}function eS(n,r){(n.pooledCacheLanes&=r)===0&&(r=n.pooledCache,r!=null&&(n.pooledCache=null,jc(r)))}function jf(){return yl!==null&&(yl.skipTransition(),yl=null),o0(),l0(),c0(),u0()}function u0(){if(_n!==5)return!1;var n=Vs,r=r0;r0=0;var a=Cn(ci),c=ge.T,p=ue.p;try{ue.p=32>a?32:a,ge.T=null,a=s0,s0=null;var y=Vs,T=ci;if(_n=0,wo=Vs=null,ci=0,(cn&6)!==0)throw Error(i(331));var P=cn;if(cn|=4,U1(y.current),L1(y,y.current,T,a),cn=P,Wc(0,!1),ze&&typeof ze.onPostCommitFiberRoot=="function")try{ze.onPostCommitFiberRoot(Ie,y)}catch{}return!0}finally{ue.p=p,ge.T=c,eS(n,r)}}function tS(n,r,a){r=Es(a,r),r=km(n.stateNode,r,2),n=ma(n,r,2),n!==null&&(ft(n,2),ui(n))}function yn(n,r,a){if(n.tag===3)tS(n,n,a);else for(;r!==null;){if(r.tag===3){tS(r,n,a);break}else if(r.tag===1){var c=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Ra===null||!Ra.has(c))){n=Es(a,n),a=Z2(2),c=ma(r,a,2),c!==null&&(J2(a,c,r,n),ft(c,2),ui(c));break}}r=r.return}}function d0(n,r,a){var c=n.pingCache;if(c===null){c=n.pingCache=new nD;var p=new Set;c.set(r,p)}else p=c.get(r),p===void 0&&(p=new Set,c.set(r,p));p.has(a)||(t0=!0,p.add(a),n=uD.bind(null,n,r,a),r.then(n,n))}function uD(n,r,a){var c=n.pingCache;c!==null&&c.delete(r),n.pingedLanes|=n.suspendedLanes&a,n.warmLanes&=~a,kn===n&&(Jt&a)===a&&((Vn===4||Vn===3&&(Jt&62914560)===Jt&&300>wt()-Tf)&&(cn&2)===0?Sl(n,0):Cf|=a,ml===Jt&&(ml=0)),ui(n)}function nS(n,r){r===0&&(r=tt()),n=io(n,r),n!==null&&(ft(n,r),ui(n))}function dD(n){var r=n.memoizedState,a=0;r!==null&&(a=r.retryLane),nS(n,a)}function fD(n,r){var a=0;switch(n.tag){case 31:case 13:var c=n.stateNode,p=n.memoizedState;p!==null&&(a=p.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error(i(314))}c!==null&&c.delete(r),nS(n,a)}function hD(n,r){return tn(n,r)}var El=null,Rl=null,f0=!1,If=!1,h0=!1,Ta=0;function ui(n){n!==Rl&&n.next===null&&(Rl===null?El=Rl=n:Rl=Rl.next=n),If=!0,f0||(f0=!0,gD())}function Wc(n,r){if(!h0&&If){h0=!0;do for(var a=!1,c=El;c!==null;){if(n!==0){var p=c.pendingLanes;if(p===0)var y=0;else{var T=c.suspendedLanes,P=c.pingedLanes;y=(1<<31-et(42|n)+1)-1,y&=p&~(T&~P),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(a=!0,aS(c,y))}else y=Jt,y=Ke(c,c===kn?y:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(y&3)===0||Xe(c,y)||(a=!0,aS(c,y));c=c.next}while(a);h0=!1}}function pD(){rS()}function rS(){If=f0=!1;var n=0;Ta!==0&&TD()&&(n=Ta);for(var r=wt(),a=null,c=El;c!==null;){var p=c.next,y=sS(c,r);y===0?(c.next=null,a===null?El=p:a.next=p,p===null&&(Rl=a)):(a=c,(n!==0||(y&3)!==0)&&(If=!0)),c=p}_n!==0&&_n!==5||Wc(n),Ta!==0&&(Ta=0)}function sS(n,r){for(var a=n.suspendedLanes,c=n.pingedLanes,p=n.expirationTimes,y=n.pendingLanes&-62914561;0<y;){var T=31-et(y),P=1<<T,Z=p[T];Z===-1?((P&a)===0||(P&c)!==0)&&(p[T]=lt(P,r)):Z<=r&&(n.expiredLanes|=P),y&=~P}if(r=kn,a=Jt,a=Ke(n,n===r?a:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c=n.callbackNode,a===0||n===r&&(mn===2||mn===9)||n.cancelPendingCommit!==null)return c!==null&&c!==null&&an(c),n.callbackNode=null,n.callbackPriority=0;if((a&3)===0||Xe(n,a)){if(r=a&-a,r===n.callbackPriority)return r;switch(c!==null&&an(c),Cn(a)){case 2:case 8:a=xt;break;case 32:a=yt;break;case 268435456:a=un;break;default:a=yt}return c=iS.bind(null,n),a=tn(a,c),n.callbackPriority=r,n.callbackNode=a,r}return c!==null&&c!==null&&an(c),n.callbackPriority=2,n.callbackNode=null,2}function iS(n,r){if(_n!==0&&_n!==5)return n.callbackNode=null,n.callbackPriority=0,null;var a=n.callbackNode;if(jf()&&n.callbackNode!==a)return null;var c=Jt;return c=Ke(n,n===kn?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c===0?null:(K1(n,c,r),sS(n,wt()),n.callbackNode!=null&&n.callbackNode===a?iS.bind(null,n):null)}function aS(n,r){if(jf())return null;K1(n,r,!0)}function gD(){OD(function(){(cn&6)!==0?tn(ht,pD):rS()})}function p0(){if(Ta===0){var n=fo;n===0&&(n=ne,ne<<=1,(ne&261888)===0&&(ne=256)),Ta=n}return Ta}function oS(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:mr(n)}function mD(n,r,a,c,p){if(r==="submit"&&a&&a.stateNode===p){var y=oS((p[An]||null).action),T=c.submitter;T&&(r=(r=T[An]||null)?oS(r.formAction):T.getAttribute("formAction"),r!==null&&(y=r,T=null));var P=new jd("action","action",null,c,p);n.push({event:P,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Ta!==0){var Z=new FormData(p,T);wm(a,{pending:!0,data:Z,method:p.method,action:y},null,Z)}}else typeof y=="function"&&(P.preventDefault(),Z=new FormData(p,T),wm(a,{pending:!0,data:Z,method:p.method,action:y},y,Z))},currentTarget:p}]})}}for(var g0=0;g0<Hg.length;g0++){var m0=Hg[g0],yD=m0.toLowerCase(),vD=m0[0].toUpperCase()+m0.slice(1);Us(yD,"on"+vD)}Us(jx,"onAnimationEnd"),Us(Ix,"onAnimationIteration"),Us(Px,"onAnimationStart"),Us("dblclick","onDoubleClick"),Us("focusin","onFocus"),Us("focusout","onBlur"),Us(kN,"onTransitionRun"),Us(ON,"onTransitionStart"),Us(AN,"onTransitionCancel"),Us(Lx,"onTransitionEnd"),xn("onMouseEnter",["mouseout","mouseover"]),xn("onMouseLeave",["mouseout","mouseover"]),xn("onPointerEnter",["pointerout","pointerover"]),xn("onPointerLeave",["pointerout","pointerover"]),Ht("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ht("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ht("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ht("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ht("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ht("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var eu="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(" "),bD=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(eu));function lS(n,r){r=(r&4)!==0;for(var a=0;a<n.length;a++){var c=n[a],p=c.event;c=c.listeners;e:{var y=void 0;if(r)for(var T=c.length-1;0<=T;T--){var P=c[T],Z=P.instance,ae=P.currentTarget;if(P=P.listener,Z!==y&&p.isPropagationStopped())break e;y=P,p.currentTarget=ae;try{y(p)}catch(pe){Ld(pe)}p.currentTarget=null,y=Z}else for(T=0;T<c.length;T++){if(P=c[T],Z=P.instance,ae=P.currentTarget,P=P.listener,Z!==y&&p.isPropagationStopped())break e;y=P,p.currentTarget=ae;try{y(p)}catch(pe){Ld(pe)}p.currentTarget=null,y=Z}}}}function $t(n,r){var a=r[Oi];a===void 0&&(a=r[Oi]=new Set);var c=n+"__bubble";a.has(c)||(cS(r,n,2,!1),a.add(c))}function y0(n,r,a){var c=0;r&&(c|=4),cS(a,n,c,r)}var Pf="_reactListening"+Math.random().toString(36).slice(2);function v0(n){if(!n[Pf]){n[Pf]=!0,Ot.forEach(function(a){a!=="selectionchange"&&(bD.has(a)||y0(a,!1,n),y0(a,!0,n))});var r=n.nodeType===9?n:n.ownerDocument;r===null||r[Pf]||(r[Pf]=!0,y0("selectionchange",!1,r))}}function cS(n,r,a,c){switch(JS(r)){case 2:var p=dj;break;case 8:p=fj;break;default:p=_0}a=p.bind(null,r,a,n),p=void 0,!no||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),c?p!==void 0?n.addEventListener(r,a,{capture:!0,passive:p}):n.addEventListener(r,a,!0):p!==void 0?n.addEventListener(r,a,{passive:p}):n.addEventListener(r,a,!1)}function b0(n,r,a,c,p){var y=c;if((r&1)===0&&(r&2)===0&&c!==null)e:for(;;){if(c===null)return;var T=c.tag;if(T===3||T===4){var P=c.stateNode.containerInfo;if(P===p)break;if(T===4)for(T=c.return;T!==null;){var Z=T.tag;if((Z===3||Z===4)&&T.stateNode.containerInfo===p)return;T=T.return}for(;P!==null;){if(T=Fn(P),T===null)return;if(Z=T.tag,Z===5||Z===6||Z===26||Z===27){c=y=T;continue e}P=P.parentNode}}c=c.return}to(function(){var ae=y,pe=eo(a),Ce=[];e:{var se=zx.get(n);if(se!==void 0){var fe=jd,Ye=n;switch(n){case"keypress":if(Nd(a)===0)break e;case"keydown":case"keyup":fe=rN;break;case"focusin":Ye="focus",fe=Mg;break;case"focusout":Ye="blur",fe=Mg;break;case"beforeblur":case"afterblur":fe=Mg;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=fx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=qM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=lN;break;case jx:case Ix:case Px:fe=$M;break;case Lx:fe=uN;break;case"scroll":case"scrollend":fe=VM;break;case"wheel":fe=fN;break;case"copy":case"cut":case"paste":fe=XM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=px;break;case"submit":fe=aN;break;case"toggle":case"beforetoggle":fe=pN}var st=(r&4)!==0,Pt=!st&&(n==="scroll"||n==="scrollend"),ie=st?se!==null?se+"Capture":null:se;st=[];for(var te=ae,ce;te!==null;){var Re=te;if(ce=Re.stateNode,Re=Re.tag,Re!==5&&Re!==26&&Re!==27||ce===null||ie===null||(Re=Mi(te,ie),Re!=null&&st.push(tu(te,Re,ce))),Pt)break;te=te.return}0<st.length&&(se=new fe(se,Ye,null,a,pe),Ce.push({event:se,listeners:st}))}}if((r&7)===0){e:{if(fe=n==="mouseover"||n==="pointerover",se=n==="mouseout"||n==="pointerout",fe&&a!==Wa&&(Ye=a.relatedTarget||a.fromElement)&&(Fn(Ye)||Ye[jn]))break e;(se||fe)&&(Ye=pe.window===pe?pe:(fe=pe.ownerDocument)?fe.defaultView||fe.parentWindow:window,se?(fe=a.relatedTarget||a.toElement,se=ae,fe=fe?Fn(fe):null,fe!==null&&(Pt=l(fe),st=fe.tag,fe!==Pt||st!==5&&st!==27&&st!==6)&&(fe=null)):(se=null,fe=ae),se!==fe&&(st=fx,Re="onMouseLeave",ie="onMouseEnter",te="mouse",(n==="pointerout"||n==="pointerover")&&(st=px,Re="onPointerLeave",ie="onPointerEnter",te="pointer"),Pt=se==null?Ye:he(se),ce=fe==null?Ye:he(fe),Ye=new st(Re,te+"leave",se,a,pe),Ye.target=Pt,Ye.relatedTarget=ce,Re=null,Fn(pe)===ae&&(st=new st(ie,te+"enter",fe,a,pe),st.target=ce,st.relatedTarget=Pt,Re=st),Pt=Re,st=se&&fe?j(se,fe,xD):null,se!==null&&uS(Ce,Ye,se,st,!1),fe!==null&&Pt!==null&&uS(Ce,Pt,fe,st,!0)))}e:{if(se=ae?he(ae):window,fe=se.nodeName&&se.nodeName.toLowerCase(),fe==="select"||fe==="input"&&se.type==="file")var Je=wx;else if(xx(se))if(Ex)Je=RN;else{Je=wN;var Wt=SN}else fe=se.nodeName,!fe||fe.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?ae&&Ja(ae.elementType)&&(Je=wx):Je=EN;if(Je&&(Je=Je(n,ae))){Sx(Ce,Je,a,pe);break e}Wt&&Wt(n,se,ae)}switch(Wt=ae?he(ae):window,n){case"focusin":(xx(Wt)||Wt.contentEditable==="true")&&(Jo=Wt,zg=ae,Mc=null);break;case"focusout":Mc=zg=Jo=null;break;case"mousedown":_g=!0;break;case"contextmenu":case"mouseup":case"dragend":_g=!1,Nx(Ce,a,pe);break;case"selectionchange":if(TN)break;case"keydown":case"keyup":Nx(Ce,a,pe)}var ct;if(Dg)e:{switch(n){case"compositionstart":var St="onCompositionStart";break e;case"compositionend":St="onCompositionEnd";break e;case"compositionupdate":St="onCompositionUpdate";break e}St=void 0}else Zo?vx(n,a)&&(St="onCompositionEnd"):n==="keydown"&&a.keyCode===229&&(St="onCompositionStart");St&&(gx&&a.locale!=="ko"&&(Zo||St!=="onCompositionStart"?St==="onCompositionEnd"&&Zo&&(ct=ux()):(oa=pe,kg="value"in oa?oa.value:oa.textContent,Zo=!0)),Wt=Lf(ae,St),0<Wt.length&&(St=new hx(St,n,null,a,pe),Ce.push({event:St,listeners:Wt}),ct?St.data=ct:(ct=bx(a),ct!==null&&(St.data=ct)))),(ct=mN?yN(n,a):vN(n,a))&&(St=Lf(ae,"onBeforeInput"),0<St.length&&(Wt=new hx("onBeforeInput","beforeinput",null,a,pe),Ce.push({event:Wt,listeners:St}),Wt.data=ct)),mD(Ce,n,ae,a,pe)}lS(Ce,r)})}function tu(n,r,a){return{instance:n,listener:r,currentTarget:a}}function Lf(n,r){for(var a=r+"Capture",c=[];n!==null;){var p=n,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=Mi(n,a),p!=null&&c.unshift(tu(n,p,y)),p=Mi(n,r),p!=null&&c.push(tu(n,p,y))),n.tag===3)return c;n=n.return}return[]}function xD(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function uS(n,r,a,c,p){for(var y=r._reactName,T=[];a!==null&&a!==c;){var P=a,Z=P.alternate,ae=P.stateNode;if(P=P.tag,Z!==null&&Z===c)break;P!==5&&P!==26&&P!==27||ae===null||(Z=ae,p?(ae=Mi(a,y),ae!=null&&T.unshift(tu(a,ae,Z))):p||(ae=Mi(a,y),ae!=null&&T.push(tu(a,ae,Z)))),a=a.return}T.length!==0&&n.push({event:r,listeners:T})}var SD=/\r\n?/g,wD=/\u0000|\uFFFD/g;function dS(n){return(typeof n=="string"?n:""+n).replace(SD,`
10
+ `).replace(wD,"")}function fS(n,r){return r=dS(r),dS(n)===r}function vn(n,r,a,c,p,y){switch(a){case"children":if(typeof c=="string")r==="body"||r==="textarea"&&c===""||Ir(n,c);else if(typeof c=="number"||typeof c=="bigint")r!=="body"&&Ir(n,""+c);else return;break;case"className":ss(n,"class",c);break;case"tabIndex":ss(n,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":ss(n,a,c);break;case"style":as(n,c,y);return;case"data":if(r!=="object"){ss(n,"data",c);break}case"src":case"href":if(c===""&&(r!=="a"||a!=="href")){n.removeAttribute(a);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(a);break}c=mr(c),n.setAttribute(a,c);break;case"action":case"formAction":if(typeof c=="function"){n.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(a==="formAction"?(r!=="input"&&vn(n,r,"name",p.name,p,null),vn(n,r,"formEncType",p.formEncType,p,null),vn(n,r,"formMethod",p.formMethod,p,null),vn(n,r,"formTarget",p.formTarget,p,null)):(vn(n,r,"encType",p.encType,p,null),vn(n,r,"method",p.method,p,null),vn(n,r,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(a);break}c=mr(c),n.setAttribute(a,c);break;case"onClick":c!=null&&(n.onclick=Pr);return;case"onScroll":c!=null&&$t("scroll",n);return;case"onScrollEnd":c!=null&&$t("scrollend",n);return;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(a=c.__html,a!=null){if(p.children!=null)throw Error(i(60));y?.__html!==a&&(n.innerHTML=a)}}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}a=mr(c),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(a,c):n.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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(a,""):n.removeAttribute(a);break;case"capture":case"download":c===!0?n.setAttribute(a,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(a,c):n.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?n.setAttribute(a,c):n.removeAttribute(a);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?n.removeAttribute(a):n.setAttribute(a,c);break;case"popover":$t("beforetoggle",n),$t("toggle",n),zn(n,"popover",c);break;case"xlinkActuate":Gn(n,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":Gn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":Gn(n,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":Gn(n,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":Gn(n,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":Gn(n,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":Gn(n,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":Gn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":Gn(n,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":zn(n,"is",c);break;case"innerText":case"textContent":return;default:if(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")a=Sc.get(a)||a,zn(n,a,c);else return}mt=!0}function x0(n,r,a,c,p,y){switch(a){case"style":as(n,c,y);return;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(a=c.__html,a!=null){if(p.children!=null)throw Error(i(60));y?.__html!==a&&(n.innerHTML=a)}}break;case"children":if(typeof c=="string")Ir(n,c);else if(typeof c=="number"||typeof c=="bigint")Ir(n,""+c);else return;break;case"onScroll":c!=null&&$t("scroll",n);return;case"onScrollEnd":c!=null&&$t("scrollend",n);return;case"onClick":c!=null&&(n.onclick=Pr);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Rt.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(p=a.endsWith("Capture"),y=a.slice(2,p?a.length-7:void 0),r=n[An]||null,r=r!=null?r[a]:null,typeof r=="function"&&n.removeEventListener(y,r,p),typeof c=="function")){typeof r!="function"&&r!==null&&(a in n?n[a]=null:n.hasAttribute(a)&&n.removeAttribute(a)),n.addEventListener(y,c,p);break e}mt=!0,a in n?n[a]=c:c===!0?n.setAttribute(a,""):zn(n,a,c)}return}mt=!0}function wr(n,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":$t("error",n),$t("load",n);var c=!1,p=!1,y;for(y in a)if(a.hasOwnProperty(y)){var T=a[y];if(T!=null)switch(y){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:vn(n,r,y,T,a,null)}}p&&vn(n,r,"srcSet",a.srcSet,a,null),c&&vn(n,r,"src",a.src,a,null);return;case"input":$t("invalid",n);var P=y=T=p=null,Z=null,ae=null;for(c in a)if(a.hasOwnProperty(c)){var pe=a[c];if(pe!=null)switch(c){case"name":p=pe;break;case"type":T=pe;break;case"checked":Z=pe;break;case"defaultChecked":ae=pe;break;case"value":y=pe;break;case"defaultValue":P=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(i(137,r));break;default:vn(n,r,c,pe,a,null)}}ia(n,y,P,Z,ae,T,p,!1);return;case"select":$t("invalid",n),c=T=y=null;for(p in a)if(a.hasOwnProperty(p)&&(P=a[p],P!=null))switch(p){case"value":y=P;break;case"defaultValue":T=P;break;case"multiple":c=P;default:vn(n,r,p,P,a,null)}r=y,a=T,n.multiple=!!c,r!=null?qr(n,!!c,r,!1):a!=null&&qr(n,!!c,a,!0);return;case"textarea":$t("invalid",n),y=p=c=null;for(T in a)if(a.hasOwnProperty(T)&&(P=a[T],P!=null))switch(T){case"value":c=P;break;case"defaultValue":p=P;break;case"children":y=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(i(91));break;default:vn(n,r,T,P,a,null)}is(n,c,p,y);return;case"option":for(Z in a)a.hasOwnProperty(Z)&&(c=a[Z],c!=null)&&(Z==="selected"?n.selected=c&&typeof c!="function"&&typeof c!="symbol":vn(n,r,Z,c,a,null));return;case"dialog":$t("beforetoggle",n),$t("toggle",n),$t("cancel",n),$t("close",n);break;case"iframe":case"object":$t("load",n);break;case"video":case"audio":for(c=0;c<eu.length;c++)$t(eu[c],n);break;case"image":$t("error",n),$t("load",n);break;case"details":$t("toggle",n);break;case"embed":case"source":case"link":$t("error",n),$t("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(ae in a)if(a.hasOwnProperty(ae)&&(c=a[ae],c!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:vn(n,r,ae,c,a,null)}return;default:if(Ja(r)){for(pe in a)a.hasOwnProperty(pe)&&(c=a[pe],c!==void 0&&x0(n,r,pe,c,a,void 0));return}}for(P in a)a.hasOwnProperty(P)&&(c=a[P],c!=null&&vn(n,r,P,c,a,null))}var ED={};function RD(n,r,a,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,T=null,P=null,Z=null,ae=null,pe=null;for(fe in a){var Ce=a[fe];if(a.hasOwnProperty(fe)&&Ce!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":Z=Ce;default:c.hasOwnProperty(fe)||vn(n,r,fe,null,c,Ce)}}for(var se in c){var fe=c[se];if(Ce=a[se],c.hasOwnProperty(se)&&(fe!=null||Ce!=null))switch(se){case"type":fe!==Ce&&(mt=!0),y=fe;break;case"name":fe!==Ce&&(mt=!0),p=fe;break;case"checked":fe!==Ce&&(mt=!0),ae=fe;break;case"defaultChecked":fe!==Ce&&(mt=!0),pe=fe;break;case"value":fe!==Ce&&(mt=!0),T=fe;break;case"defaultValue":fe!==Ce&&(mt=!0),P=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(i(137,r));break;default:fe!==Ce&&vn(n,r,se,fe,c,Ce)}}Cr(n,T,P,Z,ae,pe,y,p);return;case"select":fe=T=P=se=null;for(y in a)if(Z=a[y],a.hasOwnProperty(y)&&Z!=null)switch(y){case"value":break;case"multiple":fe=Z;default:c.hasOwnProperty(y)||vn(n,r,y,null,c,Z)}for(p in c)if(y=c[p],Z=a[p],c.hasOwnProperty(p)&&(y!=null||Z!=null))switch(p){case"value":y!==Z&&(mt=!0),se=y;break;case"defaultValue":y!==Z&&(mt=!0),P=y;break;case"multiple":y!==Z&&(mt=!0),T=y;default:y!==Z&&vn(n,r,p,y,c,Z)}r=P,a=T,c=fe,se!=null?qr(n,!!a,se,!1):!!c!=!!a&&(r!=null?qr(n,!!a,r,!0):qr(n,!!a,a?[]:"",!1));return;case"textarea":fe=se=null;for(P in a)if(p=a[P],a.hasOwnProperty(P)&&p!=null&&!c.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:vn(n,r,P,null,c,p)}for(T in c)if(p=c[T],y=a[T],c.hasOwnProperty(T)&&(p!=null||y!=null))switch(T){case"value":p!==y&&(mt=!0),se=p;break;case"defaultValue":p!==y&&(mt=!0),fe=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(i(91));break;default:p!==y&&vn(n,r,T,p,c,y)}Xo(n,se,fe);return;case"option":for(var Ye in a)se=a[Ye],a.hasOwnProperty(Ye)&&se!=null&&!c.hasOwnProperty(Ye)&&(Ye==="selected"?n.selected=!1:vn(n,r,Ye,null,c,se));for(Z in c)se=c[Z],fe=a[Z],c.hasOwnProperty(Z)&&se!==fe&&(se!=null||fe!=null)&&(Z==="selected"?(se!==fe&&(mt=!0),n.selected=se&&typeof se!="function"&&typeof se!="symbol"):vn(n,r,Z,se,c,fe));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 st in a)se=a[st],a.hasOwnProperty(st)&&se!=null&&!c.hasOwnProperty(st)&&vn(n,r,st,null,c,se);for(ae in c)if(se=c[ae],fe=a[ae],c.hasOwnProperty(ae)&&se!==fe&&(se!=null||fe!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(i(137,r));break;default:vn(n,r,ae,se,c,fe)}return;default:if(Ja(r)){for(var Pt in a)se=a[Pt],a.hasOwnProperty(Pt)&&se!==void 0&&!c.hasOwnProperty(Pt)&&x0(n,r,Pt,void 0,c,se);for(pe in c)se=c[pe],fe=a[pe],!c.hasOwnProperty(pe)||se===fe||se===void 0&&fe===void 0||x0(n,r,pe,se,c,fe);return}}for(var ie in a)se=a[ie],a.hasOwnProperty(ie)&&se!=null&&!c.hasOwnProperty(ie)&&vn(n,r,ie,null,c,se);for(Ce in c)se=c[Ce],fe=a[Ce],!c.hasOwnProperty(Ce)||se===fe||se==null&&fe==null||vn(n,r,Ce,se,c,fe)}function hS(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function CD(){if(typeof performance.getEntriesByType=="function"){for(var n=0,r=0,a=performance.getEntriesByType("resource"),c=0;c<a.length;c++){var p=a[c],y=p.transferSize,T=p.initiatorType,P=p.duration;if(y&&P&&hS(T)){for(T=0,P=p.responseEnd,c+=1;c<a.length;c++){var Z=a[c],ae=Z.startTime;if(ae>P)break;var pe=Z.transferSize,Ce=Z.initiatorType;pe&&hS(Ce)&&(Z=Z.responseEnd,T+=pe*(Z<P?1:(P-ae)/(Z-ae)))}if(--c,r+=8*(y+T)/(p.duration/1e3),n++,10<n)break}}if(0<n)return r/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var S0=null,w0=null;function nu(n){return n.nodeType===9?n:n.ownerDocument}function pS(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 gS(n,r){if(n===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&r==="foreignObject"?0:n}function mS(n,r,a,c){return a=nu(a).createElement(n),a[fn]=c,a[An]=r,wr(a,n,r),Se(a),a}function E0(n,r){return n==="textarea"||n==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var R0=null;function TD(){var n=window.event;return n&&n.type==="popstate"?n===R0?!1:(R0=n,!0):(R0=null,!1)}var C0=typeof setTimeout=="function"?setTimeout:void 0,kD=typeof clearTimeout=="function"?clearTimeout:void 0,yS=typeof Promise=="function"?Promise:void 0,vS=typeof requestAnimationFrame=="function"?requestAnimationFrame:C0,OD=typeof queueMicrotask=="function"?queueMicrotask:typeof yS<"u"?function(n){return yS.resolve(null).then(n).catch(AD)}:C0;function AD(n){setTimeout(function(){throw n})}function ka(n){return n==="head"}function bS(n,r){var a=r,c=0;do{var p=a.nextSibling;if(n.removeChild(a),p&&p.nodeType===8)if(a=p.data,a==="/$"||a==="/&"){if(c===0){n.removeChild(p),Nl(r);return}c--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")c++;else if(a==="html")j0(n.ownerDocument.documentElement);else if(a==="head"){a=n.ownerDocument.head,j0(a);for(var y=a.firstChild;y;){var T=y.nextSibling,P=y.nodeName;y[xs]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&y.rel.toLowerCase()==="stylesheet"||a.removeChild(y),y=T}}else a==="body"&&j0(n.ownerDocument.body);a=p}while(a);Nl(r)}function xS(n,r){var a=n;n=0;do{var c=a.nextSibling;if(a.nodeType===1?r?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(r?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),c&&c.nodeType===8)if(a=c.data,a==="/$"){if(n===0)break;n--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||n++;a=c}while(a)}function SS(n,r,a){if(r=CSS.escape(r)!==r?"r-"+btoa(r).replace(/=/g,""):r,n.style.viewTransitionName=r,a!=null&&(n.style.viewTransitionClass=a),a=getComputedStyle(n),a.display==="inline"){if(r=n.getClientRects(),r.length===1)var c=1;else for(var p=c=0;p<r.length;p++){var y=r[p];0<y.width&&0<y.height&&c++}c===1&&(n=n.style,n.display=r.length===1?"inline-block":"block",n.marginTop="-"+a.paddingTop,n.marginBottom="-"+a.paddingBottom)}}function wS(n,r){n=n.style,r=r.style;var a=r!=null?r.hasOwnProperty("viewTransitionName")?r.viewTransitionName:r.hasOwnProperty("view-transition-name")?r["view-transition-name"]:null:null;n.viewTransitionName=a==null||typeof a=="boolean"?"":(""+a).trim(),a=r!=null?r.hasOwnProperty("viewTransitionClass")?r.viewTransitionClass:r.hasOwnProperty("view-transition-class")?r["view-transition-class"]:null:null,n.viewTransitionClass=a==null||typeof a=="boolean"?"":(""+a).trim(),n.display==="inline-block"&&(r==null?n.display=n.margin="":(a=r.display,n.display=a==null||typeof a=="boolean"?"":a,a=r.margin,a!=null?n.margin=a:(a=r.hasOwnProperty("marginTop")?r.marginTop:r["margin-top"],n.marginTop=a==null||typeof a=="boolean"?"":a,r=r.hasOwnProperty("marginBottom")?r.marginBottom:r["margin-bottom"],n.marginBottom=r==null||typeof r=="boolean"?"":r)))}function MD(n,r,a){return a=a.ownerDocument.defaultView,{rect:n,abs:r.position==="absolute"||r.position==="fixed",clip:r.clipPath!=="none"||r.overflow!=="visible"||r.filter!=="none"||r.mask!=="none"||r.mask!=="none"||r.borderRadius!=="0px",view:0<=n.bottom&&0<=n.right&&n.top<=a.innerHeight&&n.left<=a.innerWidth}}function T0(n){var r=n.getBoundingClientRect(),a=getComputedStyle(n);return MD(r,a,n)}function ND(n){return n.documentElement.clientHeight}function DD(n){this.addEventListener("load",n),this.addEventListener("error",n)}function jD(n,r,a,c,p,y,T,P,Z){var ae=r.nodeType===9?r:r.ownerDocument;try{var pe=ae.startViewTransition({update:function(){var se=ae.defaultView,fe=se.navigation&&se.navigation.transition,Ye=ae.fonts.status;c();var st=[];if(Ye==="loaded"&&(ND(ae),ae.fonts.status==="loading"&&st.push(ae.fonts.ready)),Ye=st.length,n!==null)for(var Pt=n.suspenseyImages,ie=0,te=0;te<Pt.length;te++){var ce=Pt[te];if(!ce.complete){var Re=ce.getBoundingClientRect();if(0<Re.bottom&&0<Re.right&&Re.top<se.innerHeight&&Re.left<se.innerWidth){if(ie+=VS(ce),ie>Uf){st.length=Ye;break}ce=new Promise(DD.bind(ce)),st.push(ce)}}}if(0<st.length)return se=Promise.race([Promise.all(st),new Promise(function(Je){return setTimeout(Je,500)})]).then(p,p),(fe?Promise.allSettled([fe.finished,se]):se).then(y,y);if(p(),fe)return fe.finished.then(y,y);y()},types:a});ae.__reactViewTransition=pe;var Ce=[];return pe.ready.then(function(){for(var se=ae.documentElement.getAnimations({subtree:!0}),fe=0;fe<se.length;fe++){var Ye=se[fe],st=Ye.effect,Pt=st.pseudoElement;if(Pt!=null&&Pt.startsWith("::view-transition")){Ce.push(Ye),Ye=st.getKeyframes();for(var ie=Pt=void 0,te=!0,ce=0;ce<Ye.length;ce++){var Re=Ye[ce],Je=Re.width;if(Pt===void 0)Pt=Je;else if(Pt!==Je){te=!1;break}if(Je=Re.height,ie===void 0)ie=Je;else if(ie!==Je){te=!1;break}delete Re.width,delete Re.height,Re.transform==="none"&&delete Re.transform}te&&Pt!==void 0&&ie!==void 0&&(st.setKeyframes(Ye),te=getComputedStyle(st.target,st.pseudoElement),te.width!==Pt||te.height!==ie)&&(te=Ye[0],te.width=Pt,te.height=ie,te=Ye[Ye.length-1],te.width=Pt,te.height=ie,st.setKeyframes(Ye))}}T()},function(se){ae.__reactViewTransition===pe&&(ae.__reactViewTransition=null);try{typeof se=="object"&&se!==null&&se.name==="InvalidStateError"&&(se.message==="View transition was skipped because document visibility state is hidden."||se.message==="Skipping view transition because document visibility state has become hidden."||se.message==="Skipping view transition because viewport size changed."||se.message==="Transition was aborted because of invalid state")&&(se=null),se!==null&&Z(se)}finally{c(),p(),T()}}),pe.finished.finally(function(){for(var se=0;se<Ce.length;se++)Ce[se].cancel();ae.__reactViewTransition===pe&&(ae.__reactViewTransition=null),P()}),pe}catch{return c(),p(),T(),null}}function Eo(n,r){this._scope=document.documentElement,this._selector="::view-transition-"+n+"("+r+")"}Eo.prototype.animate=function(n,r){return r=typeof r=="number"?{duration:r}:D({},r),r.pseudoElement=this._selector,this._scope.animate(n,r)},Eo.prototype.getAnimations=function(){for(var n=this._scope,r=this._selector,a=n.getAnimations({subtree:!0}),c=[],p=0;p<a.length;p++){var y=a[p].effect;y!==null&&y.target===n&&y.pseudoElement===r&&c.push(a[p])}return c},Eo.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function ES(n){return{name:n,group:new Eo("group",n),imagePair:new Eo("image-pair",n),old:new Eo("old",n),new:new Eo("new",n)}}function ps(n){this._fragmentFiber=n,this._observers=this._eventListeners=null}ps.prototype.addEventListener=function(n,r,a){var c=null,p=null;if(!(a!=null&&typeof a!="boolean"&&(c=a.signal||null,c!==null&&c.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var y=this._eventListeners;if(CS(y,n,r,a)===-1){var T=this,P=r;a!=null&&typeof a!="boolean"&&a.once===!0&&(P=function(Z){T.removeEventListener(n,r,a),typeof r=="function"?r.call(this,Z):r.handleEvent(Z)}),c!==null&&(p=T.removeEventListener.bind(T,n,r,a),c.addEventListener("abort",p,{once:!0}),p=c.removeEventListener.bind(c,"abort",p)),c=Cl(a),y.push({type:n,listener:r,optionsOrUseCapture:a,attachedListener:P,cleanup:p}),h(this._fragmentFiber.child,!1,ID,n,P,c)}this._eventListeners=y}};function ID(n,r,a,c){return E(n).addEventListener(r,a,c),!1}ps.prototype.removeEventListener=function(n,r,a){var c=this._eventListeners;if(c!==null&&(r=CS(c,n,r,a),r!==-1)){var p=c[r];a=p.attachedListener;var y=p.cleanup;p=Cl(p.optionsOrUseCapture),h(this._fragmentFiber.child,!1,PD,n,a,p),c.splice(r,1),y!==null&&y()}};function PD(n,r,a,c){return E(n).removeEventListener(r,a,c),!1}function Cl(n){return n!=null&&typeof n!="boolean"&&(n.once===!0||n.signal instanceof AbortSignal)?{capture:n.capture,passive:n.passive}:n}function RS(n){return n==null?"c=0":typeof n=="boolean"?"c="+(n?"1":"0"):"c="+(n.capture?"1":"0")}function CS(n,r,a,c){if(n.length===0)return-1;c=RS(c);for(var p=0;p<n.length;p++){var y=n[p];if(y.type===r&&y.listener===a&&RS(y.optionsOrUseCapture)===c)return p}return-1}ps.prototype.dispatchEvent=function(n){var r=x(this._fragmentFiber);if(r===null)return!0;r=E(r);var a=this._eventListeners;if(a!==null&&0<a.length||!n.bubbles){var c=r.nodeType===9?r.createComment(""):document.createTextNode("");if(a)for(var p=0;p<a.length;p++){var y=a[p];c.addEventListener(y.type,y.attachedListener,Cl(y.optionsOrUseCapture))}if(r.appendChild(c),n=c.dispatchEvent(n),a)for(p=0;p<a.length;p++)y=a[p],c.removeEventListener(y.type,y.attachedListener,Cl(y.optionsOrUseCapture));return r.removeChild(c),n}return r.dispatchEvent(n)},ps.prototype.focus=function(n){h(this._fragmentFiber.child,!0,TS,n,void 0,void 0)};function TS(n,r){return n.tag===6?!1:(n=E(n),GD(n,r))}ps.prototype.focusLast=function(n){var r=[];h(this._fragmentFiber.child,!0,k0,r,void 0,void 0);for(var a=r.length-1;0<=a&&!TS(r[a],n);a--);};function k0(n,r){return r.push(n),!1}ps.prototype.blur=function(){var n=x(this._fragmentFiber);n!==null&&(n=E(n),n=nu(n).activeElement,n!==null&&h(this._fragmentFiber.child,!1,LD,n,void 0,void 0))};function LD(n,r){return n.tag===6?!1:(n=E(n),n===r||n.contains(r)?(r.blur(),!0):!1)}ps.prototype.observeUsing=function(n){this._observers===null&&(this._observers=new Set),this._observers.add(n),h(this._fragmentFiber.child,!1,zD,n,void 0,void 0)};function zD(n,r){return n.tag===6||(n=E(n),r.observe(n)),!1}ps.prototype.unobserveUsing=function(n){var r=this._observers;if(r!==null&&r.has(n)){r.delete(n),h(this._fragmentFiber.child,!1,_D,n,void 0,void 0);for(var a=r=0;a<Ks.length;a++){var c=Ks[a];c.fragmentInstance===this&&c.observer===n?n.unobserve(c.instance):Ks[r++]=c}Ks.length=r}};function _D(n,r){return n.tag===6||(n=E(n),r.unobserve(n)),!1}var Ks=[],O0=!1;function UD(n,r,a){Ks.push({fragmentInstance:n,observer:r,instance:a}),O0||(O0=!0,$D(function(){O0=!1;var c=Ks;Ks=[];for(var p=0;p<c.length;p++){var y=c[p];y.observer.unobserve(y.instance)}}))}ps.prototype.getClientRects=function(){var n=[];return h(this._fragmentFiber.child,!1,HD,n,void 0,void 0),n};function HD(n,r){if(n.tag===6){n=n.stateNode;var a=n.ownerDocument.createRange();a.selectNodeContents(n),r.push.apply(r,a.getClientRects())}else n=E(n),r.push.apply(r,n.getClientRects());return!1}ps.prototype.getRootNode=function(n){var r=x(this._fragmentFiber);return r===null?this:E(r).getRootNode(n)},ps.prototype.compareDocumentPosition=function(n){var r=x(this._fragmentFiber);if(r===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var a=[];h(this._fragmentFiber.child,!1,k0,a,void 0,void 0);var c=E(r);if(a.length===0){if(a=c,S(this._fragmentFiber)){e:{for(r=this._fragmentFiber.return;r!==null;){if(r.tag===4){r=r.stateNode.containerInfo;break e}if(r.tag===3||r.tag===5||r.tag===27)break;r=r.return}r=null}r!=null&&(a=r)}r=this._fragmentFiber;var p=c=a.compareDocumentPosition(n);return a===n?p=Node.DOCUMENT_POSITION_CONTAINS:c&Node.DOCUMENT_POSITION_CONTAINED_BY&&(a=w(r)[1],a===null?p=Node.DOCUMENT_POSITION_PRECEDING:(n=E(a).compareDocumentPosition(n),p=n===0||n&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),p|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}r=E(a[0]),p=E(a[a.length-1]);var y=S(this._fragmentFiber)?r.parentElement:c;if(y==null)return Node.DOCUMENT_POSITION_DISCONNECTED;c=y.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY,y=y.compareDocumentPosition(p)&Node.DOCUMENT_POSITION_CONTAINED_BY;var T=r.compareDocumentPosition(n),P=p.compareDocumentPosition(n),Z=T&Node.DOCUMENT_POSITION_CONTAINED_BY||P&Node.DOCUMENT_POSITION_CONTAINED_BY;return P=c&&y&&T&Node.DOCUMENT_POSITION_FOLLOWING&&P&Node.DOCUMENT_POSITION_PRECEDING,r=c&&r===n||y&&p===n||Z||P?Node.DOCUMENT_POSITION_CONTAINED_BY:!c&&r===n||!y&&p===n?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:T,r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||FD(r,this._fragmentFiber,a[0],a[a.length-1],n)?r:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function FD(n,r,a,c,p){var y=Fn(p);if(n&Node.DOCUMENT_POSITION_CONTAINED_BY){if(a=!!y)e:{for(;y!==null;){if(y.tag===7&&(y===r||y.alternate===r)){a=!0;break e}y=y.return}a=!1}return a}if(n&Node.DOCUMENT_POSITION_CONTAINS){if(y===null)return y=p.ownerDocument,p===y||p===y.documentElement||p===y.body;e:{for(y=r,r=x(r);y!==null;){if(!(y.tag!==5&&y.tag!==3&&y.tag!==27||y!==r&&y.alternate!==r)){y=!0;break e}y=y.return}y=!1}return y}return n&Node.DOCUMENT_POSITION_PRECEDING?((r=!!y)&&!(r=y===a)&&(r=j(a,y,N),r===null?r=!1:(h(r,!0,O,y,a),y=R,R=null,r=y!==null)),r):n&Node.DOCUMENT_POSITION_FOLLOWING?((r=!!y)&&!(r=y===c)&&(r=j(c,y,N),r===null?r=!1:(h(r,!0,A,y,c),y=R,k=R=null,r=y!==null)),r):!1}function kS(n,r){var a=n.ownerDocument.createRange();a.selectNodeContents(n),n=a.getBoundingClientRect(),window.scrollTo(window.scrollX+n.left,r?window.scrollY+n.top:window.scrollY+n.bottom-window.innerHeight)}ps.prototype.scrollIntoView=function(n){if(typeof n=="object")throw Error(i(566));var r=[];h(this._fragmentFiber.child,!1,k0,r,void 0,void 0);var a=n!==!1;if(r.length===0){var c=w(this._fragmentFiber);if(c=a?c[1]||c[0]||x(this._fragmentFiber):c[0]||c[1],c===null)return;if(c.tag===6){n=E(c),kS(n,a);return}if(c=E(c),c.nodeType!==9){if(c.nodeType===11){a="host"in c?c.host:null,a!==null&&a.scrollIntoView(n);return}c.scrollIntoView(n)}}for(c=a?r.length-1:0;c!==(a?-1:r.length);){var p=r[c];p.tag===6?(p=E(p),kS(p,a)):E(p).scrollIntoView(n),c+=a?-1:1}};function BD(n,r){return n=E(n),OS(n,r),!1}function OS(n,r){n.reactFragments==null&&(n.reactFragments=new Set),n.reactFragments.add(r)}function AS(n,r){var a=r._eventListeners;if(a!==null)for(var c=0;c<a.length;c++){var p=a[c];n.addEventListener(p.type,p.attachedListener,Cl(p.optionsOrUseCapture))}n.nodeType!==3&&(a=r._observers,a!==null&&a.forEach(function(y){for(var T=0,P=0;P<Ks.length;P++){var Z=Ks[P];(Z.fragmentInstance!==r||Z.observer!==y||Z.instance!==n)&&(Ks[T++]=Z)}Ks.length=T,y.observe(n)}),OS(n,r))}function VD(n,r){var a=r._eventListeners;if(a!==null)for(var c=0;c<a.length;c++){var p=a[c];n.removeEventListener(p.type,p.attachedListener,Cl(p.optionsOrUseCapture))}n.nodeType!==3&&(a=r._observers,a!==null&&a.forEach(function(y){typeof y.rootMargin=="string"?UD(r,y,n):y.unobserve(n)}),n.reactFragments!=null&&n.reactFragments.delete(r))}function A0(n){var r=n.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":A0(a),qn(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}n.removeChild(a)}}function KD(n,r,a,c){for(;n.nodeType===1;){var p=a;if(n.nodeName.toLowerCase()!==r.toLowerCase()){if(!c&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(c){if(!n[xs])switch(r){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(y=n.getAttribute("rel"),y==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(y!==p.rel||n.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||n.getAttribute("title")!==(p.title==null?null:p.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(y=n.getAttribute("src"),(y!==(p.src==null?null:p.src)||n.getAttribute("type")!==(p.type==null?null:p.type)||n.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(r==="input"&&n.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&n.getAttribute("name")===y)return n}else return n;if(n=Os(n.nextSibling),n===null)break}return null}function qD(n,r,a){if(r==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!a||(n=Os(n.nextSibling),n===null))return null;return n}function MS(n,r){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!r||(n=Os(n.nextSibling),n===null))return null;return n}function M0(n){return n.data==="$?"||n.data==="$~"}function N0(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function YD(n,r){var a=n.ownerDocument;if(n.data==="$~")n._reactRetry=r;else if(n.data!=="$?"||a.readyState!=="loading")r();else{var c=function(){r(),a.removeEventListener("DOMContentLoaded",c)};a.addEventListener("DOMContentLoaded",c),n._reactRetry=c}}function Os(n){for(;n!=null;n=n.nextSibling){var r=n.nodeType;if(r===1||r===3)break;if(r===8){if(r=n.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return n}var D0=null;function NS(n){n=n.nextSibling;for(var r=0;n;){if(n.nodeType===8){var a=n.data;if(a==="/$"||a==="/&"){if(r===0)return Os(n.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}n=n.nextSibling}return null}function DS(n){n=n.previousSibling;for(var r=0;n;){if(n.nodeType===8){var a=n.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(r===0)return n;r--}else a!=="/$"&&a!=="/&"||r++}n=n.previousSibling}return null}function GD(n,r){function a(){c=!0}if(n.ownerDocument.activeElement===n)return!0;var c=!1;try{n.ownerDocument.addEventListener("focus",a,!0),(n.focus||HTMLElement.prototype.focus).call(n,r)}finally{n.ownerDocument.removeEventListener("focus",a,!0)}return c}function $D(n){vS(function(){vS(function(r){return n(r)})})}function jS(n,r,a){switch(r=nu(a),n){case"html":if(n=r.documentElement,!n)throw Error(i(452));return n;case"head":if(n=r.head,!n)throw Error(i(453));return n;case"body":if(n=r.body,!n)throw Error(i(454));return n;default:throw Error(i(451))}}function IS(n,r,a){for(var c in a){var p=a[c];a.hasOwnProperty(c)&&p!=null&&vn(n,r,c,null,ED,p)}a.dangerouslySetInnerHTML!=null&&(n.textContent=""),n.onclick===Pr&&(n.onclick=null),qn(n)}function j0(n){for(var r=n.attributes;r.length;)n.removeAttributeNode(r[0]);qn(n)}var As=new Map,PS=new Set;function ru(n){if(typeof n.getRootNode=="function"){var r=n.getRootNode();if(r.nodeType===9||r.nodeType===11)return r}return n.nodeType===9?n:n.ownerDocument}var Bi=ue.d;ue.d={f:QD,r:XD,D:ZD,C:JD,L:WD,m:ej,X:nj,S:tj,M:rj};function QD(){var n=Bi.f(),r=Mf();return n||r}function XD(n){var r=gr(n);r!==null&&r.tag===5&&r.type==="form"?z2(r):Bi.r(n)}var Tl=typeof document>"u"?null:document;function LS(n,r,a){var c=Tl;if(c&&typeof r=="string"&&r){var p=Dn(r);p='link[rel="'+n+'"][href="'+p+'"]',typeof a=="string"&&(p+='[crossorigin="'+a+'"]'),PS.has(p)||(PS.add(p),n={rel:n,crossOrigin:a,href:r},c.querySelector(p)===null&&(r=c.createElement("link"),wr(r,"link",n),Se(r),c.head.appendChild(r)))}}function ZD(n){Bi.D(n),LS("dns-prefetch",n,null)}function JD(n,r){Bi.C(n,r),LS("preconnect",n,r)}function WD(n,r,a){Bi.L(n,r,a);var c=Tl;if(c&&n&&r){var p='link[rel="preload"][as="'+Dn(r)+'"]';r==="image"&&a&&a.imageSrcSet?(p+='[imagesrcset="'+Dn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(p+='[imagesizes="'+Dn(a.imageSizes)+'"]')):p+='[href="'+Dn(n)+'"]';var y=p;switch(r){case"style":y=kl(n);break;case"script":y=Ol(n)}if(!(As.has(y)||(n=D({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:n,as:r},a),As.set(y,n),c.querySelector(p)!==null||r==="style"&&c.querySelector(su(y))||r==="script"&&c.querySelector(iu(y))))){var T=c.createElement("link");wr(T,"link",n),r==="style"&&(T[zt]=!0,T.onload=T.onerror=function(){rt(T)}),Se(T),c.head.appendChild(T)}}}function ej(n,r){Bi.m(n,r);var a=Tl;if(a&&n){var c=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+Dn(c)+'"][href="'+Dn(n)+'"]',y=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Ol(n)}if(!As.has(y)&&(n=D({rel:"modulepreload",href:n},r),As.set(y,n),a.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(iu(y)))return}c=a.createElement("link"),wr(c,"link",n),Se(c),a.head.appendChild(c)}}}function tj(n,r,a){Bi.S(n,r,a);var c=Tl;if(c&&n){var p=Ae(c).hoistableStyles,y=kl(n);r=r||"default";var T=p.get(y);if(!T){var P={loading:0,preload:null};if(T=c.querySelector(su(y)))P.loading=5;else{n=D({rel:"stylesheet",href:n,"data-precedence":r},a),(a=As.get(y))&&I0(n,a);var Z=T=c.createElement("link");Se(Z),wr(Z,"link",n),Z._p=new Promise(function(ae,pe){Z.onload=ae,Z.onerror=pe}),Z.addEventListener("load",function(){P.loading|=1}),Z.addEventListener("error",function(){P.loading|=2}),P.loading|=4,zf(T,r,c)}T={type:"stylesheet",instance:T,count:1,state:P},p.set(y,T)}}}function nj(n,r){Bi.X(n,r);var a=Tl;if(a&&n){var c=Ae(a).hoistableScripts,p=Ol(n),y=c.get(p);y||(y=a.querySelector(iu(p)),y||(n=D({src:n,async:!0},r),(r=As.get(p))&&P0(n,r),y=a.createElement("script"),Se(y),wr(y,"link",n),a.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function rj(n,r){Bi.M(n,r);var a=Tl;if(a&&n){var c=Ae(a).hoistableScripts,p=Ol(n),y=c.get(p);y||(y=a.querySelector(iu(p)),y||(n=D({src:n,async:!0,type:"module"},r),(r=As.get(p))&&P0(n,r),y=a.createElement("script"),Se(y),wr(y,"link",n),a.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},c.set(p,y))}}function zS(n,r,a,c){var p=(p=be.current)?ru(p):null;if(!p)throw Error(i(446));switch(n){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(a=kl(a.href),r=Ae(p).hoistableStyles,c=r.get(a),c||(c={type:"style",instance:null,count:0,state:null},r.set(a,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){n=kl(a.href);var y=Ae(p).hoistableStyles,T=y.get(n);if(T||(p=p.ownerDocument||p,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(n,T),(y=p.querySelector(su(n)))?y._p||(T.instance=y,T.state.loading=5):(y=As.get(n),y||(y={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},As.set(n,y)),sj(p,n,y,T.state))),r&&c===null)throw Error(i(528,""));return T}if(r&&c!==null)throw Error(i(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(a=Ol(a),r=Ae(p).hoistableScripts,c=r.get(a),c||(c={type:"script",instance:null,count:0,state:null},r.set(a,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,n))}}function kl(n){return'href="'+Dn(n)+'"'}function su(n){return'link[rel="stylesheet"]['+n+"]"}function _S(n){return D({},n,{"data-precedence":n.precedence,precedence:null})}function sj(n,r,a,c){if(r=n.querySelector('link[rel="preload"][as="style"]['+r+"]")){if(r[zt]!==!0){c.loading=1;return}}else r=n.createElement("link"),r[zt]=!0,r.onload=r.onerror=rt.bind(null,r),wr(r,"link",a),Se(r),n.head.appendChild(r);c.preload=r,r.addEventListener("load",function(){return c.loading|=1}),r.addEventListener("error",function(){return c.loading|=2})}function Ol(n){return'[src="'+Dn(n)+'"]'}function iu(n){return"script[async]"+n}function US(n,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var c=n.querySelector('style[data-href~="'+Dn(a.href)+'"]');if(c)return r.instance=c,Se(c),c;var p=D({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),Se(c),wr(c,"style",p),zf(c,a.precedence,n),r.instance=c;case"stylesheet":p=kl(a.href);var y=n.querySelector(su(p));if(y)return r.state.loading|=4,r.instance=y,Se(y),y;c=_S(a),(p=As.get(p))&&I0(c,p),y=(n.ownerDocument||n).createElement("link"),Se(y);var T=y;return T._p=new Promise(function(P,Z){T.onload=P,T.onerror=Z}),wr(y,"link",c),r.state.loading|=4,zf(y,a.precedence,n),r.instance=y;case"script":return y=Ol(a.src),(p=n.querySelector(iu(y)))?(r.instance=p,Se(p),p):(c=a,(p=As.get(y))&&(c=D({},a),P0(c,p)),n=n.ownerDocument||n,p=n.createElement("script"),Se(p),wr(p,"link",c),n.head.appendChild(p),r.instance=p);case"void":return null;default:throw Error(i(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(c=r.instance,r.state.loading|=4,zf(c,a.precedence,n));return r.instance}function zf(n,r,a){for(var c=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,y=p,T=0;T<c.length;T++){var P=c[T];if(P.dataset.precedence===r)y=P;else if(y!==p)break}y?y.parentNode.insertBefore(n,y.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(n,r.firstChild))}function I0(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.title==null&&(n.title=r.title)}function P0(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.integrity==null&&(n.integrity=r.integrity)}var _f=null;function HS(n,r,a){if(_f===null){var c=new Map,p=_f=new Map;p.set(a,c)}else p=_f,c=p.get(a),c||(c=new Map,p.set(a,c));if(c.has(n))return c;for(c.set(n,null),a=a.getElementsByTagName(n),p=0;p<a.length;p++){var y=a[p];if(!(y[xs]||y[fn]||n==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var T=y.getAttribute(r)||"";T=n+T;var P=c.get(T);P?P.push(y):c.set(T,[y])}}return c}function L0(n,r,a){n=n.ownerDocument||n,n.head.insertBefore(a,r==="title"?n.querySelector("head > title"):null)}function ij(n,r,a){if(a===1||r.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(n=r.disabled,typeof r.precedence=="string"&&n==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function FS(n,r){return n==="img"&&r.src!=null&&r.src!==""&&r.onLoad==null&&r.loading!=="lazy"}function BS(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function VS(n){return(n.width||100)*(n.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function KS(n,r){typeof r.decode=="function"&&(n.imgCount++,r.complete||(n.imgBytes+=VS(r),n.suspenseyImages.push(r)),n=lj.bind(n),r.decode().then(n,n))}function aj(n,r,a,c){if(a.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var p=kl(c.href),y=r.querySelector(su(p));if(y){r=y._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(n.count++,n=au.bind(n),r.then(n,n)),a.state.loading|=4,a.instance=y,Se(y);return}y=r.ownerDocument||r,c=_S(c),(p=As.get(p))&&I0(c,p),y=y.createElement("link"),Se(y);var T=y;T._p=new Promise(function(P,Z){T.onload=P,T.onerror=Z}),wr(y,"link",c),a.instance=y}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(a,r),(r=a.state.preload)&&(a.state.loading&3)===0&&(n.count++,a=au.bind(n),r.addEventListener("load",a),r.addEventListener("error",a))}}var Uf=0;function oj(n,r){return n.stylesheets&&n.count===0&&Ff(n,n.stylesheets),0<n.count||0<n.imgCount?function(a){var c=setTimeout(function(){if(n.stylesheets&&Ff(n,n.stylesheets),n.unsuspend){var y=n.unsuspend;n.unsuspend=null,y()}},6e4+r);0<n.imgBytes&&Uf===0&&(Uf=62500*CD());var p=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Ff(n,n.stylesheets),n.unsuspend)){var y=n.unsuspend;n.unsuspend=null,y()}},(n.imgBytes>Uf?50:800)+r);return n.unsuspend=a,function(){n.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function qS(n){if(n.count===0&&(n.imgCount===0||!n.waitingForImages)){if(n.stylesheets)Ff(n,n.stylesheets);else if(n.unsuspend){var r=n.unsuspend;n.unsuspend=null,r()}}}function au(){this.count--,qS(this)}function lj(){this.imgCount--,qS(this)}var Hf=null;function Ff(n,r){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Hf=new Map,r.forEach(cj,n),Hf=null,au.call(n))}function cj(n,r){if(!(r.state.loading&4)){var a=Hf.get(n);if(a)var c=a.get(null);else{a=new Map,Hf.set(n,a);for(var p=n.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var T=p[y];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(a.set(T.dataset.precedence,T),c=T)}c&&a.set(null,c)}p=r.instance,T=p.getAttribute("data-precedence"),y=a.get(T)||c,y===c&&a.set(null,p),a.set(T,p),this.count++,c=au.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),y?y.parentNode.insertBefore(p,y.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(p,n.firstChild)),r.state.loading|=4}}var Al={$$typeof:U,Provider:null,Consumer:null,_currentValue:Te,_currentValue2:Te,_threadCount:0};function uj(n,r,a,c,p,y,T,P,Z){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=Et(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Et(0),this.hiddenUpdates=Et(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.transitionTypes=null,this.incompleteTransitions=new Map}function YS(n,r,a,c,p,y,T,P,Z,ae,pe,Ce){return n=new uj(n,r,a,T,Z,ae,pe,Ce,P),r=1,y===!0&&(r|=24),y=Yr(3,null,null,r),n.current=y,y.stateNode=n,r=Zg(),r.refCount++,n.pooledCache=r,r.refCount++,y.memoizedState={element:c,isDehydrated:a,cache:r},tm(y),n}function GS(n){return n?(n=tl,n):tl}function $S(n,r,a,c,p,y){p=GS(p),c.context===null?c.context=p:c.pendingContext=p,c=ga(r),c.payload={element:a},y=y===void 0?null:y,y!==null&&(c.callback=y),a=ma(n,c,r),a!==null&&(Xr(a,n,r),zc(a,n,r))}function QS(n,r){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var a=n.retryLane;n.retryLane=a!==0&&a<r?a:r}}function z0(n,r){QS(n,r),(n=n.alternate)&&QS(n,r)}function XS(n){if(n.tag===13||n.tag===31){var r=io(n,67108864);r!==null&&Xr(r,n,67108864),z0(n,67108864)}}function ZS(n){if(n.tag===13||n.tag===31){var r=hs();r=Bt(r);var a=io(n,r);a!==null&&Xr(a,n,r),z0(n,r)}}var Ml=!0;function dj(n,r,a,c){var p=ge.T;ge.T=null;var y=ue.p;try{ue.p=2,_0(n,r,a,c)}finally{ue.p=y,ge.T=p}}function fj(n,r,a,c){var p=ge.T;ge.T=null;var y=ue.p;try{ue.p=8,_0(n,r,a,c)}finally{ue.p=y,ge.T=p}}function _0(n,r,a,c){if(Ml){var p=U0(c);if(p===null)b0(n,r,c,Bf,a),WS(n,c);else if(pj(p,n,r,a,c))c.stopPropagation();else if(WS(n,c),r&4&&-1<hj.indexOf(n)){for(;p!==null;){var y=gr(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var T=qe(y.pendingLanes);if(T!==0){var P=y;for(P.pendingLanes|=2,P.entangledLanes|=2;T;){var Z=1<<31-et(T);P.entanglements[1]|=Z,T&=~Z}ui(y),(cn&6)===0&&(kf=wt()+500,Wc(0))}}break;case 31:case 13:P=io(y,2),P!==null&&Xr(P,y,2),Mf(),z0(y,2)}if(y=U0(c),y===null&&b0(n,r,c,Bf,a),y===p)break;p=y}p!==null&&c.stopPropagation()}else b0(n,r,c,null,a)}}function U0(n){return n=eo(n),H0(n)}var Bf=null;function H0(n){if(Bf=null,n=Fn(n),n!==null){var r=l(n);if(r===null)n=null;else{var a=r.tag;if(a===13){if(n=u(r),n!==null)return n;n=null}else if(a===31){if(n=d(r),n!==null)return n;n=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;n=null}else r!==n&&(n=null)}}return Bf=n,null}function JS(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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Zt()){case ht:return 2;case xt:return 8;case yt:case Ut:return 32;case un:return 268435456;default:return 32}default:return 32}}var F0=!1,Oa=null,Aa=null,Ma=null,ou=new Map,lu=new Map,Na=[],hj="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 WS(n,r){switch(n){case"focusin":case"focusout":Oa=null;break;case"dragenter":case"dragleave":Aa=null;break;case"mouseover":case"mouseout":Ma=null;break;case"pointerover":case"pointerout":ou.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":lu.delete(r.pointerId)}}function cu(n,r,a,c,p,y){return n===null||n.nativeEvent!==y?(n={blockedOn:r,domEventName:a,eventSystemFlags:c,nativeEvent:y,targetContainers:[p]},r!==null&&(r=gr(r),r!==null&&XS(r)),n):(n.eventSystemFlags|=c,r=n.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),n)}function pj(n,r,a,c,p){switch(r){case"focusin":return Oa=cu(Oa,n,r,a,c,p),!0;case"dragenter":return Aa=cu(Aa,n,r,a,c,p),!0;case"mouseover":return Ma=cu(Ma,n,r,a,c,p),!0;case"pointerover":var y=p.pointerId;return ou.set(y,cu(ou.get(y)||null,n,r,a,c,p)),!0;case"gotpointercapture":return y=p.pointerId,lu.set(y,cu(lu.get(y)||null,n,r,a,c,p)),!0}return!1}function ew(n){var r=Fn(n.target);if(r!==null){var a=l(r);if(a!==null){if(r=a.tag,r===13){if(r=u(a),r!==null){n.blockedOn=r,ns(n.priority,function(){ZS(a)});return}}else if(r===31){if(r=d(a),r!==null){n.blockedOn=r,ns(n.priority,function(){ZS(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){n.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Vf(n){if(n.blockedOn!==null)return!1;for(var r=n.targetContainers;0<r.length;){var a=U0(n.nativeEvent);if(a===null){a=n.nativeEvent;var c=new a.constructor(a.type,a);Wa=c,a.target.dispatchEvent(c),Wa=null}else return r=gr(a),r!==null&&XS(r),n.blockedOn=a,!1;r.shift()}return!0}function tw(n,r,a){Vf(n)&&a.delete(r)}function gj(){F0=!1,Oa!==null&&Vf(Oa)&&(Oa=null),Aa!==null&&Vf(Aa)&&(Aa=null),Ma!==null&&Vf(Ma)&&(Ma=null),ou.forEach(tw),lu.forEach(tw)}function Kf(n,r){n.blockedOn===r&&(n.blockedOn=null,F0||(F0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,gj)))}var qf=null;function nw(n){qf!==n&&(qf=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){qf===n&&(qf=null);for(var r=0;r<n.length;r+=3){var a=n[r],c=n[r+1],p=n[r+2];if(typeof c!="function"){if(H0(c||a)===null)continue;break}var y=gr(a);y!==null&&(n.splice(r,3),r-=3,wm(y,{pending:!0,data:p,method:a.method,action:c},c,p))}}))}function Nl(n){function r(Z){return Kf(Z,n)}Oa!==null&&Kf(Oa,n),Aa!==null&&Kf(Aa,n),Ma!==null&&Kf(Ma,n),ou.forEach(r),lu.forEach(r);for(var a=0;a<Na.length;a++){var c=Na[a];c.blockedOn===n&&(c.blockedOn=null)}for(;0<Na.length&&(a=Na[0],a.blockedOn===null);)ew(a),a.blockedOn===null&&Na.shift();if(a=(n.ownerDocument||n).$$reactFormReplay,a!=null)for(c=0;c<a.length;c+=3){var p=a[c],y=a[c+1],T=p[An]||null;if(typeof y=="function")T||nw(a);else if(T){var P=null;if(y&&y.hasAttribute("formAction")){if(p=y,T=y[An]||null)P=T.formAction;else if(H0(p)!==null)continue}else P=T.action;typeof P=="function"?a[c+1]=P:(a.splice(c,3),c-=3),nw(a)}}}function rw(){function n(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(T){return p=T})},focusReset:"manual",scroll:"manual"})}function r(){p!==null&&(p(),p=null),c||setTimeout(a,20)}function a(){if(!c&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(a,100),function(){c=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),p!==null&&(p(),p=null)}}}function B0(n){this._internalRoot=n}Yf.prototype.render=B0.prototype.render=function(n){var r=this._internalRoot;if(r===null)throw Error(i(409));var a=r.current,c=hs();$S(a,c,n,r,null,null)},Yf.prototype.unmount=B0.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var r=n.containerInfo;$S(n.current,2,null,n,null,null),Mf(),r[jn]=null}};function Yf(n){this._internalRoot=n}Yf.prototype.unstable_scheduleHydration=function(n){if(n){var r=Tn();n={blockedOn:null,target:n,priority:r};for(var a=0;a<Na.length&&r!==0&&r<Na[a].priority;a++);Na.splice(a,0,n),a===0&&ew(n)}};var sw=t.version;if(sw!=="19.3.1")throw Error(i(527,sw,"19.3.1"));ue.findDOMNode=function(n){var r=n._reactInternals;if(r===void 0)throw typeof n.render=="function"?Error(i(188)):(n=Object.keys(n).join(","),Error(i(268,n)));return n=g(r),n=n!==null?m(n):null,n=n===null?null:n.stateNode,n};var mj={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:ge,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Gf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gf.isDisabled&&Gf.supportsFiber)try{Ie=Gf.inject(mj),ze=Gf}catch{}}return du.createRoot=function(n,r){if(!o(n))throw Error(i(299));var a=!1,c="",p=G2,y=$2,T=Q2;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(y=r.onCaughtError),r.onRecoverableError!==void 0&&(T=r.onRecoverableError)),r=YS(n,1,!1,null,null,a,c,null,p,y,T,rw),n[jn]=r.current,v0(n),new B0(r)},du.hydrateRoot=function(n,r,a){if(!o(n))throw Error(i(299));var c=!1,p="",y=G2,T=$2,P=Q2,Z=null;return a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(p=a.identifierPrefix),a.onUncaughtError!==void 0&&(y=a.onUncaughtError),a.onCaughtError!==void 0&&(T=a.onCaughtError),a.onRecoverableError!==void 0&&(P=a.onRecoverableError),a.formState!==void 0&&(Z=a.formState)),r=YS(n,1,!0,r,a??null,c,p,Z,y,T,P,rw),r.context=GS(null),a=r.current,c=hs(),c=Bt(c),p=ga(c),p.callback=null,ma(a,p,c),a=c,r.current.lanes=a,ft(r,a),ui(r),n[jn]=r.current,v0(n),new Yf(r)},du.version="19.3.1",du}var pw;function Tj(){if(pw)return q0.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(),q0.exports=Cj(),q0.exports}var kj=Tj();const gw={};function tr(e,t){const s=b.useRef(gw);return s.current===gw&&(s.current=e(t)),s}const Oy=[];let Ay;function Oj(){return Ay}function Aj(e){Oy.push(e)}function Xu(e){const t=(s,i)=>{const o=tr(Mj).current;let l;try{Ay=o;for(const u of Oy)u.before(o);l=e(s,i);for(const u of Oy)u.after(o);o.didInitialize=!0}finally{Ay=void 0}return l};return t.displayName=e.displayName||e.name,t}function gp(e){return b.forwardRef(Xu(e))}function Mj(){return{didInitialize:!1}}function En(){}const $s=Object.freeze([]),Xt=Object.freeze({}),Nj=()=>{},_e=typeof document<"u"?b.useLayoutEffect:Nj;function Dj(e,t){return function(i,...o){const l=new URL(e);return l.searchParams.set("code",i.toString()),o.forEach(u=>l.searchParams.append("args[]",u)),`${t} error #${i}; visit ${l} for the full message.`}}const gn=Dj("https://base-ui.com/production-error","Base UI"),GR=b.createContext(void 0);function Zu(e){const t=b.useContext(GR);if(t===void 0&&!e)throw new Error(gn(72));return t}function Sv(e){b.useEffect(e,$s)}const fu=0;class Ps{static create(){return new Ps}currentId=fu;start(t,s){this.clear(),this.currentId=setTimeout(()=>{this.currentId=fu,s()},t)}isStarted(){return this.currentId!==fu}clear=()=>{this.currentId!==fu&&(clearTimeout(this.currentId),this.currentId=fu)};disposeEffect=()=>this.clear}function Un(){const e=tr(Ps.create).current;return Sv(e.disposeEffect),e}function jj(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:Ij,platform:Pj,maxTouchPoints:Lj}=jj(),mp=Ij.toLowerCase(),Pu=Pj.toLowerCase(),yp=/^i(os$|p)/.test(Pu)||Pu==="macintel"&&Lj>1,mw="android",My=Pu===mw||mp.includes(mw),wv=!yp&&Pu.startsWith("mac");Pu.startsWith("win");const zj=wv||yp,Si=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!Si&&mp.includes("firefox");!Si&&mp.includes("chrom");const _j=zj,Ev=/jsdom|happydom/.test(mp);function Ys(e){e.preventDefault(),e.stopPropagation()}function Uj(e){return"nativeEvent"in e}function ec(e){return e.pointerType===""&&e.isTrusted?!0:My&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Rv(e){return Ev?!1:!My&&e.width===0&&e.height===0||e.type==="pointerdown"&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"&&(My||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Ua(e,t){const s=["mouse","pen"];return t||s.push("",void 0),s.includes(e)}function Hj(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function vp(){return typeof window<"u"}function Rr(e){return Cv(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=(Cv(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Cv(e){return vp()?e instanceof Node||e instanceof Rn(e).Node:!1}function ln(e){return vp()?e instanceof Element||e instanceof Rn(e).Element:!1}function bn(e){return vp()?e instanceof HTMLElement||e instanceof Rn(e).HTMLElement:!1}function jo(e){return!vp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Rn(e).ShadowRoot}function Ju(e){const{overflow:t,overflowX:s,overflowY:i,display:o}=ys(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+s)&&o!=="inline"&&o!=="contents"}function Fj(e){return/^(table|td|th)$/.test(Rr(e))}function bp(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Bj=/transform|translate|scale|rotate|perspective|filter/,Vj=/paint|layout|strict|content/,Ro=e=>!!e&&e!=="none";let Q0;function Tv(e){const t=ln(e)?ys(e):e;return Ro(t.transform)||Ro(t.translate)||Ro(t.scale)||Ro(t.rotate)||Ro(t.perspective)||!kv()&&(Ro(t.backdropFilter)||Ro(t.filter))||Bj.test(t.willChange||"")||Vj.test(t.contain||"")}function Kj(e){let t=Zi(e);for(;bn(t)&&!$i(t);){if(Tv(t))return t;if(bp(t))return null;t=Zi(t)}return null}function kv(){return Q0==null&&(Q0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Q0}function $i(e){return/^(html|body|#document)$/.test(Rr(e))}function ys(e){return Rn(e).getComputedStyle(e)}function xp(e){return ln(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Zi(e){if(Rr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||jo(e)&&e.host||ea(e);return jo(t)?t.host:t}function $R(e){const t=Zi(e);return $i(t)?(e.ownerDocument||e).body:bn(t)&&Ju(t)?t:$R(t)}function Lu(e,t,s){var i;t===void 0&&(t=[]),s===void 0&&(s=!0);const o=$R(e),l=o===((i=e.ownerDocument)==null?void 0:i.body),u=Rn(o);if(l){const d=Ny(u);return t.concat(u,u.visualViewport||[],Ju(o)?o:[],d&&s?Lu(d):[])}else return t.concat(o,Lu(o,[],s))}function Ny(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Jr(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function it(e,t){if(!e||!t)return!1;const s=t.getRootNode?.();if(e.contains(t))return!0;if(s&&jo(s)){let i=t;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function zu(e,t){let s=e;for(;s;){if(ln(s)&&s.matches(t))return s;s=s.assignedSlot??s.parentNode??(jo(s)?s.host:null)}return null}function nr(e){return"composedPath"in e?e.composedPath()[0]??e.target:e.target}const Dy="data-base-ui-focusable",QR="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Sp="ArrowLeft",wp="ArrowRight",XR="ArrowUp",Ov="ArrowDown",Av="data-starting-style",qj="data-ending-style",Yj={[Av]:""},Gj={[qj]:""},wi={transitionStatus(e){return e==="starting"?Yj:e==="ending"?Gj:null}},$j="data-open",Qj="data-closed",Xj="data-anchor-hidden",ZR="data-popup-open",Zj="data-pressed",Jj={[ZR]:""},Wj={[ZR]:"",[Zj]:""},e4={[$j]:""},t4={[Qj]:""},n4={[Xj]:""},Ep={open(e){return e?Jj:null}},_u={open(e){return e?Wj:null}},Wu={open(e){return e?e4:t4},anchorHidden(e){return e?n4:null}},Rp={...Wu,...wi},jy="data-trigger-disabled";function _h(e,t){if(!ln(e))return!1;const s=e;if(t.hasElement(s))return!s.hasAttribute(jy);for(const[,i]of t.entries())if(it(i,s))return!i.hasAttribute(jy);return!1}function X0(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const s=e;return s.target!=null&&t.contains(s.target)}function r4(e){return e.matches("html,body")}function ed(e){return bn(e)&&e.matches(QR)}function s4(e){return zu(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${QR}`)!=null}function Iy(e){return e?e.getAttribute("role")==="combobox"&&ed(e):!1}function i4(e){if(!e||Ev)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Uh(e){return e?e.hasAttribute(Dy)?e:e.querySelector(`[${Dy}]`)||e:null}function a4(e,t){return t!=null&&!Ua(t)?0:typeof e=="function"?e():e}function Io(e,t,s){const i=a4(e,s);return typeof i=="number"?i:i?.[t]}function yw(e){return typeof e=="function"?e():e}function JR(e,t){return t||e==="click"||e==="mousedown"}function o4(e){return e?.includes("mouse")&&e!=="mousedown"}function ut(e,t,s,i){let o=!1,l=!1;const u=i??Xt;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){l=!0},get isCanceled(){return o},get isPropagationAllowed(){return l},trigger:s,...u}}function l4(e,t,s){const i=s??Xt;return{reason:e,event:t??new Event("base-ui"),...i}}const Mr="none",Qs="trigger-press",Kn="trigger-hover",Fl="trigger-focus",Cp="outside-press",No="item-press",WR="close-press",Fa="focus-out",td="escape-key",Hh="list-navigation",eC="keyboard",c4="pointer",Mv="cancel-open",vu="sibling-open",u4="disabled",nd="imperative-action",d4="window-resize",tC=b.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Ps,currentIdRef:{current:null},currentContextRef:{current:null}});function f4(e,t){e.current=t.current}function h4(e){const{children:t,delay:s,timeoutMs:i=0}=e,o=b.useRef(s),l=b.useRef(s),u=b.useRef(null),d=b.useRef(null),f=Un();return _e(()=>{if(l.current=s,!u.current){o.current=s;return}o.current={open:Io(o.current,"open"),close:Io(s,"close")}},[s,u,o,l]),v.jsx(tC.Provider,{value:b.useMemo(()=>({hasProvider:!0,delayRef:o,initialDelayRef:l,currentIdRef:u,timeoutMs:i,currentContextRef:d,timeout:f}),[i,f]),children:t})}function p4(e,t={open:!1}){const{open:s}=t,i=e.useState("floatingId"),o=b.useContext(tC),{currentIdRef:l,delayRef:u,timeoutMs:d,initialDelayRef:f,currentContextRef:g,hasProvider:m,timeout:h}=o,[x,S]=b.useState(!1),w=b.useRef(s);return _e(()=>{w.current=s},[s]),_e(()=>{function C(){g.current?.setIsInstantPhase(!1),l.current=null,g.current=null,u.current=f.current,h.clear()}if(l.current&&!s&&l.current===i){if(S(!1),d){const E=i;return h.start(d,()=>{e.select("open")||l.current&&l.current!==E||C()}),()=>{(w.current||l.current!==E)&&h.clear()}}C()}},[s,i,l,u,d,f,g,h,e]),_e(()=>{if(!s)return;const C=g.current,E=l.current;h.clear(),g.current={onOpenChange:e.setOpen,setIsInstantPhase:S},l.current=i,u.current={open:0,close:Io(f.current,"close")},E!==null&&E!==i?(S(!0),C?.setIsInstantPhase(!0),C?.onOpenChange(!1,ut(Mr))):(S(!1),C?.setIsInstantPhase(!1))},[s,i,e,l,u,f,g,h]),_e(()=>()=>{if(l.current===i){if(g.current=null,!w.current)return;l.current=null,f4(u,f),h.clear()}},[g,l,u,i,f,h]),b.useMemo(()=>({activeIdRef:l,hasProvider:m,delayRef:u,isInstantPhase:x}),[l,m,u,x])}function Lt(e,t,s,i){return e.addEventListener(t,s,i),()=>{e.removeEventListener(t,s,i)}}function yi(...e){return()=>{for(let t=0;t<e.length;t+=1){const s=e[t];s&&s()}}}function es(e,t,s,i){const o=tr(nC).current;return m4(o,e,t,s,i)&&rC(o,[e,t,s,i]),o.callback}function g4(e){const t=tr(nC).current;return y4(t,e)&&rC(t,e),t.callback}function nC(){return{callback:null,cleanup:null,refs:[]}}function m4(e,t,s,i,o){return e.refs[0]!==t||e.refs[1]!==s||e.refs[2]!==i||e.refs[3]!==o}function y4(e,t){return e.refs.length!==t.length||e.refs.some((s,i)=>s!==t[i])}function rC(e,t){if(e.refs=t,t.every(s=>s==null)){e.callback=null;return}e.callback=s=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),s!=null){const i=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const l=t[o];if(l!=null)switch(typeof l){case"function":{const u=l(s);typeof u=="function"&&(i[o]=u);break}case"object":{l.current=s;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const l=t[o];if(l!=null)switch(typeof l){case"function":{const u=i[o];typeof u=="function"?u():l(null);break}case"object":{l.current=null;break}}}}}}}function Ln(e){const t=tr(v4,e).current;return t.next=e,_e(t.effect),t}function v4(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Nv={...qR},Z0=Nv.useInsertionEffect,b4=Z0&&Z0!==Nv.useLayoutEffect?Z0:e=>e();function Be(e){const t=tr(x4).current;return t.next=e,b4(t.effect),t.trampoline}function x4(){const e={next:void 0,callback:S4,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function S4(){}const $f=null;class w4{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const s=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let o=0;o<s.length;o+=1)s[o]?.(t)};request(t){const s=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),s}cancel(t){const s=t-this.startId;s<0||s>=this.callbacks.length||this.callbacks[s]!==null&&(this.callbacks[s]=null,this.callbacksCount-=1)}}let Qf=new w4;class Or{static create(){return new Or}static request(t){return Qf.request(t)}static cancel(t){return Qf.cancel(t)}currentId=$f;request(t){this.cancel(),this.currentId=Qf.request(()=>{this.currentId=$f,t()})}cancel=()=>{this.currentId!==$f&&(Qf.cancel(this.currentId),this.currentId=$f)};disposeEffect=()=>this.cancel}function tc(){const e=tr(Or.create).current;return Sv(e.disposeEffect),e}function Qt(e){return e?.ownerDocument||document}const sC={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},rd={...sC,position:"fixed",margin:0,top:0,left:0},Tp={...sC,position:"absolute"},Ba=b.forwardRef(function(t,s){const[i,o]=b.useState();_e(()=>{_j&&Si&&o("button")},[]);const l={tabIndex:0,role:i};return v.jsx("span",{...t,ref:s,style:rd,"aria-hidden":i?void 0:!0,...l,"data-base-ui-focus-guard":""})}),nc=Math.min,Qi=Math.max,Fh=Math.round,Xf=Math.floor,Xi=e=>({x:e,y:e}),E4={left:"right",right:"left",bottom:"top",top:"bottom"};function iC(e,t,s){return Qi(e,nc(t,s))}function Va(e,t){return typeof e=="function"?e(t):e}function ms(e){return e.split("-")[0]}function vi(e){return e.split("-")[1]}function Dv(e){return e==="x"?"y":"x"}function jv(e){return e==="y"?"height":"width"}function js(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Iv(e){return Dv(js(e))}function R4(e,t,s){s===void 0&&(s=!1);const i=vi(e),o=Iv(e),l=jv(o);let u=o==="x"?i===(s?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(u=Bh(u)),[u,Bh(u)]}function C4(e){const t=Bh(e);return[Py(e),t,Py(t)]}function Py(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const vw=["left","right"],bw=["right","left"],T4=["top","bottom"],k4=["bottom","top"];function O4(e,t,s){switch(e){case"top":case"bottom":return s?t?bw:vw:t?vw:bw;case"left":case"right":return t?T4:k4;default:return[]}}function A4(e,t,s,i){const o=vi(e);let l=O4(ms(e),s==="start",i);return o&&(l=l.map(u=>u+"-"+o),t&&(l=l.concat(l.map(Py)))),l}function Bh(e){const t=ms(e);return E4[t]+e.slice(t.length)}function M4(e){var t,s,i,o;return{top:(t=e.top)!=null?t:0,right:(s=e.right)!=null?s:0,bottom:(i=e.bottom)!=null?i:0,left:(o=e.left)!=null?o:0}}function aC(e){return typeof e!="number"?M4(e):{top:e,right:e,bottom:e,left:e}}function Uu(e){const{x:t,y:s,width:i,height:o}=e;return{width:i,height:o,top:s,left:t,right:t+i,bottom:s+o,x:t,y:s}}function Bl(e,t){return t<0||t>=e.length}function wh(e,t){return Vl(e.current,{disabledIndices:t})}function Ly(e,t){return Vl(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function N4(e,t,s){const{decrement:i,loopFocus:o,allowEscape:l,disabledIndices:u,minIndex:d,maxIndex:f}=s,g=()=>Vl(e,{startingIndex:t,decrement:i,disabledIndices:u});let m,h=!1;if(!o)m=i?Math.max(d,g()):Math.min(f,g());else if(i?t<=d:t>=f){const x=i?-1:e.length;l&&t!==x?m=-1:(m=i?f:d,h=!0)}else m=g();return{index:Bl(e,m)?-1:m,wrapped:h}}function Vl(e,{startingIndex:t=-1,decrement:s=!1,disabledIndices:i,amount:o=1}={}){let l=t;do l+=s?-o:o;while(l>=0&&l<=e.length-1&&Kl(e,l,i));return l}function Kl(e,t,s){if(typeof s=="function"?s(t):s?.includes(t)??!1)return!0;const o=e[t];return o?!kp(o)||o.matches(":disabled")?!0:!s&&(o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"):!1}function D4(e){return e.visibility==="hidden"||e.visibility==="collapse"}function kp(e,t=e?ys(e):null){return!e||!e.isConnected||!t||D4(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const j4='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function I4(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const s=e.getRootNode();return jo(s)?s.host:null}function zy(e){for(const t of Array.from(e.children))if(Rr(t)==="summary")return t;return null}function P4(e,t){const s=zy(t);return!!s&&(e===s||it(s,e))}function oC(e){const t=e?Rr(e):"";return e!=null&&e.matches(j4)&&(t!=="summary"||e.parentElement!=null&&Rr(e.parentElement)==="details"&&zy(e.parentElement)===e)&&(t!=="details"||zy(e)==null)&&(t!=="input"||e.type!=="hidden")}function Pv(e){if(!oC(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=I4(t)){const s=t!==e,i=Rr(t)==="slot";if(t.hasAttribute("inert")||s&&Rr(t)==="details"&&!t.open&&!P4(e,t)||t.hasAttribute("hidden")||!i&&!L4(t,s))return!1}return!0}function L4(e,t){const s=ys(e);return t?s.display!=="none":kp(e,s)}function lC(e){const t=e.tabIndex;if(t<0){const s=Rr(e);if(s==="details"||s==="audio"||s==="video"||bn(e)&&e.isContentEditable)return 0}return t}function J0(e){if(Rr(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function cC(e,t){const s=J0(e);if(!s)return!0;const i=t.find(o=>{const l=J0(o);return l?.name===s.name&&l.form===s.form&&l.checked});return i?i===s:t.find(o=>{const l=J0(o);return l?.name===s.name&&l.form===s.form})===s}function uC(e){if(bn(e)&&Rr(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return bn(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Lv(e,t){uC(e).forEach(s=>{oC(s)&&t.push(s),Lv(s,t)})}function dC(e,t,s){uC(e).forEach(i=>{bn(i)&&i.matches(t)&&s.push(i),dC(i,t,s)})}function Op(e){return Pv(e)&&lC(e)>=0}function fC(e){const t=[];return Lv(e,t),t.filter(Pv)}function Ap(e){const t=fC(e);return t.filter(s=>lC(s)>=0&&cC(s,t))}function hC(e,t){const s=Ap(e),i=s.length;if(i===0)return;const o=Jr(Qt(e)),l=s.indexOf(o),u=l===-1?t===1?0:i-1:l+t;return s[u]}function pC(e){return hC(Qt(e).body,1)||e}function gC(e){return hC(Qt(e).body,-1)||e}function z4(e,t,s){if(!e)return null;const i=[];Lv(Qt(e).body,i);const o=i.indexOf(e);if(o===-1)return null;const l=i.filter(Pv);for(let u=1;u<i.length;u+=1){const d=i[(o+t*u+i.length)%i.length];if(!it(s,d)&&Op(d)&&cC(d,l))return d}return i[o]}function ql(e,t){const s=t||e.currentTarget,i=e.relatedTarget;return!i||!it(s,i)}function _4(e){Ap(e).forEach(s=>{s.dataset.tabindex=s.getAttribute("tabindex")||"",s.setAttribute("tabindex","-1")})}function xw(e){const t=[];dC(e,"[data-tabindex]",t),t.forEach(s=>{const i=s.dataset.tabindex;delete s.dataset.tabindex,i?s.setAttribute("tabindex",i):s.removeAttribute("tabindex")})}function Ka(e,t,s=!0){return e.filter(o=>o.parentId===t).flatMap(o=>[...!s||o.context?.open?[o]:[],...Ka(e,o.id,s)])}function Sw(e,t){let s=[],i=e.find(o=>o.id===t)?.parentId;for(;i;){const o=e.find(l=>l.id===i);i=o?.parentId,o&&(s=s.concat(o))}return s}function Yl(e){return`data-base-ui-${e}`}let Zf=0;function Eh(e,t={}){const{preventScroll:s=!1,sync:i=!1,shouldFocus:o}=t;cancelAnimationFrame(Zf);function l(){o&&!o()||e?.focus({preventScroll:s})}if(i)return l(),En;const u=requestAnimationFrame(l);return Zf=u,()=>{Zf===u&&(cancelAnimationFrame(u),Zf=0)}}const ww="data-base-ui-inert";let hu=new WeakMap,Jf=new WeakSet,pu=new WeakMap,W0=0;function mC(e){return e?jo(e)?e.host:mC(e.parentNode):null}const Ew=(e,t)=>t.map(s=>{if(e.contains(s))return s;const i=mC(s);return e.contains(i)?i:null}).filter(s=>s!=null),Rw=e=>{const t=new Set;return e.forEach(s=>{let i=s;for(;i&&!t.has(i);)t.add(i),i=i.parentNode}),t},Cw=(e,t,s)=>{const i=[],o=l=>{!l||s.has(l)||Array.from(l.children).forEach(u=>{Rr(u)!=="script"&&(t.has(u)?o(u):i.push(u))})};return o(e),i};function U4(e,t,s,{mark:i=!0}){const o=Ew(t,e),l=i?Cw(t,Rw(o),new Set(o)):[],u=[],d=[];if(s){const f=Ew(t,Array.from(t.querySelectorAll("[aria-live]"))),g=o.concat(f);Cw(t,Rw(g),new Set(g)).forEach(h=>{const x=h.getAttribute("aria-hidden"),S=x!==null&&x!=="false",w=(hu.get(h)||0)+1;hu.set(h,w),u.push(h),w===1&&S&&Jf.add(h),S||h.setAttribute("aria-hidden","true")})}return i&&l.forEach(f=>{const g=(pu.get(f)||0)+1;pu.set(f,g),d.push(f),g===1&&f.setAttribute(ww,"")}),W0+=1,()=>{u.forEach(f=>{const g=(hu.get(f)||0)-1;hu.set(f,g),g||(Jf.has(f)||f.removeAttribute("aria-hidden"),Jf.delete(f))}),i&&d.forEach(f=>{const g=(pu.get(f)||0)-1;pu.set(f,g),g||f.removeAttribute(ww)}),W0-=1,W0||(hu=new WeakMap,Jf=new WeakSet,pu=new WeakMap)}}function Tw(e,t={}){const{ariaHidden:s=!1,mark:i=!0}=t,o=Qt(e[0]).body;return U4(e,o,s,{mark:i})}var hr=YR();const H4=KR(hr);function yC(){const[,e]=b.useState({});return b.useCallback(()=>{e({})},[])}let kw=0;function F4(e,t="mui"){const s=b.useRef(void 0),i=yC(),o=e??s.current;return b.useEffect(()=>{s.current==null&&(kw+=1,s.current=`${t}-${kw}`,e==null&&i())},[e,t,i]),o}const Ow=Nv.useId;function ac(e,t){if(Ow!==void 0){const s=Ow();return e??(t?`${t}-${s}`:s)}return F4(e,t)}const B4=parseInt(b.version,10);function zv(e){return B4>=e}function Aw(e){if(!b.isValidElement(e))return null;const t=e,s=t.props;return(zv(19)?s?.ref:t.ref)??null}function _y(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function V4(e,t){const s={};for(const i in e){const o=e[i];if(t?.hasOwnProperty(i)){const l=t[i](o);l!=null&&Object.assign(s,l);continue}o===!0?s[`data-${i.toLowerCase()}`]="":o&&(s[`data-${i.toLowerCase()}`]=o.toString())}return s}function K4(e,t){return typeof e=="function"?e(t):e}function vC(e,t){return typeof e=="function"?e(t):e}const bC={};function Ar(e,t,s,i,o){if(!s&&!i&&!o&&!e)return Vh(t);let l=Vh(e);return t&&(l=bu(l,t)),s&&(l=bu(l,s)),i&&(l=bu(l,i)),o&&(l=bu(l,o)),l}function q4(e){if(e.length===0)return bC;if(e.length===1)return Vh(e[0]);let t=Vh(e[0]);for(let s=1;s<e.length;s+=1)t=bu(t,e[s]);return t}function Vh(e){return SC(e)?{...e(bC)}:Y4(e)}function bu(e,t){return SC(t)?t(e):G4(e,t)}function Y4(e){const t={...e};for(const s in t){const i=t[s];xC(s,i)&&(t[s]=wC(i))}return t}function G4(e,t){if(!t)return e;for(const s in t){const i=t[s];switch(s){case"style":{e[s]=_y(e.style,i);break}case"className":{e[s]=EC(e.className,i);break}default:xC(s,i)?e[s]=$4(e[s],i):e[s]=i}}return e}function xC(e,t){const s=e.charCodeAt(0),i=e.charCodeAt(1),o=e.charCodeAt(2);return s===111&&i===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function SC(e){return typeof e=="function"}function $4(e,t){return t?e?(...s)=>{const i=s[0];if(RC(i)){const l=i;Kh(l);const u=t(...s);return l.baseUIHandlerPrevented||e?.(...s),u}const o=t(...s);return e?.(...s),o}:wC(t):e}function wC(e){return e&&((...t)=>{const s=t[0];return RC(s)&&Kh(s),e(...t)})}function Kh(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function EC(e,t){return t?e?t+" "+e:t:e}function RC(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function kt(e,t,s={}){let i=t.render;s.enabled!==!1&&(i=_v(i));const o=Q4(t,s,i);if(s.enabled===!1)return null;const l=s.state??Xt;return J4(e,i,o,l)}function Q4(e,t,s){const{className:i,style:o}=e,{state:l=Xt,ref:u,props:d,stateAttributesMapping:f,enabled:g=!0}=t,m=g?K4(i,l):void 0,h=g?vC(o,l):void 0,x=g?V4(l,f):Xt,S=g&&d?X4(d):void 0,w=g?_y(x,S)??{}:Xt;return typeof document<"u"&&(g?Array.isArray(u)?w.ref=g4([w.ref,Aw(s),...u]):w.ref=es(w.ref,Aw(s),u):es(null,null)),g?(m!==void 0&&(w.className=EC(w.className,m)),h!==void 0&&(w.style=_y(w.style,h)),w):Xt}function X4(e){return Array.isArray(e)?q4(e):Ar(void 0,e)}const Z4=Symbol.for("react.lazy");function _v(e){if(e?.$$typeof!==Z4)return e;const t=b.Children.toArray(e)[0];return b.isValidElement(t)?t:e}function J4(e,t,s,i){if(t){if(typeof t=="function")return t(s,i);const o=Ar(s,t.props);return o.ref=s.ref,b.cloneElement(t,o)}return W4(e,s)}function W4(e,t){return e==="button"?b.createElement("button",{type:"button",...t,key:t.key}):e==="img"?b.createElement("img",{alt:"",...t,key:t.key}):b.createElement(e,t)}const eI=500,CC=500,tI={style:{transition:"none"}},Uv="data-base-ui-click-trigger",TC={fallbackAxisSide:"none"},Hv={fallbackAxisSide:"end"},nI={clipPath:"inset(50%)",position:"fixed",top:0,left:0},kC=b.createContext(null),OC=()=>b.useContext(kC),rI=Yl("portal");function AC(e={}){const{ref:t,container:s,componentProps:i=Xt,elementProps:o}=e,l=ac(),d=OC()?.portalNode,[f,g]=b.useState(null),[m,h]=b.useState(null),x=Be(E=>{E!==null&&h(E)}),S=b.useRef(null);_e(()=>{if(s===null){S.current&&(S.current=null,h(null),g(null));return}const E=(s&&(Cv(s)?s:s.current))??d??document.body;if(E==null){S.current&&(S.current=null,h(null),g(null));return}S.current!==E&&(S.current=E,h(null),g(E))},[s,d]);const w=kt("div",i,{ref:[t,x],props:[{id:l,[rI]:""},o]}),C=f&&w?hr.createPortal(w,f):null;return{node:m,nodeId:b.isValidElement(w)?w.props.id:void 0,subtree:C}}const Mp=b.forwardRef(function(t,s){const{render:i,className:o,style:l,children:u,container:d,portalOwnerRole:f,...g}=t,{node:m,nodeId:h,subtree:x}=AC({container:d,ref:s,componentProps:t,elementProps:g}),S=b.useRef(null),w=b.useRef(null),C=b.useRef(null),E=b.useRef(null),[R,k]=b.useState(null),O=b.useRef(!1),A=R?.modal,N=R?.open,j=!!R&&!R.modal&&R.open&&!!m;b.useEffect(()=>{if(!m||A)return;function M(_){m&&_.relatedTarget&&ql(_)&&(_.type==="focusin"?O.current&&(xw(m),O.current=!1):(_4(m),O.current=!0))}return yi(Lt(m,"focusin",M,!0),Lt(m,"focusout",M,!0))},[m,A]),_e(()=>{!m||N!==!0||!O.current||(xw(m),O.current=!1)},[N,m]);const D=b.useMemo(()=>({beforeOutsideRef:S,afterOutsideRef:w,beforeInsideRef:C,afterInsideRef:E,portalNode:m,setFocusManagerState:k}),[m]);return v.jsxs(b.Fragment,{children:[x,v.jsxs(kC.Provider,{value:D,children:[j&&m&&v.jsx(Ba,{"data-type":"outside",ref:S,onFocus:M=>{if(ql(M,m))C.current?.focus();else{const _=R?R.domReference:null;gC(_)?.focus()}}}),j&&m&&v.jsx("span",{role:f,"aria-owns":h,style:nI}),m&&hr.createPortal(u,m),j&&m&&v.jsx(Ba,{"data-type":"outside",ref:w,onFocus:M=>{if(ql(M,m))E.current?.focus();else{const _=R?R.domReference:null;pC(_)?.focus(),R?.closeOnFocusOut&&R?.onOpenChange(!1,ut(Fa,M.nativeEvent))}}})]})]})});function MC(){const e=new Map;return{emit(t,s){e.get(t)?.forEach(i=>i(s))},on(t,s){e.has(t)||e.set(t,new Set),e.get(t).add(s)},off(t,s){e.get(t)?.delete(s)}}}class Fv{nodesRef={current:[]};events=MC();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const s=this.nodesRef.current.findIndex(i=>i===t);s!==-1&&this.nodesRef.current.splice(s,1)}}const NC=b.createContext(null),DC=b.createContext(null),$a=()=>b.useContext(NC)?.id||null,Qa=e=>{const t=b.useContext(DC);return e??t};function Bv(e){const t=ac(),s=Qa(e),i=$a();return _e(()=>{if(!t)return;const o={id:t,parentId:i};return s?.addNode(o),()=>{s?.removeNode(o)}},[s,t,i]),t}function jC(e){const{children:t,id:s}=e,i=$a();return v.jsx(NC.Provider,{value:b.useMemo(()=>({id:s,parentId:i}),[s,i]),children:t})}function IC(e){const{children:t,externalTree:s}=e,i=tr(()=>s??new Fv).current;return v.jsx(DC.Provider,{value:i,children:t})}function Ki(e){return e==null?e:"current"in e?e.current:e}function sI(e,t){const s=Rn(nr(e));return e instanceof s.KeyboardEvent?"keyboard":e instanceof s.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||(ec(e)?"keyboard":t||"mouse"):"touches"in e?"touch":e instanceof s.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const Mw=20;let za=[];function Vv(){za=za.filter(e=>e.deref()?.isConnected)}function Nw(e){Vv(),e&&Rr(e)!=="body"&&(za.push(new WeakRef(e)),za.length>Mw&&(za=za.slice(-Mw)))}function Dw(){return Vv(),za[za.length-1]?.deref()}function iI(e){return e?Op(e)?e:Ap(e)[0]||e:null}function jw(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const s=fC(e).filter(o=>{const l=o.getAttribute("data-tabindex")||"";return Op(o)||o.hasAttribute("data-tabindex")&&!l.startsWith("-")}),i=e.getAttribute("tabindex");s.length===0?i!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Np(e){const{context:t,children:s,disabled:i=!1,initialFocus:o=!0,returnFocus:l=!0,explicitReturnFocus:u,restoreFocus:d=!1,modal:f=!0,closeOnFocusOut:g=!0,openInteractionType:m="",nextFocusableElement:h,previousFocusableElement:x,beforeContentFocusGuardRef:S,externalTree:w,getInsideElements:C}=e,E=t.useState("open"),R=t.useState("domReferenceElement"),k=t.useState("floatingElement"),{events:O,dataRef:A}=t.context,N=Be(()=>A.current.floatingContext?.nodeId),j=o===!1,D=Iy(R)&&j,M=Ln(o),_=Ln(l),L=Ln(u),q=Ln(m),X=Ln(E),B=Qa(w),H=OC(),U=b.useRef(!1),z=b.useRef(!1),Q=b.useRef(!1),$=b.useRef(null),K=b.useRef(""),Y=b.useRef(""),ee=b.useRef(null),G=b.useRef(null),oe=es(ee,S,H?.beforeInsideRef),I=es(G,H?.afterInsideRef),V=Un(),W=Un(),re=tc(),Ee=H!=null,le=Uh(k),me=Be((ve=le)=>ve?Ap(ve):[]),ge=Be(()=>C?.().filter(ve=>ve!=null)??[]);b.useEffect(()=>{if(i||!f)return;function ve(Oe){Oe.key==="Tab"&&it(le,Jr(Qt(le)))&&me().length===0&&!D&&Ys(Oe)}const Pe=Qt(le);return Lt(Pe,"keydown",ve)},[i,le,f,D,me]),b.useEffect(()=>{if(i||!E)return;const ve=Qt(le);function Pe(){Q.current=!1}function Oe(Ve){const ke=nr(Ve),Ue=ge(),be=it(k,ke)||it(R,ke)||it(H?.portalNode,ke)||Ue.some(He=>He===ke||it(He,ke));Q.current=!be,Y.current=Ve.pointerType||"keyboard",zu(ke,`[${Uv}]`)&&(z.current=!0,W.start(0,()=>{z.current=!1}))}function Le(){Y.current="keyboard"}return yi(Lt(ve,"pointerdown",Oe,!0),Lt(ve,"pointerup",Pe,!0),Lt(ve,"pointercancel",Pe,!0),Lt(ve,"keydown",Le,!0),Pe)},[i,k,R,le,E,H,W,ge]),b.useEffect(()=>{if(i||!g)return;const ve=Qt(le);function Pe(){z.current=!0,W.start(0,()=>{z.current=!1})}function Oe(Ue){const be=nr(Ue);Op(be)&&($.current=be)}function Le(Ue){const be=Ue.relatedTarget,He=Ue.currentTarget,Ze=nr(Ue);f&&be==null&&Ze!=null&&it(k,Ze)&&Nw(Ze),queueMicrotask(()=>{const ot=N(),de=t.context.triggerElements,we=ge(),Ge=be?.hasAttribute(Yl("focus-guard"))&&[ee.current,G.current,H?.beforeInsideRef.current,H?.afterInsideRef.current,H?.beforeOutsideRef.current,H?.afterOutsideRef.current,Ki(x),Ki(h)].includes(be),Me=!(it(R,be)||it(k,be)||it(be,k)||it(H?.portalNode,be)||we.some(De=>De===be||it(De,be))||de.hasMatchingElement(De=>it(De,be))||Ge||B&&(Ka(B.nodesRef.current,ot).find(De=>it(De.context?.elements.floating,be)||it(De.context?.elements.domReference,be))||Sw(B.nodesRef.current,ot).find(De=>[De.context?.elements.floating,Uh(De.context?.elements.floating)].includes(be)||De.context?.elements.domReference===be)));if(He===R&&le&&jw(le),d&&He!==R&&!kp(Ze)&&Jr(ve)===ve.body){if(bn(le)&&(le.focus(),d==="popup")){re.request(()=>{le.focus()});return}const De=me(),bt=$.current,dt=(bt&&De.includes(bt)?bt:null)||De[De.length-1]||le;bn(dt)&&dt.focus()}if(A.current.insideReactTree){A.current.insideReactTree=!1;return}(D||!f)&&be&&Me&&!z.current&&(D||be!==Dw())&&(U.current=!0,t.setOpen(!1,ut(Fa,Ue)))})}function Ve(){Q.current||(A.current.insideReactTree=!0,V.start(0,()=>{A.current.insideReactTree=!1}))}const ke=bn(R)?R:null;if(!(!k&&!ke))return yi(ke&&Lt(ke,"focusout",Le),ke&&Lt(ke,"pointerdown",Pe),k&&Lt(k,"focusin",Oe),k&&Lt(k,"focusout",Le),k&&H&&Lt(k,"focusout",Ve,!0))},[i,R,k,le,f,B,H,t,g,d,me,D,N,A,V,W,re,h,x,ge]),b.useEffect(()=>{if(i||!k||!E)return;const ve=Array.from(H?.portalNode?.querySelectorAll(`[${Yl("portal")}]`)||[]),Oe=(B?Sw(B.nodesRef.current,N()):[]).find(He=>Iy(He.context?.elements.domReference||null))?.context?.elements.domReference,Ve=[...[k,...ve,ee.current,G.current,H?.beforeOutsideRef.current,H?.afterOutsideRef.current,...ge()],Oe,Ki(x),Ki(h),D?R:null].filter(He=>He!=null),ke=Tw(Ve,{ariaHidden:f||D,mark:!1}),Ue=[k,...ve].filter(He=>He!=null),be=Tw(Ue);return()=>{be(),ke()}},[E,i,R,k,f,H,D,B,N,h,x,ge]),_e(()=>{if(!E||i||!bn(le))return;K.current="",Y.current="";const ve=Qt(le),Pe=Jr(ve);queueMicrotask(()=>{const Oe=M.current,Le=typeof Oe=="function"?Oe(q.current||""):Oe;if(Le===void 0||Le===!1||it(le,Pe))return;let ke=null;const Ue=()=>(ke==null&&(ke=me(le)),ke[0]||le);let be;Le===!0||Le===null?be=Ue():be=Ki(Le),be=be||Ue();const He=it(le,Jr(ve)),Ze=A.current.openEvent,ot=Ze?.type==="mousedown"&&ec(Ze);Eh(be,{sync:ot,preventScroll:be===le,shouldFocus(){if(!X.current)return!1;if(He)return!0;const de=Jr(ve);return!(de!==be&&it(le,de))}})})},[i,E,le,me,M,q,X,A]);const ue=b.useRef(null);_e(()=>{if(i||!le){ue.current=null;return}ue.current&&(ue.current.cancelled=!0,ue.current=null);const ve=Qt(le),Pe=Jr(ve),Oe=q.current==null;Nw(Pe);function Le(ke){if(ke.open||(K.current=sI(ke.nativeEvent,Y.current)),(ke.reason===Fa&&ke.triggerElement?.hasAttribute(Yl("focus-guard"))||ke.reason===Kn&&ke.nativeEvent.type==="mouseleave")&&(U.current=!0),ke.reason===Cp)if(ke.nested)U.current=!1;else if(ec(ke.nativeEvent)||Rv(ke.nativeEvent))U.current=!1;else{let Ue=!1;Qt(le).createElement("div").focus({get preventScroll(){return Ue=!0,!1}}),Ue?U.current=!1:U.current=!0}}O.on("openchange",Le);function Ve(ke){const Ue=_.current;let be=typeof Ue=="function"?Ue(ke):Ue;if(be===void 0||be===!1)return null;be===null&&(be=!0);const He=R?.isConnected?R:null,Ze=Pe?.isConnected&&Rr(Pe)!=="body"?Pe:null;let ot=Oe?Ze||He:He||Ze;return ot||(ot=Dw()||null),typeof be=="boolean"?ot:Ki(be)||ot||null}return()=>{O.off("openchange",Le);const ke=Jr(ve),Ue=ge(),be=it(k,ke)||Ue.some(we=>we===ke||it(we,ke))||B&&Ka(B.nodesRef.current,N(),!1).some(we=>it(we.context?.elements.floating,ke)),He=_.current,Ze=K.current,ot=Ve(Ze),de={cancelled:!1};ue.current=de,queueMicrotask(()=>{ue.current===de&&(ue.current=null);const we=iI(ot),Ge=L.current??typeof He!="boolean";if(!de.cancelled&&He&&!U.current&&bn(we)&&(!(!Ge&&we!==ke&&ke!==ve.body)||be)){const Me={preventScroll:!0};Ze==="keyboard"&&(Me.focusVisible=!0),we.focus(Me)}U.current=!1})}},[i,k,le,_,L,q,O,B,R,N,ge]),_e(()=>{if(!Si||E||!k)return;const ve=Jr(Qt(k));!bn(ve)||!ed(ve)||it(k,ve)&&ve.blur()},[E,k]),_e(()=>{if(!(i||!H))return H.setFocusManagerState({modal:f,closeOnFocusOut:g,open:E,onOpenChange:t.setOpen,domReference:R}),()=>{H.setFocusManagerState(null)}},[i,H,f,E,t,g,R]),_e(()=>{if(!(i||!le))return jw(le),()=>{queueMicrotask(Vv)}},[i,le]);const Te=!i&&(f?!D:!0)&&(Ee||f);return v.jsxs(b.Fragment,{children:[Te&&v.jsx(Ba,{"data-type":"inside",ref:oe,onFocus:ve=>{if(f){const Pe=me();Eh(Pe[Pe.length-1])}else H?.portalNode&&(U.current=!1,ql(ve,H.portalNode)?pC(R)?.focus():Ki(x??H.beforeOutsideRef)?.focus())}}),s,Te&&v.jsx(Ba,{"data-type":"inside",ref:I,onFocus:ve=>{f?Eh(me()[0]):H?.portalNode&&(g&&(U.current=!0),ql(ve,H.portalNode)?gC(R)?.focus():Ki(h??H.afterOutsideRef)?.focus())}})]})}function Dp(e,t={}){const{enabled:s=!0,event:i="click",toggle:o=!0,ignoreMouse:l=!1,stickIfOpen:u=!0,touchOpenDelay:d=0,reason:f=Qs}=t,g=e.context.dataRef,m=b.useRef(void 0),h=tc(),x=Un(),S=b.useMemo(()=>{function w(E,R,k,O){const A=ut(f,R,k);E&&O==="touch"&&d>0?x.start(d,()=>{e.setOpen(!0,A)}):e.setOpen(E,A)}function C(E,R,k){const O=g.current.openEvent,A=e.select("domReferenceElement")!==R;return E&&A||!E||!o?!0:O&&(typeof u=="function"?u():u)?!k(O.type):!1}return{onPointerDown(E){m.current=Ua(E.pointerType,!0)&&Rv(E.nativeEvent)?"virtual":E.pointerType},onMouseDown(E){const R=m.current,k=E.nativeEvent,O=e.select("open");if(E.button!==0||i==="click"||Ua(R,!0)&&l)return;const A=C(O,E.currentTarget,M=>M==="click"||M==="mousedown"),N=nr(k),j=ed(N);if(j||R==="virtual"){w(A,k,j?N:E.currentTarget,R);return}const D=E.currentTarget;h.request(()=>{w(A,k,D,R)})},onClick(E){if(i==="mousedown-only")return;const R=m.current;if(i==="mousedown"&&R){m.current=void 0;return}if(Ua(R,!0)&&l)return;const k=e.select("open"),O=C(k,E.currentTarget,A=>A==="click"||A==="mousedown"||A==="keydown"||A==="keyup");w(O,E.nativeEvent,E.currentTarget,R)},onKeyDown(){m.current=void 0}}},[g,i,l,f,e,u,o,h,x,d]);return b.useMemo(()=>s?{reference:S}:Xt,[s,S])}function aI(e,t){let s=null,i=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){const l=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},u=t.axis==="x"||t.axis==="both",d=t.axis==="y"||t.axis==="both",f=["mouseenter","mousemove"].includes(t.dataRef.current.openEvent?.type||"")&&t.pointerType!=="touch",g=t.axis==="y"?l.width:0,m=t.axis==="x"?l.height:0;let h=l.x,x=l.y;return s==null&&t.x&&u&&(s=l.x-t.x),i==null&&t.y&&d&&(i=l.y-t.y),h-=s||0,x-=i||0,(!o||f)&&(h=u&&t.x!=null?t.x:h,x=d&&t.y!=null?t.y:x),o=!0,{width:g,height:m,x:h,y:x,top:x,right:h+g,bottom:x+m,left:h}}}}function Iw(e){return e!=null&&e.clientX!=null}function oI(e,t={}){const{enabled:s=!0,axis:i="both"}=t,o=e.useState("open"),l=e.useState("floatingElement"),u=e.useState("domReferenceElement"),d=e.context.dataRef,f=b.useRef(!1),g=b.useRef(null),[m,h]=b.useState(),[x,S]=b.useState([]),w=Be(O=>{e.set("positionReference",O)}),C=Be((O,A,N)=>{f.current||d.current.openEvent&&!Iw(d.current.openEvent)||e.set("positionReference",aI(N??u,{x:O,y:A,axis:i,dataRef:d,pointerType:m}))}),E=Be(O=>{o?g.current||(C(O.clientX,O.clientY,O.currentTarget),S([])):C(O.clientX,O.clientY,O.currentTarget)}),R=Ua(m)?l:o;b.useEffect(()=>{if(!s){w(u);return}if(!R)return;function O(){g.current?.(),g.current=null}const A=Rn(l);function N(j){const D=nr(j);it(l,D)?O():C(j.clientX,j.clientY)}return!d.current.openEvent||Iw(d.current.openEvent)?g.current=Lt(A,"mousemove",N):w(u),O},[R,s,l,d,u,e,C,w,x]),b.useEffect(()=>()=>{e.set("positionReference",null)},[e]),b.useEffect(()=>{s&&!l&&(f.current=!1)},[s,l]),b.useEffect(()=>{!s&&o&&(f.current=!0)},[s,o]);const k=b.useMemo(()=>{function O(A){h(A.pointerType)}return{onPointerDown:O,onPointerEnter:O,onMouseMove:E,onMouseEnter:E}},[E]);return b.useMemo(()=>s?{reference:k,trigger:k}:{},[s,k])}function lI(){return!1}function cI(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function sd(e,t={}){const{enabled:s=!0,escapeKey:i=!0,outsidePress:o=!0,outsidePressEvent:l="sloppy",referencePress:u=lI,bubbles:d,externalTree:f}=t,g=e.useState("open"),m=e.useState("floatingElement"),{dataRef:h,events:x}=e.context,S=Qa(f),w=Be(typeof o=="function"?o:()=>!1),C=typeof o=="function"?w:o,E=C!==!1,R=Be(()=>l),{escapeKey:k,outsidePress:O}=cI(d),A=b.useRef(!1),N=b.useRef(!1),j=b.useRef(!1),D=b.useRef(!1),M=b.useRef(!1),_=b.useRef(""),L=b.useRef(null),q=Un(),X=Un(),B=Un(),H=Be(()=>{X.clear(),h.current.insideReactTree=!1}),U=Be(I=>{const V=h.current.floatingContext?.nodeId;return(S?Ka(S.nodesRef.current,V):[]).some(re=>re.context?.open&&!re.context.dataRef.current[I])}),z=Be(I=>X0(I,e.select("floatingElement"))||X0(I,e.select("domReferenceElement"))),Q=Be(I=>{u()&&e.setOpen(!1,ut(Qs,I.nativeEvent))}),$=Be(I=>{if(!g||!s||!i||I.key!=="Escape")return;const V=Uj(I)?I.nativeEvent:I;if(M.current||V.isComposing||!k&&U("__escapeKeyBubbles"))return;const W=ut(td,V);e.setOpen(!1,W),W.isCanceled||I.preventDefault(),!k&&!W.isPropagationAllowed&&I.stopPropagation()}),K=Be(()=>{h.current.insideReactTree=!0,X.start(0,H)}),Y=Be(I=>{if(!g||!s||I.button!==0)return;const V=nr(I.nativeEvent);it(e.select("floatingElement"),V)&&(A.current||(A.current=!0,N.current=!1))}),ee=Be(I=>{!g||!s||(I.defaultPrevented||I.nativeEvent.defaultPrevented)&&A.current&&(N.current=!0)});b.useEffect(()=>{function I(V){V.open||(D.current=!1)}return x.on("openchange",I),()=>{x.off("openchange",I)}},[x]),b.useEffect(()=>H,[H]),b.useEffect(()=>{if(!g||!s)return g||(D.current=!1,M.current=!1,_.current="",L.current=null),H;h.current.__escapeKeyBubbles=k,h.current.__outsidePressBubbles=O;const I=new Ps,V=Qt(m);function W(){B.clear(),M.current=!0}function re(){M.current=!0,B.start(Si?5:0,()=>{M.current=!1})}function Ee(){j.current=!0,I.start(0,()=>{j.current=!1})}function le(){A.current=!1,N.current=!1}function me(){const de=_.current,we=de==="pen"||!de?"mouse":de,Ge=R(),Me=typeof Ge=="function"?Ge():Ge;return typeof Me=="string"?Me:Me[we]}function ge(de){const we=me();return we==="intentional"&&de.type!=="click"||we==="sloppy"&&de.type==="click"}function ue(de){const we=h.current.floatingContext?.nodeId,Ge=S&&Ka(S.nodesRef.current,we).some(Me=>X0(de,Me.context?.elements.floating));return z(de)||Ge}function Te(de){if(ge(de)){de.type!=="click"&&!z(de)&&(I.clear(),j.current=!1),H();return}if(h.current.insideReactTree){H();return}const we=nr(de),Ge=`[${Yl("inert")}]`,Me=ln(we)?we.getRootNode():null,De=Array.from((jo(Me)?Me:Qt(e.select("floatingElement"))).querySelectorAll(Ge)),bt=e.context.triggerElements;if(we&&(bt.hasElement(we)||bt.hasMatchingElement(gt=>it(gt,we))))return;let dt=ln(we)?we:null;for(;dt&&!$i(dt);){const gt=Zi(dt);if($i(gt)||!ln(gt))break;dt=gt}if(!(De.length&&ln(we)&&!r4(we)&&!it(we,e.select("floatingElement"))&&De.every(gt=>!it(dt,gt)))){if(bn(we)&&!("touches"in de)){const gt=$i(we),Nt=ys(we),jt=/auto|scroll/,tn=gt||jt.test(Nt.overflowX),an=gt||jt.test(Nt.overflowY),nn=tn&&we.clientWidth>0&&we.scrollWidth>we.clientWidth,We=an&&we.clientHeight>0&&we.scrollHeight>we.clientHeight,wt=Nt.direction==="rtl",Zt=We&&(wt?de.offsetX<=we.offsetWidth-we.clientWidth:de.offsetX>we.clientWidth),ht=nn&&de.offsetY>we.clientHeight;if(Zt||ht)return}if(!ue(de)){if(me()==="intentional"){if(de.detail!==0&&!ec(de)&&!D.current)return;if(j.current){I.clear(),j.current=!1;return}}typeof C=="function"&&!C(de)||U("__outsidePressBubbles")||(e.setOpen(!1,ut(Cp,de)),H())}}}function ve(de){me()!=="sloppy"||de.pointerType==="touch"||!e.select("open")||!s||z(de)||Te(de)}function Pe(de){if(me()!=="sloppy"||!e.select("open")||!s||z(de))return;const we=de.touches[0];we&&(L.current={startTime:Date.now(),startX:we.clientX,startY:we.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},q.start(1e3,()=>{L.current&&(L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1)}))}function Oe(de,we){const Ge=nr(de);if(!Ge)return;const Me=Lt(Ge,de.type,()=>{we(de),Me()})}function Le(de){_.current="touch",Oe(de,Pe)}function Ve(de){q.clear(),de.type==="pointerdown"&&(de.button===0&&(D.current=!0),_.current=de.pointerType),!(de.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)&&Oe(de,we=>{we.type==="pointerdown"?ve(we):Te(we)})}function ke(de){if(de.type==="pointercancel"&&(D.current=!1),!A.current)return;const we=N.current;if(le(),me()==="intentional"){if(de.type==="pointercancel"){we&&Ee();return}if(!ue(de)){if(we){Ee();return}typeof C=="function"&&!C(de)||(I.clear(),j.current=!0,H())}}}function Ue(de){if(me()!=="sloppy"||!L.current||z(de))return;const we=de.touches[0];if(!we)return;const Ge=Math.abs(we.clientX-L.current.startX),Me=Math.abs(we.clientY-L.current.startY),De=Math.sqrt(Ge*Ge+Me*Me);De>5&&(L.current.dismissOnTouchEnd=!0),De>10&&(Te(de),q.clear(),L.current=null)}function be(de){Oe(de,Ue)}function He(de){me()!=="sloppy"||!L.current||z(de)||(L.current.dismissOnTouchEnd&&Te(de),q.clear(),L.current=null)}function Ze(de){Oe(de,He)}const ot=yi(i&&yi(Lt(V,"keydown",$),Lt(V,"compositionstart",W),Lt(V,"compositionend",re)),E&&yi(Lt(V,"click",Ve,!0),Lt(V,"pointerdown",Ve,!0),Lt(V,"pointerup",ke,!0),Lt(V,"pointercancel",ke,!0),Lt(V,"mousedown",Ve,!0),Lt(V,"mouseup",ke,!0),Lt(V,"touchstart",Le,{capture:!0,passive:!0}),Lt(V,"touchmove",be,{capture:!0,passive:!0}),Lt(V,"touchend",Ze,{capture:!0,passive:!0})));return()=>{ot(),I.clear(),le(),j.current=!1}},[h,m,i,E,C,g,s,k,O,$,H,R,U,z,S,e,q,B]);const G=b.useMemo(()=>({onKeyDown:$,onPointerDown:Q,onClick:Q}),[$,Q]),oe=b.useMemo(()=>({onKeyDown:$,onPointerDown:ee,onMouseDown:ee,onClickCapture:K,onMouseDownCapture(I){K(),Y(I)},onPointerDownCapture(I){K(),Y(I)},onMouseUpCapture:K,onTouchEndCapture:K,onTouchMoveCapture:K}),[$,K,Y,ee]);return b.useMemo(()=>s?{reference:G,floating:oe,trigger:G}:{},[s,G,oe])}function PC(e){const{popupStore:t,treatPopupAsFloatingElement:s=!1,floatingRootContext:i,floatingId:o,nested:l,onOpenChange:u}=e,d=t.useState("open"),f=t.useState("activeTriggerElement"),g=t.useState(s?"popupElement":"positionerElement"),m=u;return t.useSyncedValue("floatingId",o),_e(()=>{const h={open:d,floatingId:o,referenceElement:f,floatingElement:g};ln(f)&&(h.domReferenceElement=f),i.state.positionReference===i.state.referenceElement&&(h.positionReference=f),i.update(h)},[d,o,f,g,i]),i.context.onOpenChange=m,i.context.nested=l,i}function _o(e,t=!1,s=!1,i=!1){const[o,l]=b.useState(e&&t?"idle":void 0),[u,d]=b.useState(e&&!i);return e&&!u&&(d(!0),l("starting")),!e&&u&&o!=="ending"&&!s&&l("ending"),!e&&!u&&o==="ending"&&l(void 0),_e(()=>{if(!e&&u&&o!=="ending"&&s){const f=Or.request(()=>{l("ending")});return()=>{Or.cancel(f)}}},[e,u,o,s]),_e(()=>{if(!e||t||o===void 0)return;const f=Or.request(()=>{l(void 0)});return()=>{Or.cancel(f)}},[t,e,o]),_e(()=>{if(!e||!t)return;e&&u&&o!=="idle"&&l("starting");const f=Or.request(()=>{l("idle")});return()=>{Or.cancel(f)}},[t,e,u,o]),{mounted:u,setMounted:d,transitionStatus:o}}function Pw(e,t){return e.getAnimations(t).filter(s=>{const i=s.effect?.getTiming();return i?.duration!==1/0&&i?.iterations!==1/0})}let Wf=null;function uI(e){if(!Wf){const t=[];Wf=t,queueMicrotask(()=>{Wf=null,hr.flushSync(()=>{for(const s of t)s()})})}Wf.push(e)}function jp(e,t=!1,s=!1){const i=tc();return Be((o,l=null)=>{i.cancel();const u=Ki(e);if(u==null)return;const d=u,f=()=>{if(!s){hr.flushSync(o);return}uI(()=>{l?.aborted||o()})};if(typeof d.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){o();return}function g(){Promise.all(Pw(d).map(m=>m.finished.then(En))).then(()=>{l?.aborted||f()},()=>{if(l?.aborted)return;if(Pw(d).some(h=>h.pending||h.playState!=="finished")){g();return}f()})}if(t){const m=Av;if(!d.hasAttribute(m)){i.request(g);return}const h=new MutationObserver(()=>{d.hasAttribute(m)||(h.disconnect(),g())});h.observe(d,{attributes:!0,attributeFilter:[m]}),l?.addEventListener("abort",()=>h.disconnect(),{once:!0});return}i.request(g)})}function Ls(e){const{enabled:t=!0,open:s,ref:i,batch:o=!1,onComplete:l}=e,u=Be(l),d=jp(i,s,o);b.useEffect(()=>{if(!t)return;const f=new AbortController;return d(u,f.signal),()=>{f.abort()}},[t,s,u,d])}function LC(e){const{open:t,ref:s,preventUnmountOnClose:i,setPreventUnmountOnClose:o,onUnmount:l,animateInitialOpen:u}=e,d=Be(o),{mounted:f,setMounted:g,transitionStatus:m}=_o(t,!1,!1,u),h=t?!1:i;_e(()=>{t&&d(!1)},[t,d]);const x=b.useRef(f),S=b.useRef(!1),w=yC(),C=()=>{x.current=!1,g(!1),l()};_e(()=>{x.current=f,S.current&&(S.current=!1,!t&&f&&C())});const E=Be(()=>{if(x.current){if(t){S.current=!0,w();return}C()}});return Ls({enabled:f&&!t&&!h,open:t,ref:s,onComplete(){t||E()}}),{mounted:f,transitionStatus:m,preventUnmountingOnClose:h,forceUnmount:E}}const id={tabIndex:-1,[Dy]:""};function zC(e){return t=>t==="touch"?e.current:!0}function Kv(e,t=!1){const s=ac(),i=$a()!=null,o=tr(()=>e(s,i)).current;return PC({popupStore:o,treatPopupAsFloatingElement:t,floatingRootContext:o.state.floatingRootContext,floatingId:s,nested:i,onOpenChange:o.setOpen}),o}function Ip({handle:e,store:t}){return _e(()=>e.attachStore(t),[e,t]),null}function Lw(e){const t=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==t&&e.set("triggerCount",t)}function dI(e,t){const s=b.useRef(null);return Be(i=>{const o=s.current;if(o!==null){if(o.element===i&&o.store===t&&o.id===e)return;s.current=null;const l=o.store;l.context.triggerElements.getById(o.id)===o.element&&(l.context.triggerElements.delete(o.id),Lw(l))}i!==null&&e!==void 0&&(s.current={store:t,id:e,element:i},t.context.triggerElements.add(e,i),Lw(t))})}function Pp(e,t,s,i=!1){let o=e.preventUnmountingOnClose;t?o=!1:i&&(o=!0);const l=s?.id??null;let u=e.activeTriggerId,d=e.activeTriggerElement;return(l||t)&&(u=l,d=s??null),{open:t,preventUnmountingOnClose:o,activeTriggerId:u,activeTriggerElement:d,openedWithoutTrigger:t?s==null:e.openedWithoutTrigger}}function Lp(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function fI(e,t,s,i={}){const o=s.reason,l=o===Kn,u=t&&o===Fl,d=!t&&(o===Qs||o===td),f=Lp(s);if(e.context.onOpenChange?.(t,s),s.isCanceled)return;i.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,s);const g=()=>{const m=Pp(e.state,t,s.trigger,f()),h={...i.extraState,...m};u?h.instantType="focus":d?h.instantType="dismiss":l&&(h.instantType=void 0),e.update(h)};l?hr.flushSync(g):g()}function zp(e,t,s,i){const o=s.useState("isMountedByTrigger",e),l=dI(e,s),u=Be(f=>{const g=s.select("open"),m=s.select("activeTriggerId");if(m===e){const h={activeTriggerElement:f,...g?i:null};s.update(h);return}if(m==null&&g&&!s.state.openedWithoutTrigger){const h={activeTriggerId:e??null,activeTriggerElement:f,...i};s.update(h)}}),d=Be(f=>{l(f),f&&u(f)});return _e(()=>(d(t.current),()=>d(null)),[d,t,s,e]),_e(()=>{if(o){const f={activeTriggerElement:t.current,...i};s.update(f)}},[o,s,t,...Object.values(i)]),{registerTrigger:d,isMountedByThisTrigger:o}}function _p(e,t={}){const{closeOnActiveTriggerUnmount:s=!1}=t,i=b.useRef(null),o=e.useState("open"),l=e.useState("triggerCount"),u=e.useState("activeTriggerId"),d=e.useState("activeTriggerElement");_e(()=>{if(!o){i.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0),e.state.openedWithoutTrigger&&e.set("openedWithoutTrigger",!1);return}const f=e.context.triggerElements.size,g={};e.state.triggerCount!==f&&(g.triggerCount=f);const m=e.select("activeTriggerId");let h=null;if(m){const x=e.context.triggerElements.getById(m);if(x)i.current=m,x!==e.state.activeTriggerElement&&(g.activeTriggerElement=x);else{for(const[S,w]of e.context.triggerElements.entries())if(w===e.state.activeTriggerElement){g.activeTriggerId=S,g.activeTriggerElement=w,i.current=S;break}g.activeTriggerId===void 0&&(i.current===m?h=m:i.current=null)}}else i.current=null;if(!h&&!m&&!e.state.openedWithoutTrigger&&f===1){const x=e.context.triggerElements.entries().next();if(!x.done){const[S,w]=x.value;g.activeTriggerId=S,g.activeTriggerElement=w,i.current=S}}(g.triggerCount!==void 0||g.activeTriggerId!==void 0||g.activeTriggerElement!==void 0)&&e.update(g),h&&s&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===h&&!e.context.triggerElements.getById(h)){const x=ut(Mr);e.setOpen(!1,x),x.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[o,e,l,u,d,s])}function Up(e,t,s,i){const{mounted:o,transitionStatus:l,forceUnmount:u}=LC({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState("preventUnmountingOnClose"),setPreventUnmountOnClose:d=>t.set("preventUnmountingOnClose",d),animateInitialOpen:i,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),s?.(),t.context.onOpenChangeComplete?.(!1)}});return tr(()=>(t.set("mounted",o),null)),t.useSyncedValues({mounted:o,transitionStatus:l}),{forceUnmount:u,transitionStatus:l}}function Hp(e,t){e.useSyncedValues(t),_e(()=>()=>{e.update({activeTriggerProps:Xt,inactiveTriggerProps:Xt,popupProps:Xt})},[e])}function _C(e,t){_e(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),_e(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class ad{idMap=new Map;add(t,s){this.idMap.set(t,s)}delete(t){this.idMap.delete(t)}hasElement(t){for(const s of this.idMap.values())if(s===t)return!0;return!1}hasMatchingElement(t){for(const s of this.idMap.values())if(t(s))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}var ey={exports:{}},ty={};var zw;function hI(){if(zw)return ty;zw=1;var e=Qu();function t(h,x){return h===x&&(h!==0||1/h===1/x)||h!==h&&x!==x}var s=typeof Object.is=="function"?Object.is:t,i=e.useState,o=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function d(h,x){var S=x(),w=i({inst:{value:S,getSnapshot:x}}),C=w[0].inst,E=w[1];return l(function(){C.value=S,C.getSnapshot=x,f(C)&&E({inst:C})},[h,S,x]),o(function(){return f(C)&&E({inst:C}),h(function(){f(C)&&E({inst:C})})},[h]),u(S),S}function f(h){var x=h.getSnapshot;h=h.value;try{var S=x();return!s(h,S)}catch{return!0}}function g(h,x){return x()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:d;return ty.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,ty}var _w;function UC(){return _w||(_w=1,ey.exports=hI()),ey.exports}var Fp=UC(),ny={exports:{}},ry={};var Uw;function pI(){if(Uw)return ry;Uw=1;var e=Qu(),t=UC();function s(g,m){return g===m&&(g!==0||1/g===1/m)||g!==g&&m!==m}var i=typeof Object.is=="function"?Object.is:s,o=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,d=e.useMemo,f=e.useDebugValue;return ry.useSyncExternalStoreWithSelector=function(g,m,h,x,S){var w=l(null);if(w.current===null){var C={hasValue:!1,value:null};w.current=C}else C=w.current;w=d(function(){function R(j){if(!k){if(k=!0,O=j,j=x(j),S!==void 0&&C.hasValue){var D=C.value;if(S(D,j))return A=D}return A=j}if(D=A,i(O,j))return D;var M=x(j);return S!==void 0&&S(D,M)?(O=j,D):(O=j,A=M)}var k=!1,O,A,N=h===void 0?null:h;return[function(){return R(m())},N===null?void 0:function(){return R(N())}]},[m,h,x,S]);var E=o(g,w[0],w[1]);return u(function(){C.hasValue=!0,C.value=E},[E]),f(E),E},ry}var Hw;function gI(){return Hw||(Hw=1,ny.exports=pI()),ny.exports}var mI=gI();const yI=zv(19),vI=yI?xI:SI;function HC(e,t,s,i,o){return vI(e,t,s,i,o)}function bI(e,t,s,i,o){const l=b.useCallback(()=>t(e.getSnapshot(),s,i,o),[e,t,s,i,o]);return Fp.useSyncExternalStore(e.subscribe,l,l)}Aj({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let s=0;s<e.syncHooks.length;s+=1){const i=e.syncHooks[s],o=i.selector(i.store.state,i.a1,i.a2,i.a3);Object.is(i.value,o)||(t=!0,i.value=o)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const s=new Set;for(const o of e.syncHooks)s.add(o.store);const i=[];for(const o of s)i.push(o.subscribe(t));return()=>{for(const o of i)o()}}),Fp.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function xI(e,t,s,i,o){const l=Oj();if(!l)return bI(e,t,s,i,o);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,s)||!Object.is(d.a2,i)||!Object.is(d.a3,o))&&(d.store!==e&&(l.didChangeStore=!0),d.store=e,d.selector=t,d.a1=s,d.a2=i,d.a3=o,d.value=t(e.getSnapshot(),s,i,o))):(d={store:e,selector:t,a1:s,a2:i,a3:o,value:t(e.getSnapshot(),s,i,o)},l.syncHooks.push(d)),d.value}function SI(e,t,s,i,o){return mI.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,l=>t(l,s,i,o))}class wI{static create(t){return new this(t)}constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const s=this.updateTick;for(const i of this.listeners){if(s!==this.updateTick)return;i(t)}}update(t){for(const s in t)if(!Object.is(this.state[s],t[s])){this.setState({...this.state,...t});return}}set(t,s){Object.is(this.state[t],s)||this.setState({...this.state,[t]:s})}notifyAll(){const t={...this.state};this.setState(t)}use(t,s,i,o){return HC(this,t,s,i,o)}}class oc extends wI{constructor(t,s={},i){super(t),this.context=s,this.selectors=i}useSyncedValue(t,s){b.useDebugValue(t);const i=this;_e(()=>{i.state[t]!==s&&i.set(t,s)},[i,t,s])}useSyncedValueWithCleanup(t,s){const i=this;_e(()=>(i.state[t]!==s&&i.set(t,s),()=>{i.set(t,void 0)}),[i,t,s])}useSyncedValues(t){const s=this,i=Object.values(t);_e(()=>{s.update(t)},[s,...i])}useControlledProp(t,s){b.useDebugValue(t);const i=this,o=s!==void 0;_e(()=>{o&&!Object.is(i.state[t],s)&&i.setState({...i.state,[t]:s})},[i,t,s,o])}select(t,s,i,o){const l=this.selectors[t];return l(this.state,s,i,o)}useState(t,s,i,o){return b.useDebugValue(t),HC(this,this.selectors[t],s,i,o)}useContextCallback(t,s){b.useDebugValue(t);const i=Be(s??En);this.context[t]=i}useStateSetter(t){const s=b.useRef(void 0);return s.current===void 0&&(s.current=i=>{this.set(t,i)}),s.current}observe(t,s){let i;typeof t=="function"?i=t:i=this.selectors[t];let o=i(this.state);return s(o,o,this),this.subscribe(l=>{const u=i(l);if(!Object.is(o,u)){const d=o;o=u,s(u,d,this)}})}}const EI={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class FC extends oc{constructor(t){const{syncOnly:s,nested:i,onOpenChange:o,triggerElements:l,...u}=t;super({...u,positionReference:u.referenceElement,domReferenceElement:u.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:MC(),nested:i,triggerElements:l},EI),this.syncOnly=s}syncOpenEvent=(t,s)=>{(!t||!this.state.open||s!=null&&Hj(s))&&(this.context.dataRef.current.openEvent=t?s:void 0)};dispatchOpenChange=(t,s)=>{this.syncOpenEvent(t,s.event);const i={open:t,reason:s.reason,nativeEvent:s.event,nested:this.context.nested,triggerElement:s.trigger};this.context.events.emit("openchange",i)};setOpen=(t,s)=>{if(this.syncOnly){this.context.onOpenChange?.(t,s);return}this.dispatchOpenChange(t,s),this.context.onOpenChange?.(t,s)}}function Bp(e,t,s=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new FC({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:s,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Xt,inactiveTriggerProps:Xt,popupProps:Xt}}const Tu=e=>e.triggerIdProp??e.activeTriggerId,qh=e=>e.openProp??e.open,Fw=e=>(e.popupElement?.id??e.floatingId)||void 0;function BC(e,t){return t!==void 0&&qh(e)&&Tu(e)===t}function RI(e,t){return BC(e,t)?!0:t!==void 0&&qh(e)&&Tu(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}const Yi={open:qh,mounted:e=>e.mounted,transitionStatus:e=>qh(e)&&!e.mounted?"starting":e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Tu,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Fw,isTriggerActive:(e,t)=>t!==void 0&&Tu(e)===t,isOpenedByTrigger:(e,t)=>BC(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Tu(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>RI(e,t)?Fw(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Vp(e){const t=b.useCallback(i=>e===void 0?En:e.subscribeStore(i),[e]),s=b.useCallback(()=>e===void 0?void 0:e.store,[e]);return Fp.useSyncExternalStore(t,s,()=>e?.serverStore)}function CI(e){const{open:t=!1,onOpenChange:s,elements:i={}}=e,o=ac(),l=$a()!=null,u=tr(()=>new FC({open:t,transitionStatus:void 0,onOpenChange:s,referenceElement:i.reference??null,floatingElement:i.floating??null,triggerElements:new ad,floatingId:o,syncOnly:!1,nested:l})).current;return _e(()=>{const d={open:t,floatingId:o};i.reference!==void 0&&(d.referenceElement=i.reference,d.domReferenceElement=ln(i.reference)?i.reference:null),i.floating!==void 0&&(d.floatingElement=i.floating),u.update(d)},[t,o,i.reference,i.floating,u]),u.context.onOpenChange=s,u.context.nested=l,u}const sy=wv&&Si;function VC(e,t={}){const{enabled:s=!0,delay:i}=t,{events:o,dataRef:l}=e.context,u=b.useRef(!1),d=b.useRef(null),f=b.useRef(!0),g=Un();b.useEffect(()=>{const h=e.select("domReferenceElement");if(!s)return;const x=Rn(h);function S(){const E=e.select("domReferenceElement");!e.select("open")&&bn(E)&&E===Jr(Qt(E))&&(u.current=!0,d.current=E)}function w(){f.current=!0}function C(){f.current=!1}return yi(Lt(x,"blur",S),sy&&Lt(x,"keydown",w,!0),sy&&Lt(x,"pointerdown",C,!0))},[e,s]),b.useEffect(()=>{if(!s)return;function h(x){if(x.reason===Qs||x.reason===td){const S=e.select("domReferenceElement");ln(S)&&(d.current=S,u.current=!0)}}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,s,e]);const m=b.useMemo(()=>{function h(){u.current=!1,d.current=null}return{onMouseLeave(){h()},onFocus(x){const S=x.currentTarget;if(u.current){if(d.current===S)return;h()}const w=nr(x.nativeEvent);if(ln(w)){if(sy&&!x.relatedTarget){if(!f.current&&!ed(w))return}else if(!i4(w))return}const C=_h(x.relatedTarget,e.context.triggerElements),{nativeEvent:E,currentTarget:R}=x;if(e.select("open")&&C||!i){e.setOpen(!0,ut(Fl,E,R));return}g.start(i,()=>{u.current||e.setOpen(!0,ut(Fl,E,R))})},onBlur(x){h();const S=x.relatedTarget,w=x.nativeEvent,C=ln(S)&&S.hasAttribute(Yl("focus-guard"))&&S.getAttribute("data-type")==="outside";g.start(0,()=>{const E=e.select("domReferenceElement"),R=Jr(Qt(E));!S&&R===E||it(l.current.floatingContext?.refs.floating.current,R)||it(E,R)||C||_h(S??R,e.context.triggerElements)||e.setOpen(!1,ut(Fl,w))})}}},[l,i,e,g]);return b.useMemo(()=>s?{reference:m,trigger:m}:{},[s,m])}class qv{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new Ps;restTimeout=new Ps;handleCloseOptions=void 0;static create(){return new qv}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const Yh=new WeakMap;function Gh(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&Yh.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Yh.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function KC(e,t){const{scopeElement:s,referenceElement:i,floatingElement:o}=t,l=Yh.get(s);l&&l!==e&&Gh(l),Gh(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=s,e.pointerEventsReferenceElement=i,e.pointerEventsFloatingElement=o,Yh.set(s,e),s.style.pointerEvents="none",i.style.pointerEvents="auto",o.style.pointerEvents="auto"}function Yv(e){const t=e.context.dataRef.current,s=tr(()=>t.hoverInteractionState??qv.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=s),Sv(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Gv(e,t={}){const{enabled:s=!0,closeDelay:i=0,nodeId:o}=t,l=e.useState("open"),u=e.useState("floatingElement"),d=e.useState("domReferenceElement"),{dataRef:f}=e.context,g=Qa(),m=$a(),h=Yv(e),x=Un(),S=Be(()=>JR(f.current.openEvent?.type,h.interactedInside)),w=Be(()=>o4(f.current.openEvent?.type)),C=Be(()=>{Gh(h)});_e(()=>{l||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,C())},[l,h,C]),b.useEffect(()=>C,[C]),_e(()=>{if(s&&l&&h.handleCloseOptions?.blockPointerEvents&&w()&&ln(d)&&u){const E=d,R=u,k=Qt(u),O=g?.nodesRef.current.find(D=>D.id===m)?.context?.elements.floating;O&&(O.style.pointerEvents="");const A=h.pointerEventsScopeElement!==R?h.pointerEventsScopeElement:null,N=O!==R?O:null,j=h.handleCloseOptions?.getScope?.()??A??N??zu(E,"[data-rootownerid]")??k.body;return KC(h,{scopeElement:j,referenceElement:E,floatingElement:R}),()=>{C()}}},[s,l,d,u,h,w,g,m,C]),b.useEffect(()=>{if(!s)return;function E(){return!!(g&&m&&Ka(g.nodesRef.current,m).length>0)}function R(D){const M=Io(i,"close",h.pointerType),_=()=>{e.setOpen(!1,ut(Kn,D)),g?.events.emit("floating.closed",D)};M?h.openChangeTimeout.start(M,_):(h.openChangeTimeout.clear(),_())}function k(D){const M=nr(D);if(!s4(M)){h.interactedInside=!1;return}h.interactedInside=zu(M,"[aria-haspopup]")!=null}function O(){h.openChangeTimeout.clear(),x.clear(),g?.events.off("floating.closed",N),C()}function A(D){if(E()&&g){g.events.on("floating.closed",N);return}if(_h(D.relatedTarget,e.context.triggerElements))return;const M=f.current.floatingContext?.nodeId??o,_=D.relatedTarget;if(!(g&&M&&ln(_)&&Ka(g.nodesRef.current,M,!1).some(q=>it(q.context?.elements.floating,_)))){if(h.handler){h.handler(D);return}C(),w()&&!S()&&R(D)}}function N(D){!g||!m||E()||x.start(0,()=>{g.events.off("floating.closed",N),e.setOpen(!1,ut(Kn,D)),g.events.emit("floating.closed",D)})}const j=u;return yi(j&&Lt(j,"mouseenter",O),j&&Lt(j,"mouseleave",A),j&&Lt(j,"pointerdown",k,!0),()=>{g?.events.off("floating.closed",N)})},[s,u,e,f,i,o,w,S,C,h,g,m,x])}const TI={current:null};function $v(e,t={}){const{enabled:s=!0,delay:i=0,handleClose:o=null,mouseOnly:l=!1,restMs:u=0,move:d=!0,triggerElementRef:f=TI,externalTree:g,isActiveTrigger:m=!0,getHandleCloseContext:h,isClosing:x,shouldOpen:S,guardStaleOpen:w=!1}=t,{dataRef:C,events:E}=e.context,R=Qa(g),k=Yv(e),O=b.useRef(!1),A=Ln(o),N=Ln(i),j=Ln(u),D=Ln(s),M=Ln(S),_=Ln(x),L=Be(()=>JR(C.current.openEvent?.type,k.interactedInside)),q=Be(()=>M.current?.()!==!1),X=Be((U,z,Q)=>{const $=e.context.triggerElements;if($.hasElement(z))return!U||!it(U,z);if(!ln(Q))return!1;const K=Q;return $.hasMatchingElement(Y=>it(Y,K))&&(!U||!it(U,K))}),B=Be(()=>{if(!k.handler)return;Qt(e.select("domReferenceElement")).removeEventListener("mousemove",k.handler),k.handler=void 0}),H=Be(()=>{Gh(k)});return m&&(k.handleCloseOptions=o?.__options),b.useEffect(()=>B,[B]),b.useEffect(()=>{if(!s)return;function U(z){z.open?O.current=!1:(O.current=z.reason===Kn,B(),k.openChangeTimeout.clear(),k.restTimeout.clear(),k.blockMouseMove=!0,k.restTimeoutPending=!1)}return E.on("openchange",U),()=>{E.off("openchange",U)}},[s,E,k,B]),b.useEffect(()=>{if(!s)return;function U(ee,G=!0){const oe=Io(N.current,"close",k.pointerType);oe?k.openChangeTimeout.start(oe,()=>{e.setOpen(!1,ut(Kn,ee)),R?.events.emit("floating.closed",ee)}):G&&(k.openChangeTimeout.clear(),e.setOpen(!1,ut(Kn,ee)),R?.events.emit("floating.closed",ee))}const z=f.current??(m?e.select("domReferenceElement"):null);if(!ln(z))return;function Q(ee){if(k.openChangeTimeout.clear(),k.blockMouseMove=!1,l&&!Ua(k.pointerType))return;const G=yw(j.current),oe=Io(N.current,"open",k.pointerType),I=nr(ee),V=ee.currentTarget??null,W=e.select("domReferenceElement");let re=V;if(ln(I)&&!e.context.triggerElements.hasElement(I)){for(const Oe of e.context.triggerElements.elements())if(it(Oe,I)){re=Oe;break}}ln(V)&&ln(W)&&!e.context.triggerElements.hasElement(V)&&it(V,W)&&(re=W);const Ee=re==null?!1:X(W,re,I),le=e.select("open"),me=_.current?.()??e.select("transitionStatus")==="ending",ge=!le&&me&&O.current,ue=!Ee&&ln(re)&&ln(W)&&it(W,re)&&ge,Te=G>0&&!oe,ve=Ee&&(le||ge)||ue,Pe=!le||Ee;if(ve){q()&&e.setOpen(!0,ut(Kn,ee,re));return}Te||(oe?k.openChangeTimeout.start(oe,()=>{Pe&&q()&&e.setOpen(!0,ut(Kn,ee,re))}):Pe&&q()&&e.setOpen(!0,ut(Kn,ee,re)))}function $(ee){if(L()){H();return}B();const G=e.select("domReferenceElement"),oe=Qt(G);k.restTimeout.clear(),k.restTimeoutPending=!1;const I=C.current.floatingContext??h?.();if(_h(ee.relatedTarget,e.context.triggerElements))return;if(A.current&&I){e.select("open")||k.openChangeTimeout.clear();const W=f.current;k.handler=A.current({...I,tree:R,x:ee.clientX,y:ee.clientY,onClose(){H(),B(),D.current&&!L()&&W===e.select("domReferenceElement")&&U(ee,!0)}}),oe.addEventListener("mousemove",k.handler),k.handler(ee);return}(k.pointerType!=="touch"||!it(e.select("floatingElement"),ee.relatedTarget))&&U(ee)}function K(ee){it(z,ee.relatedTarget)||(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1)}const Y=w?Lt(z,"mouseout",K):void 0;return d?yi(Lt(z,"mousemove",Q,{once:!0}),Lt(z,"mouseenter",Q),Lt(z,"mouseleave",$),Y):yi(Lt(z,"mouseenter",Q),Lt(z,"mouseleave",$),Y)},[B,H,C,N,e,s,A,k,m,X,L,l,d,j,f,R,D,h,_,q,w]),b.useMemo(()=>{if(!s)return;function U(z){k.pointerType=z.pointerType}return{onPointerDown:U,onPointerEnter:U,onMouseMove(z){const{nativeEvent:Q}=z,$=z.currentTarget,K=e.select("domReferenceElement"),Y=e.select("open"),ee=X(K,$,z.target);if(l&&!Ua(k.pointerType))return;if(Y&&ee&&k.handleCloseOptions?.blockPointerEvents){const I=e.select("floatingElement");if(I){const V=k.handleCloseOptions?.getScope?.()??$.ownerDocument.body;KC(k,{scopeElement:V,referenceElement:$,floatingElement:I})}}const G=yw(j.current);if(Y&&!ee||G===0||!ee&&k.restTimeoutPending&&z.movementX**2+z.movementY**2<2)return;k.restTimeout.clear();function oe(){if(k.restTimeoutPending=!1,L())return;const I=e.select("open");!k.blockMouseMove&&(!I||ee)&&q()&&e.setOpen(!0,ut(Kn,Q,$))}k.pointerType==="touch"?hr.flushSync(()=>{oe()}):ee&&Y?oe():(k.restTimeoutPending=!0,k.restTimeout.start(G,oe))}}},[s,k,L,X,l,e,j,q])}function Bw(e){return Si&&e.movementX===0&&e.movementY===0}function Kp(e,t,s){switch(e){case"vertical":return t;case"horizontal":return s;default:return t||s}}function eh(e,t){return Kp(t,e===XR||e===Ov,e===Sp||e===wp)}function iy(e,t,s){return Kp(t,e===Ov,s?e===Sp:e===wp)||e==="Enter"||e===" "||e===""}function kI(e,t,s){return Kp(t,s?e===Sp:e===wp,e===Ov)}function OI(e,t,s,i){const o=s?e===wp:e===Sp,l=e===XR;return t==="both"||t==="horizontal"&&i?e==="Escape":Kp(t,o,l)}function qC(e,t){const{listRef:s,activeIndex:i,onNavigate:o=()=>{},enabled:l=!0,selectedIndex:u=null,allowEscape:d=!1,loopFocus:f=!1,nested:g=!1,rtl:m=!1,virtual:h=!1,focusItemOnOpen:x="auto",focusItemOnHover:S=!0,openOnArrowKeyDown:w=!0,disabledIndices:C=void 0,orientation:E="vertical",triggerOrientation:R=E,parentOrientation:k,id:O,resetOnPointerLeave:A=!0,externalTree:N,nestedReturnFocusRef:j,grid:D}=t,M=D!=null,_=e.useState("open"),L=e.useState("floatingElement"),q=e.useState("domReferenceElement"),X=e.context.dataRef,B=Uh(L),H=Iy(q),U=Ln(B),z=$a(),Q=Qa(N),$=b.useRef(x),K=b.useRef(u??-1),Y=b.useRef(null),ee=b.useRef(!0),G=Be(de=>{o(K.current===-1?null:K.current,de)}),oe=b.useRef(!!L),I=b.useRef(_),V=b.useRef(!1),W=b.useRef(!1),re=b.useRef(null),Ee=Ln(C),le=Ln(_),me=Ln(u),ge=Ln(A),ue=tc(),Te=tc(),ve=Be(()=>{ue.cancel();function de(De){h||(re.current=Eh(De,{sync:V.current,preventScroll:!0}))}const we=s.current[K.current],Ge=W.current;we&&de(we),(V.current?De=>De():De=>ue.request(De))(()=>{const De=s.current[K.current]||we;if(!De)return;we||de(De),Ue&&(Ge||!ee.current)&&De.scrollIntoView?.({block:"nearest",inline:"nearest"})})});_e(()=>{X.current.orientation=E},[X,E]),_e(()=>{_||(Y.current=null),(!_||x!=="auto")&&($.current=x)},[_,x]),_e(()=>{l&&(_&&L?(K.current=u??-1,$.current&&u!=null&&(W.current=!0,G())):oe.current&&(K.current=-1,G()))},[l,_,L,u,G]),_e(()=>{if(l){if(!_){V.current=!1;return}if(L)if(i==null){if(V.current=!1,me.current!=null)return;if(oe.current&&(K.current=-1,ve()),(!I.current||!oe.current)&&$.current&&(Y.current!=null||$.current===!0&&Y.current==null)){let de=0;const we=()=>{s.current[0]==null?(de<2&&(de?Me=>Te.request(Me):queueMicrotask)(we),de+=1):(K.current=Y.current==null||iy(Y.current,R,m)||g?wh(s):Ly(s),Y.current=null,G())};we()}}else Bl(s.current,i)||(K.current=i,ve(),W.current=!1)}},[l,_,L,i,me,g,s,R,m,G,ve,Te]),_e(()=>{if(!l||L||!Q||h||!oe.current)return;const de=Q.nodesRef.current,we=de.find(De=>De.id===z)?.context?.elements.floating,Ge=Jr(Qt(q??we??null)),Me=de.some(De=>De.context&&it(De.context.elements.floating,Ge));we&&!Me&&ee.current&&we.focus({preventScroll:!0})},[l,L,q,Q,z,h]),_e(()=>{I.current=_,oe.current=!!L});const Pe=i!=null,Oe=Be(de=>{if(!le.current)return;const we=s.current.indexOf(de.currentTarget);we!==-1&&(K.current!==we||i!==we)&&(K.current=we,G(de))}),Le=Be(()=>k??Q?.nodesRef.current.find(de=>de.id===z)?.context?.dataRef?.current.orientation),Ve=Be(()=>wh(s,Ee.current)),ke=Be(de=>{if(ee.current=!1,V.current=!0,de.which===229||!le.current&&de.currentTarget===U.current)return;if(g&&OI(de.key,E,m,M)){eh(de.key,Le())||Ys(de),e.setOpen(!1,ut(Hh,de.nativeEvent));const De=j?.current??q;bn(De)&&De.focus();return}i!=null&&i!==K.current&&!Bl(s.current,i)&&(K.current=i);const we=K.current,Ge=wh(s,C),Me=Ly(s,C);if(H||(de.key==="Home"&&(Ys(de),K.current=Ge,G(de)),de.key==="End"&&(Ys(de),K.current=Me,G(de))),D!=null){const De=D(de,K.current,s,E,f,m,C,Ge,Me);if(De!=null&&De!==K.current&&(K.current=De,G(de)),E==="both")return}if(eh(de.key,E)){Ys(de);const De=Jr(de.currentTarget.ownerDocument);if(_&&!h&&it(de.currentTarget,De)&&!s.current.some(gt=>gt!=null&&it(gt,De))){K.current=iy(de.key,E,m)?Ge:Me,G(de),i===K.current&&ve();return}const{index:bt,wrapped:dt}=N4(s.current,we,{decrement:!iy(de.key,E,m),loopFocus:f,allowEscape:d,disabledIndices:C,minIndex:Ge,maxIndex:Me});dt&&(V.current=!1),K.current=bt,G(de)}}),Ue=b.useMemo(()=>({onFocus(we){V.current=!0,Oe(we)},onClick({currentTarget:we}){h||we.focus({preventScroll:!0})},onMouseMove(we){Bw(we)||(V.current=!0,W.current=!1,S&&Oe(we))},onPointerLeave(we){if(!le.current||!ee.current||we.pointerType==="touch")return;V.current=!0;const Ge=we.relatedTarget;if(!(!S||s.current.includes(Ge))&&ge.current&&(re.current?.(),re.current=null,K.current=-1,G(we),!h)){const Me=U.current,De=Jr(Qt(Me));Me&&it(Me,De)&&Me.focus({preventScroll:!0})}}}),[Oe,le,U,S,s,G,ge,h]),be=b.useMemo(()=>h&&_&&Pe&&{"aria-activedescendant":`${O}-${i}`},[h,_,Pe,O,i]),He=b.useMemo(()=>({...H?{}:be,onKeyDown(de){if(de.key==="Tab"&&de.shiftKey&&_&&!h){const we=nr(de.nativeEvent);if(we&&!it(U.current,we))return;Ys(de);const Ge=ut(Fa,de.nativeEvent);e.setOpen(!1,Ge);const Me=j?.current??q;!Ge.isCanceled&&bn(Me)&&Me.focus();return}ke(de)},onPointerMove(de){Bw(de)||(ee.current=!0)}}),[be,ke,U,H,e,_,h,q,j]),Ze=b.useMemo(()=>{function de(Me){e.setOpen(!0,ut(Hh,Me.nativeEvent,Me.currentTarget))}function we(Me){x==="auto"&&ec(Me.nativeEvent)&&($.current=!h)}function Ge(Me){$.current=x,x==="auto"&&Rv(Me.nativeEvent)&&($.current=!0)}return{onKeyDown(Me){const De=e.select("open");ee.current=!1;const bt=Me.key.startsWith("Arrow"),dt=kI(Me.key,Le(),m),gt=eh(Me.key,De?E:R),Nt=(g?dt:gt)||Me.key==="Enter"||Me.key.trim()==="";if(h&&De&&(!g||ed(Me.currentTarget)))return ke(Me);if(!(!De&&!w&&bt)){if(Nt){const jt=eh(Me.key,Le());Y.current=g&&jt?null:Me.key}if(g){dt&&(Ys(Me),De?(K.current=Ve(),G(Me),h&&U.current?.focus()):de(Me));return}gt&&(me.current!=null&&(K.current=me.current),Ys(Me),!De&&w?de(Me):ke(Me),De&&G(Me))}},onFocus(Me){Me.target===Me.currentTarget&&e.select("open")&&!h&&(K.current=-1,G(Me))},onPointerDown:Ge,onPointerEnter:Ge,onMouseDown:we,onClick:we}},[ke,x,Ve,g,G,e,w,E,R,Le,m,me,h,U]),ot=b.useMemo(()=>({...be,...Ze}),[be,Ze]);return b.useMemo(()=>l?{reference:ot,floating:He,item:Ue,trigger:Ze}:{},[l,ot,He,Ze,Ue])}function YC(e,t){const{listRef:s,elementsRef:i,activeIndex:o,onMatch:l,disabledIndices:u,onTyping:d,enabled:f=!0,resetMs:g=750,selectedIndex:m=null}=t,h=Be(d),x=e.useState("open"),S=Un(),w=b.useRef(""),C=b.useRef(m??o??-1),E=b.useRef(null),R=Be(A=>{function N(H){return i?.current[H]}function j(H){const U=N(H);return U&&!kp(U)||U?.matches(":disabled")?!1:u==null||!Kl($s,H,u)}function D(H,U,z=0){if(H.length===0)return-1;const Q=(z%H.length+H.length)%H.length,$=U.toLowerCase();for(let K=0;K<H.length;K+=1){const Y=(Q+K)%H.length;if(!(!H[Y]?.toLowerCase().startsWith($)||!j(Y)))return Y}return-1}const M=s.current;if(w.current.length>0&&A.key===" "&&(Ys(A),h?.(!0)),w.current.length>0&&w.current[0]!==" "&&D(M,w.current)===-1&&A.key!==" "&&h?.(!1),M==null||A.key.length!==1||A.ctrlKey||A.metaKey||A.altKey)return;x&&A.key!==" "&&(Ys(A),h?.(!0));const _=w.current==="";_&&(C.current=m??o??-1),M.every((H,U)=>H&&j(U)?H[0]?.toLowerCase()!==H[1]?.toLowerCase():!0)&&w.current===A.key&&(w.current="",C.current=E.current),w.current+=A.key,S.start(g,()=>{w.current="",C.current=E.current,h?.(!1)});const X=((_?m??o??-1:C.current)??0)+1,B=D(M,w.current,X);B!==-1?(l?.(B,A),E.current=B):A.key!==" "&&(w.current="",h?.(!1))}),k=Be(A=>{const N=A.relatedTarget,j=e.select("domReferenceElement"),D=e.select("floatingElement");it(j,N)||it(D,N)||(S.clear(),w.current="",C.current=E.current,h?.(!1))});_e(()=>{!x&&m!==null||(S.clear(),E.current=null,w.current!==""&&(w.current="",h?.(!1)))},[x,m,S,h]);const O=b.useMemo(()=>({onKeyDown:R,onBlur:k}),[R,k]);return b.useMemo(()=>f?{reference:O,floating:O}:{},[f,O])}const Vw=.1,AI=Vw*Vw,wn=.5;function th(e,t,s,i,o,l){return i>=t!=l>=t&&e<=(o-s)*(t-i)/(l-i)+s}function nh(e,t,s,i,o,l,u,d,f,g){let m=!1;return th(e,t,s,i,o,l)&&(m=!m),th(e,t,o,l,u,d)&&(m=!m),th(e,t,u,d,f,g)&&(m=!m),th(e,t,f,g,s,i)&&(m=!m),m}function MI(e,t,s){return e>=s.x&&e<=s.x+s.width&&t>=s.y&&t<=s.y+s.height}function rh(e,t,s,i,o,l){const u=Math.min(s,o),d=Math.max(s,o),f=Math.min(i,l),g=Math.max(i,l);return e>=u&&e<=d&&t>=f&&t<=g}function Qv(e={}){const{blockPointerEvents:t=!1}=e,s=new Ps,i=({x:o,y:l,placement:u,elements:d,onClose:f,nodeId:g,tree:m})=>{const h=u?.split("-")[0];let x=!1,S=null,w=null,C=typeof performance<"u"?performance.now():0;function E(k,O){const A=performance.now(),N=A-C;if(S===null||w===null||N===0)return S=k,w=O,C=A,!1;const j=k-S,D=O-w,M=j*j+D*D,_=N*N*AI;return S=k,w=O,C=A,M<_}function R(){s.clear(),f()}return function(O){s.clear();const A=d.domReference,N=d.floating;if(!A||!N||h==null||o==null||l==null)return;const{clientX:j,clientY:D}=O,M=nr(O),_=O.type==="mouseleave",L=it(N,M),q=it(A,M);if(L&&(x=!0,!_))return;if(q&&(x=!1,!_)){x=!0;return}if(_&&ln(O.relatedTarget)&&it(N,O.relatedTarget))return;function X(){return!!(m&&Ka(m.nodesRef.current,g).length>0)}function B(){X()||R()}if(X())return;const H=A.getBoundingClientRect(),U=N.getBoundingClientRect(),z=o>U.right-U.width/2,Q=l>U.bottom-U.height/2,$=U.width>H.width,K=U.height>H.height,Y=($?H:U).left,ee=($?H:U).right,G=(K?H:U).top,oe=(K?H:U).bottom;if(h==="top"&&l>=H.bottom-1||h==="bottom"&&l<=H.top+1||h==="left"&&o>=H.right-1||h==="right"&&o<=H.left+1){B();return}let I=!1;switch(h){case"top":I=rh(j,D,Y,H.top+1,ee,U.bottom-1);break;case"bottom":I=rh(j,D,Y,U.top+1,ee,H.bottom-1);break;case"left":I=rh(j,D,U.right-1,oe,H.left+1,G);break;case"right":I=rh(j,D,H.right-1,oe,U.left+1,G);break}if(I)return;if(x&&!MI(j,D,H)){B();return}if(!_&&E(j,D)){B();return}let V=!1;switch(h){case"top":{const W=$?wn/2:wn*4,re=$||z?o+W:o-W,Ee=$?o-W:z?o+W:o-W,le=l+wn+1,me=z||$?U.bottom-wn:U.top,ge=z?$?U.bottom-wn:U.top:U.bottom-wn;V=nh(j,D,re,le,Ee,le,U.left,me,U.right,ge);break}case"bottom":{const W=$?wn/2:wn*4,re=$||z?o+W:o-W,Ee=$?o-W:z?o+W:o-W,le=l-wn,me=z||$?U.top+wn:U.bottom,ge=z?$?U.top+wn:U.bottom:U.top+wn;V=nh(j,D,re,le,Ee,le,U.left,me,U.right,ge);break}case"left":{const W=K?wn/2:wn*4,re=K||Q?l+W:l-W,Ee=K?l-W:Q?l+W:l-W,le=o+wn+1,me=Q||K?U.right-wn:U.left,ge=Q?K?U.right-wn:U.left:U.right-wn;V=nh(j,D,me,U.top,ge,U.bottom,le,re,le,Ee);break}case"right":{const W=K?wn/2:wn*4,re=K||Q?l+W:l-W,Ee=K?l-W:Q?l+W:l-W,le=o-wn,me=Q||K?U.left+wn:U.right,ge=Q?K?U.left+wn:U.right:U.left+wn;V=nh(j,D,le,re,le,Ee,me,U.top,ge,U.bottom);break}}V?x||s.start(40,B):B()}};return i.__options={...e,blockPointerEvents:t},i}function Kw(e,t,s){let{reference:i,floating:o}=e;const l=js(t),u=Iv(t),d=jv(u),f=ms(t),g=l==="y",m=i.x+i.width/2-o.width/2,h=i.y+i.height/2-o.height/2,x=i[d]/2-o[d]/2;let S;switch(f){case"top":S={x:m,y:i.y-o.height};break;case"bottom":S={x:m,y:i.y+i.height};break;case"right":S={x:i.x+i.width,y:h};break;case"left":S={x:i.x-o.width,y:h};break;default:S={x:i.x,y:i.y}}const w=vi(t);return w&&(S[u]+=x*(w==="end"?1:-1)*(s&&g?-1:1)),S}async function NI(e,t){var s;t===void 0&&(t={});const{x:i,y:o,platform:l,rects:u,elements:d,strategy:f}=e,{boundary:g="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:x=!1,padding:S=0}=Va(t,e),w=aC(S),E=d[x?h==="floating"?"reference":"floating":h],R=Uu(await l.getClippingRect({element:(s=await(l.isElement==null?void 0:l.isElement(E)))==null||s?E:E.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:g,rootBoundary:m,strategy:f})),k=h==="floating"?{x:i,y:o,width:u.floating.width,height:u.floating.height}:u.reference,O=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),A=await(l.isElement==null?void 0:l.isElement(O))&&await(l.getScale==null?void 0:l.getScale(O))||{x:1,y:1},N=Uu(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:k,offsetParent:O,strategy:f}):k);return{top:(R.top-N.top+w.top)/A.y,bottom:(N.bottom-R.bottom+w.bottom)/A.y,left:(R.left-N.left+w.left)/A.x,right:(N.right-R.right+w.right)/A.x}}const DI=50,jI=async(e,t,s)=>{const{placement:i="bottom",strategy:o="absolute",middleware:l=[],platform:u}=s,d=u.detectOverflow?u:{...u,detectOverflow:NI},f=await(u.isRTL==null?void 0:u.isRTL(t));let g=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:h}=Kw(g,i,f),x=i,S=0;const w={};for(let C=0;C<l.length;C++){const E=l[C];if(!E)continue;const{name:R,fn:k}=E,{x:O,y:A,data:N,reset:j}=await k({x:m,y:h,initialPlacement:i,placement:x,strategy:o,middlewareData:w,rects:g,platform:d,elements:{reference:e,floating:t}});m=O??m,h=A??h,w[R]={...w[R],...N},j&&S<DI&&(S++,typeof j=="object"&&(j.placement&&(x=j.placement),j.rects&&(g=j.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:o}):j.rects),{x:m,y:h}=Kw(g,x,f)),C=-1)}return{x:m,y:h,placement:x,strategy:o,middlewareData:w}},II=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var s,i;const{placement:o,middlewareData:l,rects:u,initialPlacement:d,platform:f,elements:g}=t,{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:x,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:C=!0,...E}=Va(e,t);if((s=l.arrow)!=null&&s.alignmentOffset)return{};const R=ms(o),k=js(d),O=ms(d)===d,A=await(f.isRTL==null?void 0:f.isRTL(g.floating)),N=x||(O||!C?[Bh(d)]:C4(d)),j=w!=="none";!x&&j&&N.push(...A4(d,C,w,A));const D=[d,...N],M=await f.detectOverflow(t,E),_=[];let L=((i=l.flip)==null?void 0:i.overflows)||[];if(m&&_.push(M[R]),h){const H=R4(o,u,A);_.push(M[H[0]],M[H[1]])}if(L=[...L,{placement:o,overflows:_}],!_.every(H=>H<=0)){var q,X;const H=(((q=l.flip)==null?void 0:q.index)||0)+1,U=D[H];if(U&&(!(h==="alignment"?k!==js(U):!1)||L.every($=>js($.placement)===k?$.overflows[0]>0:!0)))return{data:{index:H,overflows:L},reset:{placement:U}};let z=(X=L.filter(Q=>Q.overflows[0]<=0).sort((Q,$)=>Q.overflows[1]-$.overflows[1])[0])==null?void 0:X.placement;if(!z)switch(S){case"bestFit":{var B;const Q=(B=L.filter($=>{if(j){const K=js($.placement);return K===k||K==="y"}return!0}).map($=>[$.placement,$.overflows.filter(K=>K>0).reduce((K,Y)=>K+Y,0)]).sort(($,K)=>$[1]-K[1])[0])==null?void 0:B[0];Q&&(z=Q);break}case"initialPlacement":z=d;break}if(o!==z)return{reset:{placement:z}}}return{}}}},GC=new Set(["left","top"]);async function PI(e,t){const{placement:s,platform:i,elements:o}=e,l=await(i.isRTL==null?void 0:i.isRTL(o.floating)),u=ms(s),d=vi(s),f=js(s)==="y",g=GC.has(u)?-1:1,m=l&&f?-1:1,h=Va(t,e);let{mainAxis:x,crossAxis:S,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return d&&typeof w=="number"&&(S=d==="end"?w*-1:w),f?{x:S*m,y:x*g}:{x:x*g,y:S*m}}const LI=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var s,i;const{x:o,y:l,placement:u,middlewareData:d}=t,f=await PI(t,e);return u===((s=d.offset)==null?void 0:s.placement)&&(i=d.arrow)!=null&&i.alignmentOffset?{}:{x:o+f.x,y:l+f.y,data:{...f,placement:u}}}}},zI=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:s,y:i,placement:o,platform:l}=t,{mainAxis:u=!0,crossAxis:d=!1,limiter:f={fn:k=>{let{x:O,y:A}=k;return{x:O,y:A}}},...g}=Va(e,t),m={x:s,y:i},h=await l.detectOverflow(t,g),x=js(o),S=Dv(x);let w=m[S],C=m[x];const E=(k,O)=>iC(O+h[k==="y"?"top":"left"],O,O-h[k==="y"?"bottom":"right"]);u&&(w=E(S,w)),d&&(C=E(x,C));const R=f.fn({...t,[S]:w,[x]:C});return{...R,data:{x:R.x-s,y:R.y-i,enabled:{[S]:u,[x]:d}}}}}},_I=function(e){return e===void 0&&(e={}),{options:e,fn(t){var s,i;const{x:o,y:l,placement:u,rects:d,middlewareData:f}=t,{offset:g=0,mainAxis:m=!0,crossAxis:h=!0}=Va(e,t),x={x:o,y:l},S=js(u),w=Dv(S);let C=x[w],E=x[S];const R=Va(g,t),k=typeof R=="number"?{mainAxis:R,crossAxis:0}:{mainAxis:(s=R.mainAxis)!=null?s:0,crossAxis:(i=R.crossAxis)!=null?i:0};if(m){const N=w==="y"?"height":"width",j=d.reference[w]-d.floating[N]+k.mainAxis,D=d.reference[w]+d.reference[N]-k.mainAxis;C<j?C=j:C>D&&(C=D)}if(h){var O,A;const N=w==="y"?"width":"height",j=GC.has(ms(u)),D=d.reference[S]-d.floating[N]+(j&&((O=f.offset)==null?void 0:O[S])||0)+(j?0:k.crossAxis),M=d.reference[S]+d.reference[N]+(j?0:((A=f.offset)==null?void 0:A[S])||0)-(j?k.crossAxis:0);E<D?E=D:E>M&&(E=M)}return{[w]:C,[S]:E}}}},UI=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:s,rects:i,platform:o,elements:l}=t,{apply:u=()=>{},...d}=Va(e,t),f=await o.detectOverflow(t,d),g=ms(s),m=vi(s),h=js(s)==="y",{width:x,height:S}=i.floating;let w,C;g==="top"||g==="bottom"?(w=g,C=m===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(C=g,w=m==="end"?"top":"bottom");const E=S-f.top-f.bottom,R=x-f.left-f.right,k=nc(S-f[w],E),O=nc(x-f[C],R),A=t.middlewareData.shift,N=!A;let j=k,D=O;A!=null&&A.enabled.x&&(D=R),A!=null&&A.enabled.y&&(j=E),N&&!m&&(h?D=x-2*Qi(f.left,f.right):j=S-2*Qi(f.top,f.bottom)),await u({...t,availableWidth:D,availableHeight:j});const M=await o.getDimensions(l.floating);return x!==M.width||S!==M.height?{reset:{rects:!0}}:{}}}};function $C(e){const t=ys(e);let s=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const o=bn(e),l=o?e.offsetWidth:s,u=o?e.offsetHeight:i,d=Fh(s)!==l||Fh(i)!==u;return d&&(s=l,i=u),{width:s,height:i,$:d}}function Xv(e){return ln(e)?e:e.contextElement}function Gl(e){const t=Xv(e);if(!bn(t))return Xi(1);const s=t.getBoundingClientRect(),{width:i,height:o,$:l}=$C(t);let u=(l?Fh(s.width):s.width)/i,d=(l?Fh(s.height):s.height)/o;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const HI=Xi(0);function QC(e){const t=Rn(e);return!kv()||!t.visualViewport?HI:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function FI(e,t,s){return t===void 0&&(t=!1),!!s&&t&&s===Rn(e)}function Po(e,t,s,i){t===void 0&&(t=!1),s===void 0&&(s=!1);const o=e.getBoundingClientRect(),l=Xv(e);let u=Xi(1);t&&(i?ln(i)&&(u=Gl(i)):u=Gl(e));const d=FI(l,s,i)?QC(l):Xi(0);let f=(o.left+d.x)/u.x,g=(o.top+d.y)/u.y,m=o.width/u.x,h=o.height/u.y;if(l&&i){const x=Rn(l),S=ln(i)?Rn(i):i;let w=x,C=Ny(w);for(;C&&S!==w;){const E=Gl(C),R=C.getBoundingClientRect(),k=ys(C),O=R.left+(C.clientLeft+parseFloat(k.paddingLeft))*E.x,A=R.top+(C.clientTop+parseFloat(k.paddingTop))*E.y;f*=E.x,g*=E.y,m*=E.x,h*=E.y,f+=O,g+=A,w=Rn(C),C=Ny(w)}}return Uu({width:m,height:h,x:f,y:g})}function qp(e,t){const s=xp(e).scrollLeft;return t?t.left+s:Po(ea(e)).left+s}function XC(e,t){const s=e.getBoundingClientRect(),i=s.left+t.scrollLeft-qp(e,s),o=s.top+t.scrollTop;return{x:i,y:o}}function BI(e){let{elements:t,rect:s,offsetParent:i,strategy:o}=e;const l=o==="fixed",u=ea(i),d=t?bp(t.floating):!1;if(i===u||d&&l)return s;let f={scrollLeft:0,scrollTop:0},g=Xi(1);const m=Xi(0),h=bn(i);if((h||!l)&&((Rr(i)!=="body"||Ju(u))&&(f=xp(i)),h)){const S=Po(i);g=Gl(i),m.x=S.x+i.clientLeft,m.y=S.y+i.clientTop}const x=u&&!h&&!l?XC(u,f):Xi(0);return{width:s.width*g.x,height:s.height*g.y,x:s.x*g.x-f.scrollLeft*g.x+m.x+x.x,y:s.y*g.y-f.scrollTop*g.y+m.y+x.y}}function VI(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function KI(e){const t=xp(e),s=e.ownerDocument.body,i=Qi(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),o=Qi(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let l=-t.scrollLeft+qp(e);const u=-t.scrollTop;return ys(s).direction==="rtl"&&(l+=Qi(e.clientWidth,s.clientWidth)-i),{width:i,height:o,x:l,y:u}}const qI=25;function YI(e,t,s){s===void 0&&(s="viewport");const i=s==="layoutViewport",o=Rn(e),l=ea(e),u=o.visualViewport;let d=l.clientWidth,f=l.clientHeight,g=0,m=0;if(u){const x=!kv()||t==="fixed";i?x||(g=-u.offsetLeft,m=-u.offsetTop):(d=u.width,f=u.height,x&&(g=u.offsetLeft,m=u.offsetTop))}if(qp(l)<=0){const x=l.ownerDocument,S=x.body,w=getComputedStyle(S),C=x.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,E=Math.abs(l.clientWidth-S.clientWidth-C),R=getComputedStyle(l).scrollbarGutter==="stable both-edges"?E/2:E;R<=qI&&(d-=R)}return{width:d,height:f,x:g,y:m}}function GI(e,t){const s=Po(e,!0,t==="fixed"),i=s.top+e.clientTop,o=s.left+e.clientLeft,l=Gl(e),u=e.clientWidth*l.x,d=e.clientHeight*l.y,f=o*l.x,g=i*l.y;return{width:u,height:d,x:f,y:g}}function qw(e,t,s){let i;if(t==="viewport"||t==="layoutViewport")i=YI(e,s,t);else if(t==="document")i=KI(ea(e));else if(ln(t))i=GI(t,s);else{const o=QC(e);i={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Uu(i)}function $I(e,t){const s=t.get(e);if(s)return s;let i=Lu(e,[],!1).filter(d=>ln(d)&&Rr(d)!=="body"),o=null;const l=ys(e).position==="fixed";let u=l?Zi(e):e;for(;ln(u)&&!$i(u);){const d=ys(u),f=Tv(u),g=o?o.position:l?"fixed":"";!f&&(g==="fixed"||g==="absolute"&&d.position==="static")?i=i.filter(h=>h!==u):o=d,u=Zi(u)}return t.set(e,i),i}function QI(e){let{element:t,boundary:s,rootBoundary:i,strategy:o}=e;const u=[...s==="clippingAncestors"?bp(t)?[]:$I(t,this._c):[].concat(s),i],d=qw(t,u[0],o);let f=d.top,g=d.right,m=d.bottom,h=d.left;for(let x=1;x<u.length;x++){const S=qw(t,u[x],o);f=Qi(S.top,f),g=nc(S.right,g),m=nc(S.bottom,m),h=Qi(S.left,h)}return{width:g-h,height:m-f,x:h,y:f}}function XI(e){const{width:t,height:s}=$C(e);return{width:t,height:s}}function ZI(e,t,s){const i=bn(t),o=ea(t),l=s==="fixed",u=Po(e,!0,l,t);let d={scrollLeft:0,scrollTop:0};const f=Xi(0);if((i||!l)&&((Rr(t)!=="body"||Ju(o))&&(d=xp(t)),i)){const x=Po(t,!0,l,t);f.x=x.x+t.clientLeft,f.y=x.y+t.clientTop}!i&&o&&(f.x=qp(o));const g=o&&!i&&!l?XC(o,d):Xi(0),m=u.left+d.scrollLeft-f.x-g.x,h=u.top+d.scrollTop-f.y-g.y;return{x:m,y:h,width:u.width,height:u.height}}function ay(e){return ys(e).position==="static"}function Yw(e,t){if(!bn(e)||ys(e).position==="fixed")return null;if(t)return t(e);let s=e.offsetParent;return ea(e)===s&&(s=s.ownerDocument.body),s}function ZC(e,t){const s=Rn(e);if(bp(e))return s;if(!bn(e)){let o=Zi(e);for(;o&&!$i(o);){if(ln(o)&&!ay(o))return o;o=Zi(o)}return s}let i=Yw(e,t);for(;i&&Fj(i)&&ay(i);)i=Yw(i,t);return i&&$i(i)&&ay(i)&&!Tv(i)?s:i||Kj(e)||s}const JI=async function(e){const t=this.getOffsetParent||ZC,s=this.getDimensions,i=await s(e.floating);return{reference:ZI(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function WI(e){return ys(e).direction==="rtl"}const JC={convertOffsetParentRelativeRectToViewportRelativeRect:BI,getDocumentElement:ea,getClippingRect:QI,getOffsetParent:ZC,getElementRects:JI,getClientRects:VI,getDimensions:XI,getScale:Gl,isElement:ln,isRTL:WI};function WC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function e3(e,t,s){let i=null,o;const l=ea(e);function u(){var m;clearTimeout(o),(m=i)==null||m.disconnect(),i=null}function d(m,h){m===void 0&&(m=!1),h===void 0&&(h=1),u();const x=e.getBoundingClientRect(),{left:S,top:w,width:C,height:E}=x;if(m||t(),!C||!E)return;const R=Xf(w),k=Xf(l.clientWidth-(S+C)),O=Xf(l.clientHeight-(w+E)),A=Xf(S),j={rootMargin:-R+"px "+-k+"px "+-O+"px "+-A+"px",threshold:Qi(0,nc(1,h))||1};let D=!0;function M(_){const L=_[0].intersectionRatio;if(!WC(x,e.getBoundingClientRect()))return d();if(L!==h){if(!D)return d();L?d(!1,L):o=setTimeout(()=>{d(!1,1e-7)},1e3)}D=!1}try{i=new IntersectionObserver(M,{...j,root:l.ownerDocument})}catch{i=new IntersectionObserver(M,j)}i.observe(e)}const f=Rn(e),g=()=>d(s);return f.addEventListener("resize",g),d(!0),()=>{f.removeEventListener("resize",g),u()}}function Gw(e,t,s,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=i,g=Xv(e),m=o||l?[...g?Lu(g):[],...t?Lu(t):[]]:[];m.forEach(R=>{o&&R.addEventListener("scroll",s),l&&R.addEventListener("resize",s)});const h=g&&d?e3(g,s,l):null;let x=-1,S=null;u&&(S=new ResizeObserver(R=>{let[k]=R;k&&k.target===g&&S&&t&&(S.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var O;(O=S)==null||O.observe(t)})),s()}),g&&!f&&S.observe(g),t&&S.observe(t));let w,C=f?Po(e):null;f&&E();function E(){const R=Po(e);C&&!WC(C,R)&&s(),C=R,w=requestAnimationFrame(E)}return s(),()=>{var R;m.forEach(k=>{o&&k.removeEventListener("scroll",s),l&&k.removeEventListener("resize",s)}),h?.(),(R=S)==null||R.disconnect(),S=null,f&&cancelAnimationFrame(w)}}const t3=LI,n3=zI,r3=II,s3=UI,i3=_I,a3=(e,t,s)=>{const i=new Map,o=s??{},l={...JC,...o.platform,_c:i};return jI(e,t,{...o,platform:l})};var o3=typeof document<"u",l3=function(){},Rh=o3?b.useLayoutEffect:l3;function $h(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 s,i,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(s=e.length,s!==t.length)return!1;for(i=s;i--!==0;)if(!$h(e[i],t[i]))return!1;return!0}if(o=Object.keys(e),s=o.length,s!==Object.keys(t).length)return!1;for(i=s;i--!==0;)if(!{}.hasOwnProperty.call(t,o[i]))return!1;for(i=s;i--!==0;){const l=o[i];if(!(l==="_owner"&&e.$$typeof)&&!$h(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function eT(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $w(e,t){const s=eT(e);return Math.round(t*s)/s}function oy(e){const t=b.useRef(e);return Rh(()=>{t.current=e}),t}function c3(e){e===void 0&&(e={});const{placement:t="bottom",strategy:s="absolute",middleware:i=[],platform:o,elements:{reference:l,floating:u}={},transform:d=!0,whileElementsMounted:f,open:g}=e,[m,h]=b.useState({x:0,y:0,strategy:s,placement:t,middlewareData:{},isPositioned:!1}),[x,S]=b.useState(i);$h(x,i)||S(i);const[w,C]=b.useState(null),[E,R]=b.useState(null),k=b.useCallback($=>{$!==j.current&&(j.current=$,C($))},[]),O=b.useCallback($=>{$!==D.current&&(D.current=$,R($))},[]),A=l||w,N=u||E,j=b.useRef(null),D=b.useRef(null),M=b.useRef(m),_=f!=null,L=oy(f),q=oy(o),X=oy(g),B=b.useCallback(()=>{if(!j.current||!D.current)return;const $={placement:t,strategy:s,middleware:x};q.current&&($.platform=q.current),a3(j.current,D.current,$).then(K=>{const Y={...K,isPositioned:X.current!==!1};H.current&&!$h(M.current,Y)&&(M.current=Y,hr.flushSync(()=>{h(Y)}))})},[x,t,s,q,X]);Rh(()=>{g===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,h($=>({...$,isPositioned:!1})))},[g]);const H=b.useRef(!1);Rh(()=>(H.current=!0,()=>{H.current=!1}),[]),Rh(()=>{if(A&&(j.current=A),N&&(D.current=N),A&&N){if(L.current)return L.current(A,N,B);B()}},[A,N,B,L,_]);const U=b.useMemo(()=>({reference:j,floating:D,setReference:k,setFloating:O}),[k,O]),z=b.useMemo(()=>({reference:A,floating:N}),[A,N]),Q=b.useMemo(()=>{const $={position:s,left:0,top:0};if(!z.floating)return $;const K=$w(z.floating,m.x),Y=$w(z.floating,m.y);return d?{...$,transform:"translate("+K+"px, "+Y+"px)",...eT(z.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:K,top:Y}},[s,d,z.floating,m.x,m.y]);return b.useMemo(()=>({...m,update:B,refs:U,elements:z,floatingStyles:Q}),[m,B,U,z,Q])}const u3=(e,t)=>{const s=t3(e);return{name:s.name,fn:s.fn,options:[e,t]}},d3=(e,t)=>{const s=n3(e);return{name:s.name,fn:s.fn,options:[e,t]}},f3=(e,t)=>({fn:i3(e).fn,options:[e,t]}),h3=(e,t)=>{const s=r3(e);return{name:s.name,fn:s.fn,options:[e,t]}},p3=(e,t)=>{const s=s3(e);return{name:s.name,fn:s.fn,options:[e,t]}},g3={...Yi,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class m3 extends oc{constructor(t,s,i){const o=new ad;super(y3(t,o,s,i),v3(o),g3)}setOpen=(t,s)=>{fI(this,t,s,{extraState:{openChangeReason:s.reason}})};cancelPendingOpen(t){this.state.floatingRootContext.dispatchOpenChange(!1,ut(Qs,t))}}function y3(e,t,s,i=!1){return{...Bp(t,s,i),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function v3(e){return{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const b3=Xu(function(t){const{disabled:s=!1,defaultOpen:i=!1,open:o,disableHoverablePopup:l=!1,trackCursorAxis:u="none",actionsRef:d,onOpenChange:f,onOpenChangeComplete:g,handle:m,triggerId:h,defaultTriggerId:x=null,children:S}=t,w=Kv((q,X)=>new m3({open:i,openProp:o,activeTriggerId:x,triggerIdProp:h},q,X));w.useControlledProp("openProp",o),w.useControlledProp("triggerIdProp",h),w.useContextCallback("onOpenChange",f),w.useContextCallback("onOpenChangeComplete",g);const C=w.useState("open"),E=!s&&C,R=w.useState("activeTriggerId"),k=w.useState("mounted"),O=w.useState("payload");w.useSyncedValues({trackCursorAxis:u,disableHoverablePopup:l,disabled:s}),_p(w,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:A,transitionStatus:N}=Up(E,w),j=w.useState("isInstantPhase"),D=w.useState("instantType"),M=w.useState("lastOpenChangeReason"),_=b.useRef(null);_e(()=>{C&&s&&w.setOpen(!1,ut(u4))},[C,s,w]),_e(()=>{N==="ending"&&M===Mr||N!=="ending"&&j?(D!=="delay"&&(_.current=D),w.set("instantType","delay")):_.current!==null&&(w.set("instantType",_.current),_.current=null)},[N,j,M,D,w]),_e(()=>{E&&R==null&&w.set("payload",void 0)},[w,R,E]),b.useImperativeHandle(d,()=>({unmount:A,close:()=>w.setOpen(!1,ut(nd))}),[A,w]);const L=E||k||!s&&u!=="none";return v.jsxs(GR.Provider,{value:w,children:[m&&v.jsx(Ip,{handle:m,store:w}),L&&v.jsx(x3,{store:w,disabled:s,trackCursorAxis:u}),typeof S=="function"?S({payload:O}):S]})});function x3({store:e,disabled:t,trackCursorAxis:s}){const i=e.useState("floatingRootContext"),o=sd(i,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),l=oI(i,{enabled:!t&&s!=="none",axis:s==="none"?void 0:s}),u=b.useMemo(()=>Ar(l.reference,o.reference),[l.reference,o.reference]);return Hp(e,{activeTriggerProps:u,inactiveTriggerProps:u,popupProps:o.floating??Xt}),null}function ar(e){return ac(e,"base-ui")}const tT=b.createContext(void 0);function S3(){return b.useContext(tT)}const w3=600,Qw="data-base-ui-tooltip-trigger";function Xw(e){const t=nr(e);return ln(t)?t:null}const E3=gp(function(t,s){const{render:i,className:o,style:l,handle:u,payload:d,disabled:f,delay:g,closeOnClick:m=!0,closeDelay:h,id:x,...S}=t,w=Zu(!0),E=Vp(u)??w;if(!E)throw new Error(gn(82));const R=ar(x),k=E.useState("isTriggerActive",R),O=E.useState("isOpenedByTrigger",R),A=E.useState("floatingRootContext"),N=b.useRef(null),j=h??0,{registerTrigger:D,isMountedByThisTrigger:M}=zp(R,N,E,{payload:d,closeOnClick:m,closeDelay:j}),_=S3(),{activeIdRef:L,delayRef:q,isInstantPhase:X,hasProvider:B}=p4(A,{open:O}),H=Yv(A);E.useSyncedValue("isInstantPhase",X);const U=E.useState("disabled"),z=f??U,Q=Ln(z),$=E.useState("trackCursorAxis"),K=E.useState("disableHoverablePopup"),Y=b.useRef(!1),ee=Un(),G=b.useRef(void 0);function oe(){return B&&L.current!=null?0:g??_??w3}function I(ue){const Te=N.current;if(!Te||!ue)return!1;const ve=zu(ue,`[${Qw}]`);return ve!==null&&ve!==Te&&it(Te,ve)}function V(ue){const Te=I(ue);return Y.current=Te,Te&&(H.openChangeTimeout.clear(),H.restTimeout.clear(),H.restTimeoutPending=!1,ee.clear()),Te}const W=$v(A,{enabled:!z,mouseOnly:!0,move:!1,handleClose:!K&&$!=="both"?Qv():null,restMs:oe,delay(){return h==null&&B?{close:Io(q.current,"close")}:{close:j}},triggerElementRef:N,isActiveTrigger:k,isClosing:()=>E.select("transitionStatus")==="ending",shouldOpen(){return!Y.current}}),re=VC(A,{enabled:!z}).reference,Ee=ue=>{const Te=Y.current,ve=Xw(ue),Pe=V(ve),Oe=N.current,Le=Oe&&ve&&it(Oe,ve);if(Pe&&E.select("open")&&E.select("lastOpenChangeReason")===Kn){E.setOpen(!1,ut(Kn,ue));return}if(Te&&!Pe&&Le&&!Q.current&&!E.select("open")&&Oe&&Ua(G.current)){const Ve=()=>{!Y.current&&!Q.current&&!E.select("open")&&E.setOpen(!0,ut(Kn,ue,Oe))},ke=oe();ke===0?(ee.clear(),Ve()):ee.start(ke,Ve)}},le=E.useState("appliedTriggerProps",M||$!=="none");return kt("button",t,{state:{open:O},ref:[s,D,N],props:[W,re,le,{onMouseOver(ue){Ee(ue.nativeEvent)},onFocus(ue){I(Xw(ue.nativeEvent))&&ue.preventBaseUIHandler()},onMouseLeave(){Y.current=!1,ee.clear(),G.current=void 0},onPointerEnter(ue){G.current=ue.pointerType},onPointerDown(ue){G.current=ue.pointerType,E.set("closeOnClick",m),m&&!E.select("open")&&E.cancelPendingOpen(ue.nativeEvent)},onClick(ue){m&&!E.select("open")&&E.cancelPendingOpen(ue.nativeEvent)},id:R,[jy]:z?"":void 0,[Qw]:z?void 0:""},S],stateAttributesMapping:Ep})}),nT=b.createContext(void 0);function R3(){const e=b.useContext(nT);if(e===void 0)throw new Error(gn(70));return e}const C3=b.forwardRef(function(t,s){const{children:i,container:o,className:l,render:u,style:d,...f}=t,{node:g,subtree:m}=AC({container:o,ref:s,componentProps:t,elementProps:f});return!m&&!g?null:v.jsxs(b.Fragment,{children:[m,g&&hr.createPortal(i,g)]})}),T3=b.forwardRef(function(t,s){const{keepMounted:i=!1,...o}=t;return Zu().useState("mounted")||i?v.jsx(nT.Provider,{value:i,children:v.jsx(C3,{ref:s,...o})}):null}),rT=b.createContext(void 0);function sT(){const e=b.useContext(rT);if(e===void 0)throw new Error(gn(71));return e}function k3(e){const{nodeId:t,externalTree:s,rootContext:i}=e,o=i.useState("referenceElement"),l=i.useState("floatingElement"),u=i.useState("domReferenceElement"),d=i.useState("open"),f=i.useState("floatingId"),[g,m]=b.useState(null),h=b.useRef(null),x=Qa(s),S=b.useMemo(()=>({reference:o,floating:l,domReference:u}),[o,l,u]),w=c3({...e,elements:{...S,...g&&{reference:g}}}),C=b.useCallback(O=>{const A=ln(O)?{getBoundingClientRect:()=>O.getBoundingClientRect(),getClientRects:()=>O.getClientRects(),contextElement:O}:O;m(A),w.refs.setReference(A)},[w.refs]),E=b.useMemo(()=>({...w.refs,setPositionReference:C,domReference:h}),[w.refs,C]),R=b.useMemo(()=>({...w.elements,domReference:u}),[w.elements,u]),k=b.useMemo(()=>({...w,dataRef:i.context.dataRef,open:d,onOpenChange:i.setOpen,events:i.context.events,floatingId:f,refs:E,elements:R,nodeId:t,rootStore:i}),[w,E,R,t,i,d,f]);return _e(()=>{u&&(h.current=u)},[u]),_e(()=>{i.context.dataRef.current.floatingContext=k;const O=x?.nodesRef.current.find(A=>A.id===t);O&&(O.context=k)}),b.useMemo(()=>({...w,context:k,refs:E,elements:R,rootStore:i}),[w,E,R,k,i])}const O3=b.createContext(void 0);function Yp(){return b.useContext(O3)?.direction??"ltr"}const A3=e=>({name:"arrow",options:e,async fn(t){const{x:s,y:i,placement:o,rects:l,platform:u,elements:d,middlewareData:f}=t,{element:g,padding:m=0}=Va(e,t)||{};if(g==null)return{};const h=aC(m),x={x:s,y:i},S=Iv(o),w=jv(S),C=await u.getDimensions(g),E=S==="y",R=E?"top":"left",k=E?"bottom":"right",O=E?"clientHeight":"clientWidth",A=l.reference[w]+l.reference[S]-x[S]-l.floating[w],N=x[S]-l.reference[S],j=d.floating[O]||l.floating[w],D=A/2-N/2,M=j/2-C[w]/2-1,_=Math.min(h[R],M),L=Math.min(h[k],M),q=_,X=j-C[w]-L,B=j/2-C[w]/2+D,H=iC(q,B,X),U=!f.arrow&&vi(o)!=null&&B!==H&&l.reference[w]/2-(B<q?_:L)-C[w]/2<0,z=U?B<q?B-q:B-X:0;return{[S]:x[S]+z,data:{[S]:H,centerOffset:B-H-z,...U&&{alignmentOffset:z}},reset:U}}}),M3=(e,t)=>{const{name:s,fn:i}=A3(e);return{name:s,fn:i,options:[e,t]}},N3={name:"hide",async fn(e){const{width:t,height:s,x:i,y:o}=e.rects.reference,l=t===0&&s===0&&i===0&&o===0,u=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:u.top-s>=0||u.right-t>=0||u.bottom-s>=0||u.left-t>=0||l}}}},D3={sideX:"left",sideY:"top"},j3="--available-width",I3="--available-height",P3="--anchor-width",L3="--anchor-height",z3="--transform-origin",Zw=j3,Jw=I3;function iT(e,t,s){const i=e==="inline-start"||e==="inline-end";return{top:"top",right:i?s?"inline-start":"inline-end":"right",bottom:"bottom",left:i?s?"inline-end":"inline-start":"left"}[t]}function Ww(e,t,s){const{rects:i,placement:o}=e;return{side:iT(t,ms(o),s),align:vi(o)||"center",anchor:{width:i.reference.width,height:i.reference.height},positioner:{width:i.floating.width,height:i.floating.height}}}function Gp(e){return _3(e,k3)}function _3(e,t){const{anchor:s,positionMethod:i="absolute",side:o="bottom",sideOffset:l=0,align:u="center",alignOffset:d=0,collisionBoundary:f,collisionPadding:g=5,sticky:m=!1,arrowPadding:h=5,disableAnchorTracking:x=!1,inline:S,keepMounted:w=!1,floatingRootContext:C,mounted:E,collisionAvoidance:R,shift:k,nodeId:O,adaptiveOrigin:A,lazyFlip:N=!1,externalTree:j}=e,D=R.side||"flip",M=R.align||"flip",_=R.fallbackAxisSide||"end",L=k?.crossAxis??!1,q=k?.rootBoundary,X=typeof s=="function"?s:void 0,B=Be(X),H=X?B:s,U=Ln(s),z=Ln(E),$=Yp()==="rtl",[K,Y]=b.useState(null);!E&&K!==null&&Y(null);const ee=N==="placement",G=K?ms(K):null,oe=K&&ee?vi(K)||"center":null,I=G||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":$?"left":"right","inline-start":$?"right":"left"}[o],V=oe||u,W=V==="center"?I:`${I}-${V}`;let re=g;typeof re=="number"?re={top:re,right:re,bottom:re,left:re}:re&&(re={top:re.top||0,right:re.right||0,bottom:re.bottom||0,left:re.left||0});const Ee=1,le=o==="bottom"?Ee:0,me=o==="top"?Ee:0,ge=o==="right"?Ee:0,ue=o==="left"?Ee:0,Te={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:re},ve=b.useRef(null),Pe=Ln(l),Oe=Ln(d),Le=typeof l!="function"?l:0,Ve=typeof d!="function"?d:0,ke=[];S&&ke.push(S),ke.push(u3(je=>{const at=Ww(je,o,$),Ie=typeof Pe.current=="function"?Pe.current(at):Pe.current,ze=typeof Oe.current=="function"?Oe.current(at):Oe.current;return{mainAxis:Ie,crossAxis:ze,alignmentAxis:ze}},[Le,Ve,$,o]));const Ue=M==="none"&&D!=="shift",be=!Ue&&(m||L||D==="shift"),He=D==="none"?null:h3({...Te,padding:{top:re.top+Ee+le,right:re.right+Ee+ue,bottom:re.bottom+Ee+me,left:re.left+Ee+ge},mainAxis:!L&&D==="flip",crossAxis:M==="flip"?"alignment":!1,fallbackAxisSideDirection:_}),Ze=Ue?null:d3({...Te,rootBoundary:q,mainAxis:M!=="none",crossAxis:be,limiter:m||L?void 0:f3(je=>{if(!ve.current)return{};const{width:at,height:Ie}=ve.current.getBoundingClientRect(),ze=js(ms(je.placement)),$e=ze==="y"?at:Ie,et=ze==="y"?re.left+re.right:re.top+re.bottom;return{offset:$e/2+et/2}})},[Te,m,L,q,re,M]);D==="shift"||M==="shift"||V==="center"?ke.push(Ze,He):ke.push(He,Ze),ke.push(p3({...Te,apply({elements:{floating:je},availableWidth:at,availableHeight:Ie,rects:ze}){if(!z.current)return;const $e=je.style;$e.setProperty(Zw,`${at}px`),$e.setProperty(Jw,`${Ie}px`);const et=Rn(je).devicePixelRatio||1,{x:Tt,y:F,width:J,height:ne}=ze.reference,ye=(Math.round((Tt+J)*et)-Math.round(Tt*et))/et,xe=(Math.round((F+ne)*et)-Math.round(F*et))/et;$e.setProperty(P3,`${ye}px`),$e.setProperty(L3,`${xe}px`)}}),M3(je=>({element:ve.current||Qt(je.elements.floating).createElement("div"),padding:ve.current?h:0}),[h]),{name:"transformOrigin",fn(je){const{elements:{floating:at},middlewareData:Ie,placement:ze,platform:$e,rects:et,y:Tt}=je,F=ms(ze),J=vi(ze),ne=js(F)==="y",ye=ve.current,xe=typeof l=="function"?l(Ww(je,o,$)):l;let qe;if(!ye&&J&&Math.abs(ne?Ie.shift?.x||0:Ie.shift?.y||0)<=1)qe=J==="start"===(ne&&$e.isRTL?.(at)===!0)?"100%":"0%";else{const Xe=ne?Ie.arrow?.x||0:Ie.arrow?.y||0,Qe=ne?ye?.clientWidth||0:ye?.clientHeight||0;qe=`${Xe+Qe/2}px`}let Ke=F==="top"||F==="left"?`calc(100% + ${xe}px)`:`${-xe}px`;return be&&ne&&Math.abs(Ie.shift?.y||0)>xe&&(Ke=`${et.reference.y+et.reference.height/2-Tt}px`),at.style.setProperty(z3,ne?`${qe} ${Ke}`:`${Ke} ${qe}`),{}}},N3,A),_e(()=>{!E&&C&&C.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[E,C]);const ot=b.useMemo(()=>({ancestorScroll:!x,elementResize:!x&&typeof ResizeObserver<"u",layoutShift:!x&&typeof IntersectionObserver<"u"}),[x]),{refs:de,elements:we,x:Ge,y:Me,middlewareData:De,update:bt,placement:dt,context:gt,isPositioned:Nt,floatingStyles:jt}=t({rootContext:C,open:w?E:void 0,placement:W,middleware:ke,strategy:i,whileElementsMounted:w?void 0:(...je)=>Gw(...je,ot),nodeId:O,externalTree:j}),{sideX:tn,sideY:an}=De.adaptiveOrigin||D3,nn=Nt?i:"fixed",We=b.useMemo(()=>{let je;return Nt?A?je={position:nn,[tn]:Ge,[an]:Me}:je={...jt,position:nn}:je={position:nn,top:0,left:0},je[Zw]="100vw",je[Jw]="100vh",Nt||(je.opacity=0),je},[A,nn,tn,Ge,an,Me,jt,Nt]),wt=b.useRef(null);_e(()=>{if(!E)return;const je=U.current,at=typeof je=="function"?je():je,ze=(eE(at)?at.current:at)||null||null;ze!==wt.current&&(de.setPositionReference(ze),wt.current=ze)},[E,de,H,U]),b.useEffect(()=>{if(!E)return;const je=U.current;typeof je!="function"&&eE(je)&&je.current!==wt.current&&(de.setPositionReference(je.current),wt.current=je.current)},[E,de,H,U]),b.useEffect(()=>{if(w&&E&&we.reference&&we.floating)return Gw(we.reference,we.floating,bt,ot)},[w,E,we,bt,ot]);const Zt=ms(dt),ht=iT(o,Zt,$),xt=vi(dt)||"center",yt=!!De.hide?.referenceHidden;_e(()=>{N&&E&&Nt&&(Zt!==I||ee&&xt!==V)&&Y(dt)},[N,ee,E,Nt,dt,Zt,xt,I,V]);const Ut=b.useMemo(()=>({position:"absolute",top:De.arrow?.y,left:De.arrow?.x}),[De.arrow]),un=De.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:We,arrowStyles:Ut,arrowRef:ve,arrowUncentered:un,side:ht,align:xt,physicalSide:Zt,anchorHidden:yt,refs:de,context:gt,isPositioned:Nt,update:bt}),[We,Ut,ve,un,ht,xt,Zt,yt,de,gt,Nt,bt])}function eE(e){return e!=null&&"current"in e}function od(e){return e==="starting"?tI:Xt}function $p(e,t,{styles:s,transitionStatus:i,props:o,refs:l,hidden:u,inert:d=!1}){const f={...s};return d&&(f.pointerEvents="none"),kt("div",e,{state:t,ref:l,props:[{role:"presentation",hidden:u,style:f},od(i),o],stateAttributesMapping:Wu})}const U3=b.forwardRef(function(t,s){const{render:i,className:o,anchor:l,positionMethod:u="absolute",side:d="top",align:f="center",sideOffset:g=0,alignOffset:m=0,collisionBoundary:h="clipping-ancestors",collisionPadding:x=5,arrowPadding:S=5,sticky:w=!1,disableAnchorTracking:C=!1,collisionAvoidance:E=Hv,style:R,...k}=t,O=Zu(),A=R3(),N=O.useState("open"),j=O.useState("mounted"),D=O.useState("trackCursorAxis"),M=O.useState("disableHoverablePopup"),_=O.useState("floatingRootContext"),L=O.useState("instantType"),q=O.useState("transitionStatus"),X=O.useState("adaptiveOrigin"),B=Gp({anchor:l,positionMethod:u,floatingRootContext:_,mounted:j,side:d,sideOffset:g,align:f,alignOffset:m,collisionBoundary:h,collisionPadding:x,sticky:w,arrowPadding:S,disableAnchorTracking:C,keepMounted:A,collisionAvoidance:E,adaptiveOrigin:X}),H=b.useMemo(()=>({open:N,side:B.side,align:B.align,anchorHidden:B.anchorHidden,instant:D!=="none"?"tracking-cursor":L}),[N,B.side,B.align,B.anchorHidden,D,L]),U=$p(t,H,{styles:B.positionerStyles,transitionStatus:q,props:k,refs:[s,O.useStateSetter("positionerElement")],hidden:!j,inert:!N||D==="both"||M});return v.jsx(rT.Provider,{value:B,children:U})}),H3=b.forwardRef(function(t,s){const{render:i,className:o,style:l,...u}=t,d=Zu(),{side:f,align:g}=sT(),m=d.useState("open"),h=d.useState("instantType"),x=d.useState("transitionStatus"),S=d.useState("popupProps"),w=d.useState("floatingRootContext"),C=d.useState("disabled"),E=d.useState("closeDelay");Ls({open:m,ref:d.context.popupRef,onComplete(){m&&d.context.onOpenChangeComplete?.(!0)}}),Gv(w,{enabled:!C,closeDelay:E});const R=d.useStateSetter("popupElement");return kt("div",t,{state:{open:m,side:f,align:g,instant:h,transitionStatus:x},ref:[s,d.context.popupRef,R],props:[id,S,od(x),u],stateAttributesMapping:Rp})}),F3=b.forwardRef(function(t,s){const{render:i,className:o,style:l,...u}=t,d=Zu(),{arrowRef:f,side:g,align:m,arrowUncentered:h,arrowStyles:x}=sT(),S=d.useState("open"),w=d.useState("instantType");return kt("div",t,{state:{open:S,side:g,align:m,uncentered:h,instant:w},ref:[s,f],props:[{style:x,"aria-hidden":!0},u],stateAttributesMapping:Wu})}),B3=function(t){const{delay:s,closeDelay:i,timeout:o=400}=t,l=b.useMemo(()=>({open:s,close:i}),[s,i]);return v.jsx(tT.Provider,{value:s,children:v.jsx(h4,{delay:l,timeoutMs:o,children:t.children})})};function Qp(e){return zv(19)?e:e?"true":void 0}function V3(e){const[t,s]=b.useState({current:e,previous:null});return Object.is(e,t.current)||s({current:e,previous:t.current}),t.previous}const aT=48,Ei=(e,t=0)=>{const s=new Int32Array(e.length);for(let i=0;i<e.length;i++)s[i]=e.charCodeAt(i)-aT-t;return s},Xp=e=>{const t=new Int32Array(e.length+1);for(let s=0;s<e.length;s++)t[s+1]=t[s]+e[s];return t},qa=e=>{const t=new Int32Array(e.length);let s=0;for(let i=0;i<e.length;i++){const o=e.charCodeAt(i)-aT;s+=o>>>1^-(o&1),t[i]=s}return t},K3=384,q3=[],To=Xp(Ei("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),Y3=Xp(Ei(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3")),G3="@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom",$3=(()=>{const e=To.length-1,t=new Int32Array(e);for(let o=e-1;o>=0;o--){let l=1,u=o+1;for(let d=To[o];d<To[o+1];d++)l+=t[u],u+=t[u];t[o]=l}const s=new Int32Array(To[e]);let i=0;for(let o=0;o<e;o++){let l=o+1;for(let u=To[o];u<To[o+1];u++)s[i++]=l,l+=t[l]}return s})(),Q3=Ei("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),X3=Xp(Ei("123333359346463635126536711576")),Z3=Ei("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),J3=Ei("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),W3=qa("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),eP=(()=>{const e=new Int32Array(319).fill(-1),t=qa("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),s=qa("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let i=0;i<t.length;i++)e[t[i]]=s[i];return e})(),tP="container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform".split("|").map(e=>{const t=e.split(" "),s=t.shift();for(let i=0;i<t.length;i++)t[i]=s+t[i];return t}),tE=qa("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),nP=qa("ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>6ʰ22ʷʺʷʺʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622"),rP=qa("02222222222222222222222222222222222222222222222222222222222222222202021422222222CF2200GJ021042222WZ222IL0ad2c10h2222U00X202[^2w0000120zy|}€22ƒ†…:22z22222222222G000q†OVI00000{˜2™<40000Œ›@00000G¦§000ª00000000000000021K¬«00®“000000000000000000000–222›HGH_1¸222½2¾2222ÇÊ000­°2±"),oT=new Int32Array(987),lT=new Int32Array(987),cT=new Int32Array(987);let Uy="";const Hy=new Int32Array(1022);{const e=new Map;let t=0,s=0;for(let i=0;i<tE.length;i++)for(const o of tP[rP[i]]){let l=e.get(o);l===void 0&&(l=t++,e.set(o,l),Hy[l*2]=Uy.length,Hy[l*2+1]=o.length,Uy+=o),oT[s]=tE[i],lT[s]=nP[i],cT[s]=l,s++}}const sP=qa("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),iP=Xp(Ei("1::24444432:442:44:44>222222:44:4421322511111311111114")),aP=qa("2Š4A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅҜ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=„ƧNž2Đå242L222290000f22500ɛ000ǘ222"),oP=Ei("ij"),lP=Ei("—"),cP=Ei("1"),uP="* ** after backdrop before details-content file first-letter first-line marker placeholder selection";var dP={GROUP_COUNT:K3,customValidatorNames:q3,edgeStart:To,labelStart:Y3,labelText:G3,edgeTarget:$3,nodeGroup:Q3,nodeVlist:eP,vlistPat:X3,vlistOps:Z3,vlistRef:J3,vlistGroup:W3,litAnchor:oT,litGroup:lT,litPool:cT,poolOffsets:Hy,poolText:Uy,adjGid:sP,adjStart:iP,adjTgt:aP,patGid:oP,patTgt:lP,postfixLookupGroups:cP,orderSensitiveModifiers:uP};const fP="line"in new Error,di=-1,Co=-1,ly=(e,t,s)=>{let i=2166136261;for(let o=t;o<s;o++)i=Math.imul(i^e.charCodeAt(o),16777619);return i},Ch=(e,t,s)=>{const i=s-t;let o=Math.imul(i,2654435761)^e.charCodeAt(t);if(i>3){const l=i>>2,u=i>>1;o=Math.imul(o^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+l),2246822507),o=Math.imul(o^e.charCodeAt(t+u)<<8^e.charCodeAt(t+u+l)<<16^e.charCodeAt(s-3),3266489909),o^=e.charCodeAt(s-2)<<8^e.charCodeAt(s-1)<<16;for(let d=t+3,f=s-4;d<t+8&&d<f;d++,f--)o=Math.imul(o^e.charCodeAt(d)^e.charCodeAt(f)<<8,16777619)}return o^o>>>15|0},hP=(e,t,s={})=>{const{GROUP_COUNT:i,edgeStart:o,labelStart:l,labelText:u,edgeTarget:d,nodeGroup:f,nodeVlist:g,vlistPat:m,vlistOps:h,vlistRef:x,vlistGroup:S,litAnchor:w,litGroup:C,litPool:E,poolOffsets:R,poolText:k,adjGid:O,adjStart:A,adjTgt:N,patGid:j,patTgt:D,postfixLookupGroups:M,customValidatorNames:_,orderSensitiveModifiers:L}=e,q=new Int32Array(i).fill(-1);for(let he=0;he<O.length;he++)q[O[he]]=he;let X=0;for(let he=0;he+1<A.length;he++){const Ae=A[he+1]-A[he];Ae>X&&(X=Ae)}let B=32;for(;B<2*(1+X+j.length);)B<<=1;const H=new Int32Array(x.length+1);for(let he=0;he<x.length;he++)H[he+1]=H[he]+m[x[he]+1]-m[x[he]];const U=new Uint8Array(i);for(let he=0;he<M.length;he++)U[M[he]]=1;const z=o.length-1,Q=new Uint8Array(z);let $=0,K=!0;for(let he=0;he<w.length;he++){Q[w[he]]=1;const Ae=R[E[he]*2+1];Ae>$&&($=Ae);const Se=k.charCodeAt(R[E[he]*2]);(Se===91||Se===40)&&(K=!1)}let Y=1;for(;Y<w.length*2;)Y<<=1;const ee=new Int32Array(Y).fill(-1);for(let he=0;he<w.length;he++){const Ae=R[E[he]*2];let Se=(ly(k,Ae,Ae+R[E[he]*2+1])^Math.imul(w[he],2654435761)|0)&Y-1;for(;ee[Se]!==-1;)Se=Se+1&Y-1;ee[Se]=he}const G=(he,Ae,Se,rt)=>{let Ot=(ly(Ae,Se,rt)^Math.imul(he,2654435761)|0)&Y-1;const Rt=rt-Se;for(;;){const Ht=ee[Ot];if(Ht===-1)return-1;if(w[Ht]===he&&R[E[Ht]*2+1]===Rt){const xn=R[E[Ht]*2];let hn=!0;for(let vt=0;vt<Rt;vt++)if(k.charCodeAt(xn+vt)!==Ae.charCodeAt(Se+vt)){hn=!1;break}if(hn)return C[Ht]}Ot=Ot+1&Y-1}},oe=s.cacheSize??8192,I=s.prefix??e.prefix??"",V=I===""?"":I+":",W=V.length,re=(_??[]).map(he=>{throw new Error("cn: missing validator "+he)}),Ee=/\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$/,le=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,me=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ge=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;let ue=0,Te=-1,ve=-1,Pe=-1,Oe=-1;const Le=he=>he>=97&&he<=122||he>=65&&he<=90||he>=48&&he<=57||he===95,Ve=he=>/\s/.test(String.fromCharCode(he)),ke=(he,Ae,Se)=>{if(ue=0,Te=-1,Se-Ae<3)return;const rt=he.charCodeAt(Ae),Ot=he.charCodeAt(Se-1);if(rt===91&&Ot===93)ue=1;else if(rt===40&&Ot===41)ue=2;else return;Pe=Ae+1,Oe=Se-1;let Rt=Ae+1;if(Le(he.charCodeAt(Rt))){for(Rt++;Rt<Se-1;){const Ht=he.charCodeAt(Rt);if(!Le(Ht)&&Ht!==45)break;Rt++}Rt<Se-2&&he.charCodeAt(Rt)===58&&(Te=Ae+1,ve=Rt,Pe=Rt+1)}},Ue=(he,Ae,Se,rt)=>{if(Se-Ae!==rt.length)return!1;for(let Ot=0;Ot<rt.length;Ot++)if(he.charCodeAt(Ae+Ot)!==rt.charCodeAt(Ot))return!1;return!0},be=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,He=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ze=he=>!!he&&!Number.isNaN(Number(he)),ot=(he,Ae,Se)=>{if(Se-Ae<11||!Ue(he,Ae,Ae+10,"@container"))return!1;if(he.charCodeAt(Ae+10)===47)return Se-Ae>=12;const rt=he.charCodeAt(Ae+11);return rt===115&&Se-Ae>=17&&Ue(he,Ae+10,Ae+16,"-size/")||rt===110&&Se-Ae>=19&&Ue(he,Ae+10,Ae+18,"-normal/")},de=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],we="length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight".split("|").map(he=>he.split(" ")),Ge=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],Me=(he,Ae,Se,rt)=>{if(he>=10){if(he>=25)return re[he-25](Ae.slice(Se,rt));const Ot=he-10;if(ue!==de[Ot])return!1;if(Te>=0){for(const Rt of we[Ot])if(Ue(Ae,Te,ve,Rt))return!0;return!1}switch(Ge[Ot]){case 0:return!1;case 1:return!0;case 2:{const Rt=Ae.slice(Pe,Oe);return Ee.test(Rt)&&!le.test(Rt)}case 3:return Ze(Ae.slice(Pe,Oe));case 4:return ge.test(Ae.slice(Pe,Oe));default:return me.test(Ae.slice(Pe,Oe))}}switch(he){case 0:return!0;case 1:return ue===0;case 2:return ue===1;case 3:return ue===2;case 4:return be.test(Ae.slice(Se,rt));case 5:return Ze(Ae.slice(Se,rt));case 6:{const Ot=Ae.slice(Se,rt);return!!Ot&&Number.isInteger(Number(Ot))}case 7:return rt>Se&&Ae.charCodeAt(rt-1)===37&&Ze(Ae.slice(Se,rt-1));case 8:return He.test(Ae.slice(Se,rt));default:return ot(Ae,Se,rt)}},De=new Set(typeof L=="string"?L.split(" "):L),bt=(he,Ae,Se,rt,Ot,Rt)=>{const Ht=ly(Ae,Se,rt)^(Ot?2654435769:0)|0;let xn=he.get(Ht);if(xn!==void 0)e:for(let Dt=0;Dt<xn.length;Dt++){const on=xn[Dt];if(!(on.imp!==Ot||on.k.length!==rt-Se)){for(let mt=0;mt<on.k.length;mt++)if(on.k.charCodeAt(mt)!==Ae.charCodeAt(Se+mt))continue e;return on.id}}else he.set(Ht,xn=[]);const hn=Ae.slice(Se,rt),vt=Rt(hn);return xn.push({k:hn,imp:Ot,id:vt}),vt};let dt=new Map,gt=new Map,Nt=2;const jt=4096,tn=(he,Ae)=>{const Se=[];let rt=0,Ot=0,Rt=0;for(let vt=0;vt<he.length;vt++){const Dt=he.charCodeAt(vt);rt===0&&Ot===0&&Dt===58?(Se.push(he.slice(Rt,vt)),Rt=vt+1):Dt===91?rt++:Dt===93?rt--:Dt===40?Ot++:Dt===41&&Ot--}Se.push(he.slice(Rt));let Ht=Se[0];if(Se.length>1){const vt=[];let Dt=[];for(const on of Se)on.charCodeAt(0)===91||De.has(on)?(Dt.length&&(vt.push(...Dt.sort()),Dt=[]),vt.push(on)):Dt.push(on);Dt.length&&vt.push(...Dt.sort()),Ht=vt.join(":")}const xn=Ae?Ht+" !":Ht;let hn=gt.get(xn);return hn===void 0&&gt.set(xn,hn=Nt++),hn};let an=new Map,nn=i;const We=i+4096,wt=()=>nn++,Zt=2097152,ht=8192,xt=new Int32Array(ht),yt=new Array(ht).fill(null),Ut=new Int32Array(ht),un=new Int32Array(ht),je=new Uint8Array(ht);let at=0;const Ie=(he,Ae,Se,rt,Ot,Rt,Ht,xn)=>{let hn=he;if(yt[he]!==null)if(yt[he|1]===null)hn=he|1;else if((at++&3)===0)hn=he|at>>2&1;else return;yt[hn]=Ae.slice(Se,rt),xt[hn]=Ot,Ut[hn]=Rt,un[hn]=Ht,je[hn]=xn},ze=()=>yt.fill(null);let $e=256,et=[new Int32Array($e),new Int32Array($e),new Int32Array($e),new Int32Array($e)],[Tt,F,J,ne]=et,ye=new Uint8Array($e),xe=new Uint8Array($e);const qe=()=>{$e*=2,et=et.map(Ae=>{const Se=new Int32Array($e);return Se.set(Ae),Se}),[Tt,F,J,ne]=et;const he=new Uint8Array($e);he.set(ye),ye=he,xe=new Uint8Array($e)};let Ke=64,Xe=new Int32Array(Ke),Qe=new Int32Array(Ke);const lt=new Int32Array(i);let tt=2048,Et=21,ft=new Float64Array(tt),qt=new Int32Array(tt),Ft=0;const On=(he,Ae)=>{if(he===0&&Ae<i)return lt[Ae]===Ft?1:(lt[Ae]=Ft,0);const Se=he*2097152+Ae+1;let rt=Math.imul(Se,2654435761)>>>Et;for(;qt[rt]===Ft;){if(ft[rt]===Se)return 1;rt=rt+1&tt-1}return ft[rt]=Se,qt[rt]=Ft,0},Yt=(he,Ae,Se,rt,Ot)=>{if(Se-Ae>=2&&he.charCodeAt(Ae)===91&&he.charCodeAt(Se-1)===93){let Rt=-1;for(let Ht=Ae+1;Ht<Se-1;Ht++)if(he.charCodeAt(Ht)===58){Rt=Ht;break}return Rt===-1||Rt===Ae+1?di:bt(an,he,Ae+1,Rt,0,wt)}if(rt>=0&&f[rt]>=0)return f[rt];for(let Rt=Ot-1;Rt>=0;Rt--){const Ht=Qe[Rt];if(Ht>Se)continue;const xn=Xe[Rt],hn=Se-Ht;if(Q[xn]===1&&hn>0&&hn<=$){const zn=he.charCodeAt(Ht);if(K===!1||zn!==91&&zn!==40){const ss=G(xn,he,Ht,Se);if(ss>=0)return ss}}const vt=g[xn];if(vt<0)continue;const Dt=x[vt],on=m[Dt],mt=m[Dt+1];if(on===mt)continue;ke(he,Ht,Se);const rr=H[vt]-on;for(let zn=on;zn<mt;zn++)if(Me(h[zn],he,Ht,Se))return S[rr+zn]}return di},Bt=he=>{const Ae=he.length;let Se=0,rt=0,Ot=!1;(Nt>jt||dt.size>jt)&&(dt=new Map,gt=new Map,Nt=2,ze()),nn>We&&(an=new Map,nn=i,ze());let Rt=0;for(;Rt<Ae;){let vt=he.charCodeAt(Rt);if(vt===32||vt>=9&&vt<=13||vt>=160&&Ve(vt)){vt!==32&&(Ot=!0),Rt++;continue}const Dt=Rt;let on=0;for(;Rt<Ae;){if(vt=he.charCodeAt(Rt),vt<=32){if(vt===32)break;if(vt>=9&&vt<=13){Ot=!0;break}}else if(vt>=160&&Ve(vt)){Ot=!0;break}on=Math.imul(on^vt,16777619),Rt++}const mt=Rt,rr=mt-Dt;Se===$e&&qe();const zn=Se++;Tt[zn]=Dt,F[zn]=mt,rt+=rr,on^=Math.imul(rr,2654435761);const ss=on^on>>>15|0,Gn=ss&8190;{let rn=-1;if(xt[Gn]===ss&&yt[Gn]!==null&&yt[Gn].length===rr?rn=Gn:xt[Gn|1]===ss&&yt[Gn|1]!==null&&yt[Gn|1].length===rr&&(rn=Gn|1),rn>=0){const or=yt[rn];let Ss=!0;for(let os=0;os<rr;os++)if(or.charCodeAt(os)!==he.charCodeAt(Dt+os)){Ss=!1;break}if(Ss){J[zn]=Ut[rn],ne[zn]=un[rn],ye[zn]=je[rn];continue}}}let $n=Dt;if(W!==0){if(mt-Dt<=W||!he.startsWith(V,Dt)){J[zn]=di,Ie(Gn,he,Dt,mt,ss,di,0,0);continue}$n=Dt+W}let Go=0,bc=0,Ai=-1,$o=-1;for(let rn=$n;rn<mt;rn++){const or=he.charCodeAt(rn);if(Go===0&&bc===0){if(or===58){Ai=rn;continue}if(or===47){$o=rn;continue}}or===91?Go++:or===93?Go--:or===40?bc++:or===41&&bc--}const Ad=Ai>=$n?Ai+1:$n;let Dn=Ad,Cr=mt,ia=!1,Qo=0;Cr>Dn&&he.charCodeAt(Cr-1)===33?(ia=!0,Cr--):Cr>Dn&&he.charCodeAt(Dn)===33&&(ia=!0,Dn++,Qo=1);let qr=-1;$o>Ad&&(qr=$o+Qo,qr>=Cr&&(qr=-1));let Xo=Dn;Cr-Dn>1&&he.charCodeAt(Dn)===45&&(Xo=Dn+1);let is=0,Ir=0,aa=0,xc=-1,as=0;(g[0]>=0||Q[0]===1)&&(Xe[0]=0,Qe[0]=Xo,as=1);let Ja=Co,Sc=0;for(let rn=Xo;rn<Cr;rn++)if(rn===qr&&(Ja=Ir<aa?Co:is,Sc=as),is!==Co){const or=he.charCodeAt(rn);let Ss=-1;if(Ir<aa)u.charCodeAt(Ir)===or?(Ir++,Ir===aa&&(Ss=is=xc)):is=Co;else{const os=o[is],to=o[is+1];let Mi=Co;for(let yr=os;yr<to;yr++){const no=l[yr];if(u.charCodeAt(no)===or){l[yr+1]-no===1?Ss=Mi=d[yr]:(Ir=no+1,aa=l[yr+1],xc=d[yr],Mi=is);break}}is=Mi}if(Ss>=0&&(g[Ss]>=0||Q[Ss]===1)&&rn+1<Cr&&he.charCodeAt(rn+1)===45){if(as===Ke){Ke*=2;const os=new Int32Array(Ke);os.set(Xe),Xe=os;const to=new Int32Array(Ke);to.set(Qe),Qe=to}Xe[as]=Ss,Qe[as]=rn+2,as++}}qr===Cr&&(Ja=Ir<aa?Co:is,Sc=as);const wc=Ir<aa?Co:is;let mr,Pr=!1;if(qr>=0)if(Pr=!0,mr=Yt(he,Dn,qr,Ja,Sc),mr!==di&&mr<i&&U[mr]){const rn=Yt(he,Dn,Cr,wc,as);rn!==di&&rn!==mr&&(mr=rn,Pr=!1)}else mr===di&&(mr=Yt(he,Dn,Cr,wc,as),Pr=!1);else mr=Yt(he,Dn,Cr,wc,as);let Wa=0,eo=0;mr===di?J[zn]=di:(eo=Pr?1:0,Wa=$n>=Ai?ia?1:0:bt(dt,he,$n,Ai,ia?1:0,rn=>tn(rn,ia)),J[zn]=mr,ye[zn]=eo,ne[zn]=Wa),Ie(Gn,he,Dt,mt,ss,mr,Wa,eo)}if(Se===0)return"";if(Se===1)return Tt[0]===0&&F[0]===Ae?he:he.slice(Tt[0],F[0]);if(Se*B>tt){for(;Se*B>tt;)tt<<=1,Et--;ft=new Float64Array(tt),qt=new Int32Array(tt)}if(Nt>=Zt||nn>=Zt)throw new Error("cn: too many distinct classes in one merge");Ft=Ft+1|0,Ft===0&&(lt.fill(0),qt.fill(0),Ft=1);let Ht=!1;for(let vt=Se-1;vt>=0;vt--){const Dt=J[vt];if(Dt===di){xe[vt]=1;continue}const on=ne[vt];if(On(on,Dt)===1){xe[vt]=0,Ht=!0;continue}if(xe[vt]=1,Dt<i){const mt=q[Dt];if(mt>=0)for(let rr=A[mt];rr<A[mt+1];rr++)On(on,N[rr]);if(ye[vt]&1)for(let rr=0;rr<j.length;rr++)j[rr]===Dt&&On(on,D[rr])}}if(!Ht&&!Ot&&Ae===rt+Se-1)return he;let xn="",hn=0;for(;hn<Se;){if(!xe[hn]){hn++;continue}const vt=Tt[hn];let Dt=F[hn],on=hn+1;for(;on<Se&&xe[on]&&Tt[on]===Dt+1&&he.charCodeAt(Dt)===32;)Dt=F[on],on++;xn.length>0&&(xn+=" "),xn+=he.slice(vt,Dt),hn=on}return xn},Cn=16384,Tn=new Int32Array(Cn*2);let ns=0,dn=1,fn=Object.create(null),An=Object.create(null),jn=new Map,Oi=new Map,jr=0,_s=0;const rs=()=>{ns^=Cn,dn=dn+1|0,_s=0},xs=he=>{let Ae=fn[he];if(Ae!==void 0)return Ae;const Se=Ch(he,0,he.length),rt=(Se&16383)+ns,Ot=Tn[rt]===(Se^dn)||Tn[rt^Cn]===(Se^dn-1);return Ot&&(Ae=An[he],Ae!==void 0)?(fn[he]=Ae,Ae):(Ae=Bt(he),Ot?(fn[he]=Ae,++jr>oe&&(jr=0,An=fn,fn=Object.create(null),rs())):(Tn[rt]=Se^dn,++_s>Cn&&rs()),Ae)},zt=he=>{let Ae=jn.get(he);if(Ae!==void 0)return Ae;const Se=Ch(he,0,he.length),rt=(Se&16383)+ns,Ot=Tn[rt]===(Se^dn)||Tn[rt^Cn]===(Se^dn-1);return Ot&&(Ae=Oi.get(he),Ae!==void 0)?(jn.set(he,Ae),Ae):(Ae=Bt(he),Ot?(jn.set(he,Ae),++jr>oe&&(jr=0,Oi=jn,jn=new Map,rs())):(Tn[rt]=Se^dn,++_s>Cn&&rs()),Ae)},qn=he=>{const Ae=Ch(he,0,he.length),Se=(Ae&16383)+ns;return Tn[Se]===(Ae^dn)||Tn[Se^Cn]===(Ae^dn-1)?!0:(Tn[Se]=Ae^dn,++_s>Cn&&rs(),!1)},Fn=oe===0?Bt:fP?he=>{const Ae=jn.get(he);return Ae!==void 0?Ae:zt(he)}:xs;return{merge:function(){return arguments.length===1&&typeof arguments[0]=="string"?Fn(arguments[0]):Fn(gP.apply(null,arguments))},mergeString:Fn,seenBefore:oe===0?()=>!1:qn,mergeUncached:Bt}},Qh=(e,t)=>{if(!e)return"";if(typeof e=="string")return e;let s="";if(typeof e.length=="number"&&(!t||Array.isArray(e))){const i=e;for(let o=0;o<i.length;o++){const l=i[o];if(!l)continue;const u=typeof l=="string"?l:Qh(l,t);u&&(s&&(s+=" "),s+=u)}return s}if(t){if(typeof e=="number")return""+e;if(typeof e=="object")for(const i in e)e[i]&&(s&&(s+=" "),s+=i)}return s},pP=(e,t)=>{let s="";for(let i=0;i<e.length;i++){const o=e[i];if(!o)continue;const l=typeof o=="string"?o:Qh(o,t);l&&(s&&(s+=" "),s+=l)}return s},gP=function(){return pP(arguments,!1)},mP=256,nE=16,yP=1024,cy=4096,vP=(e,t)=>{const s=t===void 0?()=>!0:t.seenBefore,i=t===void 0?e:t.mergeUncached;let o=new Map,l=new Map,u=0,d=null,f=null,g=[],m=[],h=0;const x=(R,k,O)=>{f===null&&(f=new Array(cy).fill(""),g=new Array(cy).fill(""),m=new Array(cy).fill(""));const A=Ch(R,0,R.length)&4094;if(f[A]===R&&g[A]===k)return m[A];if(f[A|1]===R&&g[A|1]===k)return m[A|1];const N=e(O?k+" "+R:R),j=f[A]===""?A:A|(f[A|1]===""?1:h++&1);return f[j]=R,g[j]=k,m[j]=N,N},S=(R,k,O,A)=>{let N=0;if(k){if(k!==R.a0)return!1;N=1}if(O){if(O!==(N===0?R.a0:R.a1))return!1;N++}if(A){if(A!==(N===0?R.a0:N===1?R.a1:R.a2))return!1;N++}return N===R.t},w=(R,k)=>{const O=R.a;let A=0;for(let N=0;N<k.length;N++){const j=k[N];if(j){if(j!==O[A])return!1;A++}}return A===R.t},C=(R,k)=>{const O=R.length,A=d===null?null:d.n;if(!k){if(A!==null&&w(A,R))return d=A,A.r;if(d!==null&&d!==A&&w(d,R))return d.r}let N="",j=-1,D=0,M=!1;for(let q=0;q<O;q++){let X=R[q];if(X){if(typeof X!="string"){if(X=R[q]=Qh(X,!0),!X)continue;M=!0}j<0&&(N=X,j=q),D++}}if(D===0)return"";if(D===1)return e(N);if(M){if(A!==null&&w(A,R))return d=A,A.r;if(d!==null&&d!==A&&w(d,R))return d.r}let _=o.get(N);_===void 0&&(_=l.get(N),_!==void 0&&o.set(N,_));let L=null;if(_!==void 0){if(_.skip>0){_.skip--,d=null;let X=N;for(let B=j+1;B<O;B++){const H=R[B];H&&(X+=" "+H)}return x(X,"",!1)}const q=_.e;e:for(let X=0;X<q.length;X++){const B=q[X];if(B.t!==D)continue;const H=B.a;let U=1;for(let z=j+1;z<O;z++){const Q=R[z];if(Q&&Q!==H[U++])continue e}L=B;break}L!==null&&(_.miss=0)}if(L===null){let q=N;const X=[N];for(let H=j+1;H<O;H++){const U=R[H];U&&(q+=" "+U,X.push(U))}if(!s(q))return i(q);L={r:e(q),t:X.length,a0:X[0],a1:X[1],a2:X[2]??"",a:X,n:null},_===void 0?o.set(N,_={e:[],miss:0,skip:0,at:0}):++_.miss>nE&&(_.miss=nE,_.skip=yP,_.e.length=0,_.at=0);const B=_.e;B.length<mP?B.push(L):(B[_.at]=L,_.at=_.at+1&255),++u>1e3&&(u=0,l=o,o=new Map)}return d!==null&&d!==L&&(d.n=L),d=L,L.r},E=R=>Array.isArray(R)?C(R.slice(),!1):e(Qh(R,!0));return function(R,k,O){const A=arguments.length;if((A|1)===3){const D=d;if(D!==null){const M=D.n;if(M!==null&&S(M,R,k,O))return d=M,M.r;if(D!==M&&S(D,R,k,O))return D.r}if(A===2&&typeof k=="string"&&k!==""){const M=o.get(R);if(M!==void 0&&M.skip>0)return M.skip--,d=null,x(k,R,!0)}return C([R,k,O],!0)}if(A===1)return typeof R=="string"?e(R):E(R);const N=d;if(N!==null){const D=N.n;if(D!==null){const M=D.a;let _=0,L=!0;for(let q=0;q<A;q++){const X=arguments[q];if(X){if(X!==M[_]){L=!1;break}_++}}if(L&&_===D.t)return d=D,D.r}if(N!==D){const M=N.a;let _=0,L=!0;for(let q=0;q<A;q++){const X=arguments[q];if(X){if(X!==M[_]){L=!1;break}_++}}if(L&&_===N.t)return N.r}}const j=[];for(let D=0;D<A;D++)j.push(arguments[D]);return C(j,!0)}},rE=hP(dP),Fe=vP(rE.mergeString,rE);function bP({delay:e=0,...t}){return v.jsx(B3,{"data-slot":"tooltip-provider",delay:e,...t})}function Xh({...e}){return v.jsx(b3,{"data-slot":"tooltip",...e})}function Zh({...e}){return v.jsx(E3,{"data-slot":"tooltip-trigger",...e})}function Jh({className:e,side:t="top",sideOffset:s=4,align:i="center",alignOffset:o=0,children:l,...u}){return v.jsx(T3,{children:v.jsx(U3,{align:i,alignOffset:o,side:t,sideOffset:s,className:"isolate z-50",children:v.jsxs(H3,{"data-slot":"tooltip-content",className:Fe("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...u,children:[l,v.jsx(F3,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 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 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"})]})})})}var xP=(e,t,s,i,o,l,u,d)=>{let f=document.documentElement,g=["light","dark"];function m(S){(Array.isArray(e)?e:[e]).forEach(w=>{let C=w==="class",E=C&&l?o.map(R=>l[R]||R):o;C?(f.classList.remove(...E),f.classList.add(l&&l[S]?l[S]:S)):f.setAttribute(w,S)}),h(S)}function h(S){d&&g.includes(S)&&(f.style.colorScheme=S)}function x(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(i)m(i);else try{let S=localStorage.getItem(t)||s,w=u&&S==="system"?x():S;m(w)}catch{}},SP=b.createContext(void 0),wP={setTheme:e=>{},themes:[]},EP=()=>{var e;return(e=b.useContext(SP))!=null?e:wP};b.memo(({forcedTheme:e,storageKey:t,attribute:s,enableSystem:i,enableColorScheme:o,defaultTheme:l,value:u,themes:d,nonce:f,scriptProps:g})=>{let m=JSON.stringify([s,t,l,e,d,u,i,o]).slice(1,-1);return b.createElement("script",{...g,suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(${xP.toString()})(${m})`}})});function RP(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}const CP=e=>{switch(e){case"success":return OP;case"info":return MP;case"warning":return AP;case"error":return NP;default:return null}},TP=Array(12).fill(0),kP=({visible:e,className:t})=>Ne.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Ne.createElement("div",{className:"sonner-spinner"},TP.map((s,i)=>Ne.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),OP=Ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ne.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),AP=Ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ne.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),MP=Ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ne.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),NP=Ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Ne.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),DP=Ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},Ne.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Ne.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),jP=()=>{const[e,t]=Ne.useState(document.hidden);return Ne.useEffect(()=>{const s=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",s),()=>document.removeEventListener("visibilitychange",s)},[]),e};let IP=1;const PP=100,sE=e=>{var t;return typeof e?.id=="number"||(e==null||(t=e.id)==null?void 0:t.length)>0?e.id:IP++};class LP{constructor(){this.subscribe=t=>(this.subscribers.push(t),this.getActiveToasts().forEach(s=>t(s)),()=>{const s=this.subscribers.indexOf(t);this.subscribers.splice(s,1)}),this.publish=t=>{this.subscribers.forEach(s=>s(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t],this.trimHistory()},this.trimHistory=()=>{let t=this.toasts.length-PP;t<=0||(this.toasts=this.toasts.filter(s=>t>0&&this.dismissedToasts.has(s.id)?(this.dismissedToasts.delete(s.id),t--,!1):!0))},this.create=t=>{const{message:s,...i}=t,o=sE(t),l=this.pendingDismissals.get(o);l!==void 0&&(cancelAnimationFrame(l),this.pendingDismissals.delete(o),this.dismissedToasts.delete(o));const u=this.dismissedToasts.has(o),d=t.dismissible===void 0?!0:t.dismissible;return u&&(this.dismissedToasts.delete(o),this.toasts=this.toasts.filter(g=>g.id!==o)),(u?void 0:this.toasts.find(g=>g.id===o))?this.toasts=this.toasts.map(g=>g.id===o?(this.publish({...g,...t,id:o,title:s}),{...g,...t,id:o,dismissible:d,title:s}):g):this.addToast({title:s,...i,dismissible:d,id:o}),o},this.dismiss=t=>{if(t==null)return this.getActiveToasts().forEach(i=>{this.dismissedToasts.add(i.id),this.subscribers.forEach(o=>o({id:i.id,dismiss:!0}))}),t;this.dismissedToasts.add(t);const s=this.pendingDismissals.get(t);return s!==void 0&&cancelAnimationFrame(s),this.pendingDismissals.set(t,requestAnimationFrame(()=>{this.pendingDismissals.delete(t),this.subscribers.forEach(i=>i({id:t,dismiss:!0}))})),t},this.message=(t,s)=>this.create({...s,message:t,type:void 0}),this.error=(t,s)=>this.create({...s,message:t,type:"error"}),this.success=(t,s)=>this.create({...s,type:"success",message:t}),this.info=(t,s)=>this.create({...s,type:"info",message:t}),this.warning=(t,s)=>this.create({...s,type:"warning",message:t}),this.loading=(t,s)=>this.create({...s,type:"loading",message:t}),this.promise=(t,s)=>{if(!s)return;let i;s.loading!==void 0&&(i=this.create({...s,promise:t,type:"loading",message:s.loading,description:typeof s.description!="function"?s.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let l=i!==void 0,u;const d=o.then(async g=>{if(u=["resolve",g],Ne.isValidElement(g))l=!1,this.create({id:i,type:"default",message:g});else if(_P(g)&&!g.ok){l=!1;const h=typeof s.error=="function"?await s.error(`HTTP error! status: ${g.status}`):s.error,x=typeof s.description=="function"?await s.description(`HTTP error! status: ${g.status}`):s.description,w=typeof h=="object"&&!Ne.isValidElement(h)?h:{message:h};this.create({id:i,type:"error",description:x,...w})}else if(g instanceof Error){l=!1;const h=typeof s.error=="function"?await s.error(g):s.error,x=typeof s.description=="function"?await s.description(g):s.description,w=typeof h=="object"&&!Ne.isValidElement(h)?h:{message:h};this.create({id:i,type:"error",description:x,...w})}else if(s.success!==void 0){l=!1;const h=typeof s.success=="function"?await s.success(g):s.success,x=typeof s.description=="function"?await s.description(g):s.description,w=typeof h=="object"&&!Ne.isValidElement(h)?h:{message:h};this.create({id:i,type:"success",description:x,...w})}}).catch(async g=>{if(u=["reject",g],s.error!==void 0){l=!1;const m=typeof s.error=="function"?await s.error(g):s.error,h=typeof s.description=="function"?await s.description(g):s.description,S=typeof m=="object"&&!Ne.isValidElement(m)?m:{message:m};this.create({id:i,type:"error",description:h,...S})}}).finally(()=>{l&&(this.dismiss(i),i=void 0),s.finally==null||s.finally.call(s)}),f=()=>new Promise((g,m)=>d.then(()=>u[0]==="reject"?m(u[1]):g(u[1])).catch(m));return typeof i!="string"&&typeof i!="number"?{unwrap:f}:Object.assign(i,{unwrap:f})},this.custom=(t,s)=>{const i=sE(s);return this.create({...s,jsx:t(i),id:i,type:void 0}),i},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const Zr=new LP,zP=(e,t)=>Zr.message(e,t),_P=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",UP=zP,HP=()=>Zr.toasts,FP=()=>Zr.getActiveToasts(),Kt=Object.assign(UP,{success:Zr.success,info:Zr.info,warning:Zr.warning,error:Zr.error,custom:Zr.custom,message:Zr.message,promise:Zr.promise,dismiss:Zr.dismiss,loading:Zr.loading},{getHistory:HP,getToasts:FP});RP("[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;flex:1;min-width:0}[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(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);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]{-webkit-user-select:none;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 sh(e){return e.label!==void 0}const BP=3,VP="24px",KP="16px",iE=4e3,qP=356,YP=14,GP=45,$P=200;function fi(...e){return e.filter(Boolean).join(" ")}function QP(e){const[t,s]=e.split("-"),i=[];return t&&i.push(t),s&&i.push(s),i}const XP=e=>{var t,s,i,o,l,u,d,f,g;const{invert:m,toast:h,unstyled:x,interacting:S,setHeights:w,visibleToasts:C,heights:E,index:R,toasts:k,expanded:O,removeToast:A,defaultRichColors:N,closeButton:j,style:D,cancelButtonStyle:M,actionButtonStyle:_,className:L="",descriptionClassName:q="",duration:X,position:B,gap:H,expandByDefault:U,classNames:z,icons:Q,closeButtonAriaLabel:$="Close toast"}=e,[K,Y]=Ne.useState(null),[ee,G]=Ne.useState(null),[oe,I]=Ne.useState(!1),[V,W]=Ne.useState(!1),[re,Ee]=Ne.useState(!1),[le,me]=Ne.useState(!1),[ge,ue]=Ne.useState(!1),[Te,ve]=Ne.useState(0),[Pe,Oe]=Ne.useState(0),Le=Ne.useRef(h.duration||X||iE),Ve=Ne.useRef(null),ke=Ne.useRef(null),Ue=R===0,be=R+1<=C,He=h.type,Ze=He??"default",ot=h.dismissible!==!1,de=h.className||"",we=h.descriptionClassName||"",Ge=Ne.useMemo(()=>E.findIndex(je=>je.toastId===h.id)||0,[E,h.id]),Me=Ne.useMemo(()=>{var je;return(je=h.closeButton)!=null?je:j},[h.closeButton,j]),De=Ne.useMemo(()=>h.duration||X||iE,[h.duration,X]),bt=Ne.useRef(0),dt=Ne.useRef(0),gt=Ne.useRef(0),Nt=Ne.useRef(null),[jt,tn]=B.split("-"),an=Ne.useMemo(()=>E.reduce((je,at,Ie)=>Ie>=Ge?je:je+at.height,0),[E,Ge]),nn=jP(),We=Ne.useMemo(()=>{var je;return(je=e.swipeDirections)!=null?je:QP(B)},[e.swipeDirections,B]),wt=h.invert||m,Zt=He==="loading";dt.current=Ne.useMemo(()=>Ge*H+an,[Ge,an]),Ne.useEffect(()=>{Le.current=De},[De]),Ne.useEffect(()=>{I(!0)},[]),Ne.useEffect(()=>{const je=ke.current;if(je){const at=je.getBoundingClientRect().height;return Oe(at),w(Ie=>[{toastId:h.id,height:at,position:h.position},...Ie]),()=>w(Ie=>Ie.filter(ze=>ze.toastId!==h.id))}},[w,h.id]),Ne.useLayoutEffect(()=>{if(!oe)return;const je=ke.current,at=je.style.height;je.style.height="auto";const Ie=je.getBoundingClientRect().height;je.style.height=at,Oe(Ie),w(ze=>ze.find(et=>et.toastId===h.id)?ze.map(et=>et.toastId===h.id?{...et,height:Ie}:et):[{toastId:h.id,height:Ie,position:h.position},...ze])},[oe,h.title,h.description,w,h.id,h.jsx,h.action,h.cancel]);const ht=Ne.useCallback(()=>{W(!0),ve(dt.current),w(je=>je.filter(at=>at.toastId!==h.id)),setTimeout(()=>{A(h)},$P)},[h,A,w,dt]);Ne.useEffect(()=>{if(h.promise&&He==="loading"||h.duration===1/0||h.type==="loading")return;let je;return O||S||nn?(()=>{if(gt.current<bt.current){const ze=new Date().getTime()-bt.current;Le.current=Le.current-ze}gt.current=new Date().getTime()})():Le.current!==1/0&&(bt.current=new Date().getTime(),je=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),ht()},Le.current)),()=>clearTimeout(je)},[O,S,h,He,nn,ht]),Ne.useEffect(()=>{h.delete&&(ht(),h.onDismiss==null||h.onDismiss.call(h,h))},[ht,h.delete]);function xt(){var je;if(Q?.loading){var at;return Ne.createElement("div",{className:fi(z?.loader,h==null||(at=h.classNames)==null?void 0:at.loader,"sonner-loader"),"data-visible":He==="loading"},Q.loading)}return Ne.createElement(kP,{className:fi(z?.loader,h==null||(je=h.classNames)==null?void 0:je.loader),visible:He==="loading"})}const yt=h.icon||Q?.[He]||CP(He);var Ut,un;return Ne.createElement("li",{tabIndex:0,ref:ke,className:fi(L,de,z?.toast,h==null||(t=h.classNames)==null?void 0:t.toast,z?.[Ze],h==null||(s=h.classNames)==null?void 0:s[Ze]),"data-sonner-toast":"","data-rich-colors":(Ut=h.richColors)!=null?Ut:N,"data-styled":!(h.jsx||h.unstyled||x),"data-mounted":oe,"data-promise":!!h.promise,"data-swiped":ge,"data-removed":V,"data-visible":be,"data-y-position":jt,"data-x-position":tn,"data-index":R,"data-front":Ue,"data-swiping":re,"data-dismissible":ot,"data-type":He,"data-invert":wt,"data-swipe-out":le,"data-swipe-direction":ee,"data-expanded":!!(O||U&&oe),"data-testid":h.testId,style:{"--index":R,"--toasts-before":R,"--z-index":k.length-R,"--offset":`${V?Te:dt.current}px`,"--initial-height":U?"auto":`${Pe}px`,...D,...h.style},onDragEnd:()=>{Ee(!1),Y(null),Nt.current=null},onPointerDown:je=>{je.button!==2&&(Zt||!ot||(Ve.current=new Date,ve(dt.current),je.target.setPointerCapture(je.pointerId),je.target.tagName!=="BUTTON"&&(Ee(!0),Nt.current={x:je.clientX,y:je.clientY})))},onPointerUp:()=>{var je,at,Ie;if(le||!ot)return;Nt.current=null;const ze=Number(((je=ke.current)==null?void 0:je.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),$e=Number(((at=ke.current)==null?void 0:at.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),et=new Date().getTime()-((Ie=Ve.current)==null?void 0:Ie.getTime()),Tt=K==="x"?ze:$e,F=Math.abs(Tt)/et;if((K==="x"?We.includes(ze>0?"right":"left"):We.includes($e>0?"bottom":"top"))&&(Math.abs(Tt)>=GP||F>.11)){ve(dt.current),h.onDismiss==null||h.onDismiss.call(h,h),G(K==="x"?ze>0?"right":"left":$e>0?"down":"up"),ht(),me(!0);return}else{var ne,ye;(ne=ke.current)==null||ne.style.setProperty("--swipe-amount-x","0px"),(ye=ke.current)==null||ye.style.setProperty("--swipe-amount-y","0px")}ue(!1),Ee(!1),Y(null)},onPointerMove:je=>{var at,Ie,ze;if(!Nt.current||!ot||((at=window.getSelection())==null?void 0:at.toString().length)>0)return;const et=je.clientY-Nt.current.y,Tt=je.clientX-Nt.current.x;!K&&(Math.abs(Tt)>1||Math.abs(et)>1)&&Y(Math.abs(Tt)>Math.abs(et)?"x":"y");let F={x:0,y:0};const J=ne=>1/(1.5+Math.abs(ne)/20);if(K==="y"){if(We.includes("top")||We.includes("bottom"))if(We.includes("top")&&et<0||We.includes("bottom")&&et>0)F.y=et;else{const ne=et*J(et);F.y=Math.abs(ne)<Math.abs(et)?ne:et}}else if(K==="x"&&(We.includes("left")||We.includes("right")))if(We.includes("left")&&Tt<0||We.includes("right")&&Tt>0)F.x=Tt;else{const ne=Tt*J(Tt);F.x=Math.abs(ne)<Math.abs(Tt)?ne:Tt}(Math.abs(F.x)>0||Math.abs(F.y)>0)&&ue(!0),(Ie=ke.current)==null||Ie.style.setProperty("--swipe-amount-x",`${F.x}px`),(ze=ke.current)==null||ze.style.setProperty("--swipe-amount-y",`${F.y}px`)}},Me&&!h.jsx&&He!=="loading"?Ne.createElement("button",{"aria-label":$,"data-disabled":Zt,"data-close-button":!0,onClick:Zt||!ot?()=>{}:()=>{ht(),h.onDismiss==null||h.onDismiss.call(h,h)},className:fi(z?.closeButton,h==null||(i=h.classNames)==null?void 0:i.closeButton)},(un=Q?.close)!=null?un:DP):null,(He||h.icon||h.promise)&&h.icon!==null&&(Q?.[He]!==null||h.icon)?Ne.createElement("div",{"data-icon":"",className:fi(z?.icon,h==null||(o=h.classNames)==null?void 0:o.icon)},He==="loading"?h.icon||xt():h.promise?xt():null,He!=="loading"?yt:null):null,Ne.createElement("div",{"data-content":"",className:fi(z?.content,h==null||(l=h.classNames)==null?void 0:l.content)},Ne.createElement("div",{"data-title":"",className:fi(z?.title,h==null||(u=h.classNames)==null?void 0:u.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?Ne.createElement("div",{"data-description":"",className:fi(q,we,z?.description,h==null||(d=h.classNames)==null?void 0:d.description)},typeof h.description=="function"?h.description():h.description):null),Ne.isValidElement(h.cancel)?h.cancel:h.cancel&&sh(h.cancel)?Ne.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||M,onClick:je=>{sh(h.cancel)&&ot&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,je),ht())},className:fi(z?.cancelButton,h==null||(f=h.classNames)==null?void 0:f.cancelButton)},h.cancel.label):null,Ne.isValidElement(h.action)?h.action:h.action&&sh(h.action)?Ne.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||_,onClick:je=>{sh(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,je),!je.defaultPrevented&&ht())},className:fi(z?.actionButton,h==null||(g=h.classNames)==null?void 0:g.actionButton)},h.action.label):null)};function aE(){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 ZP(e,t){const s={};return[e,t].forEach((i,o)=>{const l=o===1,u=l?"--mobile-offset":"--offset",d=l?KP:VP;function f(g){["top","right","bottom","left"].forEach(m=>{s[`${u}-${m}`]=typeof g=="number"?`${g}px`:g})}typeof i=="number"||typeof i=="string"?f(i):typeof i=="object"?["top","right","bottom","left"].forEach(g=>{i[g]===void 0?s[`${u}-${g}`]=d:s[`${u}-${g}`]=typeof i[g]=="number"?`${i[g]}px`:i[g]}):f(d)}),s}const JP=Ne.forwardRef(function(t,s){const{id:i,invert:o,position:l="bottom-right",hotkey:u=["altKey","KeyT"],expand:d,closeButton:f,className:g,offset:m,mobileOffset:h,theme:x="light",richColors:S,duration:w,style:C,visibleToasts:E=BP,toastOptions:R,dir:k=aE(),gap:O=YP,icons:A,customAriaLabel:N,containerAriaLabel:j="Notifications"}=t,[D,M]=Ne.useState([]),_=Ne.useMemo(()=>i?D.filter(I=>I.toasterId===i):D.filter(I=>!I.toasterId),[D,i]),L=Ne.useMemo(()=>Array.from(new Set([l].concat(_.filter(I=>I.position).map(I=>I.position)))),[_,l]),[q,X]=Ne.useState([]),[B,H]=Ne.useState(!1),[U,z]=Ne.useState(!1),[Q,$]=Ne.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=Ne.useRef(null),Y=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),ee=Ne.useRef(null),G=Ne.useRef(!1),oe=Ne.useCallback(I=>{M(V=>{var W;return(W=V.find(re=>re.id===I.id))!=null&&W.delete||Zr.dismiss(I.id),V.filter(({id:re})=>re!==I.id)})},[]);return Ne.useEffect(()=>Zr.subscribe(I=>{if(I.dismiss){requestAnimationFrame(()=>{M(V=>V.map(W=>W.id===I.id?{...W,delete:!0}:W))});return}setTimeout(()=>{H4.flushSync(()=>{M(V=>{const W=V.findIndex(re=>re.id===I.id);return W!==-1?[...V.slice(0,W),{...V[W],...I},...V.slice(W+1)]:[I,...V]})})})}),[]),Ne.useEffect(()=>{if(x!=="system"){$(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window>"u")return;const I=window.matchMedia("(prefers-color-scheme: dark)");try{I.addEventListener("change",({matches:V})=>{$(V?"dark":"light")})}catch{I.addListener(({matches:W})=>{try{$(W?"dark":"light")}catch(re){console.error(re)}})}},[x]),Ne.useEffect(()=>{D.length<=1&&H(!1)},[D]),Ne.useEffect(()=>{const I=V=>{var W;if(u.length>0&&u.every(le=>V[le]||V.code===le)){var Ee;H(!0),(Ee=K.current)==null||Ee.focus()}V.code==="Escape"&&(document.activeElement===K.current||(W=K.current)!=null&&W.contains(document.activeElement))&&H(!1)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[u]),Ne.useEffect(()=>{if(K.current)return()=>{ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null,G.current=!1)}},[K.current]),Ne.createElement("section",{ref:s,"aria-label":N??`${j} ${Y}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},L.map((I,V)=>{var W;const[re,Ee]=I.split("-");return _.length?Ne.createElement("ol",{key:I,dir:k==="auto"?aE():k,tabIndex:-1,ref:K,className:g,"data-sonner-toaster":!0,"data-sonner-theme":Q,"data-y-position":re,"data-x-position":Ee,style:{"--front-toast-height":`${((W=q[0])==null?void 0:W.height)||0}px`,"--width":`${qP}px`,"--gap":`${O}px`,...C,...ZP(m,h)},onBlur:le=>{G.current&&!le.currentTarget.contains(le.relatedTarget)&&(G.current=!1,ee.current&&(ee.current.focus({preventScroll:!0}),ee.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||G.current||(G.current=!0,ee.current=le.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{U||H(!1)},onDragEnd:()=>H(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||z(!0)},onPointerUp:()=>z(!1)},_.filter(le=>!le.position&&V===0||le.position===I).map((le,me)=>{var ge,ue;return Ne.createElement(XP,{key:le.id,icons:A,index:me,toast:le,defaultRichColors:S,duration:(ge=R?.duration)!=null?ge:w,className:R?.className,descriptionClassName:R?.descriptionClassName,invert:o,visibleToasts:E,closeButton:(ue=R?.closeButton)!=null?ue:f,interacting:U,position:I,style:R?.style,unstyled:R?.unstyled,classNames:R?.classNames,cancelButtonStyle:R?.cancelButtonStyle,actionButtonStyle:R?.actionButtonStyle,closeButtonAriaLabel:R?.closeButtonAriaLabel,removeToast:oe,toasts:_.filter(Te=>Te.position==le.position),heights:q.filter(Te=>Te.position==le.position),setHeights:X,expandByDefault:d,gap:O,expanded:B,swipeDirections:t.swipeDirections})})):null}))}),WP=e=>(e.match(/\d+[xX]\d+|[A-Z]?[a-z]+|[A-Z]|\d+/g)??[]).join("-").toLowerCase();function eL(e,t,s=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:WP(e),size:24,node:t,...s.length>0?{aliases:s}:{}}}const tL=e=>{let t="",s=!1;for(const i of e){if(i==="-"||i==="_"||i<=" "){s=t.length>0;continue}t.length===0?t+=i.toLowerCase():t+=s?i.toUpperCase():i,s=!1}return t},nL=e=>{const t=tL(e);return t.charAt(0).toUpperCase()+t.slice(1)},Fy=(...e)=>{const t=new Set;for(const s of e)if(typeof s=="string")for(const i of s.split(/\s+/))i&&t.add(i);return[...t].join(" ")},Dl={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function uy(e){return e!=null}function rL(e,t={}){const s=t.attributeNames??{},i=x=>s[x]??x,o=e.size??e.width??Dl.width,l=e.size??e.height??Dl.height,u=e.aliases?.filter(x=>typeof x=="string"&&x.trim()!=="").map(x=>`lucide-${x}`)??[],d=[...e.name?[`lucide-${e.name}`]:[],...u],f=t.className?.split(" ").filter(Boolean)??[],g=t.includeDefaultClasses===!1?Fy(...f):Fy("lucide",...d,...f);let m=t.strokeWidth??Dl["stroke-width"];if(t.absoluteStrokeWidth){const x=Number(m)*Number(e.size??e.width??Dl.width)/Number(t.size??t.width??Dl.width);Number.isFinite(x)&&(m=x)}return["svg",{...Object.entries(Dl).reduce((x,[S,w])=>(x[i(S)]=w,x),{}),..."color"in t&&t.color&&{[i("stroke")]:t.color},..."size"in t&&uy(t.size)&&{[i("width")]:t.size,[i("height")]:t.size},..."width"in t&&uy(t.width)&&{[i("width")]:t.width},..."height"in t&&uy(t.height)&&{[i("height")]:t.height},[i("stroke-width")]:m,...g&&{[i("class")]:g},[i("viewBox")]:`0 0 ${o} ${l}`,...t.hasA11yProp===!1?{[i("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(x=>{const[S,w,C]=x,E=t.nonScalingStroke?{[i("vector-effect")]:"non-scaling-stroke",...w}:w;return C?[S,E,C]:[S,E]})]}function sL(e,t={}){return rL(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}const iL=e=>{if(e==null||typeof e!="object")return!1;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(t.startsWith("aria-")||t==="role"||t==="title")&&e[t]!=null)return!0;return!1},aL=b.createContext({}),oL=()=>b.useContext(aL),lL=b.forwardRef(({color:e,size:t,width:s,height:i,strokeWidth:o,absoluteStrokeWidth:l,nonScalingStroke:u,className:d="",children:f,iconNode:g=[],icon:m={node:g,aliases:[],size:24},...h},x)=>{const{size:S=24,strokeWidth:w=2,absoluteStrokeWidth:C=!1,nonScalingStroke:E=!1,color:R="currentColor",className:k=""}=oL()??{},O=!!f||iL(h),[A,N,j=[]]=sL(m,{color:e??R,width:s??t??S,height:i??t??S,strokeWidth:o??w,absoluteStrokeWidth:l??C,nonScalingStroke:u??E,className:Fy(k,d),hasA11yProp:O,attributes:h});return b.createElement(A,{ref:x,...N},[...j.map(([D,M])=>b.createElement(D,M)),...Array.isArray(f)?f:[f]])});function At(e,t=[],s=[]){const i=typeof e=="string"?eL(e,t,s):e,o=b.forwardRef(({className:l,...u},d)=>b.createElement(lL,{ref:d,icon:i,className:l,...u}));return i.name&&(o.displayName=nL(i.name)),o}const uT={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};uT.node;const cL=At(uT),dT={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};dT.node;const fT=At(dT),hT={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};hT.node;const ld=At(hT),pT={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};pT.node;const Zv=At(pT),gT={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};gT.node;const Jv=At(gT),mT={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};mT.node;const uL=At(mT),yT={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};yT.node;const vT=At(yT),bT={name:"circle-question-mark",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9 9.5a3 2.5 0 016 0c0 2-2 2-3 3.5",key:"1awbb0"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["help-circle","circle-help"]};bT.node;const dL=At(bT),xT={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};xT.node;const fL=At(xT),ST={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};ST.node;const wT=At(ST),ET={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};ET.node;const Zp=At(ET),RT={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};RT.node;const Wv=At(RT),CT={name:"eye-off",size:24,node:[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};CT.node;const hL=At(CT),TT={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};TT.node;const pL=At(TT),kT={name:"file-input",size:24,node:[["path",{d:"M4 11V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-1",key:"1q9hii"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 15h10",key:"jfw4w8"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]};kT.node;const OT=At(kT),AT={name:"file-output",size:24,node:[["path",{d:"M4.226 20.925A2 2 0 0 0 6 22h12a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.127",key:"wfxp4w"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]]};AT.node;const MT=At(AT),NT={name:"file-plus",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]};NT.node;const gL=At(NT),DT={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};DT.node;const eb=At(DT),jT={name:"files",size:24,node:[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]};jT.node;const mL=At(jT),IT={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};IT.node;const PT=At(IT),LT={name:"folder-plus",size:24,node:[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};LT.node;const yL=At(LT),zT={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};zT.node;const _T=At(zT),UT={name:"grip-vertical",size:24,node:[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]};UT.node;const tb=At(UT),HT={name:"info",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]};HT.node;const vL=At(HT),FT={name:"languages",size:24,node:[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]};FT.node;const bL=At(FT),BT={name:"layout-dashboard",size:24,node:[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]};BT.node;const xL=At(BT),VT={name:"library-big",size:24,node:[["rect",{width:"8",height:"18",x:"3",y:"3",rx:"1",key:"oynpb5"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z",key:"1qboyk"}]]};VT.node;const SL=At(VT),KT={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]};KT.node;const wL=At(KT),qT={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};qT.node;const Vr=At(qT),YT={name:"lock-keyhole",size:24,node:[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]]};YT.node;const EL=At(YT),GT={name:"menu",size:24,node:[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]};GT.node;const RL=At(GT),$T={name:"octagon-x",size:24,node:[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-octagon"]};$T.node;const CL=At($T),QT={name:"paintbrush",size:24,node:[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]]};QT.node;const TL=At(QT),XT={name:"panel-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],aliases:["sidebar"]};XT.node;const kL=At(XT),ZT={name:"pencil",size:24,node:[["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"}]]};ZT.node;const JT=At(ZT),WT={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};WT.node;const lc=At(WT),ek={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};ek.node;const OL=At(ek),tk={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};tk.node;const nk=At(tk),rk={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};rk.node;const nb=At(rk),sk={name:"settings",size:24,node:[["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"}]]};sk.node;const AL=At(sk),ik={name:"sliders-horizontal",size:24,node:[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]};ik.node;const ak=At(ik),ok={name:"terminal",size:24,node:[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]};ok.node;const ML=At(ok),lk={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};lk.node;const rb=At(lk),ck={name:"triangle-exclamation-point",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle","triangle-alert"]};ck.node;const sb=At(ck),uk={name:"user-round-plus",size:24,node:[["path",{d:"M2 21a8 8 0 0 1 13.292-6",key:"bjp14o"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M22 19h-6",key:"vcuq98"}]],aliases:["user-plus-2"]};uk.node;const dk=At(uk),fk={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};fk.node;const By=At(fk),hk={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};hk.node;const ta=At(hk),NL=({...e})=>{const{theme:t="system"}=EP();return v.jsx(JP,{theme:t,className:"toaster group",icons:{success:v.jsx(vT,{className:"size-4"}),info:v.jsx(vL,{className:"size-4"}),warning:v.jsx(sb,{className:"size-4"}),error:v.jsx(CL,{className:"size-4"}),loading:v.jsx(Vr,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},toastOptions:{classNames:{toast:"cn-toast"}},...e})},Ct=e=>typeof e=="string",gu=()=>{let e,t;const s=new Promise((i,o)=>{e=i,t=o});return s.resolve=e,s.reject=t,s},ih=e=>e==null?"":String(e),DL=(e,t,s)=>{e.forEach(i=>{t[i]&&(s[i]=t[i])})},jL=/###/g,oE=e=>e&&e.includes("###")?e.replace(jL,"."):e,lE=e=>!e||Ct(e),ku=(e,t,s)=>{const i=Ct(t)?t.split("."):t;let o=0;for(;o<i.length-1;){if(lE(e))return{};const l=oE(i[o]);!e[l]&&s&&(e[l]=new s),Object.prototype.hasOwnProperty.call(e,l)?e=e[l]:e={},++o}return lE(e)?{}:{obj:e,k:oE(i[o])}},cE=(e,t,s)=>{const{obj:i,k:o}=ku(e,t,Object);if(i!==void 0||t.length===1){i[o]=s;return}let l=t[t.length-1],u=t.slice(0,t.length-1),d=ku(e,u,Object);for(;d.obj===void 0&&u.length;)l=`${u[u.length-1]}.${l}`,u=u.slice(0,u.length-1),d=ku(e,u,Object),d?.obj&&typeof d.obj[`${d.k}.${l}`]<"u"&&(d.obj=void 0);d.obj[`${d.k}.${l}`]=s},IL=(e,t,s,i)=>{const{obj:o,k:l}=ku(e,t,Object);o[l]=o[l]||[],o[l].push(s)},Wh=(e,t)=>{const{obj:s,k:i}=ku(e,t);if(s&&Object.prototype.hasOwnProperty.call(s,i))return s[i]},PL=(e,t,s)=>{const i=Wh(e,s);return i!==void 0?i:Wh(t,s)},pk=(e,t,s)=>{for(const i in t)i!=="__proto__"&&i!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,i)?Ct(e[i])||e[i]instanceof String||Ct(t[i])||t[i]instanceof String?s&&(e[i]=t[i]):pk(e[i],t[i],s):e[i]=t[i]);return e},Vi=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),LL={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},zL=e=>Ct(e)?e.replace(/[&<>"'\/]/g,t=>LL[t]):e;class _L{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const s=this.regExpMap.get(t);if(s!==void 0)return s;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 UL=[" ",",","?","!",";"],HL=new _L(20),FL=(e,t,s)=>{t=t||"",s=s||"";const i=UL.filter(u=>!t.includes(u)&&!s.includes(u));if(i.length===0)return!0;const o=HL.getRegExp(`(${i.map(u=>u==="?"?"\\?":u).join("|")})`);let l=!o.test(e);if(!l){const u=e.indexOf(s);u>0&&!o.test(e.substring(0,u))&&(l=!0)}return l},Vy=(e,t,s=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const i=t.split(s);let o=e;for(let l=0;l<i.length;){if(!o||typeof o!="object")return;let u,d="";for(let f=l;f<i.length;++f)if(f!==l&&(d+=s),d+=i[f],u=o[d],(typeof u=="function"||d==="__proto__")&&!Object.prototype.hasOwnProperty.call(o,d)&&(u=void 0),u!==void 0){if(["string","number","boolean"].includes(typeof u)&&f<i.length-1)continue;l+=f-l+1;break}o=u}return o},rc=e=>e?.replace(/_/g,"-"),BL={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class ep{constructor(t,s={}){this.init(t,s)}init(t,s={}){this.prefix=s.prefix||"i18next:",this.logger=t||BL,this.options=s,this.debug=s.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,s,i,o){return o&&!this.debug?null:(t=t.map(l=>Ct(l)?l.replace(/[\r\n\x00-\x1F\x7F]/g," "):l),Ct(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[s](t))}create(t){return new ep(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new ep(this.logger,t)}}var mi=new ep;class Jp{constructor(){this.observers={}}on(t,s){return t.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const o=this.observers[i].get(s)||0;this.observers[i].set(s,o+1)}),this}off(t,s){if(this.observers[t]){if(!s){delete this.observers[t];return}this.observers[t].delete(s)}}once(t,s){const i=(...o)=>{s(...o),this.off(t,i)};return this.on(t,i),this}emit(t,...s){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([o,l])=>{for(let u=0;u<l;u++)o(...s)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([o,l])=>{for(let u=0;u<l;u++)o(t,...s)})}}const uE=new WeakSet;class dE extends Jp{constructor(t,s={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.includes(t)||this.options.ns.push(t)}removeNamespaces(t){const s=this.options.ns.indexOf(t);s>-1&&this.options.ns.splice(s,1)}getResource(t,s,i,o={}){const l=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let d;t.includes(".")?d=t.split("."):(d=[t,s],i&&(Array.isArray(i)?d.push(...i):Ct(i)&&l?d.push(...i.split(l)):d.push(i)));const f=Wh(this.data,d);return f==null&&!s&&!i&&t.includes(".")&&(t=d[0],s=d[1],i=d.slice(2).join(".")),f!=null||!u||!Ct(i)?f:Vy(this.data?.[t]?.[s],i,l)}addResource(t,s,i,o,l={silent:!1}){const u=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator;let d=[t,s];i&&(d=d.concat(u?i.split(u):i)),t.includes(".")&&(d=t.split("."),o=s,s=d[1]),this.addNamespaces(s),cE(this.data,d,o),l.silent||this.emit("added",t,s,i,o)}addResources(t,s,i,o={silent:!1}){for(const l in i)(Ct(i[l])||Array.isArray(i[l]))&&this.addResource(t,s,l,i[l],{silent:!0});o.silent||this.emit("added",t,s,i)}addResourceBundle(t,s,i,o,l,u={silent:!1,skipCopy:!1}){let d=[t,s];t.includes(".")&&(d=t.split("."),o=i,i=s,s=d[1]),this.addNamespaces(s);let f=Wh(this.data,d)||{};u.skipCopy||(i=JSON.parse(JSON.stringify(i))),o?pk(f,i,l):f={...f,...i},cE(this.data,d,f),u.silent||this.emit("added",t,s,i)}removeResourceBundle(t,s){this.hasResourceBundle(t,s)&&delete this.data[t][s],this.removeNamespaces(s),this.emit("removed",t,s)}hasResourceBundle(t,s){return this.getResource(t,s)!==void 0}getResourceBundle(t,s){return s||(s=this.options.defaultNS),this.getResource(t,s)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const s=this.getDataByLanguage(t);return!!(s&&Object.keys(s)||[]).find(o=>{const l=s[o];return uE.has(l)?!0:!l||Object.keys(l).length===0?!1:(typeof l=="object"&&uE.add(l),!0)})}toJSON(){return this.data}}var gk={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,s,i,o){return e.forEach(l=>{t=this.processors[l]?.process(t,s,i,o)??t}),t}};const mk=Symbol("i18next/PATH_KEY");function VL(){const e=[],t=Object.create(null);let s;return t.get=(i,o)=>(s?.revoke?.(),o===mk?e:(e.push(o),s=Proxy.revocable(i,t),s.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Ha(e,t){const{[mk]:s}=e(VL()),i=t?.keySeparator??".",o=t?.nsSeparator??":",l=t?.enableSelector==="strict";if(s.length>1&&o){const u=t?.ns,d=l?Array.isArray(u)?u:u?[u]:null:Array.isArray(u)?u:null;if(d&&(l?d:d.length>1?d.slice(1):[]).includes(s[0]))return`${s[0]}${o}${s.slice(1).join(i)}`}return s.join(i)}const dy=e=>!Ct(e)&&typeof e!="boolean"&&typeof e!="number";class tp extends Jp{constructor(t,s={}){super(),DL(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=mi.create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,s={interpolation:{}}){const i={...s};if(t==null)return!1;const o=this.resolve(t,i);if(o?.res===void 0)return!1;const l=dy(o.res);return!(i.returnObjects===!1&&l)}extractFromKey(t,s){let i=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let l=s.ns||this.options.defaultNS||[];const u=i&&t.includes(i),d=!this.options.userDefinedKeySeparator&&!s.keySeparator&&!this.options.userDefinedNsSeparator&&!s.nsSeparator&&!FL(t,i,o);if(u&&!d){const f=t.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:t,namespaces:Ct(l)?[l]:l};const g=t.split(i);(i!==o||i===o&&this.options.ns.includes(g[0]))&&(l=g.shift()),t=g.join(o)}return{key:t,namespaces:Ct(l)?[l]:l}}translate(t,s,i){let o=typeof s=="object"?{...s}:s;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof o=="object"&&(o={...o}),o||(o={}),t==null)return"";typeof t=="function"&&(t=Ha(t,{...this.options,...o})),Array.isArray(t)||(t=[String(t)]),t=t.map(B=>typeof B=="function"?Ha(B,{...this.options,...o}):String(B));const l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:d,namespaces:f}=this.extractFromKey(t[t.length-1],o),g=f[f.length-1];let m=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;m===void 0&&(m=":");const h=o.lng||this.language,x=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h?.toLowerCase()==="cimode")return x?l?{res:`${g}${m}${d}`,usedKey:d,exactUsedKey:d,usedLng:h,usedNS:g,usedParams:this.getUsedParamsDetails(o)}:`${g}${m}${d}`:l?{res:d,usedKey:d,exactUsedKey:d,usedLng:h,usedNS:g,usedParams:this.getUsedParamsDetails(o)}:d;const S=this.resolve(t,o);let w=S?.res;const C=S?.usedKey||d,E=S?.exactUsedKey||d,R=["[object Number]","[object Function]","[object RegExp]"],k=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,O=!this.i18nFormat||this.i18nFormat.handleAsObject,A=o.count!==void 0&&!Ct(o.count),N=tp.hasDefaultValue(o),j=A?this.pluralResolver.getSuffix(h,o.count,o):"",D=o.ordinal&&A?this.pluralResolver.getSuffix(h,o.count,{ordinal:!1}):"",M=A&&!o.ordinal&&o.count===0,_=M&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${j}`]||o[`defaultValue${D}`]||o.defaultValue;let L=w;O&&!w&&N&&(L=_);const q=dy(L),X=Object.prototype.toString.apply(L);if(O&&L&&q&&!R.includes(X)&&!(Ct(k)&&Array.isArray(L))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const B=this.options.returnedObjectHandler?this.options.returnedObjectHandler(C,L,{...o,ns:f}):`key '${d} (${this.language})' returned an object instead of string.`;return l?(S.res=B,S.usedParams=this.getUsedParamsDetails(o),S):B}if(u){const B=Array.isArray(L),H=B?[]:{},U=B?E:C;for(const z in L)if(Object.prototype.hasOwnProperty.call(L,z)){const Q=`${U}${u}${z}`;N&&!w?H[z]=this.translate(Q,{...o,defaultValue:dy(_)?_[z]:void 0,joinArrays:!1,ns:f}):H[z]=this.translate(Q,{...o,joinArrays:!1,ns:f}),H[z]===Q&&(H[z]=L[z])}w=H}}else if(O&&Ct(k)&&Array.isArray(w))w=w.join(k),w&&(w=this.extendTranslation(w,t,o,S,i));else{let B=!1,H=!1;!this.isValidLookup(w)&&N&&(B=!0,w=_),this.isValidLookup(w)||(H=!0,w=d);const z=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&H?void 0:w,Q=N&&_!==w&&this.options.updateMissing;if(H||B||Q){if(this.logger.log(Q?"updateKey":"missingKey",h,g,A&&!Q?`${d}${this.pluralResolver.getSuffix(h,o.count,o)}`:d,Q?_:w),u){const ee=this.resolve(d,{...o,keySeparator:!1});ee&&ee.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 $=[];const K=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&K&&K[0])for(let ee=0;ee<K.length;ee++)$.push(K[ee]);else this.options.saveMissingTo==="all"?$=this.languageUtils.toResolveHierarchy(o.lng||this.language):$.push(o.lng||this.language);const Y=(ee,G,oe)=>{const I=N&&oe!==w?oe:z;this.options.missingKeyHandler?this.options.missingKeyHandler(ee,g,G,I,Q,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(ee,g,G,I,Q,o),this.emit("missingKey",ee,g,G,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?$.forEach(ee=>{const G=this.pluralResolver.getSuffixes(ee,o);M&&o[`defaultValue${this.options.pluralSeparator}zero`]&&!G.includes(`${this.options.pluralSeparator}zero`)&&G.push(`${this.options.pluralSeparator}zero`),G.forEach(oe=>{Y([ee],d+oe,o[`defaultValue${oe}`]||_)})}):Y($,d,_))}w=this.extendTranslation(w,t,o,S,i),H&&w===d&&this.options.appendNamespaceToMissingKey&&(w=`${g}${m}${d}`),(H||B)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${g}${m}${d}`:d,B?w:void 0,o))}return l?(S.res=w,S.usedParams=this.getUsedParamsDetails(o),S):w}extendTranslation(t,s,i,o,l){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const f=Ct(t)&&(i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let g;if(f){const h=t.match(this.interpolator.nestingRegexp);g=h&&h.length}let m=i.replace&&!Ct(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(m={...this.options.interpolation.defaultVariables,...m}),t=this.interpolator.interpolate(t,m,i.lng||this.language||o.usedLng,i),f){const h=t.match(this.interpolator.nestingRegexp),x=h&&h.length;g<x&&(i.nest=!1)}!i.lng&&o&&o.res&&(i.lng=this.language||o.usedLng),i.nest!==!1&&(t=this.interpolator.nest(t,(...h)=>l?.[0]===h[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${s[0]}`),null):this.translate(...h,s),i)),i.interpolation&&this.interpolator.reset()}const u=i.postProcess||this.options.postProcess,d=Ct(u)?[u]:u;return t!=null&&d?.length&&i.applyPostProcessor!==!1&&(t=gk.handle(d,t,s,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),t}resolve(t,s={}){let i,o,l,u,d;return Ct(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(f=>typeof f=="function"?Ha(f,{...this.options,...s}):f)),t.forEach(f=>{if(this.isValidLookup(i))return;const g=this.extractFromKey(f,s),m=g.key;o=m;let h=g.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const x=s.count!==void 0&&!Ct(s.count),S=x&&!s.ordinal&&s.count===0,w=s.context!==void 0&&(Ct(s.context)||typeof s.context=="number")&&s.context!=="",C=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);h.forEach(E=>{this.isValidLookup(i)||(d=E,!this.checkedLoadedFor[`${C[0]}-${E}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(d)&&(this.checkedLoadedFor[`${C[0]}-${E}`]=!0,this.logger.warn(`key "${o}" for languages "${C.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!!!")),C.forEach(R=>{if(this.isValidLookup(i))return;u=R;const k=[m];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(k,m,R,E,s);else{let A;x&&(A=this.pluralResolver.getSuffix(R,s.count,s));const N=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(x&&(s.ordinal&&A.startsWith(j)&&k.push(m+A.replace(j,this.options.pluralSeparator)),k.push(m+A),S&&k.push(m+N)),w){const D=`${m}${this.options.contextSeparator||"_"}${s.context}`;k.push(D),x&&(s.ordinal&&A.startsWith(j)&&k.push(D+A.replace(j,this.options.pluralSeparator)),k.push(D+A),S&&k.push(D+N))}}let O;for(;O=k.pop();)this.isValidLookup(i)||(l=O,i=this.getResource(R,E,O,s))}))})}),{res:i,usedKey:o,exactUsedKey:l,usedLng:u,usedNS:d}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,s,i,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,s,i,o):this.resourceStore.getResource(t,s,i,o)}getUsedParamsDetails(t={}){const s=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=t.replace&&!Ct(t.replace);let o=i?t.replace:t;if(i&&typeof t.count<"u"&&(o={...o,count:t.count}),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!i){o={...o};for(const l of s)delete o[l]}return o}static hasDefaultValue(t){const s="defaultValue";for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&i.startsWith(s)&&t[i]!==void 0)return!0;return!1}}class fE{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=mi.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(t){if(t=rc(t),!t||!t.includes("-"))return null;const s=t.split("-");return s.length===2||(s.pop(),s[s.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(s.join("-"))}getLanguagePartFromCode(t){if(t=rc(t),!t||!t.includes("-"))return t;const s=t.split("-");return this.formatLanguageCode(s[0])}formatLanguageCode(t){if(Ct(t)&&t.includes("-")){let s;try{s=Intl.getCanonicalLocales(t)[0]}catch{}return s&&this.options.lowerCaseLng&&(s=s.toLowerCase()),s||(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.includes(t)}getBestMatchFromCodes(t){if(!t)return null;let s;return t.forEach(i=>{if(s)return;const o=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(o))&&(s=o)}),!s&&this.options.supportedLngs&&t.forEach(i=>{if(s)return;const o=this.getScriptPartFromCode(i);if(this.isSupportedCode(o))return s=o;const l=this.getLanguagePartFromCode(i);if(this.isSupportedCode(l))return s=l;s=this.options.supportedLngs.find(u=>u===l?!0:!u.includes("-")&&!l.includes("-")?!1:!!(u.includes("-")&&!l.includes("-")&&u.slice(0,u.indexOf("-"))===l))}),s||(s=this.getFallbackCodes(this.options.fallbackLng)[0]),s}getFallbackCodes(t,s){if(!t)return[];if(typeof t=="function"&&(t=t(s)),Ct(t)&&(t=[t]),Array.isArray(t))return t;if(!s)return t.default||[];let i=t[s];return i||(i=t[this.getScriptPartFromCode(s)]),i||(i=t[this.formatLanguageCode(s)]),i||(i=t[this.getLanguagePartFromCode(s)]),i||(i=t.default),i||[]}toResolveHierarchy(t,s){const i=this.options.fallbackLng,o=Array.isArray(i)?i.join("|"):i;o!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=o);const l=s===void 0||s===!1||Ct(s),u=s===void 0&&typeof this.options.fallbackLng=="function",d=Ct(t)&&l&&!u;let f=null;if(d){let x;s===void 0?x="undefined":s===!1?x="boolean:false":x=`string:${s}`,f=`${t.length}:${t}|${x}`}if(f!==null){const x=this.resolveHierarchyCache[f];if(x!==void 0)return x.slice()}const g=this.getFallbackCodes((s===!1?[]:s)||this.options.fallbackLng||[],t),m=[],h=x=>{x&&(this.isSupportedCode(x)?m.push(x):this.logger.warn(`rejecting language code not found in supportedLngs: ${x}`))};return Ct(t)&&(t.includes("-")||t.includes("_"))?(this.options.load!=="languageOnly"&&h(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&h(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&h(this.getLanguagePartFromCode(t))):Ct(t)&&h(this.formatLanguageCode(t)),g.forEach(x=>{const S=this.formatLanguageCode(x);m.includes(S)||h(S)}),f!==null?(this.resolveHierarchyCache[f]=m,m.slice()):m}}const hE={zero:0,one:1,two:2,few:3,many:4,other:5},pE={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class KL{constructor(t,s={}){this.languageUtils=t,this.options=s,this.logger=mi.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,s={}){const i=rc(t==="dev"?"en":t),o=s.ordinal?"ordinal":"cardinal",l=JSON.stringify({cleanedCode:i,type:o});if(l in this.pluralRulesCache)return this.pluralRulesCache[l];let u;try{u=new Intl.PluralRules(i,{type:o})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),pE;if(!t.match(/-|_/))return pE;const f=this.languageUtils.getLanguagePartFromCode(t);u=this.getRule(f,s)}return this.pluralRulesCache[l]=u,u}needsPlural(t,s={}){let i=this.getRule(t,s);return i||(i=this.getRule("dev",s)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,s,i={}){return this.getSuffixes(t,i).map(o=>`${s}${o}`)}getSuffixes(t,s={}){let i=this.getRule(t,s);return i||(i=this.getRule("dev",s)),i?i.resolvedOptions().pluralCategories.sort((o,l)=>hE[o]-hE[l]).map(o=>`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(t,s,i={}){const o=this.getRule(t,i);return o?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${o.select(s)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",s,i))}}const gE=(e,t,s,i=".",o=!0)=>{let l=PL(e,t,s);return!l&&o&&Ct(s)&&(l=Vy(e,s,i),l===void 0&&(l=Vy(t,s,i))),l};class mE{constructor(t={}){this.logger=mi.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(s=>s),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:s,escapeValue:i,useRawValueToEscape:o,prefix:l,prefixEscaped:u,suffix:d,suffixEscaped:f,formatSeparator:g,unescapeSuffix:m,unescapePrefix:h,nestingPrefix:x,nestingPrefixEscaped:S,nestingSuffix:w,nestingSuffixEscaped:C,nestingOptionsSeparator:E,maxReplaces:R,alwaysFormat:k}=t.interpolation;this.escape=s!==void 0?s:zL,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=l?Vi(l):u||"{{",this.suffix=d?Vi(d):f||"}}",this.formatSeparator=g||",",this.unescapePrefix=m?"":h?Vi(h):"-",this.unescapeSuffix=this.unescapePrefix?"":m?Vi(m):"",this.nestingPrefix=x?Vi(x):S||Vi("$t("),this.nestingSuffix=w?Vi(w):C||Vi(")"),this.nestingOptionsSeparator=E||",",this.maxReplaces=R||1e3,this.alwaysFormat=k!==void 0?k:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(s,i)=>s?.source===i?(s.lastIndex=0,s):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,s,i,o){let l,u,d;const f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},g=C=>{if(!C.includes(this.formatSeparator)){const O=gE(s,f,C,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(O,void 0,i,{...o,...s,interpolationkey:C}):O}const E=C.split(this.formatSeparator),R=E.shift().trim(),k=E.join(this.formatSeparator).trim();return this.format(gE(s,f,R,this.options.keySeparator,this.options.ignoreJSONStructure),k,i,{...o,...s,interpolationkey:R})};this.resetRegExp(),!this.escapeValue&&typeof t=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const m=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,h=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,x=[{regex:this.regexpUnescape,safeValue:C=>C},{regex:this.regexp,safeValue:C=>this.escapeValue?this.escape(C):C}],S=[];let w=0;return x.forEach(C=>{for(d=0;l=C.regex.exec(t);){const E=l.index-w,R=S.find(([A,N])=>E>=A&&E<N);if(R){C.regex.lastIndex=R[1]+w;continue}const k=l[1].trim();if(u=g(k),u===void 0)if(typeof m=="function"){const A=m(t,l,o);u=Ct(A)?A:""}else if(o&&Object.prototype.hasOwnProperty.call(o,k))u="";else if(h){u=l[0];continue}else this.logger.warn(`missed to pass in variable ${k} for interpolating ${t}`),u="";else!Ct(u)&&!this.useRawValueToEscape&&(u=ih(u));const O=ih(C.safeValue(u));if(t=t.slice(0,l.index)+O+t.slice(l.index+l[0].length),h?(C.regex===this.regexpUnescape?S.push([l.index,l.index+O.length]):w+=O.length-l[0].length,C.regex.lastIndex+=O.length,C.regex.lastIndex-=l[0].length):C.regex.lastIndex=0,d++,d>=this.maxReplaces)break}}),t}nest(t,s,i={}){let o,l,u;const d=(h,x)=>{const S=this.nestingOptionsSeparator;if(!h.includes(S))return h;const w=h.split(new RegExp(`${Vi(S)}[ ]*{`));let C=`{${w[1]}`;h=w[0],C=this.interpolate(C,u);const E=C.match(/'/g),R=C.match(/"/g);((E?.length??0)%2===0&&!R||(R?.length??0)%2!==0)&&(C=C.replace(/'/g,'"'));try{u=JSON.parse(C),x&&(u={...x,...u})}catch(k){return this.logger.warn(`failed parsing options string in nesting for key ${h}`,k),`${h}${S}${C}`}return u.defaultValue&&u.defaultValue.includes(this.prefix)&&delete u.defaultValue,h},f=new RegExp(this.nestingRegexp);let g="",m=0;for(;o=f.exec(t);){let h=[];u={...i},u=u.replace&&!Ct(u.replace)?u.replace:u,u.applyPostProcessor=!1,delete u.defaultValue;const x=/{.*}/s.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(x!==-1&&(h=o[1].slice(x).split(this.formatSeparator).map(S=>S.trim()).filter(Boolean),o[1]=o[1].slice(0,x)),l=s(d.call(this,o[1].trim(),u),u),l&&o[0]===t&&!Ct(l))return l;Ct(l)||(l=ih(l)),l||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),l=""),h.length&&(l=h.reduce((S,w)=>this.format(S,w,i.lng,{...i,interpolationkey:o[1].trim()}),l.trim())),g+=t.slice(m,o.index)+ih(l),m=f.lastIndex,this.regexp.lastIndex=0}return m?g+t.slice(m):t}}const qL=e=>{let t=e.toLowerCase().trim();const s={};if(e.includes("(")){const i=e.split("(");t=i[0].toLowerCase().trim();const o=i[1].slice(0,-1);t==="currency"&&!o.includes(":")?s.currency||(s.currency=o.trim()):t==="relativetime"&&!o.includes(":")?s.range||(s.range=o.trim()):o.split(";").forEach(u=>{if(u){const[d,...f]=u.split(":"),g=f.join(":").trim().replace(/^'+|'+$/g,""),m=d.trim();s[m]||(s[m]=g),g==="false"&&(s[m]=!1),g==="true"&&(s[m]=!0),isNaN(g)||(s[m]=parseInt(g,10))}})}return{formatName:t,formatOptions:s}},yE=e=>{const t={};return(s,i,o)=>{let l=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(l={...l,[o.interpolationkey]:void 0});let u;try{u=i+JSON.stringify(l)}catch{return e(rc(i),o)(s)}let d=t[u];return d||(d=e(rc(i),o),t[u]=d),d(s)}},YL=e=>(t,s,i)=>e(rc(s),i)(t);class GL{constructor(t={}){this.logger=mi.create("formatter"),this.options=t,this.init(t)}init(t,s={interpolation:{}}){this.formatSeparator=s.interpolation.formatSeparator||",";const i=s.cacheInBuiltFormats?yE:YL;this.formats={number:i((o,l)=>{const u=new Intl.NumberFormat(o,{...l});return d=>u.format(d)}),currency:i((o,l)=>{const u=new Intl.NumberFormat(o,{...l,style:"currency"});return d=>u.format(d)}),datetime:i((o,l)=>{const u=new Intl.DateTimeFormat(o,{...l});return d=>u.format(d)}),relativetime:i((o,l)=>{const u=new Intl.RelativeTimeFormat(o,{...l});return d=>u.format(d,l.range||"day")}),list:i((o,l)=>{const u=new Intl.ListFormat(o,{...l});return d=>u.format(d)})}}add(t,s){this.formats[t.toLowerCase().trim()]=s}addCached(t,s){this.formats[t.toLowerCase().trim()]=yE(s)}format(t,s,i,o={}){if(!s||t==null)return t;const l=s.split(this.formatSeparator),u=[];for(let f=0;f<l.length;f++){let g=l[f];for(;g.indexOf("(")>-1&&!g.includes(")")&&f+1<l.length;)g=`${g}${this.formatSeparator}${l[++f]}`;u.push(g)}return u.reduce((f,g)=>{const{formatName:m,formatOptions:h}=qL(g);if(this.formats[m]){let x=f;try{const S=o?.formatParams?.[o.interpolationkey]||{},w=S.locale||S.lng||o.locale||o.lng||i;x=this.formats[m](f,w,{...h,...o,...S})}catch(S){this.logger.warn(S)}return x}else this.logger.warn(`there was no format function for ${m}`);return f},t)}}const $L=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class QL extends Jp{constructor(t,s,i,o={}){super(),this.backend=t,this.store=s,this.services=i,this.languageUtils=i.languageUtils,this.options=o,this.logger=mi.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(i,o.backend,o)}queueLoad(t,s,i,o){const l={},u={},d={},f={};return t.forEach(g=>{let m=!0;s.forEach(h=>{const x=`${g}|${h}`;!i.reload&&this.store.hasResourceBundle(g,h)?this.state[x]=2:this.state[x]<0||(this.state[x]===1?u[x]===void 0&&(u[x]=!0):(this.state[x]=1,m=!1,u[x]===void 0&&(u[x]=!0),l[x]===void 0&&(l[x]=!0),f[h]===void 0&&(f[h]=!0)))}),m||(d[g]=!0)}),(Object.keys(l).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(l),pending:Object.keys(u),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(f)}}loaded(t,s,i){const o=t.split("|"),l=o[0],u=o[1];s&&this.emit("failedLoading",l,u,s),!s&&i&&this.store.addResourceBundle(l,u,i,void 0,void 0,{skipCopy:!0}),this.state[t]=s?-1:2,s&&i&&(this.state[t]=0);const d={};this.queue.forEach(f=>{IL(f.loaded,[l],u),$L(f,t),s&&f.errors.push(s),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(g=>{d[g]||(d[g]={});const m=f.loaded[g];m.length&&m.forEach(h=>{d[g][h]===void 0&&(d[g][h]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(f=>!f.done)}read(t,s,i,o=0,l=this.retryTimeout,u){if(!t.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:s,fcName:i,tried:o,wait:l,callback:u});return}this.readingCalls++;const d=(g,m)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(g&&m&&o<this.maxRetries){setTimeout(()=>{this.read(t,s,i,o+1,l*2,u)},l);return}u(g,m)},f=this.backend[i].bind(this.backend);if(f.length===2){try{const g=f(t,s);g&&typeof g.then=="function"?g.then(m=>d(null,m)).catch(d):d(null,g)}catch(g){d(g)}return}return f(t,s,d)}prepareLoading(t,s,i={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();Ct(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Ct(s)&&(s=[s]);const l=this.queueLoad(t,s,i,o);if(!l.toLoad.length)return l.pending.length||o(),null;l.toLoad.forEach(u=>{this.loadOne(u)})}load(t,s,i){this.prepareLoading(t,s,{},i)}reload(t,s,i){this.prepareLoading(t,s,{reload:!0},i)}loadOne(t,s=""){const i=t.split("|"),o=i[0],l=i[1];this.read(o,l,"read",void 0,void 0,(u,d)=>{u&&this.logger.warn(`${s}loading namespace ${l} for language ${o} failed`,u),!u&&d&&this.logger.log(`${s}loaded namespace ${l} for language ${o}`,d),this.loaded(t,u,d)})}saveMissing(t,s,i,o,l,u={},d=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(s)){this.logger.warn(`did not save key "${i}" as the namespace "${s}" 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(this.backend?.create){const f={...u,isUpdate:l},g=this.backend.create.bind(this.backend);if(g.length<6)try{let m;g.length===5?m=g(t,s,i,o,f):m=g(t,s,i,o),m&&typeof m.then=="function"?m.then(h=>d(null,h)).catch(d):d(null,m)}catch(m){d(m)}else g(t,s,i,o,d,f)}!t||!t[0]||this.store.addResource(t[0],s,i,o)}}}const fy=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,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]),Ct(e[1])&&(t.defaultValue=e[1]),Ct(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const s=e[3]||e[2];Object.keys(s).forEach(i=>{t[i]=s[i]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),vE=e=>(Ct(e.ns)&&(e.ns=[e.ns]),Ct(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ct(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),ah=()=>{},XL=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(s=>{typeof e[s]=="function"&&(e[s]=e[s].bind(e))})};class Ou extends Jp{constructor(t={},s){if(super(),this.options=vE(t),this.services={},this.logger=mi,this.modules={external:[]},XL(this),s&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,s),this;setTimeout(()=>{this.init(t,s)},0)}}init(t={},s){this.isInitializing=!0,typeof t=="function"&&(s=t,t={}),t.defaultNS==null&&t.ns&&(Ct(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const i=fy();this.options={...i,...this.options,...vE(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);const o=g=>g?typeof g=="function"?new g:g:null;if(!this.options.isClone){this.modules.logger?mi.init(o(this.modules.logger),this.options):mi.init(null,this.options);let g;this.modules.formatter?g=this.modules.formatter:g=GL;const m=new fE(this.options);this.store=new dE(this.options.resources,this.options);const h=this.services;h.logger=mi,h.resourceStore=this.store,h.languageUtils=m,h.pluralResolver=new KL(m,{prepend:this.options.pluralSeparator}),g&&(h.formatter=o(g),h.formatter.init&&h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new mE(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new QL(o(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",(x,...S)=>{this.emit(x,...S)}),this.modules.languageDetector&&(h.languageDetector=o(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=o(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new tp(this.services,this.options),this.translator.on("*",(x,...S)=>{this.emit(x,...S)}),this.modules.external.forEach(x=>{x.init&&x.init(this)})}if(this.format=this.options.interpolation.format,s||(s=ah),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const g=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);g.length>0&&g[0]!=="dev"&&(this.options.lng=g[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(g=>{this[g]=(...m)=>this.store[g](...m)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(g=>{this[g]=(...m)=>(this.store[g](...m),this)});const d=gu(),f=()=>{const g=(m,h)=>{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(h),s(m,h)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return g(null,this.t.bind(this));this.changeLanguage(this.options.lng,g)};return this.options.resources||!this.options.initAsync?f():setTimeout(f,0),d}loadResources(t,s=ah){let i=s;const o=Ct(t)?t:this.language;if(typeof t=="function"&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const l=[],u=d=>{if(!d||d==="cimode")return;this.services.languageUtils.toResolveHierarchy(d).forEach(g=>{g!=="cimode"&&(l.includes(g)||l.push(g))})};o?u(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>u(f)),this.options.preload?.forEach?.(d=>u(d)),this.services.backendConnector.load(l,this.options.ns,d=>{!d&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(d)})}else i(null)}reloadResources(t,s,i){const o=gu();return typeof t=="function"&&(i=t,t=void 0),typeof s=="function"&&(i=s,s=void 0),t||(t=this.languages),s||(s=this.options.ns),i||(i=ah),this.services.backendConnector.reload(t,s,l=>{o.resolve(),i(l)}),o}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"&&gk.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"].includes(t)){for(let s=0;s<this.languages.length;s++){const i=this.languages[s];if(!["cimode","dev"].includes(i)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&!this.languages.includes(t)&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,s){this.isLanguageChangingTo=t;const i=gu();this.emit("languageChanging",t);const o=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},l=(d,f)=>{f?this.isLanguageChangingTo===t&&(o(f),this.translator.changeLanguage(f),this.isLanguageChangingTo=void 0,this.emit("languageChanged",f),this.logger.log("languageChanged",f)):this.isLanguageChangingTo=void 0,i.resolve((...g)=>this.t(...g)),s&&s(d,(...g)=>this.t(...g))},u=d=>{!t&&!d&&this.services.languageDetector&&(d=[]);const f=Ct(d)?d:d&&d[0],g=this.store.hasLanguageSomeTranslations(f)?f:this.services.languageUtils.getBestMatchFromCodes(Ct(d)?[d]:d);g&&(this.language||o(g),this.translator.language||this.translator.changeLanguage(g),this.services.languageDetector?.cacheUserLanguage?.(g)),this.loadResources(g,m=>{l(m,g)})};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,s,i,o){const l=o?.scopeNs,u=(d,f,...g)=>{let m;typeof f!="object"?m=this.options.overloadTranslationOptionHandler([d,f].concat(g)):m={...f},m.lng=m.lng||u.lng,m.lngs=m.lngs||u.lngs;const h=m.ns!==void 0&&m.ns!==null;m.ns=m.ns||u.ns,m.keyPrefix!==""&&(m.keyPrefix=m.keyPrefix||i||u.keyPrefix);const x={...this.options,...m};Array.isArray(l)&&!h&&(x.ns=l),typeof m.keyPrefix=="function"&&(m.keyPrefix=Ha(m.keyPrefix,x));const S=this.options.keySeparator||".";let w;return m.keyPrefix&&Array.isArray(d)?w=d.map(C=>(typeof C=="function"&&(C=Ha(C,x)),`${m.keyPrefix}${S}${C}`)):(typeof d=="function"&&(d=Ha(d,x)),w=m.keyPrefix?`${m.keyPrefix}${S}${d}`:d),this.t(w,m)};return Ct(t)?u.lng=t:u.lngs=t,u.ns=s,u.keyPrefix=i,u}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,s={}){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=s.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,l=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const u=(g,m)=>{const h=this.services.backendConnector.state[`${g}|${m}`];return h===-1||h===0||h===2};if(s.precheck){const g=s.precheck(this,u);if(g!==void 0)return g}if(this.hasResourceBundle(i,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages)return!0;const{languageUtils:d}=this.services,f=s.lng?d.isSupportedCode(i)&&d.toResolveHierarchy(i,!1)[0]:i;return!!((!f||u(f,t))&&(!o||u(l,t)))}loadNamespaces(t,s){const i=gu();return this.options.ns?(Ct(t)&&(t=[t]),t.forEach(o=>{this.options.ns.includes(o)||this.options.ns.push(o)}),this.loadResources(o=>{i.resolve(),s&&s(o)}),i):(s&&s(),Promise.resolve())}loadLanguages(t,s){const i=gu();Ct(t)&&(t=[t]);const o=this.options.preload||[],l=t.filter(u=>!o.includes(u)&&this.services.languageUtils.isSupportedCode(u));return l.length?(this.options.preload=o.concat(l),this.loadResources(u=>{i.resolve(),s&&s(u)}),i):(s&&s(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const o=new Intl.Locale(t);if(o&&o.getTextInfo){const l=o.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const s=["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=this.services?.languageUtils||new fE(fy());return t.toLowerCase().indexOf("-latn")>1?"ltr":s.includes(i.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},s){const i=new Ou(t,s);return i.createInstance=Ou.createInstance,i}cloneInstance(t={},s=ah){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const o={...this.options,preload:!1,...t,isClone:!0},l=new Ou(o);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=g=>{const m=Array.isArray(g)?[...g]:{...g};return Object.keys(m).forEach(h=>{m[h]&&typeof m[h]=="object"&&(m[h]=d(m[h]))}),m},f=d(this.store.data);l.store=new dE(f,o),l.services.resourceStore=l.store}if(t.interpolation){const f={...fy().interpolation,...this.options.interpolation,...t.interpolation},g={...o,interpolation:f};l.services.interpolator=new mE(g)}return l.translator=new tp(l.services,o),l.translator.on("*",(d,...f)=>{l.emit(d,...f)}),l.init(o,s),l.translator.options=o,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 pr=Ou.createInstance();pr.createInstance;pr.dir;pr.init;pr.loadResources;pr.reloadResources;pr.use;pr.changeLanguage;pr.getFixedT;pr.t;pr.exists;pr.setDefaultNamespace;pr.hasLoadedNamespace;pr.loadNamespaces;pr.loadLanguages;const ZL={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,"!doctype":!0,"!DOCTYPE":!0},JL=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function bE(e){const t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},s=e.match(/<\/?([^\s]+?)[/\s>]/);if(s&&(t.name=s[1],(ZL[s[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){const l=e.indexOf("-->");return{type:"comment",comment:l!==-1?e.slice(4,l):""}}const i=new RegExp(JL);let o=null;for(;o=i.exec(e),o!==null;)if(o[0].trim())if(o[1]){const l=o[1].trim();let u=[l,null];const d=l.indexOf("=");d>-1&&(u=[l.slice(0,d),l.slice(d+1)]),t.attrs[u[0]]=u[1],i.lastIndex--}else o[2]&&(t.attrs[o[2]]=o[3].trim().substring(1,o[3].length-1));return t}const oh=/<!--[\s\S]*?-->|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,WL=/<\/?([^\s]+?)[/\s>]/,e5=/^\s*$/,t5=/^(script|style)$/i,xu="\0",n5=Object.create(null);function yk(e){e.forEach(function(t){if(t.type==="text"){t.content=t.content.split(xu).join("<");return}if(t.type==="comment"){t.comment=t.comment.split(xu).join("<");return}for(const s in t.attrs){const i=t.attrs[s];typeof i=="string"&&i.indexOf(xu)>-1&&(t.attrs[s]=i.split(xu).join("<"))}t.children.length&&yk(t.children)})}function r5(e,t){const s=t&&t.components||n5,i=t&&t.allowedTags;let o=!1;if(i){const w=typeof i=="function"?i:function(k){return i.indexOf(k)>-1};let C="",E=0;oh.lastIndex=0;let R;for(;R=oh.exec(e);){const k=R[0];C+=e.slice(E,R.index);const O=k.match(WL);k.startsWith("<!--")||O&&w(O[1])?(C+=k,E=R.index+k.length):(o=!0,C+=xu,E=R.index+1,oh.lastIndex=E)}e=C+e.slice(E)}const l=[],u=[];let d,f=-1,g=!1,m=0,h;if(e.indexOf("<")!==0){const w=e.indexOf("<");l.push({type:"text",content:w===-1?e:e.substring(0,w)})}const x=[];let S;for(;S=oh.exec(e);)x.push(S);return x.forEach(function(w,C){const E=w[0];if(!E||E.startsWith("<!--"))return;let R=0,k=0,O=-1,A=null;for(let j=0;j<E.length;j++){const D=E.charAt(j);A?D===A&&(A=null):D==='"'||D==="'"?A=D:D==="<"?(R++,R===2&&(O=j)):D===">"&&k++}const N=O>-1&&/[a-zA-Z0-9\-!/]/.test(E.charAt(O+1));if(R>k&&N){const j=E.substring(0,O),D=E.substring(j.length);x[C][0]=D,x[C].index+=j.length}}),x.forEach(function(w,C){const E=w[0];if(!E)return;const R=w.index;if(R<m)return;if(g){if(E!=="</"+d.name+">")return;g=!1}const k=E.charAt(1)!=="/",O=E.startsWith("<!--"),A=R+E.length,N=e.charAt(A),j=x[C+1];let D;if(N==="<"&&j){const _=e.substring(A,j.index);D=_.split("<").length>_.split(">").length}let M;if(O){const _=bE(E);if(f<0)return l.push(_),l;M=u[f],M.children.push(_);const L=e.slice(A,j?j.index:void 0);return L.length>0&&M.children.push({type:"text",content:L}),l}if(k){f++,d=bE(E),d.type==="tag"&&s[d.name]&&(d.type="component",g=!0);let _=!1;if(!g&&!d.voidElement&&t5.test(d.name)){_=!0,h||(h=e.toLowerCase());const L=h.indexOf("</"+d.name.toLowerCase()+">",A),q=L===-1?e.length:L,X=e.slice(A,q);X&&d.children.push({type:"text",content:X}),m=q}!d.voidElement&&!g&&!_&&N&&N!=="<"&&d.children.push({type:"text",content:e.slice(A,j?j.index:void 0)}),f===0&&l.push(d),M=u[f-1],M&&M.children.push(d),u[f]=d}if((!k||d.voidElement)&&(f>-1&&(d.voidElement||d.name===E.slice(2,-1))&&(f--,d=f===-1?l:u[f]),!g&&(N!=="<"||D)&&N)){M=f===-1?l:u[f].children;const _=j?j.index:-1;let L=e.slice(A,_===-1?void 0:_);e5.test(L)&&(L=" "),(_>-1&&f+M.length>=0||L!==" ")&&M.push({type:"text",content:L})}}),o&&yk(l),l}function s5(e){const t=[];for(const s in e)e[s]===null?t.push(s):t.push(s+'="'+String(e[s]).replace(/"/g,"&quot;")+'"');return t.length?" "+t.join(" "):""}function vk(e,t){switch(t.type){case"text":return e+t.content;case"tag":{const s=t.voidElement&&t.name.toLowerCase()!=="!doctype"?"/>":">";return e+="<"+t.name+(t.attrs?s5(t.attrs):"")+s,t.voidElement?e:e+t.children.reduce(vk,"")+"</"+t.name+">"}case"comment":return e+="<!--"+t.comment+"-->",e}}function i5(e){return e.reduce(function(t,s){return t+vk("",s)},"")}var a5={parse:r5,stringify:i5};const Th=(e,t,s,i)=>{const o=[s,{code:t,...i||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(o,"warn","react-i18next::",!0);Wr(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...o):console?.warn&&console.warn(...o)},xE={},$l=(e,t,s,i)=>{Wr(s)&&xE[s]||(Wr(s)&&(xE[s]=new Date),Th(e,t,s,i))},bk=(e,t)=>()=>{if(e.isInitialized)t();else{const s=()=>{setTimeout(()=>{e.off("initialized",s)},0),t()};e.on("initialized",s)}},Ky=(e,t,s)=>{e.loadNamespaces(t,bk(e,s))},SE=(e,t,s,i)=>{if(Wr(s)&&(s=[s]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Ky(e,s,i);s.forEach(o=>{e.options.ns.indexOf(o)<0&&e.options.ns.push(o)}),e.loadLanguages(t,bk(e,i))},o5=(e,t,s={})=>!t.languages||!t.languages.length?($l(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:s.lng,precheck:(i,o)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,e))return!1}}),Wr=e=>typeof e=="string",gi=e=>typeof e=="object"&&e!==null,l5=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,c5={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},u5=e=>c5[e],xk=e=>e.replace(l5,u5);let qy={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:xk,transDefaultProps:void 0};const d5=(e={})=>{qy={...qy,...e}},ib=()=>qy;let Sk;const f5=e=>{Sk=e},ab=()=>Sk,kh=(e,t)=>{if(!e)return!1;const s=e.props?.children??e.children;return t?s.length>0:!!s},Su=e=>{if(!e)return[];const t=e.props?.children??e.children;return e.props?.i18nIsDynamicList?qi(t):t},h5=e=>qi(e).every(b.isValidElement),qi=e=>Array.isArray(e)?e:[e],p5=(e,t)=>{const s={...t};return s.props={...t.props,...e.props},s},g5=e=>{const t={};if(!e)return t;const s=i=>{qi(i).forEach(l=>{Wr(l)||(kh(l)?s(Su(l)):gi(l)&&!b.isValidElement(l)&&Object.assign(t,l))})};return s(e),t},Yy=(e,t,s,i)=>{if(!e)return"";let o="";const l=qi(e),u=t?.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return l.forEach((d,f)=>{if(Wr(d)){o+=`${d}`;return}if(b.isValidElement(d)){const{props:g,type:m}=d,h=Object.keys(g).length,x=u.indexOf(m)>-1,S=g.children;if(!S&&x&&!h){o+=`<${m}/>`;return}if(!S&&(!x||h)||g.i18nIsDynamicList){o+=`<${f}></${f}>`;return}if(x&&h<=1){const C=Wr(S)?S:Yy(S,t,s,i);o+=`<${m}>${C}</${m}>`;return}const w=Yy(S,t,s,i);o+=`<${f}>${w}</${f}>`;return}if(d===null){Th(s,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:i});return}if(gi(d)){const{format:g,...m}=d,h=Object.keys(m);if(h.length===1){const x=g?`${h[0]}, ${g}`:h[0];o+=`{{${x}}}`;return}if(!h.length&&Object.keys(d).length===1&&"format"in d){o+="{{format}}";return}Th(s,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:i,child:d});return}Th(s,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:i,child:d})}),o},m5=(e,t,s,i,o,l,u)=>{if(s==="")return[];const d=o.transKeepBasicHtmlNodesFor||[],f=s&&new RegExp(d.map(O=>`<${O}`).join("|")).test(s);if(!e&&!t&&!f&&!u)return[s];const g=t??{},m=O=>{qi(O).forEach(N=>{Wr(N)||(kh(N)?m(Su(N)):gi(N)&&!b.isValidElement(N)&&Object.assign(g,N))})};m(e);const h=Object.keys(g),x=O=>/^\d+$/.test(O)||d.indexOf(O)>-1||h.indexOf(O)>-1,S=a5.parse(`<0>${s}</0>`,{allowedTags:x}),w={...g,...l},C=(O,A,N)=>{const j=Su(O),D=R(j,A.children,N);return h5(j)&&D.length===0||O.props?.i18nIsDynamicList?j:D},E=(O,A,N,j,D)=>{O.dummy?(O.children=A,N.push(b.cloneElement(O,{key:j},D?void 0:A))):N.push(...b.Children.map([O],M=>{if(M.type===b.Fragment||M.props?.i18nIsDynamicList!==void 0){const L={key:j};return M&&M.props&&Object.keys(M.props).forEach(q=>{q==="children"||q==="i18nIsDynamicList"||(L[q]=M.props[q])}),b.createElement(M.type,L,D?null:A)}const _={key:j};return M&&M.props&&Object.keys(M.props).forEach(L=>{L==="ref"||L==="children"||(_[L]=M.props[L])}),b.cloneElement(M,_,D?null:A)}))},R=(O,A,N)=>{const j=qi(O),D=qi(A),M={};return D.reduce((_,L,q)=>{const X=L.children?.[0]?.content&&i.services.interpolator.interpolate(L.children[0].content,w,i.language);if(L.type==="tag"){let B=j[parseInt(L.name,10)];!B&&t&&(B=t[L.name]),N.length===1&&!B&&gi(N[0])&&(B=N[0][L.name]),B||(B={});const H={...L.attrs};u&&Object.keys(H).forEach(Y=>{const ee=H[Y];Wr(ee)&&(H[Y]=xk(ee))});const U=Object.keys(H).length!==0?p5({props:H},B):B,z=b.isValidElement(U),Q=z&&kh(L,!0)&&!L.voidElement,$=f&&gi(U)&&U.dummy&&!z,K=gi(t)&&Object.hasOwnProperty.call(t,L.name);if(Wr(U)){const Y=i.services.interpolator.interpolate(U,w,i.language);_.push(Y)}else if(kh(U)||Q){const Y=C(U,L,N);E(U,Y,_,q)}else if($){const Y=R(j,L.children,N);E(U,Y,_,q)}else if(Number.isNaN(parseFloat(L.name)))if(K){const Y=C(U,L,N);E(U,Y,_,q,L.voidElement)}else if(o.transSupportBasicHtmlNodes&&d.indexOf(L.name)>-1)if(L.voidElement)_.push(b.createElement(L.name,{key:`${L.name}-${q}`}));else{const Y=M[L.name]||0;M[L.name]=Y+1;let ee,G=0;for(let V=0;V<j.length;V+=1){const W=j[V];if(b.isValidElement(W)&&W.type===L.name){if(G===Y){ee=W;break}G+=1}}const oe=ee?qi(Su(ee)):j,I=R(oe,L.children,N);_.push(b.createElement(L.name,{key:`${L.name}-${q}`},I))}else if(L.voidElement)_.push(`<${L.name} />`);else{const Y=R(j,L.children,N);_.push(`<${L.name}>${Y}</${L.name}>`)}else if(gi(U)&&!z){const Y=L.children[0]?X:null;Y&&_.push(Y)}else E(U,X,_,q,L.children.length!==1||!X)}else if(L.type==="text"){const B=o.transWrapTextNodes,H=typeof o.unescape=="function"?o.unescape:ib().unescape,U=u?H(i.services.interpolator.interpolate(L.content,w,i.language)):i.services.interpolator.interpolate(L.content,w,i.language);B?_.push(b.createElement(B,{key:`${L.name}-${q}`},U)):_.push(U)}return _},[])},k=R([{dummy:!0,children:e||[]}],S,qi(e||[]));return Su(k[0])},wk=(e,t,s)=>{const i=e.key||t,o=b.cloneElement(e,{key:i});if(!o.props||!o.props.children||s.indexOf(`${t}/>`)<0&&s.indexOf(`${t} />`)<0)return o;function l(){return b.createElement(b.Fragment,null,o)}return b.createElement(l,{key:i})},y5=(e,t)=>e.map((s,i)=>wk(s,i,t)),v5=(e,t)=>{const s={};return Object.keys(e).forEach(i=>{Object.assign(s,{[i]:wk(e[i],i,t)})}),s},b5=(e,t,s,i)=>e?Array.isArray(e)?y5(e,t):gi(e)?v5(e,t):($l(s,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:i}),null):null,x5=e=>!gi(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,s)=>t&&Number.isNaN(Number.parseFloat(s)),!0);function S5({children:e,count:t,parent:s,i18nKey:i,context:o,tOptions:l={},values:u,defaults:d,components:f,ns:g,i18n:m,t:h,shouldUnescape:x,...S}){const w=m||ab();if(!w)return $l(w,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.",{i18nKey:i}),e;const C=h||w.t.bind(w)||(ee=>ee),E={...ib(),...w.options?.react};let R=g||(C.ns?void 0:w.options?.defaultNS||"translation");Wr(R)&&(R=[R]);const{transDefaultProps:k}=E,O=k?.tOptions?{...k.tOptions,...l}:l,A=x??k?.shouldUnescape,N=k?.values?{...k.values,...u}:u,j=k?.components?{...k.components,...f}:f,D=Yy(e,E,w,i),M=Array.isArray(i)?i[i.length-1]:i,_=d||O?.defaultValue||D||E.transEmptyNodeValue||(typeof M=="function"?Ha(M):M),{hashTransKey:L}=E,q=i||(L?L(D||_):D||_);w.options?.interpolation?.defaultVariables?u={...w.options.interpolation.defaultVariables,...N}:u=N;const X=g5(e);X&&typeof X.count=="number"&&t===void 0&&(t=X.count),t===void 0&&(t=O?.count);const B=u||t!==void 0&&!w.options?.interpolation?.alwaysFormat||!e?O.interpolation:{interpolation:{...O.interpolation,prefix:"#$?",suffix:"?$#"}},H={...O,context:o||O.context,count:t,...u,...B,defaultValue:_,ns:R};let U=q?C(q,H):_;U===q&&_&&(U=_);const z=b5(j,U,w,i);let Q=z||e,$=null;x5(z)?($=z,Q=e):z&&!Array.isArray(z)&&($=z,Q=void 0);const K=m5(Q,$,U,w,E,H,A),Y=s??E.defaultTransParent;return Y?b.createElement(Y,S,K):K}const w5={type:"3rdParty",init(e){d5(e.options.react),f5(e)}},Ek=b.createContext();class E5{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(s=>{this.usedNamespaces[s]||(this.usedNamespaces[s]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Wp({children:e,count:t,parent:s,i18nKey:i,context:o,tOptions:l={},values:u,defaults:d,components:f,ns:g,i18n:m,t:h,shouldUnescape:x,...S}){const{i18n:w,defaultNS:C}=b.useContext(Ek)||{},E=m||w||ab(),R=h||E?.t.bind(E);return S5({children:e,count:t,parent:s,i18nKey:i,context:o,tOptions:l,values:u,defaults:d,components:f,ns:g||(R?.ns?void 0:C||E?.options?.defaultNS),i18n:E,t:h,shouldUnescape:x,...S})}const R5=(e,t)=>{if(Wr(t))return t;if(gi(t)&&Wr(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const s=e[e.length-1];return typeof s=="function"?"":s}return e},C5={t:R5,ready:!1},T5=()=>()=>{},pt=(e,t={})=>{const{i18n:s}=t,{i18n:i,defaultNS:o}=b.useContext(Ek)||{},l=s||i||ab();l&&!l.reportNamespaces&&(l.reportNamespaces=new E5),l||$l(l,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.");const u=b.useMemo(()=>({...ib(),...l?.options?.react,...t}),[l,t]),{useSuspense:d,keyPrefix:f,bindI18n:g,bindI18nStore:m}=u,h=o||l?.options?.defaultNS,x=Wr(h)?[h]:h||["translation"],S=JSON.stringify(x),w=b.useMemo(()=>x,[S]);l?.reportNamespaces?.addUsedNamespaces?.(w);const C=b.useRef(0),E=b.useCallback(H=>{if(!l)return T5;const U=()=>{C.current+=1,H()};return g&&l.on(g,U),m&&l.store.on(m,U),()=>{g&&g.split(" ").forEach(z=>l.off(z,U)),m&&m.split(" ").forEach(z=>l.store.off(z,U))}},[l,g,m]),R=b.useRef(),k=b.useCallback(()=>{if(!l)return C5;const H=!!(l.isInitialized||l.initializedStoreOnce)&&w.every(ee=>o5(ee,l,u)),U=t.lng||l.language,z=C.current,Q=typeof f=="function"?Ha(f,{...l.options,ns:w}):f,$=R.current;if($&&$.i18n===l&&$.ready===H&&$.lng===U&&$.namespaces===w&&$.keyPrefix===Q&&$.revision===z)return $;const Y={t:l.getFixedT(U,u.nsMode==="fallback"?w:w[0],f,{scopeNs:w}),i18n:l,ready:H,lng:U,namespaces:w,keyPrefix:Q,revision:z};return R.current=Y,Y},[l,w,f,u,t.lng]),[O,A]=b.useState(0);let{t:N,ready:j}=Fp.useSyncExternalStore(E,k,k),D;l&&d&&!j&&(D=new Promise(H=>{const U=()=>H();t.lng?SE(l,t.lng,w,U):Ky(l,w,U)}),{t:N,ready:j}=k()),b.useEffect(()=>{if(l&&!j&&!d){const H=()=>A(U=>U+1);t.lng?SE(l,t.lng,w,H):Ky(l,w,H)}},[l,t.lng,w,j,d,O]);const M=l||{},_=b.useRef(null),L=b.useRef(),q=H=>`${H.language}|${H.resolvedLanguage}|${H.languages?.join(",")}`,X=H=>{const U=Object.getOwnPropertyDescriptors(H);U.__original&&delete U.__original;const z=Object.create(Object.getPrototypeOf(H),U);if(!Object.prototype.hasOwnProperty.call(z,"__original"))try{Object.defineProperty(z,"__original",{value:H,writable:!1,enumerable:!1,configurable:!1})}catch{}return z},B=b.useMemo(()=>{const H=M,U=H&&q(H);let z=H;H&&(_.current&&_.current.__original===H?L.current!==U?(z=X(H),_.current=z,L.current=U):z=_.current:(z=X(H),_.current=z,L.current=U));const Q=!j&&!d?(...K)=>($l(l,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),N(...K)):N,$=[Q,z,j];return $.t=Q,$.i18n=z,$.ready=j,$},[N,M,j,M.resolvedLanguage,M.language,M.languages]);if(l&&d&&!j){let H=!1;try{H=!1}catch{}throw H&&$l(l,"SUSPENDED_WHILE_LOADING","useTranslation: suspended while translations are loading (useSuspense is true by default). Add a <Suspense> boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook"),D}return B};function Rk(e){var t,s,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(s=Rk(e[t]))&&(i&&(i+=" "),i+=s)}else for(s in e)e[s]&&(i&&(i+=" "),i+=s);return i}function k5(){for(var e,t,s=0,i="",o=arguments.length;s<o;s++)(e=arguments[s])&&(t=Rk(e))&&(i&&(i+=" "),i+=t);return i}const wE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,EE=k5,Uo=(e,t)=>s=>{var i;if(t?.variants==null)return EE(e,s?.class,s?.className);const{variants:o,defaultVariants:l}=t,u=Object.keys(o).map(g=>{const m=s?.[g],h=l?.[g];if(m===null)return null;const x=wE(m)||wE(h);return o[g][x]}),d=s&&Object.entries(s).reduce((g,m)=>{let[h,x]=m;return x===void 0||(g[h]=x),g},{}),f=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((g,m)=>{let{class:h,className:x,...S}=m;return Object.entries(S).every(w=>{let[C,E]=w;return Array.isArray(E)?E.includes({...l,...d}[C]):{...l,...d}[C]===E})?[...g,h,x]:g},[]);return EE(e,u,f,s?.class,s?.className)},Ck=b.createContext(void 0);function ob(e=!1){const t=b.useContext(Ck);if(t===void 0&&!e)throw new Error(gn(16));return t}function O5(e){const{focusableWhenDisabled:t,disabled:s,composite:i=!1,tabIndex:o=0,isNativeButton:l}=e,u=i&&t!==!1,d=i&&t===!1;return{props:b.useMemo(()=>{const g={onKeyDown(m){s&&t&&m.key!=="Tab"&&m.preventDefault()}};return i||(g.tabIndex=o,!l&&s&&(g.tabIndex=t?o:-1)),(l&&(t||u)||!l&&s)&&(g["aria-disabled"]=s),l&&(!t||d)&&(g.disabled=s),g},[i,s,t,u,d,l,o])}}function Do(e,t,{detail:s=0,pointerType:i=""}={}){e.dispatchEvent(new(Rn(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:s,pointerType:i,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function vs(e={}){const{disabled:t=!1,focusableWhenDisabled:s,tabIndex:i=0,native:o=!0,composite:l}=e,u=b.useRef(null),d=ob(!0),f=l??d!==void 0,{props:g}=O5({focusableWhenDisabled:s,disabled:t,composite:f,tabIndex:i,isNativeButton:o}),m=b.useCallback(()=>{const S=u.current;hy(S)&&f&&t&&g.disabled===void 0&&S.disabled&&(S.disabled=!1)},[t,g.disabled,f]);_e(m,[m]);const h=b.useCallback((S={})=>{const{onClick:w,onMouseDown:C,onKeyUp:E,onKeyDown:R,onPointerDown:k,...O}=S;return Ar({onClick(A){if(t){A.preventDefault();return}w?.(A)},onMouseDown(A){t||C?.(A)},onKeyDown(A){if(t||(Kh(A),R?.(A),A.baseUIHandlerPrevented))return;const N=A.target===A.currentTarget,j=A.currentTarget,D=hy(j),M=!o&&A5(j),_=N&&(o?D:!M),L=A.key==="Enter",q=A.key===" ",X=j.getAttribute("role"),B=X?.startsWith("menuitem")||X==="option"||X==="gridcell";if(N&&f&&q){if(A.defaultPrevented&&B)return;A.preventDefault(),(!o||D)&&(A.preventBaseUIHandler(),Do(j,A));return}if(!_||o||!q&&!L){N&&M&&q&&A.preventDefault();return}A.defaultPrevented||(A.preventDefault(),L&&(A.preventBaseUIHandler(),Do(j,A)))},onKeyUp(A){if(!t){if(Kh(A),E?.(A),A.target===A.currentTarget&&o&&f&&hy(A.currentTarget)&&A.key===" "){A.preventDefault();return}A.baseUIHandlerPrevented||A.target===A.currentTarget&&!o&&!f&&!A.defaultPrevented&&A.key===" "&&(A.preventBaseUIHandler(),Do(A.currentTarget,A))}},onPointerDown(A){if(t){A.preventDefault();return}k?.(A)}},o?{type:"button"}:{role:"button"},g,O)},[t,g,f,o]),x=Be(S=>{u.current=S,m()});return{getButtonProps:h,buttonRef:x}}function hy(e){return bn(e)&&e.tagName==="BUTTON"}function A5(e){return bn(e)&&e.tagName==="A"&&!!e.href}const M5=b.forwardRef(function(t,s){const{render:i,className:o,disabled:l=!1,focusableWhenDisabled:u=!1,nativeButton:d=!0,style:f,...g}=t,{getButtonProps:m,buttonRef:h}=vs({disabled:l,focusableWhenDisabled:u,native:d});return kt("button",t,{state:{disabled:l},ref:[s,h],props:[g,m]})}),Tk=Uo("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-xs/relaxed font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-input/30",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",xs:"h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5",sm:"h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",lg:"h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4",icon:"size-7 [&_svg:not([class*='size-'])]:size-3.5","icon-xs":"size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5","icon-sm":"size-6 [&_svg:not([class*='size-'])]:size-3","icon-lg":"size-8 [&_svg:not([class*='size-'])]:size-4"}},defaultVariants:{variant:"default",size:"default"}});function nt({className:e,variant:t="default",size:s="default",...i}){return v.jsx(M5,{"data-slot":"button",className:Fe(Tk({variant:t,size:s,className:e})),...i})}const N5=Uo("group/code-block relative flex w-full min-w-0 flex-col overflow-hidden rounded-md text-sm has-[>[data-slot=code-block-content]:focus-visible]:ring-2 has-[>[data-slot=code-block-content]:focus-visible]:ring-ring/30 data-[size=sm]:text-xs",{variants:{variant:{default:"border border-input text-foreground has-[>[data-slot=code-block-content]:focus-visible]:border-ring dark:bg-input/30",destructive:"border border-destructive/30 text-destructive dark:border-destructive/40"}},defaultVariants:{variant:"default"}});function D5({className:e,variant:t="default",size:s="default",...i}){return v.jsx("div",{"data-slot":"code-block","data-variant":t,"data-size":s,className:Fe(N5({variant:t}),e),...i})}function j5({className:e,...t}){return v.jsx("div",{"data-slot":"code-block-header",className:Fe("flex min-w-0 shrink-0 items-center gap-2 px-3 pt-3 text-muted-foreground group-data-[size=sm]/code-block:px-2 group-data-[size=sm]/code-block:pt-2 group-data-[variant=destructive]/code-block:text-destructive *:has-[>[data-slot=code-block-title]]:min-w-0",e),...t})}function I5({className:e,...t}){return v.jsx("div",{"data-slot":"code-block-title",className:Fe("min-w-0 truncate font-sans text-xs font-medium text-foreground group-data-[variant=destructive]/code-block:text-destructive [&_svg]:pointer-events-none [&_svg]:inline-block [&_svg]:align-middle [&_svg:not([class*='size-'])]:size-3.5 *:[svg]:me-1.5",e),...t})}function P5({className:e,...t}){return v.jsx("div",{"data-slot":"code-block-actions",className:Fe("-my-1 ms-auto -me-1.5 flex shrink-0 items-center gap-1 [[data-slot=code-block]>&]:absolute [[data-slot=code-block]>&]:end-2 [[data-slot=code-block]>&]:top-2 [[data-slot=code-block]>&]:z-10 [[data-slot=code-block]>&]:m-0 [[data-slot=code-block]>&]:opacity-0 [[data-slot=code-block]>&]:transition-opacity [[data-slot=code-block]>&]:group-focus-within/code-block:opacity-100 [[data-slot=code-block]>&]:group-hover/code-block:opacity-100 group-data-[size=sm]/code-block:[[data-slot=code-block]>&]:end-1.5 group-data-[size=sm]/code-block:[[data-slot=code-block]>&]:top-1.5 [[data-slot=code-block]>&]:pointer-coarse:opacity-100 [[data-slot=code-block]>&]:*:[button]:bg-background [[data-slot=code-block]>&]:*:[button]:ring-1 [[data-slot=code-block]>&]:*:[button]:ring-foreground/10",e),...t})}function L5({value:e,variant:t="ghost",size:s="icon-xs",className:i,onClick:o,...l}){const[u,d]=b.useState(!1);return b.useEffect(()=>{if(!u)return;const f=setTimeout(()=>d(!1),2e3);return()=>clearTimeout(f)},[u]),v.jsxs(v.Fragment,{children:[v.jsx(nt,{"data-slot":"code-block-copy-button","data-copied":u||void 0,variant:t,size:s,"aria-label":u?"Copied":"Copy",className:Fe(i),onClick:f=>{o?.(f),navigator.clipboard.writeText(e).then(()=>d(!0)).catch(()=>{})},...l,children:u?v.jsx(ld,{}):v.jsx(wT,{})}),v.jsx("span",{"aria-live":"polite",className:"sr-only",children:u?"Copied":""})]})}function z5({className:e,children:t,style:s,wrap:i=!1,lineNumbers:o=!1,startLine:l=1,...u}){return v.jsx("pre",{"data-slot":"code-block-content","data-wrap":i||void 0,"data-numbered":o||void 0,dir:"ltr",tabIndex:0,style:{counterReset:`line ${l-1}`,...s},className:Fe("min-h-0 min-w-0 scroll-fade-x scrollbar-thin overflow-auto px-3 py-3 text-start font-mono leading-relaxed outline-none group-has-data-[slot=code-block-footer]/code-block:pb-2 group-has-data-[slot=code-block-header]/code-block:pt-2 group-data-[size=sm]/code-block:px-2 group-data-[size=sm]/code-block:py-2 group-data-[size=sm]/code-block:group-has-data-[slot=code-block-header]/code-block:pt-1.5 data-wrap:scroll-fade-y data-wrap:wrap-break-word data-wrap:whitespace-pre-wrap",e),...u,children:v.jsx("code",{"data-slot":"code-block-code",className:"grid min-h-lh min-w-max content-start in-data-numbered:grid-cols-[auto_1fr] in-data-wrap:min-w-0",children:o&&typeof t=="string"?t.replace(/\n$/,"").split(`
11
+ `).map((d,f)=>v.jsx(U5,{children:d},f)):t})})}const _5=Uo("relative -mx-3 block min-h-lh px-3 group-data-[size=sm]/code-block:-mx-2 group-data-[size=sm]/code-block:px-2 before:min-w-6 before:text-end before:text-muted-foreground after:absolute after:start-1 after:top-0 after:text-muted-foreground after:select-none in-data-numbered:col-span-2 in-data-numbered:grid in-data-numbered:grid-cols-subgrid in-data-numbered:gap-x-3 in-data-numbered:[counter-increment:line] in-data-numbered:before:content-[counter(line)] in-data-numbered:before:select-none in-data-numbered:supports-[content:counter(line)_/_'']:before:content-[counter(line)_/_'']",{variants:{variant:{default:"",added:"bg-muted after:content-['+']",removed:"bg-destructive/10 after:text-destructive after:content-['−']",highlighted:"bg-muted"}},defaultVariants:{variant:"default"}});function U5({className:e,variant:t="default",children:s,...i}){const o=s==null||s===""||Array.isArray(s)&&s.length===0;return v.jsx("span",{"data-slot":"code-block-line","data-variant":t,className:Fe(_5({variant:t}),e),...i,children:v.jsx("span",{"data-slot":"code-block-line-content",className:"min-w-0",children:o?`
12
+ `:s})})}const kk=b.createContext(void 0);function cd(e){const t=b.useContext(kk);if(t===void 0&&!e)throw new Error(gn(47));return t}const H5={...Yi,disabled:e=>e.disabled,instantType:e=>e.instantType==="trigger-change"&&!Yi.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===Qs&&Yi.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod==="touch"&&e.openChangeReason===Qs,hasTriggerFocusGuards:(e,t)=>Yi.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class F5 extends oc{constructor(t,s,i){const o=new ad;super(B5(t,o,s,i),V5(o),H5)}setOpen=(t,s)=>{const i=s.reason===Kn,o=s.reason===Qs&&s.event.detail===0,l=!t&&(s.reason===td||s.reason==null),u=Lp(s),d=this.select("activeTriggerId");if(!t&&s.reason===WR&&s.trigger==null&&d!=null&&(s.trigger=this.context.triggerElements.getById(d)??this.select("activeTriggerElement")??void 0),this.context.onOpenChange?.(t,s),s.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,s);const f=()=>{const m=Pp(this.state,t,s.trigger,u());m.openChangeReason=s.reason,this.update(m)};i?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(CC,()=>{this.context.stickIfOpen=!1}),hr.flushSync(f)):f();let g;o?g="click":l?g="dismiss":s.reason===Fa&&(g="focus"),this.set("instantType",g)}}function B5(e,t,s,i=!1){const o={...Bp(t,s,i),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return o.open&&e?.mounted===void 0&&(o.mounted=!0),o}function V5(e){return{popupRef:b.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:b.createRef(),beforeTriggerFocusGuardRef:b.createRef(),beforeContentFocusGuardRef:b.createRef(),stickIfOpenTimeout:new Ps,stickIfOpen:!0,triggerElements:e}}const RE=Xu(function({props:t}){const{children:s,open:i,defaultOpen:o=!1,onOpenChange:l,onOpenChangeComplete:u,modal:d=!1,handle:f,triggerId:g,defaultTriggerId:m=null}=t,h=q5(f,{modal:d,open:o,openProp:i,activeTriggerId:m,triggerIdProp:g});h.useControlledProp("openProp",i),h.useControlledProp("triggerIdProp",g);const x=h.useState("open"),S=h.useState("mounted"),w=h.useState("payload");h.useContextCallback("onOpenChange",l),h.useContextCallback("onOpenChangeComplete",u),_C(h,x),_p(h);const{forceUnmount:C}=Up(x,h,()=>{h.context.stickIfOpen=!0,h.set("openChangeReason",null)});h.useSyncedValues({modal:d}),b.useEffect(()=>{x||h.context.stickIfOpenTimeout.clear()},[h,x]),b.useImperativeHandle(t.actionsRef,()=>({unmount:C,close:()=>h.setOpen(!1,ut(nd))}),[C,h]);const E=x||S||f!=null;return v.jsxs(kk.Provider,{value:h,children:[f&&v.jsx(Ip,{handle:f,store:h}),E&&v.jsx(Y5,{store:h,modal:d}),typeof s=="function"?s({payload:w}):s]})});function K5(e){return cd(!0)?v.jsx(RE,{props:e}):v.jsx(IC,{children:v.jsx(RE,{props:e})})}function q5(e,t){const s=Kv((i,o)=>new F5(t,i,o));return b.useEffect(()=>s.context.stickIfOpenTimeout.disposeEffect(),[s]),s}function Y5({store:e,modal:t}){const s=e.useState("floatingRootContext"),i=sd(s,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),o=i.reference,l=i.floating;return Hp(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:l}),null}const G5=300;function Ok(e,t){function s(l,u,d){const f=l.currentTarget;hr.flushSync(()=>{e.setOpen(!1,ut(Fa,l.nativeEvent,f))}),z4(f.isConnected?f:t.current,u,d)?.focus()}function i(l){s(l,-1,e.select("positionerElement"))}function o(l){const u=e.select("positionerElement");u&&ql(l,u)?e.context.beforeContentFocusGuardRef.current?.focus():s(l,1,u)}return{handlePreFocusGuardFocus:i,handleFocusTargetFocus:o}}function $5(e){const t=b.useRef(""),s=b.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:b.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o?e(o,o.pointerType):e(o,t.current),t.current=""},[e]),onPointerDown:s}}function cc(e,t){const s=b.useRef(e),i=Be(t);_e(()=>{s.current!==e&&i(s.current),s.current=e},[e,i])}function lb(e,t){const s=Be((l,u)=>{(typeof e=="function"?e():e)||t(u||(yp?"touch":""))}),{onClick:i,onPointerDown:o}=$5(s);return b.useMemo(()=>({onClick:i,onPointerDown:o}),[i,o])}function Ak(e){const[t,s]=b.useState(null),i=lb(e,s);return cc(e,o=>{o&&!e&&s(null)}),b.useMemo(()=>({openMethod:t,triggerProps:i}),[t,i])}const Q5=gp(function(t,s){const{render:i,className:o,style:l,disabled:u=!1,nativeButton:d=!0,handle:f,payload:g,openOnHover:m=!1,delay:h=G5,closeDelay:x=0,id:S,...w}=t,C=cd(!0),R=Vp(f)??C;if(!R)throw new Error(gn(74));const k=ar(S),O=R.useState("isTriggerActive",k),A=R.useState("floatingRootContext"),N=R.useState("isOpenedByTrigger",k),j=R.useState("triggerPopupId",k),D=b.useRef(null),{registerTrigger:M,isMountedByThisTrigger:_}=zp(k,D,R,{payload:g,disabled:u,openOnHover:m,closeDelay:x}),L=R.useState("isPressOpenedByTrigger",k),q=R.useState("isTouchPressOpen",m),X=R.useState("hasTriggerFocusGuards",k),B=$v(A,{enabled:!u&&m&&!q,mouseOnly:!0,move:!1,handleClose:Qv(),restMs:h,delay:{close:x},triggerElementRef:D,isActiveTrigger:O,isClosing:()=>R.select("transitionStatus")==="ending"}),H=Be(()=>R.context.stickIfOpen),U=Dp(A,{stickIfOpen:H}),z=lb(()=>R.select("open"),W=>{R.set("openMethod",W)}),Q=R.useState("triggerProps",_),{getButtonProps:$,buttonRef:K}=vs({disabled:u,native:d}),Y={open(W){return L?_u.open(W):Ep.open(W)}},{handlePreFocusGuardFocus:ee,handleFocusTargetFocus:G}=Ok(R,D),I=kt("button",t,{state:{disabled:u,open:N},ref:[K,s,M,D],props:[U.reference,B,Q,z,{[Uv]:"",id:k,"aria-haspopup":"dialog","aria-expanded":N,"aria-controls":j},w,$],stateAttributesMapping:Y}),V=v.jsx(b.Fragment,{children:I},k);return X?v.jsxs(b.Fragment,{children:[v.jsx(Ba,{ref:R.context.beforeTriggerFocusGuardRef,onFocus:ee}),V,v.jsx(Ba,{ref:R.context.triggerFocusTargetRef,onFocus:G})]}):V}),Mk=b.createContext(void 0);function X5(){const e=b.useContext(Mk);if(e===void 0)throw new Error(gn(45));return e}const Z5=b.forwardRef(function(t,s){const{keepMounted:i=!1,...o}=t;return cd().useState("mounted")||i?v.jsx(Mk.Provider,{value:i,children:v.jsx(Mp,{ref:s,...o})}):null}),Nk=b.createContext(void 0);function J5(){const e=b.useContext(Nk);if(!e)throw new Error(gn(46));return e}const eg=b.forwardRef(function(t,s){const{cutout:i,...o}=t;let l;if(i){const u=i.getBoundingClientRect();l=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${u.left}px ${u.top}px,${u.left}px ${u.bottom}px,${u.right}px ${u.bottom}px,${u.right}px ${u.top}px,${u.left}px ${u.top}px)`}return v.jsx("div",{ref:s,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:l}})});function Dk(e){const{store:t,domReference:s,positionerElement:i,open:o}=e,l=b.useRef(null),u=b.useRef(null),d=jp(i);_e(()=>{o||(u.current?.abort(),u.current=null,t.state.instantType==="trigger-change"&&t.set("instantType",void 0))},[o,t]),_e(()=>{const f=s,g=l.current;if(f&&(l.current=f),!g||!f||f===g||!t.select("open"))return;t.set("instantType",void 0);const m=new AbortController;return u.current=m,d(()=>{t.select("open")&&t.set("instantType","trigger-change")},m.signal),()=>{m.abort()}},[s,d,t])}let CE={},TE={},kE="";function tg(e,t){return Ju(e)?e:t}function OE(e,t,s){return/hidden|clip/.test(e.getComputedStyle(tg(t,s)).overflowY)}function W5(e){if(typeof document>"u")return!1;const t=Qt(e);return Rn(t).innerWidth-t.documentElement.clientWidth>0}function ez(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const s=Qt(e),i=s.documentElement,o=s.body,l=tg(i,o),u=l.style.overflowY,d=i.style.scrollbarGutter;i.style.scrollbarGutter="stable",l.style.overflowY="scroll";const f=l.offsetWidth;l.style.overflowY="hidden";const g=l.offsetWidth;return l.style.overflowY=u,i.style.scrollbarGutter=d,f===g}function tz(e){const t=Qt(e),s=t.documentElement,i=t.body,o=tg(s,i),l={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,l)}}function nz(e){const t=Qt(e),s=t.documentElement,i=t.body,o=Rn(s);let l=0,u=0,d=!1;const f=Or.create();if(Si&&(o.visualViewport?.scale??1)!==1)return()=>{};function g(){const S=o.getComputedStyle(s),w=o.getComputedStyle(i),R=(S.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";l=s.scrollTop,u=s.scrollLeft,CE={scrollbarGutter:s.style.scrollbarGutter,overflowY:s.style.overflowY,overflowX:s.style.overflowX},kE=s.style.scrollBehavior,TE={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 k=s.scrollHeight>s.clientHeight,O=s.scrollWidth>s.clientWidth,A=S.overflowY==="scroll"||w.overflowY==="scroll",N=S.overflowX==="scroll"||w.overflowX==="scroll",j=Math.max(0,o.innerWidth-i.clientWidth),D=Math.max(0,o.innerHeight-i.clientHeight),M=parseFloat(w.marginTop)+parseFloat(w.marginBottom),_=parseFloat(w.marginLeft)+parseFloat(w.marginRight),L=tg(s,i);if(d=ez(e),d){s.style.scrollbarGutter=R,L.style.overflowY="hidden",L.style.overflowX="hidden";return}Object.assign(s.style,{scrollbarGutter:R,overflowY:"hidden",overflowX:"hidden"}),(k||A)&&(s.style.overflowY="scroll"),(O||N)&&(s.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:M||D?`calc(100dvh - ${M+D}px)`:"100dvh",width:_||j?`calc(100vw - ${_+j}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),i.scrollTop=l,i.scrollLeft=u,s.setAttribute("data-base-ui-scroll-locked",""),s.style.scrollBehavior="unset"}function m(){Object.assign(s.style,CE),Object.assign(i.style,TE),d||(s.scrollTop=l,s.scrollLeft=u,s.removeAttribute("data-base-ui-scroll-locked"),s.style.scrollBehavior=kE)}function h(){m(),f.request(g)}g();const x=Lt(o,"resize",h);return()=>{f.cancel(),m(),typeof o.removeEventListener=="function"&&x()}}class rz{lockCount=0;restore=null;timeoutLock=Ps.create();timeoutUnlock=Ps.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const s=Qt(t),i=s.documentElement,o=s.body,l=Rn(i);if(OE(l,i,o)){const d=new l.MutationObserver(()=>{OE(l,i,o)||(d.disconnect(),this.restore=null,this.lock(t))}),f={attributes:!0};d.observe(i,f),d.observe(o,f),this.restore=()=>d.disconnect();return}const u=yp||!W5(t);this.restore=u?tz(t):nz(t)}}const sz=new rz;function jk(e=!0,t=null){_e(()=>{if(e)return sz.acquire(t)},[e,t])}const iz=20;function cb(e,t,s,i){const[o,l]=b.useState(!1);_e(()=>{if(!e||!t||s==null){l(!1);return}const u=Qt(s).documentElement.clientWidth,d=s.offsetWidth;l(u>0&&d>0&&d>=u-iz)},[e,t,s]),jk(e&&(!t||o),i)}const az=b.forwardRef(function(t,s){const{render:i,className:o,style:l,anchor:u,positionMethod:d,side:f,align:g,sideOffset:m,alignOffset:h,collisionBoundary:x="clipping-ancestors",collisionPadding:S,arrowPadding:w,sticky:C,disableAnchorTracking:E=!1,collisionAvoidance:R=Hv,...k}=t,O=cd(),A=X5(),N=Bv(),j=O.useState("floatingRootContext"),D=O.useState("mounted"),M=O.useState("open"),_=O.useState("openChangeReason"),L=O.useState("activeTriggerElement"),q=O.useState("modal"),X=O.useState("openMethod"),B=O.useState("positionerElement"),H=O.useState("instantType"),U=O.useState("transitionStatus"),z=O.useState("adaptiveOrigin"),Q=Gp({anchor:u,floatingRootContext:j,positionMethod:d,mounted:D,side:f,sideOffset:m,align:g,alignOffset:h,arrowPadding:w,collisionBoundary:x,collisionPadding:S,sticky:C,disableAnchorTracking:E,keepMounted:A,nodeId:N,collisionAvoidance:R,adaptiveOrigin:z}),$=j.useState("domReferenceElement");Dk({store:O,domReference:$,positionerElement:B,open:M});const K=q===!0&&_!==Kn;cb(M&&K,X==="touch",B,L);const Y=O.useStateSetter("positionerElement"),ee={open:M,side:Q.side,align:Q.align,anchorHidden:Q.anchorHidden,instant:H},G=$p(t,ee,{styles:Q.positionerStyles,transitionStatus:U,props:k,refs:[s,Y],hidden:!D,inert:!M});return v.jsxs(Nk.Provider,{value:Q,children:[D&&K&&v.jsx(eg,{inert:Qp(!M),cutout:L}),v.jsx(jC,{id:N,children:G})]})}),Gy="ArrowUp",$y="ArrowDown",Qy="ArrowLeft",Xy="ArrowRight",Zy="Home",Jy="End",ud=new Set([Gy,$y,Qy,Xy,Zy,Jy]),Ik="Shift",oz=[Ik,"Control","Alt","Meta"];function lz(e){return bn(e)&&e.tagName==="INPUT"}function AE(e){return!!(lz(e)&&e.selectionStart!=null||bn(e)&&e.tagName==="TEXTAREA")}function ME(e,t,s,i){if(!e||!t||!t.scrollTo)return;let o=e.scrollLeft,l=e.scrollTop;const u=e.clientWidth<e.scrollWidth,d=e.clientHeight<e.scrollHeight;if(u&&i!=="vertical"){const f=NE(e,t,"left"),g=lh(e),m=lh(t);s==="ltr"&&(f+t.offsetWidth+m.scrollMarginRight>e.scrollLeft+e.clientWidth-g.scrollPaddingRight?o=f+t.offsetWidth+m.scrollMarginRight-e.clientWidth+g.scrollPaddingRight:f-m.scrollMarginLeft<e.scrollLeft+g.scrollPaddingLeft&&(o=f-m.scrollMarginLeft-g.scrollPaddingLeft)),s==="rtl"&&(f-m.scrollMarginLeft<e.scrollLeft+g.scrollPaddingLeft?o=f-m.scrollMarginLeft-g.scrollPaddingLeft:f+t.offsetWidth+m.scrollMarginRight>e.scrollLeft+e.clientWidth-g.scrollPaddingRight&&(o=f+t.offsetWidth+m.scrollMarginRight-e.clientWidth+g.scrollPaddingRight))}if(d&&i!=="horizontal"){const f=NE(e,t,"top"),g=lh(e),m=lh(t);f-m.scrollMarginTop<e.scrollTop+g.scrollPaddingTop?l=f-m.scrollMarginTop-g.scrollPaddingTop:f+t.offsetHeight+m.scrollMarginBottom>e.scrollTop+e.clientHeight-g.scrollPaddingBottom&&(l=f+t.offsetHeight+m.scrollMarginBottom-e.clientHeight+g.scrollPaddingBottom)}e.scrollTo({left:o,top:l,behavior:"auto"})}function NE(e,t,s){const i=s==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[i],t.offsetParent!==e);)t=t.offsetParent;return o}function lh(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const cz=b.createContext(void 0);function ng(e){return b.useContext(cz)}const uz=b.createContext(void 0);function dz(){const[e,t]=b.useState(0),s=Be(()=>(t(o=>o+1),()=>{t(o=>Math.max(0,o-1))}));return{context:b.useMemo(()=>({register:s}),[s]),hasClosePart:e>0}}const fz=b.forwardRef(function(t,s){const{render:i,className:o,style:l,initialFocus:u,finalFocus:d,...f}=t,g=cd(),m=J5(),h=ng()!=null,{context:x,hasClosePart:S}=dz(),w=g.useState("open"),C=g.useState("openMethod"),E=g.useState("instantType"),R=g.useState("transitionStatus"),k=g.useState("popupProps"),O=g.useState("titleElementId"),A=g.useState("descriptionElementId"),N=g.useState("modal"),j=g.useState("mounted"),D=g.useState("openChangeReason"),M=g.useState("activeTriggerElement"),_=g.useState("floatingRootContext"),L=_.useState("floatingId"),q=g.useState("disabled"),X=g.useState("openOnHover"),B=g.useState("closeDelay");Ls({open:w,ref:g.context.popupRef,onComplete(){w&&g.context.onOpenChangeComplete?.(!0)}}),Gv(_,{enabled:X&&!q,closeDelay:B});const H=u===void 0?zC(g.context.popupRef):u,U=N!==!1&&S;g.useSyncedValue("focusManagerModal",U);const z=g.useStateSetter("popupElement"),Q={open:w,side:m.side,align:m.align,instant:E,transitionStatus:R},$=kt("div",t,{state:Q,ref:[s,g.context.popupRef,z],props:[k,{id:L,role:"dialog",...id,"aria-labelledby":O,"aria-describedby":A,onKeyDown(K){h&&ud.has(K.key)&&K.stopPropagation()}},od(R),f],stateAttributesMapping:Rp});return v.jsx(Np,{context:_,openInteractionType:C,modal:U,disabled:!j||D===Kn,initialFocus:H,returnFocus:d,restoreFocus:"popup",getInsideElements:()=>[g.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:bn(M)?M:void 0,nextFocusableElement:g.context.triggerFocusTargetRef,beforeContentFocusGuardRef:g.context.beforeContentFocusGuardRef,children:v.jsx(uz.Provider,{value:x,children:$})})});function ub({...e}){return v.jsx(K5,{"data-slot":"popover",...e})}function Pk({...e}){return v.jsx(Q5,{"data-slot":"popover-trigger",...e})}function db({anchor:e,align:t="center",alignOffset:s=0,side:i="bottom",sideOffset:o=4,className:l,...u}){return v.jsx(Z5,{children:v.jsx(az,{anchor:e,className:"isolate z-50 outline-none",align:t,alignOffset:s,side:i,sideOffset:o,children:v.jsx(fz,{"data-slot":"popover-content",className:Fe("z-50 w-72 origin-(--transform-origin) rounded-lg bg-popover p-4 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",l),...u})})})}const Lk=b.createContext(void 0),Nr=e=>{const t=b.useContext(Lk);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},hz=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(Lk.Provider,{value:e,children:t})),pz={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var gz=class{#e=pz;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};const Ao=new gz;function mz(e){setTimeout(e,0)}const yz=typeof window>"u"||"Deno"in globalThis;function Fr(){}function vz(e,t){return typeof e=="function"?e(t):e}function zk(e){return typeof e=="number"&&e>=0&&e!==1/0}function _k(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Pn(e,t){return typeof e=="function"?e(t):e}function DE(e,t){const{type:s="all",exact:i,fetchStatus:o,predicate:l,queryKey:u,stale:d}=e;if(u){if(i){if(t.queryHash!==fb(u,t.options))return!1}else if(!sc(t.queryKey,u))return!1}if(s!=="all"){const f=t.isActive();if(s==="active"&&!f||s==="inactive"&&f)return!1}return!(typeof d=="boolean"&&t.isStale()!==d||o&&o!==t.state.fetchStatus||l&&!l(t))}function jE(e,t){const{exact:s,status:i,predicate:o,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(s){if(Lo(t.options.mutationKey)!==Lo(l))return!1}else if(!sc(t.options.mutationKey,l))return!1}return!(i&&t.state.status!==i||o&&!o(t))}function fb(e,t){return(t?.queryKeyHashFn||Lo)(e)}function Lo(e){return JSON.stringify(e,(t,s)=>Wy(s)?Object.keys(s).sort().reduce((i,o)=>(i[o]=s[o],i),{}):s)}function sc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let i=0;i<t.length;i++)if(!sc(e[i],t[i]))return!1;return!0}const s=Object.keys(t);for(const i of s)if(!sc(e[i],t[i]))return!1;return!0}return!1}const bz=Object.prototype.hasOwnProperty;function hb(e,t,s=0){if(e===t)return e;if(s>500)return t;const i=IE(e)&&IE(t);if(!i&&!(Wy(e)&&Wy(t)))return t;const o=(i?e:Object.keys(e)).length,l=i?t:Object.keys(t),u=l.length,d=i?new Array(u):{};let f=0;for(let g=0;g<u;g++){const m=i?g:l[g],h=e[m],x=t[m];if(h===x){d[m]=h,(i?g<o:bz.call(e,m))&&f++;continue}if(h===null||x===null||typeof h!="object"||typeof x!="object"){d[m]=x;continue}const S=hb(h,x,s+1);d[m]=S,S===h&&f++}return o===u&&f===o?e:d}function Oh(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function IE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Wy(e){if(!PE(e))return!1;const t=Object.getPrototypeOf(e),s=t?.constructor;if(s===void 0)return!0;if(typeof s!="function")return!1;const i=s.prototype;return!(!PE(i)||!i.hasOwnProperty("isPrototypeOf")||t!==Object.prototype)}function PE(e){return Object.prototype.toString.call(e)==="[object Object]"}function xz(e){return new Promise(t=>{Ao.setTimeout(t,e)})}function ev(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?hb(e,t):t}function Sz(e,t,s=0){const i=[...e,t];return s&&i.length>s?i.slice(1):i}function wz(e,t,s=0){const i=[t,...e];return s&&i.length>s?i.slice(0,-1):i}const pb=Symbol();function Uk(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===pb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function gb(e,t){return typeof e=="function"?e(...t):!!e}function Ez(e,t,s){let i=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),i||(i=!0,o.aborted?s():o.addEventListener("abort",s,{once:!0})),o)}),e}let Rz=()=>yz;const mb=()=>Rz();var uc=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(){}},Cz=class extends uc{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}};const yb=new Cz,Tz=mz;function kz(){let e=[],t=0,s=d=>{d()},i=d=>{d()},o=Tz;const l=d=>{t?e.push(d):o(()=>{s(d)})},u=()=>{const d=e;e=[],d.length&&o(()=>{i(()=>{d.forEach(f=>{s(f)})})})};return{batch:d=>{let f;t++;try{f=d()}finally{t--,t||u()}return f},batchCalls:d=>(...f)=>{l(()=>{d(...f)})},schedule:l,setNotifyFunction:d=>{s=d},setBatchNotifyFunction:d=>{i=d},setScheduler:d=>{o=d}}}const Wn=kz();var Oz=class extends uc{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};const np=new Oz;function Az(e){return Math.min(1e3*2**e,3e4)}function Hk(e){return(e??"online")==="online"?np.isOnline():!0}var tv=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Fk(e){let t=!1,s=0,i,o="pending",l,u;const d=new Promise((k,O)=>{l=k,u=O});d.catch(Fr);const f=()=>o!=="pending",g=k=>{if(!f()){const O=new tv(k);C(O),e.onCancel?.(O)}},m=()=>{t=!0},h=()=>{t=!1},x=()=>yb.isFocused()&&(e.networkMode==="always"||np.isOnline())&&e.canRun(),S=()=>Hk(e.networkMode)&&e.canRun(),w=k=>{f()||(i?.(),o="resolved",l(k))},C=k=>{f()||(i?.(),o="rejected",u(k))},E=k=>new Promise(O=>{i=A=>{(f()||k())&&O(A)},e.onPause?.()}).then(()=>{i=void 0,f()||e.onContinue?.()}),R=()=>{if(f())return;let k;const O=s===0?e.initialPromise:void 0;try{k=O??e.fn()}catch(A){k=Promise.reject(A)}Promise.resolve(k).then(w).catch(A=>{if(f())return;const N=e.retry??(mb()?0:3),j=e.retryDelay??Az,D=typeof j=="function"?j(s,A):j,M=N===!0||typeof N=="number"&&s<N||typeof N=="function"&&N(s,A);if(t||!M){C(A);return}s++,e.onFail?.(s,A),xz(D).then(()=>x()?void 0:E(x)).then(()=>{t?C(A):R()})})};return{promise:d,status:()=>o,cancel:g,continue:()=>(i?.(),d),cancelRetry:m,continueRetry:h,canStart:S,start:()=>(S()?R():E(S).then(R),d)}}var Bk=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),zk(this.gcTime)&&(this.#e=Ao.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(mb()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Ao.clearTimeout(this.#e),this.#e=void 0)}};function Mz(e){return{onFetch:(t,s)=>{const i=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,l=t.state.data?.pages||[],u=t.state.data?.pageParams||[];let d={pages:[],pageParams:[]},f=0;const g=async()=>{let m=!1;const h=w=>{Ez(w,()=>t.signal,()=>m=!0)},x=Uk(t.options,t.fetchOptions),S=async(w,C,E)=>{if(m)return Promise.reject(t.signal.reason);if(C==null&&w.pages.length)return Promise.resolve(w);const k=(()=>{const j={client:t.client,queryKey:t.queryKey,pageParam:C,direction:E?"backward":"forward",meta:t.options.meta};return h(j),j})(),O=await x(k),{maxPages:A}=t.options,N=E?wz:Sz;return{pages:N(w.pages,O,A),pageParams:N(w.pageParams,C,A)}};if(o&&l.length){const w=o==="backward",C=w?Nz:LE,E={pages:l,pageParams:u};d=await S(E,C(i,E),w)}else{const w=e??l.length;do{const C=f===0?u[0]===void 0?i.initialPageParam:u[0]:LE(i,d);if(f>0&&C==null)break;d=await S(d,C),f++}while(f<w)}return d};t.options.persister?t.fetchFn=()=>t.options.persister?.(g,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=g}}}function LE(e,{pages:t,pageParams:s}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,s[i],s):void 0}function Nz(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var Dz=class extends Bk{#e;#t;#n;#r;#i;#s;#a;#l;constructor(e){super(),this.#l=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=_E(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#s?.promise}setOptions(e){if(this.options={...this.#a,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=_E(this.options);t.data!==void 0&&(this.setState(zE(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const s=ev(this.state.data,e,this.options);return this.#o({data:s,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),s}setState(e){this.#o({type:"setState",state:e})}cancel(e){const t=this.#s?.promise;return this.#s?.cancel(e),t?t.then(Fr).catch(Fr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Pn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===pb||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Pn(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!_k(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){const t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#s&&(this.#l||this.state.fetchStatus==="paused"&&this.state.status==="pending"?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(g=>g.options.queryFn);f&&this.setOptions(f.options)}const s=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#l=!0,s.signal)})},o=()=>{const f=Uk(this.options,t),m=(()=>{const h={client:this.#i,queryKey:this.queryKey,meta:this.meta};return i(h),h})();return this.#l=!1,this.options.persister?this.options.persister(f,m,this):f(m)},u=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:o};return i(f),f})();(this.#e==="infinite"?Mz(this.options.pages):this.options.behavior)?.onFetch(u,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#o({type:"fetch",meta:u.fetchOptions?.meta});const d=this.#s=Fk({initialPromise:t?.initialPromise,fn:u.fetchFn,onCancel:f=>{f instanceof tv&&f.revert&&this.setState({...this.#n,fetchStatus:"idle"}),s.abort()},onFail:(f,g)=>{this.#o({type:"failed",failureCount:f,error:g})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{const f=await d.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#r.config.onSuccess?.(f,this),this.#r.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof tv){if(f.silent)return this.#s.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#o({type:"error",error:f}),this.#r.config.onError?.(f,this),this.#r.config.onSettled?.(this.state.data,f,this),f}finally{this.#s===d&&(this.#s=void 0),this.scheduleGc()}}#o(e){const t=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...Vk(s.data,this.options),fetchMeta:e.meta??null};case"success":const i={...s,...zE(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?i:void 0,i;case"error":const o=e.error;return{...s,error:o,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=t(this.state),Wn.batch(()=>{this.observers.slice().forEach(s=>{s.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function Vk(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Hk(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function zE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function _E(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,i=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var jz=class extends uc{#e;#t=void 0;#n=void 0;#r=void 0;#i;#s;#a;#l;#o;#h;#u;#d;#c;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#a=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),UE(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return nv(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return nv(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Pn(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),t._defaulted&&!Oh(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&HE(this.#t,s,this.options,t)&&this.#f(),this.updateResult(),i&&(this.#t!==s||Pn(this.options.enabled,this.#t)!==Pn(t.enabled,this.#t)||Pn(this.options.staleTime,this.#t)!==Pn(t.staleTime,this.#t))&&this.#m();const o=this.#y();i&&(this.#t!==s||Pn(this.options.enabled,this.#t)!==Pn(t.enabled,this.#t)||o!==this.#c)&&this.#v(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),s=this.createResult(t,e);return Oh(this.getCurrentResult(),s)||(this.#r=s,this.#s=this.options,this.#i=this.#t.state),s}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(s,i)=>(this.trackProp(i),t?.(i),Reflect.get(s,i))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),s=this.#e.getQueryCache().build(this.#e,t);let i=()=>{},o;const l=new Promise(u=>{o=u,i=this.#e.getQueryCache().subscribe(d=>{d.type==="updated"&&d.query.queryHash===s.queryHash&&s.state.data!==void 0&&(i(),u(this.createResult(s,t)))})});return Promise.race([s.fetch(t).then(()=>{const u=this.createResult(s,t);return o?.(u),u}).finally(()=>{i()}),l])}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#f(e){this.#w();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Fr)),t}#g(e){return!mb()&&Pn(this.options.enabled,this.#t)!==!1&&zk(e)}#m(){this.#x();const e=Pn(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#g(e))return;const t=_k(this.#r.dataUpdatedAt,e)+1;this.#u=Ao.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#y(){return Pn(this.options.refetchInterval,this.#t)??!1}#v(e){this.#S(),this.#c=e,!(this.#c===0||!this.#g(this.#c))&&(this.#d=Ao.setInterval(()=>{(this.options.refetchIntervalInBackground||yb.isFocused())&&this.#f()},this.#c))}#b(){this.#m(),this.#v(this.#y())}#x(){this.#u!==void 0&&(Ao.clearTimeout(this.#u),this.#u=void 0)}#S(){this.#d!==void 0&&(Ao.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){const s=this.#t,i=this.options,o=this.#r,l=this.#i,u=this.#s,d=e!==s?e.state:this.#n,{state:f}=e;let g={...f},m=!1,h;if(t._optimisticResults){const N=this.hasListeners(),j=!N&&UE(e,t),D=N&&HE(e,s,t,i);(j||D)&&(g={...g,...Vk(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:x,errorUpdatedAt:S,status:w}=g;h=g.data;let C=!1;if(t.placeholderData!==void 0&&h===void 0&&w==="pending"){let N;o?.isPlaceholderData&&t.placeholderData===u?.placeholderData?(N=o.data,C=!0):N=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,N!==void 0&&(w="success",h=ev(o?.data,N,t),m=!0)}if(t.select&&h!==void 0&&!C)if(o&&h===l?.data&&t.select===this.#l)h=this.#o;else try{this.#l=t.select,h=t.select(h),h=ev(o?.data,h,t),this.#o=h,this.#a=null}catch(N){this.#a=N}else h===void 0&&(this.#a=null);this.#a&&(x=this.#a,h=this.#o,S=Date.now(),w="error",m=!1);const E=g.fetchStatus==="fetching",R=w==="pending",k=w==="error",O=R&&E,A=h!==void 0;return{status:w,fetchStatus:g.fetchStatus,isPending:R,isSuccess:w==="success",isError:k,isInitialLoading:O,isLoading:O,data:h,dataUpdatedAt:g.dataUpdatedAt,error:x,errorUpdatedAt:S,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:g.dataUpdateCount>d.dataUpdateCount||g.errorUpdateCount>d.errorUpdateCount,isFetching:E,isRefetching:E&&!R,isLoadingError:k&&!A,isPaused:g.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:k&&A,isStale:vb(e,t),refetch:this.refetch,isEnabled:Pn(t.enabled,e)!==!1}}updateResult(){const e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#s=this.options,this.#i.data!==void 0&&(this.#h=this.#t),Oh(t,e))return;this.#r=t;const i=(()=>{if(!e)return!0;const{notifyOnChangeProps:o}=this.options,l=typeof o=="function"?o():o;if(l==="all"||!l&&!this.#p.size)return!0;const u=new Set(l??this.#p);return this.options.throwOnError&&u.add("error"),Object.keys(this.#r).some(d=>{const f=d;return this.#r[f]!==e[f]&&u.has(f)})})();Wn.batch(()=>{i&&this.listeners.forEach(o=>{o(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}};function Iz(e,t){return Pn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Pn(t.retryOnMount,e)===!1)}function UE(e,t){return Iz(e,t)||e.state.data!==void 0&&nv(e,t,t.refetchOnMount)}function nv(e,t,s){if(Pn(t.enabled,e)!==!1&&Pn(t.staleTime,e)!=="static"){const i=Pn(s,e);return i==="always"||i!==!1&&vb(e,t)}return!1}function HE(e,t,s,i){return(e!==t||Pn(i.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&vb(e,s)}function vb(e,t){return Pn(t.enabled,e)!==!1&&e.isStaleByTime(Pn(t.staleTime,e))}var Pz=class extends Bk{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Kk(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(e){const t=()=>{this.#i({type:"continue"})},s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},i=this.#r=Fk({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(u,d)=>{this.#i({type:"failed",failureCount:u,error:d})},onPause:()=>{this.#i({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),o=this.state.status==="pending",l=!i.canStart();try{if(o)t();else{this.#i({type:"pending",variables:e,isPaused:l}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,s);const d=await this.options.onMutate?.(e,s);d!==this.state.context&&this.#i({type:"pending",context:d,variables:e,isPaused:l})}const u=await i.start();return await this.#n.config.onSuccess?.(u,e,this.state.context,this,s),await this.options.onSuccess?.(u,e,this.state.context,s),await this.#n.config.onSettled?.(u,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(u,null,e,this.state.context,s),this.#i({type:"success",data:u}),u}catch(u){try{await this.#n.config.onError?.(u,e,this.state.context,this,s)}catch(d){Promise.reject(d)}try{await this.options.onError?.(u,e,this.state.context,s)}catch(d){Promise.reject(d)}try{await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,s)}catch(d){Promise.reject(d)}try{await this.options.onSettled?.(void 0,u,e,this.state.context,s)}catch(d){Promise.reject(d)}throw this.#i({type:"error",error:u}),u}finally{this.#r===i&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){const t=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Wn.batch(()=>{this.#t.forEach(s=>{s.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Kk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Lz=class extends uc{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,s){const i=new Pz({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:s});return this.add(i),i}add(e){this.#e.add(e);const t=ch(e);if(typeof t=="string"){const s=this.#t.get(t);s?s.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=ch(e);if(typeof t=="string"){const s=this.#t.get(t);if(s)if(s.length>1){const i=s.indexOf(e);i!==-1&&s.splice(i,1)}else s[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=ch(e);if(typeof t=="string"){const s=this.#t.get(t)?.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){const t=ch(e);return typeof t=="string"?this.#t.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Wn.batch(()=>{const e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(t=>{this.notify({type:"removed",mutation:t})})})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(s=>jE(t,s))}findAll(e={}){return this.getAll().filter(t=>jE(e,t))}notify(e){Wn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Wn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Fr))))}};function ch(e){return e.options.scope?.id}var zz=class extends uc{#e;#t=void 0;#n;#r;constructor(t,s){super(),this.#e=t,this.setOptions(s),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#e.defaultMutationOptions(t),Oh(this.options,s)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),s?.mutationKey&&this.options.mutationKey&&Lo(s.mutationKey)!==Lo(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#i(),this.#s(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#s()}mutate(t,s){return this.#r=s,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#i(){const t=this.#n?.state??Kk();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#s(t){Wn.batch(()=>{const s=this.#r;if(s&&this.hasListeners()){const i=this.#t.variables,o=this.#t.context,l={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{s.onSuccess?.(t.data,i,o,l)}catch(u){Promise.reject(u)}try{s.onSettled?.(t.data,null,i,o,l)}catch(u){Promise.reject(u)}}else if(t?.type==="error"){try{s.onError?.(t.error,i,o,l)}catch(u){Promise.reject(u)}try{s.onSettled?.(void 0,t.error,i,o,l)}catch(u){Promise.reject(u)}}}this.listeners.forEach(i=>{i(this.#t)})})}},qk=class extends uc{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,s){const i=t.queryKey,o=t.queryHash??fb(i,t);let l=this.get(o);return l||(l=new Dz({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(i)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Wn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(s=>DE(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>DE(e,s)):t}notify(e){Wn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Wn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Wn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},_z=class{#e;#t;#n;#r;#i;#s;#a;#l;constructor(e={}){this.#e=e.queryCache||new qk,this.#t=e.mutationCache||new Lz,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#a=yb.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=np.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#a?.(),this.#a=void 0,this.#l?.(),this.#l=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=this.#e.build(this,t),i=s.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(Pn(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:s})=>[t,s.data])}setQueryData(e,t,s){const i=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(i.queryHash)?.state.data,l=vz(t,o);if(l!==void 0)return this.#e.build(this,i).setData(l,{...s,manual:!0})}setQueriesData(e,t,s){return Wn.batch(()=>this.#e.findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,s)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Wn.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=this.#e;return Wn.batch(()=>{const i=s.findAll(e),o=new Set(i);return i.forEach(l=>{l.reset()}),this.refetchQueries({type:"active",predicate:l=>o.has(l)},t)})}cancelQueries(e,t={}){const s={revert:!0,...t},i=Wn.batch(()=>this.#e.findAll(e).map(o=>o.cancel(s)));return Promise.all(i).then(Fr).catch(Fr)}invalidateQueries(e,t={}){return Wn.batch(()=>(this.#e.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},i=Wn.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let l=o.fetch(void 0,s);return s.throwOnError||(l=l.catch(Fr)),o.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(i).then(Fr)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=this.#e.build(this,t),i=s.isStaleByTime(Pn(t.staleTime,s))?await s.fetch(t):s.state.data,o=t.select;return o?o(i):i}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=this.#e.build(this,t);return s.isStaleByTime(Pn(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Fr).catch(Fr)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Fr).catch(Fr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return np.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Lo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],s={};return t.forEach(i=>{sc(e,i.queryKey)&&Object.assign(s,i.defaultOptions)}),s}setMutationDefaults(e,t){this.#i.set(Lo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#i.values()],s={};return t.forEach(i=>{sc(e,i.mutationKey)&&Object.assign(s,i.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=fb(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===pb&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};const Yk=b.createContext(!1),Uz=()=>b.useContext(Yk);Yk.Provider;function Hz(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const Fz=b.createContext(Hz()),Bz=()=>b.useContext(Fz),Vz=(e,t,s)=>{const i=s?.state.status==="error"&&typeof e.throwOnError=="function"?gb(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||i)&&(t.isReset()||(e.retryOnMount=!1))},Kz=e=>{b.useEffect(()=>{e.clearReset()},[e])},qz=({result:e,errorResetBoundary:t,throwOnError:s,query:i,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(o&&e.data===void 0||gb(s,[e.error,i])),Yz=e=>{if(e.suspense){const s=o=>o==="static"?o:Math.max(o??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...o)=>s(i(...o)):s(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Gz=(e,t)=>e?.suspense&&t.isPending,$z=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function Qz(e,t,s){const i=Uz(),o=Bz(),l=Nr(s),u=l.defaultQueryOptions(e),d=l.getQueryCache().get(u.queryHash),f=e.subscribed!==!1;u._optimisticResults=i?"isRestoring":f?"optimistic":void 0,Yz(u),Vz(u,o,d),Kz(o);const[g]=b.useState(()=>new t(l,u)),m=g.getOptimisticResult(u),h=!i&&f;if(b.useSyncExternalStore(b.useCallback(x=>{const S=h?g.subscribe(Wn.batchCalls(x)):Fr;return g.updateResult(),S},[g,h]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),b.useEffect(()=>{g.setOptions(u)},[u,g]),Gz(u,m))throw $z(u,g,o);if(qz({result:m,errorResetBoundary:o,throwOnError:u.throwOnError,query:d,suspense:u.suspense}))throw m.error;return u.notifyOnChangeProps?m:g.trackResult(m)}function na(e,t){return Qz(e,jz,t)}function rg(e,t){const s=Nr(t);return Zz({filters:{...e,status:"pending"}},s).length}function Xz(){let e;return(t,s)=>{let i=[],o;return()=>{const l=t.findAll(s.filters),u=l.flatMap(d=>[d,d.state]);return(!o||u.length!==i.length||u.some((d,f)=>!Object.is(d,i[f])))&&(i=u,o=hb(e,l.map(d=>s.select?s.select(d):d.state)),e=o),o}}}function Zz(e={},t){const s=Nr(t).getMutationCache(),[i]=b.useState(()=>Xz()),o=i(s,e);return b.useSyncExternalStore(b.useCallback(l=>s.subscribe(Wn.batchCalls(l)),[s]),o,o)}function er(e,t){const s=Nr(t),[i]=b.useState(()=>new zz(s,e));b.useEffect(()=>{i.setOptions(e)},[i,e]);const o=b.useSyncExternalStore(b.useCallback(u=>i.subscribe(Wn.batchCalls(u)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),l=b.useCallback((...u)=>{i.mutate(u[0],u[1]).catch(Fr)},[i]);if(o.error&&gb(i.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:l,mutateAsync:o.mutate}}const dd="/api/settings";function Jz(e){return dc({signal:e})}function Wz(e){return dc({method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}function e_(){return dc({method:"POST"},`${dd}/config-folder/open`)}function t_(e){return dc({signal:e},`${dd}/skill-copy`)}function n_(e){return dc({method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)},`${dd}/skill-copy`)}function r_(e){return dc({signal:e},`${dd}/skill-status`)}async function dc(e,t=dd){const s=await fetch(t,e);if(!s.ok)throw new Error(await s_(s));return s.json()}async function s_(e){try{return(await e.json()).error?.message??`Request failed with status ${e.status}`}catch{return`Request failed with status ${e.status}`}}const Gk=["skill-status"];function i_(){return na({queryKey:Gk,queryFn:({signal:e})=>r_(e),retry:!1})}const py=768;function bb(){const[e,t]=b.useState(void 0);return b.useEffect(()=>{const s=window.matchMedia(`(max-width: ${py-1}px)`),i=()=>{t(window.innerWidth<py)};return s.addEventListener("change",i),t(window.innerWidth<py),()=>s.removeEventListener("change",i)},[]),!!e}const a_={agents:"statusBar.targetAgents",claude:"statusBar.targetClaude"},o_={missing:"statusBar.statusMissing",outdated:"statusBar.statusOutdated",current:"statusBar.statusCurrent"},rv={missing:"text-red-600 dark:text-red-400",outdated:"text-amber-600 dark:text-amber-400",current:"text-emerald-600 dark:text-emerald-400"},$k={missing:fL,outdated:sb,current:vT};function l_(){const{t:e}=pt(),t=bb(),s=b.useRef(null),[i,o]=b.useState(!1),l=i_(),u=l.data?.targets??[],d=u.length>0?u_(u):void 0,f=d?$k[d]:void 0,g=u.filter(({status:h})=>h!=="current"),m=`foundry settings download-skill --target ${g.map(({target:h})=>h==="agents"?".agents":".claude").join(",")}`;return v.jsxs("div",{ref:s,"data-slot":"skill-status-bar",className:`
13
+ fixed inset-x-0 bottom-0 z-20 flex h-6 items-center justify-between
14
+ gap-3 border-t bg-background/95 px-3 text-[11px] text-muted-foreground
15
+ backdrop-blur-sm
16
+ `,children:[v.jsx("span",{"data-slot":"skill-status-version",className:"min-w-0 truncate",children:l.data?e("statusBar.foundryVersion",{version:l.data.version}):e("statusBar.foundry")}),v.jsxs(ub,{open:i,onOpenChange:o,children:[v.jsxs(Pk,{openOnHover:!t,delay:120,"aria-label":e("statusBar.skillStatus"),className:`
17
+ flex h-5 cursor-pointer items-center gap-1.5 rounded-sm px-1.5
18
+ outline-none
19
+ hover:bg-muted hover:text-foreground
20
+ focus-visible:ring-2 focus-visible:ring-ring/50
21
+ `,children:[v.jsx("span",{children:e("statusBar.skill")}),l.isPending&&v.jsx("span",{className:`
22
+ size-1.5 animate-pulse rounded-full bg-muted-foreground
23
+ `}),l.isError&&v.jsx(sb,{className:`
24
+ size-3 text-amber-600
25
+ dark:text-amber-400
26
+ `}),f&&d&&v.jsx(f,{className:`
27
+ size-3
28
+ ${rv[d]}
29
+ `})]}),v.jsx(db,{anchor:t?s:void 0,side:"top",align:t?"center":"end",sideOffset:8,className:`
30
+ w-[calc(100vw-2rem)] max-w-[calc(100vw-2rem)]
31
+ md:w-116
32
+ `,children:v.jsxs("div",{className:"flex flex-col gap-3",children:[l.isPending&&v.jsx("p",{className:"text-xs text-muted-foreground",children:e("statusBar.skillChecking")}),l.isError&&v.jsx("p",{className:`
33
+ text-xs text-amber-600
34
+ dark:text-amber-400
35
+ `,children:e("statusBar.skillUnavailable")}),u.length>0&&v.jsx("div",{className:"flex flex-col gap-3",children:u.map(h=>v.jsx(c_,{...h},h.target))}),g.length>0&&v.jsxs("div",{className:"flex flex-col gap-1.5",children:[v.jsx("p",{className:"text-[11px] text-muted-foreground",children:v.jsx(Wp,{i18nKey:"statusBar.skillRefreshHint",components:{settings:v.jsx("a",{href:"#/settings?panel=advanced",onClick:()=>o(!1),className:`
36
+ font-medium text-foreground underline
37
+ underline-offset-2
38
+ `})}})}),v.jsxs(D5,{size:"sm",children:[v.jsxs(j5,{children:[v.jsxs(I5,{children:[v.jsx(ML,{}),e("statusBar.terminal")]}),v.jsx(P5,{children:v.jsx(L5,{value:m,"aria-label":e("statusBar.copyCommand")})})]}),v.jsx(z5,{wrap:!0,children:m})]})]})]})})]})]})}function c_({target:e,status:t,destination:s}){const{t:i}=pt(),o=$k[t];return v.jsxs("div",{className:"flex flex-col gap-1",children:[v.jsxs("div",{className:"flex items-center justify-between gap-2",children:[v.jsxs("span",{className:`
39
+ flex items-center gap-1.5 text-xs font-medium text-foreground
40
+ `,children:[v.jsx(o,{className:`
41
+ size-3
42
+ ${rv[t]}
43
+ `}),i(a_[e])]}),v.jsx("span",{className:`
44
+ text-[11px]
45
+ ${rv[t]}
46
+ `,children:i(o_[t])})]}),v.jsx("code",{className:"font-mono text-[11px] break-all text-muted-foreground",children:s})]})}function u_(e){return e.some(({status:t})=>t==="missing")?"missing":e.some(({status:t})=>t==="outdated")?"outdated":"current"}var Qk=e=>{throw TypeError(e)},Xk=(e,t,s)=>t.has(e)||Qk("Cannot "+s),Ms=(e,t,s)=>(Xk(e,t,"read from private field"),s?s.call(e):t.get(e)),wu=(e,t,s)=>t.has(e)?Qk("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),hi=(e,t,s,i)=>(Xk(e,t,"write to private field"),t.set(e,s),s),sg=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,ig=/^[\\/]{2}/;function Zk(e,t){return t+e.replace(/\\/g,"/")}var FE="popstate";function BE(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function d_(e={}){function t(o,l){let{pathname:u="/",search:d="",hash:f=""}=ei(o.location.hash.substring(1));return!u.startsWith("/")&&!u.startsWith(".")&&(u="/"+u),Hu("",{pathname:u,search:d,hash:f},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function s(o,l){let u=o.document.querySelector("base"),d="";if(u&&u.getAttribute("href")){let f=o.location.href,g=f.indexOf("#");d=g===-1?f:f.slice(0,g)}return d+"#"+(typeof l=="string"?l:Br(l))}function i(o,l){Hn(o.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(l)})`)}return h_(t,s,i,e)}function _t(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Hn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function f_(){return Math.random().toString(36).substring(2,10)}function VE(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Hu(e,t,s=null,i,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ei(t):t,state:s,key:t&&t.key||i||f_(),mask:o}}function Br({pathname:e="/",search:t="",hash:s=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),s&&s!=="#"&&(e+=s.charAt(0)==="#"?s:"#"+s),e}function ei(e){let t={};if(e){let s=e.indexOf("#");s>=0&&(t.hash=e.substring(s),e=e.substring(0,s));let i=e.indexOf("?");i>=0&&(t.search=e.substring(i),e=e.substring(0,i)),e&&(t.pathname=e)}return t}function h_(e,t,s,i={}){let{window:o=document.defaultView,v5Compat:l=!1}=i,u=o.history,d="POP",f=null,g=m();g==null&&(g=0,u.replaceState({...u.state,idx:g},""));function m(){return(u.state||{idx:null}).idx}function h(){d="POP";let E=m(),R=E==null?null:E-g;g=E,f&&f({action:d,location:C.location,delta:R})}function x(E,R){d="PUSH";let k=BE(E)?E:Hu(C.location,E,R);s&&s(k,E),g=m()+1;let O=VE(k,g),A=C.createHref(k.mask||k);try{u.pushState(O,"",A)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;o.location.assign(A)}l&&f&&f({action:d,location:C.location,delta:1})}function S(E,R){d="REPLACE";let k=BE(E)?E:Hu(C.location,E,R);s&&s(k,E),g=m();let O=VE(k,g),A=C.createHref(k.mask||k);u.replaceState(O,"",A),l&&f&&f({action:d,location:C.location,delta:0})}function w(E){return Jk(o,E)}let C={get action(){return d},get location(){return e(o,u)},listen(E){if(f)throw new Error("A history only accepts one active listener");return o.addEventListener(FE,h),f=E,()=>{o.removeEventListener(FE,h),f=null}},createHref(E){return t(o,E)},createURL:w,encodeLocation(E){let R=w(E);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:x,replace:S,go(E){return u.go(E)}};return C}function Jk(e,t,s=!1){let i="http://localhost";e&&(i=e.location.origin!=="null"?e.location.origin:e.location.href),_t(i,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:Br(t);return o=o.replace(/ $/,"%20"),!s&&ig.test(o)&&(o=i+o),new URL(o,i)}var Eu,KE=class{constructor(e){if(wu(this,Eu,new Map),e)for(let[t,s]of e)this.set(t,s)}get(e){if(Ms(this,Eu).has(e))return Ms(this,Eu).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Ms(this,Eu).set(e,t)}};Eu=new WeakMap;var p_=new Set(["lazy","caseSensitive","path","id","index","children"]);function g_(e){return p_.has(e)}var m_=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function y_(e){return m_.has(e)}function v_(e){return e.index===!0}function Fu(e,t,s=[],i={},o=!1){return e.map((l,u)=>{let d=[...s,String(u)],f=typeof l.id=="string"?l.id:d.join("-");if(_t(l.index!==!0||!l.children,"Cannot specify children on an index route"),_t(o||!i[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),v_(l)){let g={...l,id:f};return i[f]=qE(g,t(g)),g}else{let g={...l,id:f,children:void 0};return i[f]=qE(g,t(g)),l.children&&(g.children=Fu(l.children,t,d,i,o)),g}})}function qE(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Wk(e,t,s="/"){return qs(e,t,s,!1)}function qs(e,t,s,i,o){let l=typeof t=="string"?ei(t):t,u=ts(l.pathname||"/",s);if(u==null)return null;let d=o??Ah(e),f=null,g=iO(u);for(let m=0;f==null&&m<d.length;++m)f=O_(d[m],g,i);return f}function eO(e,t){let{route:s,pathname:i,params:o}=e;return{id:s.id,pathname:i,params:o,data:t[s.id],loaderData:t[s.id],handle:s.handle}}function Ah(e){let t=tO(e);return b_(t),t}function tO(e,t=[],s=[],i="",o=!1){let l=(u,d,f=o,g)=>{let m={relativePath:g===void 0?u.path||"":g,caseSensitive:u.caseSensitive===!0,childrenIndex:d,route:u};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(i)&&f)return;_t(m.relativePath.startsWith(i),`Absolute route path "${m.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(i.length)}let h=Is([i,m.relativePath]),x=s.concat(m);u.children&&u.children.length>0&&(_t(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),tO(u.children,t,x,h,f)),!(u.path==null&&!u.index)&&t.push({path:h,score:T_(h,u.index),routesMeta:x.map((S,w)=>{let[C,E]=sO(S.relativePath,S.caseSensitive,w===x.length-1);return{...S,matcher:C,compiledParams:E}})})};return e.forEach((u,d)=>{if(u.path===""||!u.path?.includes("?"))l(u,d);else for(let f of nO(u.path))l(u,d,!0,f)}),t}function nO(e){let t=e.split("/");if(t.length===0)return[];let[s,...i]=t,o=s.endsWith("?"),l=s.replace(/\?$/,"");if(i.length===0)return o?[l,""]:[l];let u=nO(i.join("/")),d=[];return d.push(...u.map(f=>f===""?l:[l,f].join("/"))),o&&d.push(...u),d.map(f=>e.startsWith("/")&&f===""?"/":f)}function b_(e){e.sort((t,s)=>t.score!==s.score?s.score-t.score:k_(t.routesMeta.map(i=>i.childrenIndex),s.routesMeta.map(i=>i.childrenIndex)))}var x_=/^:[\w-]+$/,S_=3,w_=2,E_=1,R_=10,C_=-2,YE=e=>e==="*";function T_(e,t){let s=e.split("/"),i=s.length;return s.some(YE)&&(i+=C_),t&&(i+=w_),s.filter(o=>!YE(o)).reduce((o,l)=>o+(x_.test(l)?S_:l===""?E_:R_),i)}function k_(e,t){return e.length===t.length&&e.slice(0,-1).every((i,o)=>i===t[o])?e[e.length-1]-t[t.length-1]:0}function O_(e,t,s=!1){let{routesMeta:i}=e,o={},l="/",u=[];for(let d=0;d<i.length;++d){let f=i[d],g=d===i.length-1,m=l==="/"?t:t.slice(l.length)||"/",h={path:f.relativePath,caseSensitive:f.caseSensitive,end:g},x=f.matcher&&f.compiledParams?rO(h,m,f.matcher,f.compiledParams):Bu(h,m),S=f.route;if(!x&&g&&s&&!i[i.length-1].route.index&&(x=Bu({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!x)return null;Object.assign(o,x.params),u.push({params:o,pathname:Is([l,x.pathname]),pathnameBase:N_(Is([l,x.pathnameBase])),route:S}),x.pathnameBase!=="/"&&(l=Is([l,x.pathnameBase]))}return u}function Bu(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[s,i]=sO(e.path,e.caseSensitive,e.end);return rO(e,t,s,i)}function rO(e,t,s,i){let o=t.match(s);if(!o)return null;let l=o[0],u=ic(l,1),d=o.slice(1);return{params:i.reduce((g,{paramName:m,isOptional:h},x)=>{if(m==="*"){let w=d[x]||"";u=ic(l.slice(0,l.length-w.length),1)}const S=d[x];return h&&!S?g[m]=void 0:g[m]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:l,pathnameBase:u,pattern:e}}function sO(e,t=!1,s=!0){Hn(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=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,d,f,g,m)=>{if(i.push({paramName:d,isOptional:f!=null}),f){let h=m.charAt(g+u.length);return h&&h!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(i.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),i]}function iO(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Hn(!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 ts(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let s=t.endsWith("/")?t.length-1:t.length,i=e.charAt(s);return i&&i!=="/"?null:e.slice(s)||"/"}function A_({basename:e,pathname:t}){return t==="/"?e:Is([e,t])}var xb=e=>sg.test(e);function M_(e,t="/"){let{pathname:s,search:i="",hash:o=""}=typeof e=="string"?ei(e):e,l;return s?(s=Sb(s),s.startsWith("/")||s.startsWith("\\")?l=GE(s.substring(1),"/"):l=GE(s,t)):l=t,{pathname:l,search:D_(i),hash:j_(o)}}function GE(e,t){let s=ic(t).split("/");return e.split("/").forEach(o=>{o===".."?s.length>1&&s.pop():o!=="."&&s.push(o)}),s.length>1?s.join("/"):"/"}function gy(e,t,s,i){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${s}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function aO(e){return e.filter((t,s)=>s===0||t.route.path&&t.route.path.length>0)}function ag(e){let t=aO(e);return t.map((s,i)=>i===t.length-1?s.pathname:s.pathnameBase)}function fd(e,t,s,i=!1){let o;typeof e=="string"?o=ei(e):(o={...e},_t(!o.pathname||!o.pathname.includes("?"),gy("?","pathname","search",o)),_t(!o.pathname||!o.pathname.includes("#"),gy("#","pathname","hash",o)),_t(!o.search||!o.search.includes("#"),gy("#","search","hash",o)));let l=e===""||o.pathname==="",u=l?"/":o.pathname,d;if(u==null)d=s;else{let h=t.length-1;if(!i&&u.startsWith("..")){let x=u.split("/");for(;x[0]==="..";)x.shift(),h-=1;o.pathname=x.join("/")}d=h>=0?t[h]:"/"}let f=M_(o,d),g=u&&u!=="/"&&u.endsWith("/"),m=(l||u===".")&&s.endsWith("/");return!f.pathname.endsWith("/")&&(g||m)&&(f.pathname+="/"),f}var Sb=e=>e.replace(/[\\/]{2,}/g,"/"),Is=e=>Sb(e.join("/"));function ic(e,t=0){let s=e.length;for(;s>t&&e.charCodeAt(s-1)===47;)s--;return s===e.length?e:e.slice(0,s)}var N_=e=>ic(e).replace(/^\/*/,"/"),D_=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,j_=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,I_=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],hd=class{constructor(e,t,s,i=!1){this.status=e,this.statusText=t||"",this.internal=i,s instanceof Error?(this.data=s.toString(),this.error=s):this.data=s}};function Vu(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function pd(e){let t=e.map(s=>s.route.path).filter(Boolean);return Is(t)||"/"}var oO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function lO(e,t){let s=e;if(typeof s!="string"||!sg.test(s))return{absoluteURL:void 0,isExternal:!1,to:s};let i=s,o=!1;if(oO)try{let l=new URL(window.location.href),u=ig.test(s)?new URL(Zk(s,l.protocol)):new URL(s),d=ts(u.pathname,t);u.origin===l.origin&&d!=null?s=d+u.search+u.hash:o=!0}catch{Hn(!1,`<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:o,to:s}}var _a=Symbol("Uninstrumented");function P_(e,t){let s={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:t.id,index:t.index,path:t.path,instrument(l){let u=Object.keys(s);for(let d of u)l[d]&&s[d].push(l[d])}}));let i={};if(typeof t.lazy=="function"&&s.lazy.length>0){let o=Hl(s.lazy,t.lazy,()=>{});o&&(i.lazy=o)}if(typeof t.lazy=="object"){let o=t.lazy;["middleware","loader","action"].forEach(l=>{let u=o[l],d=s[`lazy.${l}`];if(typeof u=="function"&&d.length>0){let f=Hl(d,u,()=>{});f&&(i.lazy=Object.assign(i.lazy||{},{[l]:f}))}})}return["loader","action"].forEach(o=>{let l=t[o];if(typeof l=="function"&&s[o].length>0){let u=l[_a]??l,d=Hl(s[o],u,(...f)=>$E(f[0]));d&&(o==="loader"&&u.hydrate===!0&&(d.hydrate=!0),d[_a]=u,i[o]=d)}}),t.middleware&&t.middleware.length>0&&s.middleware.length>0&&(i.middleware=t.middleware.map(o=>{let l=o[_a]??o,u=Hl(s.middleware,l,(...d)=>$E(d[0]));return u?(u[_a]=l,u):o})),i}function L_(e,t){let s={navigate:[],fetch:[]};if(t.forEach(i=>i({instrument(o){let l=Object.keys(o);for(let u of l)o[u]&&s[u].push(o[u])}})),s.navigate.length>0){let i=e.navigate[_a]??e.navigate,o=Hl(s.navigate,i,(...l)=>{let[u,d]=l;return{to:typeof u=="number"||typeof u=="string"?u:u?Br(u):".",...QE(e,d??{})}});o&&(o[_a]=i,e.navigate=o)}if(s.fetch.length>0){let i=e.fetch[_a]??e.fetch,o=Hl(s.fetch,i,(...l)=>{let[u,,d,f]=l;return{href:d??".",fetcherKey:u,...QE(e,f??{})}});o&&(o[_a]=i,e.fetch=o)}return e}function Hl(e,t,s){return e.length===0?null:async(...i)=>{let o=await cO(e,s(...i),()=>t(...i),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function cO(e,t,s,i){let o=e[i],l;if(o){let u,d=async()=>(u?console.error("You cannot call instrumented handlers more than once"):u=cO(e,t,s,i-1),l=await u,_t(l,"Expected a result"),l.type==="error"&&l.value instanceof Error?{status:"error",error:l.value}:{status:"success",error:void 0});try{await o(d,t)}catch(f){console.error("An instrumentation function threw an error:",f)}u||await d(),await u}else try{l={type:"success",value:await s()}}catch(u){l={type:"error",value:u}}return l||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function $E(e){let{request:t,context:s,params:i,pattern:o}=e;return{request:z_(t),params:{...i},pattern:o,context:__(s)}}function QE(e,t){return{currentUrl:Br(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 z_(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function __(e){if(H_(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var U_=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function H_(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")===U_}var XE=new URL("http://localhost");function wb(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),XE)}catch{return XE}}function my(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function F_(e,t){if(e.startsWith("//"))return!0;let s=t.protocol.toLowerCase();return e.toLowerCase().startsWith(s)?t.host===""||e.slice(s.length).startsWith("//"):!1}function Ql(e,t,s,i){let o=null;try{o=e==null?null:new URL(e,s)}catch{}let l=new URL(t,s),u=o!=null&&!my(o,s),d=!my(l,s);if(i==="reject"){if(u||d)throw new Error("External navigation is not allowed")}else if(d&&(o==null||!F_(e,o)||!my(o,l)))throw new Error("External navigation is not allowed")}var uO=["POST","PUT","PATCH","DELETE"],B_=new Set(uO),V_=["GET",...uO],K_=new Set(V_),dO=new Set([301,302,303,307,308]),q_=new Set([307,308]),yy={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Y_={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Pl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},G_=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),fO="remix-router-transitions",hO=Symbol("ResetLoaderData"),ko,Ll,ja,zl,$_=class{constructor(e){wu(this,ko),wu(this,Ll),wu(this,ja),wu(this,zl),hi(this,ko,e),hi(this,Ll,Ah(e))}get stableRoutes(){return Ms(this,ko)}get activeRoutes(){return Ms(this,ja)??Ms(this,ko)}get branches(){return Ms(this,zl)??Ms(this,Ll)}get hasHMRRoutes(){return Ms(this,ja)!=null}setRoutes(e){hi(this,ko,e),hi(this,Ll,Ah(e))}setHmrRoutes(e){hi(this,ja,e),hi(this,zl,Ah(e))}commitHmrRoutes(){Ms(this,ja)&&(hi(this,ko,Ms(this,ja)),hi(this,Ll,Ms(this,zl)),hi(this,ja,void 0),hi(this,zl,void 0))}};ko=new WeakMap;Ll=new WeakMap;ja=new WeakMap;zl=new WeakMap;function Q_(e){const t=e.window?e.window:typeof window<"u"?window:void 0,s=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";_t(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i=e.hydrationRouteProperties||[],o=e.mapRouteProperties||G_,l=o;if(e.instrumentations){let F=e.instrumentations;l=J=>({...o(J),...P_(F.map(ne=>ne.route).filter(Boolean),J)})}let u={},d=new $_(Fu(e.routes,l,void 0,u)),f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let g=e.dataStrategy||e6,m={...e.future},h=null,x=new Set,S=null,w=null,C=null,E=null,R=e.hydrationData!=null,k=qs(d.activeRoutes,e.history.location,f,!1,d.branches),O=!1,A=null,N,j;if(k==null&&!e.patchRoutesOnNavigation){let F=Ns(404,{pathname:e.history.location.pathname}),{matches:J,route:ne}=uh(d.activeRoutes);N=!0,j=!N,k=J,A={[ne.id]:F}}else if(k&&!e.hydrationData&&Ie(k,d.activeRoutes,e.history.location.pathname).active&&(k=null),k)if(k.some(F=>F.route.lazy))N=!1,j=!N;else if(!k.some(F=>Eb(F.route)))N=!0,j=!N;else{let F=e.hydrationData?e.hydrationData.loaderData:null,J=e.hydrationData?e.hydrationData.errors:null,ne=k;if(J){let ye=k.findIndex(xe=>J[xe.route.id]!==void 0);ne=ne.slice(0,ye+1)}j=!1,N=!0,ne.forEach(ye=>{let xe=pO(ye.route,F,J);j=j||xe.renderFallback,N=N&&!xe.shouldLoad})}else{N=!1,j=!N,k=[];let F=Ie(null,d.activeRoutes,e.history.location.pathname);F.active&&F.matches&&(O=!0,k=F.matches)}let D,M={historyAction:e.history.action,location:e.history.location,matches:k,initialized:N,renderFallback:j,navigation:yy,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||A,fetchers:new Map,blockers:new Map},_="POP",L=null,q=!1,X,B=!1,H=new Map,U=null,z=!1,Q=!1,$=new Set,K=new Map,Y=0,ee=-1,G=new Map,oe=new Set,I=new Map,V=new Map,W=new Set,re=new Map,Ee,le=null;function me(){if(h=e.history.listen(({action:F,location:J,delta:ne})=>{if(Ee){Ee(),Ee=void 0;return}Hn(re.size===0||ne!=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 ye=xt({currentLocation:M.location,nextLocation:J,historyAction:F});if(ye&&ne!=null){let xe=new Promise(qe=>{Ee=qe});e.history.go(ne*-1),ht(ye,{state:"blocked",location:J,proceed(){ht(ye,{state:"proceeding",proceed:void 0,reset:void 0,location:J}),xe.then(()=>e.history.go(ne))},reset(){let qe=new Map(M.blockers);qe.set(ye,Pl),Te({blockers:qe})}}),L?.resolve(),L=null;return}return Le(F,J)}),s){b6(t,H);let F=()=>x6(t,H);t.addEventListener("pagehide",F),U=()=>t.removeEventListener("pagehide",F)}return M.initialized||Le("POP",M.location,{initialHydration:!0}),D}function ge(){h&&h(),U&&U(),x.clear(),X&&X.abort(),M.fetchers.forEach((F,J)=>Nt(M.fetchers,J)),M.blockers.forEach((F,J)=>Zt(J))}function ue(F){if(x.add(F),S){let{newErrors:J}=S;S=null,F(M,{deletedFetchers:[],newErrors:J,viewTransitionOpts:void 0,flushSync:!1})}return()=>x.delete(F)}function Te(F,J={}){F.matches&&(F.matches=F.matches.map(xe=>{let qe=u[xe.route.id],Ke=xe.route;return Ke.element!==qe.element||Ke.errorElement!==qe.errorElement||Ke.hydrateFallbackElement!==qe.hydrateFallbackElement?{...xe,route:qe}:xe})),M={...M,...F};let ne=[],ye=[];M.fetchers.forEach((xe,qe)=>{xe.state==="idle"&&(W.has(qe)?ne.push(qe):ye.push(qe))}),W.forEach(xe=>{!M.fetchers.has(xe)&&!K.has(xe)&&ne.push(xe)}),x.size===0&&(S={newErrors:F.errors??null}),[...x].forEach(xe=>xe(M,{deletedFetchers:ne,newErrors:F.errors??null,viewTransitionOpts:J.viewTransitionOpts,flushSync:J.flushSync===!0})),ne.forEach(xe=>Nt(M.fetchers,xe)),ye.forEach(xe=>M.fetchers.delete(xe))}function ve(F,J,{flushSync:ne}={}){let ye=M.actionData!=null&&M.navigation.formMethod!=null&&kr(M.navigation.formMethod)&&M.navigation.state==="loading"&&F.state?._isRedirect!==!0,xe;J.actionData?Object.keys(J.actionData).length>0?xe=J.actionData:xe=null:ye?xe=M.actionData:xe=null;let qe=J.loaderData?aR(M.loaderData,J.loaderData,J.matches||[],J.errors):M.loaderData,Ke=M.blockers;Ke.size>0&&(Ke=new Map(Ke),Ke.forEach((tt,Et)=>Ke.set(Et,Pl)));let Xe=z?!1:at(F,J.matches||M.matches),Qe=q===!0||M.navigation.formMethod!=null&&kr(M.navigation.formMethod)&&F.state?._isRedirect!==!0;d.commitHmrRoutes(),z||_==="POP"||(_==="PUSH"?e.history.push(F,F.state):_==="REPLACE"&&e.history.replace(F,F.state));let lt;if(_==="POP"&&!z&&F!==M.location){let tt=H.get(M.location.pathname);tt&&tt.has(F.pathname)?lt={currentLocation:M.location,nextLocation:F}:H.has(F.pathname)&&(lt={currentLocation:F,nextLocation:M.location})}else if(B){let tt=H.get(M.location.pathname);tt?tt.add(F.pathname):(tt=new Set([F.pathname]),H.set(M.location.pathname,tt)),lt={currentLocation:M.location,nextLocation:F}}Te({...J,actionData:xe,loaderData:qe,historyAction:_,location:F,initialized:!0,renderFallback:!1,navigation:yy,revalidation:"idle",restoreScrollPosition:Xe,preventScrollReset:Qe,blockers:Ke},{viewTransitionOpts:lt,flushSync:ne===!0}),_="POP",q=!1,B=!1,z=!1,Q=!1,L?.resolve(),L=null,le?.resolve(),le=null}async function Pe(F,J){if(L?.resolve(),L=null,typeof F=="number"){L||(L=uR());let Ft=L.promise;return e.history.go(F),Ft}let ne=sv(M.location,M.matches,f,F,J?.fromRouteId,J?.relative),{path:ye,submission:xe,error:qe}=ZE(!1,ne,J),Ke;if(J?.mask){let Ft=typeof J.mask=="string"?ei(J.mask):{...M.location.mask,...J.mask};if(Ke={pathname:Ft.pathname??"",search:Ft.search??"",hash:Ft.hash??""},ig.test(Ke.pathname))throw new Error("External navigation is not allowed");Ke.pathname.startsWith("\\")&&(Ke.pathname=Ke.pathname.replace(/^\\+/,"/")),Ql(typeof J.mask=="string"?J.mask:Br(J.mask),Br(Ke),e.history.createURL("/"),"reject")}let Xe=M.location,Qe=Hu(Xe,ye,J&&J.state,void 0,Ke);Qe={...Qe,...e.history.encodeLocation(Qe)},Ql(F==null?e.history.createHref(M.location):typeof F=="string"?F:Br(F),e.history.createHref(Qe.mask||Qe),e.history.createURL("/"),"reject");let lt=J&&J.replace!=null?J.replace:void 0,tt="PUSH";lt===!0?tt="REPLACE":lt===!1||xe!=null&&kr(xe.formMethod)&&xe.formAction===M.location.pathname+M.location.search&&(tt="REPLACE");let Et=J&&"preventScrollReset"in J?J.preventScrollReset===!0:void 0,ft=(J&&J.flushSync)===!0,qt=xt({currentLocation:Xe,nextLocation:Qe,historyAction:tt});if(qt){ht(qt,{state:"blocked",location:Qe,proceed(){ht(qt,{state:"proceeding",proceed:void 0,reset:void 0,location:Qe}),Pe(F,J)},reset(){let Ft=new Map(M.blockers);Ft.set(qt,Pl),Te({blockers:Ft})}});return}await Le(tt,Qe,{submission:xe,pendingError:qe,preventScrollReset:Et,replace:J&&J.replace,enableViewTransition:J&&J.viewTransition,flushSync:ft,callSiteDefaultShouldRevalidate:J&&J.defaultShouldRevalidate})}function Oe(){le||(le=uR()),Me(),Te({revalidation:"loading"});let F=le.promise;return M.navigation.state==="submitting"?F:M.navigation.state==="idle"?(Le(M.historyAction,M.location,{startUninterruptedRevalidation:!0}),F):(Le(_||M.historyAction,M.navigation.location,{overrideNavigation:M.navigation,enableViewTransition:B===!0}),F)}async function Le(F,J,ne){X&&X.abort(),X=null,_=F,z=(ne&&ne.startUninterruptedRevalidation)===!0,je(M.location,M.matches),q=(ne&&ne.preventScrollReset)===!0,B=(ne&&ne.enableViewTransition)===!0;let ye=d.activeRoutes,xe=ne?.initialHydration&&M.matches&&M.matches.length>0&&!O?M.matches:qs(ye,J,f,!1,d.branches),qe=(ne&&ne.flushSync)===!0;if(xe&&M.initialized&&!Q&&c6(M.location,J)&&!(ne&&ne.submission&&kr(ne.submission.formMethod))){ve(J,{matches:xe},{flushSync:qe});return}let Ke=Ie(xe,ye,J.pathname);if(Ke.active&&Ke.matches&&(xe=Ke.matches),!xe){let{error:Yt,notFoundMatches:Bt,route:Cn}=yt(J.pathname);ve(J,{matches:Bt,loaderData:{},errors:{[Cn.id]:Yt}},{flushSync:qe});return}let Xe=ne&&ne.overrideNavigation?{...ne.overrideNavigation,matches:xe,historyAction:F}:void 0;X=new AbortController;let Qe=_l(e.history,J,X.signal,ne&&ne.submission),lt=e.getContext?await e.getContext():new KE,tt;if(ne&&ne.pendingError)tt=[La(xe).route.id,{type:"error",error:ne.pendingError}];else if(ne&&ne.submission&&kr(ne.submission.formMethod)){let Yt=await Ve(Qe,J,ne.submission,xe,F,lt,Ke.active,ne&&ne.initialHydration===!0,{replace:ne.replace,flushSync:qe});if(Yt.shortCircuited)return;if(Yt.pendingActionResult){let[Bt,Cn]=Yt.pendingActionResult;if(gs(Cn)&&Vu(Cn.error)&&Cn.error.status===404){X=null,ve(J,{matches:Yt.matches,loaderData:{},errors:{[Bt]:Cn.error}});return}}xe=Yt.matches||xe,tt=Yt.pendingActionResult,Xe=vy(J,xe,F,ne.submission),qe=!1,Ke.active=!1,Qe=_l(e.history,Qe.url,Qe.signal)}let{shortCircuited:Et,matches:ft,loaderData:qt,errors:Ft,workingFetchers:On}=await ke(Qe,J,xe,F,lt,Ke.active,Xe,ne&&ne.submission,ne&&ne.fetcherSubmission,ne&&ne.replace,ne&&ne.initialHydration===!0,qe,tt,ne&&ne.callSiteDefaultShouldRevalidate);Et||(X=null,ve(J,{matches:ft||xe,...oR(tt),loaderData:qt,errors:Ft,...On?{fetchers:On}:{}}))}async function Ve(F,J,ne,ye,xe,qe,Ke,Xe,Qe={}){Me();let lt=y6(J,ye,xe,ne);if(Te({navigation:lt},{flushSync:Qe.flushSync===!0}),Ke){let ft=await ze(ye,J.pathname,F.signal);if(ft.type==="aborted")return{shortCircuited:!0};if(ft.type==="error"){if(ft.partialMatches.length===0){let{matches:Ft,route:On}=uh(d.activeRoutes);return{matches:Ft,pendingActionResult:[On.id,{type:"error",error:ft.error}]}}let qt=La(ft.partialMatches).route.id;return{matches:ft.partialMatches,pendingActionResult:[qt,{type:"error",error:ft.error}]}}else if(ft.matches)ye=ft.matches;else{let{notFoundMatches:qt,error:Ft,route:On}=yt(J.pathname);return{matches:qt,pendingActionResult:[On.id,{type:"error",error:Ft}]}}}let tt,Et=Mh(ye,J);if(!Et.route.action&&!Et.route.lazy)tt={type:"error",error:Ns(405,{method:F.method,pathname:J.pathname,routeId:Et.route.id})};else{let ft=Xl(l,u,F,J,ye,Et,Xe?[]:i,qe),qt=await we(F,J,ft,qe,null);if(tt=qt[Et.route.id],!tt){for(let Ft of ye)if(qt[Ft.route.id]){tt=qt[Ft.route.id];break}}if(F.signal.aborted)return{shortCircuited:!0}}if(Mo(tt)){let ft;return Qe&&Qe.replace!=null?ft=Qe.replace:ft=rR(tt.response.headers.get("Location"),new URL(F.url),f,e.history)===M.location.pathname+M.location.search,await de(F,tt,!0,{submission:ne,replace:ft}),{shortCircuited:!0}}if(gs(tt)){let ft=La(ye,Et.route.id);return(Qe&&Qe.replace)!==!0&&(_="PUSH"),{matches:ye,pendingActionResult:[ft.route.id,tt,Et.route.id]}}return{matches:ye,pendingActionResult:[Et.route.id,tt]}}async function ke(F,J,ne,ye,xe,qe,Ke,Xe,Qe,lt,tt,Et,ft,qt){let Ft=Ke||vy(J,ne,ye,Xe),On=Xe||Qe||cR(Ft),Yt=!z&&!tt;if(qe){if(Yt){let qn=Ue(ft);Te({navigation:Ft,...qn!==void 0?{actionData:qn}:{}},{flushSync:Et})}let zt=await ze(ne,J.pathname,F.signal);if(zt.type==="aborted")return{shortCircuited:!0};if(zt.type==="error"){if(zt.partialMatches.length===0){let{matches:Fn,route:gr}=uh(d.activeRoutes);return{matches:Fn,loaderData:{},errors:{[gr.id]:zt.error}}}let qn=La(zt.partialMatches).route.id;return{matches:zt.partialMatches,loaderData:{},errors:{[qn]:zt.error}}}else if(zt.matches)ne=zt.matches;else{let{error:qn,notFoundMatches:Fn,route:gr}=yt(J.pathname);return{matches:Fn,loaderData:{},errors:{[gr.id]:qn}}}}let Bt=d.activeRoutes,{dsMatches:Cn,revalidatingFetchers:Tn}=JE(F,xe,l,u,e.history,M,ne,On,J,tt?[]:i,tt===!0,Q,$,W,I,oe,Bt,f,e.patchRoutesOnNavigation!=null,d.branches,ft,qt);if(ee=++Y,!e.dataStrategy&&!Cn.some(zt=>zt.shouldLoad)&&!Cn.some(zt=>zt.route.middleware&&zt.route.middleware.length>0)&&Tn.length===0){let zt=new Map(M.fetchers),qn=nn(zt);return ve(J,{matches:ne,loaderData:{},errors:ft&&gs(ft[1])?{[ft[0]]:ft[1].error}:null,...oR(ft),...qn?{fetchers:zt}:{}},{flushSync:Et}),{shortCircuited:!0}}if(Yt){let zt={};if(!qe){zt.navigation=Ft;let qn=Ue(ft);qn!==void 0&&(zt.actionData=qn)}Tn.length>0&&(zt.fetchers=be(Tn)),Te(zt,{flushSync:Et})}Tn.forEach(zt=>{tn(zt.key),zt.controller&&K.set(zt.key,zt.controller)});let ns=()=>Tn.forEach(zt=>tn(zt.key));X&&X.signal.addEventListener("abort",ns);let{loaderResults:dn,fetcherResults:fn}=await Ge(Cn,Tn,F,J,xe);if(F.signal.aborted)return{shortCircuited:!0};X&&X.signal.removeEventListener("abort",ns),Tn.forEach(zt=>K.delete(zt.key));let An=dh(dn);if(An)return await de(F,An.result,!0,{replace:lt}),{shortCircuited:!0};if(An=dh(fn),An)return oe.add(An.key),await de(F,An.result,!0,{replace:lt}),{shortCircuited:!0};let jn=new Map(M.fetchers),{loaderData:Oi,errors:jr}=iR(M,ne,dn,ft,Tn,fn,jn);tt&&M.errors&&(jr={...M.errors,...jr});let _s=nn(jn),rs=We(ee,jn),xs=_s||rs||Tn.length>0;return{matches:ne,loaderData:Oi,errors:jr,...xs?{workingFetchers:jn}:{}}}function Ue(F){if(F&&!gs(F[1]))return{[F[0]]:F[1].data};if(M.actionData)return Object.keys(M.actionData).length===0?null:M.actionData}function be(F){let J=new Map(M.fetchers);return F.forEach(ne=>{let ye=J.get(ne.key),xe=mu(void 0,ye?ye.data:void 0);J.set(ne.key,xe)}),J}async function He(F,J,ne,ye){tn(F);let xe=(ye&&ye.flushSync)===!0,qe=d.activeRoutes,Ke=sv(M.location,M.matches,f,ne,J,ye?.relative),Xe=qs(qe,Ke,f,!1,d.branches),Qe=Ie(Xe,qe,Ke);if(Qe.active&&Qe.matches&&(Xe=Qe.matches),!Xe){bt(F,J,Ns(404,{pathname:Ke}),{flushSync:xe});return}let{path:lt,submission:tt,error:Et}=ZE(!0,Ke,ye);if(Et){bt(F,J,Et,{flushSync:xe});return}let ft=e.getContext?await e.getContext():new KE,qt=(ye&&ye.preventScrollReset)===!0;if(tt&&kr(tt.formMethod)){await Ze(F,J,lt,Xe,ft,Qe.active,xe,qt,tt,ye&&ye.defaultShouldRevalidate);return}I.set(F,{routeId:J,path:lt}),await ot(F,J,lt,Xe,ft,Qe.active,xe,qt,tt)}async function Ze(F,J,ne,ye,xe,qe,Ke,Xe,Qe,lt){Me(),I.delete(F);let tt=M.fetchers.get(F);De(F,v6(Qe,tt),{flushSync:Ke});let Et=new AbortController,ft=_l(e.history,ne,Et.signal,Qe);if(qe){let Se=await ze(ye,new URL(ft.url).pathname,ft.signal,F);if(Se.type==="aborted")return;if(Se.type==="error"){bt(F,J,Se.error,{flushSync:Ke});return}else if(Se.matches)ye=Se.matches;else{bt(F,J,Ns(404,{pathname:ne}),{flushSync:Ke});return}}let qt=Mh(ye,ne);if(!qt.route.action&&!qt.route.lazy){let Se=Ns(405,{method:Qe.formMethod,pathname:ne,routeId:J});bt(F,J,Se,{flushSync:Ke});return}K.set(F,Et);let Ft=Y,On=Xl(l,u,ft,ne,ye,qt,i,xe),Yt=await we(ft,ne,On,xe,F),Bt=Yt[qt.route.id];if(!Bt){for(let Se of On)if(Yt[Se.route.id]){Bt=Yt[Se.route.id];break}}if(ft.signal.aborted){K.get(F)===Et&&K.delete(F);return}if(W.has(F)){if(Mo(Bt)||gs(Bt)){De(F,pi(void 0));return}}else{if(Mo(Bt))if(K.delete(F),ee>Ft){De(F,pi(void 0));return}else return oe.add(F),De(F,mu(Qe)),de(ft,Bt,!1,{fetcherSubmission:Qe,preventScrollReset:Xe});if(gs(Bt)){bt(F,J,Bt.error);return}}let Cn=M.navigation.location||M.location,Tn=_l(e.history,Cn,Et.signal),ns=d.activeRoutes,dn=M.navigation.state!=="idle"?qs(ns,M.navigation.location,f,!1,d.branches):M.matches;_t(dn,"Didn't find any matches after fetcher action");let fn=++Y;G.set(F,fn);let{dsMatches:An,revalidatingFetchers:jn}=JE(Tn,xe,l,u,e.history,M,dn,Qe,Cn,i,!1,Q,$,W,I,oe,ns,f,e.patchRoutesOnNavigation!=null,d.branches,[qt.route.id,Bt],lt),Oi=mu(Qe,Bt.data),jr=new Map(M.fetchers);jr.set(F,Oi),jn.filter(Se=>Se.key!==F).forEach(Se=>{let rt=Se.key,Ot=jr.get(rt),Rt=mu(void 0,Ot?Ot.data:void 0);jr.set(rt,Rt),tn(rt),Se.controller&&K.set(rt,Se.controller)}),Te({fetchers:jr});let _s=()=>jn.forEach(Se=>tn(Se.key));Et.signal.addEventListener("abort",_s);let{loaderResults:rs,fetcherResults:xs}=await Ge(An,jn,Tn,Cn,xe);if(Et.signal.aborted)return;Et.signal.removeEventListener("abort",_s),G.delete(F),K.delete(F),jn.forEach(Se=>K.delete(Se.key));let zt=M.fetchers.has(F),qn=Se=>{if(!zt)return Se;let rt=new Map(Se.fetchers);return rt.set(F,pi(Bt.data)),{...Se,fetchers:rt}},Fn=dh(rs);if(Fn)return M=qn(M),de(Tn,Fn.result,!1,{preventScrollReset:Xe});if(Fn=dh(xs),Fn)return oe.add(Fn.key),M=qn(M),de(Tn,Fn.result,!1,{preventScrollReset:Xe});let gr=new Map(M.fetchers);zt&&gr.set(F,pi(Bt.data));let{loaderData:he,errors:Ae}=iR(M,dn,rs,void 0,jn,xs,gr);We(fn,gr),M.navigation.state==="loading"&&fn>ee?(_t(_,"Expected pending action"),X&&X.abort(),ve(M.navigation.location,{matches:dn,loaderData:he,errors:Ae,fetchers:gr})):(Te({errors:Ae,loaderData:aR(M.loaderData,he,dn,Ae),fetchers:gr}),Q=!1)}async function ot(F,J,ne,ye,xe,qe,Ke,Xe,Qe){let lt=M.fetchers.get(F);De(F,mu(Qe,lt?lt.data:void 0),{flushSync:Ke});let tt=new AbortController,Et=_l(e.history,ne,tt.signal);if(qe){let Bt=await ze(ye,new URL(Et.url).pathname,Et.signal,F);if(Bt.type==="aborted")return;if(Bt.type==="error"){bt(F,J,Bt.error,{flushSync:Ke});return}else if(Bt.matches)ye=Bt.matches;else{bt(F,J,Ns(404,{pathname:ne}),{flushSync:Ke});return}}let ft=Mh(ye,ne);K.set(F,tt);let qt=Y,Ft=Xl(l,u,Et,ne,ye,ft,i,xe),On=await we(Et,ne,Ft,xe,F),Yt=On[ft.route.id];if(!Yt){for(let Bt of ye)if(On[Bt.route.id]){Yt=On[Bt.route.id];break}}if(K.get(F)===tt&&K.delete(F),!Et.signal.aborted){if(W.has(F)){De(F,pi(void 0));return}if(Mo(Yt))if(ee>qt){De(F,pi(void 0));return}else{oe.add(F),await de(Et,Yt,!1,{preventScrollReset:Xe});return}if(gs(Yt)){bt(F,J,Yt.error);return}De(F,pi(Yt.data))}}async function de(F,J,ne,{submission:ye,fetcherSubmission:xe,preventScrollReset:qe,replace:Ke}={}){ne||(L?.resolve(),L=null),J.response.headers.has("X-Remix-Revalidate")&&(Q=!0);let Xe=J.response.headers.get("Location");_t(Xe,"Expected a Location header on the redirect Response");let Qe=Xe,lt=new URL(F.url);Xe=rR(Xe,lt,f,e.history),Ql(Qe,Xe,lt,"allow-explicit");let tt=Hu(M.location,Xe,{_isRedirect:!0});if(s){let Yt=!1;if(J.response.headers.has("X-Remix-Reload-Document"))Yt=!0;else if(xb(Xe)){const Bt=Jk(t,Xe,!0);Yt=Bt.origin!==t.location.origin||ts(Bt.pathname,f)==null}if(Yt){Ke?t.location.replace(Xe):t.location.assign(Xe);return}}X=null;let Et=Ke===!0||J.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:ft,formAction:qt,formEncType:Ft}=M.navigation;!ye&&!xe&&ft&&qt&&Ft&&(ye=cR(M.navigation));let On=ye||xe;if(q_.has(J.response.status)&&On&&kr(On.formMethod))await Le(Et,tt,{submission:{...On,formAction:Xe},preventScrollReset:qe||q,enableViewTransition:ne?B:void 0});else{let Yt=vy(tt,[],Et,ye);await Le(Et,tt,{overrideNavigation:Yt,fetcherSubmission:xe,preventScrollReset:qe||q,enableViewTransition:ne?B:void 0})}}async function we(F,J,ne,ye,xe){let qe,Ke={};try{qe=await n6(g,F,J,ne,xe,ye,!1)}catch(Xe){return ne.filter(Qe=>Qe.shouldLoad).forEach(Qe=>{Ke[Qe.route.id]={type:"error",error:Xe}}),Ke}if(F.signal.aborted)return Ke;if(!kr(F.method))for(let Xe of ne){if(qe[Xe.route.id]?.type==="error")break;!qe.hasOwnProperty(Xe.route.id)&&!M.loaderData.hasOwnProperty(Xe.route.id)&&(!M.errors||!M.errors.hasOwnProperty(Xe.route.id))&&Xe.shouldCallHandler()&&(qe[Xe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Xe.route.id}`)})}for(let[Xe,Qe]of Object.entries(qe))if(h6(Qe)){let lt=Qe.result;Ke[Xe]={type:"redirect",response:a6(lt,F,Xe,ne,f)}}else Ke[Xe]=await i6(Qe);return Ke}async function Ge(F,J,ne,ye,xe){let qe=we(ne,ye,F,xe,null),Ke=Promise.all(J.map(async lt=>{if(lt.matches&&lt.match&&lt.request&&lt.controller){let Et=(await we(lt.request,lt.path,lt.matches,xe,lt.key))[lt.match.route.id];return{[lt.key]:Et}}else return Promise.resolve({[lt.key]:{type:"error",error:Ns(404,{pathname:lt.path})}})})),Xe=await qe,Qe=(await Ke).reduce((lt,tt)=>Object.assign(lt,tt),{});return{loaderResults:Xe,fetcherResults:Qe}}function Me(){Q=!0,I.forEach((F,J)=>{K.has(J)&&$.add(J),tn(J)})}function De(F,J,ne={}){let ye=new Map(M.fetchers);ye.set(F,J),Te({fetchers:ye},{flushSync:(ne&&ne.flushSync)===!0})}function bt(F,J,ne,ye={}){let xe=La(M.matches,J),qe=new Map(M.fetchers);Nt(qe,F),Te({errors:{[xe.route.id]:ne},fetchers:qe},{flushSync:(ye&&ye.flushSync)===!0})}function dt(F){return V.set(F,(V.get(F)||0)+1),W.has(F)&&W.delete(F),M.fetchers.get(F)||Y_}function gt(F,J){tn(F,J?.reason),De(F,pi(null))}function Nt(F,J){let ne=M.fetchers.get(J);K.has(J)&&!(ne&&ne.state==="loading"&&G.has(J))&&tn(J),I.delete(J),G.delete(J),oe.delete(J),W.delete(J),$.delete(J),F.delete(J)}function jt(F){let J=(V.get(F)||0)-1;J<=0?(V.delete(F),W.add(F)):V.set(F,J),Te({fetchers:new Map(M.fetchers)})}function tn(F,J){let ne=K.get(F);ne&&(ne.abort(J),K.delete(F))}function an(F,J){for(let ne of F){let ye=J.get(ne);_t(ye,`Expected fetcher: ${ne}`);let xe=pi(ye.data);J.set(ne,xe)}}function nn(F){let J=[],ne=!1;for(let ye of oe){let xe=F.get(ye);_t(xe,`Expected fetcher: ${ye}`),xe.state==="loading"&&(oe.delete(ye),J.push(ye),ne=!0)}return an(J,F),ne}function We(F,J){let ne=[];for(let[ye,xe]of G)if(xe<F){let qe=J.get(ye);_t(qe,`Expected fetcher: ${ye}`),qe.state==="loading"&&(tn(ye),G.delete(ye),ne.push(ye))}return an(ne,J),ne.length>0}function wt(F,J){let ne=M.blockers.get(F)||Pl;return re.get(F)!==J&&re.set(F,J),ne}function Zt(F){M.blockers.delete(F),re.delete(F)}function ht(F,J){let ne=M.blockers.get(F)||Pl;_t(ne.state==="unblocked"&&J.state==="blocked"||ne.state==="blocked"&&J.state==="blocked"||ne.state==="blocked"&&J.state==="proceeding"||ne.state==="blocked"&&J.state==="unblocked"||ne.state==="proceeding"&&J.state==="unblocked",`Invalid blocker state transition: ${ne.state} -> ${J.state}`);let ye=new Map(M.blockers);ye.set(F,J),Te({blockers:ye})}function xt({currentLocation:F,nextLocation:J,historyAction:ne}){if(re.size===0)return;re.size>1&&Hn(!1,"A router only supports one blocker at a time");let ye=Array.from(re.entries()),[xe,qe]=ye[ye.length-1],Ke=M.blockers.get(xe);if(!(Ke&&Ke.state==="proceeding")&&qe({currentLocation:F,nextLocation:J,historyAction:ne}))return xe}function yt(F){let J=Ns(404,{pathname:F}),ne=d.activeRoutes,{matches:ye,route:xe}=uh(ne);return{notFoundMatches:ye,route:xe,error:J}}function Ut(F,J,ne){if(w=F,E=J,C=ne||null,!R&&M.navigation===yy){R=!0;let ye=at(M.location,M.matches);ye!=null&&Te({restoreScrollPosition:ye})}return()=>{w=null,E=null,C=null}}function un(F,J){return C&&C(F,J.map(ye=>eO(ye,M.loaderData)))||F.key}function je(F,J){if(w&&E){let ne=un(F,J);w[ne]=E()}}function at(F,J){if(w){let ne=un(F,J),ye=w[ne];if(typeof ye=="number")return ye}return null}function Ie(F,J,ne){if(e.patchRoutesOnNavigation){let ye=d.branches;if(F){if(Object.keys(F[0].params).length>0)return{active:!0,matches:qs(J,ne,f,!0,ye)}}else return{active:!0,matches:qs(J,ne,f,!0,ye)||[]}}return{active:!1,matches:null}}async function ze(F,J,ne,ye){if(!e.patchRoutesOnNavigation)return{type:"success",matches:F};let xe=F;for(;;){let qe=u;try{await e.patchRoutesOnNavigation({signal:ne,path:J,matches:xe,fetcherKey:ye,patch:(lt,tt)=>{ne.aborted||WE(lt,tt,d,qe,l,!1)}})}catch(lt){return{type:"error",error:lt,partialMatches:xe}}if(ne.aborted)return{type:"aborted"};let Ke=d.branches,Xe=qs(d.activeRoutes,J,f,!1,Ke),Qe=null;if(Xe){if(Object.keys(Xe[0].params).length===0)return{type:"success",matches:Xe};if(Qe=qs(d.activeRoutes,J,f,!0,Ke),!(Qe&&xe.length<Qe.length&&$e(xe,Qe.slice(0,xe.length))))return{type:"success",matches:Xe}}if(Qe||(Qe=qs(d.activeRoutes,J,f,!0,Ke)),!Qe||$e(xe,Qe))return{type:"success",matches:null};xe=Qe}}function $e(F,J){return F.length===J.length&&F.every((ne,ye)=>ne.route.id===J[ye].route.id)}function et(F){u={},d.setHmrRoutes(Fu(F,l,void 0,u))}function Tt(F,J,ne=!1){WE(F,J,d,u,l,ne),d.hasHMRRoutes||Te({})}return D={get basename(){return f},get future(){return m},get state(){return M},get routes(){return d.stableRoutes},get branches(){return d.branches},get manifest(){return u},get window(){return t},initialize:me,subscribe:ue,enableScrollRestoration:Ut,navigate:Pe,fetch:He,revalidate:Oe,createHref:F=>e.history.createHref(F),createURL:F=>e.history.createURL(F),encodeLocation:F=>e.history.encodeLocation(F),getFetcher:dt,resetFetcher:gt,deleteFetcher:jt,dispose:ge,getBlocker:wt,deleteBlocker:Zt,patchRoutes:Tt,_internalFetchControllers:K,_internalSetRoutes:et,_internalSetStateDoNotUseOrYouWillBreakYourApp(F){Te(F)}},e.instrumentations&&(D=L_(D,e.instrumentations.map(F=>F.router).filter(Boolean))),D}function X_(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function sv(e,t,s,i,o,l){let u,d;if(o){u=[];for(let g of t)if(u.push(g),g.route.id===o){d=g;break}}else u=t,d=t[t.length-1];let f=fd(i||".",ag(u),ts(e.pathname,s)||e.pathname,l==="path");if(i==null&&(f.search=e.search,f.hash=e.hash),(i==null||i===""||i===".")&&d){let g=Cb(f.search);if(d.route.index&&!g)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&g){let m=new URLSearchParams(f.search),h=m.getAll("index");m.delete("index"),h.filter(S=>S).forEach(S=>m.append("index",S));let x=m.toString();f.search=x?`?${x}`:""}}return s!=="/"&&(f.pathname=A_({basename:s,pathname:f.pathname})),Br(f)}function ZE(e,t,s){if(!s||!X_(s))return{path:t};if(s.formMethod&&!m6(s.formMethod))return{path:t,error:Ns(405,{method:s.formMethod})};let i=()=>({path:t,error:Ns(400,{type:"invalid-body"})}),l=(s.formMethod||"get").toUpperCase(),u=SO(t);if(s.body!==void 0){if(s.formEncType==="text/plain"){if(!kr(l))return i();let h=typeof s.body=="string"?s.body:s.body instanceof FormData||s.body instanceof URLSearchParams?Array.from(s.body.entries()).reduce((x,[S,w])=>`${x}${S}=${w}
47
+ `,""):String(s.body);return{path:t,submission:{formMethod:l,formAction:u,formEncType:s.formEncType,formData:void 0,json:void 0,text:h}}}else if(s.formEncType==="application/json"){if(!kr(l))return i();try{let h=typeof s.body=="string"?JSON.parse(s.body):s.body;return{path:t,submission:{formMethod:l,formAction:u,formEncType:s.formEncType,formData:void 0,json:h,text:void 0}}}catch{return i()}}}_t(typeof FormData=="function","FormData is not available in this environment");let d,f;if(s.formData)d=ov(s.formData),f=s.formData;else if(s.body instanceof FormData)d=ov(s.body),f=s.body;else if(s.body instanceof URLSearchParams)d=s.body,f=sR(d);else if(s.body==null)d=new URLSearchParams,f=new FormData;else try{d=new URLSearchParams(s.body),f=sR(d)}catch{return i()}let g={formMethod:l,formAction:u,formEncType:s&&s.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(kr(g.formMethod))return{path:t,submission:g};let m=ei(t);return e&&m.search&&Cb(m.search)&&d.append("index",""),m.search=`?${d}`,{path:Br(m),submission:g}}function JE(e,t,s,i,o,l,u,d,f,g,m,h,x,S,w,C,E,R,k,O,A,N){let j=A?gs(A[1])?A[1].error:A[1].data:void 0,D=o.createURL(l.location),M=o.createURL(f),_;if(m&&l.errors){let z=Object.keys(l.errors)[0];_=u.findIndex(Q=>Q.route.id===z)}else if(A&&gs(A[1])){let z=A[0];_=u.findIndex(Q=>Q.route.id===z)-1}let L=A?A[1].statusCode:void 0,q=L&&L>=400,X={currentUrl:D,currentParams:l.matches[0]?.params||{},nextUrl:M,nextParams:u[0].params,...d,actionResult:j,actionStatus:L},B=pd(u),H=u.map((z,Q)=>{let{route:$}=z,K=null;if(_!=null&&Q>_)K=!1;else if($.lazy)K=!0;else if(!Eb($))K=!1;else if(m){let{shouldLoad:oe}=pO($,l.loaderData,l.errors);K=oe}else Z_(l.loaderData,l.matches[Q],z)&&(K=!0);if(K!==null)return iv(s,i,e,f,B,z,g,t,K);let Y=!1;typeof N=="boolean"?Y=N:q?Y=!1:(h||D.pathname+D.search===M.pathname+M.search||D.search!==M.search||J_(l.matches[Q],z))&&(Y=!0);let ee={...X,defaultShouldRevalidate:Y},G=Au(z,ee);return iv(s,i,e,f,B,z,g,t,G,ee,N)}),U=[];return w.forEach((z,Q)=>{if(m||!u.some(V=>V.route.id===z.routeId)||S.has(Q))return;let $=l.fetchers.get(Q),K=$&&$.state!=="idle"&&$.data===void 0,Y=qs(E,z.path,R??"/",!1,O);if(!Y){if(k&&K)return;U.push({key:Q,routeId:z.routeId,path:z.path,matches:null,match:null,request:null,controller:null});return}if(C.has(Q))return;let ee=Mh(Y,z.path),G=new AbortController,oe=_l(o,z.path,G.signal),I=null;if(x.has(Q))x.delete(Q),I=Xl(s,i,oe,z.path,Y,ee,g,t);else if(K)h&&(I=Xl(s,i,oe,z.path,Y,ee,g,t));else{let V;typeof N=="boolean"?V=N:q?V=!1:V=h;let W={...X,defaultShouldRevalidate:V};Au(ee,W)&&(I=Xl(s,i,oe,z.path,Y,ee,g,t,W))}I&&U.push({key:Q,routeId:z.routeId,path:z.path,matches:I,match:ee,request:oe,controller:G})}),{dsMatches:H,revalidatingFetchers:U}}function Eb(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function pO(e,t,s){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Eb(e))return{shouldLoad:!1,renderFallback:!1};let i=t!=null&&e.id in t,o=s!=null&&s[e.id]!==void 0;if(!i&&o)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!i};let l=!i&&!o;return{shouldLoad:l,renderFallback:l}}function Z_(e,t,s){let i=!t||s.route.id!==t.route.id,o=!e.hasOwnProperty(s.route.id);return i||o}function J_(e,t){let s=e.route.path;return e.pathname!==t.pathname||s!=null&&s.endsWith("*")&&e.params["*"]!==t.params["*"]}function Au(e,t){if(e.route.shouldRevalidate){let s=e.route.shouldRevalidate(t);if(typeof s=="boolean")return s}return t.defaultShouldRevalidate}function WE(e,t,s,i,o,l){let u;if(e){let g=i[e];_t(g,`No route found to patch children into: routeId = ${e}`),g.children||(g.children=[]),u=g.children}else u=s.activeRoutes;let d=[],f=[];if(t.forEach(g=>{let m=u.find(h=>gO(g,h));m?f.push({existingRoute:m,newRoute:g}):d.push(g)}),d.length>0){let g=Fu(d,o,[e||"_","patch",String(u?.length||"0")],i);u.push(...g)}if(l&&f.length>0)for(let g=0;g<f.length;g++){let{existingRoute:m,newRoute:h}=f[g],x=m,[S]=Fu([h],o,[],{},!0);Object.assign(x,{element:S.element?S.element:x.element,errorElement:S.errorElement?S.errorElement:x.errorElement,hydrateFallbackElement:S.hydrateFallbackElement?S.hydrateFallbackElement:x.hydrateFallbackElement})}s.hasHMRRoutes||s.setRoutes([...s.activeRoutes])}function gO(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((s,i)=>t.children?.some(o=>gO(s,o)))??!1:!1}var eR=new WeakMap,mO=({key:e,route:t,manifest:s,mapRouteProperties:i})=>{let o=s[t.id];if(_t(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let l=o.lazy[e];if(!l)return;let u=eR.get(o);u||(u={},eR.set(o,u));let d=u[e];if(d)return d;let f=(async()=>{let g=g_(e),h=o[e]!==void 0&&e!=="hasErrorBoundary";if(g)Hn(!g,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),u[e]=Promise.resolve();else if(h)Hn(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await l();x!=null&&(Object.assign(o,{[e]:x}),Object.assign(o,i(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(x=>x===void 0)&&(o.lazy=void 0))})();return u[e]=f,f},tR=new WeakMap;function W_(e,t,s,i,o){let l=s[e.id];if(_t(l,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=tR.get(l);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let h=(async()=>{_t(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),S={};for(let w in x){let C=x[w];if(C===void 0)continue;let E=y_(w),k=l[w]!==void 0&&w!=="hasErrorBoundary";E?Hn(!E,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):k?Hn(!k,`Route "${l.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):S[w]=C}Object.assign(l,S),Object.assign(l,{...i(l),lazy:void 0})})();return tR.set(l,h),h.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:h}}let u=Object.keys(e.lazy),d=[],f;for(let m of u){if(o&&o.includes(m))continue;let h=mO({key:m,route:e,manifest:s,mapRouteProperties:i});h&&(d.push(h),m===t&&(f=h))}let g=d.length>0?Promise.all(d).then(()=>{}):void 0;return g?.catch(()=>{}),f?.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:f}}async function nR(e){let t=e.matches.filter(o=>o.shouldLoad),s={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,l)=>{s[t[l].route.id]=o}),s}async function e6(e){return e.matches.some(t=>t.route.middleware)?yO(e,()=>nR(e)):nR(e)}function yO(e,t){return t6(e,t,i=>{if(g6(i))throw i;return i},d6,s);function s(i,o,l){if(l)return Promise.resolve(Object.assign(l.value,{[o]:{type:"error",result:i}}));{let{matches:u}=e,d=Math.min(Math.max(u.findIndex(g=>g.route.id===o),0),Math.max(u.findIndex(g=>g.shouldCallHandler()),0)),f=La(u,u[d].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:i}})}}}async function t6(e,t,s,i,o){let{matches:l,...u}=e,d=l.flatMap(g=>g.route.middleware?g.route.middleware.map(m=>[g.route.id,m]):[]);return await vO(u,d,t,s,i,o)}async function vO(e,t,s,i,o,l,u=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let f=t[u];if(!f)return await s();let[g,m]=f,h,x=async()=>{if(h)throw new Error("You may only call `next()` once per middleware");try{return h={value:await vO(e,t,s,i,o,l,u+1)},h.value}catch(S){return h={value:await l(S,g,h)},h.value}};try{let S=await m(e,x),w=S!=null?i(S):void 0;return o(w)?w:h?w??h.value:(h={value:await x()},h.value)}catch(S){return await l(S,g,h)}}function bO(e,t,s,i,o){let l=mO({key:"middleware",route:i.route,manifest:t,mapRouteProperties:e}),u=W_(i.route,kr(s.method)?"action":"loader",t,e,o);return{middleware:l,route:u.lazyRoutePromise,handler:u.lazyHandlerPromise}}function iv(e,t,s,i,o,l,u,d,f,g=null,m){let h=!1,x=bO(e,t,s,l,u);return{...l,_lazyPromises:x,shouldLoad:f,shouldRevalidateArgs:g,shouldCallHandler(S){return h=!0,g?typeof m=="boolean"?Au(l,{...g,defaultShouldRevalidate:m}):typeof S=="boolean"?Au(l,{...g,defaultShouldRevalidate:S}):Au(l,g):f},resolve(S){let{lazy:w,loader:C,middleware:E}=l.route,R=h||f||S&&!kr(s.method)&&(w||C),k=E&&E.length>0&&!C&&!w;return R&&(kr(s.method)||!k)?r6({request:s,path:i,pattern:o,match:l,lazyHandlerPromise:x?.handler,lazyRoutePromise:x?.route,handlerOverride:S,scopedContext:d}):Promise.resolve({type:"data",result:void 0})}}}function Xl(e,t,s,i,o,l,u,d,f=null){return o.map(g=>g.route.id!==l.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:f,shouldCallHandler:()=>!1,_lazyPromises:bO(e,t,s,g,u),resolve:()=>Promise.resolve({type:"data",result:void 0})}:iv(e,t,s,i,pd(o),g,u,d,!0,f))}async function n6(e,t,s,i,o,l,u){i.some(m=>m._lazyPromises?.middleware)&&await Promise.all(i.map(m=>m._lazyPromises?.middleware));let d={request:t,url:xO(t,s),pattern:pd(i),params:i[0].params,context:l,matches:i},g=await e({...d,fetcherKey:o,runClientMiddleware:m=>{let h=d;return yO(h,()=>m({...h,fetcherKey:o,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(i.flatMap(m=>[m._lazyPromises?.handler,m._lazyPromises?.route]))}catch{}return g}async function r6({request:e,path:t,pattern:s,match:i,lazyHandlerPromise:o,lazyRoutePromise:l,handlerOverride:u,scopedContext:d}){let f,g,m=kr(e.method),h=m?"action":"loader",x=S=>{let w,C=new Promise((k,O)=>w=O);g=()=>w(),e.signal.addEventListener("abort",g);let E=k=>typeof S!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${h}" [routeId: ${i.route.id}]`)):S({request:e,url:xO(e,t),pattern:s,params:i.params,context:d},...k!==void 0?[k]:[]),R=(async()=>{try{return{type:"data",result:await(u?u(O=>E(O)):E())}}catch(k){return{type:"error",result:k}}})();return Promise.race([R,C])};try{let S=m?i.route.action:i.route.loader;if(o||l)if(S){let w,[C]=await Promise.all([x(S).catch(E=>{w=E}),o,l]);if(w!==void 0)throw w;f=C}else{await o;let w=m?i.route.action:i.route.loader;if(w)[f]=await Promise.all([x(w),l]);else if(h==="action"){let C=new URL(e.url),E=C.pathname+C.search;throw Ns(405,{method:e.method,pathname:E,routeId:i.route.id})}else return{type:"data",result:void 0}}else if(S)f=await x(S);else{let w=new URL(e.url),C=w.pathname+w.search;throw Ns(404,{pathname:C})}}catch(S){return{type:"error",result:S}}finally{g&&e.signal.removeEventListener("abort",g)}return f}async function s6(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 i6(e){let{result:t,type:s}=e;if(Rb(t)){let i;try{i=await s6(t)}catch(o){return{type:"error",error:o}}return s==="error"?{type:"error",error:new hd(t.status,t.statusText,i),statusCode:t.status,headers:t.headers}:{type:"data",data:i,statusCode:t.status,headers:t.headers}}return s==="error"?lR(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:u6(t),statusCode:Vu(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Vu(t)?t.status:void 0}:lR(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function a6(e,t,s,i,o){let l=e.headers.get("Location");if(_t(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!xb(l)){let u=i.slice(0,i.findIndex(d=>d.route.id===s)+1);l=sv(new URL(t.url),u,o,l),e.headers.set("Location",l)}return e}var o6=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function av(e){try{return o6.includes(new URL(e).protocol)}catch{return!1}}function rR(e,t,s,i){if(xb(e)){let o=e,l=ig.test(o)?new URL(Zk(o,t.protocol)):new URL(o);if(av(l.toString()))throw new Error("Invalid redirect location");let u=ts(l.pathname,s)!=null;if(l.origin===t.origin&&u)return Sb(l.pathname)+l.search+l.hash}try{let o=i.createURL(e);if(av(o.toString()))throw new Error("Invalid redirect location")}catch{}return e}function _l(e,t,s,i){let o=e.createURL(SO(t)).toString(),l={signal:s};if(i&&kr(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=ov(i.formData):l.body=i.formData}return new Request(o,l)}function xO(e,t){let s=new URL(e.url),i=typeof t=="string"?ei(t):t;if(s.pathname=i.pathname||"/",i.search){let o=new URLSearchParams(i.search),l=o.getAll("index");o.delete("index");for(let u of l.filter(Boolean))o.append("index",u);s.search=o.size?`?${o.toString()}`:""}else s.search="";return s.hash=i.hash||"",s}function ov(e){let t=new URLSearchParams;for(let[s,i]of e.entries())t.append(s,typeof i=="string"?i:i.name);return t}function sR(e){let t=new FormData;for(let[s,i]of e.entries())t.append(s,i);return t}function l6(e,t,s,i=!1,o=!1){let l={},u=null,d,f=!1,g={},m=s&&gs(s[1])?s[1].error:void 0;return e.forEach(h=>{if(!(h.route.id in t))return;let x=h.route.id,S=t[x];if(_t(!Mo(S),"Cannot handle redirect results in processLoaderData"),gs(S)){let w=S.error;if(m!==void 0&&(w=m,m=void 0),u=u||{},o)u[x]=w;else{let C=La(e,x);u[C.route.id]==null&&(u[C.route.id]=w)}i||(l[x]=hO),f||(f=!0,d=Vu(S.error)?S.error.status:500),S.headers&&(g[x]=S.headers)}else l[x]=S.data,S.statusCode&&S.statusCode!==200&&!f&&(d=S.statusCode),S.headers&&(g[x]=S.headers)}),m!==void 0&&s&&(u={[s[0]]:m},s[2]&&(l[s[2]]=void 0)),{loaderData:l,errors:u,statusCode:d||200,loaderHeaders:g}}function iR(e,t,s,i,o,l,u){let{loaderData:d,errors:f}=l6(t,s,i);return o.filter(g=>!g.matches||g.matches.some(m=>m.shouldLoad)).forEach(g=>{let{key:m,match:h,controller:x}=g;if(x&&x.signal.aborted)return;let S=l[m];if(_t(S,"Did not find corresponding fetcher result"),gs(S)){let w=La(e.matches,h?.route.id);f&&f[w.route.id]||(f={...f,[w.route.id]:S.error}),u.delete(m)}else if(Mo(S))_t(!1,"Unhandled fetcher revalidation redirect");else{let w=pi(S.data);u.set(m,w)}}),{loaderData:d,errors:f}}function aR(e,t,s,i){let o=Object.entries(t).filter(([,l])=>l!==hO).reduce((l,[u,d])=>(l[u]=d,l),{});for(let l of s){let u=l.route.id;if(!t.hasOwnProperty(u)&&e.hasOwnProperty(u)&&l.route.loader&&(o[u]=e[u]),i&&i.hasOwnProperty(u))break}return o}function oR(e){return e?gs(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function La(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 uh(e){let t=e.length===1?e[0]:e.find(s=>s.index||!s.path||s.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Ns(e,{pathname:t,routeId:s,method:i,type:o,message:l}={}){let u="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(u="Bad Request",i&&t&&s?d=`You made a ${i} request to "${t}" but did not provide a \`loader\` for route "${s}", so there is no way to handle the request.`:o==="invalid-body"&&(d="Unable to encode submission body")):e===403?(u="Forbidden",d=`Route "${s}" does not match URL "${t}"`):e===404?(u="Not Found",d=`No route matches URL "${t}"`):e===405&&(u="Method Not Allowed",i&&t&&s?d=`You made a ${i.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${s}", so there is no way to handle the request.`:i&&(d=`Invalid request method "${i.toUpperCase()}"`)),new hd(e||500,u,new Error(d),!0)}function dh(e){let t=Object.entries(e);for(let s=t.length-1;s>=0;s--){let[i,o]=t[s];if(Mo(o))return{key:i,result:o}}}function SO(e){let t=typeof e=="string"?ei(e):e;return Br({...t,hash:""})}function c6(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function u6(e){return new hd(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function d6(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,s])=>typeof t=="string"&&f6(s))}function f6(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function h6(e){return Rb(e.result)&&dO.has(e.result.status)}function gs(e){return e.type==="error"}function Mo(e){return(e&&e.type)==="redirect"}function lR(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Rb(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function p6(e){return dO.has(e)}function g6(e){return Rb(e)&&p6(e.status)&&e.headers.has("Location")}function m6(e){return K_.has(e.toUpperCase())}function kr(e){return B_.has(e.toUpperCase())}function Cb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Mh(e,t){let s=typeof t=="string"?ei(t).search:t.search;if(e[e.length-1].route.index&&Cb(s||""))return e[e.length-1];let i=aO(e);return i[i.length-1]}function cR(e){let{formMethod:t,formAction:s,formEncType:i,text:o,formData:l,json:u}=e;if(!(!t||!s||!i)){if(o!=null)return{formMethod:t,formAction:s,formEncType:i,formData:void 0,json:void 0,text:o};if(l!=null)return{formMethod:t,formAction:s,formEncType:i,formData:l,json:void 0,text:void 0};if(u!==void 0)return{formMethod:t,formAction:s,formEncType:i,formData:void 0,json:u,text:void 0}}}function vy(e,t,s,i){return i?{state:"loading",location:e,matches:t,historyAction:s,formMethod:i.formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text}:{state:"loading",location:e,matches:t,historyAction:s,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function y6(e,t,s,i){return{state:"submitting",location:e,matches:t,historyAction:s,formMethod:i.formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text}}function mu(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 v6(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 pi(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 b6(e,t){try{let s=e.sessionStorage.getItem(fO);if(s){let i=JSON.parse(s);for(let[o,l]of Object.entries(i||{}))l&&Array.isArray(l)&&t.set(o,new Set(l||[]))}}catch{}}function x6(e,t){if(t.size>0){let s={};for(let[i,o]of t)s[i]=[...o];try{e.sessionStorage.setItem(fO,JSON.stringify(s))}catch(i){Hn(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function uR(){let e,t,s=new Promise((i,o)=>{e=async l=>{i(l);try{await s}catch{}},t=async l=>{o(l);try{await s}catch{}}});return{promise:s,resolve:e,reject:t}}var Ho=b.createContext(null);Ho.displayName="DataRouter";var gd=b.createContext(null);gd.displayName="DataRouterState";var wO=b.createContext(!1);function EO(){return b.useContext(wO)}var Tb=b.createContext({isTransitioning:!1});Tb.displayName="ViewTransition";var RO=b.createContext(new Map);RO.displayName="Fetchers";var S6=b.createContext(null);S6.displayName="Await";var bs=b.createContext(null);bs.displayName="Navigation";var og=b.createContext(null);og.displayName="Location";var zs=b.createContext({outlet:null,matches:[],isDataRoute:!1});zs.displayName="Route";var kb=b.createContext(null);kb.displayName="RouteError";var CO="REACT_ROUTER_ERROR",w6="REDIRECT",E6="ROUTE_ERROR_RESPONSE";function R6(e){if(e.startsWith(`${CO}:${w6}:{`))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 C6(e){if(e.startsWith(`${CO}:${E6}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new hd(t.status,t.statusText,t.data)}catch{}}function T6(e,{relative:t}={}){_t(Fo(),"useHref() may be used only in the context of a <Router> component.");let{basename:s,navigator:i}=b.useContext(bs),{hash:o,pathname:l,search:u}=md(e,{relative:t}),d=l;return s!=="/"&&(d=l==="/"?s:Is([s,l])),i.createHref({pathname:d,search:u,hash:o})}function Fo(){return b.useContext(og)!=null}function Dr(){return _t(Fo(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(og).location}function k6(e){_t(Fo(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Dr();return b.useMemo(()=>Bu(e,iO(t)),[t,e])}var TO="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function kO(e){b.useContext(bs).static||b.useLayoutEffect(e)}function Bo(){let{isDataRoute:e}=b.useContext(zs);return e?K6():O6()}function O6(){_t(Fo(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(Ho),{basename:t,navigator:s}=b.useContext(bs),{matches:i}=b.useContext(zs),{pathname:o}=Dr(),l=JSON.stringify(ag(i)),u=b.useRef(!1);return kO(()=>{u.current=!0}),b.useCallback((f,g={})=>{if(Hn(u.current,TO),!u.current)return;if(typeof f=="number"){s.go(f);return}let m=fd(f,JSON.parse(l),o,g.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Is([t,m.pathname])),Ql(typeof f=="string"?f:Br(f),s.createHref(m),wb(s),"reject"),(g.replace?s.replace:s.push)(m,g.state,g)},[t,s,l,o,e])}var A6=b.createContext(null);function M6(e){let t=b.useContext(zs).outlet;return b.useMemo(()=>t&&b.createElement(A6.Provider,{value:e},t),[t,e])}function N6(){let{matches:e}=b.useContext(zs);return e[e.length-1]?.params??{}}function md(e,{relative:t}={}){let{matches:s}=b.useContext(zs),{pathname:i}=Dr(),o=JSON.stringify(ag(s));return b.useMemo(()=>fd(e,JSON.parse(o),i,t==="path"),[e,o,i,t])}function D6(e,t,s){_t(Fo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=b.useContext(bs),{matches:o}=b.useContext(zs),l=o[o.length-1],u=l?l.params:{},d=l?l.pathname:"/",f=l?l.pathnameBase:"/",g=l&&l.route;{let E=g&&g.path||"";MO(d,!g||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${E}">) 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.
48
+
49
+ Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let m=Dr(),h;h=m;let x=h.pathname||"/",S=x;if(f!=="/"){let E=f.replace(/^\//,"").split("/");S="/"+x.replace(/^\//,"").split("/").slice(E.length).join("/")}let w=s&&s.state.matches.length?s.state.matches.map(E=>Object.assign(E,{route:s.manifest[E.route.id]||E.route})):Wk(e,{pathname:S});return Hn(g||w!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),Hn(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.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.`),z6(w&&w.map(E=>Object.assign({},E,{params:Object.assign({},u,E.params),pathname:Is([f,i.encodeLocation?i.encodeLocation(E.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?f:Is([f,i.encodeLocation?i.encodeLocation(E.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),o,s)}function j6(){let e=F6(),t=Vu(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),s=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",o={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=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:l},"ErrorBoundary")," or"," ",b.createElement("code",{style:l},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),s?b.createElement("pre",{style:o},s):null,u)}var I6=b.createElement(j6,null),OO=class extends b.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 s=C6(e.digest);s&&(e=s)}let t=e!==void 0?b.createElement(zs.Provider,{value:this.props.routeContext},b.createElement(kb.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?b.createElement(P6,{error:e},t):t}};OO.contextType=wO;var by=new WeakMap;function P6({children:e,error:t}){let{basename:s,navigator:i}=b.useContext(bs);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let o=R6(t.digest);if(o){let l=by.get(t);if(l)throw l;let u=lO(o.location,s),d=u.absoluteURL||u.to;if(Ql(o.location,d,wb(i),"allow-explicit"),av(d))throw new Error("Invalid redirect location");if(oO&&!by.get(t))if(u.isExternal||o.reloadDocument)window.location.href=d;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:o.replace}));throw by.set(t,f),f}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d}`})}}return e}function L6({routeContext:e,match:t,children:s}){let i=b.useContext(Ho);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(zs.Provider,{value:e},s)}function z6(e,t=[],s){let i=s?.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let o=e,l=i?.errors;if(l!=null){let m=o.findIndex(h=>h.route.id&&l?.[h.route.id]!==void 0);_t(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),o=o.slice(0,Math.min(o.length,m+1))}let u=!1,d=-1;if(s&&i){u=i.renderFallback;for(let m=0;m<o.length;m++){let h=o[m];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(d=m),h.route.id){let{loaderData:x,errors:S}=i,w=h.route.loader&&!x.hasOwnProperty(h.route.id)&&(!S||S[h.route.id]===void 0);if(h.route.lazy||w){s.isStatic&&(u=!0),d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}}let f=s?.onError,g=i&&f?(m,h)=>{f(m,{location:i.location,params:i.matches?.[0]?.params??{},pattern:pd(i.matches),errorInfo:h})}:void 0;return o.reduceRight((m,h,x)=>{let S,w=!1,C=null,E=null;i&&(S=l&&h.route.id?l[h.route.id]:void 0,C=h.route.errorElement||I6,u&&(d<0&&x===0?(MO("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,E=null):d===x&&(w=!0,E=h.route.hydrateFallbackElement||null)));let R=t.concat(o.slice(0,x+1)),k=()=>{let O;return S?O=C:w?O=E:h.route.Component?O=b.createElement(h.route.Component,null):h.route.element?O=h.route.element:O=m,b.createElement(L6,{match:h,routeContext:{outlet:m,matches:R,isDataRoute:i!=null},children:O})};return i&&(h.route.ErrorBoundary||h.route.errorElement||x===0)?b.createElement(OO,{location:i.location,revalidation:i.revalidation,component:C,error:S,children:k(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:g}):k()},null)}function Ob(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function AO(e){let t=b.useContext(Ho);return _t(t,Ob(e)),t}function Ab(e){let t=b.useContext(gd);return _t(t,Ob(e)),t}function _6(e){let t=b.useContext(zs);return _t(t,Ob(e)),t}function Mb(e){let t=_6(e),s=t.matches[t.matches.length-1];return _t(s.route.id,`${e} can only be used on routes that contain a unique "id"`),s.route.id}function U6(){return Mb("useRouteId")}function H6(){let{matches:e,loaderData:t}=Ab("useMatches");return b.useMemo(()=>e.map(s=>eO(s,t)),[e,t])}function F6(){let e=b.useContext(kb),t=Ab("useRouteError"),s=Mb("useRouteError");return e!==void 0?e:t.errors?.[s]}var B6=0;function V6(e){let{router:t,basename:s}=AO("useBlocker"),i=Ab("useBlocker"),[o,l]=b.useState(""),u=b.useCallback(d=>{if(typeof e!="function")return!!e;if(s==="/")return e(d);let{currentLocation:f,nextLocation:g,historyAction:m}=d;return e({currentLocation:{...f,pathname:ts(f.pathname,s)||f.pathname},nextLocation:{...g,pathname:ts(g.pathname,s)||g.pathname},historyAction:m})},[s,e]);return b.useEffect(()=>{let d=String(++B6);return l(d),()=>t.deleteBlocker(d)},[t]),b.useEffect(()=>{o!==""&&t.getBlocker(o,u)},[t,o,u]),o&&i.blockers.has(o)?i.blockers.get(o):Pl}function K6(){let{router:e}=AO("useNavigate"),t=Mb("useNavigate"),s=b.useRef(!1);return kO(()=>{s.current=!0}),b.useCallback(async(o,l={})=>{Hn(s.current,TO),s.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...l}))},[e,t])}var dR={};function MO(e,t,s){!t&&!dR[e]&&(dR[e]=!0,Hn(!1,s))}var fR={};function hR(e,t){!e&&!fR[t]&&(fR[t]=!0,console.warn(t))}var q6="useOptimistic",pR=qR[q6],Y6=()=>{};function G6(e){return pR?pR(e):[e,Y6]}function $6(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Hn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:b.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Hn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:b.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Hn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:b.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Q6=["HydrateFallback","hydrateFallbackElement"],X6=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=s=>{this.status==="pending"&&(this.status="resolved",e(s))},this.reject=s=>{this.status==="pending"&&(this.status="rejected",t(s))}})}};function Z6({router:e,flushSync:t,onError:s,useTransitions:i}){i=EO()||i;let[l,u]=b.useState(e.state),[d,f]=G6(l),[g,m]=b.useState(),[h,x]=b.useState({isTransitioning:!1}),[S,w]=b.useState(),[C,E]=b.useState(),[R,k]=b.useState(),O=b.useRef(new Map),A=b.useCallback((M,{deletedFetchers:_,newErrors:L,flushSync:q,viewTransitionOpts:X})=>{L&&s&&Object.values(L).forEach(H=>s(H,{location:M.location,params:M.matches[0]?.params??{},pattern:pd(M.matches)})),M.fetchers.forEach((H,U)=>{H.data!==void 0&&O.current.set(U,H.data)}),_.forEach(H=>O.current.delete(H)),hR(q===!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 B=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(hR(X==null||B,"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."),!X||!B){t&&q?t(()=>u(M)):i===!1?u(M):b.startTransition(()=>{i===!0&&f(H=>gR(H,M)),u(M)});return}if(t&&q){t(()=>{C&&(S?.resolve(),C.skipTransition()),x({isTransitioning:!0,flushSync:!0,currentLocation:X.currentLocation,nextLocation:X.nextLocation})});let H=e.window.document.startViewTransition(()=>{t(()=>u(M))});H.finished.finally(()=>{t(()=>{w(void 0),E(void 0),m(void 0),x({isTransitioning:!1})})}),t(()=>E(H));return}C?(S?.resolve(),C.skipTransition(),k({state:M,currentLocation:X.currentLocation,nextLocation:X.nextLocation})):(m(M),x({isTransitioning:!0,flushSync:!1,currentLocation:X.currentLocation,nextLocation:X.nextLocation}))},[e.window,t,C,S,i,f,s]);b.useLayoutEffect(()=>e.subscribe(A),[e,A]),b.useEffect(()=>{h.isTransitioning&&!h.flushSync&&w(new X6)},[h]),b.useEffect(()=>{if(S&&g&&e.window){let M=g,_=S.promise,L=e.window.document.startViewTransition(async()=>{i===!1?u(M):b.startTransition(()=>{i===!0&&f(q=>gR(q,M)),u(M)}),await _});L.finished.finally(()=>{w(void 0),E(void 0),m(void 0),x({isTransitioning:!1})}),E(L)}},[g,S,e.window,i,f]),b.useEffect(()=>{S&&g&&d.location.key===g.location.key&&S.resolve()},[S,C,d.location,g]),b.useEffect(()=>{!h.isTransitioning&&R&&(m(R.state),x({isTransitioning:!0,flushSync:!1,currentLocation:R.currentLocation,nextLocation:R.nextLocation}),k(void 0))},[h.isTransitioning,R]);let N=b.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:M=>e.navigate(M),push:(M,_,L)=>e.navigate(M,{state:_,preventScrollReset:L?.preventScrollReset}),replace:(M,_,L)=>e.navigate(M,{replace:!0,state:_,preventScrollReset:L?.preventScrollReset})}),[e]),j=e.basename||"/",D=b.useMemo(()=>({router:e,navigator:N,static:!1,basename:j,onError:s}),[e,N,j,s]);return b.createElement(b.Fragment,null,b.createElement(Ho.Provider,{value:D},b.createElement(gd.Provider,{value:d},b.createElement(RO.Provider,{value:O.current},b.createElement(Tb.Provider,{value:h},b.createElement(t8,{basename:j,location:d.location,navigationType:d.historyAction,navigator:N,useTransitions:i},b.createElement(J6,{routes:e.routes,manifest:e.manifest,future:e.future,state:d,isStatic:!1,onError:s})))))),null)}function gR(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 J6=b.memo(W6);function W6({routes:e,manifest:t,future:s,state:i,isStatic:o,onError:l}){return D6(e,void 0,{manifest:t,state:i,isStatic:o,onError:l})}function e8({to:e,replace:t,state:s,relative:i}){_t(Fo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o,navigator:l}=b.useContext(bs);Hn(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=b.useContext(zs),{pathname:d}=Dr(),f=Bo(),g=fd(e,ag(u),d,i==="path");Ql(typeof e=="string"?e:Br(e),l.createHref(g),wb(l),"reject");let m=JSON.stringify(g);return b.useEffect(()=>{f(JSON.parse(m),{replace:t,state:s,relative:i})},[f,m,i,t,s]),null}function NO(e){return M6(e.context)}function t8({basename:e="/",children:t=null,location:s,navigationType:i="POP",navigator:o,static:l=!1,useTransitions:u}){_t(!Fo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),f=b.useMemo(()=>({basename:d,navigator:o,static:l,useTransitions:u,future:{}}),[d,o,l,u]);typeof s=="string"&&(s=ei(s));let{pathname:g="/",search:m="",hash:h="",state:x=null,key:S="default",mask:w}=s,C=b.useMemo(()=>{let E=ts(g,d);return E==null?null:{location:{pathname:E,search:m,hash:h,state:x,key:S,mask:w},navigationType:i}},[d,g,m,h,x,S,i,w]);return Hn(C!=null,`<Router basename="${d}"> is not able to match the URL "${g}${m}${h}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:b.createElement(bs.Provider,{value:f},b.createElement(og.Provider,{children:t,value:C}))}var Nh="get",Dh="application/x-www-form-urlencoded";function lg(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function n8(e){return lg(e)&&e.tagName.toLowerCase()==="button"}function r8(e){return lg(e)&&e.tagName.toLowerCase()==="form"}function s8(e){return lg(e)&&e.tagName.toLowerCase()==="input"}function i8(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function a8(e,t){return e.button===0&&(!t||t==="_self")&&!i8(e)}function lv(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,s)=>{let i=e[s];return t.concat(Array.isArray(i)?i.map(o=>[s,o]):[[s,i]])},[]))}function o8(e,t){let s=lv(e);return t&&t.forEach((i,o)=>{s.has(o)||t.getAll(o).forEach(l=>{s.append(o,l)})}),s}var fh=null;function l8(){if(fh===null)try{new FormData(document.createElement("form"),0),fh=!1}catch{fh=!0}return fh}var c8=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function xy(e){return e!=null&&!c8.has(e)?(Hn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Dh}"`),null):e}function u8(e,t){let s,i,o,l,u;if(r8(e)){let d=e.getAttribute("action");i=d?ts(d,t):null,s=e.getAttribute("method")||Nh,o=xy(e.getAttribute("enctype"))||Dh,l=new FormData(e)}else if(n8(e)||s8(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 f=e.getAttribute("formaction")||d.getAttribute("action");if(i=f?ts(f,t):null,s=e.getAttribute("formmethod")||d.getAttribute("method")||Nh,o=xy(e.getAttribute("formenctype"))||xy(d.getAttribute("enctype"))||Dh,l=new FormData(d,e),!l8()){let{name:g,type:m,value:h}=e;if(m==="image"){let x=g?`${g}.`:"";l.append(`${x}x`,"0"),l.append(`${x}y`,"0")}else g&&l.append(g,h)}}else{if(lg(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');s=Nh,i=null,o=Dh,u=e}return l&&o==="text/plain"&&(u=l,l=void 0),{action:i,method:s.toLowerCase(),encType:o,formData:l,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Nb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function DO(e,t,s,i){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return s?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${i}`:o.pathname=`${o.pathname}.${i}`:o.pathname==="/"?o.pathname=`_root.${i}`:t&&ts(o.pathname,t)==="/"?o.pathname=`${ic(t)}/_root.${i}`:o.pathname=`${ic(o.pathname)}.${i}`,o}async function d8(e,t){if(e.id in t)return t[e.id];try{let s=await import(e.module);return t[e.id]=s,s}catch(s){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(s),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function f8(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 h8(e,t,s){let i=await Promise.all(e.map(async o=>{let l=t.routes[o.route.id];if(l){let u=await d8(l,s);return u.links?u.links():[]}return[]}));return y8(i.flat(1).filter(f8).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function mR(e,t,s,i,o,l){let u=(f,g)=>s[g]?f.route.id!==s[g].route.id:!0,d=(f,g)=>s[g].pathname!==f.pathname||s[g].route.path?.endsWith("*")&&s[g].params["*"]!==f.params["*"];return l==="assets"?t.filter((f,g)=>u(f,g)||d(f,g)):l==="data"?t.filter((f,g)=>{let m=i.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(u(f,g)||d(f,g))return!0;if(f.route.shouldRevalidate){let h=f.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:s[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function p8(e,t,{includeHydrateFallback:s}={}){return g8(e.map(i=>{let o=t.routes[i.route.id];if(!o)return[];let l=[o.module];return o.clientActionModule&&(l=l.concat(o.clientActionModule)),o.clientLoaderModule&&(l=l.concat(o.clientLoaderModule)),s&&o.hydrateFallbackModule&&(l=l.concat(o.hydrateFallbackModule)),o.imports&&(l=l.concat(o.imports)),l}).flat(1))}function g8(e){return[...new Set(e)]}function m8(e){let t={},s=Object.keys(e).sort();for(let i of s)t[i]=e[i];return t}function y8(e,t){let s=new Set;return new Set(t),e.reduce((i,o)=>{let l=JSON.stringify(m8(o));return s.has(l)||(s.add(l),i.push({key:l,link:o})),i},[])}function Db(){let e=b.useContext(Ho);return Nb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function v8(){let e=b.useContext(gd);return Nb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var jb=b.createContext(void 0);jb.displayName="FrameworkContext";function cg(){let e=b.useContext(jb);return Nb(e,"You must render this element inside a <HydratedRouter> element"),e}function b8(e,t){let s=b.useContext(jb),[i,o]=b.useState(!1),[l,u]=b.useState(!1),{onFocus:d,onBlur:f,onMouseEnter:g,onMouseLeave:m,onTouchStart:h}=t,x=b.useRef(null);b.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let C=R=>{R.forEach(k=>{u(k.isIntersecting)})},E=new IntersectionObserver(C,{threshold:.5});return x.current&&E.observe(x.current),()=>{E.disconnect()}}},[e]),b.useEffect(()=>{if(i){let C=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(C)}}},[i]);let S=()=>{o(!0)},w=()=>{o(!1),u(!1)};return s?e!=="intent"?[l,x,{}]:[l,x,{onFocus:yu(d,S),onBlur:yu(f,w),onMouseEnter:yu(g,S),onMouseLeave:yu(m,w),onTouchStart:yu(h,S)}]:[!1,x,{}]}function yu(e,t){return s=>{e&&e(s),s.defaultPrevented||t(s)}}function x8({page:e,...t}){let s=EO(),{nonce:i}=cg(),{router:o}=Db(),l=b.useMemo(()=>Wk(o.routes,e,o.basename),[o.routes,e,o.basename]);return l?(t.nonce==null&&i&&(t={...t,nonce:i}),s?b.createElement(w8,{page:e,matches:l,...t}):b.createElement(E8,{page:e,matches:l,...t})):null}function S8(e){let{manifest:t,routeModules:s}=cg(),[i,o]=b.useState([]);return b.useEffect(()=>{let l=!1;return h8(e,t,s).then(u=>{l||o(u)}),()=>{l=!0}},[e,t,s]),i}function w8({page:e,matches:t,...s}){let i=Dr(),{future:o}=cg(),{basename:l}=Db(),u=b.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let d=DO(e,l,o.v8_trailingSlashAwareDataRequests,"rsc"),f=!1,g=[];for(let m of t)typeof m.route.shouldRevalidate=="function"?f=!0:g.push(m.route.id);return f&&g.length>0&&d.searchParams.set("_routes",g.join(",")),[d.pathname+d.search]},[l,o.v8_trailingSlashAwareDataRequests,e,i,t]);return b.createElement(b.Fragment,null,u.map(d=>b.createElement("link",{key:d,rel:"prefetch",as:"fetch",href:d,...s})))}function E8({page:e,matches:t,...s}){let i=Dr(),{future:o,manifest:l,routeModules:u}=cg(),{basename:d}=Db(),{loaderData:f,matches:g}=v8(),m=b.useMemo(()=>mR(e,t,g,l,i,"data"),[e,t,g,l,i]),h=b.useMemo(()=>mR(e,t,g,l,i,"assets"),[e,t,g,l,i]),x=b.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let C=new Set,E=!1;if(t.forEach(k=>{let O=l.routes[k.route.id];!O||!O.hasLoader||(!m.some(A=>A.route.id===k.route.id)&&k.route.id in f&&u[k.route.id]?.shouldRevalidate||O.hasClientLoader?E=!0:C.add(k.route.id))}),C.size===0)return[];let R=DO(e,d,o.v8_trailingSlashAwareDataRequests,"data");return E&&C.size>0&&R.searchParams.set("_routes",t.filter(k=>C.has(k.route.id)).map(k=>k.route.id).join(",")),[R.pathname+R.search]},[d,o.v8_trailingSlashAwareDataRequests,f,i,l,m,t,e,u]),S=b.useMemo(()=>p8(h,l),[h,l]),w=S8(h);return b.createElement(b.Fragment,null,x.map(C=>b.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...s})),S.map(C=>b.createElement("link",{key:C,rel:"modulepreload",href:C,...s})),w.map(({key:C,link:E})=>b.createElement("link",{key:C,nonce:s.nonce,...E,crossOrigin:E.crossOrigin??s.crossOrigin})))}function R8(...e){return t=>{e.forEach(s=>{typeof s=="function"?s(t):s!=null&&(s.current=t)})}}var C8=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{C8&&(window.__reactRouterVersion="7.18.5")}catch{}function T8(e,t){return Q_({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:d_({window:t?.window}),hydrationData:k8(),routes:e,mapRouteProperties:$6,hydrationRouteProperties:Q6,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function k8(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:O8(e.errors)}),e}function O8(e){if(!e)return null;let t=Object.entries(e),s={};for(let[i,o]of t)if(o&&o.__type==="RouteErrorResponse")s[i]=new hd(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(typeof o.__subType=="string"&&I_.includes(o.__subType)){let l=window[o.__subType];if(typeof l=="function")try{let u=new l(o.message);u.stack="",s[i]=u}catch{}}if(s[i]==null){let l=new Error(o.message);l.stack="",s[i]=l}}else s[i]=o;return s}var yd=b.forwardRef(function({onClick:t,discover:s="render",prefetch:i="none",relative:o,reloadDocument:l,replace:u,mask:d,state:f,target:g,to:m,preventScrollReset:h,viewTransition:x,defaultShouldRevalidate:S,...w},C){let{basename:E,navigator:R,useTransitions:k}=b.useContext(bs),O=typeof m=="string"&&sg.test(m),A=lO(m,E);m=A.to;let N=T6(m,{relative:o}),j=Dr(),D=null;if(d){let U=fd(d,[],j.mask?j.mask.pathname:"/",!0);E!=="/"&&(U.pathname=U.pathname==="/"?E:Is([E,U.pathname])),D=R.createHref(U)}let[M,_,L]=b8(i,w),q=N8(m,{replace:u,mask:d,state:f,target:g,preventScrollReset:h,relative:o,viewTransition:x,defaultShouldRevalidate:S,useTransitions:k});function X(U){t&&t(U),U.defaultPrevented||q(U)}let B=!(A.isExternal||l),H=b.createElement("a",{...w,...L,href:(B?D:void 0)||A.absoluteURL||N,onClick:B?X:t,ref:R8(C,_),target:g,"data-discover":!O&&s==="render"?"true":void 0});return M&&!O?b.createElement(b.Fragment,null,H,b.createElement(x8,{page:N})):H});yd.displayName="Link";var Mu=b.forwardRef(function({"aria-current":t="page",caseSensitive:s=!1,className:i="",end:o=!1,style:l,to:u,viewTransition:d,children:f,...g},m){let h=md(u,{relative:g.relative}),x=Dr(),S=b.useContext(gd),{navigator:w,basename:C}=b.useContext(bs),E=S!=null&&_8(h)&&d===!0,R=w.encodeLocation?w.encodeLocation(h).pathname:h.pathname,k=x.pathname,O=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;s||(k=k.toLowerCase(),O=O?O.toLowerCase():null,R=R.toLowerCase()),O&&C&&(O=ts(O,C)||O);const A=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let N=k===R||!o&&k.startsWith(R)&&k.charAt(A)==="/",j=O!=null&&(O===R||!o&&O.startsWith(R)&&O.charAt(R.length)==="/"),D={isActive:N,isPending:j,isTransitioning:E},M=N?t:void 0,_;typeof i=="function"?_=i(D):_=[i,N?"active":null,j?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let L=typeof l=="function"?l(D):l;return b.createElement(yd,{...g,"aria-current":M,className:_,ref:m,style:L,to:u,viewTransition:d},typeof f=="function"?f(D):f)});Mu.displayName="NavLink";var A8=b.forwardRef(({discover:e="render",fetcherKey:t,navigate:s,reloadDocument:i,replace:o,state:l,method:u=Nh,action:d,onSubmit:f,relative:g,preventScrollReset:m,viewTransition:h,defaultShouldRevalidate:x,...S},w)=>{let{useTransitions:C}=b.useContext(bs),E=P8(),R=L8(d,{relative:g}),k=u.toLowerCase()==="get"?"get":"post",O=typeof d=="string"&&sg.test(d),A=N=>{if(f&&f(N),N.defaultPrevented)return;N.preventDefault();let j=N.nativeEvent.submitter,D=j?.getAttribute("formmethod")||u,M=()=>E(j||N.currentTarget,{fetcherKey:t,method:D,navigate:s,replace:o,state:l,relative:g,preventScrollReset:m,viewTransition:h,defaultShouldRevalidate:x});C&&s!==!1?b.startTransition(()=>M()):M()};return b.createElement("form",{ref:w,method:k,action:R,onSubmit:i?f:A,...S,"data-discover":!O&&e==="render"?"true":void 0})});A8.displayName="Form";function M8(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jO(e){let t=b.useContext(Ho);return _t(t,M8(e)),t}function N8(e,{target:t,replace:s,mask:i,state:o,preventScrollReset:l,relative:u,viewTransition:d,defaultShouldRevalidate:f,useTransitions:g}={}){let m=Bo(),h=Dr(),x=md(e,{relative:u});return b.useCallback(S=>{if(a8(S,t)){S.preventDefault();let w=s!==void 0?s:Br(h)===Br(x),C=()=>m(e,{replace:w,mask:i,state:o,preventScrollReset:l,relative:u,viewTransition:d,defaultShouldRevalidate:f});g?b.startTransition(()=>C()):C()}},[h,m,x,s,i,o,t,e,l,u,d,f,g])}function D8(e){Hn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=b.useRef(lv(e)),s=b.useRef(!1),i=Dr(),o=b.useMemo(()=>o8(i.search,s.current?null:t.current),[i.search]),l=Bo(),u=b.useCallback((d,f)=>{const g=lv(typeof d=="function"?d(new URLSearchParams(o)):d);s.current=!0,l("?"+g,f)},[l,o]);return[o,u]}var j8=0,I8=()=>`__${String(++j8)}__`;function P8(){let{router:e}=jO("useSubmit"),{basename:t}=b.useContext(bs),s=U6(),i=e.fetch,o=e.navigate;return b.useCallback(async(l,u={})=>{let{action:d,method:f,encType:g,formData:m,body:h}=u8(l,t);if(u.navigate===!1){let x=u.fetcherKey||I8();await i(x,s,u.action||d,{defaultShouldRevalidate:u.defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:m,body:h,formMethod:u.method||f,formEncType:u.encType||g,flushSync:u.flushSync})}else await o(u.action||d,{defaultShouldRevalidate:u.defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:m,body:h,formMethod:u.method||f,formEncType:u.encType||g,replace:u.replace,state:u.state,fromRouteId:s,flushSync:u.flushSync,viewTransition:u.viewTransition})},[i,o,t,s])}function L8(e,{relative:t}={}){let{basename:s}=b.useContext(bs),i=b.useContext(zs);_t(i,"useFormAction must be used inside a RouteContext");let[o]=i.matches.slice(-1),l={...md(e||".",{relative:t})},u=Dr();if(e==null){l.search=u.search;let d=new URLSearchParams(l.search),f=d.getAll("index");if(f.some(m=>m==="")){d.delete("index"),f.filter(h=>h).forEach(h=>d.append("index",h));let m=d.toString();l.search=m?`?${m}`:""}}return(!e||e===".")&&o.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),s!=="/"&&(l.pathname=l.pathname==="/"?s:Is([s,l.pathname])),Br(l)}function z8(e,t){let{capture:s}={};b.useEffect(()=>{let i=s!=null?{capture:s}:void 0;return window.addEventListener("beforeunload",e,i),()=>{window.removeEventListener("beforeunload",e,i)}},[e,s])}function _8(e,{relative:t}={}){let s=b.useContext(Tb);_t(s!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=jO("useViewTransitionState"),o=md(e,{relative:t});if(!s.isTransitioning)return!1;let l=ts(s.currentLocation.pathname,i)||s.currentLocation.pathname,u=ts(s.nextLocation.pathname,i)||s.nextLocation.pathname;return Bu(o.pathname,u)!=null||Bu(o.pathname,l)!=null}function U8(e){return b.createElement(Z6,{flushSync:hr.flushSync,...e})}function Ji({controlled:e,default:t,name:s,state:i="value"}){const{current:o}=b.useRef(e!==void 0),[l,u]=b.useState(()=>t),d=o&&e!==void 0?e:l,f=b.useCallback(g=>{o||u(g)},[]);return[d,f]}function H8(e){const{open:t,defaultOpen:s=!1,onOpenChange:i,disabled:o}=e,[l,u]=Ji({controlled:t,default:s,name:"Collapsible",state:"open"}),{mounted:d,setMounted:f,transitionStatus:g}=_o(l,!0,!0),m=ar(),[h,x]=b.useState(),S=h===null?void 0:h??m,w=Be(C=>{const E=!l,R=ut(Qs,C.nativeEvent);i(E,R),!R.isCanceled&&u(E)});return b.useMemo(()=>({defaultPanelId:m,disabled:o,handleTrigger:w,mounted:d,open:l,panelId:S,setMounted:f,setOpen:u,setPanelIdState:x,transitionStatus:g}),[m,o,w,d,l,S,f,u,x,g])}const IO=b.createContext(void 0);function PO(){const e=b.useContext(IO);if(e===void 0)throw new Error(gn(15));return e}const F8="data-open",B8="data-closed",hh=Av,V8="data-panel-open",K8={[F8]:""},q8={[B8]:""},Y8={open(e){return e?{[V8]:""}:null}},G8={open(e){return e?K8:q8}},LO={...G8,...wi},$8=b.forwardRef(function(t,s){const{render:i,className:o,defaultOpen:l=!1,disabled:u=!1,onOpenChange:d,open:f,style:g,...m}=t,h=Be(d),x=H8({open:f,defaultOpen:l,onOpenChange:h,disabled:u}),S=b.useMemo(()=>({open:x.open,disabled:x.disabled,transitionStatus:x.transitionStatus}),[x.open,x.disabled,x.transitionStatus]),w=b.useMemo(()=>({...x,onOpenChange:h,state:S}),[x,h,S]),C=kt("div",t,{state:S,ref:s,props:m,stateAttributesMapping:LO});return v.jsx(IO.Provider,{value:w,children:C})}),Q8={...Y8,...wi},X8=b.forwardRef(function(t,s){const{panelId:i,open:o,handleTrigger:l,state:u,disabled:d}=PO(),{className:f,disabled:g=d,render:m,nativeButton:h=!0,style:x,...S}=t,{getButtonProps:w,buttonRef:C}=vs({disabled:g,native:h});return kt("button",t,{state:u,ref:[s,C],props:[{"aria-controls":o?i:void 0,"aria-expanded":o,onClick:l},S,w],stateAttributesMapping:Q8})}),jl={height:void 0,width:void 0};function Z8(e){const{externalRef:t,hiddenUntilFound:s,id:i,keepMounted:o,mounted:l,onOpenChange:u,open:d,setMounted:f,setOpen:g,transitionStatus:m}=e,h=b.useRef(null),x=b.useRef(null),[S,w]=b.useState(jl),C=b.useRef(jl),E=b.useRef(!1),R=b.useRef(d),k=b.useRef(!1),[O,A]=b.useState(!1),N=b.useRef(null),j=es(t,h),D=Ln(d),M=jp(h),_=!d&&!l,L=O?"idle":m,q=d&&(R.current||k.current),X=!d&&l&&x.current==="css-animation"&&S.height===void 0&&S.width===void 0?C.current:S,B=s&&_&&x.current!=="css-animation",H=Be((K,Y=!0)=>{Y&&(C.current=K),w(K)}),U=Be(()=>{N.current?.(),N.current=null}),z=Be(K=>{U(),N.current=()=>{N.current=null,K()}}),Q=Be(()=>{d&&l&&x.current==="css-animation"&&(k.current=!0)});_e(()=>{!O||m==="starting"||A(!1)},[O,m]),b.useEffect(()=>()=>{Q(),U()},[Q,U]),_e(()=>{d||(R.current=!1,k.current=!1);const K=h.current;if(!K)return;!d&&N.current&&U();const Y=J8(K,q);if(x.current=Y,d&&m==="idle"&&R.current&&Y==="css-animation"){C.current=Il(K);return}if(d&&m==="starting"){const oe=E.current;if(E.current=!1,Y==="none"){H(Il(K)),A(!0);return}if(Y==="css-transition"){const W=W8(K);if(H(Il(K)),!oe)return W;const re=ph(K,"transition-duration","0s");return z(re),A(!0),W}H(Il(K));const I=ph(K,"animation-name","none");if(!oe){I();return}const V=ph(K,"animation-duration","0s");I(),z(V),A(!0);return}if(!d&&l&&(m==="idle"||m==="starting")){if(Y==="none"){H(jl,!1),f(!1);return}H(Il(K));return}if(m!=="ending")return;if(Y==="none"){f(!1);return}const ee=Il(K);if(!(ee.height>0||ee.width>0)){f(!1);return}H(ee),Y==="css-animation"&&ph(K,"animation-name","none")()},[l,d,U,H,f,z,q,m]),Ls({enabled:d&&l&&L==="idle",open:!0,ref:h,onComplete(){d&&H(jl,!1)}}),b.useEffect(()=>{if(d||!l||L!=="ending")return;if(!h.current){f(!1),H(jl,!1);return}const Y=new AbortController;let ee=-1;function G(){D.current||(f(!1),H(jl,!1))}return ee=Or.request(()=>{M(G,Y.signal)}),()=>{Or.cancel(ee),Y.abort()}},[D,l,d,L,M,H,f]),_e(()=>{const K=h.current;!K||!s||!_||K.setAttribute("hidden","until-found")},[_,s]),b.useEffect(function(){const Y=h.current;if(!Y)return;const ee=Ps.create();let G=-1;const oe=(W,re)=>{ee.start(0,()=>{D.current||(G=Or.request(()=>{D.current||(W&&(E.current=!1),re&&Y.setAttribute(hh,""),Y.setAttribute("hidden","until-found"))}))})},V=Lt(Y,"beforematch",W=>{const re=ut(Mr,W);if(u(!0,re),re.isCanceled){oe(!1,!1);return}E.current=!0;const Ee=Y.hasAttribute(hh);Y.removeAttribute(hh),g(!0),oe(!0,Ee)});return()=>{ee.clear(),Or.cancel(G),V()}},[D,u,g]);const $=o||s||l||d;return{height:X.height,props:{...B?{[hh]:""}:void 0,hidden:_,id:i},ref:j,shouldPreventOpenAnimation:q,shouldRender:$,transitionStatus:L,width:X.width}}function Il(e){return{height:e.scrollHeight,width:e.scrollWidth}}function J8(e,t){const s=Rn(e).getComputedStyle(e),i=(s.animationName.split(",").map(l=>l.trim()).some(l=>l!==""&&l!=="none")||t)&&yR(s.animationDuration),o=yR(s.transitionDuration);return i&&o||o?"css-transition":i?"css-animation":"none"}function yR(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function ph(e,t,s){const i=e.style.getPropertyValue(t),o=e.style.getPropertyPriority(t);return e.style.setProperty(t,s),()=>{if(i===""){e.style.removeProperty(t);return}e.style.setProperty(t,i,o)}}function W8(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(o=>{e.style.setProperty(o,"initial","important")});function s(){Object.entries(t).forEach(([o,l])=>{if(l===""){e.style.removeProperty(o);return}e.style.setProperty(o,l)})}const i=Or.request(s);return()=>{Or.cancel(i),s()}}const eU="--collapsible-panel-height",tU="--collapsible-panel-width",nU=b.forwardRef(function(t,s){const{className:i,hiddenUntilFound:o,keepMounted:l,render:u,id:d,style:f,...g}=t,{defaultPanelId:m,mounted:h,onOpenChange:x,open:S,setMounted:w,setPanelIdState:C,setOpen:E,state:R,transitionStatus:k}=PO(),O=o??!1,A=l??!1,N=d||void 0,j=N??m;_e(()=>(C(Q=>N??(Q===null?void 0:Q)),()=>{C(Q=>Q===N?null:Q)}),[N,C]);const{height:D,props:M,ref:_,shouldPreventOpenAnimation:L,shouldRender:q,transitionStatus:X,width:B}=Z8({externalRef:s,hiddenUntilFound:O,id:j,keepMounted:A,mounted:h,onOpenChange:x,open:S,setMounted:w,setOpen:E,transitionStatus:k}),H={...R,transitionStatus:X},U=vC(f,H),z=kt("div",{...t,style:void 0},{state:H,ref:_,props:[M,{style:{[eU]:D===void 0?"auto":`${D}px`,[tU]:B===void 0?"auto":`${B}px`}},g,U?{style:U}:void 0,L?{style:{animationName:"none"}}:void 0],stateAttributesMapping:LO});return q?z:null});function rU({...e}){return v.jsx($8,{"data-slot":"collapsible",...e})}function sU({...e}){return v.jsx(X8,{"data-slot":"collapsible-trigger",...e})}function iU({...e}){return v.jsx(nU,{"data-slot":"collapsible-content",...e})}const zO=b.createContext(void 0);function aU(e){const t=b.useContext(zO);if(t===void 0)throw new Error(gn(33));return t}const ug=b.createContext(void 0);function ra(e){const t=b.useContext(ug);if(t===void 0&&!e)throw new Error(gn(36));return t}const _O=b.createContext(void 0);function dg(e=!0){const t=b.useContext(_O);if(t===void 0&&!e)throw new Error(gn(25));return t}const UO=b.createContext(null);function fg(e="root"){const t=b.useContext(UO),s=b.useContext(ug);return t===null||s===void 0?null:(e==="submenu-trigger"?s.virtualFocus||s.parentVirtualFocus:s.virtualFocus)?t:null}const oU={visible:!0,ref:null};function lU(){return oU}function HO(e,t,s="root"){const i=fg(s),l=((s==="submenu-trigger"?i?.useSubmenuTrigger:i?.useItem)??lU)({label:e.label,children:e.children,render:e.render}),u=es(t,l.ref);return{visible:l.visible,ref:u,props:l.props}}function cU(e){e.preventDefault()}function uU(e){const{closeOnClick:t,highlighted:s,id:i,nodeId:o,store:l,typingRef:u,itemRef:d,itemMetadata:f}=e,g=ra(),m=dg(!0),h=f.type==="submenu-trigger",x=h?g.parentVirtualFocus:g.virtualFocus,w=(h&&g.parent.type==="menu"?g.parent.store:g.store).useState("webkitAriaSelected",s),{events:C}=l.useState("floatingTreeRoot"),E=l.useState("open"),R=m!==void 0,k=!x&&E&&s?0:-1;return b.useMemo(()=>({id:i,role:"menuitem",tabIndex:k,"aria-selected":w,onMouseDown:x?cU:void 0,onKeyDown(O){O.key===" "&&u?.current&&O.preventDefault()},onMouseMove(O){o&&C.emit("itemhover",{nodeId:o,target:O.currentTarget})},onClick(O){t&&C.emit("close",{domEvent:O.nativeEvent,reason:No})},onMouseUp(O){if(m){const A=m.initialCursorPointRef.current;if(m.initialCursorPointRef.current=null,R&&A&&Math.abs(O.clientX-A.x)<=1&&Math.abs(O.clientY-A.y)<=1||R&&!wv&&O.button===2)return}d.current&&l.context.allowMouseUpTriggerRef.current&&(!R||O.button===2)&&f.type==="regular-item"&&Do(d.current,O,{detail:1,pointerType:"mouse"})}}),[t,k,i,C,o,l.context.allowMouseUpTriggerRef,u,d,m,R,f.type,w,x])}const FO={type:"regular-item"};function BO(e){const{closeOnClick:t,disabled:s,highlighted:i,id:o,store:l,typingRef:u=l.context.typingRef,nativeButton:d,itemMetadata:f,nodeId:g}=e,m=b.useRef(null),{getButtonProps:h,buttonRef:x}=vs({disabled:s,focusableWhenDisabled:!0,native:d,composite:!0}),S=uU({closeOnClick:t,highlighted:i,id:o,nodeId:g,store:l,typingRef:u,itemRef:m,itemMetadata:f}),w=b.useCallback(E=>Ar(S,{onMouseEnter(R){f.type==="submenu-trigger"&&f.setActive(R.nativeEvent)}},E,h),[S,h,f]),C=es(m,x);return b.useMemo(()=>({getItemProps:w,itemRef:C}),[w,C])}const VO=b.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function dU(){return b.useContext(VO)}function hg(e={}){const{guess:t,label:s,metadata:i,textRef:o,index:l}=e,{register:u,unregister:d,subscribeMapChange:f,nextIndexRef:g}=dU(),m=b.useRef(-1),[h,x]=b.useState(l==null&&t?()=>{if(m.current===-1){const E=g.current;g.current+=1,m.current=E}return m.current}:-1),S=l??h,w=b.useRef(null),C=b.useCallback(E=>{const R=w.current;R&&d(R),w.current=E,E&&u(E,{metadata:i??null,index:l??null,label:s,textRef:o})},[l,u,d,i,s,o]);return _e(()=>{if(l==null)return f(E=>{const R=w.current?E.get(w.current)?.index:null;R!=null&&x(R)})},[l,f]),{ref:C,index:S}}const fU="data-checked",hU="data-unchecked",KO={checked(e){return e?{[fU]:""}:{[hU]:""}},...wi},Ib=b.createContext(void 0);function pU(){const e=b.useContext(Ib);if(e===void 0)throw new Error(gn(31));return e}const gU=b.forwardRef(function(t,s){const{render:i,className:o,style:l,...u}=t,[d,f]=b.useState(void 0),g=kt("div",t,{ref:s,props:{role:"group","aria-labelledby":d,...u}});return v.jsx(Ib.Provider,{value:f,children:g})}),mU=b.forwardRef(function(t,s){const i=fg()?.Group??gU;return v.jsx(i,{...t,ref:s})}),yU=b.forwardRef(function(t,s){const{render:i,className:o,style:l,id:u,...d}=t,f=ar(u),g=pU();return _e(()=>(g(f),()=>{g(m=>m===f?void 0:m)}),[g,f]),kt("div",t,{ref:s,props:{id:f,"aria-hidden":!0,...d}})}),vU=b.forwardRef(function(t,s){const{render:i,className:o,id:l,label:u,nativeButton:d=!1,disabled:f=!1,closeOnClick:g=!0,style:m,...h}=t,{store:x}=ra(),S=hg({guess:!0,label:u}),w=ar(l),C=x.useState("disabled"),E=x.useState("isActive",S.index),R=x.useState("floatingNodeId"),k=x.useState("itemProps"),O=f||C,{getItemProps:A,itemRef:N}=BO({closeOnClick:g,disabled:O,highlighted:E,id:w,store:x,nativeButton:d,nodeId:R,itemMetadata:FO});return kt("div",t,{state:{disabled:O,highlighted:E},props:[k,h,A],ref:[N,s,S.ref]})}),qO=b.forwardRef(function(t,s){const i=HO(t,s);return i.visible?v.jsx(vU,{...t,ref:i.ref}):null}),bU=b.createContext(void 0);function xU(){return b.useContext(bU)}function SU(e,t){const s=_v(e.render);if(b.isValidElement(s)){const i=s.props;if(Object.hasOwn(i,"id"))return i.id??""}return e.id??t}function wU(e,t,s){const i=SU(e,t),o=i===t?void 0:i,l=b.useCallback(u=>s?.(u?o:void 0),[o,s]);return[i,l]}function EU(e,t,s){const i=_v(e.render),o=b.isValidElement(i)?i.props:void 0,l=e["aria-label"]??o?.["aria-label"];let u=e["aria-labelledby"]??o?.["aria-labelledby"];return u==null&&!l&&(u=t?t.id||void 0:s||void 0),u}const RU=b.forwardRef(function(t,s){const{render:i,className:o,style:l,finalFocus:u,id:d,initialFocus:f,...g}=t,{store:m,defaultFloatingId:h,setRenderedFloatingId:x,virtualFocus:S,orientation:w}=ra(),C=xU(),{side:E,align:R}=aU(),k=ng()!=null,O=m.useState("open"),A=m.useState("transitionStatus"),N=m.useState("popupProps"),j=m.useState("mounted"),D=m.useState("instantType"),M=m.useState("activeTriggerElement"),_=m.useState("parent"),L=m.useState("lastOpenChangeReason"),q=m.useState("rootId"),X=m.useState("floatingRootContext"),B=m.useState("floatingTreeRoot"),H=m.useState("closeDelay"),U=m.useState("hoverEnabled"),z=m.useState("disabled"),Q=m.useState("openMethod"),$=m.useState("activeTriggerId"),K=m.useState("listElement"),[Y,ee]=wU(t,h,x),G=EU(t,M,$),oe=_.type==="menu"?C:void 0,I=_.type==="context-menu";let V=f??_.type!=="menu";f===void 0&&K&&_.type!=="menu"&&(V=()=>m.state.activeIndex!==null?!1:K),Ls({open:O,ref:m.context.popupRef,onComplete(){O&&m.context.onOpenChangeComplete?.(!0)}}),b.useEffect(()=>{function ve(Pe){m.setOpen(!1,ut(Pe.reason,Pe.domEvent))}return B.events.on("close",ve),()=>{B.events.off("close",ve)}},[B.events,m]),Gv(X,{enabled:U&&!z&&!I&&_.type!=="menubar",closeDelay:H});const W=m.useStateSetter("popupElement"),re=b.useContext(UO)?.useParentHandoff??TU,{parentVirtualFocusRef:Ee,handleFocus:le}=re(m,_,O,S),me={transitionStatus:A,side:E,align:R,open:O,nested:_.type==="menu",instant:D},ge=kt("div",t,{state:me,ref:[s,m.context.popupRef,W,ee],stateAttributesMapping:Rp,props:[N,{id:Y,...K?{role:"presentation"}:{role:"menu","aria-orientation":w==="horizontal"?"horizontal":void 0,"aria-labelledby":G},onKeyDown(ve){oe?.onPopupKeyDown?.(ve),k&&ud.has(ve.key)&&ve.stopPropagation()},onFocus:le},od(A),g,{"data-rootownerid":q}]});let ue=_.type===void 0||I;(M||_.type==="menubar"&&L!==Cp)&&(ue=!0);const Te=oe?.getReturnElement??Ee;return v.jsx(Np,{context:X,openInteractionType:Q,modal:I,disabled:!j,returnFocus:u??Te??ue,explicitReturnFocus:u===void 0&&Te?!1:void 0,initialFocus:V,restoreFocus:!0,getInsideElements:_.type===void 0?()=>[m.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:_.type!=="menubar"?B:void 0,previousFocusableElement:M,nextFocusableElement:_.type===void 0?m.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:m.context.beforeContentFocusGuardRef,children:ge})}),CU={parentVirtualFocusRef:void 0,handleFocus:void 0};function TU(){return CU}const YO=b.forwardRef(function(t,s){const i=fg()?.Popup??RU;return v.jsx(i,{...t,ref:s})}),GO=b.createContext(void 0);function kU(){const e=b.useContext(GO);if(e===void 0)throw new Error(gn(32));return e}const $O=b.forwardRef(function(t,s){const{keepMounted:i=!1,...o}=t,{store:l,parent:u}=ra();if(!(l.useState("mounted")||i))return null;const g=u.type==="menu"||u.type==="menubar"?"group":void 0;return v.jsx(GO.Provider,{value:i,children:v.jsx(Mp,{ref:s,...o,portalOwnerRole:g})})});function Pb(e){const{children:t,elementsRef:s,labelsRef:i,onMapChange:o}=e,l=Be(o),[,u]=b.useState(0),d=tr(AU).current,f=tr(OU).current,g=b.useRef(0),m=b.useRef(!0),h=b.useRef(null),x=b.useRef(null),S=Be(()=>{m.current||(m.current=!0,u(N=>N+1))}),w=Be((N,j)=>{f.set(N,j),S()}),C=Be(N=>{f.delete(N),S()}),E=Be(N=>{const j=new Map;return s.current.length=0,i&&(i.current.length=0),N.forEach(D=>{j.set(D.element,{...D.registration.metadata??{},index:D.index}),s.current[D.index]=D.element,i&&(i.current[D.index]=D.registration.label!==void 0?D.registration.label:D.registration.textRef?.current?.textContent??D.element.textContent)}),g.current=s.current.length,j});function R(N){if(x.current?.disconnect(),x.current=null,typeof MutationObserver!="function"||N.length<2)return;const j=new MutationObserver(M=>{if(!DU(M))return;let _=null;for(const L of N)if(L.isConnected){if(_&&QO(_,L)>0){j.disconnect(),S();return}_=L}});x.current=j;const D=new Set;for(let M=1;M<N.length;M+=1){const _=NU(N[M-1],N[M]);_&&D.add(_)}D.forEach(M=>j.observe(M,{childList:!0}))}const k=Be(()=>{const[N,j]=MU(f),D=E(N),M=h.current,_=!M||M.length!==N.length||N.some((L,q)=>{const X=M[q];return L.index!==X.index||L.element!==X.element||L.registration.index!==X.registration.index||L.registration.metadata!==X.registration.metadata});R(j),h.current=N,m.current=!1,_&&(d.forEach(L=>L(D)),l(D))});_e(()=>(!m.current&&h.current&&E(h.current),()=>{s.current=[],i&&(i.current=[])}),[s,i,E]),_e(()=>{m.current&&k()}),_e(()=>()=>{x.current?.disconnect(),m.current=!0},[]);const O=Be(N=>(d.add(N),()=>{d.delete(N)})),A=b.useMemo(()=>({register:w,unregister:C,subscribeMapChange:O,nextIndexRef:g}),[w,C,O,g]);return v.jsx(VO.Provider,{value:A,children:t})}function OU(){return new Map}function AU(){return new Set}function MU(e){const t=new Set,s=[],i=[];e.forEach((l,u)=>{if(!u.isConnected)return;const d=l.index,f={index:d??-1,element:u,registration:l};d===null?i.push(f):d>=0&&(t.add(d),s.push(f))});let o=0;return i.sort((l,u)=>QO(l.element,u.element)),i.forEach(l=>{for(;t.has(o);)o+=1;l.index=o,s.push(l),o+=1}),t.size>0&&s.sort((l,u)=>l.index-u.index),[s,i.map(l=>l.element)]}function NU(e,t){let s=e.parentElement;for(;s&&!s.contains(t);)s=s.parentElement;return s}function DU(e){for(const t of e)for(let s=0;s<t.removedNodes.length;s+=1)if(t.removedNodes[s].isConnected)return!0;return!1}function QO(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const XO=b.forwardRef(function(t,s){const{anchor:i,positionMethod:o="absolute",className:l,render:u,side:d,align:f,sideOffset:g=0,alignOffset:m=0,collisionBoundary:h="clipping-ancestors",collisionPadding:x=5,arrowPadding:S=5,sticky:w=!1,disableAnchorTracking:C=!1,collisionAvoidance:E=TC,style:R,...k}=t,{store:O,virtualFocus:A,syncHighlightedItem:N}=ra(),j=kU(),D=dg(!0),M=O.useState("parent"),_=O.useState("floatingRootContext"),L=O.useState("floatingTreeRoot"),q=O.useState("mounted"),X=O.useState("open"),B=O.useState("modal"),H=O.useState("openMethod"),U=O.useState("activeTriggerElement"),z=O.useState("transitionStatus"),Q=O.useState("positionerElement"),$=O.useState("instantType"),K=O.useState("adaptiveOrigin"),Y=O.useState("lastOpenChangeReason"),ee=O.useState("floatingNodeId"),G=O.useState("floatingParentNodeId"),oe=_.useState("domReferenceElement");let I=i,V=g,W=m,re=f,Ee=E;M.type==="context-menu"&&(I=i??M.context?.anchor,re=re??"start",!d&&re!=="center"&&(W=t.alignOffset??2,V=t.sideOffset??-5));let le=d,me=re;M.type==="menu"?(le=le??"inline-end",me=me??"start",Ee=t.collisionAvoidance??Hv):M.type==="menubar"&&(le=le??(M.context.orientation==="vertical"?"inline-end":"bottom"),me=me??"start");const ge=M.type==="context-menu",ue=Gp({anchor:I,floatingRootContext:_,positionMethod:D?"fixed":o,mounted:q,side:le,sideOffset:V,align:me,alignOffset:W,arrowPadding:ge?0:S,collisionBoundary:h,collisionPadding:x,sticky:w,nodeId:ee,keepMounted:j,disableAnchorTracking:C,collisionAvoidance:Ee,shift:ge?{crossAxis:!("side"in Ee&&Ee.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:L,adaptiveOrigin:K,lazyFlip:A?"placement":!1});b.useEffect(()=>{function Ue(be){be.open&&(be.parentNodeId===ee&&O.set("hoverEnabled",!1),be.nodeId!==ee&&be.parentNodeId===O.select("floatingParentNodeId")&&O.setOpen(!1,ut(vu)))}return L.events.on("menuopenchange",Ue),()=>{L.events.off("menuopenchange",Ue)}},[O,L.events,ee]),b.useEffect(()=>{if(O.select("floatingParentNodeId")==null)return;function Ue(be){if(be.open||be.nodeId!==O.select("floatingParentNodeId"))return;const He=be.reason??vu;O.setOpen(!1,ut(He))}return L.events.on("menuopenchange",Ue),()=>{L.events.off("menuopenchange",Ue)}},[L.events,O]);const Te=Un();b.useEffect(()=>{X||Te.clear()},[X,Te]),b.useEffect(()=>{function Ue(be){if(!(!X||be.nodeId!==O.select("floatingParentNodeId")))if(be.target&&U&&U!==be.target){const He=O.select("closeDelay");He>0?Te.isStarted()||Te.start(He,()=>{O.setOpen(!1,ut(vu))}):O.setOpen(!1,ut(vu))}else Te.clear()}return L.events.on("itemhover",Ue),()=>{L.events.off("itemhover",Ue)}},[L.events,X,U,O,Te]),b.useEffect(()=>{const Ue={open:X,nodeId:ee,parentNodeId:G,reason:O.select("lastOpenChangeReason")};L.events.emit("menuopenchange",Ue)},[L.events,X,O,ee,G]),Dk({store:O,domReference:oe,positionerElement:Q,open:X});const ve={open:X,side:ue.side,align:ue.align,anchorHidden:ue.anchorHidden,nested:M.type==="menu",instant:$},Pe=M.type==="menubar"&&M.context.modal;cb(X&&(Pe||B&&Y!==Kn),H==="touch",Q,U);const Le=$p(t,ve,{styles:ue.positionerStyles,transitionStatus:z,props:k,refs:[s,O.useStateSetter("positionerElement")],hidden:!q,inert:!X}),Ve=q&&M.type!=="menu"&&(M.type!=="menubar"&&B&&Y!==Kn||M.type==="menubar"&&M.context.modal);let ke=null;return M.type==="menubar"?ke=M.context.contentElement:M.type===void 0&&(ke=U),v.jsxs(zO.Provider,{value:ue,children:[Ve&&v.jsx(eg,{ref:M.type==="context-menu"||M.type==="nested-context-menu"?M.context.internalBackdropRef:null,inert:Qp(!X),cutout:ke}),v.jsx(jC,{id:ee,children:v.jsx(Pb,{elementsRef:O.context.itemDomElements,labelsRef:O.context.itemLabels,onMapChange:N,children:Le})})]})}),ZO=b.createContext(void 0);function jU(){const e=b.useContext(ZO);if(e===void 0)throw new Error(gn(34));return e}const IU=b.forwardRef(function(t,s){const{render:i,className:o,value:l,defaultValue:u,onValueChange:d,disabled:f=!1,style:g,"aria-labelledby":m,...h}=t,[x,S]=b.useState(void 0),[w,C]=Ji({controlled:l,default:u,name:"MenuRadioGroup"}),E=Be((A,N)=>{d?.(A,N),!N.isCanceled&&C(A)}),k=kt("div",t,{state:{disabled:f},ref:s,props:{role:"group","aria-labelledby":m??x,"aria-disabled":f||void 0,...h}}),O=b.useMemo(()=>({value:w,setValue:E,disabled:f}),[w,E,f]);return v.jsx(Ib.Provider,{value:S,children:v.jsx(ZO.Provider,{value:O,children:k})})}),PU=b.memo(b.forwardRef(function(t,s){const i=fg()?.RadioGroup??IU;return v.jsx(i,{...t,ref:s})})),JO=b.createContext(void 0);function LU(){const e=b.useContext(JO);if(e===void 0)throw new Error(gn(35));return e}const zU=b.forwardRef(function(t,s){const{render:i,className:o,id:l,label:u,nativeButton:d=!1,disabled:f=!1,closeOnClick:g=!1,value:m,style:h,...x}=t,{store:S}=ra(),{value:w,setValue:C,disabled:E}=jU(),R=hg({guess:!0,label:u}),k=ar(l),O=S.useState("isActive",R.index),A=S.useState("floatingNodeId"),N=S.useState("itemProps"),j=S.useState("disabled"),D=f||E||j,M=w===m,{getItemProps:_,itemRef:L}=BO({closeOnClick:g,disabled:D,highlighted:O,id:k,store:S,nativeButton:d,nodeId:A,itemMetadata:FO}),q=b.useMemo(()=>({disabled:D,highlighted:O,checked:M}),[D,O,M]);function X(H){const U=ut(No,H.nativeEvent,void 0,{preventUnmountOnClose:En});C(m,U)}const B=kt("div",t,{state:q,stateAttributesMapping:KO,props:[N,{role:"menuitemradio","aria-checked":M,onClick:X},x,_],ref:[L,s,R.ref]});return v.jsx(JO.Provider,{value:q,children:B})}),_U=b.forwardRef(function(t,s){const i=HO(t,s);return i.visible?v.jsx(zU,{...t,ref:i.ref}):null}),UU=b.forwardRef(function(t,s){const{render:i,className:o,style:l,keepMounted:u=!1,...d}=t,f=LU(),g=b.useRef(null),{transitionStatus:m,mounted:h,setMounted:x}=_o(f.checked);Ls({batch:!0,enabled:!f.checked,open:f.checked,ref:g,onComplete(){f.checked||x(!1)}});const S={checked:f.checked,disabled:f.disabled,highlighted:f.highlighted,transitionStatus:m};return kt("span",t,{state:S,stateAttributesMapping:KO,ref:[s,g],props:{"aria-hidden":!0,...d},enabled:u||h})}),HU=b.createContext(null);function WO(e){return b.useContext(HU)}function FU(e){return e==null?Mr:e.type.startsWith("key")?eC:e.type.startsWith("mouse")||e.type.startsWith("pointer")?c4:Mr}const BU={...Yi,disabled:e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{const s=Yi.triggerPopupId(e,t);return s?e.listElement?.id||s:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>Si&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType==="trigger-change"&&!Yi.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")}};class VU extends oc{constructor(t,s,i=!1){const o=new ad,l=qU(o,s,i,t);super(l,KU(o),BU),this.observe("parent",u=>{u.type==="menu"?this.context.allowMouseUpTriggerRef=u.store.context.allowMouseUpTriggerRef:u.type!==void 0&&(this.context.allowMouseUpTriggerRef=u.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){const t=this.state.parent;if(t.type!=="menu")return;let s=t.store.select("rootId"),i=t.store.select("floatingTreeRoot"),o=t.store.select("keyboardEventRelay");return t.store.subscribe(()=>{const l=t.store.select("rootId"),u=t.store.select("floatingTreeRoot"),d=t.store.select("keyboardEventRelay");s===l&&i===u&&o===d||(s=l,i=u,o=d,this.notifyAll())})}setOpen(t,s){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:s})}setActiveIndex(t,s,i){if(this.state.activeIndex!==t){const l=(t===null?void 0:this.context.itemDomElements.current[t])===this.context.reportedItem;this.context.highlightReason=l?"none":s,this.context.highlightEvent=l?void 0:i}this.set("activeIndex",t)}highlightItem(t,s,i){const o=this.context.itemDomElements.current.indexOf(t);o>-1&&this.setActiveIndex(o,s,i)}}function KU(e){return{positionerRef:b.createRef(),popupRef:b.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:"none",highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:b.createRef(),beforeTriggerFocusGuardRef:b.createRef(),beforeContentFocusGuardRef:b.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function qU(e,t,s=!1,i){return{...Bp(e,t,s),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:Xt,inputProps:Xt,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Fv,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Xt,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...i}}const vR=b.createContext(null);function eA(e,t){return(e===Qs||e===No)&&t?.detail===0}function YU(e,t){return e===Hh||eA(e,t)}const GU=Xu(function(t){const{children:s,open:i,onOpenChange:o,onOpenChangeComplete:l,onItemHighlighted:u,defaultOpen:d=!1,disabled:f=!1,modal:g,loopFocus:m=!0,orientation:h="vertical",actionsRef:x,closeParentOnEsc:S=!1,handle:w,triggerId:C,defaultTriggerId:E=null,highlightItemOnHover:R=!0,isSubmenu:k=!1,virtualFocus:O=!1,virtualFocusRef:A,allowEscape:N=!0,resetOnPointerLeave:j=!0}=t,D=dg(!0),M=ra(!0),_=WO(!0),L=M?.store,q=M?.virtualFocus??!1,X=b.useMemo(()=>k&&L?{type:"menu",store:L}:_?{type:"menubar",context:_}:D&&!L?{type:"context-menu",context:D}:{type:void 0},[D,L,_,k]),B=ar(),H=ar(),[U,z]=b.useState(void 0),Q=(U??H)||void 0,$=$a(),K=X.type==="menu"?X.store:void 0,Y=(i??d)&&K?.state.transitionStatus==="starting",ee=tr(()=>Y?K?.state.instantType:void 0).current,G=tr(()=>{const Ie=new VU({open:d,openProp:i,activeTriggerId:E,triggerIdProp:C,parent:X,disabled:f,highlightItemOnHover:R,modal:X.type===void 0?g:void 0,rootId:B,instantType:ee},Q,$!=null);return Ie.context.virtualFocusRef=A,Ie}).current;G.useControlledProp("openProp",i),G.useControlledProp("triggerIdProp",C),G.useContextCallback("onOpenChangeComplete",l);const oe=G.useState("floatingTreeRoot"),I=Bv(oe),V=G.useState("open"),W=G.useState("activeTriggerElement"),re=G.useState("positionerElement"),Ee=G.useState("hoverEnabled"),le=G.useState("disabled"),me=G.useState("lastOpenChangeReason"),ge=G.useState("parent"),ue=G.useState("activeIndex"),Te=G.useState("keyboardOpen"),ve=G.useState("payload"),Pe=G.useState("floatingParentNodeId"),Oe=b.useRef(null),Le=b.useRef(ge.type!=="context-menu"),Ve=Un(),ke=b.useRef(!0),Ue=Un(),be=Pe!=null,{openMethod:He,triggerProps:Ze}=Ak(V);G.useSyncedValues({disabled:f,highlightItemOnHover:R,modal:ge.type===void 0?g:void 0,openMethod:He,rootId:B}),_p(G);const{forceUnmount:ot,transitionStatus:de}=Up(V,G,()=>{G.set("allowMouseEnter",!1)},Y),we=jp(G.context.popupRef);b.useEffect(()=>{if(ee===void 0)return;const Ie=()=>{G.state.instantType===ee&&G.set("instantType",void 0)};if(!V){Ie();return}if(de!==void 0)return;if(G.context.popupRef.current==null){Ie();return}const ze=new AbortController;return we(Ie,ze.signal),()=>{ze.abort()}},[ee,V,de,we,G]),_e(()=>{D&&!M?G.update({parent:{type:"context-menu",context:D},floatingNodeId:I,floatingParentNodeId:$}):(M||!G.select("activeTriggerElement"))&&G.update({floatingNodeId:I,floatingParentNodeId:$})},[D,M,I,$,W,G]),b.useEffect(()=>{if(V||(Oe.current=null),ge.type==="context-menu"){if(!V){Ve.clear(),Le.current=!1;return}Ve.start(500,()=>{Le.current=!0})}},[Ve,V,ge.type]),_e(()=>{!V&&!Ee&&G.set("hoverEnabled",!0)},[V,Ee,G]);const Ge=Be((Ie,ze)=>{const $e=ze.reason;if(!Ie&&!G.select("open")||V===Ie&&ze.trigger===W&&me===$e)return;const et=Lp(ze);if(!Ie&&ze.trigger==null&&(ze.trigger=W??void 0),o?.(Ie,ze),ze.isCanceled)return;G.state.floatingRootContext.dispatchOpenChange(Ie,ze);const Tt=ze.event;if(Ie===!1&&$e!==No&&Tt?.type==="click"&&Tt.pointerType==="touch"&&!ke.current)return;Ie&&$e===Fl?(ke.current=!1,Ue.start(300,()=>{ke.current=!0})):(ke.current=!0,Ue.clear());const F=!Ie&&($e===td||$e==null);Oe.current=ze.event;const J=Pp(G.state,Ie,ze.trigger,et());J.openChangeReason=$e,J.keyboardOpen=Ie&&YU($e,Tt),ge.type==="menubar"&&($e===Fl||$e===Fa||$e===Kn||$e===Hh||$e===vu)?J.instantType="group":eA($e,Tt)?J.instantType="click":F?J.instantType="dismiss":J.instantType=void 0,G.update(J)}),Me=PC({popupStore:G,floatingRootContext:G.state.floatingRootContext,floatingId:Q,nested:$!=null,onOpenChange:Ge}),De=Me.context.events;_e(()=>{const Ie=({open:ze,eventDetails:$e})=>Ge(ze,$e);return De.on("setOpen",Ie),()=>{De?.off("setOpen",Ie)}},[De,Ge]),_e(()=>G.subscribeToParentMenu(),[G]);const bt=b.useCallback(()=>{G.setOpen(!1,ut(nd))},[G]);b.useImperativeHandle(x,()=>({unmount:ot,close:bt}),[ot,bt]);let dt;ge.type==="context-menu"&&(dt=ge.context),b.useImperativeHandle(dt?.positionerRef,()=>re,[re]),b.useImperativeHandle(dt?.actionsRef,()=>({setOpen:Ge}),[Ge]);const gt=sd(Me,{enabled:!le,bubbles:{escapeKey:S&&ge.type==="menu"},outsidePress(){return ge.type!=="context-menu"||Oe.current?.type==="contextmenu"?!0:Le.current},externalTree:be?oe:void 0}),Nt=Yp(),jt=qC(Me,{enabled:!le,listRef:G.context.itemDomElements,activeIndex:ue,virtual:O,nested:ge.type==="menubar"||!O&&ge.type!==void 0,parentOrientation:ge.type==="menubar"?ge.context.orientation:void 0,loopFocus:m,focusItemOnOpen:O?Te:void 0,allowEscape:O&&m&&N,orientation:h,triggerOrientation:O?"vertical":h,rtl:Nt==="rtl",disabledIndices:$s,onNavigate(Ie,ze){G.setActiveIndex(Ie,FU(ze),ze?.nativeEvent)},openOnArrowKeyDown:ge.type!=="context-menu"&&!(O&&k),externalTree:!O&&be?oe:void 0,nestedReturnFocusRef:K?.context.virtualFocusRef,focusItemOnHover:R,resetOnPointerLeave:j}),tn=b.useCallback(Ie=>{G.context.typingRef.current=Ie},[G]),an=YC(Me,{enabled:!le&&!O,listRef:G.context.itemLabels,elementsRef:G.context.itemDomElements,activeIndex:ue,resetMs:eI,onMatch:(Ie,ze)=>{V&&Ie!==ue&&G.setActiveIndex(Ie,eC,ze.nativeEvent)},onTyping:tn}),nn=Be(u),We=b.useRef(-1),wt=Be(()=>{const Ie=G.state.activeIndex,ze=Ie===null?void 0:G.context.itemDomElements.current[Ie]??void 0;if(ze?.isConnected===!1)return;const $e=ze===void 0?-1:Ie;if(We.current===$e&&G.context.reportedItem===ze)return;We.current=$e,G.context.reportedItem=ze,O&&G.set("highlightedItem",ze);const{highlightReason:et,highlightEvent:Tt}=G.context;G.context.highlightReason=Mr,G.context.highlightEvent=void 0,u&&nn(ze,l4(et,Tt,{label:ze===void 0?void 0:G.context.itemLabels.current[$e]??void 0}))});_e(()=>{wt()},[ue,wt]);const Zt=b.useMemo(()=>{if(!O)return jt.reference;if(!jt.trigger)return Xt;const{onFocus:Ie,...ze}=jt.trigger;return ze},[O,jt.reference,jt.trigger]);G.useSyncedValue("inputProps",O?jt.reference??Xt:Xt);const ht=b.useMemo(()=>{const Ie=Ar(an.reference,Zt,gt.reference,{onMouseMove(){G.set("allowMouseEnter",!0)}},Ze);return Ie["aria-haspopup"]="menu",Ie["aria-expanded"]=V,Ie},[G,an.reference,Zt,gt.reference,Ze,V]),xt=b.useMemo(()=>{const Ie=Ar(jt.trigger,gt.trigger,Ze);return Ie["aria-haspopup"]="menu",Ie["aria-expanded"]=!1,Ie},[jt.trigger,gt.trigger,Ze]);tr(()=>(G.update({inactiveTriggerProps:xt}),null));const yt=b.useMemo(()=>Ar(id,{onMouseMove(){G.set("allowMouseEnter",!0),ge.type==="menu"&&G.set("hoverEnabled",!1)},onClick(){G.select("hoverEnabled")&&G.set("hoverEnabled",!1)},onKeyDown(Ie){const ze=G.select("keyboardEventRelay");ze&&!Ie.isPropagationStopped()&&ze(Ie)}},an.floating,jt.floating,gt.floating),[ge.type,G,an.floating,jt.floating,gt.floating]),Ut=jt.item??Xt;Hp(G,{floatingRootContext:Me,activeTriggerProps:ht,inactiveTriggerProps:xt,popupProps:yt,itemProps:Ut});const un=b.useMemo(()=>({store:G,parent:X,orientation:h,loopFocus:m,allowEscape:N,defaultFloatingId:H,setRenderedFloatingId:z,virtualFocus:O,parentVirtualFocus:q,syncHighlightedItem:wt}),[G,X,h,m,N,H,O,q,wt]),je=typeof s=="function"?s({payload:ve}):s;let at=v.jsxs(ug.Provider,{value:un,children:[w&&v.jsx(Ip,{handle:w,store:G}),je]});return(ge.type===void 0||ge.type==="context-menu")&&(at=v.jsx(IC,{externalTree:oe,children:at})),at});function tA(e){const t=b.useContext(vR);if(t===null)return v.jsx(GU,{...e});const s=t.Root;return v.jsx(vR.Provider,{value:null,children:v.jsx(s,{...t.options,...e})})}const gh=5;function nA(e,t){const s=$U(t);return e.clientX>=s.left-gh&&e.clientX<=s.right+gh&&e.clientY>=s.top-gh&&e.clientY<=s.bottom+gh}function $U(e){const t=e.getBoundingClientRect(),s=Rn(e);if(Ev)return t;const i=s.getComputedStyle(e,"::before"),o=s.getComputedStyle(e,"::after");if(!(i.content!=="none"||o.content!=="none"))return t;const u=parseFloat(i.width)||0,d=parseFloat(i.height)||0,f=parseFloat(o.width)||0,g=parseFloat(o.height)||0,m=Math.max(t.width,u,f),h=Math.max(t.height,d,g),x=m-t.width,S=h-t.height;return{left:t.left-x/2,right:t.right+x/2,top:t.top-S/2,bottom:t.bottom+S/2}}function QU(e={}){const{highlightItemOnHover:t,highlightedIndex:s,onHighlightedIndexChange:i}=ob(),{ref:o,index:l}=hg(e),u=s===l,d=b.useRef(null),f=es(o,d);return{compositeProps:{tabIndex:u?0:-1,onFocus(){i(l)},onMouseMove(){const m=d.current;if(!t||!m)return;const h=m.hasAttribute("disabled")||m.ariaDisabled==="true";!u&&!h&&m.focus()}},compositeRef:f,index:l}}function Lb(e){const{render:t,className:s,style:i,state:o=Xt,props:l=$s,refs:u=$s,metadata:d,stateAttributesMapping:f,tag:g="div",...m}=e,{compositeProps:h,compositeRef:x}=QU({metadata:d});return kt(g,e,{state:o,ref:[x,...u],props:[h,...l,m],stateAttributesMapping:f})}function zb(e){if(bn(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid");if(!$i(e))return zb(Zi(e))}function XU(e){const{enabled:t=!0,mouseDownAction:s,open:i}=e,o=b.useRef(!1);return b.useMemo(()=>t?{onMouseDown:l=>{(s==="open"&&!i||s==="close"&&i)&&(o.current=!0,Qt(l.currentTarget).addEventListener("click",()=>{o.current=!1},{once:!0}))},onClick:l=>{o.current&&(o.current=!1,l.preventBaseUIHandler())}}:Xt,[t,s,i])}const ZU=gp(function(t,s){const{render:i,className:o,style:l,disabled:u=!1,nativeButton:d=!0,id:f,openOnHover:g,delay:m=100,closeDelay:h=0,handle:x,payload:S,...w}=t,C=ra(!0),R=Vp(x)??C?.store;if(!R)throw new Error(gn(85));const k=ar(f),O=R.useState("isTriggerActive",k),A=R.useState("floatingRootContext"),N=R.useState("isOpenedByTrigger",k),j=R.useState("triggerControlsId",k),D=b.useRef(null),M=WU(),_=ob(!0),L=Qa(),q=b.useMemo(()=>L??new Fv,[L]),X=Bv(q),B=$a(),{registerTrigger:H,isMountedByThisTrigger:U}=zp(k,D,R,{payload:S,closeDelay:h,parent:M,floatingTreeRoot:q,floatingNodeId:X,floatingParentNodeId:B,keyboardEventRelay:_?.relayKeyboardEvent}),z=M.type==="menubar",Q=R.useState("disabled"),$=u||Q||z&&M.context.disabled,{getButtonProps:K,buttonRef:Y}=vs({disabled:$,native:d});b.useEffect(()=>{!N&&M.type===void 0&&(R.context.allowMouseUpTriggerRef.current=!1)},[R,N,M.type]);const ee=b.useRef(null),G=Un(),oe=Be(Ue=>{if(!ee.current)return;G.clear(),R.context.allowMouseUpTriggerRef.current=!1;const be=Ue.target;it(ee.current,be)||it(R.select("positionerElement"),be)||be===ee.current||be!=null&&zb(be)===R.select("rootId")||nA(Ue,ee.current)||q.events.emit("close",{domEvent:Ue,reason:Mv})});b.useEffect(()=>{const Ue=Qt(ee.current);if(N&&R.select("lastOpenChangeReason")===Kn)return Ue.addEventListener("mouseup",oe,{once:!0}),()=>{Ue.removeEventListener("mouseup",oe)}},[N,oe,R]);const I=z&&M.context.hasSubmenuOpen,W=$v(A,{enabled:(g??I)&&!$&&(!z||I&&!U),handleClose:Qv({blockPointerEvents:!z}),mouseOnly:!0,move:!1,restMs:M.type===void 0?m:void 0,delay:{close:h},triggerElementRef:D,externalTree:q,isActiveTrigger:O,isClosing:()=>R.select("transitionStatus")==="ending"}),re=JU(N,R.select("lastOpenChangeReason")),Ee=Dp(A,{enabled:!$,event:N&&z?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:M.type===void 0?re:!1}),le=VC(A,{enabled:!$&&I}),me=XU({open:N,enabled:z,mouseDownAction:"open"}),ge=b.useMemo(()=>Ar(le.reference,Ee.reference),[le.reference,Ee.reference]),ue=R.useState("triggerProps",U),Te=R.useState("filterTriggerProps"),{handlePreFocusGuardFocus:ve,handleFocusTargetFocus:Pe}=Ok(R,D),Oe={disabled:$,open:N},Le=[ee,s,Y,H,D],Ve=[ge,W??Xt,ue,{"aria-haspopup":"menu","aria-controls":j,id:k,onMouseDown:Ue=>{if(R.select("open"))return;G.start(200,()=>{R.context.allowMouseUpTriggerRef.current=!0}),Qt(Ue.currentTarget).addEventListener("mouseup",oe,{once:!0})}},Te,z?{role:"menuitem"}:{},me,w,K],ke=kt("button",t,{enabled:!z,stateAttributesMapping:_u,state:Oe,ref:Le,props:Ve});return z?v.jsx(Lb,{tag:"button",render:i,className:o,style:l,state:Oe,refs:Le,props:Ve,stateAttributesMapping:_u}):N?v.jsxs(b.Fragment,{children:[v.jsx(Ba,{ref:R.context.beforeTriggerFocusGuardRef,onFocus:ve},`${k}-pre-focus-guard`),v.jsx(b.Fragment,{children:ke},k),v.jsx(Ba,{ref:R.context.triggerFocusTargetRef,onFocus:Pe},`${k}-post-focus-guard`)]}):v.jsx(b.Fragment,{children:ke},k)});function JU(e,t){const s=Un(),[i,o]=b.useState(!1);return _e(()=>{e&&t===Kn?(o(!0),s.start(CC,()=>{o(!1)})):e||(s.clear(),o(!1))},[e,t,s]),i}function WU(){const e=WO();return b.useMemo(()=>e?{type:"menubar",context:e}:{type:void 0},[e])}const eH=b.forwardRef(function(t,s){const{className:i,render:o,orientation:l="horizontal",style:u,...d}=t;return kt("div",t,{state:{orientation:l},ref:s,props:[{role:"separator","aria-orientation":l},d]})});function rA(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function rp(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function tH(e){return typeof e=="object"&&e!=null&&Array.isArray(e.items)}function sA(e){return tH(e?.[0])}function nH(e){return sA(e)?e.flatMap(t=>t.items):e}function rH(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(sA(t)){for(const s of t)for(const i of s.items)if(i&&i.value==null&&i.label!=null)return!0;return!1}for(const s of t)if(s&&s.value==null&&s.label!=null)return!0;return!1}function iA(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return rp(e)}function Ul(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?rp(e.value):rp(e)}function aA(e,t,s){function i(){return iA(e,s)}if(s&&e!=null)return s(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??i();if(Array.isArray(t)){const l=nH(t);if(e==null||typeof e!="object"){const u=l.find(d=>d.value===e);return u&&u.label!=null?u.label:i()}if("value"in e){const u=l.find(d=>d&&d.value===e.value);if(u&&u.label!=null)return u.label}}return i()}function sH(e,t,s){return e.reduce((i,o,l)=>(l>0&&i.push(", "),i.push(v.jsx(b.Fragment,{children:aA(o,t,s)},l)),i),[])}function Vo({...e}){return v.jsx(tA,{"data-slot":"dropdown-menu",...e})}function Ko({...e}){return v.jsx(ZU,{"data-slot":"dropdown-menu-trigger",...e})}function qo({align:e="start",alignOffset:t=0,side:s="bottom",sideOffset:i=4,className:o,...l}){return v.jsx($O,{children:v.jsx(XO,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:s,sideOffset:i,children:v.jsx(YO,{"data-slot":"dropdown-menu-content",className:Fe("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",o),...l})})})}function oA({...e}){return v.jsx(mU,{"data-slot":"dropdown-menu-group",...e})}function lA({className:e,inset:t,...s}){return v.jsx(yU,{"data-slot":"dropdown-menu-label","data-inset":t,className:Fe("px-2 py-1.5 text-xs text-muted-foreground data-inset:pl-7.5",e),...s})}function fc({className:e,inset:t,variant:s="default",...i}){return v.jsx(qO,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":s,className:Fe("group/dropdown-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive",e),...i})}function iH({...e}){return v.jsx(PU,{"data-slot":"dropdown-menu-radio-group",...e})}function aH({className:e,children:t,inset:s,...i}){return v.jsxs(_U,{"data-slot":"dropdown-menu-radio-item","data-inset":s,className:Fe("relative flex min-h-7 cursor-default items-center gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7.5 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",e),...i,children:[v.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:v.jsx(UU,{children:v.jsx(ld,{})})}),t]})}function _b(e){return kt(e.defaultTagName??"div",e,e)}const oH="data-valid",lH="data-invalid",cH={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},uH={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},dH={disabled:!1,...uH},hc={valid(e){return e===null?null:e?{[oH]:""}:{[lH]:""}}},fH={invalid:void 0,name:void 0,validityData:{state:cH,errors:[],error:"",value:"",initialValue:null},setValidityData:En,disabled:void 0,setTouched:En,setDirty:En,setFilled:En,setFocused:En,focusOwnerRef:{current:void 0},validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:dH,registerFieldControl:En,validation:{getValidationProps:(e,t=Xt)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:En,getInputControl:()=>null,commit:async()=>{},change:En}},hH=b.createContext(fH);function sa(e=!0){const t=b.useContext(hH);if(t.setValidityData===En&&!e)throw new Error(gn(28));return t}const pH=b.createContext(void 0);function gH(e=!1){const t=b.useContext(pH);if(!t&&!e)throw new Error(gn(86));return t}const mH=b.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:En,validationMode:"onSubmit",submitCountRef:{current:0}});function vd(){return b.useContext(mH)}const yH=b.createContext({controlId:void 0,registerControlId:En,resetControlId:En,labelId:void 0,setLabelId:En,messageIds:[],setMessageIds:En,getDescriptionProps:e=>e});function Yo(){return b.useContext(yH)}function Ub(e,t,s,i=!0,o,l){const[u,d]=b.useState(),f=ar(o?`${o}-label`:void 0),g=!!l?.trim(),h=e??(g?void 0:t)??u;return _e(()=>{const x=e||t||g||!i?void 0:vH(s.current,f);u!==x&&d(x)}),h}function vH(e,t){const s=bH(e);if(s)return!s.id&&t&&(s.id=t),s.id||void 0}function bH(e){if(!e)return;const t=e.parentElement;if(t&&t.tagName==="LABEL")return t;const s=e.id;if(s){const o=e.nextElementSibling;if(o&&o.htmlFor===s)return o}const i=e.labels;return i&&i[0]}function pc(e={}){const{id:t,enabled:s=!0}=e,{controlId:i,registerControlId:o,resetControlId:l}=Yo(),u=ar(),d=tr(()=>Symbol()),f=b.useRef(!1),g=b.useRef(!1),m=Be(()=>{!f.current||o===En||(f.current=!1,o(d.current,void 0))});return _e(()=>{if(!s||o===En){m();return}let h;if(t!==void 0)g.current=!0,h=t;else if(g.current)h=u;else{l();return}if(h===void 0){m();return}f.current=!0,o(d.current,h)},[t,s,o,l,u,d,m]),_e(()=>m,[m]),(s?i:void 0)??t??u}function xH(e,t){return e.matches(":disabled")?!1:!t||e.form===t?!0:e.form===null&&!e.hasAttribute("form")}const SH=b.createContext({disabled:!1});function cA(){return b.useContext(SH)}function bd(e,t,s){const{setFocused:i,focusOwnerRef:o}=sa(),l=Be(u=>{(u?!e:o.current===l)&&(o.current=u&&l,i(u))});return _e(()=>{const u=t.current;return u?.getRootNode()?.activeElement===u&&l(!0),()=>l(!1)},[e,t,l]),l}function xd(e,t,s,i,o=!0,l){const{registerFieldControl:u}=sa(),d=tr(()=>Symbol());_e(()=>{const f=d.current;if(!o){u(f,void 0);return}u(f,{controlRef:e,getValue:i,id:t,name:l,value:s})},[e,o,i,t,l,u,d,s]),_e(()=>{const f=d.current;return()=>{u(f,void 0)}},[u,d])}const wH=b.forwardRef(function(t,s){const{render:i,className:o,id:l,name:u,value:d,disabled:f=!1,onValueChange:g,defaultValue:m,autoFocus:h=!1,style:x,...S}=t,{state:w,name:C,disabled:E,setTouched:R,setDirty:k,validityData:O,setFilled:A,validationMode:N,validation:j}=sa(),{clearErrors:D,elementRef:M,submitCountRef:_}=vd(),L=E||f,q=C??u,X={...w,disabled:L},{labelId:B}=Yo(),H=pc({id:l}),U=d!==void 0,z=d==null?void 0:String(d),Q=Be(()=>j.inputRef.current?.value);xd(j.inputRef,H,z,Q,!L,u),_e(()=>{const G=z??j.inputRef.current?.value;G!==void 0&&A(G!=="")},[z,m,j.inputRef,A]),cc(z,()=>{z!==void 0&&(D(q),k(z!==(O.initialValue??"")),j.change(z))});const $=b.useRef(null),K=bd(L,$),Y=Un();return kt("input",t,{ref:[s,$],state:X,props:[{id:H,disabled:L,name:q,ref:j.inputRef,"aria-labelledby":B,autoFocus:h,...U?{value:d}:{defaultValue:m},onChange(G){const oe=G.currentTarget.value,I=ut(Mr,G.nativeEvent);g?.(oe,I),!U&&(k(oe!==(O.initialValue??"")),A(oe!==""),!G.nativeEvent.defaultPrevented&&!I.isCanceled&&(D(q),j.change(oe)))},onFocus(){K(!0)},onBlur(G){if(R(!0),K(!1),N==="onBlur"){const oe=G.currentTarget.value;j.commit(oe),U&&queueMicrotask(()=>{const I=j.inputRef.current?.value;I!==void 0&&I!==oe&&I!==(O.initialValue??"")&&j.commit(I)})}},onKeyDown(G){if(G.currentTarget.tagName==="INPUT"&&G.key==="Enter"){R(!0);const oe=G.currentTarget.value,I=G.currentTarget.form;if(I&&I===M.current&&!G.defaultPrevented){const V=G.currentTarget,W=_.current;Y.start(0,()=>{_.current===W&&j.commit(V.value)})}else j.commit(oe)}}},S,G=>j.getValidationProps(L,G)],stateAttributesMapping:hc})}),EH=b.forwardRef(function(t,s){return v.jsx(wH,{ref:s,...t})});function Sd({className:e,type:t,...s}){return v.jsx(EH,{type:t,"data-slot":"input",className:Fe("h-7 w-full min-w-0 rounded-md border border-input bg-input/20 px-2 py-0.5 text-sm transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-xs/relaxed file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...s})}function uA({className:e,orientation:t="horizontal",...s}){return v.jsx(eH,{"data-slot":"separator",orientation:t,className:Fe("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...s})}const dA=b.createContext(void 0);function Xa(e){const t=b.useContext(dA);if(!e&&t===void 0)throw new Error(gn(27));return t}const fA=b.forwardRef(function(t,s){const{render:i,className:o,style:l,forceRender:u=!1,...d}=t,f=Xa(),g=f.useState("open"),m=f.useState("nested"),h=f.useState("mounted"),x=f.useState("transitionStatus");return kt("div",t,{state:{open:g,transitionStatus:x},ref:[f.context.backdropRef,s],stateAttributesMapping:Rp,props:[{role:"presentation",hidden:!h,style:{userSelect:"none",WebkitUserSelect:"none"}},d],enabled:u||!m})}),pg=b.forwardRef(function(t,s){const{render:i,className:o,style:l,disabled:u=!1,nativeButton:d=!0,...f}=t,g=Xa(),m=g.useState("open"),{getButtonProps:h,buttonRef:x}=vs({disabled:u,native:d}),S={disabled:u};function w(C){m&&g.setOpen(!1,ut(WR,C.nativeEvent))}return kt("button",t,{state:S,ref:[s,x],props:[{onClick:w},f,h]})}),hA=b.forwardRef(function(t,s){const{render:i,className:o,style:l,id:u,...d}=t,f=Xa(),g=ar(u);return f.useSyncedValueWithCleanup("descriptionElementId",g),kt("p",t,{ref:s,props:[{id:g},d]})}),pA=b.createContext(void 0);function RH(){const e=b.useContext(pA);if(e===void 0)throw new Error(gn(26));return e}const CH="--nested-dialogs",TH="data-nested-dialog-open",kH={...Wu,...wi,nestedDialogOpen(e){return e?{[TH]:""}:null}},gA=b.forwardRef(function(t,s){const{render:i,className:o,style:l,finalFocus:u,initialFocus:d,...f}=t,g=Xa(),m=g.useState("descriptionElementId"),h=g.useState("disablePointerDismissal"),x=g.useState("floatingRootContext"),S=g.useState("popupProps"),w=g.useState("modal"),C=g.useState("mounted"),E=g.useState("nested"),R=g.useState("nestedOpenDialogCount"),k=g.useState("open"),O=g.useState("openMethod"),A=g.useState("titleElementId"),N=g.useState("transitionStatus"),j=g.useState("role"),D=x.useState("floatingId");RH(),Ls({open:k,ref:g.context.popupRef,onComplete(){k&&g.context.onOpenChangeComplete?.(!0)}});const M=d===void 0?zC(g.context.popupRef):d,_=R>0,L=g.useStateSetter("popupElement"),X=kt("div",t,{state:{open:k,nested:E,transitionStatus:N,nestedDialogOpen:_},props:[S,{id:D,"aria-labelledby":A,"aria-describedby":m,role:j,...id,hidden:!C,onKeyDown(B){ud.has(B.key)&&B.stopPropagation()},style:{[CH]:R}},f],ref:[s,g.context.popupRef,L],stateAttributesMapping:kH});return v.jsx(Np,{context:x,openInteractionType:O,disabled:!C,closeOnFocusOut:!h,initialFocus:M,returnFocus:u,modal:w!==!1,restoreFocus:"popup",children:X})}),mA=b.forwardRef(function(t,s){const{keepMounted:i=!1,...o}=t,l=Xa(),u=l.useState("mounted"),d=l.useState("modal"),f=l.useState("open");return u||i?v.jsx(pA.Provider,{value:i,children:v.jsxs(Mp,{ref:s,...o,children:[u&&d===!0&&v.jsx(eg,{ref:l.context.internalBackdropRef,inert:Qp(!f)}),t.children]})}):null});function OH({store:e,parentContext:t,isDrawer:s}){const i=e.useState("open"),o=e.useState("mounted"),l=e.useState("disablePointerDismissal"),u=e.useState("modal"),d=e.useState("popupElement"),f=e.useState("floatingRootContext"),[g,m]=b.useState(0),[h,x]=b.useState(0),S=g===0,w=sd(f,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:u==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(C){if(!e.context.outsidePressEnabledRef.current||"button"in C&&C.button!==0)return!1;if("touches"in C){if(C.type==="touchend"){if(C.changedTouches.length!==1||C.touches.length!==0)return!1}else if(C.touches.length!==1)return!1}const E=nr(C);if(S&&!l){if(u){const R=e.context.internalBackdropRef.current,k=e.context.backdropRef.current;return R||k?R===E||k===E||it(E,d)&&!E?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:S});return jk(i&&u===!0,d),e.useContextCallback("onNestedDialogOpen",(C,E)=>{!e.select("open")&&!e.select("mounted")||(m(C),x(E))}),_e(()=>{!i&&!o&&(m(0),x(0))},[i,o]),_e(()=>(t?.onNestedDialogOpen&&i&&t.onNestedDialogOpen(g+1,h+(s?1:0)),()=>{t?.onNestedDialogOpen&&i&&t.onNestedDialogOpen(0,0)}),[s,i,g,h,t]),Hp(e,{activeTriggerProps:w.reference,inactiveTriggerProps:w.trigger,popupProps:w.floating,nestedOpenDialogCount:g,nestedOpenDrawerCount:h}),null}const AH={...Yi,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class MH extends oc{constructor(t,s,i){const o=new ad,l=NH(t,o,s,i);super(l,DH(o),AH)}setOpen=(t,s)=>{s.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&s.trigger==null&&this.state.activeTriggerId!=null&&(s.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,s),!s.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(t,s),this.update(Pp(this.state,t,s.trigger)))}}function NH(e,t,s,i=!1){return{...Bp(t,s,i),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function DH(e){return{popupRef:b.createRef(),backdropRef:b.createRef(),internalBackdropRef:b.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function jH(e,t){const{children:s,open:i,defaultOpen:o=!1,onOpenChange:l,onOpenChangeComplete:u,disablePointerDismissal:d=!1,modal:f=!0,actionsRef:g,handle:m,triggerId:h,defaultTriggerId:x=null}=t,S=e==="drawer",w=f,C=d,E="dialog",R=Xa(!0),k=R!=null,O={modal:w,disablePointerDismissal:C,nested:k,role:E},A=Kv((L,q)=>new MH({open:o,openProp:i,activeTriggerId:x,triggerIdProp:h,...O},L,q),!0);A.useControlledProp("openProp",i),A.useControlledProp("triggerIdProp",h),A.useSyncedValues(O),A.useContextCallback("onOpenChange",l),A.useContextCallback("onOpenChangeComplete",u);const N=A.useState("open"),j=A.useState("mounted"),D=A.useState("payload");_C(A,N),_p(A);const{forceUnmount:M}=Up(N,A);b.useImperativeHandle(g,()=>({unmount:M,close:()=>A.setOpen(!1,ut(nd))}),[M,A]);const _=N||j||m!=null;return v.jsxs(dA.Provider,{value:A,children:[m&&v.jsx(Ip,{handle:m,store:A}),_&&v.jsx(OH,{store:A,parentContext:R?.context,isDrawer:S}),typeof s=="function"?s({payload:D}):s]})}const yA=Xu(function(t){return jH("dialog",t)}),vA=b.forwardRef(function(t,s){const{render:i,className:o,style:l,id:u,...d}=t,f=Xa(),g=ar(u);return f.useSyncedValueWithCleanup("titleElementId",g),kt("h2",t,{ref:s,props:[{id:g},d]})}),IH=gp(function(t,s){const{render:i,className:o,style:l,disabled:u=!1,nativeButton:d=!0,id:f,payload:g,handle:m,...h}=t,x=Xa(!0),w=Vp(m)??x;if(!w)throw new Error(gn(79));const C=ar(f),E=w.useState("floatingRootContext"),R=w.useState("isOpenedByTrigger",C),k=w.useState("triggerPopupId",C),O=b.useRef(null),{registerTrigger:A,isMountedByThisTrigger:N}=zp(C,O,w,{payload:g}),{getButtonProps:j,buttonRef:D}=vs({disabled:u,native:d}),M=Dp(E),_=lb(()=>w.select("open"),X=>{w.set("openMethod",X)}),L={disabled:u,open:R},q=w.useState("triggerProps",N);return kt("button",t,{state:L,ref:[D,s,A,O],props:[M.reference,q,_,{[Uv]:"",id:C,"aria-haspopup":"dialog","aria-expanded":R,"aria-controls":k},h,j],stateAttributesMapping:Ep})});function bA({...e}){return v.jsx(yA,{"data-slot":"sheet",...e})}function PH({...e}){return v.jsx(IH,{"data-slot":"sheet-trigger",...e})}function LH({...e}){return v.jsx(mA,{"data-slot":"sheet-portal",...e})}function zH({className:e,...t}){return v.jsx(fA,{"data-slot":"sheet-overlay",className:Fe("fixed inset-0 z-50 bg-black/80 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...t})}function xA({className:e,children:t,side:s="right",showCloseButton:i=!0,...o}){const{t:l}=pt();return v.jsxs(LH,{children:[v.jsx(zH,{}),v.jsxs(gA,{"data-slot":"sheet-content","data-side":s,className:Fe("fixed z-50 flex flex-col bg-popover bg-clip-padding text-xs/relaxed text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-10 data-[side=bottom]:data-starting-style:translate-y-10 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=left]:data-ending-style:-translate-x-10 data-[side=left]:data-starting-style:-translate-x-10 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=right]:data-ending-style:translate-x-10 data-[side=right]:data-starting-style:translate-x-10 data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:-translate-y-10 data-[side=top]:data-starting-style:-translate-y-10 data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...o,children:[t,i&&v.jsxs(pg,{"data-slot":"sheet-close",render:v.jsx(nt,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm"}),children:[v.jsx(ta,{}),v.jsx("span",{className:"sr-only",children:l("a11y.close")})]})]})]})}function _H({className:e,...t}){return v.jsx("div",{"data-slot":"sheet-header",className:Fe("flex flex-col gap-1.5 p-6",e),...t})}function SA({className:e,...t}){return v.jsx(vA,{"data-slot":"sheet-title",className:Fe("font-heading text-sm font-medium text-foreground",e),...t})}function UH({className:e,...t}){return v.jsx(hA,{"data-slot":"sheet-description",className:Fe("text-xs/relaxed text-muted-foreground",e),...t})}function fr({className:e,...t}){return v.jsx("div",{"data-slot":"skeleton",className:Fe("animate-pulse rounded-md bg-muted",e),...t})}const HH="sidebar_state",FH=3600*24*7,BH="16rem",VH="18rem",KH="3rem",qH="b",wA=b.createContext(null);function gc(){const e=b.useContext(wA);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function YH({defaultOpen:e=!0,open:t,onOpenChange:s,className:i,style:o,children:l,...u}){const d=bb(),[f,g]=b.useState(!1),[m,h]=b.useState(e),x=t??m,S=b.useCallback(R=>{const k=typeof R=="function"?R(x):R;s?s(k):h(k),document.cookie=`${HH}=${k}; path=/; max-age=${FH}`},[s,x]),w=b.useCallback(()=>d?g(R=>!R):S(R=>!R),[d,S,g]);b.useEffect(()=>{const R=k=>{k.key===qH&&(k.metaKey||k.ctrlKey)&&(k.preventDefault(),w())};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[w]);const C=x?"expanded":"collapsed",E=b.useMemo(()=>({state:C,open:x,setOpen:S,isMobile:d,openMobile:f,setOpenMobile:g,toggleSidebar:w}),[C,x,S,d,f,g,w]);return v.jsx(wA.Provider,{value:E,children:v.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":BH,"--sidebar-width-icon":KH,...o},className:Fe("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",i),...u,children:l})})}function GH({side:e="left",variant:t="sidebar",collapsible:s="offcanvas",className:i,children:o,dir:l,...u}){const{t:d}=pt(),{isMobile:f,state:g,openMobile:m,setOpenMobile:h}=gc();return s==="none"?v.jsx("div",{"data-slot":"sidebar",className:Fe("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",i),...u,children:o}):f?v.jsx(bA,{open:m,onOpenChange:h,...u,children:v.jsxs(xA,{dir:l,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":VH},side:e,children:[v.jsxs(_H,{className:"sr-only",children:[v.jsx(SA,{children:d("a11y.sidebar")}),v.jsx(UH,{children:d("a11y.sidebarDescription")})]}),v.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):v.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":g,"data-collapsible":g==="collapsed"?s:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[v.jsx("div",{"data-slot":"sidebar-gap",className:Fe("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","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)")}),v.jsx("div",{"data-slot":"sidebar-container","data-side":e,className:Fe("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:-left-(--sidebar-width) data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:-right-(--sidebar-width) 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:v.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:o})})]})}function $H({className:e,onClick:t,...s}){const{t:i}=pt(),{toggleSidebar:o}=gc();return v.jsxs(nt,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:Fe(e),onClick:l=>{t?.(l),o()},...s,children:[v.jsx(kL,{}),v.jsx("span",{className:"sr-only",children:i("a11y.toggleSidebar")})]})}function QH({className:e,...t}){const{t:s}=pt(),{toggleSidebar:i}=gc();return v.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":s("a11y.toggleSidebar"),tabIndex:-1,onClick:i,title:s("a11y.toggleSidebar"),className:Fe("absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:inset-s-1/2 after:w-0.5 hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function XH({className:e,...t}){return v.jsx("main",{"data-slot":"sidebar-inset",className:Fe("relative flex w-full flex-1 flex-col 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",e),...t})}function ZH({className:e,...t}){return v.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:Fe("flex flex-col gap-2 p-2",e),...t})}function JH({className:e,...t}){return v.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:Fe("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function WH({className:e,...t}){return v.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:Fe("relative flex w-full min-w-0 flex-col px-2 py-1",e),...t})}function EA({className:e,...t}){return v.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:Fe("flex w-full min-w-0 flex-col gap-px",e),...t})}function jh({className:e,...t}){return v.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:Fe("group/menu-item relative",e),...t})}const eF=Uo("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-[calc(var(--radius-sm)+2px)] p-2 text-left text-xs ring-sidebar-ring outline-hidden 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! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-xs",sm:"h-7 text-xs",lg:"h-12 text-xs group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Ih({render:e,isActive:t=!1,variant:s="default",size:i="default",tooltip:o,className:l,...u}){const{isMobile:d,state:f}=gc(),g=_b({defaultTagName:"button",props:Ar({className:Fe(eF({variant:s,size:i}),l)},u),render:o?v.jsx(Zh,{render:e}):e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:i,active:t}});return o?(typeof o=="string"&&(o={children:o}),v.jsxs(Xh,{children:[g,v.jsx(Jh,{side:"right",align:"center",hidden:f!=="collapsed"||d,...o})]})):g}function tF({className:e,...t}){return v.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:Fe("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden",e),...t})}function nF({className:e,...t}){return v.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:Fe("group/menu-sub-item relative",e),...t})}function rF({render:e,size:t="md",isActive:s=!1,className:i,...o}){return _b({defaultTagName:"a",props:Ar({className:Fe("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-xs data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",i)},o),render:e,state:{slot:"sidebar-menu-sub-button",sidebar:"menu-sub-button",size:t,active:s}})}function sF({items:e}){const{t}=pt(),{pathname:s}=Dr(),{isMobile:i,state:o}=gc(),l=o==="collapsed"&&!i,u=d=>s===d||s.startsWith(`${d}/`);return v.jsx(WH,{children:v.jsx(EA,{children:e.map(d=>{const f=d.icon,g=d.items?.some(m=>u(m.url))??!1;return d.items?l?v.jsx(jh,{children:v.jsxs(Vo,{children:[v.jsxs(Ko,{render:v.jsx(Ih,{tooltip:t(d.titleKey),isActive:g}),children:[v.jsx(f,{}),v.jsx("span",{children:t(d.titleKey)})]}),v.jsx(qo,{className:"w-40",side:"right",align:"start",sideOffset:4,children:v.jsxs(oA,{children:[v.jsx(lA,{children:t(d.titleKey)}),d.items.map(m=>v.jsx(fc,{className:"cursor-pointer",render:v.jsx(Mu,{to:m.url}),children:v.jsx("span",{children:t(m.titleKey)})},m.titleKey))]})})]})},d.titleKey):v.jsxs(rU,{defaultOpen:g,className:"group/collapsible",render:v.jsx(jh,{}),children:[v.jsxs(sU,{render:v.jsx(Ih,{tooltip:t(d.titleKey),isActive:g}),children:[v.jsx(f,{}),v.jsx("span",{children:t(d.titleKey)}),v.jsx(Jv,{className:`
50
+ ml-auto transition-transform duration-200
51
+ group-data-open/collapsible:rotate-90
52
+ `})]}),v.jsx(iU,{children:v.jsx(tF,{children:d.items.map(m=>v.jsx(nF,{children:v.jsx(rF,{isActive:u(m.url),render:v.jsx(Mu,{to:m.url}),children:v.jsx("span",{children:t(m.titleKey)})})},m.titleKey))})})]},`${d.titleKey}-${g?"active":"inactive"}`):v.jsx(jh,{children:v.jsxs(Ih,{tooltip:t(d.titleKey),isActive:s===d.url,render:v.jsx(Mu,{to:d.url??"/dashboard"}),children:[v.jsx(f,{}),v.jsx("span",{children:t(d.titleKey)})]})},d.titleKey)})})})}const Hb=[{titleKey:"nav.dashboard",url:"/dashboard",icon:xL},{titleKey:"nav.library",icon:SL,items:[{titleKey:"nav.instructions",url:"/library/instructions"},{titleKey:"nav.skills",url:"/library/skills"}]},{titleKey:"nav.models",icon:fT,items:[{titleKey:"nav.genesis",url:"/models/genesis"},{titleKey:"nav.explorer",url:"/models/explorer"},{titleKey:"nav.quantum",url:"/models/quantum"}]}],iF=new Map([["/settings","nav.settings"],...Hb.flatMap(e=>[...e.url?[[e.url,e.titleKey]]:[],...e.items?.map(t=>[t.url,t.titleKey])??[]])]);function RA(e){return e.startsWith("/library/skills/")?"nav.skills":iF.get(e)??"nav.dashboard"}const aF=Hb.flatMap(e=>[...e.url?[e.url]:[],...e.items?.map(t=>t.url)??[]]),oF=aF;function lF({...e}){const{t}=pt(),{pathname:s}=Dr(),{isMobile:i,setOpenMobile:o}=gc();return b.useEffect(()=>{i&&o(!1)},[i,s,o]),v.jsxs(GH,{collapsible:"icon",...e,children:[v.jsx(JH,{children:v.jsx(sF,{items:Hb})}),v.jsx(ZH,{children:v.jsx(EA,{children:v.jsx(jh,{children:v.jsxs(Ih,{tooltip:t("nav.settings"),render:v.jsx(Mu,{to:"/settings"}),children:[v.jsx(AL,{}),v.jsx("span",{children:t("nav.settings")})]})})})}),v.jsx(QH,{})]})}function cF({className:e,...t}){return v.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:Fe(e),...t})}function uF({className:e,...t}){return v.jsx("ol",{"data-slot":"breadcrumb-list",className:Fe("flex flex-wrap items-center gap-1.5 text-xs/relaxed wrap-break-word text-muted-foreground",e),...t})}function dF({className:e,...t}){return v.jsx("li",{"data-slot":"breadcrumb-item",className:Fe("inline-flex items-center gap-1",e),...t})}function fF({className:e,render:t,...s}){return _b({defaultTagName:"a",props:Ar({className:Fe("transition-colors hover:text-foreground",e)},s),render:t,state:{slot:"breadcrumb-link"}})}function hF({className:e,...t}){return v.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:Fe("font-normal text-foreground",e),...t})}function pF({children:e,className:t,...s}){return v.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Fe("[&>svg]:size-3.5",t),...s,children:e??v.jsx(Jv,{})})}function gF({items:e}){const{t}=pt();return v.jsx(cF,{"aria-label":t("a11y.breadcrumb"),className:"min-w-0",children:v.jsx(uF,{className:"flex-nowrap text-sm font-medium text-foreground",children:e.map((s,i)=>v.jsxs(b.Fragment,{children:[i>0&&v.jsx(pF,{}),v.jsx(dF,{className:s.to?"shrink-0":"min-w-0",children:s.to?v.jsx(fF,{render:v.jsx(yd,{to:s.to}),className:"truncate",title:s.label,children:s.label}):v.jsx(hF,{className:"truncate font-medium",title:s.label,children:s.label})})]},s.to??s.label))})})}const gg=b.createContext(null);gg.displayName="PageHeaderActionsContext";function mF({children:e}){const[t,s]=b.useState(null);return v.jsx(gg,{value:{container:t,setContainer:s},children:e})}function yF(){const e=b.use(gg);if(!e)throw new Error("PageHeaderActionsSlot must be used within PageHeaderActionsProvider");const t=e.setContainer,s=b.useCallback(i=>{t(i)},[t]);return v.jsx("div",{ref:s,className:"ml-auto flex shrink-0 items-center gap-2 px-4"})}function CA({children:e}){const t=b.use(gg);return t?.container?hr.createPortal(e,t.container):null}function vF(){const{t:e}=pt(),{pathname:t}=Dr(),s=k6("/library/skills/:name");return v.jsx(mF,{children:v.jsxs(YH,{className:"h-svh pb-6",children:[v.jsx(lF,{className:"pb-6"}),v.jsxs(XH,{className:s?"h-full min-w-0 overflow-hidden":"min-w-0",children:[v.jsxs("header",{className:`
53
+ flex h-16 shrink-0 items-center gap-2 transition-[width,height]
54
+ ease-linear
55
+ group-has-data-[collapsible=icon]/sidebar-wrapper:h-12
56
+ `,children:[v.jsxs("div",{className:"flex min-w-0 items-center gap-2 px-4",children:[v.jsx($H,{size:"icon",className:"-ml-1"}),v.jsx(uA,{orientation:"vertical",className:`
57
+ mr-2
58
+ data-vertical:h-4 data-vertical:self-auto
59
+ `}),v.jsx(gF,{items:s?[{label:e("nav.skills"),to:"/library/skills"},{label:s.params.name??""}]:[{label:e(RA(t))}]})]}),v.jsx(yF,{})]}),v.jsx(NO,{})]})]})})}function bF(){const{t:e}=pt(),{pathname:t}=Dr(),s=H6(),i=Bo();let o;for(const u of s.toReversed())if(xF(u.handle)){o=u.handle.backTo;break}const l=()=>{if(o===void 0){i(-1);return}i(o)};return v.jsxs("div",{"data-slot":"full-screen-layout",className:"flex h-dvh flex-col overflow-hidden bg-background pb-6",children:[v.jsx("header",{className:`
60
+ flex h-16 shrink-0 items-center gap-2 transition-[width,height]
61
+ ease-linear
62
+ `,children:v.jsxs("div",{className:"flex items-center gap-2 px-4",children:[v.jsxs(nt,{variant:"ghost",size:"icon",className:"-ml-1",onClick:l,children:[v.jsx(cL,{}),v.jsx("span",{className:"sr-only",children:e("a11y.goBack")})]}),v.jsx(uA,{orientation:"vertical",className:`
63
+ mr-2
64
+ data-vertical:h-4 data-vertical:self-auto
65
+ `}),v.jsx("span",{className:"text-sm font-medium",children:e(RA(t))})]})}),v.jsx("main",{className:"min-h-0 flex-1 overflow-hidden",children:v.jsx(NO,{})})]})}function xF(e){return typeof e=="object"&&e!==null&&"backTo"in e&&typeof e.backTo=="string"}function SF(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return b.useMemo(()=>i=>{t.forEach(o=>o(i))},t)}const mg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function mc(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Fb(e){return"nodeType"in e}function Kr(e){var t,s;return e?mc(e)?e:Fb(e)&&(t=(s=e.ownerDocument)==null?void 0:s.defaultView)!=null?t:window:window}function Bb(e){const{Document:t}=Kr(e);return e instanceof t}function wd(e){return mc(e)?!1:e instanceof Kr(e).HTMLElement}function TA(e){return e instanceof Kr(e).SVGElement}function yc(e){return e?mc(e)?e.document:Fb(e)?Bb(e)?e:wd(e)||TA(e)?e.ownerDocument:document:document:document}const Xs=mg?b.useLayoutEffect:b.useEffect;function yg(e){const t=b.useRef(e);return Xs(()=>{t.current=e}),b.useCallback(function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];return t.current==null?void 0:t.current(...i)},[])}function wF(){const e=b.useRef(null),t=b.useCallback((i,o)=>{e.current=setInterval(i,o)},[]),s=b.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,s]}function Ku(e,t){t===void 0&&(t=[e]);const s=b.useRef(e);return Xs(()=>{s.current!==e&&(s.current=e)},t),s}function Ed(e,t){const s=b.useRef();return b.useMemo(()=>{const i=e(s.current);return s.current=i,i},[...t])}function sp(e){const t=yg(e),s=b.useRef(null),i=b.useCallback(o=>{o!==s.current&&t?.(o,s.current),s.current=o},[]);return[s,i]}function ip(e){const t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current}let Sy={};function Rd(e,t){return b.useMemo(()=>{if(t)return t;const s=Sy[e]==null?0:Sy[e]+1;return Sy[e]=s,e+"-"+s},[e,t])}function kA(e){return function(t){for(var s=arguments.length,i=new Array(s>1?s-1:0),o=1;o<s;o++)i[o-1]=arguments[o];return i.reduce((l,u)=>{const d=Object.entries(u);for(const[f,g]of d){const m=l[f];m!=null&&(l[f]=m+e*g)}return l},{...t})}}const Zl=kA(1),qu=kA(-1);function EF(e){return"clientX"in e&&"clientY"in e}function vg(e){if(!e)return!1;const{KeyboardEvent:t}=Kr(e.target);return t&&e instanceof t}function RF(e){if(!e)return!1;const{TouchEvent:t}=Kr(e.target);return t&&e instanceof t}function ap(e){if(RF(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:s}=e.touches[0];return{x:t,y:s}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:s}=e.changedTouches[0];return{x:t,y:s}}}return EF(e)?{x:e.clientX,y:e.clientY}:null}const Ya=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:s}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(s?Math.round(s):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:s}=e;return"scaleX("+t+") scaleY("+s+")"}},Transform:{toString(e){if(e)return[Ya.Translate.toString(e),Ya.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:s,easing:i}=e;return t+" "+s+"ms "+i}}}),bR="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function CF(e){return e.matches(bR)?e:e.querySelector(bR)}const TF={display:"none"};function kF(e){let{id:t,value:s}=e;return Ne.createElement("div",{id:t,style:TF},s)}function OF(e){let{id:t,announcement:s,ariaLiveType:i="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Ne.createElement("div",{id:t,style:o,role:"status","aria-live":i,"aria-atomic":!0},s)}function AF(){const[e,t]=b.useState("");return{announce:b.useCallback(i=>{i!=null&&t(i)},[]),announcement:e}}const OA=b.createContext(null);function MF(e){const t=b.useContext(OA);b.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function NF(){const[e]=b.useState(()=>new Set),t=b.useCallback(i=>(e.add(i),()=>e.delete(i)),[e]);return[b.useCallback(i=>{let{type:o,event:l}=i;e.forEach(u=>{var d;return(d=u[o])==null?void 0:d.call(u,l)})},[e]),t]}const DF={draggable:`
66
+ To pick up a draggable item, press the space bar.
67
+ While dragging, use the arrow keys to move the item.
68
+ Press space again to drop the item in its new position, or press escape to cancel.
69
+ `},jF={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:s}=e;return s?"Draggable item "+t.id+" was moved over droppable area "+s.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:s}=e;return s?"Draggable item "+t.id+" was dropped over droppable area "+s.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function IF(e){let{announcements:t=jF,container:s,hiddenTextDescribedById:i,screenReaderInstructions:o=DF}=e;const{announce:l,announcement:u}=AF(),d=Rd("DndLiveRegion"),[f,g]=b.useState(!1);if(b.useEffect(()=>{g(!0)},[]),MF(b.useMemo(()=>({onDragStart(h){let{active:x}=h;l(t.onDragStart({active:x}))},onDragMove(h){let{active:x,over:S}=h;t.onDragMove&&l(t.onDragMove({active:x,over:S}))},onDragOver(h){let{active:x,over:S}=h;l(t.onDragOver({active:x,over:S}))},onDragEnd(h){let{active:x,over:S}=h;l(t.onDragEnd({active:x,over:S}))},onDragCancel(h){let{active:x,over:S}=h;l(t.onDragCancel({active:x,over:S}))}}),[l,t])),!f)return null;const m=Ne.createElement(Ne.Fragment,null,Ne.createElement(kF,{id:i,value:o.draggable}),Ne.createElement(OF,{id:d,announcement:u}));return s?hr.createPortal(m,s):m}var ir;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(ir||(ir={}));function op(){}function wy(e,t){return b.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function PF(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return b.useMemo(()=>[...t].filter(i=>i!=null),[...t])}const Zs=Object.freeze({x:0,y:0});function Vb(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function LF(e,t){const s=ap(e);if(!s)return"0 0";const i={x:(s.x-t.left)/t.width*100,y:(s.y-t.top)/t.height*100};return i.x+"% "+i.y+"%"}function Kb(e,t){let{data:{value:s}}=e,{data:{value:i}}=t;return s-i}function zF(e,t){let{data:{value:s}}=e,{data:{value:i}}=t;return i-s}function cv(e){let{left:t,top:s,height:i,width:o}=e;return[{x:t,y:s},{x:t+o,y:s},{x:t,y:s+i},{x:t+o,y:s+i}]}function AA(e,t){if(!e||e.length===0)return null;const[s]=e;return s[t]}function xR(e,t,s){return t===void 0&&(t=e.left),s===void 0&&(s=e.top),{x:t+e.width*.5,y:s+e.height*.5}}const _F=e=>{let{collisionRect:t,droppableRects:s,droppableContainers:i}=e;const o=xR(t,t.left,t.top),l=[];for(const u of i){const{id:d}=u,f=s.get(d);if(f){const g=Vb(xR(f),o);l.push({id:d,data:{droppableContainer:u,value:g}})}}return l.sort(Kb)},UF=e=>{let{collisionRect:t,droppableRects:s,droppableContainers:i}=e;const o=cv(t),l=[];for(const u of i){const{id:d}=u,f=s.get(d);if(f){const g=cv(f),m=o.reduce((x,S,w)=>x+Vb(g[w],S),0),h=Number((m/4).toFixed(4));l.push({id:d,data:{droppableContainer:u,value:h}})}}return l.sort(Kb)};function HF(e,t){const s=Math.max(t.top,e.top),i=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),u=o-i,d=l-s;if(i<o&&s<l){const f=t.width*t.height,g=e.width*e.height,m=u*d,h=m/(f+g-m);return Number(h.toFixed(4))}return 0}const FF=e=>{let{collisionRect:t,droppableRects:s,droppableContainers:i}=e;const o=[];for(const l of i){const{id:u}=l,d=s.get(u);if(d){const f=HF(d,t);f>0&&o.push({id:u,data:{droppableContainer:l,value:f}})}}return o.sort(zF)};function BF(e,t){const{top:s,left:i,bottom:o,right:l}=t;return s<=e.y&&e.y<=o&&i<=e.x&&e.x<=l}const VF=e=>{let{droppableContainers:t,droppableRects:s,pointerCoordinates:i}=e;if(!i)return[];const o=[];for(const l of t){const{id:u}=l,d=s.get(u);if(d&&BF(i,d)){const g=cv(d).reduce((h,x)=>h+Vb(i,x),0),m=Number((g/4).toFixed(4));o.push({id:u,data:{droppableContainer:l,value:m}})}}return o.sort(Kb)};function KF(e,t,s){return{...e,scaleX:t&&s?t.width/s.width:1,scaleY:t&&s?t.height/s.height:1}}function MA(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Zs}function qF(e){return function(s){for(var i=arguments.length,o=new Array(i>1?i-1:0),l=1;l<i;l++)o[l-1]=arguments[l];return o.reduce((u,d)=>({...u,top:u.top+e*d.y,bottom:u.bottom+e*d.y,left:u.left+e*d.x,right:u.right+e*d.x}),{...s})}}const YF=qF(1);function NA(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function GF(e,t,s){const i=NA(t);if(!i)return e;const{scaleX:o,scaleY:l,x:u,y:d}=i,f=e.left-u-(1-o)*parseFloat(s),g=e.top-d-(1-l)*parseFloat(s.slice(s.indexOf(" ")+1)),m=o?e.width/o:e.width,h=l?e.height/l:e.height;return{width:m,height:h,top:g,right:f+m,bottom:g+h,left:f}}const $F={ignoreTransform:!1};function vc(e,t){t===void 0&&(t=$F);let s=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:g,transformOrigin:m}=Kr(e).getComputedStyle(e);g&&(s=GF(s,g,m))}const{top:i,left:o,width:l,height:u,bottom:d,right:f}=s;return{top:i,left:o,width:l,height:u,bottom:d,right:f}}function SR(e){return vc(e,{ignoreTransform:!0})}function QF(e){const t=e.innerWidth,s=e.innerHeight;return{top:0,left:0,right:t,bottom:s,width:t,height:s}}function XF(e,t){return t===void 0&&(t=Kr(e).getComputedStyle(e)),t.position==="fixed"}function ZF(e,t){t===void 0&&(t=Kr(e).getComputedStyle(e));const s=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const l=t[o];return typeof l=="string"?s.test(l):!1})}function bg(e,t){const s=[];function i(o){if(t!=null&&s.length>=t||!o)return s;if(Bb(o)&&o.scrollingElement!=null&&!s.includes(o.scrollingElement))return s.push(o.scrollingElement),s;if(!wd(o)||TA(o)||s.includes(o))return s;const l=Kr(e).getComputedStyle(o);return o!==e&&ZF(o,l)&&s.push(o),XF(o,l)?s:i(o.parentNode)}return e?i(e):s}function DA(e){const[t]=bg(e,1);return t??null}function Ey(e){return!mg||!e?null:mc(e)?e:Fb(e)?Bb(e)||e===yc(e).scrollingElement?window:wd(e)?e:null:null}function jA(e){return mc(e)?e.scrollX:e.scrollLeft}function IA(e){return mc(e)?e.scrollY:e.scrollTop}function uv(e){return{x:jA(e),y:IA(e)}}var dr;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(dr||(dr={}));function PA(e){return!mg||!e?!1:e===document.scrollingElement}function LA(e){const t={x:0,y:0},s=PA(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={x:e.scrollWidth-s.width,y:e.scrollHeight-s.height},o=e.scrollTop<=t.y,l=e.scrollLeft<=t.x,u=e.scrollTop>=i.y,d=e.scrollLeft>=i.x;return{isTop:o,isLeft:l,isBottom:u,isRight:d,maxScroll:i,minScroll:t}}const JF={x:.2,y:.2};function WF(e,t,s,i,o){let{top:l,left:u,right:d,bottom:f}=s;i===void 0&&(i=10),o===void 0&&(o=JF);const{isTop:g,isBottom:m,isLeft:h,isRight:x}=LA(e),S={x:0,y:0},w={x:0,y:0},C={height:t.height*o.y,width:t.width*o.x};return!g&&l<=t.top+C.height?(S.y=dr.Backward,w.y=i*Math.abs((t.top+C.height-l)/C.height)):!m&&f>=t.bottom-C.height&&(S.y=dr.Forward,w.y=i*Math.abs((t.bottom-C.height-f)/C.height)),!x&&d>=t.right-C.width?(S.x=dr.Forward,w.x=i*Math.abs((t.right-C.width-d)/C.width)):!h&&u<=t.left+C.width&&(S.x=dr.Backward,w.x=i*Math.abs((t.left+C.width-u)/C.width)),{direction:S,speed:w}}function e7(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:u}=window;return{top:0,left:0,right:l,bottom:u,width:l,height:u}}const{top:t,left:s,right:i,bottom:o}=e.getBoundingClientRect();return{top:t,left:s,right:i,bottom:o,width:e.clientWidth,height:e.clientHeight}}function zA(e){return e.reduce((t,s)=>Zl(t,uv(s)),Zs)}function t7(e){return e.reduce((t,s)=>t+jA(s),0)}function n7(e){return e.reduce((t,s)=>t+IA(s),0)}function _A(e,t){if(t===void 0&&(t=vc),!e)return;const{top:s,left:i,bottom:o,right:l}=t(e);DA(e)&&(o<=0||l<=0||s>=window.innerHeight||i>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const r7=[["x",["left","right"],t7],["y",["top","bottom"],n7]];class qb{constructor(t,s){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const i=bg(s),o=zA(i);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,u,d]of r7)for(const f of u)Object.defineProperty(this,f,{get:()=>{const g=d(i),m=o[l]-g;return this.rect[f]+m},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Nu{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(s=>{var i;return(i=this.target)==null?void 0:i.removeEventListener(...s)})},this.target=t}add(t,s,i){var o;(o=this.target)==null||o.addEventListener(t,s,i),this.listeners.push([t,s,i])}}function s7(e){const{EventTarget:t}=Kr(e);return e instanceof t?e:yc(e)}function Ry(e,t){const s=Math.abs(e.x),i=Math.abs(e.y);return typeof t=="number"?Math.sqrt(s**2+i**2)>t:"x"in t&&"y"in t?s>t.x&&i>t.y:"x"in t?s>t.x:"y"in t?i>t.y:!1}var Ds;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ds||(Ds={}));function wR(e){e.preventDefault()}function i7(e){e.stopPropagation()}var en;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(en||(en={}));const UA={start:[en.Space,en.Enter],cancel:[en.Esc],end:[en.Space,en.Enter,en.Tab]},a7=(e,t)=>{let{currentCoordinates:s}=t;switch(e.code){case en.Right:return{...s,x:s.x+25};case en.Left:return{...s,x:s.x-25};case en.Down:return{...s,y:s.y+25};case en.Up:return{...s,y:s.y-25}}};class Yb{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:s}}=t;this.props=t,this.listeners=new Nu(yc(s)),this.windowListeners=new Nu(Kr(s)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ds.Resize,this.handleCancel),this.windowListeners.add(Ds.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ds.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:s}=this.props,i=t.node.current;i&&_A(i),s(Zs)}handleKeyDown(t){if(vg(t)){const{active:s,context:i,options:o}=this.props,{keyboardCodes:l=UA,coordinateGetter:u=a7,scrollBehavior:d="smooth"}=o,{code:f}=t;if(l.end.includes(f)){this.handleEnd(t);return}if(l.cancel.includes(f)){this.handleCancel(t);return}const{collisionRect:g}=i.current,m=g?{x:g.left,y:g.top}:Zs;this.referenceCoordinates||(this.referenceCoordinates=m);const h=u(t,{active:s,context:i.current,currentCoordinates:m});if(h){const x=qu(h,m),S={x:0,y:0},{scrollableAncestors:w}=i.current;for(const C of w){const E=t.code,{isTop:R,isRight:k,isLeft:O,isBottom:A,maxScroll:N,minScroll:j}=LA(C),D=e7(C),M={x:Math.min(E===en.Right?D.right-D.width/2:D.right,Math.max(E===en.Right?D.left:D.left+D.width/2,h.x)),y:Math.min(E===en.Down?D.bottom-D.height/2:D.bottom,Math.max(E===en.Down?D.top:D.top+D.height/2,h.y))},_=E===en.Right&&!k||E===en.Left&&!O,L=E===en.Down&&!A||E===en.Up&&!R;if(_&&M.x!==h.x){const q=C.scrollLeft+x.x,X=E===en.Right&&q<=N.x||E===en.Left&&q>=j.x;if(X&&!x.y){C.scrollTo({left:q,behavior:d});return}X?S.x=C.scrollLeft-q:S.x=E===en.Right?C.scrollLeft-N.x:C.scrollLeft-j.x,S.x&&C.scrollBy({left:-S.x,behavior:d});break}else if(L&&M.y!==h.y){const q=C.scrollTop+x.y,X=E===en.Down&&q<=N.y||E===en.Up&&q>=j.y;if(X&&!x.x){C.scrollTo({top:q,behavior:d});return}X?S.y=C.scrollTop-q:S.y=E===en.Down?C.scrollTop-N.y:C.scrollTop-j.y,S.y&&C.scrollBy({top:-S.y,behavior:d});break}}this.handleMove(t,Zl(qu(h,this.referenceCoordinates),S))}}}handleMove(t,s){const{onMove:i}=this.props;t.preventDefault(),i(s)}handleEnd(t){const{onEnd:s}=this.props;t.preventDefault(),this.detach(),s()}handleCancel(t){const{onCancel:s}=this.props;t.preventDefault(),this.detach(),s()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Yb.activators=[{eventName:"onKeyDown",handler:(e,t,s)=>{let{keyboardCodes:i=UA,onActivation:o}=t,{active:l}=s;const{code:u}=e.nativeEvent;if(i.start.includes(u)){const d=l.activatorNode.current;return d&&e.target!==d?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function ER(e){return!!(e&&"distance"in e)}function RR(e){return!!(e&&"delay"in e)}class Gb{constructor(t,s,i){var o;i===void 0&&(i=s7(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=s;const{event:l}=t,{target:u}=l;this.props=t,this.events=s,this.document=yc(u),this.documentListeners=new Nu(this.document),this.listeners=new Nu(i),this.windowListeners=new Nu(Kr(u)),this.initialCoordinates=(o=ap(l))!=null?o:Zs,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:s,bypassActivationConstraint:i}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ds.Resize,this.handleCancel),this.windowListeners.add(Ds.DragStart,wR),this.windowListeners.add(Ds.VisibilityChange,this.handleCancel),this.windowListeners.add(Ds.ContextMenu,wR),this.documentListeners.add(Ds.Keydown,this.handleKeydown),s){if(i!=null&&i({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(RR(s)){this.timeoutId=setTimeout(this.handleStart,s.delay),this.handlePending(s);return}if(ER(s)){this.handlePending(s);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,s){const{active:i,onPending:o}=this.props;o(i,t,this.initialCoordinates,s)}handleStart(){const{initialCoordinates:t}=this,{onStart:s}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ds.Click,i7,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ds.SelectionChange,this.removeTextSelection),s(t))}handleMove(t){var s;const{activated:i,initialCoordinates:o,props:l}=this,{onMove:u,options:{activationConstraint:d}}=l;if(!o)return;const f=(s=ap(t))!=null?s:Zs,g=qu(o,f);if(!i&&d){if(ER(d)){if(d.tolerance!=null&&Ry(g,d.tolerance))return this.handleCancel();if(Ry(g,d.distance))return this.handleStart()}if(RR(d)&&Ry(g,d.tolerance))return this.handleCancel();this.handlePending(d,g);return}t.cancelable&&t.preventDefault(),u(f)}handleEnd(){const{onAbort:t,onEnd:s}=this.props;this.detach(),this.activated||t(this.props.active),s()}handleCancel(){const{onAbort:t,onCancel:s}=this.props;this.detach(),this.activated||t(this.props.active),s()}handleKeydown(t){t.code===en.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const o7={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class HA extends Gb{constructor(t){const{event:s}=t,i=yc(s.target);super(t,o7,i)}}HA.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:s}=e,{onActivation:i}=t;return!s.isPrimary||s.button!==0?!1:(i?.({event:s}),!0)}}];const l7={move:{name:"mousemove"},end:{name:"mouseup"}};var dv;(function(e){e[e.RightClick=2]="RightClick"})(dv||(dv={}));class FA extends Gb{constructor(t){super(t,l7,yc(t.event.target))}}FA.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:s}=e,{onActivation:i}=t;return s.button===dv.RightClick?!1:(i?.({event:s}),!0)}}];const Cy={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class BA extends Gb{constructor(t){super(t,Cy)}static setup(){return window.addEventListener(Cy.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Cy.move.name,t)};function t(){}}}BA.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:s}=e,{onActivation:i}=t;const{touches:o}=s;return o.length>1?!1:(i?.({event:s}),!0)}}];var Du;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Du||(Du={}));var lp;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(lp||(lp={}));function c7(e){let{acceleration:t,activator:s=Du.Pointer,canScroll:i,draggingRect:o,enabled:l,interval:u=5,order:d=lp.TreeOrder,pointerCoordinates:f,scrollableAncestors:g,scrollableAncestorRects:m,delta:h,threshold:x}=e;const S=d7({delta:h,disabled:!l}),[w,C]=wF(),E=b.useRef({x:0,y:0}),R=b.useRef({x:0,y:0}),k=b.useMemo(()=>{switch(s){case Du.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case Du.DraggableRect:return o}},[s,o,f]),O=b.useRef(null),A=b.useCallback(()=>{const j=O.current;if(!j)return;const D=E.current.x*R.current.x,M=E.current.y*R.current.y;j.scrollBy(D,M)},[]),N=b.useMemo(()=>d===lp.TreeOrder?[...g].reverse():g,[d,g]);b.useEffect(()=>{if(!l||!g.length||!k){C();return}for(const j of N){if(i?.(j)===!1)continue;const D=g.indexOf(j),M=m[D];if(!M)continue;const{direction:_,speed:L}=WF(j,M,k,t,x);for(const q of["x","y"])S[q][_[q]]||(L[q]=0,_[q]=0);if(L.x>0||L.y>0){C(),O.current=j,w(A,u),E.current=L,R.current=_;return}}E.current={x:0,y:0},R.current={x:0,y:0},C()},[t,A,i,C,l,u,JSON.stringify(k),JSON.stringify(S),w,g,N,m,JSON.stringify(x)])}const u7={x:{[dr.Backward]:!1,[dr.Forward]:!1},y:{[dr.Backward]:!1,[dr.Forward]:!1}};function d7(e){let{delta:t,disabled:s}=e;const i=ip(t);return Ed(o=>{if(s||!i||!o)return u7;const l={x:Math.sign(t.x-i.x),y:Math.sign(t.y-i.y)};return{x:{[dr.Backward]:o.x[dr.Backward]||l.x===-1,[dr.Forward]:o.x[dr.Forward]||l.x===1},y:{[dr.Backward]:o.y[dr.Backward]||l.y===-1,[dr.Forward]:o.y[dr.Forward]||l.y===1}}},[s,t,i])}function f7(e,t){const s=t!=null?e.get(t):void 0,i=s?s.node.current:null;return Ed(o=>{var l;return t==null?null:(l=i??o)!=null?l:null},[i,t])}function h7(e,t){return b.useMemo(()=>e.reduce((s,i)=>{const{sensor:o}=i,l=o.activators.map(u=>({eventName:u.eventName,handler:t(u.handler,i)}));return[...s,...l]},[]),[e,t])}var Yu;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Yu||(Yu={}));var fv;(function(e){e.Optimized="optimized"})(fv||(fv={}));const CR=new Map;function p7(e,t){let{dragging:s,dependencies:i,config:o}=t;const[l,u]=b.useState(null),{frequency:d,measure:f,strategy:g}=o,m=b.useRef(e),h=E(),x=Ku(h),S=b.useCallback(function(R){R===void 0&&(R=[]),!x.current&&u(k=>k===null?R:k.concat(R.filter(O=>!k.includes(O))))},[x]),w=b.useRef(null),C=Ed(R=>{if(h&&!s)return CR;if(!R||R===CR||m.current!==e||l!=null){const k=new Map;for(let O of e){if(!O)continue;if(l&&l.length>0&&!l.includes(O.id)&&O.rect.current){k.set(O.id,O.rect.current);continue}const A=O.node.current,N=A?new qb(f(A),A):null;O.rect.current=N,N&&k.set(O.id,N)}return k}return R},[e,l,s,h,f]);return b.useEffect(()=>{m.current=e},[e]),b.useEffect(()=>{h||S()},[s,h]),b.useEffect(()=>{l&&l.length>0&&u(null)},[JSON.stringify(l)]),b.useEffect(()=>{h||typeof d!="number"||w.current!==null||(w.current=setTimeout(()=>{S(),w.current=null},d))},[d,h,S,...i]),{droppableRects:C,measureDroppableContainers:S,measuringScheduled:l!=null};function E(){switch(g){case Yu.Always:return!1;case Yu.BeforeDragging:return s;default:return!s}}}function $b(e,t){return Ed(s=>e?s||(typeof t=="function"?t(e):e):null,[t,e])}function g7(e,t){return $b(e,t)}function m7(e){let{callback:t,disabled:s}=e;const i=yg(t),o=b.useMemo(()=>{if(s||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(i)},[i,s]);return b.useEffect(()=>()=>o?.disconnect(),[o]),o}function xg(e){let{callback:t,disabled:s}=e;const i=yg(t),o=b.useMemo(()=>{if(s||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(i)},[s]);return b.useEffect(()=>()=>o?.disconnect(),[o]),o}function y7(e){return new qb(vc(e),e)}function TR(e,t,s){t===void 0&&(t=y7);const[i,o]=b.useState(null);function l(){o(f=>{if(!e)return null;if(e.isConnected===!1){var g;return(g=f??s)!=null?g:null}const m=t(e);return JSON.stringify(f)===JSON.stringify(m)?f:m})}const u=m7({callback(f){if(e)for(const g of f){const{type:m,target:h}=g;if(m==="childList"&&h instanceof HTMLElement&&h.contains(e)){l();break}}}}),d=xg({callback:l});return Xs(()=>{l(),e?(d?.observe(e),u?.observe(document.body,{childList:!0,subtree:!0})):(d?.disconnect(),u?.disconnect())},[e]),i}function v7(e){const t=$b(e);return MA(e,t)}const kR=[];function b7(e){const t=b.useRef(e),s=Ed(i=>e?i&&i!==kR&&e&&t.current&&e.parentNode===t.current.parentNode?i:bg(e):kR,[e]);return b.useEffect(()=>{t.current=e},[e]),s}function x7(e){const[t,s]=b.useState(null),i=b.useRef(e),o=b.useCallback(l=>{const u=Ey(l.target);u&&s(d=>d?(d.set(u,uv(u)),new Map(d)):null)},[]);return b.useEffect(()=>{const l=i.current;if(e!==l){u(l);const d=e.map(f=>{const g=Ey(f);return g?(g.addEventListener("scroll",o,{passive:!0}),[g,uv(g)]):null}).filter(f=>f!=null);s(d.length?new Map(d):null),i.current=e}return()=>{u(e),u(l)};function u(d){d.forEach(f=>{const g=Ey(f);g?.removeEventListener("scroll",o)})}},[o,e]),b.useMemo(()=>e.length?t?Array.from(t.values()).reduce((l,u)=>Zl(l,u),Zs):zA(e):Zs,[e,t])}function OR(e,t){t===void 0&&(t=[]);const s=b.useRef(null);return b.useEffect(()=>{s.current=null},t),b.useEffect(()=>{const i=e!==Zs;i&&!s.current&&(s.current=e),!i&&s.current&&(s.current=null)},[e]),s.current?qu(e,s.current):Zs}function S7(e){b.useEffect(()=>{if(!mg)return;const t=e.map(s=>{let{sensor:i}=s;return i.setup==null?void 0:i.setup()});return()=>{for(const s of t)s?.()}},e.map(t=>{let{sensor:s}=t;return s}))}function w7(e,t){return b.useMemo(()=>e.reduce((s,i)=>{let{eventName:o,handler:l}=i;return s[o]=u=>{l(u,t)},s},{}),[e,t])}function VA(e){return b.useMemo(()=>e?QF(e):null,[e])}const AR=[];function E7(e,t){t===void 0&&(t=vc);const[s]=e,i=VA(s?Kr(s):null),[o,l]=b.useState(AR);function u(){l(()=>e.length?e.map(f=>PA(f)?i:new qb(t(f),f)):AR)}const d=xg({callback:u});return Xs(()=>{d?.disconnect(),u(),e.forEach(f=>d?.observe(f))},[e]),o}function KA(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return wd(t)?t:e}function R7(e){let{measure:t}=e;const[s,i]=b.useState(null),o=b.useCallback(g=>{for(const{target:m}of g)if(wd(m)){i(h=>{const x=t(m);return h?{...h,width:x.width,height:x.height}:x});break}},[t]),l=xg({callback:o}),u=b.useCallback(g=>{const m=KA(g);l?.disconnect(),m&&l?.observe(m),i(m?t(m):null)},[t,l]),[d,f]=sp(u);return b.useMemo(()=>({nodeRef:d,rect:s,setRef:f}),[s,d,f])}const C7=[{sensor:HA,options:{}},{sensor:Yb,options:{}}],T7={current:{}},Ph={draggable:{measure:SR},droppable:{measure:SR,strategy:Yu.WhileDragging,frequency:fv.Optimized},dragOverlay:{measure:vc}};class ju extends Map{get(t){var s;return t!=null&&(s=super.get(t))!=null?s:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:s}=t;return!s})}getNodeFor(t){var s,i;return(s=(i=this.get(t))==null?void 0:i.node.current)!=null?s:void 0}}const k7={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ju,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:op},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ph,measureDroppableContainers:op,windowRect:null,measuringScheduled:!1},qA={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:op,draggableNodes:new Map,over:null,measureDroppableContainers:op},Cd=b.createContext(qA),YA=b.createContext(k7);function O7(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ju}}}function A7(e,t){switch(t.type){case ir.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ir.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case ir.DragEnd:case ir.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ir.RegisterDroppable:{const{element:s}=t,{id:i}=s,o=new ju(e.droppable.containers);return o.set(i,s),{...e,droppable:{...e.droppable,containers:o}}}case ir.SetDroppableDisabled:{const{id:s,key:i,disabled:o}=t,l=e.droppable.containers.get(s);if(!l||i!==l.key)return e;const u=new ju(e.droppable.containers);return u.set(s,{...l,disabled:o}),{...e,droppable:{...e.droppable,containers:u}}}case ir.UnregisterDroppable:{const{id:s,key:i}=t,o=e.droppable.containers.get(s);if(!o||i!==o.key)return e;const l=new ju(e.droppable.containers);return l.delete(s),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function M7(e){let{disabled:t}=e;const{active:s,activatorEvent:i,draggableNodes:o}=b.useContext(Cd),l=ip(i),u=ip(s?.id);return b.useEffect(()=>{if(!t&&!i&&l&&u!=null){if(!vg(l)||document.activeElement===l.target)return;const d=o.get(u);if(!d)return;const{activatorNode:f,node:g}=d;if(!f.current&&!g.current)return;requestAnimationFrame(()=>{for(const m of[f.current,g.current]){if(!m)continue;const h=CF(m);if(h){h.focus();break}}})}},[i,t,o,u,l]),null}function GA(e,t){let{transform:s,...i}=t;return e!=null&&e.length?e.reduce((o,l)=>l({transform:o,...i}),s):s}function N7(e){return b.useMemo(()=>({draggable:{...Ph.draggable,...e?.draggable},droppable:{...Ph.droppable,...e?.droppable},dragOverlay:{...Ph.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function D7(e){let{activeNode:t,measure:s,initialRect:i,config:o=!0}=e;const l=b.useRef(!1),{x:u,y:d}=typeof o=="boolean"?{x:o,y:o}:o;Xs(()=>{if(!u&&!d||!t){l.current=!1;return}if(l.current||!i)return;const g=t?.node.current;if(!g||g.isConnected===!1)return;const m=s(g),h=MA(m,i);if(u||(h.x=0),d||(h.y=0),l.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const x=DA(g);x&&x.scrollBy({top:h.y,left:h.x})}},[t,u,d,i,s])}const Sg=b.createContext({...Zs,scaleX:1,scaleY:1});var Pa;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Pa||(Pa={}));const j7=b.memo(function(t){var s,i,o,l;let{id:u,accessibility:d,autoScroll:f=!0,children:g,sensors:m=C7,collisionDetection:h=FF,measuring:x,modifiers:S,...w}=t;const C=b.useReducer(A7,void 0,O7),[E,R]=C,[k,O]=NF(),[A,N]=b.useState(Pa.Uninitialized),j=A===Pa.Initialized,{draggable:{active:D,nodes:M,translate:_},droppable:{containers:L}}=E,q=D!=null?M.get(D):null,X=b.useRef({initial:null,translated:null}),B=b.useMemo(()=>{var xt;return D!=null?{id:D,data:(xt=q?.data)!=null?xt:T7,rect:X}:null},[D,q]),H=b.useRef(null),[U,z]=b.useState(null),[Q,$]=b.useState(null),K=Ku(w,Object.values(w)),Y=Rd("DndDescribedBy",u),ee=b.useMemo(()=>L.getEnabled(),[L]),G=N7(x),{droppableRects:oe,measureDroppableContainers:I,measuringScheduled:V}=p7(ee,{dragging:j,dependencies:[_.x,_.y],config:G.droppable}),W=f7(M,D),re=b.useMemo(()=>Q?ap(Q):null,[Q]),Ee=ht(),le=g7(W,G.draggable.measure);D7({activeNode:D!=null?M.get(D):null,config:Ee.layoutShiftCompensation,initialRect:le,measure:G.draggable.measure});const me=TR(W,G.draggable.measure,le),ge=TR(W?W.parentElement:null),ue=b.useRef({activatorEvent:null,active:null,activeNode:W,collisionRect:null,collisions:null,droppableRects:oe,draggableNodes:M,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Te=L.getNodeFor((s=ue.current.over)==null?void 0:s.id),ve=R7({measure:G.dragOverlay.measure}),Pe=(i=ve.nodeRef.current)!=null?i:W,Oe=j?(o=ve.rect)!=null?o:me:null,Le=!!(ve.nodeRef.current&&ve.rect),Ve=v7(Le?null:me),ke=VA(Pe?Kr(Pe):null),Ue=b7(j?Te??W:null),be=E7(Ue),He=GA(S,{transform:{x:_.x-Ve.x,y:_.y-Ve.y,scaleX:1,scaleY:1},activatorEvent:Q,active:B,activeNodeRect:me,containerNodeRect:ge,draggingNodeRect:Oe,over:ue.current.over,overlayNodeRect:ve.rect,scrollableAncestors:Ue,scrollableAncestorRects:be,windowRect:ke}),Ze=re?Zl(re,_):null,ot=x7(Ue),de=OR(ot),we=OR(ot,[me]),Ge=Zl(He,de),Me=Oe?YF(Oe,He):null,De=B&&Me?h({active:B,collisionRect:Me,droppableRects:oe,droppableContainers:ee,pointerCoordinates:Ze}):null,bt=AA(De,"id"),[dt,gt]=b.useState(null),Nt=Le?He:Zl(He,we),jt=KF(Nt,(l=dt?.rect)!=null?l:null,me),tn=b.useRef(null),an=b.useCallback((xt,yt)=>{let{sensor:Ut,options:un}=yt;if(H.current==null)return;const je=M.get(H.current);if(!je)return;const at=xt.nativeEvent,Ie=new Ut({active:H.current,activeNode:je,event:at,options:un,context:ue,onAbort($e){if(!M.get($e))return;const{onDragAbort:Tt}=K.current,F={id:$e};Tt?.(F),k({type:"onDragAbort",event:F})},onPending($e,et,Tt,F){if(!M.get($e))return;const{onDragPending:ne}=K.current,ye={id:$e,constraint:et,initialCoordinates:Tt,offset:F};ne?.(ye),k({type:"onDragPending",event:ye})},onStart($e){const et=H.current;if(et==null)return;const Tt=M.get(et);if(!Tt)return;const{onDragStart:F}=K.current,J={activatorEvent:at,active:{id:et,data:Tt.data,rect:X}};hr.unstable_batchedUpdates(()=>{F?.(J),N(Pa.Initializing),R({type:ir.DragStart,initialCoordinates:$e,active:et}),k({type:"onDragStart",event:J}),z(tn.current),$(at)})},onMove($e){R({type:ir.DragMove,coordinates:$e})},onEnd:ze(ir.DragEnd),onCancel:ze(ir.DragCancel)});tn.current=Ie;function ze($e){return async function(){const{active:Tt,collisions:F,over:J,scrollAdjustedTranslate:ne}=ue.current;let ye=null;if(Tt&&ne){const{cancelDrop:xe}=K.current;ye={activatorEvent:at,active:Tt,collisions:F,delta:ne,over:J},$e===ir.DragEnd&&typeof xe=="function"&&await Promise.resolve(xe(ye))&&($e=ir.DragCancel)}H.current=null,hr.unstable_batchedUpdates(()=>{R({type:$e}),N(Pa.Uninitialized),gt(null),z(null),$(null),tn.current=null;const xe=$e===ir.DragEnd?"onDragEnd":"onDragCancel";if(ye){const qe=K.current[xe];qe?.(ye),k({type:xe,event:ye})}})}}},[M]),nn=b.useCallback((xt,yt)=>(Ut,un)=>{const je=Ut.nativeEvent,at=M.get(un);if(H.current!==null||!at||je.dndKit||je.defaultPrevented)return;const Ie={active:at};xt(Ut,yt.options,Ie)===!0&&(je.dndKit={capturedBy:yt.sensor},H.current=un,an(Ut,yt))},[M,an]),We=h7(m,nn);S7(m),Xs(()=>{me&&A===Pa.Initializing&&N(Pa.Initialized)},[me,A]),b.useEffect(()=>{const{onDragMove:xt}=K.current,{active:yt,activatorEvent:Ut,collisions:un,over:je}=ue.current;if(!yt||!Ut)return;const at={active:yt,activatorEvent:Ut,collisions:un,delta:{x:Ge.x,y:Ge.y},over:je};hr.unstable_batchedUpdates(()=>{xt?.(at),k({type:"onDragMove",event:at})})},[Ge.x,Ge.y]),b.useEffect(()=>{const{active:xt,activatorEvent:yt,collisions:Ut,droppableContainers:un,scrollAdjustedTranslate:je}=ue.current;if(!xt||H.current==null||!yt||!je)return;const{onDragOver:at}=K.current,Ie=un.get(bt),ze=Ie&&Ie.rect.current?{id:Ie.id,rect:Ie.rect.current,data:Ie.data,disabled:Ie.disabled}:null,$e={active:xt,activatorEvent:yt,collisions:Ut,delta:{x:je.x,y:je.y},over:ze};hr.unstable_batchedUpdates(()=>{gt(ze),at?.($e),k({type:"onDragOver",event:$e})})},[bt]),Xs(()=>{ue.current={activatorEvent:Q,active:B,activeNode:W,collisionRect:Me,collisions:De,droppableRects:oe,draggableNodes:M,draggingNode:Pe,draggingNodeRect:Oe,droppableContainers:L,over:dt,scrollableAncestors:Ue,scrollAdjustedTranslate:Ge},X.current={initial:Oe,translated:Me}},[B,W,De,Me,M,Pe,Oe,oe,L,dt,Ue,Ge]),c7({...Ee,delta:_,draggingRect:Me,pointerCoordinates:Ze,scrollableAncestors:Ue,scrollableAncestorRects:be});const wt=b.useMemo(()=>({active:B,activeNode:W,activeNodeRect:me,activatorEvent:Q,collisions:De,containerNodeRect:ge,dragOverlay:ve,draggableNodes:M,droppableContainers:L,droppableRects:oe,over:dt,measureDroppableContainers:I,scrollableAncestors:Ue,scrollableAncestorRects:be,measuringConfiguration:G,measuringScheduled:V,windowRect:ke}),[B,W,me,Q,De,ge,ve,M,L,oe,dt,I,Ue,be,G,V,ke]),Zt=b.useMemo(()=>({activatorEvent:Q,activators:We,active:B,activeNodeRect:me,ariaDescribedById:{draggable:Y},dispatch:R,draggableNodes:M,over:dt,measureDroppableContainers:I}),[Q,We,B,me,R,Y,M,dt,I]);return Ne.createElement(OA.Provider,{value:O},Ne.createElement(Cd.Provider,{value:Zt},Ne.createElement(YA.Provider,{value:wt},Ne.createElement(Sg.Provider,{value:jt},g)),Ne.createElement(M7,{disabled:d?.restoreFocus===!1})),Ne.createElement(IF,{...d,hiddenTextDescribedById:Y}));function ht(){const xt=U?.autoScrollEnabled===!1,yt=typeof f=="object"?f.enabled===!1:f===!1,Ut=j&&!xt&&!yt;return typeof f=="object"?{...f,enabled:Ut}:{enabled:Ut}}}),I7=b.createContext(null),MR="button",P7="Draggable";function $A(e){let{id:t,data:s,disabled:i=!1,attributes:o}=e;const l=Rd(P7),{activators:u,activatorEvent:d,active:f,activeNodeRect:g,ariaDescribedById:m,draggableNodes:h,over:x}=b.useContext(Cd),{role:S=MR,roleDescription:w="draggable",tabIndex:C=0}=o??{},E=f?.id===t,R=b.useContext(E?Sg:I7),[k,O]=sp(),[A,N]=sp(),j=w7(u,t),D=Ku(s);Xs(()=>(h.set(t,{id:t,key:l,node:k,activatorNode:A,data:D}),()=>{const _=h.get(t);_&&_.key===l&&h.delete(t)}),[h,t]);const M=b.useMemo(()=>({role:S,tabIndex:C,"aria-disabled":i,"aria-pressed":E&&S===MR?!0:void 0,"aria-roledescription":w,"aria-describedby":m.draggable}),[i,S,C,E,w,m.draggable]);return{active:f,activatorEvent:d,activeNodeRect:g,attributes:M,isDragging:E,listeners:i?void 0:j,node:k,over:x,setNodeRef:O,setActivatorNodeRef:N,transform:R}}function QA(){return b.useContext(YA)}const L7="Droppable",z7={timeout:25};function XA(e){let{data:t,disabled:s=!1,id:i,resizeObserverConfig:o}=e;const l=Rd(L7),{active:u,dispatch:d,over:f,measureDroppableContainers:g}=b.useContext(Cd),m=b.useRef({disabled:s}),h=b.useRef(!1),x=b.useRef(null),S=b.useRef(null),{disabled:w,updateMeasurementsFor:C,timeout:E}={...z7,...o},R=Ku(C??i),k=b.useCallback(()=>{if(!h.current){h.current=!0;return}S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{g(Array.isArray(R.current)?R.current:[R.current]),S.current=null},E)},[E]),O=xg({callback:k,disabled:w||!u}),A=b.useCallback((M,_)=>{O&&(_&&(O.unobserve(_),h.current=!1),M&&O.observe(M))},[O]),[N,j]=sp(A),D=Ku(t);return b.useEffect(()=>{!O||!N.current||(O.disconnect(),h.current=!1,O.observe(N.current))},[N,O]),b.useEffect(()=>(d({type:ir.RegisterDroppable,element:{id:i,key:l,disabled:s,node:N,rect:x,data:D}}),()=>d({type:ir.UnregisterDroppable,key:l,id:i})),[i]),b.useEffect(()=>{s!==m.current.disabled&&(d({type:ir.SetDroppableDisabled,id:i,key:l,disabled:s}),m.current.disabled=s)},[i,l,s,d]),{active:u,rect:x,isOver:f?.id===i,node:N,over:f,setNodeRef:j}}function _7(e){let{animation:t,children:s}=e;const[i,o]=b.useState(null),[l,u]=b.useState(null),d=ip(s);return!s&&!i&&d&&o(d),Xs(()=>{if(!l)return;const f=i?.key,g=i?.props.id;if(f==null||g==null){o(null);return}Promise.resolve(t(g,l)).then(()=>{o(null)})},[t,i,l]),Ne.createElement(Ne.Fragment,null,s,i?b.cloneElement(i,{ref:u}):null)}const U7={x:0,y:0,scaleX:1,scaleY:1};function H7(e){let{children:t}=e;return Ne.createElement(Cd.Provider,{value:qA},Ne.createElement(Sg.Provider,{value:U7},t))}const F7={position:"fixed",touchAction:"none"},B7=e=>vg(e)?"transform 250ms ease":void 0,V7=b.forwardRef((e,t)=>{let{as:s,activatorEvent:i,adjustScale:o,children:l,className:u,rect:d,style:f,transform:g,transition:m=B7}=e;if(!d)return null;const h=o?g:{...g,scaleX:1,scaleY:1},x={...F7,width:d.width,height:d.height,top:d.top,left:d.left,transform:Ya.Transform.toString(h),transformOrigin:o&&i?LF(i,d):void 0,transition:typeof m=="function"?m(i):m,...f};return Ne.createElement(s,{className:u,style:x,ref:t},l)}),K7=e=>t=>{let{active:s,dragOverlay:i}=t;const o={},{styles:l,className:u}=e;if(l!=null&&l.active)for(const[d,f]of Object.entries(l.active))f!==void 0&&(o[d]=s.node.style.getPropertyValue(d),s.node.style.setProperty(d,f));if(l!=null&&l.dragOverlay)for(const[d,f]of Object.entries(l.dragOverlay))f!==void 0&&i.node.style.setProperty(d,f);return u!=null&&u.active&&s.node.classList.add(u.active),u!=null&&u.dragOverlay&&i.node.classList.add(u.dragOverlay),function(){for(const[f,g]of Object.entries(o))s.node.style.setProperty(f,g);u!=null&&u.active&&s.node.classList.remove(u.active)}},q7=e=>{let{transform:{initial:t,final:s}}=e;return[{transform:Ya.Transform.toString(t)},{transform:Ya.Transform.toString(s)}]},Y7={duration:250,easing:"ease",keyframes:q7,sideEffects:K7({styles:{active:{opacity:"0"}}})};function G7(e){let{config:t,draggableNodes:s,droppableContainers:i,measuringConfiguration:o}=e;return yg((l,u)=>{if(t===null)return;const d=s.get(l);if(!d)return;const f=d.node.current;if(!f)return;const g=KA(u);if(!g)return;const{transform:m}=Kr(u).getComputedStyle(u),h=NA(m);if(!h)return;const x=typeof t=="function"?t:$7(t);return _A(f,o.draggable.measure),x({active:{id:l,data:d.data,node:f,rect:o.draggable.measure(f)},draggableNodes:s,dragOverlay:{node:u,rect:o.dragOverlay.measure(g)},droppableContainers:i,measuringConfiguration:o,transform:h})})}function $7(e){const{duration:t,easing:s,sideEffects:i,keyframes:o}={...Y7,...e};return l=>{let{active:u,dragOverlay:d,transform:f,...g}=l;if(!t)return;const m={x:d.rect.left-u.rect.left,y:d.rect.top-u.rect.top},h={scaleX:f.scaleX!==1?u.rect.width*f.scaleX/d.rect.width:1,scaleY:f.scaleY!==1?u.rect.height*f.scaleY/d.rect.height:1},x={x:f.x-m.x,y:f.y-m.y,...h},S=o({...g,active:u,dragOverlay:d,transform:{initial:f,final:x}}),[w]=S,C=S[S.length-1];if(JSON.stringify(w)===JSON.stringify(C))return;const E=i?.({active:u,dragOverlay:d,...g}),R=d.node.animate(S,{duration:t,easing:s,fill:"forwards"});return new Promise(k=>{R.onfinish=()=>{E?.(),k()}})}}let NR=0;function Q7(e){return b.useMemo(()=>{if(e!=null)return NR++,NR},[e])}const X7=Ne.memo(e=>{let{adjustScale:t=!1,children:s,dropAnimation:i,style:o,transition:l,modifiers:u,wrapperElement:d="div",className:f,zIndex:g=999}=e;const{activatorEvent:m,active:h,activeNodeRect:x,containerNodeRect:S,draggableNodes:w,droppableContainers:C,dragOverlay:E,over:R,measuringConfiguration:k,scrollableAncestors:O,scrollableAncestorRects:A,windowRect:N}=QA(),j=b.useContext(Sg),D=Q7(h?.id),M=GA(u,{activatorEvent:m,active:h,activeNodeRect:x,containerNodeRect:S,draggingNodeRect:E.rect,over:R,overlayNodeRect:E.rect,scrollableAncestors:O,scrollableAncestorRects:A,transform:j,windowRect:N}),_=$b(x),L=G7({config:i,draggableNodes:w,droppableContainers:C,measuringConfiguration:k}),q=_?E.setRef:void 0;return Ne.createElement(H7,null,Ne.createElement(_7,{animation:L},h&&D?Ne.createElement(V7,{key:D,id:h.id,ref:q,as:d,activatorEvent:m,adjustScale:t,className:f,transition:l,rect:_,style:{zIndex:g,...o},transform:M},s):null))});function Qb(e,t,s){const i=e.slice();return i.splice(s<0?i.length+s:s,0,i.splice(t,1)[0]),i}function Z7(e,t){return e.reduce((s,i,o)=>{const l=t.get(i);return l&&(s[o]=l),s},Array(e.length))}function mh(e){return e!==null&&e>=0}function J7(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}function W7(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const ZA=e=>{let{rects:t,activeIndex:s,overIndex:i,index:o}=e;const l=Qb(t,i,s),u=t[o],d=l[o];return!d||!u?null:{x:d.left-u.left,y:d.top-u.top,scaleX:d.width/u.width,scaleY:d.height/u.height}},yh={scaleX:1,scaleY:1},e9=e=>{var t;let{activeIndex:s,activeNodeRect:i,index:o,rects:l,overIndex:u}=e;const d=(t=l[s])!=null?t:i;if(!d)return null;if(o===s){const g=l[u];return g?{x:0,y:s<u?g.top+g.height-(d.top+d.height):g.top-d.top,...yh}:null}const f=t9(l,o,s);return o>s&&o<=u?{x:0,y:-d.height-f,...yh}:o<s&&o>=u?{x:0,y:d.height+f,...yh}:{x:0,y:0,...yh}};function t9(e,t,s){const i=e[t],o=e[t-1],l=e[t+1];return i?s<t?o?i.top-(o.top+o.height):l?l.top-(i.top+i.height):0:l?l.top-(i.top+i.height):o?i.top-(o.top+o.height):0:0}const JA="Sortable",WA=Ne.createContext({activeIndex:-1,containerId:JA,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:ZA,disabled:{draggable:!1,droppable:!1}});function n9(e){let{children:t,id:s,items:i,strategy:o=ZA,disabled:l=!1}=e;const{active:u,dragOverlay:d,droppableRects:f,over:g,measureDroppableContainers:m}=QA(),h=Rd(JA,s),x=d.rect!==null,S=b.useMemo(()=>i.map(j=>typeof j=="object"&&"id"in j?j.id:j),[i]),w=u!=null,C=u?S.indexOf(u.id):-1,E=g?S.indexOf(g.id):-1,R=b.useRef(S),k=!J7(S,R.current),O=E!==-1&&C===-1||k,A=W7(l);Xs(()=>{k&&w&&m(S)},[k,S,w,m]),b.useEffect(()=>{R.current=S},[S]);const N=b.useMemo(()=>({activeIndex:C,containerId:h,disabled:A,disableTransforms:O,items:S,overIndex:E,useDragOverlay:x,sortedRects:Z7(S,f),strategy:o}),[C,h,A.draggable,A.droppable,O,S,E,f,x,o]);return Ne.createElement(WA.Provider,{value:N},t)}const r9=e=>{let{id:t,items:s,activeIndex:i,overIndex:o}=e;return Qb(s,i,o).indexOf(t)},s9=e=>{let{containerId:t,isSorting:s,wasDragging:i,index:o,items:l,newIndex:u,previousItems:d,previousContainerId:f,transition:g}=e;return!g||!i||d!==l&&o===u?!1:s?!0:u!==o&&t===f},i9={duration:200,easing:"ease"},eM="transform",a9=Ya.Transition.toString({property:eM,duration:0,easing:"linear"}),o9={roleDescription:"sortable"};function l9(e){let{disabled:t,index:s,node:i,rect:o}=e;const[l,u]=b.useState(null),d=b.useRef(s);return Xs(()=>{if(!t&&s!==d.current&&i.current){const f=o.current;if(f){const g=vc(i.current,{ignoreTransform:!0}),m={x:f.left-g.left,y:f.top-g.top,scaleX:f.width/g.width,scaleY:f.height/g.height};(m.x||m.y)&&u(m)}}s!==d.current&&(d.current=s)},[t,s,i,o]),b.useEffect(()=>{l&&u(null)},[l]),l}function c9(e){let{animateLayoutChanges:t=s9,attributes:s,disabled:i,data:o,getNewIndex:l=r9,id:u,strategy:d,resizeObserverConfig:f,transition:g=i9}=e;const{items:m,containerId:h,activeIndex:x,disabled:S,disableTransforms:w,sortedRects:C,overIndex:E,useDragOverlay:R,strategy:k}=b.useContext(WA),O=u9(i,S),A=m.indexOf(u),N=b.useMemo(()=>({sortable:{containerId:h,index:A,items:m},...o}),[h,o,A,m]),j=b.useMemo(()=>m.slice(m.indexOf(u)),[m,u]),{rect:D,node:M,isOver:_,setNodeRef:L}=XA({id:u,data:N,disabled:O.droppable,resizeObserverConfig:{updateMeasurementsFor:j,...f}}),{active:q,activatorEvent:X,activeNodeRect:B,attributes:H,setNodeRef:U,listeners:z,isDragging:Q,over:$,setActivatorNodeRef:K,transform:Y}=$A({id:u,data:N,attributes:{...o9,...s},disabled:O.draggable}),ee=SF(L,U),G=!!q,oe=G&&!w&&mh(x)&&mh(E),I=!R&&Q,V=I&&oe?Y:null,re=oe?V??(d??k)({rects:C,activeNodeRect:B,activeIndex:x,overIndex:E,index:A}):null,Ee=mh(x)&&mh(E)?l({id:u,items:m,activeIndex:x,overIndex:E}):A,le=q?.id,me=b.useRef({activeId:le,items:m,newIndex:Ee,containerId:h}),ge=m!==me.current.items,ue=t({active:q,containerId:h,isDragging:Q,isSorting:G,id:u,index:A,items:m,newIndex:me.current.newIndex,previousItems:me.current.items,previousContainerId:me.current.containerId,transition:g,wasDragging:me.current.activeId!=null}),Te=l9({disabled:!ue,index:A,node:M,rect:D});return b.useEffect(()=>{G&&me.current.newIndex!==Ee&&(me.current.newIndex=Ee),h!==me.current.containerId&&(me.current.containerId=h),m!==me.current.items&&(me.current.items=m)},[G,Ee,h,m]),b.useEffect(()=>{if(le===me.current.activeId)return;if(le!=null&&me.current.activeId==null){me.current.activeId=le;return}const Pe=setTimeout(()=>{me.current.activeId=le},50);return()=>clearTimeout(Pe)},[le]),{active:q,activeIndex:x,attributes:H,data:N,rect:D,index:A,newIndex:Ee,items:m,isOver:_,isSorting:G,isDragging:Q,listeners:z,node:M,overIndex:E,over:$,setNodeRef:ee,setActivatorNodeRef:K,setDroppableNodeRef:L,setDraggableNodeRef:U,transform:Te??re,transition:ve()};function ve(){if(Te||ge&&me.current.newIndex===A)return a9;if(!(I&&!vg(X)||!g)&&(G||ue))return Ya.Transition.toString({...g,property:eM})}}function u9(e,t){var s,i;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(s=e?.draggable)!=null?s:t.draggable,droppable:(i=e?.droppable)!=null?i:t.droppable}}function cp(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const d9=[en.Down,en.Right,en.Up,en.Left],f9=(e,t)=>{let{context:{active:s,collisionRect:i,droppableRects:o,droppableContainers:l,over:u,scrollableAncestors:d}}=t;if(d9.includes(e.code)){if(e.preventDefault(),!s||!i)return;const f=[];l.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const x=o.get(h.id);if(x)switch(e.code){case en.Down:i.top<x.top&&f.push(h);break;case en.Up:i.top>x.top&&f.push(h);break;case en.Left:i.left>x.left&&f.push(h);break;case en.Right:i.left<x.left&&f.push(h);break}});const g=UF({collisionRect:i,droppableRects:o,droppableContainers:f});let m=AA(g,"id");if(m===u?.id&&g.length>1&&(m=g[1].id),m!=null){const h=l.get(s.id),x=l.get(m),S=x?o.get(x.id):null,w=x?.node.current;if(w&&S&&h&&x){const E=bg(w).some((j,D)=>d[D]!==j),R=tM(h,x),k=h9(h,x),O=E||!R?{x:0,y:0}:{x:k?i.width-S.width:0,y:k?i.height-S.height:0},A={x:S.left,y:S.top};return O.x&&O.y?A:qu(A,O)}}}};function tM(e,t){return!cp(e)||!cp(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function h9(e,t){return!cp(e)||!cp(t)||!tM(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function Gi({className:e,size:t="default",...s}){return v.jsx("div",{"data-slot":"card","data-size":t,className:Fe("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-lg bg-card py-(--card-spacing) text-xs/relaxed text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg",e),...s})}function p9({className:e,...t}){return v.jsx("div",{"data-slot":"card-header",className:Fe("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-lg px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",e),...t})}function g9({className:e,...t}){return v.jsx("div",{"data-slot":"card-content",className:Fe("px-(--card-spacing)",e),...t})}const nM=b.createContext(void 0);function m9(){const e=b.useContext(nM);if(e===void 0)throw new Error(gn(63));return e}const y9="data-checked",v9="data-unchecked",rM={...hc,checked(e){return e?{[y9]:""}:{[v9]:""}}},b9=b.forwardRef(function(t,s){const{checked:i,className:o,defaultChecked:l,"aria-labelledby":u,form:d,id:f,inputRef:g,name:m,nativeButton:h=!1,onCheckedChange:x,readOnly:S=!1,required:w=!1,disabled:C=!1,render:E,uncheckedValue:R,value:k,style:O,...A}=t,{clearErrors:N}=vd(),{state:j,setTouched:D,setDirty:M,validityData:_,setFilled:L,validationMode:q,disabled:X,name:B,validation:H}=sa(),{labelId:U}=Yo(),z=X||C,Q=B??m,$=b.useRef(null),K=es($,g,H.inputRef),Y=b.useRef(null),ee=bd(z,Y),G=ar(),oe=pc({id:f}),I=h?void 0:oe,[V,W]=Ji({controlled:i,default:!!l,name:"Switch",state:"checked"});xd(Y,G,V,void 0,!z,m),_e(()=>{L(V)},[V,L]),cc(V,()=>{N(Q),M(V!==_.initialValue),H.change(V)});const{getButtonProps:re,buttonRef:Ee}=vs({disabled:z,native:h}),le=Ub(u,U,$,!h,I,A["aria-label"]),me={id:h?oe:G,role:"switch","aria-checked":V,"aria-readonly":S||void 0,"aria-required":w||void 0,"aria-labelledby":le,onFocus(){ee(!0)},onBlur(){const ve=$.current;!ve||z||(D(!0),ee(!1),q==="onBlur"&&H.commit(ve.checked))},onClick(ve){if(S||z)return;ve.preventDefault();const Pe=$.current;Pe&&Do(Pe,ve)}},ge={...H.getValidationProps(z),checked:V,disabled:z,form:d,id:I,name:Q,required:w,style:Q?Tp:rd,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:K,onChange(ve){if(ve.nativeEvent.defaultPrevented)return;if(S){ve.preventDefault();return}const Pe=ve.currentTarget.checked,Oe=ut(Mr,ve.nativeEvent);x?.(Pe,Oe),!Oe.isCanceled&&W(Pe)},onClick(ve){ve.stopPropagation()},onFocus(){Y.current?.focus()},...k!==void 0?{value:k}:Xt},ue=b.useMemo(()=>({...j,checked:V,disabled:z,readOnly:S,required:w}),[j,V,z,S,w]),Te=kt("span",t,{state:ue,ref:[s,Y,Ee],props:[me,A,re,ve=>H.getValidationProps(z,ve)],stateAttributesMapping:rM});return v.jsxs(nM.Provider,{value:ue,children:[Te,!V&&Q&&R!==void 0&&v.jsx("input",{type:"hidden",form:d,name:Q,value:R,disabled:z}),v.jsx("input",{...ge,suppressHydrationWarning:!0})]})}),x9=b.forwardRef(function(t,s){const{render:i,className:o,style:l,...u}=t,d=m9();return kt("span",t,{state:d,ref:s,stateAttributesMapping:rM,props:u})});function S9({className:e,...t}){return v.jsx(b9,{"data-slot":"switch",className:Fe(`
70
+ peer relative inline-flex h-4 w-7 shrink-0 items-center rounded-full
71
+ border border-transparent bg-input p-0.5 transition-colors outline-none
72
+ focus-visible:border-ring focus-visible:ring-2
73
+ focus-visible:ring-ring/30 disabled:cursor-not-allowed
74
+ disabled:opacity-50 data-checked:bg-primary
75
+ `,e),...t,children:v.jsx(x9,{"data-slot":"switch-thumb",className:`
76
+ pointer-events-none block size-3 rounded-full bg-background shadow-sm
77
+ transition-transform data-checked:translate-x-3
78
+ `})})}function w9(e){return`library:${e}`}function sM(e,t){return`assigned:${e}:${t}`}function iM(e){return`agent:${e}`}function E9(e){return String(e).startsWith("assigned:")}function hv(e){return Xb(e)&&e.type==="library-instruction"&&typeof e.instructionId=="string"}function Jl(e){return Xb(e)&&e.type==="assigned-instruction"&&typeof e.agentId=="string"&&typeof e.instructionId=="string"}function DR(e){return Xb(e)&&e.type==="agent"&&typeof e.agentId=="string"}function Xb(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const R9="data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenAI%3c/title%3e%3cpath%20d='M9.205%208.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357%201.356-.523%202.117-.523%202.854%200%204.662%202.212%204.662%204.566%200%20.167%200%20.357-.024.547l-4.71-2.759a.797.797%200%2000-.856%200l-5.97%203.473zm10.609%208.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473%201.95-1.118a.433.433%200%2001.476%200l4.543%202.617c1.309.76%202.189%202.378%202.189%203.948%200%201.808-1.07%203.473-2.76%204.163zM7.802%2012.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545%201.95-4.472%204.591-4.472%201%200%201.927.333%202.712.928L8.23%205.067c-.285.166-.428.404-.428.737v6.898zM12%2015.128l-2.795-1.57v-3.33L12%208.658l2.795%201.57v3.33L12%2015.128zm1.796%207.23c-1%200-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974%201.142c.167.095.238.238.238.428v5.233c0%202.545-1.974%204.472-4.614%204.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482%204.482%200%20014.21%206.327v5.423c0%20.333.143.571.428.738l5.947%203.449-1.95%201.118a.432.432%200%2001-.476%200zm-.262%203.9c-2.688%200-4.662-2.021-4.662-4.519%200-.19.024-.38.047-.57l4.686%202.71c.286.167.571.167.856%200l5.97-3.448v2.26c0%20.19-.07.333-.237.428l-4.543%202.616c-.619.357-1.356.523-2.117.523zm5.899%202.83a5.947%205.947%200%20005.827-4.756C22.287%2018.339%2024%2015.84%2024%2013.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498%200-3.401-2.759-5.947-5.946-5.947-.642%200-1.26.095-1.88.31A5.962%205.962%200%200010.205%200a5.947%205.947%200%2000-5.827%204.757C1.713%205.447%200%207.945%200%2010.49c0%201.666.713%203.283%201.998%204.448-.119.5-.19%201-.19%201.499%200%203.401%202.759%205.946%205.946%205.946.642%200%201.26-.095%201.88-.309a5.96%205.96%200%20004.162%201.713z'%3e%3c/path%3e%3c/svg%3e",C9='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>OpenAI</title><path d="M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z"></path></svg>',T9="data:image/svg+xml,%3csvg%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClaude%20Code%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M20.998%2010.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6%2010.949h1.488V8.102H6v2.847zm10.51%200H18V8.102h-1.49v2.847z'%20fill='%23D97757'%20fill-rule='evenodd'%3e%3c/path%3e%3c/svg%3e",k9='<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Claude Code</title><path clip-rule="evenodd" d="M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z"></path></svg>',O9={openai:{src:R9,monochromeSvg:C9,invertInDark:!0},claudecode:{src:T9,monochromeSvg:k9,invertInDark:!1}};function aM({icon:e,monochrome:t=!1,className:s}){const i=O9[e];return v.jsx("div",{"aria-hidden":"true",className:Fe(`
79
+ flex size-8 shrink-0 items-center justify-center rounded-md bg-muted
80
+ text-foreground
81
+ `,t&&"text-muted-foreground",s),children:i?v.jsxs(v.Fragment,{children:[v.jsx("span",{hidden:!t,className:`
82
+ size-4
83
+ [&_svg]:size-full
84
+ `,dangerouslySetInnerHTML:{__html:i.monochromeSvg}}),v.jsx("img",{hidden:t,src:i.src,alt:"",draggable:!1,className:Fe("size-4",i.invertInDark&&"dark:invert")})]}):v.jsx(fT,{className:"size-4"})})}function A9({agent:e,instructionsById:t,isInstructionsLoading:s,isPending:i,isReapplying:o,onRemoveInstruction:l,onToggle:u,onReapply:d,onOpenFile:f}){const{t:g}=pt(),{isOver:m,setNodeRef:h}=XA({id:iM(e.id),data:{type:"agent",agentId:e.id},disabled:i}),x=e.enabled||e.instructionIds.length>0,S=e.enabled?g("agents.reapplyHint"):g("agents.reapplyDisabledHint"),w=g(x?e.enabled?"agents.toggleOnHint":"agents.toggleOffHint":"agents.enableRequiresInstruction");return v.jsxs(Gi,{"data-agent-id":e.id,ref:h,className:Fe("gap-0 py-0 transition-shadow",m&&"ring-2 ring-ring/40"),children:[v.jsxs("div",{className:"flex items-center gap-3 p-3",children:[v.jsx(aM,{icon:e.icon}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx("div",{className:"truncate text-sm font-medium",children:e.name}),v.jsx("button",{type:"button",className:`
85
+ block max-w-full truncate font-mono text-[11px]
86
+ text-muted-foreground
87
+ hover:text-foreground hover:underline
88
+ `,"aria-label":g("agents.openFileAria",{name:e.name}),onClick:()=>{f(e.id)},children:e.instructionFile})]}),v.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[v.jsxs(Xh,{children:[v.jsx(Zh,{render:v.jsx("span",{className:"inline-flex"}),children:v.jsx(nt,{type:"button",variant:"ghost",size:"icon","aria-label":g("agents.reapplyAria",{name:e.name}),disabled:i||!e.enabled,onClick:()=>{d(e.id)},children:v.jsx(OL,{className:Fe(o&&"animate-spin")})})}),v.jsx(Jh,{children:S})]}),v.jsxs(Xh,{children:[v.jsx(Zh,{render:v.jsx("span",{className:"inline-flex"}),children:v.jsx(S9,{checked:e.enabled,disabled:i||!x,"aria-label":g("agents.toggleAria",{name:e.name}),onCheckedChange:C=>{u(e.id,C)}})}),v.jsx(Jh,{children:w})]})]})]}),v.jsx("div",{className:"border-t border-border/60 p-3",children:e.instructionIds.length===0?v.jsx("div",{className:`
89
+ flex min-h-20 items-center justify-center rounded-md border
90
+ border-dashed border-border px-4 text-center text-xs
91
+ text-muted-foreground
92
+ `,children:g("agents.emptyAssigned")}):v.jsx(n9,{items:e.instructionIds.map(C=>sM(e.id,C)),strategy:e9,children:v.jsx("ol",{className:"flex flex-col gap-1",children:e.instructionIds.map((C,E)=>{const R=t.get(C),k=R?.name??C;return v.jsx(M9,{agentId:e.id,index:E,instructionId:C,instructionName:s&&!R?g("agents.loadingInstruction"):k,isPending:i,onRemove:l},C)})})})})]})}function M9({agentId:e,index:t,instructionId:s,instructionName:i,isPending:o,onRemove:l}){const{t:u}=pt(),{attributes:d,isDragging:f,isOver:g,listeners:m,setNodeRef:h,transform:x,transition:S}=c9({id:sM(e,s),animateLayoutChanges:()=>!1,data:{type:"assigned-instruction",agentId:e,instructionId:s},disabled:o});return v.jsxs("li",{...d,...m,ref:h,"data-instruction-id":s,style:{transform:Ya.Transform.toString(x),transition:S},className:Fe(`
93
+ group flex items-center gap-2 rounded-md border border-transparent
94
+ bg-muted/40 px-2 py-1.5
95
+ `,g&&"border-ring bg-muted",f&&"z-10",o?"cursor-default":`
96
+ cursor-grab
97
+ active:cursor-grabbing
98
+ `),children:[v.jsx(tb,{"aria-hidden":"true",className:`
99
+ size-3.5 shrink-0 text-muted-foreground
100
+ group-active:cursor-grabbing
101
+ `}),v.jsx("span",{className:`
102
+ w-4 shrink-0 text-center font-mono text-[10px] text-muted-foreground
103
+ `,children:t+1}),v.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:i}),v.jsx(nt,{type:"button",variant:"ghost",size:"icon","aria-label":u("agents.removeInstructionAria",{name:i}),disabled:o,onClick:()=>{l(e,s)},onKeyDown:w=>{w.stopPropagation()},onPointerDown:w=>{w.stopPropagation()},children:v.jsx(ta,{})})]})}const oM="/api/agents";class lM extends Error{constructor(t,s){super(s),this.code=t,this.name="AgentApiError"}code}function N9(e){return Td(oM,{signal:e})}function D9(e,t){return Td(wg(e,"instructions"),{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({instructionIds:t})})}function j9(e,t){return Td(wg(e,"enabled"),{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:t})})}function I9(e){return Td(wg(e,"reapply"),{method:"POST"})}function P9(e){return Td(wg(e,"open-file"),{method:"POST"})}function wg(e,t){return`${oM}/${encodeURIComponent(e)}/${t}`}async function Td(e,t){const s=await fetch(e,t);if(!s.ok){const i=await L9(s);throw new lM(i.code,i.message)}return s.json()}async function L9(e){try{const t=await e.json();return{code:t.error?.code??"AGENT_REQUEST_FAILED",message:t.error?.message??`Request failed with status ${e.status}`}}catch{return{code:"AGENT_REQUEST_FAILED",message:`Request failed with status ${e.status}`}}}const Hr=["agents"],vh=["agents","update"];function z9(){const{t:e}=pt(),t=Nr(),s=na({queryKey:Hr,queryFn:({signal:h})=>N9(h),retry:!1});function i(h){t.setQueryData(Hr,x=>x?.map(S=>S.id===h.id?h:S))}const o=er({mutationKey:vh,mutationFn:({agentId:h,instructionIds:x})=>D9(h,x),onMutate:async({previous:h})=>(await t.cancelQueries({queryKey:Hr}),{previous:h}),onError:(h,x,S)=>{S?.previous&&t.setQueryData(Hr,S.previous),Kt.error(e("agents.updateError"))},onSuccess:i,onSettled:()=>t.invalidateQueries({queryKey:Hr})}),l=er({mutationKey:vh,mutationFn:({agentId:h,enabled:x})=>j9(h,x),onMutate:async({agentId:h,enabled:x})=>{await t.cancelQueries({queryKey:Hr});const S=t.getQueryData(Hr);return t.setQueryData(Hr,w=>w?.map(C=>C.id===h?{...C,enabled:x}:C)),{previous:S}},onError:(h,x,S)=>{S?.previous&&t.setQueryData(Hr,S.previous),Kt.error(e("agents.enableError"))},onSuccess:h=>{i(h),Kt.success(e(h.enabled?"agents.applied":"agents.removed"))},onSettled:()=>t.invalidateQueries({queryKey:Hr})}),u=er({mutationKey:vh,mutationFn:h=>I9(h),onSuccess:h=>{i(h),Kt.success(e("agents.reapplied"))},onError:()=>{Kt.error(e("agents.reapplyError"))},onSettled:()=>t.invalidateQueries({queryKey:Hr})}),d=er({mutationKey:vh,mutationFn:h=>P9(h),onError:h=>{Kt.error(e(h instanceof lM&&h.code==="AGENT_FILE_NOT_FOUND"?"agents.fileMissing":"agents.openFileError"))}}),f=[o,l,u,d],g=new Set;for(const h of f){if(!h.isPending)continue;const x=_9(h.variables);x&&g.add(x)}const m=new Set(u.isPending&&typeof u.variables=="string"?[u.variables]:[]);return{agents:s.data??[],isLoading:s.isPending,isError:s.isError&&s.data===void 0,retry:s.refetch,pendingAgentIds:g,reapplyingAgentIds:m,updateInstructions:(h,x)=>{const S=t.getQueryData(Hr);t.setQueryData(Hr,w=>w?.map(C=>C.id===h?{...C,instructionIds:x,enabled:x.length>0&&C.enabled}:C)),o.mutate({agentId:h,instructionIds:x,previous:S})},setEnabled:(h,x)=>{l.mutate({agentId:h,enabled:x})},reapply:h=>{u.mutate(h)},openFile:h=>{d.mutate(h)}}}function _9(e){if(typeof e=="string")return e;if(e&&typeof e=="object"&&"agentId"in e){const t=e.agentId;return typeof t=="string"?t:void 0}}function Gu({className:e,description:t,icon:s,title:i}){let o=null;return t!=null&&(o=v.jsx("p",{className:"max-w-64 text-xs/relaxed text-muted-foreground",children:t})),v.jsxs("div",{"data-slot":"empty",className:Fe(`
104
+ flex w-full flex-1 flex-col items-center justify-center gap-2 px-4
105
+ py-10 text-center
106
+ `,e),children:[s&&v.jsx("div",{className:`
107
+ flex size-8 items-center justify-center rounded-md bg-muted
108
+ text-muted-foreground
109
+ `,children:v.jsx(s,{"aria-hidden":"true",className:"size-4"})}),v.jsx("div",{className:"text-sm font-medium",children:i}),o]})}function U9(e){const[t,s]=b.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),i=b.useRef(null),o=b.useRef(null),l=b.useRef(null),u=b.useRef(null),d=b.useRef(!0),f=b.useRef(null),g=ac(),m=b.useMemo(()=>({anchor:t,setAnchor:s,actionsRef:l,backdropRef:i,internalBackdropRef:o,positionerRef:u,allowMouseUpTriggerRef:d,initialCursorPointRef:f,rootId:g}),[t,g]);return v.jsx(_O.Provider,{value:m,children:v.jsx(ug.Provider,{value:void 0,children:v.jsx(tA,{...e})})})}const jR=500,H9=b.forwardRef(function(t,s){const{render:i,className:o,style:l,...u}=t,{setAnchor:d,actionsRef:f,internalBackdropRef:g,backdropRef:m,positionerRef:h,allowMouseUpTriggerRef:x,initialCursorPointRef:S,rootId:w}=dg(!1),{store:C}=ra(!1),E=C.useState("open"),R=C.useState("disabled"),k=b.useRef(null),O=b.useRef(null),A=Un(),N=Un(),j=b.useRef(!1),D=b.useRef(null);function M(U,z,Q){const $=Q.type.startsWith("touch");S.current={x:U,y:z},d({getBoundingClientRect(){return DOMRect.fromRect({width:$?10:0,height:$?10:0,x:U,y:z})}}),j.current=!1,f.current?.setOpen(!0,ut(Qs,Q)),N.start(jR,()=>{j.current=!0})}function _(U){if(R)return;x.current=!0,Ys(U),M(U.clientX,U.clientY,U.nativeEvent);const z=Qt(k.current);D.current?.abort();const Q=new AbortController;D.current=Q,z.addEventListener("mouseup",$=>{if(x.current=!1,!j.current)return;N.clear(),j.current=!1;const K=nr($);it(h.current,K)||w&&K&&zb(K)===w||f.current?.setOpen(!1,ut(Mv,$))},{once:!0,signal:Q.signal})}function L(){A.clear(),O.current=null}function q(U){if(R){L();return}if(x.current=!1,U.touches.length!==1){L();return}U.stopPropagation();const z=U.touches[0],Q={x:z.clientX,y:z.clientY};O.current=Q,A.start(jR,()=>{M(Q.x,Q.y,U.nativeEvent)})}function X(U){if(U.touches.length!==1){L();return}if(A.isStarted()&&O.current){const z=U.touches[0],Q=10,$=Math.abs(z.clientX-O.current.x),K=Math.abs(z.clientY-O.current.y);($>Q||K>Q)&&L()}}return b.useEffect(()=>()=>{D.current?.abort()},[]),b.useEffect(()=>{function U(Q){if(R)return;const K=nr(Q);(it(k.current,K)||it(g.current,K)||it(m.current,K))&&Q.preventDefault()}const z=Qt(k.current);return Lt(z,"contextmenu",U)},[m,R,g]),kt("div",t,{state:{open:E},ref:[k,s],props:[{onContextMenu:_,onTouchStart:q,onTouchMove:X,onTouchEnd:L,onTouchCancel:L,style:{WebkitTouchCallout:"none"}},u],stateAttributesMapping:_u})}),F9=XO;function Eg({...e}){return v.jsx(U9,{"data-slot":"context-menu",...e})}function Rg({className:e,...t}){return v.jsx(H9,{"data-slot":"context-menu-trigger",className:Fe("select-none",e),...t})}function Cg({className:e,align:t="start",alignOffset:s=4,side:i="right",sideOffset:o=0,...l}){return v.jsx($O,{children:v.jsx(F9,{className:"isolate z-50 outline-none",align:t,alignOffset:s,side:i,sideOffset:o,children:v.jsx(YO,{"data-slot":"context-menu-content",className:Fe("z-50 max-h-(--available-height) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...l})})})}function Tg({className:e,inset:t,variant:s="default",...i}){return v.jsx(qO,{"data-slot":"context-menu-item","data-inset":t,"data-variant":s,className:Fe("group/context-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive",e),...i})}function B9({instructions:e,isLoading:t,isError:s,onRetry:i,onEdit:o,onDelete:l,onPreload:u}){const{t:d}=pt();return t?v.jsx(Gi,{className:"gap-0 py-0",children:v.jsx("div",{className:"divide-y",children:[0,1,2].map(f=>v.jsxs("div",{className:"flex items-center gap-2 p-3",children:[v.jsx(fr,{className:"size-3.5 rounded-sm"}),v.jsx(fr,{className:"h-4 w-2/3"})]},f))})}):s?v.jsxs(Gi,{className:"items-start gap-3 p-4",children:[v.jsx("p",{className:"text-xs text-muted-foreground",children:d("instructions.loadError")}),v.jsxs(nt,{type:"button",variant:"outline",onClick:i,children:[v.jsx(nk,{}),v.jsx("span",{children:d("common.retry")})]})]}):e.length===0?v.jsx(Gi,{className:"gap-0 py-0",children:v.jsx(Gu,{icon:eb,title:d("instructions.emptyTitle"),description:d("instructions.emptyDescription")})}):v.jsx(Gi,{className:"gap-0 py-0",children:v.jsx("ul",{"aria-label":d("instructions.listAria"),className:"divide-y",children:e.map(f=>v.jsx(V9,{instruction:f,onRequestDelete:()=>l(f),onEdit:()=>{o(f)},onPreload:u},f.id))})})}function V9({instruction:e,onEdit:t,onPreload:s,onRequestDelete:i}){const{t:o}=pt(),{attributes:l,isDragging:u,listeners:d,setNodeRef:f}=$A({id:w9(e.id),data:{type:"library-instruction",instructionId:e.id}});return v.jsxs(Eg,{children:[v.jsxs(Rg,{ref:f,render:v.jsx("li",{...d,"data-instruction-id":e.id,className:Fe(`
110
+ group flex cursor-grab items-center gap-2 py-2.5 pr-1 pl-3
111
+ hover:bg-muted/40
112
+ active:cursor-grabbing
113
+ `,u&&"opacity-40")}),children:[v.jsx(tb,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-muted-foreground"}),v.jsx("button",{...l,type:"button",className:`
114
+ flex min-w-0 flex-1 cursor-grab items-center gap-2 text-left text-xs
115
+ outline-none
116
+ focus-visible:underline focus-visible:underline-offset-3
117
+ active:cursor-grabbing
118
+ `,onClick:t,onFocus:s,onPointerEnter:s,children:v.jsx("span",{className:"min-w-0 flex-1 truncate",children:e.name})}),v.jsxs(Vo,{children:[v.jsx(Ko,{render:v.jsx(nt,{type:"button",variant:"ghost",size:"icon","aria-label":o("instructions.actionsAria",{name:e.name}),className:`
119
+ -my-1.5 shrink-0 text-muted-foreground opacity-0
120
+ transition-opacity
121
+ group-hover:opacity-100
122
+ focus-visible:opacity-100
123
+ data-popup-open:opacity-100
124
+ [@media(hover:none)]:opacity-100
125
+ `,onKeyDown:g=>{g.stopPropagation()},onMouseDown:g=>{g.stopPropagation()},onPointerDown:g=>{g.stopPropagation()},onTouchStart:g=>{g.stopPropagation()}}),children:v.jsx(Wv,{})}),v.jsx(qo,{align:"end",className:"w-40",children:v.jsx(IR,{Item:fc,onDelete:i,onEdit:t})})]})]}),v.jsx(Cg,{children:v.jsx(IR,{Item:Tg,onDelete:i,onEdit:t})})]})}function IR({Item:e,onEdit:t,onDelete:s}){const{t:i}=pt();return v.jsxs(v.Fragment,{children:[v.jsxs(e,{onClick:t,children:[v.jsx(JT,{}),v.jsx("span",{children:i("instructions.edit")})]}),v.jsxs(e,{variant:"destructive",onClick:s,children:[v.jsx(rb,{}),v.jsx("span",{children:i("instructions.delete")})]})]})}function cM({className:e,...t}){return v.jsx("label",{"data-slot":"label",className:Fe("flex items-center gap-2 text-xs/relaxed leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Wi({children:e,className:t,...s}){return v.jsxs(cM,{className:Fe("gap-1",t),...s,children:[e,v.jsx("span",{"aria-hidden":"true",className:"text-destructive",children:"*"})]})}function Ri({...e}){return v.jsx(yA,{"data-slot":"dialog",...e})}function K9({...e}){return v.jsx(mA,{"data-slot":"dialog-portal",...e})}function kd({...e}){return v.jsx(pg,{"data-slot":"dialog-close",...e})}function q9({className:e,...t}){return v.jsx(fA,{"data-slot":"dialog-overlay",className:Fe("fixed inset-0 isolate z-50 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function Ci({className:e,children:t,showCloseButton:s=!0,...i}){return v.jsxs(K9,{children:[v.jsx(q9,{}),v.jsxs(gA,{"data-slot":"dialog-content",className:Fe("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-xs/relaxed text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...i,children:[t,s&&v.jsxs(pg,{"data-slot":"dialog-close",render:v.jsx(nt,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[v.jsx(ta,{}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Js({className:e,...t}){return v.jsx("div",{"data-slot":"dialog-header",className:Fe("flex flex-col gap-1",e),...t})}function bi({className:e,showCloseButton:t=!1,children:s,...i}){return v.jsxs("div",{"data-slot":"dialog-footer",className:Fe("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...i,children:[s,t&&v.jsx(pg,{render:v.jsx(nt,{variant:"outline"}),children:"Close"})]})}function Ws({className:e,...t}){return v.jsx(vA,{"data-slot":"dialog-title",className:Fe("font-heading text-sm font-medium",e),...t})}function xi({className:e,...t}){return v.jsx(hA,{"data-slot":"dialog-description",className:Fe("text-xs/relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}const Zb="/api/instructions";class uM extends Error{constructor(t,s){super(s),this.code=t,this.name="InstructionApiError"}code}function Y9(e){return Jb(Zb,{signal:e})}function G9(e){return Jb(Zb,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}function $9(e,t){return Jb(dM(e),{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}async function Q9(e){const t=await fetch(dM(e),{method:"DELETE"});if(t.ok)return;const s=await fM(t);throw new uM(s.code,s.message)}async function Jb(e,t){const s=await fetch(e,t);if(!s.ok){const i=await fM(s);throw new uM(i.code,i.message)}return s.json()}function dM(e){return`${Zb}/${encodeURIComponent(e)}`}async function fM(e){try{const t=await e.json();return{code:t.error?.code??"INSTRUCTION_REQUEST_FAILED",message:t.error?.message??`Request failed with status ${e.status}`}}catch{return{code:"INSTRUCTION_REQUEST_FAILED",message:`Request failed with status ${e.status}`}}}const $u=["instructions"];function X9(){const e=na({queryKey:$u,queryFn:({signal:t})=>Y9(t),retry:!1});return{instructions:e.data??[],isLoading:e.isPending,isError:e.isError&&e.data===void 0,retry:e.refetch}}const Z9="modulepreload",J9=function(e){return"/"+e},PR={},W9=function(t,s,i){let o=Promise.resolve();if(s&&s.length>0){let f=function(g){return Promise.all(g.map(m=>Promise.resolve(m).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),d=u?.nonce||u?.getAttribute("nonce");o=f(s.map(g=>{if(g=J9(g),g in PR)return;PR[g]=!0;const m=g.endsWith(".css"),h=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${h}`))return;const x=document.createElement("link");if(x.rel=m?"stylesheet":Z9,m||(x.as="script"),x.crossOrigin="",x.href=g,d&&x.setAttribute("nonce",d),document.head.appendChild(x),m)return new Promise((S,w)=>{x.addEventListener("load",S),x.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${g}`)))})}))}function l(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return o.then(u=>{for(const d of u||[])d.status==="rejected"&&l(d.reason);return t().catch(l)})},hM=()=>W9(()=>import("./code-editor-DR4jlIG5.js").then(e=>e.j2),__vite__mapDeps([0,1]));function Ty(){hM()}const eB=b.lazy(async()=>({default:(await hM()).CodeEditor}));function pM(e){const{t}=pt();return v.jsx(b.Suspense,{fallback:v.jsx("div",{style:{height:e.height??"16rem"},className:`
126
+ flex items-center justify-center text-xs text-muted-foreground
127
+ `,children:t("editor.loading")}),children:v.jsx(eB,{...e})})}const tB="16rem";function LR({instruction:e,onClose:t}){const{t:s}=pt(),i=Nr(),o=b.useId(),l=b.useId(),u=e!==void 0,[d,f]=b.useState(e?.name??""),[g,m]=b.useState(e?.content??""),h=er({mutationFn:O=>e?$9(e.id,O):G9(O),onSuccess:O=>{i.setQueryData($u,A=>[...(A??[]).filter(N=>N.id!==O.id),O].toSorted((N,j)=>j.updatedAt-N.updatedAt)),i.invalidateQueries({queryKey:$u}),Kt.success(s(u?"instructions.updated":"instructions.created")),t()},onError:()=>{Kt.error(s(u?"instructions.updateError":"instructions.error"))}}),x=h.isPending,S=!!(d.trim()&&g.trim())&&!x,w=u?"instructions.editTitle":"instructions.createTitle",C=u?"instructions.updating":"instructions.creating",E=u?"instructions.updateSave":"instructions.save",R=u?nb:lc;function k(){x||t()}return v.jsx(Ri,{open:!0,onOpenChange:O=>{O||k()},children:v.jsxs(Ci,{showCloseButton:!1,className:`
128
+ grid max-h-[calc(100vh-2rem)] grid-rows-[auto_minmax(0,1fr)_auto]
129
+ overflow-hidden
130
+ sm:max-w-3xl
131
+ `,children:[v.jsxs("form",{className:"contents","aria-busy":x,onSubmit:O=>{O.preventDefault(),S&&h.mutate({name:d.trim(),content:g})},children:[v.jsx(Js,{className:"pr-8",children:v.jsx(Ws,{children:s(w)})}),v.jsxs("div",{className:"flex min-h-0 flex-col gap-3 overflow-y-auto pr-1",children:[v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Wi,{htmlFor:o,children:s("instructions.name")}),v.jsx(Sd,{id:o,autoFocus:!0,required:!0,maxLength:200,value:d,disabled:x,placeholder:s("instructions.namePlaceholder"),onChange:O=>{f(O.target.value)}})]}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Wi,{id:l,children:s("instructions.content")}),v.jsx("div",{role:"group","aria-labelledby":l,"aria-required":"true",className:`
132
+ overflow-hidden rounded-md border border-input bg-input/20
133
+ focus-within:border-ring focus-within:ring-2
134
+ focus-within:ring-ring/30
135
+ `,children:v.jsx(pM,{height:tB,value:g,ariaLabel:s("instructions.content"),placeholder:s("instructions.contentPlaceholder"),readOnly:x,onChange:m})})]})]}),v.jsxs(bi,{children:[v.jsx(nt,{type:"button",variant:"ghost",disabled:x,onClick:k,children:s("common.cancel")}),v.jsxs(nt,{type:"submit",disabled:!S,children:[x?v.jsx(Vr,{className:"animate-spin"}):v.jsx(R,{}),v.jsx("span",{children:s(x?C:E)})]})]})]}),v.jsxs(kd,{disabled:x,render:v.jsx(nt,{variant:"ghost",size:"icon",className:"absolute top-2 right-2"}),children:[v.jsx(ta,{}),v.jsx("span",{className:"sr-only",children:s("a11y.close")})]})]})})}function nB({instruction:e,onClose:t}){const{t:s}=pt(),i=Nr(),o=er({mutationFn:()=>Q9(e.id),onSuccess:()=>{i.setQueryData($u,u=>u?.filter(({id:d})=>d!==e.id)),i.setQueryData(Hr,u=>u?.map(d=>{const f=d.instructionIds.filter(g=>g!==e.id);return{...d,instructionIds:f,enabled:f.length>0&&d.enabled}})),i.invalidateQueries({queryKey:$u}),i.invalidateQueries({queryKey:Hr}),Kt.success(s("instructions.deleted")),t()},onError:()=>Kt.error(s("instructions.deleteError"))}),l=()=>{o.isPending||t()};return v.jsx(Ri,{open:!0,onOpenChange:u=>{u||l()},children:v.jsxs(Ci,{showCloseButton:!1,children:[v.jsxs(Js,{children:[v.jsx(Ws,{children:s("instructions.deleteConfirmTitle")}),v.jsx(xi,{children:s("instructions.deleteConfirmDescription",{name:e.name})})]}),v.jsxs(bi,{children:[v.jsx(nt,{type:"button",variant:"ghost",disabled:o.isPending,onClick:l,children:s("common.cancel")}),v.jsxs(nt,{type:"button",variant:"destructive",disabled:o.isPending,onClick:()=>o.mutate(),children:[o.isPending&&v.jsx(Vr,{className:"animate-spin"}),v.jsx("span",{children:s("instructions.delete")})]})]})]})})}const rB=e=>{const t=e.active.data.current;if(Jl(t))return sB(e,t.agentId);const s=e.pointerCoordinates?VF(e):_F(e),i=s.filter(({id:o})=>E9(o));return i.length>0?i:s};function sB(e,t){const s=e.collisionRect.left+e.collisionRect.width/2,i=e.collisionRect.top+e.collisionRect.height/2,o=e.droppableRects.get(iM(t));if(o&&(s<o.left||s>o.left+o.width||i<o.top||i>o.top+o.height))return[];let l;for(const u of e.droppableContainers){const d=u.data.current;if(!Jl(d)||d.agentId!==t)continue;const f=e.droppableRects.get(u.id);if(!f)continue;const g=(f.left+f.width/2-s)**2+(f.top+f.height/2-i)**2;(!l||g<l.distance)&&(l={id:u.id,distance:g})}return l?[{id:l.id}]:[]}function iB(){const{t:e}=pt(),[t,s]=b.useState(null),[i,o]=b.useState(!1),[l,u]=b.useState(null),[d,f]=b.useState(null),g=X9(),m=z9(),h=PF(wy(FA,{activationConstraint:{distance:4}}),wy(BA,{activationConstraint:{delay:200,tolerance:8}}),wy(Yb,{coordinateGetter:f9})),x=b.useMemo(()=>new Map(g.instructions.map(N=>[N.id,N])),[g.instructions]),S=d?g.instructions.find(({id:N})=>N===d):void 0,w=t?.data.current,C=aB(w),E=C?x.get(C)?.name??C:"",R=t?.rect.current.initial?.width;function k(N,j,D){const M=m.agents.find(({id:q})=>q===N);if(!M||m.pendingAgentIds.has(N))return;if(M.instructionIds.includes(j)){Kt.error(e("agents.duplicateError"));return}const _=[...M.instructionIds],L=D?_.indexOf(D):-1;_.splice(L<0?_.length:L,0,j),m.updateInstructions(N,_)}function O(N,j){const D=m.agents.find(({id:M})=>M===N);!D||m.pendingAgentIds.has(N)||m.updateInstructions(N,D.instructionIds.filter(M=>M!==j))}function A({active:N,over:j}){if(s(null),!j)return;const D=N.data.current,M=j.data.current;if(hv(D)){if(DR(M)){k(M.agentId,D.instructionId);return}Jl(M)&&k(M.agentId,D.instructionId,M.instructionId);return}if(!Jl(D))return;const _=m.agents.find(({id:H})=>H===D.agentId);if(!_||m.pendingAgentIds.has(_.id))return;const L=_.instructionIds,q=L.indexOf(D.instructionId),X=Jl(M)&&M.agentId===D.agentId?L.indexOf(M.instructionId):DR(M)&&M.agentId===D.agentId?L.length-1:-1;if(q===X||q===-1||X===-1)return;const B=Qb([...L],q,X);B.length===L.length&&B.every((H,U)=>H===L[U])||m.updateInstructions(_.id,B)}return v.jsxs(j7,{sensors:h,collisionDetection:rB,onDragStart:({active:N})=>{s(N)},onDragCancel:()=>{s(null)},onDragEnd:A,children:[v.jsxs("div",{className:`
136
+ grid min-h-0 flex-1 gap-4 overflow-hidden p-4
137
+ max-md:overflow-y-auto
138
+ md:grid-cols-2
139
+ `,children:[v.jsx(CA,{children:v.jsxs(nt,{type:"button",onFocus:Ty,onPointerEnter:Ty,onClick:()=>{o(!0)},children:[v.jsx(lc,{}),v.jsx("span",{children:e("instructions.create")})]})}),v.jsxs("section",{className:"flex min-h-0 flex-col gap-2",children:[v.jsxs("div",{className:"flex items-baseline justify-between gap-3 px-1",children:[v.jsx("h2",{className:"text-xs font-medium text-muted-foreground",children:e("nav.instructions")}),v.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:e("instructions.dragHint")})]}),v.jsx("div",{className:`
140
+ min-h-0 flex-1 overflow-y-auto p-1
141
+ max-md:max-h-64
142
+ `,children:v.jsx(B9,{instructions:g.instructions,isLoading:g.isLoading,isError:g.isError,onRetry:()=>{g.retry()},onEdit:N=>{f(N.id)},onDelete:N=>{u(N)},onPreload:Ty})})]}),v.jsxs("section",{className:"flex min-h-0 flex-col gap-2",children:[v.jsxs("div",{className:"flex items-baseline justify-between gap-3 px-1",children:[v.jsx("h2",{className:"text-xs font-medium text-muted-foreground",children:e("agents.title")}),v.jsx("span",{className:"truncate text-[11px] text-muted-foreground",children:e("agents.orderHint")})]}),v.jsxs("div",{className:`
143
+ flex min-h-0 flex-1 flex-col gap-3 p-1
144
+ max-md:pb-2
145
+ md:overflow-y-auto
146
+ `,children:[m.isLoading&&v.jsx(oB,{}),!m.isLoading&&m.isError&&v.jsxs(Gi,{className:"items-start gap-3 p-4",children:[v.jsx("p",{className:"text-xs text-muted-foreground",children:e("agents.loadError")}),v.jsxs(nt,{type:"button",variant:"outline",onClick:()=>{m.retry()},children:[v.jsx(nk,{}),v.jsx("span",{children:e("common.retry")})]})]}),!m.isLoading&&!m.isError&&m.agents.map(N=>v.jsx(A9,{agent:N,instructionsById:x,isInstructionsLoading:g.isLoading,isPending:m.pendingAgentIds.has(N.id),isReapplying:m.reapplyingAgentIds.has(N.id),onRemoveInstruction:O,onToggle:(j,D)=>{m.setEnabled(j,D)},onReapply:j=>{m.reapply(j)},onOpenFile:j=>{m.openFile(j)}},N.id))]})]}),l&&v.jsx(nB,{instruction:l,onClose:()=>u(null)}),i&&v.jsx(LR,{onClose:()=>{o(!1)}}),S&&v.jsx(LR,{instruction:S,onClose:()=>{f(null)}})]}),hv(w)&&v.jsx(X7,{dropAnimation:null,children:E&&v.jsxs("div",{style:{width:R},className:"flex items-center gap-2 bg-card px-3 py-2.5 text-xs",children:[v.jsx(tb,{className:"size-3.5 text-muted-foreground"}),v.jsx("span",{className:"truncate",children:E})]})})]})}function aB(e){if(hv(e)||Jl(e))return e.instructionId}function oB(){return v.jsx(v.Fragment,{children:[0,1].map(e=>v.jsxs(Gi,{className:"gap-0 py-0",children:[v.jsxs("div",{className:"flex items-center gap-3 p-3",children:[v.jsx(fr,{className:"size-8 rounded-md"}),v.jsxs("div",{className:"min-w-0 flex-1",children:[v.jsx(fr,{className:"h-4 w-24"}),v.jsx(fr,{className:"mt-2 h-3 w-40"})]}),v.jsx(fr,{className:"h-4 w-7 rounded-full"})]}),v.jsx("div",{className:"border-t border-border/60 p-3",children:v.jsx(fr,{className:"h-20 w-full"})})]},e))})}class Ga extends Error{constructor(t,s){super(s),this.code=t,this.name="SkillApiError"}code}async function Ti(e,t){const s=await fetch(e,t);if(!s.ok){const i=await s.json();throw new Ga(i.error?.code??"SKILL_REQUEST_FAILED",i.error?.message??`Request failed with status ${s.status}`)}return s.status===204?void 0:s.json()}function lB(e){return Ti("/api/skills",{signal:e})}function cB(e,t){return Ti(`/api/skills/${encodeURIComponent(e)}`,{signal:t})}function uB(e){return Ti("/api/skills",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}function dB(e){return Ti("/api/skills/import/local",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}function fB(e){return Ti("/api/skills/import/url",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}function hB(e,t){return Ti(`/api/skills/${encodeURIComponent(e)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}function pB(e){return Ti(`/api/skills/${encodeURIComponent(e)}`,{method:"DELETE"})}function gM(e){return Ti("/api/skills/agents/assignments",{signal:e})}function mM(e,t,s){return Ti(`/api/skills/${encodeURIComponent(e)}/agents/${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({assigned:s})})}const Od=["skills"],Wl=e=>["skills",e],Iu=["skills","agents","assignments"];function gB(e,t){return Ti(`/api/skills/${encodeURIComponent(e)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({files:t})})}const yM=["skill-batch-assignment"],mB=["YYYY-MM-DD HH:mm:ss","YYYY-MM-DD","YYYY/MM/DD HH:mm:ss","DD/MM/YYYY HH:mm:ss","MM/DD/YYYY hh:mm:ss A","HH:mm:ss"],yB=["America/Los_Angeles","America/New_York","Asia/Shanghai","Asia/Taipei","Asia/Tokyo","UTC"],vB=1,bB="settings.changed",xB=64,SB=1024,wB=/^[\p{L}\p{N}]+(?:-[\p{L}\p{N}]+)*$/u;function vM(e){return e.trim().normalize("NFKC")}function EB(e){const t=vM(e);return[...t].length<=xB&&t===t.toLowerCase()&&wB.test(t)}function RB(e){return e.length>0&&e.length<=1024&&e.split("/").every(t=>t.length>0&&t.length<=255&&t!=="."&&t!==".."&&!/[\\<>:"|?*]/u.test(t)&&!new RegExp("\\p{Cc}","u").test(t)&&!/[. ]$/u.test(t)&&!/^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/iu.test(t))}function CB({className:e,...t}){return v.jsx("textarea",{"data-slot":"textarea",className:Fe("flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-input/20 px-2 py-2 text-sm transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...t})}function pv({skill:e,onClose:t,onSaved:s}){const{t:i}=pt(),o=Bo(),l=Nr(),u=b.useId(),d=b.useId(),f=e!==void 0,[g,m]=b.useState(e?.name??""),[h,x]=b.useState(e?.description??""),S=er({mutationFn:R=>e?hB(e.name,R):uB(R),onSuccess:R=>{const k=e?l.getQueryData(Wl(e.name)):void 0;e&&e.name!==R.name&&l.removeQueries({queryKey:Wl(e.name),exact:!0}),k?.files&&l.setQueryData(Wl(R.name),{...k,...R}),l.invalidateQueries({queryKey:Od}),Kt.success(i(f?"skills.updated":"skills.created")),t(),s?.(R),f||o(`/library/skills/${encodeURIComponent(R.name)}`)},onError:R=>{R instanceof Ga&&R.code==="SKILL_LINK_CONFLICT"?Kt.error(i("skills.linkConflict")):R instanceof Ga&&R.code==="SKILL_NAME_CONFLICT"?Kt.error(i("skills.nameConflict")):Kt.error(i(f?"skills.updateError":"skills.createError"))}}),w=S.isPending,C=EB(g)&&!!h.trim()&&!w;function E(){w||t()}return v.jsx(Ri,{open:!0,onOpenChange:R=>{R||E()},children:v.jsxs(Ci,{showCloseButton:!1,className:`
147
+ max-h-[calc(100vh-2rem)] overflow-y-auto
148
+ sm:max-w-120
149
+ `,children:[v.jsxs("form",{className:"flex flex-col gap-4","aria-busy":w,onSubmit:R=>{R.preventDefault(),C&&S.mutate({name:vM(g),description:h.trim()})},children:[v.jsxs(Js,{className:"pr-8",children:[v.jsx(Ws,{children:i(f?"skills.editTitle":"skills.createManually")}),v.jsx(xi,{children:i(f?"skills.editDescription":"skills.createManuallyDescription")})]}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Wi,{htmlFor:u,children:i("skills.name")}),v.jsx(Sd,{id:u,autoFocus:!0,required:!0,"aria-describedby":`${u}-hint`,placeholder:i("skills.namePlaceholder"),value:g,disabled:w,onChange:R=>{m(R.target.value)}}),v.jsx("p",{id:`${u}-hint`,className:"text-xs text-muted-foreground",children:i("skills.nameHint")})]}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Wi,{htmlFor:d,children:i("skills.description")}),v.jsx(CB,{id:d,required:!0,rows:3,maxLength:SB,placeholder:i("skills.descriptionPlaceholder"),value:h,disabled:w,onChange:R=>{x(R.target.value)}})]}),v.jsxs(bi,{children:[v.jsx(nt,{type:"button",variant:"ghost",disabled:w,onClick:E,children:i("common.cancel")}),v.jsxs(nt,{type:"submit",disabled:!C,children:[w?v.jsx(Vr,{className:"animate-spin"}):f?v.jsx(nb,{}):v.jsx(lc,{}),v.jsx("span",{children:i(w?f?"skills.updating":"skills.creating":f?"skills.saveChanges":"skills.create")})]})]})]}),v.jsxs(kd,{disabled:w,render:v.jsx(nt,{variant:"ghost",size:"icon",className:"absolute top-2 right-2"}),children:[v.jsx(ta,{}),v.jsx("span",{className:"sr-only",children:i("a11y.close")})]})]})})}class gv extends Error{constructor(t,s){super(s),this.code=t}code}async function TB(e){const t=await fetch("/api/file-picker",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const s=await t.json();throw new gv(s.error?.code??"FILE_PICKER_FAILED",s.error?.message??"Unable to open file picker")}return(await t.json()).path}function kB({isPending:e,onClose:t,onImport:s}){const{t:i}=pt(),o=b.useId(),[l,u]=b.useState("");let d=!1;try{const g=new URL(l.trim());d=["http:","https:"].includes(g.protocol)&&!g.username&&!g.password}catch{}function f(){e||t()}return v.jsx(Ri,{open:!0,onOpenChange:g=>{g||f()},children:v.jsxs(Ci,{showCloseButton:!1,className:`
150
+ max-h-[calc(100vh-2rem)] overflow-y-auto
151
+ sm:max-w-120
152
+ `,children:[v.jsxs("form",{className:"flex flex-col gap-4","aria-busy":e,onSubmit:g=>{g.preventDefault(),d&&!e&&s(l.trim())},children:[v.jsxs(Js,{className:"pr-8",children:[v.jsx(Ws,{children:i("skills.importUrl")}),v.jsx(xi,{children:i("skills.importUrlDescription")})]}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Wi,{htmlFor:o,children:i("skills.url")}),v.jsx(Sd,{id:o,autoFocus:!0,required:!0,type:"url",placeholder:i("skills.importUrlHint"),autoComplete:"off",spellCheck:!1,value:l,disabled:e,onChange:g=>u(g.target.value)})]}),v.jsxs(bi,{children:[v.jsx(nt,{type:"button",variant:"ghost",disabled:e,onClick:f,children:i("common.cancel")}),v.jsxs(nt,{type:"submit",disabled:!d||e,children:[e?v.jsx(Vr,{className:"animate-spin"}):v.jsx(Zp,{}),v.jsx("span",{children:i(e?"skills.importing":"skills.importSubmit")})]})]})]}),v.jsxs(kd,{disabled:e,render:v.jsx(nt,{variant:"ghost",size:"icon",className:"absolute top-2 right-2"}),children:[v.jsx(ta,{}),v.jsx("span",{className:"sr-only",children:i("a11y.close")})]})]})})}const OB=[{titleKey:"skills.createManually",descriptionKey:"skills.createManuallyDescription",icon:lc},{titleKey:"skills.importLocal",descriptionKey:"skills.importLocalDescription",icon:PT},{titleKey:"skills.importUrl",descriptionKey:"skills.importUrlDescription",icon:Zp}],zR={SKILL_IMPORT_INVALID_URL:"skills.importInvalidUrl",SKILL_IMPORT_UNSUPPORTED_URL_FILE:"skills.importUnsupportedUrlFile",SKILL_IMPORT_DOWNLOAD_FAILED:"skills.importDownloadFailed",SKILL_IMPORT_DOWNLOAD_TIMEOUT:"skills.importDownloadTimeout",SKILL_NAME_CONFLICT:"skills.importNameConflict",SKILL_IMPORT_TOO_LARGE:"skills.importTooLarge",SKILL_IMPORT_READ_FAILED:"skills.importReadError",SKILL_IMPORT_INVALID_SOURCE:"skills.importInvalidSource",SKILL_IMPORT_SYMLINK_SOURCE:"skills.importSymlinkSource",SKILL_IMPORT_MISSING_SKILL_MD:"skills.importMissingSkillMd",SKILL_IMPORT_INVALID_METADATA:"skills.importInvalidMetadata",SKILL_IMPORT_INVALID_PATH:"skills.importInvalidPath",SKILL_IMPORT_DUPLICATE_PATH:"skills.importDuplicatePath",SKILL_IMPORT_INVALID_ENCODING:"skills.importInvalidEncoding",SKILL_IMPORT_UNSUPPORTED_ENTRIES:"skills.importUnsupportedEntries",SKILL_IMPORT_TOO_MANY_ENTRIES:"skills.importTooManyEntries",SKILL_IMPORT_SKILL_MD_TOO_LARGE:"skills.importSkillMdTooLarge",SKILL_IMPORT_INVALID_ARCHIVE:"skills.importInvalidArchive",SKILL_IMPORT_NO_SKILLS:"skills.importNoSkills",INVALID_SKILL_INPUT:"skills.importInvalid"};function AB({onCreateManually:e}){const{t}=pt(),s=Nr(),i=Bo(),[o,l]=b.useState(!1),u=er({mutationFn:m=>"url"in m?fB(m):dB(m),onSuccess:m=>{l(!1),s.invalidateQueries({queryKey:Od});const h=t("skills.importSummary",{imported:m.imported.length,skipped:m.skipped.length});m.skipped.length>0?Kt.warning(h,{description:v.jsx("ul",{className:"max-h-40 overflow-y-auto",children:m.skipped.map(x=>v.jsxs("li",{className:"wrap-break-word",children:[x.source,":",t(x.code==="SKILL_NAME_CONFLICT"?"skills.importSkippedConflict":zR[x.code]??"skills.importSkippedInvalid")]},x.source))})}):Kt.success(h),m.imported.length===1&&m.skipped.length===0&&i(`/library/skills/${encodeURIComponent(m.imported[0].name)}`)},onError:m=>{const h=m instanceof Ga?zR[m.code]:void 0;Kt.error(t(h??"skills.importError"))}}),d=er({mutationFn:()=>TB({kind:"file-or-directory",title:t("skills.importLocal"),extensions:["skill","zip"]}),onSuccess:m=>{m!==null&&u.mutate({path:m})},onError:m=>{let h="filePicker.error";m instanceof gv&&m.code==="FILE_PICKER_UNAVAILABLE"?h="filePicker.unavailable":m instanceof gv&&m.code==="FILE_PICKER_BUSY"&&(h="filePicker.busy"),Kt.error(t(h))}}),f=d.isPending||u.isPending;let g="skills.new";return d.isPending?g="filePicker.selecting":u.isPending&&(g="skills.importing"),v.jsxs(v.Fragment,{children:[v.jsxs(Vo,{children:[v.jsxs(Ko,{render:v.jsx(nt,{type:"button",disabled:f}),children:[f?v.jsx(Vr,{className:"animate-spin"}):v.jsx(lc,{}),v.jsx("span",{children:t(g)}),v.jsx(Zv,{})]}),v.jsx(qo,{align:"end",className:"w-max max-w-[min(20rem,calc(100vw-2rem))]",children:OB.map(({titleKey:m,descriptionKey:h,icon:x})=>v.jsxs(fc,{className:"items-start gap-2 p-2",onClick:()=>{m==="skills.createManually"?e():m==="skills.importLocal"?d.mutate():l(!0)},children:[v.jsx(x,{"aria-hidden":"true",className:"mt-0.5 size-4"}),v.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5 whitespace-normal",children:[v.jsx("span",{className:"text-sm",children:t(m)}),v.jsx("span",{className:"text-xs text-muted-foreground",children:t(h)})]})]},m))})]}),o&&v.jsx(kB,{isPending:u.isPending,onClose:()=>l(!1),onImport:m=>u.mutate({url:m})})]})}function MB(e){if(!e)return null;for(const t of e.elements){const s=t.tagName;if(s==="BUTTON"||s==="INPUT"){const i=t;if(i.type==="submit")return i}}return null}const NB="data-checked",DB="data-unchecked";function bM(e){return{checked(t){return e.indeterminate?{}:t?{[NB]:""}:{[DB]:""}},...hc}}const jB=b.createContext(void 0);function IB(){return b.useContext(jB)}const xM=b.createContext(void 0);function PB(){const e=b.useContext(xM);if(e===void 0)throw new Error(gn(14));return e}const LB="data-parent",zB=b.forwardRef(function(t,s){const{checked:i,className:o,defaultChecked:l=!1,"aria-labelledby":u,disabled:d=!1,form:f,id:g,indeterminate:m=!1,inputRef:h,name:x,onCheckedChange:S,parent:w=!1,readOnly:C=!1,render:E,required:R=!1,uncheckedValue:k,value:O,nativeButton:A=!1,style:N,...j}=t,{clearErrors:D}=vd(),{disabled:M,name:_,setDirty:L,setFilled:q,setTouched:X,state:B,validationMode:H,validityData:U,validation:z}=sa(),Q=cA(),{labelId:$,registerControlId:K,getDescriptionProps:Y}=Yo(),ee=IB(),G=ee?.allValues===void 0?void 0:ee.parent,oe=G!==void 0,I=M||Q.disabled||ee?.disabled||d,V=_??x,W=O??V,re=ar(),Ee=ee?.registerControlId!==K,le=pc({id:g||void 0,enabled:Ee}),me=A?le:re;let ge={};oe&&(w?ge=G.getParentProps():W!==void 0&&(ge=G.getChildProps(W)));const{checked:ue=i,indeterminate:Te=m,onCheckedChange:ve,...Pe}=ge,Oe=ee?.value,Le=b.useRef(null),Ve=bd(I,Le),{getButtonProps:ke,buttonRef:Ue}=vs({disabled:I,native:A}),be=ee?.validation??z,[He,Ze]=Ji({controlled:W!==void 0&&Oe!==void 0&&!w?Oe.includes(W):ue,default:l,name:"Checkbox",state:"checked"}),ot=oe?!!ue:He,de=oe&&Te||m;xd(Le,re,He,void 0,!ee&&!I,x);const we=G?.registerChildId,Ge=b.useRef(null),Me=be.registerInput,De=ee?W:void 0,bt=b.useCallback(We=>Me(We,{controlRef:Le,value:De}),[Me,De]),dt=es(h,Ge,w?void 0:bt),gt=Ub(u,$,Ge,!A,le,j["aria-label"]);_e(()=>{Ge.current&&(Ge.current.indeterminate=de),ee||q(He)},[He,de,ee,q]),cc(He,()=>{ee||(D(V),L(He!==U.initialValue),be.change(He))});const Nt=Ar({checked:He,disabled:I,form:f,name:w?void 0:V,id:A?void 0:le,required:R,ref:dt,style:V?Tp:rd,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(We){if(We.nativeEvent.defaultPrevented)return;if(C){We.preventDefault();return}const wt=We.currentTarget.checked,Zt=ut(Mr,We.nativeEvent);if(S?.(wt,Zt),!Zt.isCanceled&&(ve?.(wt,Zt),!Zt.isCanceled&&(Ze(wt),W!==void 0&&ee!==void 0&&!w&&!oe))){const ht=wt?[...ee.value,W]:ee.value.filter(xt=>xt!==W);ee.setValue(ht,Zt)}},onClick(We){We.stopPropagation()},onFocus(){Le.current?.focus()}},O!==void 0?{value:(ee?He&&O:O)||""}:Xt,Y,We=>be.getValidationProps(I,We));b.useEffect(()=>{if(!G||W===void 0)return;const We=G.disabledStatesRef.current;return We.set(W,I),()=>{We.delete(W)}},[G,I,W]);const jt=b.useMemo(()=>({...B,checked:ot,disabled:I,readOnly:C,required:R,indeterminate:de}),[B,ot,I,C,R,de]),tn=bM(jt),an=kt("span",t,{state:jt,ref:[Ue,Le,s],props:[{id:me,role:"checkbox","aria-checked":de?"mixed":ot,"aria-readonly":C||void 0,"aria-required":R||void 0,"aria-labelledby":gt,[LB]:w?"":void 0,onFocus(){Ve(!0)},onBlur(){const We=Ge.current;We&&(X(!0),Ve(!1),H==="onBlur"&&be.commit(ee?Oe:We.checked))},onKeyDown(We){if(We.key!=="Enter"||(We.preventBaseUIHandler(),We.defaultPrevented))return;const wt=Ge.current?.form??null,Zt=We.currentTarget,ht=We.nativeEvent,xt=We.preventDefault,yt=ht.preventDefault;let Ut=!1;We.preventDefault=()=>{Ut=!0,xt.call(We)},ht.preventDefault=()=>{Ut=!0,yt.call(ht)},yt.call(ht),Rn(Zt).queueMicrotask(()=>{We.preventDefault=xt,ht.preventDefault=yt,Ut||MB(wt)?.click()})},onClick(We){if(C||I)return;We.preventDefault();const wt=Ge.current;wt&&Do(wt,We)}},j,Pe,ke,Y,We=>be.getValidationProps(I,We)],stateAttributesMapping:tn}),nn=an.props.id;return _e(()=>{if(!(!we||w||W===void 0||nn===void 0))return we(W,nn)},[we,w,W,nn]),v.jsxs(xM.Provider,{value:jt,children:[an,!He&&!ee&&V&&!w&&k!==void 0&&v.jsx("input",{type:"hidden",form:f,name:V,value:k,disabled:I}),v.jsx("input",{...Nt,suppressHydrationWarning:!0})]})}),_B=b.forwardRef(function(t,s){const{render:i,className:o,style:l,keepMounted:u=!1,...d}=t,f=PB(),g=f.checked||f.indeterminate,{mounted:m,transitionStatus:h,setMounted:x}=_o(g),S=b.useRef(null),w={...f,transitionStatus:h};Ls({batch:!0,enabled:!g,open:g,ref:S,onComplete(){g||x(!1)}});const E={...bM(f),...wi},R=u||m,k=kt("span",t,{ref:[s,S],state:w,stateAttributesMapping:E,props:d});return R?k:null});function SM({className:e,...t}){return v.jsx(zB,{"data-slot":"checkbox",className:Fe("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary",e),...t,children:v.jsx(_B,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:v.jsx(ld,{})})})}const wM=b.createContext(void 0);function UB(){return b.useContext(wM)}const HB=b.forwardRef(function(t,s){const{className:i,defaultPressed:o=!1,disabled:l=!1,form:u,onPressedChange:d,pressed:f,render:g,type:m,value:h,nativeButton:x=!0,style:S,...w}=t,C=ar(h||void 0),E=UB(),R=E?.value??[],k=(l||E?.disabled)??!1,[O,A]=Ji({controlled:E?C!==void 0&&R.indexOf(C)>-1:f,default:o,name:"Toggle",state:"pressed"}),{getButtonProps:N,buttonRef:j}=vs({disabled:k,native:x}),D={disabled:k,pressed:O},M=[j,s],_=[{"aria-pressed":O,onClick(X){const B=!O,H=ut(Mr,X.nativeEvent);d?.(B,H),!H.isCanceled&&(C&&E?.setGroupValue?.(C,B,H),!H.isCanceled&&A(B))}},w,N],L=kt("button",t,{enabled:!E,state:D,ref:M,props:_}),q=b.useMemo(()=>({disabled:k,focusableWhenDisabled:!1}),[k]);return E?v.jsx(Lb,{tag:"button",render:g,className:i,style:S,metadata:q,state:D,refs:M,props:_}):L}),Wb="data-composite-item-active";function FB(e){const{loopFocus:t=!0,orientation:s="both",grid:i,onLoop:o,direction:l,highlightedIndex:u,onHighlightedIndexChange:d,rootRef:f,enableHomeAndEndKeys:g=!1,stopEventPropagation:m,disabledIndices:h,modifierKeys:x=$s}=e,[S,w]=b.useState(0),C=i!=null,E=b.useRef(null),R=es(E,f),k=b.useRef([]),O=b.useRef(!1),A=b.useRef(null),N=u??S,j=Be((q,X=!1)=>{if(A.current=k.current[q]??null,(d??w)(q),X){const B=k.current[q];ME(E.current,B,l,s)}}),D=Be(q=>{if(q.size===0)return;if(O.current){const U=k.current,z=U.indexOf(A.current);if(z===-1){const Q=U[N];!Q||Kl(U,N,h)?j(BB(U,h)):A.current=Q}else z!==N&&j(z);return}O.current=!0;const X=Array.from(q.keys()),B=X.find(U=>U?.hasAttribute(Wb))??null,H=B?q.get(B)?.index??-1:-1;if(H!==-1)j(H);else if(Kl(X,N,h)){const U=Vl(X,{disabledIndices:h});Bl(X,U)||j(U)}ME(E.current,B,l,s)});_e(()=>{if(h==null||u!=null||!O.current)return;const q=k.current;if(Kl(q,N,h)){const X=Vl(q,{disabledIndices:h});Bl(q,X)||j(X)}},[h,u,N,k,j]);const M=Be((q,X,B)=>o?o(q,X,B,k):B),_=Be(q=>{const X=q.key===Zy||q.key===Jy;if(!ud.has(q.key)||!g&&X||VB(q,x)||!E.current)return;const H=l==="rtl",U=H?Qy:Xy,z=H?Xy:Qy,Q=s==="vertical"?$y:U,$=s==="vertical"?Gy:z,K=nr(q.nativeEvent);if(K!=null&&AE(K)&&!rA(K)){const V=K.selectionStart,W=K.selectionEnd,re=K.value;if(V==null||q.shiftKey||V!==W||q.key!==$&&V<re.length||q.key!==Q&&V>0)return}let Y=N;const ee=wh(k,h),G=Ly(k,h);i!=null&&(Y=i({disabledIndices:h,elementsRef:k,event:q,highlightedIndex:N,loopFocus:t,maxIndex:G,minIndex:ee,onLoop:M,orientation:s,rtl:H}));const oe=s!=="vertical"&&q.key===U||s!=="horizontal"&&q.key===$y,I=s!=="vertical"&&q.key===z||s!=="horizontal"&&q.key===Gy;g&&(q.key===Zy?Y=ee:q.key===Jy&&(Y=G)),Y===N&&(oe||I)&&(t&&Y===G&&oe?(Y=ee,o&&(Y=o(q,N,Y,k))):t&&Y===ee&&I?(Y=G,o&&(Y=o(q,N,Y,k))):Y=Vl(k.current,{startingIndex:Y,decrement:I,disabledIndices:h})),Y!==N&&!Bl(k.current,Y)&&(m&&q.stopPropagation(),(C||X||oe||I)&&q.preventDefault(),j(Y,!0),queueMicrotask(()=>{k.current[Y]?.focus()}))});return{props:{ref:R,onFocus(q){const X=E.current,B=nr(q.nativeEvent);!X||B==null||!AE(B)||B.setSelectionRange(0,B.value.length)},onKeyDown:_},highlightedIndex:N,onHighlightedIndexChange:j,elementsRef:k,onMapChange:D,relayKeyboardEvent:_}}function BB(e,t){let s=-1;for(let i=0;i<e.length;i+=1){const o=e[i];if(!(!o||Kl(e,i,t))){if(o.hasAttribute(Wb))return i;s===-1&&(s=i)}}return Math.max(s,0)}function VB(e,t){for(const s of oz)if(!t.includes(s)&&e.getModifierState(s))return!0;return!1}function EM(e){const{render:t,className:s,style:i,refs:o=$s,props:l=$s,state:u=Xt,stateAttributesMapping:d,highlightedIndex:f,onHighlightedIndexChange:g,orientation:m,grid:h,loopFocus:x,onLoop:S,enableHomeAndEndKeys:w,onMapChange:C,stopEventPropagation:E=!0,rootRef:R,disabledIndices:k,modifierKeys:O,highlightItemOnHover:A=!1,tag:N="div",...j}=e,D=Yp(),{props:M,highlightedIndex:_,onHighlightedIndexChange:L,elementsRef:q,onMapChange:X,relayKeyboardEvent:B}=FB({grid:h,loopFocus:x,onLoop:S,orientation:m,highlightedIndex:f,onHighlightedIndexChange:g,rootRef:R,stopEventPropagation:E,enableHomeAndEndKeys:w,direction:D,disabledIndices:k,modifierKeys:O}),H=kt(N,e,{state:u,ref:o,props:[M,...l,j],stateAttributesMapping:d}),U=b.useMemo(()=>({highlightedIndex:_,onHighlightedIndexChange:L,highlightItemOnHover:A,relayKeyboardEvent:B}),[_,L,A,B]);return v.jsx(Ck.Provider,{value:U,children:v.jsx(Pb,{elementsRef:q,onMapChange:z=>{C?.(z),X(z)},children:H})})}const KB=b.createContext(void 0);function qB(){return b.useContext(KB)}const YB=b.forwardRef(function(t,s){const{defaultValue:i,disabled:o=!1,loopFocus:l=!0,onValueChange:u,orientation:d="horizontal",multiple:f=!1,value:g,className:m,render:h,style:x,...S}=t,w=ng(),C=qB(),E=i??$s,R=g!==void 0||i!==void 0,k=(w?.disabled??!1)||(C?.disabled??!1)||o,[O,A]=Ji({controlled:g,default:E,name:"ToggleGroup",state:"value"}),N=Be((L,q,X)=>{let B;f?(B=O.slice(),q?B.push(L):B.splice(O.indexOf(L),1)):B=q?[L]:[],u?.(B,X),!X.isCanceled&&A(B)}),j={disabled:k,multiple:f,orientation:d},D=b.useMemo(()=>({disabled:k,setGroupValue:N,value:O,isValueInitialized:R}),[k,N,O,R]),M={role:"group"},_=kt("div",t,{enabled:!!w,state:j,ref:s,props:[M,S]});return v.jsx(wM.Provider,{value:D,children:w?_:v.jsx(EM,{render:h,className:m,style:x,state:j,refs:[s],props:[M,S],loopFocus:l,enableHomeAndEndKeys:!0,orientation:d})})}),GB=Uo("group/toggle inline-flex items-center justify-center gap-1 rounded-md text-xs font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-muted"},size:{default:"h-7 min-w-7 px-2 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",sm:"h-6 min-w-6 rounded-[min(var(--radius-md),8px)] px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",lg:"h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2"}},defaultVariants:{variant:"default",size:"default"}}),RM=b.createContext({size:"default",variant:"default",spacing:2,orientation:"horizontal"});function $B({className:e,variant:t,size:s,spacing:i=2,orientation:o="horizontal",children:l,...u}){return v.jsx(YB,{"data-slot":"toggle-group","data-variant":t,"data-size":s,"data-spacing":i,"data-orientation":o,style:{"--gap":i},className:Fe("group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-md data-[size=sm]:rounded-[min(var(--radius-md),8px)] data-vertical:flex-col data-vertical:items-stretch",e),...u,children:v.jsx(RM.Provider,{value:{variant:t,size:s,spacing:i,orientation:o},children:l})})}function QB({className:e,children:t,variant:s="default",size:i="default",...o}){const l=b.useContext(RM);return v.jsx(HB,{"data-slot":"toggle-group-item","data-variant":l.variant||s,"data-size":l.size||i,"data-spacing":l.spacing,className:Fe("shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-md group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-md group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-md group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-md group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",GB({variant:l.variant||s,size:l.size||i}),e),...o,children:t})}function CM({agents:e,value:t,onValueChange:s,label:i,disabled:o=!1,shouldShowNames:l=!1}){return v.jsx($B,{multiple:!0,value:t,onValueChange:s,disabled:o,"aria-label":i,className:"max-w-full flex-wrap",children:e.map(u=>v.jsxs(QB,{value:u.id,"aria-label":u.name,title:u.name,className:Fe("disabled:opacity-100",!l&&"size-7 p-0"),children:[v.jsx(aM,{icon:u.icon,monochrome:!t.includes(u.id),className:"size-4 rounded-none bg-transparent"}),l&&v.jsx("span",{children:u.name})]},u.id))})}function TM({name:e}){const{t}=pt(),s=Nr(),i=na({queryKey:Iu,queryFn:({signal:f})=>gM(f)}),o=["skill-assignment",e],l=rg({mutationKey:o})>0,u=er({mutationKey:o,mutationFn:({id:f,assigned:g})=>mM(e,f,g),onSuccess:f=>{s.setQueryData(Iu,g=>g&&{...g,skills:g.skills.map(m=>m.name===f.name?f:m)})},onError:f=>{Kt.error(t(f instanceof Ga&&f.code==="SKILL_LINK_CONFLICT"?"skills.linkConflict":"skills.assignmentError"))},onSettled:()=>s.invalidateQueries({queryKey:Iu})});if(i.isPending)return v.jsx(fr,{className:"h-7 w-16"});if(i.isError)return v.jsx(nt,{variant:"ghost",onClick:()=>{i.refetch()},children:t("common.retry")});if(i.data.agents.length===0)return v.jsx("span",{className:"text-xs text-muted-foreground",children:t("skills.noAgents")});const d=i.data.skills.find(f=>f.name===e)?.agentIds??[];return v.jsx("div",{"aria-busy":l,children:v.jsx(CM,{agents:i.data.agents,value:d,disabled:l,label:t("skills.assignTitle",{name:e}),onValueChange:f=>{const g=i.data.agents.find(m=>f.includes(m.id)!==d.includes(m.id))?.id;g&&!l&&u.mutate({id:g,assigned:f.includes(g)})}})})}function XB({skill:e,isSelected:t,selectionDisabled:s,onSelectedChange:i,onEdit:o,onDelete:l,onAssign:u}){const{t:d}=pt();return v.jsxs(Eg,{children:[v.jsxs(Rg,{render:v.jsx("div",{role:"listitem","data-selected":t||void 0,className:`
153
+ group flex h-9 items-center rounded-md px-2 transition-colors
154
+ hover:bg-muted/50
155
+ has-aria-expanded:bg-muted/50
156
+ data-selected:bg-muted/50
157
+ `}),children:[v.jsx("div",{className:"flex w-8 shrink-0 items-center",children:v.jsx(SM,{checked:t,disabled:s,onCheckedChange:i,"aria-label":d("skills.selectAria",{name:e.name}),className:`
158
+ opacity-0
159
+ group-focus-within:opacity-100
160
+ group-hover:opacity-100
161
+ focus-visible:opacity-100
162
+ data-checked:opacity-100
163
+ [@media(hover:none)]:opacity-100
164
+ `})}),v.jsxs(yd,{to:`/library/skills/${encodeURIComponent(e.name)}`,className:`
165
+ flex min-w-0 flex-1 items-center gap-2 rounded-sm text-sm
166
+ focus-visible:outline-2 focus-visible:outline-ring
167
+ `,children:[v.jsx("span",{className:"min-w-0 truncate font-medium",children:e.name}),v.jsx("span",{className:"min-w-0 flex-1 basis-0 truncate text-muted-foreground",children:e.description})]}),!t&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:`
168
+ ml-2 hidden shrink-0
169
+ md:block
170
+ `,children:v.jsx(TM,{name:e.name})}),v.jsx("div",{className:`
171
+ flex w-9 shrink-0 justify-end overflow-hidden
172
+ md:w-0
173
+ md:group-focus-within:w-9
174
+ md:group-hover:w-9
175
+ md:group-has-aria-expanded:w-9
176
+ [@media(hover:none)]:w-9
177
+ `,children:v.jsxs(Vo,{children:[v.jsx(Ko,{render:v.jsx(nt,{type:"button",variant:"ghost",size:"icon","aria-label":d("skills.actionsAria",{name:e.name}),className:"shrink-0 text-muted-foreground"}),children:v.jsx(Wv,{})}),v.jsx(qo,{align:"end",className:"w-40",children:v.jsx(_R,{Item:fc,onEdit:o,onDelete:l,onAssign:u})})]})})]})]}),!t&&v.jsx(Cg,{children:v.jsx(_R,{Item:Tg,onEdit:o,onDelete:l,onAssign:u})})]})}function _R({Item:e,onEdit:t,onDelete:s,onAssign:i}){const{t:o}=pt();return v.jsxs(v.Fragment,{children:[v.jsxs(e,{onClick:i,children:[v.jsx(dk,{}),v.jsx("span",{children:o("skills.assign")})]}),v.jsxs(e,{onClick:t,children:[v.jsx(JT,{}),v.jsx("span",{children:o("skills.edit")})]}),v.jsxs(e,{variant:"destructive",onClick:s,children:[v.jsx(rb,{}),v.jsx("span",{children:o("skills.delete")})]})]})}function ZB({skill:e,onClose:t}){const{t:s}=pt(),i=Nr(),o=er({mutationFn:()=>pB(e.name),onSuccess:()=>{i.removeQueries({queryKey:Wl(e.name),exact:!0}),i.invalidateQueries({queryKey:Od}),Kt.success(s("skills.deleted")),t()},onError:()=>Kt.error(s("skills.deleteError"))}),l=()=>{o.isPending||t()};return v.jsx(Ri,{open:!0,onOpenChange:u=>{u||l()},children:v.jsxs(Ci,{showCloseButton:!1,children:[v.jsxs(Js,{children:[v.jsx(Ws,{children:s("skills.deleteConfirmTitle")}),v.jsx(xi,{children:v.jsx(Wp,{i18nKey:"skills.deleteConfirmDescription",values:{name:e.name},components:{skillName:v.jsx("code",{className:`
178
+ rounded-sm bg-muted px-1 py-0.5 font-mono wrap-anywhere
179
+ `})}})})]}),v.jsxs(bi,{children:[v.jsx(nt,{type:"button",variant:"ghost",disabled:o.isPending,onClick:l,children:s("common.cancel")}),v.jsxs(nt,{type:"button",variant:"destructive",disabled:o.isPending,onClick:()=>o.mutate(),children:[o.isPending&&v.jsx(Vr,{className:"animate-spin"}),v.jsx("span",{children:s("skills.delete")})]})]})]})})}function JB({skill:e,onClose:t}){const{t:s}=pt();return v.jsx(Ri,{open:!0,onOpenChange:i=>{i||t()},children:v.jsxs(Ci,{children:[v.jsxs(Js,{children:[v.jsx(Ws,{className:"pr-6 leading-relaxed",children:v.jsx(Wp,{i18nKey:"skills.assignDialogTitle",values:{name:e.name},components:{skillName:v.jsx("code",{className:`
180
+ rounded-sm bg-muted px-1 py-0.5 font-mono text-sm
181
+ wrap-anywhere
182
+ `})}})}),v.jsx(xi,{children:s("skills.assignDescription")})]}),v.jsx(TM,{name:e.name})]})})}function WB(e,t,s,i){return s.flatMap(o=>t.filter(l=>(e.find(u=>u.name===l)?.agentIds.includes(o)??!1)!==i).map(l=>({name:l,agentId:o,isAssigned:i})))}function eV({names:e,onAssigned:t}){const{t:s}=pt(),i=Nr(),[o,l]=b.useState(!1),[u,d]=b.useState([]),f=rg({mutationKey:["skill-assignment"]})>0,g=na({queryKey:Iu,queryFn:({signal:S})=>gM(S),enabled:o}),m=er({mutationKey:yM,mutationFn:async S=>{let w=0;const C=[];for(const{name:E,agentId:R,isAssigned:k}of S)try{await mM(E,R,k),w+=1}catch(O){C.push(O)}return{completed:w,errors:C}},onSuccess:async({completed:S,errors:w})=>{if(await i.invalidateQueries({queryKey:Iu}),w.length>0){Kt.error(s("skills.batchAssignPartial",{completed:S,failed:w.length}),{description:s(w.some(C=>C instanceof Ga&&C.code==="SKILL_LINK_CONFLICT")?"skills.linkConflict":"skills.assignmentError")});return}Kt.success(s("skills.batchAssigned")),l(!1),t()}}),h=!g.isSuccess||u.length===0||m.isPending||f;function x(S){h||m.mutate(WB(g.data.skills,e,u,S))}return v.jsxs(ub,{open:o,onOpenChange:S=>{m.isPending||(l(S),S||d([]))},children:[v.jsxs(Pk,{render:v.jsx(nt,{variant:"outline",disabled:f||m.isPending}),children:[v.jsx(dk,{}),v.jsx("span",{children:s("skills.batch")}),v.jsx("span",{className:"text-muted-foreground tabular-nums",children:e.length})]}),v.jsx(db,{align:"end","aria-label":s("skills.batch"),children:v.jsxs("div",{className:"flex flex-col gap-4","aria-busy":m.isPending,children:[v.jsxs("div",{className:"flex flex-col gap-2",children:[g.isPending&&v.jsx(fr,{className:"h-16 w-full"}),g.isError&&v.jsxs("div",{role:"alert",className:"space-y-2",children:[v.jsx("p",{className:"text-xs text-muted-foreground",children:s("skills.assignmentError")}),v.jsx(nt,{type:"button",variant:"outline",disabled:g.isFetching,onClick:()=>{g.refetch()},children:s("common.retry")})]}),g.isSuccess&&g.data.agents.length===0&&v.jsx("p",{className:"text-xs text-muted-foreground",children:s("skills.noAgents")}),g.isSuccess&&v.jsx(CM,{agents:g.data.agents,value:u,onValueChange:d,label:s("skills.batch"),disabled:m.isPending,shouldShowNames:!0})]}),v.jsxs("div",{className:"flex justify-end gap-2",children:[v.jsxs(nt,{type:"button",variant:"outline",disabled:h,onClick:()=>x(!1),children:[m.isPending&&!m.variables[0]?.isAssigned&&v.jsx(Vr,{className:"animate-spin"}),v.jsx("span",{children:s("skills.unassign")})]}),v.jsxs(nt,{type:"button",disabled:h,onClick:()=>x(!0),children:[m.isPending&&m.variables[0]?.isAssigned&&v.jsx(Vr,{className:"animate-spin"}),v.jsx("span",{children:s("skills.assign")})]})]})]})})]})}function tV(){const{t:e}=pt(),[t,s]=b.useState(!1),[i,o]=b.useState(null),[l,u]=b.useState(null),[d,f]=b.useState(null),[g,m]=b.useState([]),h=rg({mutationKey:yM})>0,x=na({queryKey:Od,queryFn:({signal:E})=>lB(E)}),S=x.isSuccess?x.data.filter(E=>g.includes(E.name)):[],w=x.isSuccess&&x.data.length>0&&S.length===x.data.length,C=e(w?"skills.deselectAll":"skills.selectAll");return v.jsxs(v.Fragment,{children:[v.jsxs(CA,{children:[v.jsxs(nt,{type:"button",variant:"outline",className:"max-sm:size-7 max-sm:p-0",title:C,"aria-pressed":w,disabled:h||!x.isSuccess||x.data.length===0,onClick:()=>{x.isSuccess&&m(w?[]:x.data.map(E=>E.name))},children:[v.jsx(wL,{}),v.jsx("span",{className:`
183
+ sr-only
184
+ sm:not-sr-only
185
+ `,children:C})]}),S.length>0&&v.jsx(eV,{names:S.map(E=>E.name),onAssigned:()=>m([])}),v.jsx(AB,{onCreateManually:()=>{s(!0)}})]}),v.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto p-4",children:[x.isPending&&v.jsx(fr,{className:"h-16 w-full"}),x.isError&&v.jsxs("div",{role:"alert",className:"flex flex-1 flex-col items-center justify-center",children:[v.jsx(Gu,{icon:By,title:e("skills.loadError"),className:"flex-none"}),v.jsx(nt,{variant:"outline",onClick:()=>{x.refetch()},children:e("common.retry")})]}),x.isSuccess&&x.data.length===0&&v.jsx(Gu,{icon:By,title:e("skills.emptyTitle"),description:e("skills.emptyDescription")}),x.isSuccess&&x.data.length>0&&v.jsx("div",{role:"list",children:x.data.map(E=>v.jsx(XB,{skill:E,isSelected:g.includes(E.name),selectionDisabled:h,onSelectedChange:R=>{m(k=>R?[...k,E.name]:k.filter(O=>O!==E.name))},onEdit:()=>o(E),onDelete:()=>u(E),onAssign:()=>f(E)},E.name))})]}),t&&v.jsx(pv,{onClose:()=>{s(!1)}}),i&&v.jsx(pv,{skill:i,onClose:()=>o(null)}),l&&v.jsx(ZB,{skill:l,onClose:()=>u(null)}),d&&v.jsx(JB,{skill:d,onClose:()=>f(null)})]})}function up(e,t){for(const s of e){if(s.path===t)return s;if(!s.children)continue;const i=up(s.children,t);if(i)return i}}function dp(e,t,s){return e.flatMap(i=>{if(i.path===t){const o=s(i);return o?[o]:[]}return i.children?[{...i,children:dp(i.children,t,s)}]:[i]})}function nV(e,t,s){return t?dp(e,t,i=>i.children?{...i,children:[...i.children,s]}:i):[...e,s]}function rV({files:e,parent:t,kind:s,onCreate:i,onCancel:o}){const{t:l}=pt(),[u,d]=b.useState(""),[f,g]=b.useState(!1),m=b.useRef(null),h=b.useRef(!1),x=b.useId(),S=u.trim(),w=t?`${t}/${S}`:S,C=RB(S)&&!S.includes("/"),E=S!==""&&up(e,w)!==void 0,R=E?l("skills.fileConflict"):f&&!C?l("skills.invalidEntryName"):null;b.useEffect(()=>{const O=requestAnimationFrame(()=>m.current?.focus());return()=>cancelAnimationFrame(O)},[]);const k=()=>{h.current||(g(!0),!(!C||E)&&(h.current=!0,i(s==="directory"?{path:w,children:[]}:{path:w,content:""})))};return v.jsxs("form",{onSubmit:O=>{O.preventDefault(),k()},onKeyDown:O=>{O.key==="Escape"&&(O.preventDefault(),O.stopPropagation(),h.current=!0,o())},children:[v.jsxs("div",{className:`
186
+ flex h-7 min-w-0 items-center gap-1.5 border-x border-transparent pl-2
187
+ `,children:[v.jsx("span",{className:"size-3 shrink-0"}),s==="directory"?v.jsx(_T,{className:"size-3.5 shrink-0"}):v.jsx(eb,{className:"size-3.5 shrink-0"}),v.jsx(Sd,{ref:m,required:!0,"aria-label":l(s==="directory"?"skills.newFolder":"skills.newFile"),"aria-invalid":!!R,"aria-describedby":R?x:void 0,maxLength:255,value:u,className:"min-w-0 flex-1",onKeyDown:O=>{O.key==="Enter"&&O.nativeEvent.isComposing&&O.preventDefault()},onChange:O=>d(O.target.value),onBlur:()=>{S===""&&!h.current?(h.current=!0,o()):k()}})]}),R&&v.jsx("p",{id:x,role:"alert",className:"mt-1 px-2 text-xs text-destructive",children:R})]})}function sV({entry:e,anchor:t,isOpen:s,onOpenChange:i,onConfirm:o}){const{t:l}=pt(),u=b.useId(),d=b.useId();return v.jsx(ub,{open:s,onOpenChange:i,children:v.jsx(db,{anchor:t,align:"start","aria-labelledby":u,"aria-describedby":d,finalFocus:()=>t.current?.querySelector("button")??!1,className:"max-w-[calc(100vw-1.5rem)]",children:v.jsxs("div",{className:"flex flex-col gap-3",children:[v.jsx("h2",{id:u,className:"text-sm font-medium",children:l("skills.delete")}),v.jsx("p",{id:d,className:"text-xs wrap-anywhere text-muted-foreground",children:v.jsx(Wp,{i18nKey:"skills.deleteEntryDescription",values:{path:e.path},components:{entryPath:v.jsx("code",{className:`
188
+ rounded-sm bg-muted px-1 py-0.5 font-mono wrap-anywhere
189
+ `})}})}),v.jsxs("div",{className:"flex justify-end gap-2",children:[v.jsx(nt,{variant:"ghost",onClick:()=>i(!1),children:l("common.cancel")}),v.jsx(nt,{variant:"destructive",onClick:o,children:l("skills.delete")})]})]})})})}function fp({entry:e,Item:t,onAction:s}){const{t:i}=pt(),o=e?.path??"";return v.jsxs(v.Fragment,{children:[(!e||e.children)&&v.jsxs(v.Fragment,{children:[v.jsxs(t,{onClick:()=>s({type:"create",parent:o,kind:"file"}),children:[v.jsx(gL,{}),i("skills.newFile")]}),v.jsxs(t,{onClick:()=>s({type:"create",parent:o,kind:"directory"}),children:[v.jsx(yL,{}),i("skills.newFolder")]})]}),e&&e.path!=="SKILL.md"&&v.jsxs(t,{variant:"destructive",onClick:()=>s({type:"delete",entry:e}),children:[v.jsx(rb,{}),i("skills.delete")]})]})}function iV({entry:e,onAction:t,children:s,isActive:i=!1}){const{t:o}=pt(),l=b.useRef(null),[u,d]=b.useState(!1),f=m=>{m.type==="delete"?d(!0):t(m)},g=Fe(Tk({variant:"ghost"}),`
190
+ group/file relative flex w-full min-w-0 justify-start p-0
191
+ data-active:bg-muted data-active:text-foreground
192
+ `);return e?.path==="SKILL.md"?v.jsx("div",{className:g,"data-active":i||void 0,children:s}):v.jsxs(v.Fragment,{children:[v.jsxs(Eg,{children:[v.jsxs(Rg,{render:v.jsx("div",{ref:l,className:g,"data-active":i||void 0}),children:[s,v.jsxs(Vo,{children:[v.jsx(Ko,{render:v.jsx(nt,{variant:"link",size:"icon","aria-label":o("skills.fileActions",{path:e?.path??o("skills.files")}),className:`
193
+ absolute right-0 shrink-0 text-inherit
194
+ data-popup-open:opacity-100
195
+ md:opacity-0
196
+ md:group-focus-within/file:opacity-100
197
+ md:group-hover/file:opacity-100
198
+ [@media(hover:none)]:opacity-100
199
+ `}),children:v.jsx(Wv,{})}),v.jsx(qo,{align:"end",children:v.jsx(fp,{Item:fc,entry:e,onAction:f})})]})]}),v.jsx(Cg,{children:v.jsx(fp,{Item:Tg,entry:e,onAction:f})})]}),e&&v.jsx(sV,{entry:e,anchor:l,isOpen:u,onOpenChange:d,onConfirm:()=>{d(!1),t({type:"delete",entry:e})}})]})}const ex=b.createContext({creation:null,render:()=>null});ex.displayName="InlineEntryContext";function aV({files:e,selectedPath:t,onSelect:s,onOverview:i,onAction:o,onCreate:l,overviewDisabled:u=!1}){const{t:d}=pt(),[f,g]=b.useState(!1),[m,h]=b.useState(null),x=bb(),S=R=>{u||(R.type==="create"?h(R):(h(null),o(R)))},w=v.jsxs(nt,{variant:"ghost",className:`
200
+ shrink-0 justify-start
201
+ md:gap-1.5 md:pl-6.5
202
+ `,"aria-haspopup":"dialog",disabled:u,onClick:()=>{g(!1),i()},children:[v.jsx(ak,{}),v.jsx("span",{children:d("skills.overview")})]}),C=()=>m&&v.jsx(rV,{files:e,parent:m.parent,kind:m.kind,onCancel:()=>h(null),onCreate:R=>{l(R,m.parent),h(null),R.children||g(!1)}},`${m.parent}/${m.kind}`),E=v.jsxs(v.Fragment,{children:[v.jsx(ex,{value:{creation:m,render:C},children:v.jsx(kM,{parent:"",entries:e,selectedPath:t,onSelect:R=>{g(!1),s(R)},onAction:S})}),v.jsxs(Eg,{children:[v.jsx(Rg,{render:v.jsx("div",{className:"min-h-16 flex-1"})}),v.jsx(Cg,{children:v.jsx(fp,{Item:Tg,onAction:S})})]})]});return v.jsxs(v.Fragment,{children:[v.jsxs("nav",{"aria-label":d("skills.fileNavigation"),className:`
203
+ hidden w-56 shrink-0 flex-col gap-2 overflow-y-auto border-r p-3
204
+ md:flex
205
+ `,children:[w,!x&&E]}),v.jsxs("div",{className:`
206
+ flex shrink-0 items-center gap-2 border-b p-2
207
+ md:hidden
208
+ `,children:[w,v.jsxs(bA,{open:f,onOpenChange:R=>{g(R),R||h(null)},children:[v.jsxs(PH,{render:v.jsx(nt,{variant:"outline"}),children:[v.jsx(mL,{}),v.jsx("span",{children:d("skills.files")})]}),v.jsxs(xA,{side:"left","aria-describedby":void 0,children:[v.jsx(SA,{className:"sr-only",children:d("skills.fileNavigation")}),v.jsxs("nav",{"aria-label":d("skills.fileNavigation"),className:`
209
+ flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-3 pt-14
210
+ pb-3
211
+ `,children:[v.jsxs(Vo,{children:[v.jsxs(Ko,{render:v.jsx(nt,{variant:"outline",className:"w-full shrink-0 justify-start"}),children:[v.jsx(lc,{}),v.jsx("span",{children:d("skills.newEntry")})]}),v.jsx(qo,{align:"start",children:v.jsx(fp,{Item:fc,onAction:S})})]}),E]})]})]})]})]})}function kM({entries:e,parent:t,selectedPath:s,onSelect:i,onAction:o}){const l=b.use(ex),u=e.toSorted((d,f)=>!!d.children==!!f.children?d.path.localeCompare(f.path):d.children?-1:1);return v.jsxs("ul",{className:"min-w-0 shrink-0",children:[l.creation?.parent===t&&v.jsx("li",{children:l.render()}),u.map(d=>v.jsx(oV,{entry:d,selectedPath:s,onSelect:i,onAction:o},d.path))]})}function oV({entry:e,selectedPath:t,onSelect:s,onAction:i}){const[o,l]=b.useState(!0),u=e.children!==void 0;return v.jsxs("li",{className:"min-w-0",children:[v.jsx(iV,{entry:e,isActive:t===e.path,onAction:d=>{d.type==="create"&&l(!0),i(d)},children:v.jsxs("button",{type:"button","aria-current":!u&&t===e.path?"page":void 0,"aria-expanded":u?o:void 0,className:`
212
+ flex h-7 w-full min-w-0 flex-1 items-center gap-1.5 rounded-md pr-9
213
+ pl-2 text-left text-xs font-normal outline-none
214
+ focus-visible:ring-2 focus-visible:ring-ring
215
+ `,onClick:()=>{u?l(!o):s(e.path)},children:[v.jsx("span",{className:"flex size-3 shrink-0 items-center justify-center",children:u&&v.jsx(Jv,{className:Fe("size-3 transition-transform",o&&`
216
+ rotate-90
217
+ `)})}),u?v.jsx(_T,{className:"size-3.5 shrink-0"}):v.jsx(eb,{className:"size-3.5 shrink-0"}),v.jsx("span",{className:"truncate",title:e.path,children:e.path.split("/").at(-1)})]})}),u&&o&&v.jsx("div",{className:"ml-3 border-l pl-1",children:v.jsx(kM,{parent:e.path,entries:e.children,selectedPath:t,onSelect:s,onAction:i})})]})}function lV({skill:e}){const{t}=pt(),s=Bo(),i=Nr(),[o,l]=b.useState(!1),[u,d]=b.useState("SKILL.md"),[f,g]=b.useState(e.files),[m,h]=b.useState(e.files),[x,S]=b.useState(!1),w=up(f,u),C=w?.content??"",E=JSON.stringify(f)!==JSON.stringify(m),R=er({mutationFn:()=>gB(e.name,f),onSuccess:A=>{g(A.files),h(A.files),i.setQueryData(Wl(e.name),A),i.invalidateQueries({queryKey:Od}),Kt.success(t("skills.contentSaved"))},onError:()=>Kt.error(t("skills.contentSaveError"))}),k=V6(E||R.isPending);z8(b.useCallback(A=>{(E||R.isPending)&&A.preventDefault()},[E,R.isPending]));const O=()=>{E&&!R.isPending&&R.mutate()};return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:`
218
+ flex min-h-0 flex-1 flex-col border-t
219
+ md:flex-row
220
+ `,children:[v.jsx(aV,{files:f,overviewDisabled:R.isPending,selectedPath:u,onSelect:d,onCreate:(A,N)=>{R.isPending||(g(j=>nV(j,N,A)),A.children||d(A.path))},onAction:A=>{if(R.isPending||A.type!=="delete")return;const N=A.entry.path;g(j=>dp(j,N,()=>null)),(u===N||u.startsWith(`${N}/`))&&d("SKILL.md")},onOverview:()=>{E?S(!0):l(!0)}}),v.jsxs("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col","aria-labelledby":"skill-file-title",children:[v.jsxs("header",{className:`
221
+ flex h-10 shrink-0 items-center justify-between gap-2 border-b
222
+ px-4
223
+ `,children:[v.jsx("h1",{id:"skill-file-title",className:"min-w-0 truncate font-mono text-xs font-medium",title:u,children:u}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{role:"status",className:"text-xs text-muted-foreground",children:t(R.isPending?"skills.contentSaving":E?"skills.unsavedChanges":"skills.allChangesSaved")}),v.jsxs(nt,{disabled:!E||R.isPending,onClick:O,children:[R.isPending?v.jsx(Vr,{className:"animate-spin"}):v.jsx(nb,{}),v.jsx("span",{children:t("skills.saveContent")})]})]})]}),v.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:w?.content===null?v.jsx(Gu,{title:t("skills.fileNotEditable")}):v.jsx(pM,{height:"100%",path:`foundry://skills/${encodeURIComponent(e.name)}/${u.split("/").map(A=>encodeURIComponent(A)).join("/")}`,value:C,ariaLabel:t("skills.fileEditor",{file:u}),placeholder:u==="SKILL.md"?t("skills.contentPlaceholder"):"",readOnly:R.isPending,showLineNumbers:!0,onChange:A=>g(N=>dp(N,u,j=>({path:j.path,content:A}))),onSave:O},u)})]})]}),o&&v.jsx(pv,{skill:e,onClose:()=>l(!1),onSaved:A=>{A.name!==e.name&&s(`/library/skills/${encodeURIComponent(A.name)}`,{replace:!0})}}),v.jsx(Ri,{open:k.state==="blocked"||x,onOpenChange:A=>{A||(k.reset?.(),S(!1))},children:v.jsxs(Ci,{showCloseButton:!1,children:[v.jsxs(Js,{children:[v.jsx(Ws,{children:t("skills.leaveTitle")}),v.jsx(xi,{children:t("skills.leaveDescription")})]}),v.jsxs(bi,{children:[v.jsx(nt,{variant:"ghost",onClick:()=>{k.reset?.(),S(!1)},children:t("skills.keepEditing")}),v.jsx(nt,{variant:"destructive",disabled:R.isPending,onClick:()=>{g(m),up(m,u)||d("SKILL.md"),x?(l(!0),S(!1)):k.proceed?.()},children:t("skills.discardChanges")})]})]})})]})}function cV(){const{t:e}=pt(),{name:t=""}=N6(),s=na({queryKey:Wl(t),queryFn:({signal:i})=>cB(t,i),retry:(i,o)=>!(o instanceof Ga&&o.code==="SKILL_NOT_FOUND")&&i<2});if(s.isPending)return v.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 p-4","aria-busy":"true",children:[v.jsx(fr,{className:"h-7 w-48"}),v.jsx(fr,{className:"min-h-24 flex-1"})]});if(s.isError&&s.data===void 0){const i=s.error instanceof Ga&&s.error.code==="SKILL_NOT_FOUND";return v.jsxs("div",{role:"alert",className:"flex flex-1 flex-col items-center justify-center p-4",children:[v.jsx(Gu,{icon:By,title:e(i?"skills.notFound":"skills.loadError"),className:"flex-none"}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx(nt,{variant:"outline",render:v.jsx(yd,{to:"/library/skills"}),children:e("skills.backToSkills")}),!i&&v.jsx(nt,{onClick:()=>{s.refetch()},children:e("common.retry")})]})]})}return v.jsx(lV,{skill:s.data},s.data.name)}function Za({label:e,description:t,children:s,className:i,controlClassName:o}){return v.jsxs("div",{className:Fe(`
224
+ flex flex-col items-start gap-3 p-4
225
+ min-[680px]:min-h-16 min-[680px]:flex-row min-[680px]:items-center
226
+ min-[680px]:justify-between min-[680px]:gap-8
227
+ `,i),children:[v.jsxs("div",{className:"min-w-0",children:[v.jsx("div",{className:"text-sm font-medium",children:e}),t&&v.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:t})]}),v.jsx("div",{className:Fe(`
228
+ min-w-0
229
+ max-[680px]:w-full
230
+ min-[680px]:shrink-0
231
+ `,o),children:s})]})}function uV({configFolder:e}){const{t}=pt(),s=b.useRef(null),i=er({mutationFn:async f=>{await navigator.clipboard.writeText(f)},onSuccess:()=>{Kt.success(t("settings.configFolderCopied"))},onError:()=>{Kt.error(t("settings.errors.copyConfigFolder"))}}),o=er({mutationFn:e_,onError:()=>{Kt.error(t("settings.errors.openConfigFolder"))}}),l=i.isSuccess&&i.variables===e,u=!e||i.isPending||o.isPending,d=t(l?"settings.configFolderCopied":"settings.copyConfigFolder");return v.jsx(Za,{label:t("settings.configFolder"),controlClassName:"min-[680px]:shrink",children:v.jsxs("div",{className:`
232
+ flex min-w-0 items-center justify-end gap-2
233
+ max-[680px]:justify-start
234
+ `,children:[e&&v.jsx("span",{className:`
235
+ min-w-0 font-mono text-xs break-all text-muted-foreground
236
+ select-text
237
+ `,children:e}),v.jsx(nt,{type:"button",variant:"ghost",size:"icon","aria-label":d,title:d,disabled:u,"aria-busy":i.isPending,onClick:()=>{!e||u||(s.current&&clearTimeout(s.current),i.mutate(e,{onSuccess:()=>{s.current=setTimeout(()=>i.reset(),2e3)}}))},children:l?v.jsx(ld,{}):v.jsx(wT,{})}),v.jsxs(nt,{type:"button",variant:"outline",disabled:u,"aria-busy":o.isPending,onClick:()=>{u||o.mutate()},children:[o.isPending?v.jsx(Vr,{className:"animate-spin"}):v.jsx(PT,{}),v.jsx("span",{children:t("settings.openFolder")})]})]})})}function dV({onClose:e}){const{t}=pt(),s=Nr(),i=b.useId(),[o,l]=b.useState(["agents"]),u=na({queryKey:["skill-targets"],queryFn:({signal:f})=>t_(f),retry:!1}),d=er({mutationFn:n_,onSuccess:()=>{s.invalidateQueries({queryKey:Gk}),Kt.success(t("settings.skillDownloaded")),e()},onError:()=>Kt.error(t("settings.errors.downloadSkill"))});return v.jsx(Ri,{open:!0,onOpenChange:f=>{!f&&!d.isPending&&e()},children:v.jsxs(Ci,{showCloseButton:!1,children:[v.jsxs("form",{className:"flex flex-col gap-4","aria-busy":d.isPending,onSubmit:f=>{f.preventDefault(),o.length>0&&u.isSuccess&&!d.isPending&&d.mutate({targets:o})},children:[v.jsxs(Js,{children:[v.jsx(Ws,{children:t("settings.downloadSkill")}),v.jsx(xi,{children:t("settings.downloadSkillDescription")})]}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Wi,{id:i,children:t("settings.skillTargets")}),u.isPending&&v.jsxs("div",{className:"space-y-2",children:[v.jsx(fr,{className:"h-12 w-full"}),v.jsx(fr,{className:"h-12 w-full"})]}),u.isError&&v.jsx(nt,{type:"button",variant:"outline",disabled:u.isFetching,onClick:()=>{u.refetch()},children:t("common.retry")}),u.data&&v.jsx("div",{role:"group","aria-labelledby":i,"aria-required":"true",className:"flex flex-col gap-2",children:u.data.targets.map(({target:f,destination:g})=>v.jsxs(cM,{className:"flex items-start gap-3 rounded-lg border p-3",children:[v.jsx(SM,{checked:o.includes(f),disabled:d.isPending,onCheckedChange:m=>{l(h=>m?[...h,f]:h.filter(x=>x!==f))}}),v.jsxs("span",{className:"flex min-w-0 flex-col gap-1",children:[v.jsx("span",{children:f==="agents"?".agents":".claude"}),v.jsx("span",{className:`
238
+ font-mono text-xs font-normal break-all
239
+ text-muted-foreground
240
+ `,children:g})]})]},f))})]}),v.jsxs(bi,{children:[v.jsx(nt,{type:"button",variant:"ghost",disabled:d.isPending,onClick:e,children:t("common.cancel")}),v.jsxs(nt,{type:"submit",disabled:o.length===0||!u.isSuccess||d.isPending,children:[d.isPending?v.jsx(Vr,{className:"animate-spin"}):v.jsx(Zp,{}),v.jsx("span",{children:t(d.isPending?"settings.downloadingSkill":"settings.downloadSkill")})]})]})]}),v.jsxs(kd,{disabled:d.isPending,render:v.jsx(nt,{variant:"ghost",size:"icon",className:"absolute top-2 right-2"}),children:[v.jsx(ta,{}),v.jsx("span",{className:"sr-only",children:t("a11y.close")})]})]})})}function fV({disabled:e=!1}){const{t}=pt(),[s,i]=b.useState(!1);return v.jsxs(Za,{label:v.jsxs("span",{className:"flex items-center gap-1",children:[t("settings.downloadSkill"),v.jsxs(Xh,{children:[v.jsx(Zh,{render:v.jsx(nt,{type:"button",variant:"ghost",size:"icon",className:"shrink-0 text-muted-foreground","aria-label":t("settings.aboutFoundrySkill")}),children:v.jsx(dL,{})}),v.jsx(Jh,{children:t("settings.foundrySkillHint")})]})]}),children:[v.jsxs(nt,{type:"button",variant:"outline",disabled:e,onClick:()=>i(!0),children:[v.jsx(Zp,{}),t("settings.downloadSkill")]}),s&&v.jsx(dV,{onClose:()=>i(!1)})]})}function hV({className:e,...t}){return v.jsx("div",{"data-slot":"input-group",role:"group",className:Fe("group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...t})}const pV=Uo("flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem]","block-start":"order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function gV({className:e,align:t="inline-start",...s}){return v.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:Fe(pV({align:t}),e),onClick:i=>{i.target.closest("button")||i.currentTarget.parentElement?.querySelector("input")?.focus()},...s})}const mV=Uo("flex items-center gap-2 rounded-md text-xs/relaxed shadow-none",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"gap-1","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-7 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function yV({className:e,type:t="button",variant:s="ghost",size:i="xs",...o}){return v.jsx(nt,{type:t,"data-size":i,variant:s,className:Fe(mV({size:i}),e),...o})}function vV({className:e,...t}){return v.jsx(Sd,{"data-slot":"input-group-control",className:Fe("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent",e),...t})}function mv({id:e,disabled:t,...s}){const{t:i}=pt(),o=b.useId(),l=e??o,[u,d]=b.useState(!1),f=i(u?"a11y.hidePassword":"a11y.showPassword");return v.jsxs(hV,{"data-disabled":t,children:[v.jsx(vV,{...s,id:l,type:u?"text":"password",disabled:t}),v.jsx(gV,{align:"inline-end",children:v.jsx(yV,{type:"button",size:"icon-xs","aria-label":f,"aria-controls":l,title:f,disabled:t,onClick:()=>d(g=>!g),children:u?v.jsx(hL,{}):v.jsx(pL,{})})})]})}function bV(e,t){const s=URL.createObjectURL(e),i=document.createElement("a");i.href=s,i.download=t,document.body.append(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(s),1e3)}async function xV(e){const t=await fetch("/api/data-export",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error("Unable to export data");const s=t.headers.get("content-disposition")??"",i=/filename="([^"]+)"/u.exec(s)?.[1]??"foundry.foundry-backup";bV(await t.blob(),i)}function SV({onClose:e}){const{t}=pt(),s=b.useId(),i=b.useId(),[o,l]=b.useState(""),[u,d]=b.useState(""),f=er({mutationFn:xV,onSuccess:()=>{Kt.success(t("dataExport.exported")),e()},onError:()=>{Kt.error(t("dataExport.error"))}});return v.jsx(Ri,{open:!0,onOpenChange:g=>{!g&&!f.isPending&&e()},children:v.jsxs(Ci,{showCloseButton:!1,children:[v.jsxs("form",{className:"flex flex-col gap-4","aria-busy":f.isPending,onSubmit:g=>{if(g.preventDefault(),!(!o||!u||f.isPending)){if(o!==u){Kt.error(t("dataExport.passphraseMismatch"));return}f.mutate({passphrase:o})}},children:[v.jsxs(Js,{children:[v.jsx(Ws,{children:t("dataExport.title")}),v.jsx(xi,{children:t("dataExport.description")})]}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Wi,{htmlFor:s,children:t("dataExport.passphrase")}),v.jsx(mv,{id:s,autoComplete:"new-password",required:!0,value:o,disabled:f.isPending,onChange:g=>l(g.target.value)})]}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Wi,{htmlFor:i,children:t("dataExport.confirmPassphrase")}),v.jsx(mv,{id:i,autoComplete:"new-password",required:!0,value:u,disabled:f.isPending,"aria-invalid":u.length>0&&o!==u,onChange:g=>d(g.target.value)})]}),v.jsxs("p",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[v.jsx(EL,{className:"size-4 shrink-0"}),v.jsx("span",{children:t("dataExport.passphraseHint")})]}),v.jsxs(bi,{children:[v.jsx(nt,{type:"button",variant:"ghost",disabled:f.isPending,onClick:e,children:t("common.cancel")}),v.jsxs(nt,{type:"submit",disabled:!o||!u||f.isPending,children:[f.isPending?v.jsx(Vr,{className:"animate-spin"}):v.jsx(MT,{}),v.jsx("span",{children:t(f.isPending?"dataExport.exporting":"dataExport.action")})]})]})]}),v.jsxs(kd,{disabled:f.isPending,render:v.jsx(nt,{variant:"ghost",size:"icon",className:"absolute top-2 right-2"}),children:[v.jsx(ta,{}),v.jsx("span",{className:"sr-only",children:t("a11y.close")})]})]})})}function wV({disabled:e=!1}){const{t}=pt(),[s,i]=b.useState(!1);return v.jsxs(Za,{label:t("settings.export"),children:[v.jsxs(nt,{type:"button",variant:"outline",disabled:e,onClick:()=>i(!0),children:[v.jsx(MT,{}),t("settings.export")]}),s&&v.jsx(SV,{onClose:()=>i(!1)})]})}class tx extends Error{constructor(t){super(t),this.code=t}code}async function EV(e,t){const s=await fetch("/api/data-import",{method:"POST",headers:{"content-type":"application/octet-stream","x-foundry-passphrase":encodeURIComponent(t)},body:e});return await OM(s),s.json()}async function RV(e){const t=await fetch("/api/data-import/agents",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)});await OM(t)}async function OM(e){if(e.ok)return;let t="IMPORT_FAILED";try{const i=(await e.json()).error?.code;(i==="INVALID_BACKUP"||i==="INVALID_PASSPHRASE"||i==="IMPORT_CHANGED"||i==="AGENT_APPLY_FAILED")&&(t=i)}catch{}throw new tx(t)}function CV({file:e,onClose:t}){const{t:s}=pt(),i=b.useId(),[o,l]=b.useState(""),u=er({mutationFn:()=>EV(e,o),onSuccess:()=>l(""),onError:h=>Kt.error(s(ky(h)))}),d=er({mutationFn:h=>RV({apply:h,agentRevision:u.data.agentRevision}),onSuccess:()=>location.replace(`${location.pathname}${location.search}`),onError:h=>Kt.error(s(ky(h)))}),f=u.isPending||d.isPending||d.isSuccess,g=d.error instanceof tx&&d.error.code==="IMPORT_CHANGED",m=()=>{f||(g?location.replace(`${location.pathname}${location.search}`):u.isSuccess?d.mutate(!1):t())};return v.jsx(Ri,{open:!0,onOpenChange:h=>{h||m()},children:v.jsxs(Ci,{showCloseButton:!1,children:[u.isSuccess?v.jsxs("div",{className:"flex flex-col gap-4","aria-busy":f,children:[v.jsxs(Js,{children:[v.jsx(Ws,{children:s("dataImport.applyTitle")}),v.jsx(xi,{children:s("dataImport.applyDescription")})]}),d.isError&&v.jsx("p",{role:"alert",className:"text-sm text-destructive",children:s(ky(d.error))}),v.jsxs(bi,{children:[v.jsx(nt,{type:"button",variant:"ghost",disabled:f,onClick:m,children:s("dataImport.skipAgents")}),v.jsxs(nt,{type:"button",disabled:f||g,onClick:()=>d.mutate(!0),children:[d.isPending&&v.jsx(Vr,{className:"animate-spin"}),v.jsx("span",{children:s("dataImport.applyAgents")})]})]})]}):v.jsxs("form",{className:"flex flex-col gap-4","aria-busy":f,onSubmit:h=>{h.preventDefault(),!f&&o&&u.mutate()},children:[v.jsxs(Js,{children:[v.jsx(Ws,{children:s("dataImport.title")}),v.jsx(xi,{className:"break-all",children:e.name})]}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Wi,{htmlFor:i,children:s("dataImport.passphrase")}),v.jsx(mv,{id:i,autoComplete:"current-password",required:!0,value:o,disabled:f,onChange:h=>l(h.target.value)})]}),v.jsx("p",{className:"text-xs text-muted-foreground",children:s("dataImport.replaceWarning")}),v.jsxs(bi,{children:[v.jsx(nt,{type:"button",variant:"ghost",disabled:f,onClick:m,children:s("common.cancel")}),v.jsxs(nt,{type:"submit",variant:"destructive",disabled:f||!o,children:[f?v.jsx(Vr,{className:"animate-spin"}):v.jsx(OT,{}),v.jsx("span",{children:s("dataImport.replaceAction")})]})]})]}),v.jsxs(nt,{type:"button",disabled:f,onClick:m,variant:"ghost",size:"icon",className:"absolute top-2 right-2",children:[v.jsx(ta,{}),v.jsx("span",{className:"sr-only",children:s("a11y.close")})]})]})})}function ky(e){if(e instanceof tx)switch(e.code){case"IMPORT_CHANGED":return"dataImport.changed";case"AGENT_APPLY_FAILED":return"dataImport.applyError";case"INVALID_BACKUP":return"dataImport.invalidBackup";case"INVALID_PASSPHRASE":return"dataImport.invalidPassphrase"}return"dataImport.error"}function TV({disabled:e=!1}){const{t}=pt(),s=b.useRef(null),[i,o]=b.useState(null);return v.jsxs(Za,{label:t("settings.import"),children:[v.jsx("input",{ref:s,type:"file",accept:".foundry-backup,application/octet-stream",hidden:!0,onChange:l=>{o(l.target.files?.[0]??null),l.target.value=""}}),v.jsxs(nt,{type:"button",variant:"outline",disabled:e,onClick:()=>s.current?.click(),children:[v.jsx(OT,{}),t("settings.import")]}),i&&v.jsx(CV,{file:i,onClose:()=>o(null)})]})}const kV="data-checked",OV="data-unchecked",yv={checked(e){return e?{[kV]:""}:{[OV]:""}},...wi,...hc},AM=b.createContext(void 0);function AV(){return b.useContext(AM)}const MM=b.createContext(void 0);function MV(){const e=b.useContext(MM);if(e===void 0)throw new Error(gn(52));return e}const NV=b.forwardRef(function(t,s){const{render:i,className:o,disabled:l=!1,readOnly:u=!1,required:d=!1,"aria-labelledby":f,value:g,inputRef:m,nativeButton:h=!1,id:x,style:S,...w}=t,C=AV(),{disabled:E,readOnly:R,required:k,form:O,checkedValue:A,touched:N=!1,validation:j,name:D,setCheckedValue:M=En,setTouched:_=En,registerInputRef:L=En}=C??{},{setTouched:q,setFilled:X,state:B,disabled:H}=sa(),U=cA(),{labelId:z,getDescriptionProps:Q}=Yo(),$=H||U.disabled||E||l,K=R||u,Y=k||d,ee=O,G=C?A===g:g==="",oe=b.useRef(null),I=bd($,oe),V=b.useRef(null),W=j?.registerInput,re=b.useCallback(Ze=>W?.(Ze,{controlRef:oe,value:void 0}),[W]),Ee=es(m,V,L,re);_e(()=>{V.current?.checked&&X(!0)},[X]),_e(()=>{if(V.current){if($&&G){L(null);return}L(V.current)}},[G,$,L]);const le=ar(),me=pc({id:x}),ge=h?void 0:me,ue=Ub(f,z,V,!h,ge,w["aria-label"]),Te={role:"radio","aria-checked":G,"aria-labelledby":ue,[Wb]:G?"":void 0,id:h?me:le,onKeyDown(Ze){Ze.key==="Enter"&&Ze.preventDefault()},onClick(Ze){if(Ze.defaultPrevented||$||K)return;Ze.preventDefault();const ot=V.current;ot&&Do(ot,Ze)},onFocus(Ze){I(!0),!(Ze.defaultPrevented||$||K||!N)&&(V.current?.click(),_(!1))},onBlur(){C||I(!1)}},{getButtonProps:ve,buttonRef:Pe}=vs({disabled:$,native:h,composite:!1}),Oe={type:"radio",ref:Ee,form:ee,id:ge,name:D,tabIndex:-1,style:D?Tp:rd,"aria-hidden":!0,...g!==void 0?{value:rp(g)}:Xt,disabled:$,checked:G,required:Y,readOnly:K,onChange(Ze){if(Ze.nativeEvent.defaultPrevented||$||K||g===void 0)return;const ot=ut(Mr,Ze.nativeEvent);M(g,ot),!ot.isCanceled&&q(!0)},onClick(Ze){Ze.stopPropagation()},onFocus(){oe.current?.focus()}},Le=b.useMemo(()=>({...B,required:Y,disabled:$,readOnly:K,checked:G}),[B,$,K,G,Y]),Ve=Le,ke=C!==void 0,Ue=[s,oe,Pe],be=[Te,w,ve,Q,j?Ze=>j.getValidationProps($,Ze):Xt],He=kt("span",t,{enabled:!ke,state:Le,ref:Ue,props:be,stateAttributesMapping:yv});return v.jsxs(MM.Provider,{value:Ve,children:[ke?v.jsx(Lb,{tag:"span",render:i,className:o,style:S,state:Le,refs:Ue,props:be,stateAttributesMapping:yv}):He,v.jsx("input",{...Oe,suppressHydrationWarning:!0})]})}),DV=b.forwardRef(function(t,s){const{render:i,className:o,style:l,keepMounted:u=!1,...d}=t,f=MV(),g=f.checked,{mounted:m,transitionStatus:h,setMounted:x}=_o(g),S={...f,transitionStatus:h},w=b.useRef(null),C=u||m,E=kt("span",t,{ref:[s,w],state:S,props:d,stateAttributesMapping:yv});return Ls({batch:!0,enabled:!g,open:g,ref:w,onComplete(){g||x(!1)}}),C?E:null}),jV=[Ik],IV=b.forwardRef(function(t,s){const{render:i,className:o,disabled:l,readOnly:u,required:d,onValueChange:f,value:g,defaultValue:m,form:h,name:x,inputRef:S,id:w,style:C,...E}=t,{setTouched:R,setFocused:k,validationMode:O,name:A,disabled:N,state:j,validation:D,setDirty:M,setFilled:_,validityData:L}=sa(),{labelId:q}=Yo(),{clearErrors:X,elementRef:B}=vd(),H=gH(!0),U=N||l,z=A??x,Q=ar(w),[$,K]=Ji({controlled:g,default:m,name:"RadioGroup",state:"value"}),[Y,ee]=b.useState(!1),G=Be((Oe,Le)=>{f?.(Oe,Le),!Le.isCanceled&&K(Oe)}),oe=D.getInputControl,I=b.useMemo(()=>({get current(){return oe()}}),[oe]),V=b.useRef(null),W=b.useRef(null),re=es(V,S),Ee=b.useRef(re),le=Be(Oe=>{V.current===Oe&&Ee.current===re||(Ee.current=re,re?.(Oe))});_e(()=>{le(V.current)},[re,le]);const me=Be(Oe=>{if(Oe){if(!Oe.disabled){W.current||(W.current=Oe);const Le=V.current;(Oe.checked||Le==null||Le.disabled)&&le(Oe)}return()=>{W.current===Oe&&(W.current=null),V.current===Oe&&le(null)}}}),ge=Be(()=>{const Oe=B.current;if(!Oe)return $??null;for(const Le of D.registeredInputs.keys())if(Le.checked&&xH(Le,Oe))return $??null;return null});xd(I,Q,$??null,ge,!U,x),cc($,()=>{X(z),M($!==L.initialValue),_($!=null),D.change($);const Oe=W.current;$==null&&Oe&&!Oe.disabled&&le(Oe)});const ue=q??H?.legendId,Te={...j,disabled:U??!1,required:d??!1,readOnly:u??!1},ve=b.useMemo(()=>({checkedValue:$,disabled:U,form:h,validation:D,name:z,readOnly:u,registerInputRef:me,required:d,setCheckedValue:G,setTouched:ee,touched:Y}),[$,U,h,D,z,u,me,d,G,ee,Y]),Pe={id:w,role:"radiogroup","aria-required":d||void 0,"aria-disabled":U||void 0,"aria-readonly":u||void 0,"aria-labelledby":ue,onBlur(Oe){it(Oe.currentTarget,Oe.relatedTarget)||(ee(!1),R(!0),k(!1),O==="onBlur"&&D.commit($))},onKeyDownCapture(Oe){Oe.key.startsWith("Arrow")&&ee(!0)}};return v.jsx(AM.Provider,{value:ve,children:v.jsx(EM,{render:i,className:o,style:C,state:Te,props:[Pe,E,Oe=>D.getValidationProps(U??!1,Oe)],refs:[s],stateAttributesMapping:hc,enableHomeAndEndKeys:!1,modifierKeys:jV})})});function PV({className:e,...t}){return v.jsx(IV,{"data-slot":"radio-group",className:Fe("grid w-full gap-3",e),...t})}function LV({className:e,...t}){return v.jsx(NV,{"data-slot":"radio-group-item",className:Fe("group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none group-has-focus-visible/field-label:ring-0 group-has-focus-visible/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 dark:data-checked:bg-primary",e),...t,children:v.jsx(DV,{"data-slot":"radio-group-indicator",className:"flex size-4 items-center justify-center",children:v.jsx("span",{className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground"})})})}const zV=[{value:"system",labelKey:"common.system"},{value:"light",labelKey:"theme.light"},{value:"dark",labelKey:"theme.dark"}];function _V({value:e,onValueChange:t,disabled:s=!1}){const{t:i}=pt();return v.jsx(Za,{label:i("settings.colorTheme"),children:v.jsx(PV,{"aria-label":i("settings.colorTheme"),value:e,onValueChange:t,disabled:s,"aria-busy":s,className:"flex w-auto flex-row flex-wrap items-center gap-x-6 gap-y-2",children:zV.map(o=>v.jsxs("label",{className:Fe("flex items-center gap-2 text-sm select-none",o.value===e?"font-medium text-foreground":"text-muted-foreground",s?"cursor-not-allowed opacity-60":"cursor-pointer"),children:[v.jsx(LV,{value:o.value,disabled:s}),v.jsx("span",{children:i(o.labelKey)})]},o.value))})})}function UV(e){const t=b.useRef(!0);t.current&&(t.current=!1,e())}const NM=b.createContext(void 0),DM=b.createContext(void 0);function ki(){const e=b.useContext(NM);if(e===void 0)throw new Error(gn(60));return e}function jM(){const e=b.useContext(DM);if(e===void 0)throw new Error(gn(61));return e}function HV(e,t,s=Object.is){const{length:i}=e;if(i!==t.length)return!1;for(let o=0;o<i;o+=1)if(!s(e[o],t[o]))return!1;return!0}const IM=(e,t)=>Object.is(e,t);function zo(e,t,s){return e==null||t==null?Object.is(e,t):s(e,t)}function FV(e,t,s){return Array.isArray(e)&&Array.isArray(t)?!HV(e,t,(i,o)=>zo(i,o,s)):e!==t}function vv(e,t,s){return e?e.some(i=>i===void 0?!1:zo(t,i,s)):!1}function Lh(e,t,s){return e?e.findIndex(i=>i===void 0?!1:zo(i,t,s)):-1}function BV(e,t){if(t!==IM)return i=>vv(e,i,t);const s=new Set(e);return s.delete(void 0),i=>s.has(i)&&(i!==0||e.some(o=>Object.is(i,o)))}function PM(e,t,s,i){const o=i&&Array.isArray(t)?e.findIndex(BV(t,s)):Lh(e,t,s);return o===-1?null:o}function VV(e,t,s,i,o,l){return vv(i,t,o)?l!=null&&e>l&&vv(i,s[l],o)?l:e:e===l?PM(s,i,o,!0):l}function KV(e,t,s){return e.filter(i=>!zo(t,i,s))}const qV={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{const{value:t,multiple:s,itemToStringValue:i}=e;return t==null?!1:s&&Array.isArray(t)?t.length>0:Ul(t,i)!==""},hasNullItemLabel:(e,t)=>t?rH(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{const s=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(o=>zo(t,o,s)):zo(t,i,s)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function Ru(e,t=Number.MIN_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,s))}const Gs=1;function nx(e,t){return Math.max(0,e-t)}function hp(e,t){if(t<=0)return 0;const s=Ru(e,0,t),i=s,o=t-s,l=i<=Gs,u=o<=Gs;return l&&u?i<=o?0:t:l?0:u?t:s}function YV(e){const{id:t,value:s,defaultValue:i=null,onValueChange:o,open:l,defaultOpen:u=!1,onOpenChange:d,name:f,form:g,autoComplete:m,disabled:h=!1,readOnly:x=!1,required:S=!1,modal:w=!0,actionsRef:C,inputRef:E,onOpenChangeComplete:R,items:k,multiple:O=!1,itemToStringLabel:A,itemToStringValue:N,isItemEqualToValue:j=IM,highlightItemOnHover:D=!0,children:M}=e,{clearErrors:_}=vd(),{setDirty:L,setTouched:q,setFocused:X,validityData:B,setFilled:H,name:U,disabled:z,validation:Q,validationMode:$}=sa(),K=pc({id:t}),Y=z||h,ee=U??f,[G,oe]=Ji({controlled:s,default:O?i??$s:i,name:"Select",state:"value"}),[I,V]=Ji({controlled:l,default:u,name:"Select",state:"open"}),W=b.useRef([]),re=b.useRef([]),Ee=b.useRef(null),le=b.useRef(null),me=b.useRef(0),ge=b.useRef(null),ue=b.useRef([]),Te=b.useRef(!1),ve=b.useRef(null),Pe=b.useRef(null),Oe=b.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Le=b.useRef(!1),Ve=b.useRef(G),{openMethod:ke,triggerProps:Ue}=Ak(I),be=tr(()=>new oc({id:K,labelId:void 0,modal:w,multiple:O,disabled:Y,readOnly:x,required:S,highlightItemOnHover:D,itemToStringLabel:A,itemToStringValue:N,isItemEqualToValue:j,value:G,open:I,mounted:I,transitionStatus:void 0,items:k,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:Xt,triggerProps:Xt,itemRoot:{props:Xt,multiple:O,disabled:Y,readOnly:x,isItemEqualToValue:j},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:En,setOpen:En,handleScrollArrowVisibility:En,onOpenChangeComplete:En,listRef:W,popupRef:Ee,scrollHandlerRef:le,scrollArrowsMountedCountRef:me,valueRef:ge,valuesRef:ue,labelsRef:re,typingRef:Te,selectionRef:Oe,firstItemTextRef:ve,selectedItemTextRef:Pe,alignItemWithTriggerActiveRef:Le,initialValueRef:Ve},qV)).current,[He,Ze]=b.useState(!1),{mounted:ot,transitionStatus:de,forceUnmount:we}=LC({open:I,ref:Ee,preventUnmountOnClose:He,setPreventUnmountOnClose:Ze,onUnmount(){be.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),R?.(!1)}}),Ge=be.useState("activeIndex"),Me=be.useState("selectedIndex"),De=be.useState("triggerElement"),bt=be.useState("positionerElement"),dt=V3(ke),gt=ke??dt,Nt=b.useMemo(()=>O?"":Ul(G,N),[O,G,N]),jt=b.useMemo(()=>O&&Array.isArray(G)?G.map(F=>Ul(F,N)):Ul(G,N),[O,G,N]),tn=Ln(De),an=Be(()=>jt);xd(tn,K,G,an,!Y,f);const nn=O?Array.isArray(G)&&G.length>0:G!=null&&Nt!=="";_e(()=>{H(nn)},[nn,H]),_e(function(){const J=PM(ue.current,G,j,O);J===null&&(Pe.current=null),!I&&be.set("selectedIndex",J)},[O,I,G,j,be]),cc(G,()=>{_(ee),L(FV(G,B.initialValue,j)),Q.change(G)});const We=Be((F,J)=>{const ne=J,ye=Lp(ne);d?.(F,ne),!J.isCanceled&&(F||Ze(ye()),V(F),!F&&(J.reason===Fa||J.reason===Cp)&&(q(!0),X(!1),$==="onBlur"&&Q.commit(G)))});b.useImperativeHandle(C,()=>({unmount:we,close:()=>{be.state.open&&We(!1,ut(nd))}}),[we,We,be]);const wt=Be((F,J)=>{o?.(F,J),!J.isCanceled&&oe(F)}),Zt=Be(F=>{const J=nx(F.scrollHeight,F.clientHeight),ne=hp(F.scrollTop,J),ye=ne>0,xe=ne<J;be.set("scrollUpArrowVisible",ye),be.set("scrollDownArrowVisible",xe)}),ht=CI({open:I,onOpenChange:We,elements:{reference:De,floating:bt}}),xt=Dp(ht,{enabled:!Y,event:"mousedown"}),yt=sd(ht),Ut=qC(ht,{enabled:!Y,listRef:W,activeIndex:Ge,selectedIndex:Me,disabledIndices:$s,onNavigate(F){F===null&&!I||be.set("activeIndex",F)},focusItemOnHover:D}),un=YC(ht,{enabled:!Y&&(I||!x&&!O),listRef:re,activeIndex:Ge,selectedIndex:Me,disabledIndices:F=>rA(W.current[F]),onMatch(F){I?be.set("activeIndex",F):wt(ue.current[F],ut(Mr))},onTyping(F){Te.current=F}}),je=b.useMemo(()=>Ar(un.reference,Ut.reference,yt.reference,xt.reference,Ue),[xt.reference,un.reference,Ut.reference,yt.reference,Ue]),at=b.useMemo(()=>Ar(id,un.floating,Ut.floating,yt.floating),[un.floating,Ut.floating,yt.floating]),Ie=Ut.item??Xt,ze=b.useMemo(()=>({props:Ie,multiple:O,disabled:Y,readOnly:x,isItemEqualToValue:j}),[Ie,O,Y,x,j]);be.useContextCallback("setValue",wt),be.useContextCallback("setOpen",We),be.useContextCallback("handleScrollArrowVisibility",Zt),be.useContextCallback("onOpenChangeComplete",R),UV(()=>{be.update({popupProps:at,triggerProps:je,itemRoot:ze})}),be.useSyncedValues({id:K,modal:w,multiple:O,disabled:Y,readOnly:x,required:S,highlightItemOnHover:D,value:G,open:I,mounted:ot,transitionStatus:de,popupProps:at,triggerProps:je,itemRoot:ze,items:k,itemToStringLabel:A,itemToStringValue:N,isItemEqualToValue:j,openMethod:gt});const $e=es(E,Q.inputRef),et=O?void 0:ee,Tt=b.useMemo(()=>!O||!Array.isArray(G)||!ee?null:G.map(F=>{const J=Ul(F,N);return v.jsx("input",{type:"hidden",form:g,name:ee,value:J,disabled:Y},J)}),[O,G,g,ee,N,Y]);return v.jsxs(NM.Provider,{value:be,children:[v.jsx(DM.Provider,{value:ht,children:M}),v.jsx("input",{...Q.getValidationProps(Y,{onFocus(){be.state.triggerElement?.focus({focusVisible:!0})},onChange(F){if(F.nativeEvent.defaultPrevented||Y||x)return;const J=F.currentTarget.value,ne=ut(Mr,F.nativeEvent);function ye(){if(O)return;const xe=J.toLowerCase();let qe=ue.current.findIndex(Xe=>Ul(Xe,N).toLowerCase()===xe||iA(Xe,A).toLowerCase()===xe);qe===-1&&(qe=ue.current.findIndex((Xe,Qe)=>{const lt=re.current[Qe];return lt!=null&&lt.toLowerCase()===xe}));const Ke=ue.current[qe];Ke!=null&&wt(Ke,ne)}be.set("forceMount",!0),queueMicrotask(ye)}}),id:K&&et==null?`${K}-hidden-input`:void 0,form:g,name:et,autoComplete:m,value:Nt,disabled:Y,required:S&&!(O&&nn),readOnly:x,ref:$e,style:ee?Tp:rd,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Tt]})}function GV(e,t){return e??t}const $V="data-popup-side",QV=400,XV={..._u,...hc,popupSide:e=>e?{[$V]:e}:null,value:()=>null},ZV=b.forwardRef(function(t,s){const{render:i,className:o,id:l,disabled:u=!1,nativeButton:d=!0,style:f,...g}=t,{setTouched:m,validationMode:h,validation:x,state:S,disabled:w}=sa(),{labelId:C}=Yo(),E=ki(),R=E.useState("readOnly"),k=E.useState("required"),O=E.useState("disabled"),A=w||O||u,N=E.useState("open"),j=E.useState("mounted"),D=E.useState("value"),M=E.useState("triggerProps"),_=E.useState("positionerElement"),L=E.useState("listElement"),q=E.useState("popupSide"),X=E.useState("id"),B=E.useState("labelId"),H=E.useState("hasSelectedValue"),U=j&&_?q:null,z=l??X,Q=GV(C,B);pc({id:l});const $=Ln(_),K=b.useRef(null),Y=bd(A,K),{getButtonProps:ee,buttonRef:G}=vs({disabled:A,native:d}),oe=E.useStateSetter("triggerElement"),I=Un(),V=Un(),W=Un();b.useEffect(()=>{if(N)return W.start(QV,()=>{E.context.selectionRef.current.allowUnselectedMouseUp=!0,E.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{W.clear()};E.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},V.clear()},[N,E,V,W]);const re=Ar(M,{id:z,role:"combobox","aria-expanded":N,"aria-haspopup":"listbox","aria-controls":N?L?.id??Uh(_)?.id:void 0,"aria-labelledby":Q,"aria-readonly":R||void 0,"aria-required":k||void 0,tabIndex:A?-1:0,onFocus(me){Y(!0),N&&E.context.alignItemWithTriggerActiveRef.current&&E.context.setOpen(!1,ut(Mr,me.nativeEvent)),I.start(0,()=>{E.set("forceMount",!0)})},onBlur(me){it(_,me.relatedTarget)||(m(!0),Y(!1),h==="onBlur"&&x.commit(D))},onMouseDown(me){if(N)return;const ge=Qt(me.currentTarget);function ue(Te){if(!K.current)return;const ve=Te.target;it(K.current,ve)||it($.current,ve)||nA(Te,K.current)||E.context.setOpen(!1,ut(Mv,Te))}V.start(0,()=>{ge.addEventListener("mouseup",ue,{once:!0})})}},g,ee),Ee=x.getValidationProps(A,re);Ee.role="combobox";const le={...S,open:N,disabled:A,value:D,readOnly:R,popupSide:U,placeholder:!H};return kt("button",t,{ref:[s,K,G,oe],state:le,stateAttributesMapping:XV,props:Ee})}),JV={value:()=>null},WV=b.forwardRef(function(t,s){const{className:i,render:o,children:l,placeholder:u,style:d,...f}=t,g=ki(),m=g.useState("value"),h=g.useState("items"),x=g.useState("itemToStringLabel"),S=g.useState("hasSelectedValue"),w=!S&&u!=null&&l==null,C=g.useState("hasNullItemLabel",w),E={value:m,placeholder:!S};let R=null;return typeof l=="function"?R=l(m):l!=null?R=l:w&&!C?R=u:Array.isArray(m)?R=sH(m,h,x):R=aA(m,h,x),kt("span",t,{state:E,ref:[s,g.context.valueRef],props:[{children:R},f],stateAttributesMapping:JV})}),eK=b.forwardRef(function(t,s){const{render:i,className:o,style:l,...u}=t,g={open:ki().useState("open")};return kt("span",t,{state:g,ref:s,props:[{"aria-hidden":!0,children:"▼"},u],stateAttributesMapping:Ep})}),tK=b.forwardRef(function(t,s){const i=ki(),o=i.useState("mounted"),l=i.useState("forceMount");return o||l?v.jsx(Mp,{ref:s,...t}):null}),LM=b.createContext(void 0);function rx(){const e=b.useContext(LM);if(!e)throw new Error(gn(59));return e}function pp(e,t){e&&Object.assign(e.style,t)}const zM={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},nK={position:"fixed"},rK=b.forwardRef(function(t,s){const{anchor:i,className:o,render:l,positionMethod:u,side:d,align:f,sideOffset:g,alignOffset:m,collisionBoundary:h="clipping-ancestors",collisionPadding:x,arrowPadding:S,sticky:w,disableAnchorTracking:C,alignItemWithTrigger:E=!0,collisionAvoidance:R=TC,style:k,...O}=t,A=ki(),N=jM(),j=A.useState("open"),D=A.useState("mounted"),M=A.useState("modal"),_=A.useState("value"),L=A.useState("openMethod"),q=A.useState("positionerElement"),X=A.useState("triggerElement"),B=A.useState("isItemEqualToValue"),H=A.useState("transitionStatus"),U=b.useRef(null),z=b.useRef(null),[Q,$]=b.useState(E),K=D&&Q&&L!=="touch";!D&&Q!==E&&$(E),b.useImperativeHandle(A.context.alignItemWithTriggerActiveRef,()=>K),cb((K||M)&&j,L==="touch",q,X);const Y=Gp({anchor:i,floatingRootContext:N,positionMethod:u,mounted:D,side:d,sideOffset:g,align:f,alignOffset:m,arrowPadding:S,collisionBoundary:h,collisionPadding:x,sticky:w,disableAnchorTracking:C??K,collisionAvoidance:R,keepMounted:!0}),ee=K?"none":Y.side,G=K?nK:Y.positionerStyles,oe={open:j,side:ee,align:Y.align,anchorHidden:Y.anchorHidden};_e(()=>{A.set("popupSide",Y.side)},[A,Y.side]);const I=A.useStateSetter("positionerElement"),V=$p(t,oe,{styles:G,transitionStatus:H,props:O,refs:[s,I],hidden:!D,inert:!j}),W=b.useRef(0),re=Be(le=>{if(A.context.valuesRef.current.length===0)return;const me=W.current;W.current=le.size;const ge=ut(Mr);if(me!==0&&!A.state.multiple&&_!==null&&Lh(A.context.valuesRef.current,_,B)===-1){const Te=A.context.initialValueRef.current,Pe=Te!=null&&Lh(A.context.valuesRef.current,Te,B)!==-1?Te:null;A.context.setValue(Pe,ge),Pe===null&&(A.set("selectedIndex",null),A.context.selectedItemTextRef.current=null)}if(me!==0&&A.state.multiple&&Array.isArray(_)){const ue=_.filter(Te=>Lh(A.context.valuesRef.current,Te,B)!==-1);ue.length!==_.length&&(A.context.setValue(ue,ge),ue.length===0&&(A.set("selectedIndex",null),A.context.selectedItemTextRef.current=null))}if(j&&K){A.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const ue={height:""};pp(q,ue),pp(A.context.popupRef.current,ue)}}),Ee=b.useMemo(()=>({...Y,side:ee,alignItemWithTriggerActive:K,setControlledAlignItemWithTrigger:$,scrollUpArrowRef:U,scrollDownArrowRef:z}),[Y,ee,K,$]);return v.jsx(Pb,{elementsRef:A.context.listRef,labelsRef:A.context.labelsRef,onMapChange:re,children:v.jsxs(LM.Provider,{value:Ee,children:[D&&M&&v.jsx(eg,{inert:Qp(!j),cutout:X}),V]})})}),bh="base-ui-disable-scrollbar",bv={className:bh,getElement(e){return v.jsx("style",{nonce:e,href:bh,precedence:"base-ui:low",children:`.${bh}{scrollbar-width:none}.${bh}::-webkit-scrollbar{display:none}`})}},sK=b.createContext(void 0),iK={disableStyleElements:!1};function aK(){return b.useContext(sK)??iK}const UR="--transform-origin",oK={...Wu,...wi},lK=b.forwardRef(function(t,s){const{render:i,className:o,style:l,finalFocus:u,...d}=t,f=ki(),g=f.useState("multiple"),m=f.useState("readOnly"),h=f.useState("highlightItemOnHover"),x=jM(),{side:S,align:w,alignItemWithTriggerActive:C,isPositioned:E,setControlledAlignItemWithTrigger:R}=rx(),k=ng()!=null,O=Yp(),{nonce:A,disableStyleElements:N}=aK(),j=f.useState("id"),D=f.useState("open"),M=f.useState("openMethod"),_=f.useState("mounted"),L=f.useState("popupProps"),q=f.useState("transitionStatus"),X=f.useState("triggerElement"),B=f.useState("positionerElement"),H=f.useState("listElement"),U=b.useRef(!1),z=b.useRef(!1),Q=b.useRef({}),$=tc(),K=Be(oe=>{if(!B||!f.context.popupRef.current||!z.current)return;const I=B.style.top==="0px",V=B.style.bottom==="0px";if(U.current||!C||!I&&!V){f.context.handleScrollArrowVisibility(oe);return}const W=FR(B),re=Cu(B.getBoundingClientRect().height,"y",W),Ee=Qt(B),le=Rn(B),me=le.getComputedStyle(B),ge=parseFloat(me.marginTop),ue=parseFloat(me.marginBottom),Te=HR(le.getComputedStyle(f.context.popupRef.current)),ve=Math.min(Ee.documentElement.clientHeight-ge-ue,Te),Pe=oe.scrollTop,Oe=xh(oe);let Le=null;const Ve=He=>{B.style.height=`${He}px`},ke=I?Oe-Pe:Pe,Ue=Math.min(re+ke,ve);if(ke<=Gs){const He=Ru(ke,0,ve-re);He>0&&Ve(re+He),oe.scrollTop=I?Oe:0,ve-(re+He)<=Gs&&(U.current=!0),f.context.handleScrollArrowVisibility(oe);return}if(ve-Ue>Gs)Le=I?1/0:0;else if(V&&Pe<Oe){const He=re+ke-ve;Le=Pe-(ke-He)}const be=Math.ceil(Ue);if(be!==0&&Ve(be),Le!=null){const He=Ru(Le,0,xh(oe));Math.abs(oe.scrollTop-He)>Gs&&(oe.scrollTop=He)}be>=ve-Gs&&(U.current=!0),f.context.handleScrollArrowVisibility(oe)});b.useImperativeHandle(f.context.scrollHandlerRef,()=>K,[K]),Ls({open:D,ref:f.context.popupRef,onComplete(){D&&f.context.onOpenChangeComplete(!0)}});const Y={open:D,transitionStatus:q,side:S,align:w};_e(()=>{!B||!f.context.popupRef.current||Object.keys(Q.current).length||(Q.current={top:B.style.top||"0",left:B.style.left||"0",right:B.style.right,height:B.style.height,bottom:B.style.bottom,minHeight:B.style.minHeight,maxHeight:B.style.maxHeight,marginTop:B.style.marginTop,marginBottom:B.style.marginBottom})},[f,B]),_e(()=>{D||C||(z.current=!1,U.current=!1,pp(B,Q.current))},[D,C,B]),_e(()=>{const oe=f.context.popupRef.current;if(!D||!X||!B||!oe||C&&!E||f.state.transitionStatus==="ending")return;if(z.current=!0,oe.style.removeProperty(UR),!C){$.request(()=>f.context.handleScrollArrowVisibility(H||oe));return}const I=cK(oe);try{let V=f.context.selectedItemTextRef.current;V?.isConnected||(V=!f.select("hasSelectedValue")&&f.context.firstItemTextRef.current?.isConnected?f.context.firstItemTextRef.current:null);const W=f.context.valueRef.current,re=Rn(B),Ee=re.getComputedStyle(B),le=re.getComputedStyle(oe),me=Qt(X),ge=FR(X),ue=Sh(X.getBoundingClientRect(),ge),Te=Sh(B.getBoundingClientRect(),ge),ve=ue.height,Pe=H||oe,Oe=Pe.scrollHeight,Le=parseFloat(le.borderBottomWidth),Ve=parseFloat(Ee.marginTop)||10,ke=parseFloat(Ee.marginBottom)||10,Ue=parseFloat(Ee.minHeight)||100,be=HR(le),He=5,Ze=5,ot=20,de=me.documentElement.clientHeight-Ve-ke,we=me.documentElement.clientWidth,Ge=de-ue.bottom+ve;let Me,De=O==="rtl"?ue.right-Te.width:ue.left,bt=0;if(V&&W){const ht=Sh(W.getBoundingClientRect(),ge);Me=Sh(V.getBoundingClientRect(),ge),De=Te.left+(O==="rtl"?ht.right-Me.right:ht.left-Me.left);const xt=ht.top-ue.top+ht.height/2;bt=Me.top-Te.top+Me.height/2-xt}const dt=Ge+bt+ke+Le;let gt=Math.min(de,dt);const Nt=de-Ve-ke,jt=dt-gt,tn=we-Ze;B.style.left=`${Ru(De,He,tn-Te.width)}px`,B.style.height=`${gt}px`,B.style.maxHeight="none",B.style.marginTop=`${Ve}px`,B.style.marginBottom=`${ke}px`,oe.style.height="100%";const an=xh(Pe),nn=jt>=an-Gs;nn&&(gt=Math.min(de,Te.height)-(jt-an));const We=ue.top<ot||ue.bottom>de-ot||Math.ceil(gt)+Gs<Math.min(Oe,Ue),wt=(re.visualViewport?.scale??1)!==1&&Si;if(We||wt){pp(B,Q.current),R(!1);return}const Zt=Math.max(Ue,gt);if(nn){const ht=Math.max(0,de-dt);B.style.top=Te.height>=Nt?"0":`${ht}px`,B.style.height=`${gt}px`,Pe.scrollTop=xh(Pe)}else B.style.bottom="0",Pe.scrollTop=jt;if(Me){const ht=Te.top,xt=Te.height,yt=Me.top+Me.height/2,Ut=Ru(xt>0?(yt-ht)/xt*100:50,0,100);oe.style.setProperty(UR,`50% ${Ut}%`)}(Zt===de||gt>=be)&&(U.current=!0),f.context.handleScrollArrowVisibility(Pe),h&&f.state.selectedIndex===null&&f.state.activeIndex===null&&f.context.listRef.current[0]!=null&&f.set("activeIndex",0)}finally{I()}},[f,D,B,X,C,R,$,H,h,O,E]),b.useEffect(()=>{if(!C||!B||!D)return;const oe=Rn(B);function I(V){f.context.setOpen(!1,ut(d4,V))}return Lt(oe,"resize",I)},[f,C,B,D]);const ee={...H?{role:"presentation"}:{role:"listbox","aria-multiselectable":g||void 0,"aria-readonly":m||void 0,id:`${j}-list`},onKeyDown(oe){k&&ud.has(oe.key)&&oe.stopPropagation()},onScroll(oe){H||K(oe.currentTarget)},...C&&{style:H?{height:"100%"}:zM},className:!H&&C?bv.className:void 0},G=kt("div",t,{ref:[s,f.context.popupRef],state:Y,stateAttributesMapping:oK,props:[L,ee,od(q),d]});return v.jsxs(b.Fragment,{children:[!N&&bv.getElement(A),v.jsx(Np,{context:x,modal:!1,disabled:!_,openInteractionType:M,returnFocus:u,restoreFocus:!0,children:G})]})});function HR(e){const t=e.maxHeight;return t.endsWith("px")&&parseFloat(t)||1/0}function xh(e){return nx(e.scrollHeight,e.clientHeight)}function FR(e){return JC.getScale(e)}function Cu(e,t,s){return e/s[t]}function Sh(e,t){return Uu({x:Cu(e.x,"x",t),y:Cu(e.y,"y",t),width:Cu(e.width,"x",t),height:Cu(e.height,"y",t)})}const BR=[["transform","none"],["scale","1"],["translate","0 0"]];function cK(e){const{style:t}=e,s={};for(const[i,o]of BR)s[i]=t.getPropertyValue(i),t.setProperty(i,o,"important");return()=>{for(const[i]of BR){const o=s[i];o?t.setProperty(i,o):t.removeProperty(i)}}}const uK=b.forwardRef(function(t,s){const{render:i,className:o,style:l,...u}=t,d=ki(),f=d.useState("multiple"),g=d.useState("readOnly"),{alignItemWithTriggerActive:m}=rx(),h=d.useState("hasScrollArrows"),x=d.useState("openMethod"),w={id:`${d.useState("id")}-list`,role:"listbox","aria-multiselectable":f||void 0,"aria-readonly":g||void 0,onScroll(E){d.context.scrollHandlerRef.current?.(E.currentTarget)},...m&&{style:zM},className:h&&x!=="touch"?bv.className:void 0},C=d.useStateSetter("listElement");return kt("div",t,{ref:[s,C],props:[w,u]})}),_M=b.createContext(void 0);function UM(){const e=b.useContext(_M);if(!e)throw new Error(gn(57));return e}const dK=b.memo(b.forwardRef(function(t,s){const{render:i,className:o,style:l,value:u=null,label:d,disabled:f=!1,nativeButton:g=!1,...m}=t,h=b.useRef(null),x=hg({guess:!0,label:d,textRef:h}),S=ki(),{props:w,multiple:C,disabled:E,readOnly:R,isItemEqualToValue:k}=S.useState("itemRoot"),O=E||f,A=S.useState("isActive",x.index),N=S.useState("open"),j=S.useState("isSelected",u),D=S.useState("isSelectedByFocus",x.index),M=x.index,_=b.useRef(null);_e(()=>{const Y=S.context.valuesRef.current;return Y[M]=u,()=>{delete Y[M]}},[M,u,S]),_e(()=>{const Y=S.state.value,ee=S.state.selectedIndex;let G=ee,oe;C&&Array.isArray(Y)?(G=VV(M,u,S.context.valuesRef.current,Y,k,ee),oe=G===M,M===ee&&!oe&&(S.context.selectedItemTextRef.current=null)):(oe=Y!==void 0&&zo(u,Y,k),oe&&(G=M)),S.set("selectedIndex",G),oe&&h.current&&(S.context.selectedItemTextRef.current=h.current)},[M,C,k,S,u]);const L=b.useRef("mouse"),q=b.useRef(!1),{getButtonProps:X,buttonRef:B}=vs({disabled:O,focusableWhenDisabled:!0,native:g,composite:!0}),H={disabled:O,selected:j,highlighted:A};function U(Y){if(E||R)return;const ee=S.state.value;if(C){const G=Array.isArray(ee)?ee:[],oe=j?KV(G,u,k):[...G,u];S.context.setValue(oe,ut(No,Y))}else S.context.setValue(u,ut(No,Y)),S.context.setOpen(!1,ut(No,Y))}function z(){S.context.selectionRef.current.dragY=0}const Q={role:"option","aria-selected":j,tabIndex:N&&A?0:-1,onKeyDown(Y){S.set("activeIndex",M),Y.key===" "&&S.context.typingRef.current&&Y.preventDefault()},onClick(Y){const ee=L.current!=="touch",G=Y.nativeEvent.pointerType,oe=ee&&ec(Y.nativeEvent)&&(G!==void 0||A),I=ee&&!oe&&!q.current;q.current=!1,!(O||I)&&U(Y.nativeEvent)},onPointerEnter(Y){L.current=Y.pointerType},onPointerMove(Y){if(Y.pointerType==="mouse"&&Y.buttons===1){const ee=S.context.selectionRef.current;ee.dragY+=Y.movementY,ee.dragY**2>=64&&(ee.allowUnselectedMouseUp=!0)}},onPointerDown(Y){L.current=Y.pointerType,q.current=!0,z()},onMouseUp(){if(z(),O||L.current==="touch"||q.current)return;const Y=!S.context.selectionRef.current.allowSelectedMouseUp&&j,ee=!S.context.selectionRef.current.allowUnselectedMouseUp&&!j;Y||ee||(q.current=!0,_.current?.click(),q.current=!1)}},$=kt("div",t,{ref:[B,s,x.ref,_],state:H,props:[w,Q,m,X]}),K=b.useMemo(()=>({selected:j,index:M,textRef:h,selectedByFocus:D}),[j,M,h,D]);return v.jsx(_M.Provider,{value:K,children:$})})),fK=b.memo(b.forwardRef(function(t,s){const{render:i,className:o,style:l,keepMounted:u,selected:d,...f}=t,g=b.useRef(null),{transitionStatus:m,setMounted:h}=_o(d),S=kt("span",t,{ref:[s,g],state:{selected:d,transitionStatus:m},props:[{"aria-hidden":!0,children:"✔️"},f],stateAttributesMapping:wi});return Ls({batch:!0,enabled:!d,open:d,ref:g,onComplete(){d||h(!1)}}),S})),hK=b.forwardRef(function(t,s){const{selected:i}=UM();return t.keepMounted||i?v.jsx(fK,{...t,selected:i,ref:s}):null}),pK=b.memo(b.forwardRef(function(t,s){const{index:i,textRef:o,selectedByFocus:l}=UM(),u=ki(),{render:d,className:f,style:g,...m}=t,h=b.useCallback(S=>{S&&(i===0&&(u.context.firstItemTextRef.current=S),l&&(u.context.selectedItemTextRef.current=S))},[u,i,l]);return kt("div",t,{ref:[h,s,o],props:m})})),HM=b.forwardRef(function(t,s){const{render:i,className:o,style:l,direction:u,keepMounted:d,...f}=t,g=u==="up",m=ki(),{side:h,scrollDownArrowRef:x,scrollUpArrowRef:S}=rx(),w=g?"scrollUpArrowVisible":"scrollDownArrowVisible",C=m.useState(w),E=m.useState("openMethod"),R=C&&E!=="touch",k=Un(),O=g?S:x,{mounted:A,transitionStatus:N,setMounted:j}=_o(R);_e(()=>(m.context.scrollArrowsMountedCountRef.current+=1,m.set("hasScrollArrows",!0),()=>{m.context.scrollArrowsMountedCountRef.current=Math.max(0,m.context.scrollArrowsMountedCountRef.current-1),m.context.scrollArrowsMountedCountRef.current===0&&m.set("hasScrollArrows",!1)}),[m]),Ls({open:R,ref:O,onComplete(){R||j(!1)}});const _=kt("div",t,{ref:[s,O],state:{direction:u,visible:R,side:h,transitionStatus:N},props:[{"aria-hidden":!0,children:g?"▲":"▼",style:{position:"absolute"},onMouseMove(q){if(q.movementX===0&&q.movementY===0||k.isStarted())return;m.set("activeIndex",null);function X(){const B=m.state.listElement??m.context.popupRef.current;if(!B)return;m.set("activeIndex",null),m.context.handleScrollArrowVisibility(B);const H=nx(B.scrollHeight,B.clientHeight),U=hp(B.scrollTop,H),z=U===(g?0:H),Q=m.context.listRef.current;if(U!==B.scrollTop&&(B.scrollTop=U),z){k.clear();return}if(Q.length>0){const $=O.current?.offsetHeight||0;B.scrollTop=gK(Q,g,U,B.clientHeight,$,H)}k.start(40,X)}k.start(40,X)},onMouseLeave(){k.clear()}},f],stateAttributesMapping:wi});return A||d?_:null});function gK(e,t,s,i,o,l){if(t){let m=0;const h=s+o-Gs;for(let w=0;w<e.length;w+=1){const C=e[w];if(C&&C.offsetTop>=h){m=w;break}}const x=Math.max(0,m-1),S=e[x];return x<m&&S?hp(S.offsetTop-o,l):0}let u=e.length-1;const d=s+i-o+Gs;for(let m=0;m<e.length;m+=1){const h=e[m];if(h&&h.offsetTop+h.offsetHeight>d){u=Math.max(0,m-1);break}}const f=Math.min(e.length-1,u+1),g=e[f];return f>u&&g?hp(g.offsetTop+g.offsetHeight-i+o,l):l}const mK=b.forwardRef(function(t,s){return v.jsx(HM,{...t,ref:s,direction:"down"})}),yK=b.forwardRef(function(t,s){return v.jsx(HM,{...t,ref:s,direction:"up"})}),sx=YV;function ix({className:e,...t}){return v.jsx(WV,{"data-slot":"select-value",className:Fe("flex flex-1 text-left",e),...t})}function ax({className:e,size:t="default",children:s,...i}){return v.jsxs(ZV,{"data-slot":"select-trigger","data-size":t,className:Fe("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-input/20 px-2 py-1.5 text-xs/relaxed whitespace-nowrap transition-colors outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",e),...i,children:[s,v.jsx(eK,{render:v.jsx(Zv,{className:"pointer-events-none size-3.5 text-muted-foreground"})})]})}function ox({className:e,children:t,side:s="bottom",sideOffset:i=4,align:o="center",alignOffset:l=0,alignItemWithTrigger:u=!0,...d}){return v.jsx(tK,{children:v.jsx(rK,{side:s,sideOffset:i,align:o,alignOffset:l,alignItemWithTrigger:u,className:"isolate z-50",children:v.jsxs(lK,{"data-slot":"select-content","data-align-trigger":u,className:Fe("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...d,children:[v.jsx(vK,{}),v.jsx(uK,{children:t}),v.jsx(bK,{})]})})})}function lx({className:e,children:t,...s}){return v.jsxs(dK,{"data-slot":"select-item",className:Fe("relative flex min-h-7 w-full cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...s,children:[v.jsx(pK,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:t}),v.jsx(hK,{render:v.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:v.jsx(ld,{className:"pointer-events-none"})})]})}function vK({className:e,...t}){return v.jsx(yK,{"data-slot":"select-scroll-up-button",className:Fe("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5",e),...t,children:v.jsx(uL,{})})}function bK({className:e,...t}){return v.jsx(mK,{"data-slot":"select-scroll-down-button",className:Fe("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3.5",e),...t,children:v.jsx(Zv,{})})}const FM=["en-US","zh-CN","zh-TW","ja-JP"],xK={"en-US":"English","zh-CN":"简体中文","zh-TW":"繁體中文","ja-JP":"日本語"},SK={"skills.invalidEntryName":"Enter a valid file or folder name without slashes.","skills.newEntry":"New","skills.newFile":"New file","skills.newFolder":"New folder","skills.fileActions":"Actions for {{path}}","skills.fileConflict":"A file or folder with this name already exists.","skills.fileOperationError":"Unable to update skill files. Please try again.","skills.deleteEntryDescription":"Remove <entryPath>{{path}}</entryPath> and its contents. Deletion takes effect when you save the skill.","skills.createEntryDescription":"Create in {{path}}. Enter a single file or folder name.","skills.entryName":"Name","skills.fileWorking":"Working…","skills.createEntry":"Create","skills.fileNotEditable":"This file is binary or exceeds the 2 MiB editing limit.","skills.fileLoadError":"Unable to load this file.","editor.loading":"Loading editor…","skills.saveContent":"Save","skills.contentSaving":"Saving…","skills.contentSaved":"Content saved.","skills.contentSaveError":"Unable to save content. Please try again.","skills.unsavedChanges":"Unsaved changes","skills.allChangesSaved":"All changes saved","skills.contentPlaceholder":"Write skill instructions in Markdown.","skills.fileEditor":"Edit {{file}}","skills.leaveTitle":"Discard unsaved changes?","skills.leaveDescription":"Your changes have not been saved. Save them before leaving, or discard them to continue.","skills.keepEditing":"Keep editing","skills.discardChanges":"Discard changes","skills.overview":"Overview","skills.files":"Files","skills.fileNavigation":"Skill files","skills.selectAria":"Select {{name}}","skills.selectAll":"Select all","skills.deselectAll":"Deselect all","skills.batch":"Batch","skills.batchAssigned":"Skill assignments updated.","skills.batchAssignPartial":"{{completed}} changes saved; {{failed}} failed. Retry to finish.","skills.unassign":"Unassign","skills.assign":"Assign","skills.assignTitle":"Assign {{name}}","skills.assignDialogTitle":"Assign <skillName>{{name}}</skillName>","skills.assignDescription":"Select agents to create skill links. Deselect an agent to remove its link. Changes apply immediately.","skills.assignAgentAria":"Assign {{name}} to {{agent}}","skills.assignmentError":"Unable to update skill assignment. Please try again.","skills.noAgents":"No agents available.","skills.linkConflict":"An unrelated skill entry exists in an agent folder. Resolve the conflict and retry.","skills.edit":"Edit","skills.editTitle":"Edit skill","skills.editDescription":"Update the name and description. Changes also sync to agents this skill is assigned to.","skills.saveChanges":"Save changes","skills.updating":"Saving…","skills.updated":"Skill updated.","skills.updateError":"Unable to update the skill. Please try again.","skills.delete":"Delete","skills.deleted":"Skill deleted.","skills.deleteError":"Unable to delete the skill. Please try again.","skills.deleteConfirmTitle":"Delete skill","skills.deleteConfirmDescription":"<skillName>{{name}}</skillName> and all files in its folder will be permanently deleted. The skill will also be removed from assigned agents.","skills.actionsAria":"Actions for {{name}}","nav.dashboard":"Dashboard","nav.library":"Library","nav.skills":"Skills","skills.name":"Name","skills.namePlaceholder":"e.g. knowledge-wiki","skills.nameHint":"Unique in your skill library. Use 1–64 Unicode letters or digits, lowercase where applicable, with single hyphens between words.","skills.description":"Description","skills.descriptionPlaceholder":"Describe when an agent should use this skill.","skills.create":"Create skill","skills.creating":"Creating…","skills.created":"Skill created.","skills.createError":"Unable to create the skill. Please try again.","skills.nameConflict":"A skill with this name already exists. Choose a different name.","skills.loadError":"Unable to load skills. Please try again.","skills.emptyTitle":"No skills yet","skills.emptyDescription":"Create a skill to start building your library.","skills.notFound":"Skill not found","skills.backToSkills":"Back to Skills","skills.content":"Content","skills.noContent":"No content yet","skills.new":"New skill","skills.createManually":"Create manually","skills.createManuallyDescription":"Start from a blank SKILL.md.","skills.importLocal":"Import from local","skills.importLocalDescription":"Pick one skill folder or one .skill / .zip archive.","skills.importing":"Importing…","skills.importSummary":"Imported {{imported}} skills; skipped {{skipped}}.","skills.importSkippedInvalid":"Invalid skill folder.","skills.importSkippedConflict":"Name already exists.","filePicker.selecting":"Selecting…","filePicker.error":"Unable to open the file picker. Please try again.","filePicker.unavailable":"Native file selection is unavailable on this computer.","filePicker.busy":"A file picker is already open.","skills.importReadError":"Unable to read the selected path. Check that it exists and is accessible.","skills.importInvalid":"Invalid skill.","skills.importInvalidSource":"Select one skill folder or one .skill / .zip archive.","skills.importSymlinkSource":"Symbolic-link skill sources are not supported. Select the original skill folder or archive.","skills.importMissingSkillMd":"The selected skill must contain SKILL.md at its root.","skills.importInvalidMetadata":"SKILL.md must be UTF-8 Markdown with a valid name and description in YAML frontmatter.","skills.importInvalidPath":"The skill contains an unsafe or conflicting file path.","skills.importDuplicatePath":"The skill contains duplicate file paths.","skills.importInvalidEncoding":"The skill contains a file with invalid encoding.","skills.importUnsupportedEntries":"The skill contains symbolic links or unsupported entries.","skills.importTooManyEntries":"A skill can contain at most 5,000 entries.","skills.importSkillMdTooLarge":"SKILL.md must be at most 2 MiB.","skills.importInvalidArchive":"The selected .skill or .zip archive is invalid.","skills.importNoSkills":"The source contains no skill folders.","skills.importTooLarge":"Skills must be at most 32 MiB.","skills.importNameConflict":"A skill with this name already exists. The existing skill was not overwritten.","skills.importError":"Unable to import the skill. Please try again.","skills.importUrl":"Import from URL","skills.importUrlDescription":"Fetch a published skill by URL.","skills.url":"URL","skills.importSubmit":"Import","skills.importUrlHint":"Enter a direct .skill, .zip, or SKILL.md file URL.","skills.importInvalidUrl":"Enter an HTTP or HTTPS URL without embedded credentials.","skills.importUnsupportedUrlFile":"Use a direct .skill, .zip, or SKILL.md file link. Folder and HTML pages are not supported.","skills.importDownloadFailed":"Unable to download the file. Check the URL and try again.","skills.importDownloadTimeout":"The download timed out. Try again or import the file locally.","nav.instructions":"Instructions","nav.models":"Models","nav.genesis":"Genesis","nav.explorer":"Explorer","nav.quantum":"Quantum","instructions.create":"New instruction","instructions.createTitle":"New instruction","instructions.name":"Name","instructions.namePlaceholder":"e.g. Code review checklist","instructions.content":"Content","instructions.contentPlaceholder":"Write Markdown instructions. Content is saved as Markdown.","instructions.save":"Create instruction","instructions.creating":"Creating…","instructions.created":"Instruction created.","instructions.error":"Unable to create the instruction. Please try again.","instructions.editTitle":"Edit instruction","instructions.updateSave":"Save changes","instructions.updating":"Saving…","instructions.updated":"Instruction updated. Reapply enabled agents to write the new content.","instructions.updateError":"Unable to update the instruction. Please try again.","instructions.edit":"Edit","instructions.delete":"Delete","instructions.deleted":"Instruction deleted.","instructions.deleteError":"Unable to delete the instruction. Please try again.","instructions.deleteConfirmTitle":"Delete instruction?","instructions.deleteConfirmDescription":'"{{name}}" will be removed from the library and every agent. This cannot be undone.',"instructions.dragHint":"Drag an instruction to an agent","instructions.listAria":"Instructions","instructions.actionsAria":"Actions for {{name}}","instructions.emptyTitle":"No instructions yet","instructions.emptyDescription":"Create an instruction from the New instruction action in the page header.","instructions.loadError":"Unable to load instructions. Please try again.","agents.title":"Agents","agents.orderHint":"Order controls how instructions are combined","agents.loadError":"Unable to load agents. Please try again.","agents.updateError":"Unable to update the agent instructions.","agents.enableError":"Unable to update the agent.","agents.reapplyError":"Unable to reapply the agent instructions.","agents.reapplyHint":"Rewrite the managed instruction block.","agents.reapplyDisabledHint":"Enable instructions before reapplying.","agents.openFileError":"Unable to open the instruction file.","agents.fileMissing":"The instruction file does not exist yet.","agents.duplicateError":"This instruction is already assigned to the agent.","agents.applied":"Instructions applied.","agents.removed":"Foundry instructions removed.","agents.reapplied":"Instructions reapplied.","agents.enableRequiresInstruction":"Add at least one instruction first.","agents.toggleOnHint":"Remove Foundry instructions from this file.","agents.toggleOffHint":"Write Foundry instructions to this file.","agents.emptyAssigned":"Drag instructions here","agents.loadingInstruction":"Loading instruction…","agents.openFileAria":"Open instruction file for {{name}}","agents.reapplyAria":"Reapply instructions for {{name}}","agents.toggleAria":"Apply instructions to {{name}}","agents.removeInstructionAria":"Remove {{name}} from this agent","common.retry":"Retry","settings.downloadSkill":"Download Skill","settings.skillTargets":"Install targets","settings.aboutFoundrySkill":"About the Foundry Skill","settings.foundrySkillHint":"Download the Foundry Skill to teach agents how to operate Foundry through the Foundry CLI.","settings.downloadSkillDescription":"Choose user-level folders to install the Foundry agent skill. Existing copies will be replaced.","settings.skillDownloaded":"Skill installed.","settings.errors.downloadSkill":"Unable to download the skill. Please try again.","settings.errors.skillTargets":"Unable to load skill destinations. Please try again.","settings.downloadingSkill":"Downloading…","timeZone.losAngeles":"Los Angeles","timeZone.newYork":"New York","timeZone.shanghai":"Shanghai","timeZone.taipei":"Taipei","timeZone.tokyo":"Tokyo","timeZone.utc":"Coordinated Universal Time (UTC)","dataImport.title":"Import data","dataImport.passphrase":"Backup passphrase","dataImport.replaceAction":"Replace and import","dataImport.replaceWarning":"Importing replaces local settings, Instructions, Skills, and Agent configuration with this backup. Existing data will not be merged. Agent files and links are updated only if you choose Apply after import.","dataImport.applyTitle":"Import complete. Apply Agent configuration?","dataImport.applyDescription":"Apply the imported configuration to this machine’s Agent instructions and Skill links. Choosing not to apply clears Agent configuration in Foundry and leaves existing Agent files and links in place.","dataImport.skipAgents":"Do not apply","dataImport.applyAgents":"Apply configuration","dataImport.changed":"Agent configuration has changed since this import. Close this dialog to reload the current data.","dataImport.applyError":"Data was imported, but Agent configuration could not be applied. Check file access and Skill destination conflicts, then retry.","dataImport.error":"Unable to import data. Please try again.","dataImport.invalidBackup":"This backup is invalid or unsupported.","dataImport.invalidPassphrase":"The passphrase is incorrect or the backup is corrupted.","nav.settings":"Settings","settings.workspace":"Workspace","settings.appearance":"Appearance","settings.appearanceAria":"Appearance settings","settings.languageRegion":"Language & Region","settings.languageRegionAria":"Language & Region settings","settings.advanced":"Advanced","settings.advancedAria":"Advanced settings","settings.export":"Export","dataExport.title":"Export data","dataExport.action":"Export","dataExport.description":"Download an encrypted backup of your Foundry data.","dataExport.passphrase":"Passphrase","dataExport.confirmPassphrase":"Confirm passphrase","dataExport.passphraseHint":"Keep this passphrase. You will need it to import the backup; it cannot be recovered.","dataExport.passphraseMismatch":"The passphrases do not match.","dataExport.exporting":"Exporting…","dataExport.exported":"Backup download started.","dataExport.error":"Unable to export data. Please try again.","common.cancel":"Cancel","settings.import":"Import","settings.configFolder":"Config Folder","settings.openFolder":"Open","settings.copyConfigFolder":"Copy config folder path","settings.configFolderCopied":"Config folder path copied","settings.errors.copyConfigFolder":"Unable to copy the config folder path.","settings.errors.openConfigFolder":"Unable to open the config folder.","settings.language":"Language","settings.timeFormat":"Time format","settings.timeZone":"Time zone","settings.colorTheme":"Color theme","settings.navigation":"Settings navigation","settings.openNavigation":"Open settings navigation","settings.errors.load":"Unable to load settings.","settings.errors.theme":"Unable to update the color theme.","settings.errors.language":"Unable to update the language.","settings.errors.timeFormat":"Unable to update the time format.","settings.errors.timeZone":"Unable to update the time zone.","common.system":"System","theme.light":"Light","theme.dark":"Dark","statusBar.foundry":"Foundry","statusBar.foundryVersion":"Foundry v{{version}}","statusBar.skill":"Skill","statusBar.skillStatus":"Foundry skill status","statusBar.skillChecking":"Checking skill…","statusBar.skillUnavailable":"Skill status unavailable","statusBar.skillRefreshHint":"Copy the command below into your terminal, or open <settings>Advanced settings</settings> to download the Skill again.","statusBar.copyCommand":"Copy command","statusBar.terminal":"Terminal","statusBar.targetAgents":"ChatGPT","statusBar.targetClaude":"Claude Code","statusBar.statusMissing":"Not installed","statusBar.statusOutdated":"Differs from the bundled skill","statusBar.statusCurrent":"Up to date","a11y.breadcrumb":"Breadcrumb","a11y.goBack":"Go back","a11y.close":"Close","a11y.showPassword":"Reveal password","a11y.hidePassword":"Hide password","a11y.sidebar":"Sidebar","a11y.sidebarDescription":"Displays the mobile sidebar.","a11y.toggleSidebar":"Toggle sidebar"},wK={"skills.invalidEntryName":"请输入有效的文件或文件夹名称,不包含斜杠。","skills.newEntry":"新建","skills.newFile":"新增文件","skills.newFolder":"新增文件夹","skills.fileActions":"{{path}} 的操作","skills.fileConflict":"已存在同名文件或文件夹。","skills.fileOperationError":"无法修改技能文件,请重试。","skills.deleteEntryDescription":"移除 <entryPath>{{path}}</entryPath> 及其中的所有内容,保存技能后才会删除并同步到 Agent。","skills.createEntryDescription":"在 {{path}} 中创建,请输入单个文件或文件夹名称。","skills.entryName":"名称","skills.fileWorking":"处理中…","skills.createEntry":"创建","skills.fileNotEditable":"此文件为二进制文件,或超过 2 MiB 编辑上限。","skills.fileLoadError":"无法加载此文件。","editor.loading":"正在加载编辑器…","skills.saveContent":"保存","skills.contentSaving":"保存中…","skills.contentSaved":"内容已保存。","skills.contentSaveError":"无法保存内容,请重试。","skills.unsavedChanges":"未保存的修改","skills.allChangesSaved":"已全部保存","skills.contentPlaceholder":"使用 Markdown 编写技能指令。","skills.fileEditor":"编辑 {{file}}","skills.leaveTitle":"放弃未保存的修改?","skills.leaveDescription":"当前修改尚未保存。请先保存,或放弃修改后继续。","skills.keepEditing":"继续编辑","skills.discardChanges":"放弃修改","skills.overview":"概览","skills.files":"文件","skills.fileNavigation":"技能文件","skills.selectAria":"选择 {{name}}","skills.selectAll":"全选","skills.deselectAll":"取消全选","skills.batch":"批量操作","skills.batchAssigned":"技能分配已更新。","skills.batchAssignPartial":"{{completed}} 项更改已保存,{{failed}} 项失败,请重试以完成更改。","skills.unassign":"取消分配","skills.assign":"分配","skills.assignTitle":"分配 {{name}}","skills.assignDialogTitle":"分配 <skillName>{{name}}</skillName>","skills.assignDescription":"选择 Agent 创建技能链接,取消选择则解除链接。更改立即生效。","skills.assignAgentAria":"将 {{name}} 分配给 {{agent}}","skills.assignmentError":"无法更新技能分配,请重试。","skills.noAgents":"暂无可用的 Agent。","skills.linkConflict":"Agent 技能目录中存在同名的其他内容,请处理冲突后重试。","skills.edit":"修改","skills.editTitle":"修改技能","skills.editDescription":"更新名称和描述,已分配给 Agent 的技能也会同步更新。","skills.saveChanges":"保存修改","skills.updating":"保存中…","skills.updated":"技能已更新。","skills.updateError":"无法修改技能,请重试。","skills.delete":"删除","skills.deleted":"技能已删除。","skills.deleteError":"无法删除技能,请重试。","skills.deleteConfirmTitle":"删除技能","skills.deleteConfirmDescription":"<skillName>{{name}}</skillName> 及其文件夹中的所有文件将被永久删除。已分配给 Agent 的技能也会同步移除。","skills.actionsAria":"{{name}} 的操作","nav.dashboard":"仪表盘","nav.library":"资料库","nav.skills":"技能","skills.name":"名称","skills.namePlaceholder":"例如:knowledge-wiki","skills.nameHint":"名称在技能库中必须唯一。使用 1–64 个 Unicode 字母或数字,字母有大小写时使用小写,单个连字符可用于分隔单词。","skills.description":"描述","skills.descriptionPlaceholder":"描述 Agent 应在什么情况下使用此技能。","skills.create":"创建技能","skills.creating":"创建中…","skills.created":"技能已创建。","skills.createError":"无法创建技能,请重试。","skills.nameConflict":"已存在同名技能,请使用其他名称。","skills.loadError":"无法加载技能,请重试。","skills.emptyTitle":"暂无技能","skills.emptyDescription":"创建一个技能,开始构建你的技能库。","skills.notFound":"未找到技能","skills.backToSkills":"返回技能库","skills.content":"内容","skills.noContent":"暂无内容","skills.new":"新建技能","skills.createManually":"手动创建","skills.createManuallyDescription":"从空白的 SKILL.md 开始。","skills.importLocal":"从本地导入","skills.importLocalDescription":"选择一个技能文件夹或一个 .skill / .zip 压缩包。","skills.importing":"正在导入…","skills.importSummary":"已导入 {{imported}} 个技能,跳过 {{skipped}} 项。","skills.importSkippedInvalid":"技能文件夹不符合规范。","skills.importSkippedConflict":"技能名称已存在。","filePicker.selecting":"正在选择…","filePicker.error":"无法打开文件选择器,请重试。","filePicker.unavailable":"当前电脑无法使用原生文件选择器。","filePicker.busy":"已有文件选择器打开,请先完成选择。","skills.importReadError":"无法读取所选路径,请确认文件存在且具有访问权限。","skills.importInvalid":"技能格式无效。","skills.importInvalidSource":"请选择一个技能文件夹或一个 .skill / .zip 压缩包。","skills.importSymlinkSource":"不支持导入符号链接形式的技能来源,请选择原始技能文件夹或压缩包。","skills.importMissingSkillMd":"所选技能必须在根目录包含 SKILL.md。","skills.importInvalidMetadata":"SKILL.md 必须是 UTF-8 Markdown,并在 YAML 元数据中包含有效的 name 和 description。","skills.importInvalidPath":"技能包含不安全或冲突的文件路径。","skills.importDuplicatePath":"技能包含重复的文件路径。","skills.importInvalidEncoding":"技能包含编码无效的文件。","skills.importUnsupportedEntries":"技能包含符号链接或不支持的条目。","skills.importTooManyEntries":"技能最多包含 5,000 个条目。","skills.importSkillMdTooLarge":"SKILL.md 不能超过 2 MiB。","skills.importInvalidArchive":"所选 .skill 或 .zip 压缩包无效。","skills.importNoSkills":"所选来源中没有技能文件夹。","skills.importTooLarge":"技能总大小不能超过 32 MiB。","skills.importNameConflict":"已存在同名技能,现有技能不会被覆盖。","skills.importError":"无法导入技能,请重试。","skills.importUrl":"从 URL 导入","skills.importUrlDescription":"通过 URL 获取已发布的技能。","skills.url":"URL","skills.importSubmit":"导入","skills.importUrlHint":"请输入 .skill、.zip 或 SKILL.md 文件直链。","skills.importInvalidUrl":"请输入不含账号密码的 HTTP 或 HTTPS URL。","skills.importUnsupportedUrlFile":"请使用 .skill、.zip 或 SKILL.md 文件直链,不支持文件夹和 HTML 网页。","skills.importDownloadFailed":"文件下载失败,请检查链接后重试。","skills.importDownloadTimeout":"下载超时,请重试或下载后从本地导入。","nav.instructions":"指令","nav.models":"模型","nav.genesis":"创世","nav.explorer":"探索","nav.quantum":"量子","instructions.create":"新建指令","instructions.createTitle":"新建指令","instructions.name":"名称","instructions.namePlaceholder":"例如:代码审查清单","instructions.content":"内容","instructions.contentPlaceholder":"编写 Markdown 指令。内容将以 Markdown 格式保存。","instructions.save":"创建指令","instructions.creating":"创建中…","instructions.created":"指令已创建。","instructions.error":"无法创建指令,请重试。","instructions.editTitle":"编辑指令","instructions.updateSave":"保存修改","instructions.updating":"保存中…","instructions.updated":"指令已更新。对已启用的 Agent 执行重新写入后才会使用新内容。","instructions.updateError":"无法更新指令,请重试。","instructions.edit":"编辑","instructions.delete":"删除","instructions.deleted":"指令已删除。","instructions.deleteError":"无法删除指令,请重试。","instructions.deleteConfirmTitle":"删除指令?","instructions.deleteConfirmDescription":"“{{name}}”将从指令库和所有 Agent 中移除,此操作无法撤销。","instructions.dragHint":"将指令拖到 Agent 上","instructions.listAria":"指令列表","instructions.actionsAria":"{{name}} 的操作","instructions.emptyTitle":"还没有指令","instructions.emptyDescription":"使用页面右上角的“新建指令”操作创建第一条指令。","instructions.loadError":"无法加载指令,请重试。","agents.title":"Agents","agents.orderHint":"顺序决定指令的拼接方式","agents.loadError":"无法加载 Agent,请重试。","agents.updateError":"无法更新 Agent 的指令。","agents.enableError":"无法更新 Agent。","agents.reapplyError":"无法重新写入 Agent 指令。","agents.reapplyHint":"重新生成文件中的 Foundry 指令块。","agents.reapplyDisabledHint":"启用指令后才能重新写入。","agents.openFileError":"无法打开指令文件。","agents.fileMissing":"指令文件尚不存在。","agents.duplicateError":"该指令已经添加到此 Agent。","agents.applied":"指令已写入。","agents.removed":"Foundry 指令已移除。","agents.reapplied":"指令已重新写入。","agents.enableRequiresInstruction":"请先添加至少一条指令。","agents.toggleOnHint":"从文件中移除 Foundry 指令。","agents.toggleOffHint":"将 Foundry 指令写入此文件。","agents.emptyAssigned":"将指令拖到这里","agents.loadingInstruction":"正在加载指令…","agents.openFileAria":"打开 {{name}} 的指令文件","agents.reapplyAria":"重新写入 {{name}} 的指令","agents.toggleAria":"将指令应用到 {{name}}","agents.removeInstructionAria":"从此 Agent 移除 {{name}}","common.retry":"重试","settings.downloadSkill":"下载 Skill","settings.skillTargets":"安装目标","settings.aboutFoundrySkill":"关于 Foundry Skill","settings.foundrySkillHint":"下载 Foundry Skill,让 Agent 了解如何通过 Foundry CLI 操作 Foundry。","settings.downloadSkillDescription":"选择用于安装 Foundry Agent Skill 的用户目录,已有副本将被替换。","settings.skillDownloaded":"Skill 已安装。","settings.errors.downloadSkill":"无法下载 Skill,请重试。","settings.errors.skillTargets":"无法加载 Skill 目标路径,请重试。","settings.downloadingSkill":"下载中…","timeZone.losAngeles":"洛杉矶","timeZone.newYork":"纽约","timeZone.shanghai":"上海","timeZone.taipei":"台北","timeZone.tokyo":"东京","timeZone.utc":"协调世界时(UTC)","dataImport.title":"导入数据","dataImport.passphrase":"备份密码","dataImport.replaceAction":"覆盖并导入","dataImport.replaceWarning":"导入会用备份替换本地设置、Instructions、Skills 和 Agent 配置,不会合并现有数据。导入后选择应用配置,才会更新本机 Agent 文件和链接。","dataImport.applyTitle":"导入完成,是否应用 Agent 配置?","dataImport.applyDescription":"应用后,将根据导入的配置更新本机 Agent 的 Instructions 和 Skill 链接。选择不应用将清空 Foundry 中的 Agent 配置,保留本机现有 Agent 文件和链接。","dataImport.skipAgents":"不应用","dataImport.applyAgents":"应用配置","dataImport.changed":"Agent 配置在本次导入后已发生变化。请关闭弹窗,重新加载当前数据。","dataImport.applyError":"数据已导入,但 Agent 配置未能应用。请检查文件访问权限和 Skill 目标位置冲突后重试。","dataImport.error":"无法导入数据,请重试。","dataImport.invalidBackup":"备份无效或不受支持。","dataImport.invalidPassphrase":"密码不正确或备份已损坏。","nav.settings":"设置","settings.workspace":"工作区","settings.appearance":"外观","settings.appearanceAria":"外观设置","settings.languageRegion":"语言和地区","settings.languageRegionAria":"语言和地区设置","settings.advanced":"高级","settings.advancedAria":"高级设置","settings.export":"导出","dataExport.title":"导出数据","dataExport.action":"导出","dataExport.description":"下载当前 Foundry 数据的加密备份。","dataExport.passphrase":"密码","dataExport.confirmPassphrase":"确认密码","dataExport.passphraseHint":"请保存此密码,导入备份时需要使用。密码无法找回。","dataExport.passphraseMismatch":"两次输入的密码不一致。","dataExport.exporting":"导出中…","dataExport.exported":"已开始下载数据备份。","dataExport.error":"无法导出数据,请重试。","common.cancel":"取消","settings.import":"导入","settings.configFolder":"配置文件夹","settings.openFolder":"打开","settings.copyConfigFolder":"复制配置文件夹路径","settings.configFolderCopied":"已复制配置文件夹路径","settings.errors.copyConfigFolder":"无法复制配置文件夹路径。","settings.errors.openConfigFolder":"无法打开配置文件夹。","settings.language":"语言","settings.timeFormat":"时间格式","settings.timeZone":"时区","settings.colorTheme":"颜色主题","settings.navigation":"设置导航","settings.openNavigation":"打开设置导航","settings.errors.load":"无法加载设置。","settings.errors.theme":"无法更新颜色主题。","settings.errors.language":"无法更新语言。","settings.errors.timeFormat":"无法更新时间格式。","settings.errors.timeZone":"无法更新时区。","common.system":"跟随系统","theme.light":"浅色","theme.dark":"深色","statusBar.foundry":"Foundry","statusBar.foundryVersion":"Foundry v{{version}}","statusBar.skill":"Skill","statusBar.skillStatus":"Foundry Skill 状态","statusBar.skillChecking":"正在检查 Skill…","statusBar.skillUnavailable":"无法获取 Skill 状态","statusBar.skillRefreshHint":"复制下面的命令到终端执行,或前往 <settings>高级设置</settings> 重新下载 Skill。","statusBar.copyCommand":"复制命令","statusBar.terminal":"终端","statusBar.targetAgents":"ChatGPT","statusBar.targetClaude":"Claude Code","statusBar.statusMissing":"未安装","statusBar.statusOutdated":"与当前 Foundry 版本不一致","statusBar.statusCurrent":"已是最新","a11y.breadcrumb":"面包屑导航","a11y.goBack":"返回","a11y.close":"关闭","a11y.showPassword":"显示密码","a11y.hidePassword":"隐藏密码","a11y.sidebar":"侧边栏","a11y.sidebarDescription":"显示移动端侧边栏。","a11y.toggleSidebar":"切换侧边栏"},EK={"skills.invalidEntryName":"請輸入有效的檔案或資料夾名稱,不包含斜線。","skills.newEntry":"新增","skills.newFile":"新增檔案","skills.newFolder":"新增資料夾","skills.fileActions":"{{path}} 的操作","skills.fileConflict":"已存在同名檔案或資料夾。","skills.fileOperationError":"無法修改技能檔案,請重試。","skills.deleteEntryDescription":"移除 <entryPath>{{path}}</entryPath> 及其中的所有內容,儲存技能後才會刪除並同步至 Agent。","skills.createEntryDescription":"在 {{path}} 中建立,請輸入單一檔案或資料夾名稱。","skills.entryName":"名稱","skills.fileWorking":"處理中…","skills.createEntry":"建立","skills.fileNotEditable":"此檔案為二進位檔案,或超過 2 MiB 編輯上限。","skills.fileLoadError":"無法載入此檔案。","editor.loading":"正在載入編輯器…","skills.saveContent":"儲存","skills.contentSaving":"儲存中…","skills.contentSaved":"內容已儲存。","skills.contentSaveError":"無法儲存內容,請重試。","skills.unsavedChanges":"未儲存的修改","skills.allChangesSaved":"已全部儲存","skills.contentPlaceholder":"使用 Markdown 編寫技能指令。","skills.fileEditor":"編輯 {{file}}","skills.leaveTitle":"放棄未儲存的修改?","skills.leaveDescription":"目前修改尚未儲存。請先儲存,或放棄修改後繼續。","skills.keepEditing":"繼續編輯","skills.discardChanges":"放棄修改","skills.overview":"概覽","skills.files":"檔案","skills.fileNavigation":"技能檔案","skills.selectAria":"選擇 {{name}}","skills.selectAll":"全選","skills.deselectAll":"取消全選","skills.batch":"批次操作","skills.batchAssigned":"技能分配已更新。","skills.batchAssignPartial":"{{completed}} 項變更已儲存,{{failed}} 項失敗,請重試以完成變更。","skills.unassign":"取消分配","skills.assign":"分配","skills.assignTitle":"分配 {{name}}","skills.assignDialogTitle":"分配 <skillName>{{name}}</skillName>","skills.assignDescription":"選擇 Agent 建立技能連結,取消選擇則解除連結。變更立即生效。","skills.assignAgentAria":"將 {{name}} 分配給 {{agent}}","skills.assignmentError":"無法更新技能分配,請重試。","skills.noAgents":"暫無可用的 Agent。","skills.linkConflict":"Agent 技能目錄中存在同名的其他內容,請處理衝突後重試。","skills.edit":"修改","skills.editTitle":"修改技能","skills.editDescription":"更新名稱和描述,已分配給 Agent 的技能也會同步更新。","skills.saveChanges":"儲存修改","skills.updating":"儲存中…","skills.updated":"技能已更新。","skills.updateError":"無法修改技能,請重試。","skills.delete":"刪除","skills.deleted":"技能已刪除。","skills.deleteError":"無法刪除技能,請重試。","skills.deleteConfirmTitle":"刪除技能","skills.deleteConfirmDescription":"<skillName>{{name}}</skillName> 及其資料夾中的所有檔案將被永久刪除。已分配給 Agent 的技能也會同步移除。","skills.actionsAria":"{{name}} 的操作","nav.dashboard":"儀表板","nav.library":"資料庫","nav.skills":"技能","skills.name":"名稱","skills.namePlaceholder":"例如:knowledge-wiki","skills.nameHint":"名稱在技能庫中必須唯一。使用 1–64 個 Unicode 字母或數字,字母有大小寫時使用小寫,單一連字號可用於分隔單字。","skills.description":"描述","skills.descriptionPlaceholder":"描述 Agent 應在什麼情況下使用此技能。","skills.create":"建立技能","skills.creating":"建立中…","skills.created":"技能已建立。","skills.createError":"無法建立技能,請重試。","skills.nameConflict":"已存在同名技能,請使用其他名稱。","skills.loadError":"無法載入技能,請重試。","skills.emptyTitle":"尚無技能","skills.emptyDescription":"建立一個技能,開始建構你的技能庫。","skills.notFound":"找不到技能","skills.backToSkills":"返回技能庫","skills.content":"內容","skills.noContent":"尚無內容","skills.new":"新增技能","skills.createManually":"手動建立","skills.createManuallyDescription":"從空白的 SKILL.md 開始。","skills.importLocal":"從本機匯入","skills.importLocalDescription":"選擇一個技能資料夾或一個 .skill / .zip 壓縮檔。","skills.importing":"正在匯入…","skills.importSummary":"已匯入 {{imported}} 個技能,略過 {{skipped}} 項。","skills.importSkippedInvalid":"技能資料夾不符合規範。","skills.importSkippedConflict":"技能名稱已存在。","filePicker.selecting":"正在選擇…","filePicker.error":"無法開啟檔案選擇器,請重試。","filePicker.unavailable":"目前電腦無法使用原生檔案選擇器。","filePicker.busy":"已有檔案選擇器開啟,請先完成選擇。","skills.importReadError":"無法讀取所選路徑,請確認檔案存在且具有存取權限。","skills.importInvalid":"技能格式無效。","skills.importInvalidSource":"請選擇一個技能資料夾或一個 .skill / .zip 壓縮檔。","skills.importSymlinkSource":"不支援匯入符號連結形式的技能來源,請選擇原始技能資料夾或壓縮檔。","skills.importMissingSkillMd":"所選技能必須在根目錄包含 SKILL.md。","skills.importInvalidMetadata":"SKILL.md 必須是 UTF-8 Markdown,並在 YAML 中繼資料中包含有效的 name 與 description。","skills.importInvalidPath":"技能包含不安全或衝突的檔案路徑。","skills.importDuplicatePath":"技能包含重複的檔案路徑。","skills.importInvalidEncoding":"技能包含編碼無效的檔案。","skills.importUnsupportedEntries":"技能包含符號連結或不支援的項目。","skills.importTooManyEntries":"技能最多包含 5,000 個項目。","skills.importSkillMdTooLarge":"SKILL.md 不能超過 2 MiB。","skills.importInvalidArchive":"所選 .skill 或 .zip 壓縮檔無效。","skills.importNoSkills":"所選來源中沒有技能資料夾。","skills.importTooLarge":"技能總大小不能超過 32 MiB。","skills.importNameConflict":"已存在同名技能,現有技能不會被覆蓋。","skills.importError":"無法匯入技能,請重試。","skills.importUrl":"從 URL 匯入","skills.importUrlDescription":"透過 URL 取得已發布的技能。","skills.url":"URL","skills.importSubmit":"匯入","skills.importUrlHint":"請輸入 .skill、.zip 或 SKILL.md 檔案直連。","skills.importInvalidUrl":"請輸入不含帳號密碼的 HTTP 或 HTTPS URL。","skills.importUnsupportedUrlFile":"請使用 .skill、.zip 或 SKILL.md 檔案直連,不支援資料夾和 HTML 網頁。","skills.importDownloadFailed":"檔案下載失敗,請檢查連結後重試。","skills.importDownloadTimeout":"下載逾時,請重試或下載後從本機匯入。","nav.instructions":"指令","nav.models":"模型","nav.genesis":"創世","nav.explorer":"探索","nav.quantum":"量子","instructions.create":"新增指令","instructions.createTitle":"新增指令","instructions.name":"名稱","instructions.namePlaceholder":"例如:程式碼審查清單","instructions.content":"內容","instructions.contentPlaceholder":"撰寫 Markdown 指令。內容將以 Markdown 格式儲存。","instructions.save":"建立指令","instructions.creating":"建立中…","instructions.created":"指令已建立。","instructions.error":"無法建立指令,請重試。","instructions.editTitle":"編輯指令","instructions.updateSave":"儲存修改","instructions.updating":"儲存中…","instructions.updated":"指令已更新。對已啟用的 Agent 執行重新寫入後才會使用新內容。","instructions.updateError":"無法更新指令,請重試。","instructions.edit":"編輯","instructions.delete":"刪除","instructions.deleted":"指令已刪除。","instructions.deleteError":"無法刪除指令,請重試。","instructions.deleteConfirmTitle":"刪除指令?","instructions.deleteConfirmDescription":"「{{name}}」將從指令庫和所有 Agent 中移除,此操作無法復原。","instructions.dragHint":"將指令拖到 Agent 上","instructions.listAria":"指令列表","instructions.actionsAria":"{{name}} 的操作","instructions.emptyTitle":"尚無指令","instructions.emptyDescription":"使用頁面右上角的「新增指令」操作建立第一條指令。","instructions.loadError":"無法載入指令,請重試。","agents.title":"Agents","agents.orderHint":"順序決定指令的拼接方式","agents.loadError":"無法載入 Agent,請重試。","agents.updateError":"無法更新 Agent 的指令。","agents.enableError":"無法更新 Agent。","agents.reapplyError":"無法重新寫入 Agent 指令。","agents.reapplyHint":"重新產生檔案中的 Foundry 指令區塊。","agents.reapplyDisabledHint":"啟用指令後才能重新寫入。","agents.openFileError":"無法開啟指令檔案。","agents.fileMissing":"指令檔案尚不存在。","agents.duplicateError":"此指令已經加入此 Agent。","agents.applied":"指令已寫入。","agents.removed":"Foundry 指令已移除。","agents.reapplied":"指令已重新寫入。","agents.enableRequiresInstruction":"請先加入至少一條指令。","agents.toggleOnHint":"從檔案中移除 Foundry 指令。","agents.toggleOffHint":"將 Foundry 指令寫入此檔案。","agents.emptyAssigned":"將指令拖到這裡","agents.loadingInstruction":"正在載入指令…","agents.openFileAria":"開啟 {{name}} 的指令檔案","agents.reapplyAria":"重新寫入 {{name}} 的指令","agents.toggleAria":"將指令套用到 {{name}}","agents.removeInstructionAria":"從此 Agent 移除 {{name}}","common.retry":"重試","settings.downloadSkill":"下載 Skill","settings.skillTargets":"安裝目標","settings.aboutFoundrySkill":"關於 Foundry Skill","settings.foundrySkillHint":"下載 Foundry Skill,讓 Agent 瞭解如何透過 Foundry CLI 操作 Foundry。","settings.downloadSkillDescription":"選擇用於安裝 Foundry Agent Skill 的使用者目錄,已有副本將被替換。","settings.skillDownloaded":"Skill 已安裝。","settings.errors.downloadSkill":"無法下載 Skill,請重試。","settings.errors.skillTargets":"無法載入 Skill 目標路徑,請重試。","settings.downloadingSkill":"下載中…","timeZone.losAngeles":"洛杉磯","timeZone.newYork":"紐約","timeZone.shanghai":"上海","timeZone.taipei":"臺北","timeZone.tokyo":"東京","timeZone.utc":"協調世界時(UTC)","dataImport.title":"匯入資料","dataImport.passphrase":"備份密碼","dataImport.replaceAction":"覆蓋並匯入","dataImport.replaceWarning":"匯入會以備份替換本機設定、Instructions、Skills 和 Agent 設定,不會合併現有資料。匯入後選擇套用設定,才會更新本機 Agent 檔案和連結。","dataImport.applyTitle":"匯入完成,是否套用 Agent 設定?","dataImport.applyDescription":"套用後,將依匯入的設定更新本機 Agent 的 Instructions 和 Skill 連結。選擇不套用將清空 Foundry 中的 Agent 設定,保留本機現有 Agent 檔案和連結。","dataImport.skipAgents":"不套用","dataImport.applyAgents":"套用設定","dataImport.changed":"Agent 設定在本次匯入後已變更。請關閉對話框,重新載入目前資料。","dataImport.applyError":"資料已匯入,但無法套用 Agent 設定。請檢查檔案存取權限與 Skill 目標位置衝突後重試。","dataImport.error":"無法匯入資料,請重試。","dataImport.invalidBackup":"備份無效或不受支援。","dataImport.invalidPassphrase":"密碼不正確或備份已損壞。","nav.settings":"設定","settings.workspace":"工作區","settings.appearance":"外觀","settings.appearanceAria":"外觀設定","settings.languageRegion":"語言與地區","settings.languageRegionAria":"語言與地區設定","settings.advanced":"進階","settings.advancedAria":"進階設定","settings.export":"匯出","dataExport.title":"匯出資料","dataExport.action":"匯出","dataExport.description":"下載目前 Foundry 資料的加密備份。","dataExport.passphrase":"密碼","dataExport.confirmPassphrase":"確認密碼","dataExport.passphraseHint":"請保留此密碼,匯入備份時需要使用。密碼無法復原。","dataExport.passphraseMismatch":"兩次輸入的密碼不一致。","dataExport.exporting":"匯出中…","dataExport.exported":"已開始下載資料備份。","dataExport.error":"無法匯出資料,請重試。","common.cancel":"取消","settings.import":"匯入","settings.configFolder":"設定資料夾","settings.openFolder":"開啟","settings.copyConfigFolder":"複製設定資料夾路徑","settings.configFolderCopied":"已複製設定資料夾路徑","settings.errors.copyConfigFolder":"無法複製設定資料夾路徑。","settings.errors.openConfigFolder":"無法開啟設定資料夾。","settings.language":"語言","settings.timeFormat":"時間格式","settings.timeZone":"時區","settings.colorTheme":"色彩主題","settings.navigation":"設定導覽","settings.openNavigation":"開啟設定導覽","settings.errors.load":"無法載入設定。","settings.errors.theme":"無法更新色彩主題。","settings.errors.language":"無法更新語言。","settings.errors.timeFormat":"無法更新時間格式。","settings.errors.timeZone":"無法更新時區。","common.system":"跟隨系統","theme.light":"淺色","theme.dark":"深色","statusBar.foundry":"Foundry","statusBar.foundryVersion":"Foundry v{{version}}","statusBar.skill":"Skill","statusBar.skillStatus":"Foundry Skill 狀態","statusBar.skillChecking":"正在檢查 Skill…","statusBar.skillUnavailable":"無法取得 Skill 狀態","statusBar.skillRefreshHint":"複製下方指令到終端機執行,或前往 <settings>進階設定</settings> 重新下載 Skill。","statusBar.copyCommand":"複製指令","statusBar.terminal":"終端機","statusBar.targetAgents":"ChatGPT","statusBar.targetClaude":"Claude Code","statusBar.statusMissing":"未安裝","statusBar.statusOutdated":"與目前 Foundry 版本不一致","statusBar.statusCurrent":"已是最新","a11y.breadcrumb":"麵包屑導覽","a11y.goBack":"返回","a11y.close":"關閉","a11y.showPassword":"顯示密碼","a11y.hidePassword":"隱藏密碼","a11y.sidebar":"側邊欄","a11y.sidebarDescription":"顯示行動版側邊欄。","a11y.toggleSidebar":"切換側邊欄"},RK={"skills.invalidEntryName":"スラッシュを含まない有効なファイル名またはフォルダー名を入力してください。","skills.newEntry":"新規","skills.newFile":"新規ファイル","skills.newFolder":"新規フォルダー","skills.fileActions":"{{path}} の操作","skills.fileConflict":"同じ名前のファイルまたはフォルダーが存在します。","skills.fileOperationError":"スキルファイルを更新できませんでした。もう一度お試しください。","skills.deleteEntryDescription":"<entryPath>{{path}}</entryPath> とその内容を削除します。スキルを保存すると削除が反映されます。","skills.createEntryDescription":"{{path}} に作成します。ファイルまたはフォルダーの名前を入力してください。","skills.entryName":"名前","skills.fileWorking":"処理中…","skills.createEntry":"作成","skills.fileNotEditable":"バイナリファイル、または編集上限の 2 MiB を超えています。","skills.fileLoadError":"ファイルを読み込めませんでした。","editor.loading":"エディターを読み込み中…","skills.saveContent":"保存","skills.contentSaving":"保存中…","skills.contentSaved":"内容を保存しました。","skills.contentSaveError":"内容を保存できませんでした。もう一度お試しください。","skills.unsavedChanges":"未保存の変更","skills.allChangesSaved":"すべて保存済み","skills.contentPlaceholder":"Markdown でスキルの指示を記述します。","skills.fileEditor":"{{file}} を編集","skills.leaveTitle":"未保存の変更を破棄しますか?","skills.leaveDescription":"変更はまだ保存されていません。保存するか、変更を破棄して続行してください。","skills.keepEditing":"編集を続ける","skills.discardChanges":"変更を破棄","skills.overview":"概要","skills.files":"ファイル","skills.fileNavigation":"スキルファイル","skills.selectAria":"{{name}} を選択","skills.selectAll":"すべて選択","skills.deselectAll":"すべての選択を解除","skills.batch":"一括操作","skills.batchAssigned":"スキルの割り当てを更新しました。","skills.batchAssignPartial":"{{completed}} 件成功、{{failed}} 件失敗しました。再試行して完了してください。","skills.unassign":"割り当て解除","skills.assign":"割り当て","skills.assignTitle":"{{name}} の割り当て","skills.assignDialogTitle":"<skillName>{{name}}</skillName> の割り当て","skills.assignDescription":"エージェントを選択するとスキルへのリンクを作成し、選択を解除するとリンクを削除します。変更はすぐに反映されます。","skills.assignAgentAria":"{{name}} を {{agent}} に割り当て","skills.assignmentError":"スキルの割り当てを更新できませんでした。もう一度お試しください。","skills.noAgents":"利用可能なエージェントがありません。","skills.linkConflict":"エージェントのスキルフォルダーに別の同名項目があります。競合を解消して再試行してください。","skills.edit":"編集","skills.editTitle":"スキルを編集","skills.editDescription":"名前と説明を更新します。このスキルが割り当てられているエージェントにも変更が反映されます。","skills.saveChanges":"変更を保存","skills.updating":"保存中…","skills.updated":"スキルを更新しました。","skills.updateError":"スキルを更新できません。再試行してください。","skills.delete":"削除","skills.deleted":"スキルを削除しました。","skills.deleteError":"スキルを削除できません。再試行してください。","skills.deleteConfirmTitle":"スキルを削除","skills.deleteConfirmDescription":"<skillName>{{name}}</skillName> とフォルダー内のすべてのファイルが完全に削除されます。割り当て済みのエージェントからもスキルが削除されます。","skills.actionsAria":"{{name}} の操作","nav.dashboard":"ダッシュボード","nav.library":"ライブラリ","nav.skills":"スキル","skills.name":"名前","skills.namePlaceholder":"例:knowledge-wiki","skills.nameHint":"スキルライブラリ内で一意の名前にしてください。1〜64 文字の Unicode 文字または数字を使用し、大文字・小文字がある場合は小文字にしてください。単語は単一のハイフンで区切れます。","skills.description":"説明","skills.descriptionPlaceholder":"エージェントがこのスキルを使う場面を説明してください。","skills.create":"スキルを作成","skills.creating":"作成中…","skills.created":"スキルを作成しました。","skills.createError":"スキルを作成できませんでした。もう一度お試しください。","skills.nameConflict":"同じ名前のスキルが存在します。別の名前を指定してください。","skills.loadError":"スキルを読み込めませんでした。もう一度お試しください。","skills.emptyTitle":"スキルはまだありません","skills.emptyDescription":"スキルを作成してライブラリを構築しましょう。","skills.notFound":"スキルが見つかりません","skills.backToSkills":"スキル一覧に戻る","skills.content":"内容","skills.noContent":"内容はまだありません","skills.new":"新規スキル","skills.createManually":"手動で作成","skills.createManuallyDescription":"空の SKILL.md から始めます。","skills.importLocal":"ローカルからインポート","skills.importLocalDescription":"スキルフォルダーまたは .skill / .zip アーカイブを1つ選択します。","skills.importing":"インポート中…","skills.importSummary":"{{imported}} 個のスキルをインポートし、{{skipped}} 件をスキップしました。","skills.importSkippedInvalid":"無効なスキルフォルダーです。","skills.importSkippedConflict":"同名のスキルが存在します。","filePicker.selecting":"選択中…","filePicker.error":"ファイル選択ダイアログを開けませんでした。もう一度お試しください。","filePicker.unavailable":"このコンピューターではネイティブファイル選択を利用できません。","filePicker.busy":"ファイル選択ダイアログが既に開いています。","skills.importReadError":"選択したパスを読み取れません。存在とアクセス権を確認してください。","skills.importInvalid":"スキルの形式が無効です。","skills.importInvalidSource":"スキルフォルダーまたは .skill / .zip アーカイブを1つ選択してください。","skills.importSymlinkSource":"シンボリックリンクのスキルソースはインポートできません。元のスキルフォルダーまたはアーカイブを選択してください。","skills.importMissingSkillMd":"選択したスキルのルートに SKILL.md が必要です。","skills.importInvalidMetadata":"SKILL.md は UTF-8 の Markdown で、YAML に有効な name と description が必要です。","skills.importInvalidPath":"スキルに安全でない、または競合するファイルパスがあります。","skills.importDuplicatePath":"スキルに重複したファイルパスがあります。","skills.importInvalidEncoding":"スキルにエンコーディングが無効なファイルがあります。","skills.importUnsupportedEntries":"スキルにシンボリックリンクまたは未対応の項目があります。","skills.importTooManyEntries":"スキルに含められる項目は最大 5,000 件です。","skills.importSkillMdTooLarge":"SKILL.md は 2 MiB 以下にしてください。","skills.importInvalidArchive":"選択した .skill または .zip アーカイブが無効です。","skills.importNoSkills":"選択したソースにスキルフォルダーがありません。","skills.importTooLarge":"スキルの合計サイズは 32 MiB 以下にしてください。","skills.importNameConflict":"同じ名前のスキルが既に存在します。既存のスキルは上書きされません。","skills.importError":"スキルをインポートできませんでした。もう一度お試しください。","skills.importUrl":"URL からインポート","skills.importUrlDescription":"URL から公開済みのスキルを取得します。","skills.url":"URL","skills.importSubmit":"インポート","skills.importUrlHint":".skill、.zip、または SKILL.md の直接リンクを入力してください。","skills.importInvalidUrl":"認証情報を含まない HTTP または HTTPS URL を入力してください。","skills.importUnsupportedUrlFile":".skill、.zip、または SKILL.md の直接リンクを使用してください。フォルダーや HTML ページには対応していません。","skills.importDownloadFailed":"ダウンロードできませんでした。URL を確認して再試行してください。","skills.importDownloadTimeout":"ダウンロードがタイムアウトしました。再試行するか、ローカルからインポートしてください。","nav.instructions":"指示","nav.models":"モデル","nav.genesis":"ジェネシス","nav.explorer":"エクスプローラー","nav.quantum":"クォンタム","instructions.create":"新しい指示","instructions.createTitle":"新しい指示","instructions.name":"名前","instructions.namePlaceholder":"例:コードレビューチェックリスト","instructions.content":"内容","instructions.contentPlaceholder":"Markdown の指示を入力。内容は Markdown 形式で保存されます。","instructions.save":"指示を作成","instructions.creating":"作成中…","instructions.created":"指示を作成しました。","instructions.error":"指示を作成できませんでした。もう一度お試しください。","instructions.editTitle":"指示を編集","instructions.updateSave":"変更を保存","instructions.updating":"保存中…","instructions.updated":"指示を更新しました。有効な Agent は再書き込みすると新しい内容が反映されます。","instructions.updateError":"指示を更新できませんでした。もう一度お試しください。","instructions.edit":"編集","instructions.delete":"削除","instructions.deleted":"指示を削除しました。","instructions.deleteError":"指示を削除できませんでした。もう一度お試しください。","instructions.deleteConfirmTitle":"指示を削除しますか?","instructions.deleteConfirmDescription":"「{{name}}」はライブラリとすべての Agent から削除されます。この操作は取り消せません。","instructions.dragHint":"指示を Agent にドラッグ","instructions.listAria":"指示一覧","instructions.actionsAria":"{{name}} の操作","instructions.emptyTitle":"指示はまだありません","instructions.emptyDescription":"ページ右上の「新しい指示」から最初の指示を作成してください。","instructions.loadError":"指示を読み込めませんでした。もう一度お試しください。","agents.title":"Agents","agents.orderHint":"順序が指示の結合順になります","agents.loadError":"Agent を読み込めませんでした。もう一度お試しください。","agents.updateError":"Agent の指示を更新できませんでした。","agents.enableError":"Agent を更新できませんでした。","agents.reapplyError":"Agent の指示を再書き込みできませんでした。","agents.reapplyHint":"管理対象の指示ブロックを再生成します。","agents.reapplyDisabledHint":"再書き込みするには指示を有効にしてください。","agents.openFileError":"指示ファイルを開けませんでした。","agents.fileMissing":"指示ファイルはまだ存在しません。","agents.duplicateError":"この指示はすでに Agent に追加されています。","agents.applied":"指示を書き込みました。","agents.removed":"Foundry の指示を削除しました。","agents.reapplied":"指示を再書き込みしました。","agents.enableRequiresInstruction":"先に指示を 1 つ以上追加してください。","agents.toggleOnHint":"このファイルから Foundry の指示を削除します。","agents.toggleOffHint":"Foundry の指示をこのファイルに書き込みます。","agents.emptyAssigned":"ここに指示をドラッグ","agents.loadingInstruction":"指示を読み込み中…","agents.openFileAria":"{{name}} の指示ファイルを開く","agents.reapplyAria":"{{name}} の指示を再書き込み","agents.toggleAria":"{{name}} に指示を適用","agents.removeInstructionAria":"この Agent から {{name}} を削除","common.retry":"再試行","settings.downloadSkill":"Skill をダウンロード","settings.skillTargets":"インストール先","settings.aboutFoundrySkill":"Foundry Skill について","settings.foundrySkillHint":"Foundry Skill をダウンロードして、Agent に Foundry CLI を使った Foundry の操作方法を伝えます。","settings.downloadSkillDescription":"Foundry Agent Skill のインストール先を選択します。既存のコピーは置き換えられます。","settings.skillDownloaded":"Skill をインストールしました。","settings.errors.downloadSkill":"Skill をダウンロードできません。再試行してください。","settings.errors.skillTargets":"Skill の保存先を取得できません。再試行してください。","settings.downloadingSkill":"ダウンロード中…","timeZone.losAngeles":"ロサンゼルス","timeZone.newYork":"ニューヨーク","timeZone.shanghai":"上海","timeZone.taipei":"台北","timeZone.tokyo":"東京","timeZone.utc":"協定世界時(UTC)","dataImport.title":"データをインポート","dataImport.passphrase":"バックアップのパスフレーズ","dataImport.replaceAction":"上書きしてインポート","dataImport.replaceWarning":"バックアップでローカルの設定、Instructions、Skills、Agent 設定を置き換えます。既存データとの結合は行われません。Agent のファイルとリンクは、インポート後に適用を選んだ場合にのみ更新されます。","dataImport.applyTitle":"インポート完了。Agent 設定を適用しますか?","dataImport.applyDescription":"インポートした設定で、このマシンの Agent の Instructions と Skill リンクを更新します。適用しない場合は Foundry の Agent 設定を空にし、既存の Agent ファイルとリンクを保持します。","dataImport.skipAgents":"適用しない","dataImport.applyAgents":"設定を適用","dataImport.changed":"インポート後に Agent 設定が変更されました。このダイアログを閉じて現在のデータを再読み込みしてください。","dataImport.applyError":"データはインポートされましたが、Agent 設定を適用できませんでした。ファイルへのアクセス権限と Skill の配置先の競合を確認して再試行してください。","dataImport.error":"データをインポートできませんでした。もう一度お試しください。","dataImport.invalidBackup":"バックアップが無効または未対応です。","dataImport.invalidPassphrase":"パスフレーズが違うか、バックアップが破損しています。","nav.settings":"設定","settings.workspace":"ワークスペース","settings.appearance":"外観","settings.appearanceAria":"外観設定","settings.languageRegion":"言語と地域","settings.languageRegionAria":"言語と地域の設定","settings.advanced":"詳細設定","settings.advancedAria":"詳細設定","settings.export":"エクスポート","dataExport.title":"データをエクスポート","dataExport.action":"エクスポート","dataExport.description":"Foundry のデータを暗号化したバックアップとしてダウンロードします。","dataExport.passphrase":"パスフレーズ","dataExport.confirmPassphrase":"パスフレーズの確認","dataExport.passphraseHint":"インポート時に必要なため、このパスフレーズを保管してください。復元はできません。","dataExport.passphraseMismatch":"パスフレーズが一致しません。","dataExport.exporting":"エクスポート中…","dataExport.exported":"バックアップのダウンロードを開始しました。","dataExport.error":"データをエクスポートできませんでした。もう一度お試しください。","common.cancel":"キャンセル","settings.import":"インポート","settings.configFolder":"設定フォルダー","settings.openFolder":"開く","settings.copyConfigFolder":"設定フォルダーのパスをコピー","settings.configFolderCopied":"設定フォルダーのパスをコピーしました","settings.errors.copyConfigFolder":"設定フォルダーのパスをコピーできませんでした。","settings.errors.openConfigFolder":"設定フォルダーを開けませんでした。","settings.language":"言語","settings.timeFormat":"時刻形式","settings.timeZone":"タイムゾーン","settings.colorTheme":"カラーテーマ","settings.navigation":"設定ナビゲーション","settings.openNavigation":"設定ナビゲーションを開く","settings.errors.load":"設定を読み込めませんでした。","settings.errors.theme":"カラーテーマを更新できませんでした。","settings.errors.language":"言語を更新できませんでした。","settings.errors.timeFormat":"時刻形式を更新できませんでした。","settings.errors.timeZone":"タイムゾーンを更新できませんでした。","common.system":"システム","theme.light":"ライト","theme.dark":"ダーク","statusBar.foundry":"Foundry","statusBar.foundryVersion":"Foundry v{{version}}","statusBar.skill":"Skill","statusBar.skillStatus":"Foundry Skill の状態","statusBar.skillChecking":"Skill を確認中…","statusBar.skillUnavailable":"Skill の状態を取得できません","statusBar.skillRefreshHint":"下のコマンドをターミナルで実行するか、<settings>詳細設定</settings> に移動して Skill を再ダウンロードしてください。","statusBar.copyCommand":"コマンドをコピー","statusBar.terminal":"ターミナル","statusBar.targetAgents":"ChatGPT","statusBar.targetClaude":"Claude Code","statusBar.statusMissing":"未インストール","statusBar.statusOutdated":"同梱の Skill と一致しません","statusBar.statusCurrent":"最新です","a11y.breadcrumb":"パンくずリスト","a11y.goBack":"戻る","a11y.close":"閉じる","a11y.showPassword":"パスワードを表示","a11y.hidePassword":"パスワードを非表示","a11y.sidebar":"サイドバー","a11y.sidebarDescription":"モバイル用サイドバーを表示します。","a11y.toggleSidebar":"サイドバーを切り替える"},CK={"en-US":{translation:SK},"zh-CN":{translation:wK},"zh-TW":{translation:EK},"ja-JP":{translation:RK}};function TK({value:e,onValueChange:t,disabled:s=!1}){const{t:i}=pt(),o=[{value:"system",label:i("common.system")},...FM.map(l=>({value:l,label:xK[l]}))];return v.jsx(Za,{label:i("settings.language"),children:v.jsxs(sx,{items:o,value:e,onValueChange:l=>{l&&t(l)},disabled:s,children:[v.jsx(ax,{"aria-label":i("settings.language"),className:"w-52",children:v.jsx(ix,{})}),v.jsx(ox,{children:o.map(l=>v.jsx(lx,{value:l.value,children:l.label},l.value))})]})})}const VR=mB.map(e=>({value:e,label:e}));function kK({value:e,onValueChange:t,disabled:s=!1}){const{t:i}=pt();return v.jsx(Za,{label:i("settings.timeFormat"),children:v.jsxs(sx,{items:VR,value:e,onValueChange:o=>{o&&t(o)},disabled:s,children:[v.jsx(ax,{"aria-label":i("settings.timeFormat"),className:"w-52",children:v.jsx(ix,{})}),v.jsx(ox,{children:VR.map(o=>v.jsx(lx,{value:o.value,children:o.label},o.value))})]})})}const OK={"America/Los_Angeles":"timeZone.losAngeles","America/New_York":"timeZone.newYork","Asia/Shanghai":"timeZone.shanghai","Asia/Taipei":"timeZone.taipei","Asia/Tokyo":"timeZone.tokyo",UTC:"timeZone.utc"};function AK({value:e,onValueChange:t,disabled:s=!1}){const{t:i}=pt(),o=yB.map(l=>({value:l,label:i(OK[l])}));return v.jsx(Za,{label:i("settings.timeZone"),children:v.jsxs(sx,{items:o,value:e,onValueChange:l=>{l&&t(l)},disabled:s,children:[v.jsx(ax,{"aria-label":i("settings.timeZone"),className:"w-52",children:v.jsx(ix,{})}),v.jsx(ox,{children:o.map(l=>v.jsx(lx,{value:l.value,children:l.label},l.value))})]})})}const Ia=["settings"],zh=["settings","update"];function cx(){const{t:e}=pt(),t=Nr(),s=rg({mutationKey:zh})>0,i=na({queryKey:Ia,queryFn:({signal:h})=>Jz(h),staleTime:1/0,retry:!1}),o=er({mutationKey:zh,mutationFn:Wz,onMutate:async h=>{await t.cancelQueries({queryKey:Ia});const x=t.getQueryData(Ia);return x&&t.setQueryData(Ia,MK(x,h)),{previous:x}},onSuccess:h=>{t.setQueryData(Ia,h)},onError:(h,x,S)=>{S?.previous&&t.setQueryData(Ia,S.previous),Kt.error(e(NK(x)))},onSettled:()=>t.invalidateQueries({queryKey:Ia})}),l=i.data??null,u=l?.workspace.appearance["color-theme"]??"system",d=l?.workspace["language-region"].language??"system",f=l?.workspace["language-region"]["time-format"]??"YYYY-MM-DD HH:mm:ss",g=l?.workspace["language-region"]["time-zone"]??"America/Los_Angeles";function m(h){!l||t.isMutating({mutationKey:zh})>0||o.mutate(h)}return{settings:l,theme:u,language:d,timeFormat:f,timeZone:g,isLoading:i.isPending,isUpdating:s,setTheme:h=>{h!==u&&m({theme:h})},setLanguage:h=>{h!==d&&m({language:h})},setTimeFormat:h=>{h!==f&&m({timeFormat:h})},setTimeZone:h=>{h!==g&&m({timezone:h})}}}function MK(e,t){const s=e.workspace,i=s["language-region"];return{...e,workspace:{appearance:{"color-theme":t.theme??s.appearance["color-theme"]},"language-region":{language:t.language??i.language,"time-format":t.timeFormat??i["time-format"],"time-zone":t.timezone??i["time-zone"]}}}}function NK(e){return e.theme!==void 0?"settings.errors.theme":e.language!==void 0?"settings.errors.language":e.timeFormat!==void 0?"settings.errors.timeFormat":"settings.errors.timeZone"}const Oo=[{id:"appearance",labelKey:"settings.appearance",ariaKey:"settings.appearanceAria",icon:TL},{id:"language-region",labelKey:"settings.languageRegion",ariaKey:"settings.languageRegionAria",icon:bL},{id:"advanced",labelKey:"settings.advanced",ariaKey:"settings.advancedAria",icon:ak}];function DK(){const{t:e}=pt(),[t,s]=D8(),i=Oo.find(({id:k})=>k===t.get("panel"))?.id??Oo[0].id,o=k=>{s(O=>{const A=new URLSearchParams(O);return A.set("panel",k),A})},{settings:l,theme:u,language:d,timeFormat:f,timeZone:g,isLoading:m,isUpdating:h,setTheme:x,setLanguage:S,setTimeFormat:w,setTimeZone:C}=cx(),E=Oo.find(k=>k.id===i)?.ariaKey??"settings.appearanceAria",R=Oo.find(k=>k.id===i)?.labelKey??"settings.appearance";return v.jsxs("div",{className:`
241
+ grid h-full min-h-0 grid-cols-[260px_minmax(0,1fr)]
242
+ max-[680px]:grid-cols-1
243
+ `,children:[v.jsx("aside",{className:`
244
+ hidden min-h-0 overflow-y-auto p-4
245
+ min-[680px]:block
246
+ `,children:v.jsx(jK,{activeSection:i,onSectionChange:o})}),v.jsxs("section",{"aria-label":e(E),className:"min-h-0 overflow-y-auto p-4",children:[v.jsxs("div",{className:`
247
+ mb-3 flex items-center gap-3
248
+ min-[680px]:hidden
249
+ `,children:[v.jsxs(Vo,{children:[v.jsx(Ko,{render:v.jsx(nt,{type:"button",variant:"outline",size:"icon","aria-label":e("settings.openNavigation")}),children:v.jsx(RL,{})}),v.jsx(qo,{side:"bottom",align:"start",sideOffset:8,"aria-label":e("settings.navigation"),className:"w-56",children:v.jsxs(oA,{children:[v.jsx(lA,{children:e("settings.workspace")}),v.jsx(iH,{value:i,onValueChange:k=>{const O=Oo.find(({id:A})=>A===k);O&&o(O.id)},children:Oo.map(({id:k,labelKey:O,icon:A})=>v.jsxs(aH,{value:k,closeOnClick:!0,children:[v.jsx(A,{}),e(O)]},k))})]})})]}),v.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:e(R)})]}),v.jsxs(Gi,{className:"gap-0 py-0",children:[m&&v.jsxs("div",{className:`
250
+ flex flex-col items-start gap-3 p-4
251
+ min-[680px]:min-h-16 min-[680px]:flex-row
252
+ min-[680px]:items-center min-[680px]:justify-between
253
+ min-[680px]:gap-8
254
+ `,children:[v.jsx(fr,{className:"h-4 w-24"}),v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsx(fr,{className:"h-4 w-16"}),v.jsx(fr,{className:"h-4 w-10"}),v.jsx(fr,{className:"h-4 w-10"})]})]}),!m&&i==="appearance"&&v.jsx(_V,{value:u,onValueChange:k=>{x(k)},disabled:h||!l}),!m&&i==="language-region"&&v.jsxs("div",{className:"divide-y",children:[v.jsx(TK,{value:d,onValueChange:k=>{S(k)},disabled:h||!l}),v.jsx(AK,{value:g,onValueChange:k=>{C(k)},disabled:h||!l}),v.jsx(kK,{value:f,onValueChange:k=>{w(k)},disabled:h||!l})]}),!m&&i==="advanced"&&v.jsxs("div",{className:"divide-y",children:[v.jsx(wV,{disabled:h||!l}),v.jsx(TV,{disabled:h||!l}),v.jsx(uV,{configFolder:l?.configFolder}),v.jsx(fV,{disabled:h||!l})]})]})]})]})}function jK({activeSection:e,onSectionChange:t}){const{t:s}=pt();return v.jsx("nav",{"aria-label":s("settings.navigation"),children:v.jsxs(Gi,{size:"sm",children:[v.jsx(p9,{children:v.jsx("h2",{className:"text-xs font-medium text-muted-foreground",children:s("settings.workspace")})}),v.jsx(g9,{className:"flex flex-col gap-1",children:Oo.map(({id:i,labelKey:o,icon:l})=>{const u=i===e;return v.jsxs(nt,{type:"button",variant:u?"secondary":"ghost","aria-current":u?"page":void 0,onClick:()=>{t(i)},className:"w-full justify-start gap-2",children:[v.jsx(l,{className:u?void 0:"text-muted-foreground"}),v.jsx("span",{children:s(o)})]},i)})})]})})}pr.use(w5).init({resources:CK,lng:BM(),fallbackLng:"en-US",supportedLngs:[...FM],keySeparator:!1,interpolation:{escapeValue:!1},react:{useSuspense:!1}});function BM(){const e=new Intl.DateTimeFormat().resolvedOptions().locale.toLowerCase();return e.startsWith("zh-tw")||e.startsWith("zh-hk")||e.startsWith("zh-mo")||e.startsWith("zh-hant")?"zh-TW":e.startsWith("zh")?"zh-CN":e.startsWith("ja")?"ja-JP":"en-US"}function IK(){const e=Nr();b.useEffect(()=>{const t=new EventSource("/api/events"),s=()=>{e.invalidateQueries({queryKey:Ia,refetchType:e.isMutating({mutationKey:zh})>0?"none":"active"})},i=o=>{try{const l=JSON.parse(o.data);typeof l=="object"&&l!==null&&"version"in l&&l.version===vB&&"type"in l&&l.type===bB&&s()}catch{}};return t.addEventListener("open",s),t.addEventListener("foundry",i),()=>{t.removeEventListener("open",s),t.removeEventListener("foundry",i),t.close()}},[e])}const xv=matchMedia("(prefers-color-scheme: dark)");function PK(e){return xv.addEventListener("change",e),()=>xv.removeEventListener("change",e)}function LK(){return xv.matches?"dark":"light"}function zK({children:e}){IK();const{theme:t,language:s}=cx(),i=b.useSyncExternalStore(PK,LK),o=t==="system"?i:t,l=s==="system"?BM():s;return b.useLayoutEffect(()=>{const u=document.documentElement;u.classList.toggle("dark",o==="dark"),u.style.colorScheme=o},[o]),b.useLayoutEffect(()=>{pr.changeLanguage(l),document.documentElement.lang=l},[l]),e}const _K=new _z({queryCache:new qk({onError:(e,t)=>{t.queryKey[0]==="skill-targets"?Kt.error(pr.t("settings.errors.skillTargets")):t.queryKey[0]==="settings"&&Kt.error(pr.t("settings.errors.load"))}})});function UK(){return null}function HK(e){switch(e){case"/library/instructions":return v.jsx(iB,{});case"/library/skills":return v.jsx(tV,{});default:return v.jsx(UK,{})}}const FK=T8([{element:v.jsx(vF,{}),children:[...oF.map(e=>({path:e,element:HK(e)})),{path:"/library/skills/:name",element:v.jsx(cV,{})}]},{element:v.jsx(bF,{}),children:[{path:"/settings",element:v.jsx(DK,{}),handle:{backTo:"/dashboard"}}]},{path:"*",element:v.jsx(e8,{to:"/dashboard",replace:!0})}]);function BK(){return v.jsx(hz,{client:_K,children:v.jsx(bP,{children:v.jsx(zK,{children:v.jsx(VK,{})})})})}function VK(){const{theme:e}=cx();return v.jsxs(v.Fragment,{children:[v.jsx(U8,{router:FK}),v.jsx(l_,{}),v.jsx(NL,{theme:e,position:"top-center"})]})}kj.createRoot(document.getElementById("root")).render(v.jsx(b.StrictMode,{children:v.jsx(BK,{})}));export{Ne as W,W9 as _,v as j,b as r,pt as u};