(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))u(o);new MutationObserver(o=>{for(const f of o)if(f.type==="childList")for(const g of f.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&u(g)}).observe(document,{childList:!0,subtree:!0});function a(o){const f={};return o.integrity&&(f.integrity=o.integrity),o.referrerPolicy&&(f.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?f.credentials="include":o.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function u(o){if(o.ep)return;o.ep=!0;const f=a(o);fetch(o.href,f)}})();function Oh(d){return d&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d}var no={exports:{}},ca={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ch;function Km(){if(ch)return ca;ch=1;var d=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(u,o,f){var g=null;if(f!==void 0&&(g=""+f),o.key!==void 0&&(g=""+o.key),"key"in o){f={};for(var m in o)m!=="key"&&(f[m]=o[m])}else f=o;return o=f.ref,{$$typeof:d,type:u,key:g,ref:o!==void 0?o:null,props:f}}return ca.Fragment=n,ca.jsx=a,ca.jsxs=a,ca}var fh;function Jm(){return fh||(fh=1,no.exports=Km()),no.exports}var h=Jm(),ao={exports:{}},xt={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var dh;function Wm(){if(dh)return xt;dh=1;var d=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),g=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),C=Symbol.iterator;function Z(b){return b===null||typeof b!="object"?null:(b=C&&b[C]||b["@@iterator"],typeof b=="function"?b:null)}var $={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},J=Object.assign,ot={};function at(b,j,Y){this.props=b,this.context=j,this.refs=ot,this.updater=Y||$}at.prototype.isReactComponent={},at.prototype.setState=function(b,j){if(typeof b!="object"&&typeof b!="function"&&b!=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,b,j,"setState")},at.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};function Et(){}Et.prototype=at.prototype;function X(b,j,Y){this.props=b,this.context=j,this.refs=ot,this.updater=Y||$}var st=X.prototype=new Et;st.constructor=X,J(st,at.prototype),st.isPureReactComponent=!0;var yt=Array.isArray;function H(){}var k={H:null,A:null,T:null,S:null},et=Object.prototype.hasOwnProperty;function dt(b,j,Y){var W=Y.ref;return{$$typeof:d,type:b,key:j,ref:W!==void 0?W:null,props:Y}}function At(b,j){return dt(b.type,j,b.props)}function Q(b){return typeof b=="object"&&b!==null&&b.$$typeof===d}function nt(b){var j={"=":"=0",":":"=2"};return"$"+b.replace(/[=:]/g,function(Y){return j[Y]})}var bt=/\/+/g;function mt(b,j){return typeof b=="object"&&b!==null&&b.key!=null?nt(""+b.key):j.toString(36)}function Ut(b){switch(b.status){case"fulfilled":return b.value;case"rejected":throw b.reason;default:switch(typeof b.status=="string"?b.then(H,H):(b.status="pending",b.then(function(j){b.status==="pending"&&(b.status="fulfilled",b.value=j)},function(j){b.status==="pending"&&(b.status="rejected",b.reason=j)})),b.status){case"fulfilled":return b.value;case"rejected":throw b.reason}}throw b}function R(b,j,Y,W,K){var it=typeof b;(it==="undefined"||it==="boolean")&&(b=null);var St=!1;if(b===null)St=!0;else switch(it){case"bigint":case"string":case"number":St=!0;break;case"object":switch(b.$$typeof){case d:case n:St=!0;break;case x:return St=b._init,R(St(b._payload),j,Y,W,K)}}if(St)return K=K(b),St=W===""?"."+mt(b,0):W,yt(K)?(Y="",St!=null&&(Y=St.replace(bt,"$&/")+"/"),R(K,j,Y,"",function(Al){return Al})):K!=null&&(Q(K)&&(K=At(K,Y+(K.key==null||b&&b.key===K.key?"":(""+K.key).replace(bt,"$&/")+"/")+St)),j.push(K)),1;St=0;var Qt=W===""?".":W+":";if(yt(b))for(var vt=0;vt<b.length;vt++)W=b[vt],it=Qt+mt(W,vt),St+=R(W,j,Y,it,K);else if(vt=Z(b),typeof vt=="function")for(b=vt.call(b),vt=0;!(W=b.next()).done;)W=W.value,it=Qt+mt(W,vt++),St+=R(W,j,Y,it,K);else if(it==="object"){if(typeof b.then=="function")return R(Ut(b),j,Y,W,K);throw j=String(b),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(b).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.")}return St}function V(b,j,Y){if(b==null)return b;var W=[],K=0;return R(b,W,"","",function(it){return j.call(Y,it,K++)}),W}function P(b){if(b._status===-1){var j=b._result;j=j(),j.then(function(Y){(b._status===0||b._status===-1)&&(b._status=1,b._result=Y)},function(Y){(b._status===0||b._status===-1)&&(b._status=2,b._result=Y)}),b._status===-1&&(b._status=0,b._result=j)}if(b._status===1)return b._result.default;throw b._result}var q=typeof reportError=="function"?reportError:function(b){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var j=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof b=="object"&&b!==null&&typeof b.message=="string"?String(b.message):String(b),error:b});if(!window.dispatchEvent(j))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",b);return}console.error(b)},rt={map:V,forEach:function(b,j,Y){V(b,function(){j.apply(this,arguments)},Y)},count:function(b){var j=0;return V(b,function(){j++}),j},toArray:function(b){return V(b,function(j){return j})||[]},only:function(b){if(!Q(b))throw Error("React.Children.only expected to receive a single React element child.");return b}};return xt.Activity=v,xt.Children=rt,xt.Component=at,xt.Fragment=a,xt.Profiler=o,xt.PureComponent=X,xt.StrictMode=u,xt.Suspense=S,xt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,xt.__COMPILER_RUNTIME={__proto__:null,c:function(b){return k.H.useMemoCache(b)}},xt.cache=function(b){return function(){return b.apply(null,arguments)}},xt.cacheSignal=function(){return null},xt.cloneElement=function(b,j,Y){if(b==null)throw Error("The argument must be a React element, but you passed "+b+".");var W=J({},b.props),K=b.key;if(j!=null)for(it in j.key!==void 0&&(K=""+j.key),j)!et.call(j,it)||it==="key"||it==="__self"||it==="__source"||it==="ref"&&j.ref===void 0||(W[it]=j[it]);var it=arguments.length-2;if(it===1)W.children=Y;else if(1<it){for(var St=Array(it),Qt=0;Qt<it;Qt++)St[Qt]=arguments[Qt+2];W.children=St}return dt(b.type,K,W)},xt.createContext=function(b){return b={$$typeof:g,_currentValue:b,_currentValue2:b,_threadCount:0,Provider:null,Consumer:null},b.Provider=b,b.Consumer={$$typeof:f,_context:b},b},xt.createElement=function(b,j,Y){var W,K={},it=null;if(j!=null)for(W in j.key!==void 0&&(it=""+j.key),j)et.call(j,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(K[W]=j[W]);var St=arguments.length-2;if(St===1)K.children=Y;else if(1<St){for(var Qt=Array(St),vt=0;vt<St;vt++)Qt[vt]=arguments[vt+2];K.children=Qt}if(b&&b.defaultProps)for(W in St=b.defaultProps,St)K[W]===void 0&&(K[W]=St[W]);return dt(b,it,K)},xt.createRef=function(){return{current:null}},xt.forwardRef=function(b){return{$$typeof:m,render:b}},xt.isValidElement=Q,xt.lazy=function(b){return{$$typeof:x,_payload:{_status:-1,_result:b},_init:P}},xt.memo=function(b,j){return{$$typeof:y,type:b,compare:j===void 0?null:j}},xt.startTransition=function(b){var j=k.T,Y={};k.T=Y;try{var W=b(),K=k.S;K!==null&&K(Y,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(H,q)}catch(it){q(it)}finally{j!==null&&Y.types!==null&&(j.types=Y.types),k.T=j}},xt.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()},xt.use=function(b){return k.H.use(b)},xt.useActionState=function(b,j,Y){return k.H.useActionState(b,j,Y)},xt.useCallback=function(b,j){return k.H.useCallback(b,j)},xt.useContext=function(b){return k.H.useContext(b)},xt.useDebugValue=function(){},xt.useDeferredValue=function(b,j){return k.H.useDeferredValue(b,j)},xt.useEffect=function(b,j){return k.H.useEffect(b,j)},xt.useEffectEvent=function(b){return k.H.useEffectEvent(b)},xt.useId=function(){return k.H.useId()},xt.useImperativeHandle=function(b,j,Y){return k.H.useImperativeHandle(b,j,Y)},xt.useInsertionEffect=function(b,j){return k.H.useInsertionEffect(b,j)},xt.useLayoutEffect=function(b,j){return k.H.useLayoutEffect(b,j)},xt.useMemo=function(b,j){return k.H.useMemo(b,j)},xt.useOptimistic=function(b,j){return k.H.useOptimistic(b,j)},xt.useReducer=function(b,j,Y){return k.H.useReducer(b,j,Y)},xt.useRef=function(b){return k.H.useRef(b)},xt.useState=function(b){return k.H.useState(b)},xt.useSyncExternalStore=function(b,j,Y){return k.H.useSyncExternalStore(b,j,Y)},xt.useTransition=function(){return k.H.useTransition()},xt.version="19.2.4",xt}var hh;function po(){return hh||(hh=1,ao.exports=Wm()),ao.exports}var N=po();const $m=Oh(N);var so={exports:{}},fa={},ro={exports:{}},uo={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var gh;function Fm(){return gh||(gh=1,(function(d){function n(R,V){var P=R.length;R.push(V);t:for(;0<P;){var q=P-1>>>1,rt=R[q];if(0<o(rt,V))R[q]=V,R[P]=rt,P=q;else break t}}function a(R){return R.length===0?null:R[0]}function u(R){if(R.length===0)return null;var V=R[0],P=R.pop();if(P!==V){R[0]=P;t:for(var q=0,rt=R.length,b=rt>>>1;q<b;){var j=2*(q+1)-1,Y=R[j],W=j+1,K=R[W];if(0>o(Y,P))W<rt&&0>o(K,Y)?(R[q]=K,R[W]=P,q=W):(R[q]=Y,R[j]=P,q=j);else if(W<rt&&0>o(K,P))R[q]=K,R[W]=P,q=W;else break t}}return V}function o(R,V){var P=R.sortIndex-V.sortIndex;return P!==0?P:R.id-V.id}if(d.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;d.unstable_now=function(){return f.now()}}else{var g=Date,m=g.now();d.unstable_now=function(){return g.now()-m}}var S=[],y=[],x=1,v=null,C=3,Z=!1,$=!1,J=!1,ot=!1,at=typeof setTimeout=="function"?setTimeout:null,Et=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function st(R){for(var V=a(y);V!==null;){if(V.callback===null)u(y);else if(V.startTime<=R)u(y),V.sortIndex=V.expirationTime,n(S,V);else break;V=a(y)}}function yt(R){if(J=!1,st(R),!$)if(a(S)!==null)$=!0,H||(H=!0,nt());else{var V=a(y);V!==null&&Ut(yt,V.startTime-R)}}var H=!1,k=-1,et=5,dt=-1;function At(){return ot?!0:!(d.unstable_now()-dt<et)}function Q(){if(ot=!1,H){var R=d.unstable_now();dt=R;var V=!0;try{t:{$=!1,J&&(J=!1,Et(k),k=-1),Z=!0;var P=C;try{e:{for(st(R),v=a(S);v!==null&&!(v.expirationTime>R&&At());){var q=v.callback;if(typeof q=="function"){v.callback=null,C=v.priorityLevel;var rt=q(v.expirationTime<=R);if(R=d.unstable_now(),typeof rt=="function"){v.callback=rt,st(R),V=!0;break e}v===a(S)&&u(S),st(R)}else u(S);v=a(S)}if(v!==null)V=!0;else{var b=a(y);b!==null&&Ut(yt,b.startTime-R),V=!1}}break t}finally{v=null,C=P,Z=!1}V=void 0}}finally{V?nt():H=!1}}}var nt;if(typeof X=="function")nt=function(){X(Q)};else if(typeof MessageChannel<"u"){var bt=new MessageChannel,mt=bt.port2;bt.port1.onmessage=Q,nt=function(){mt.postMessage(null)}}else nt=function(){at(Q,0)};function Ut(R,V){k=at(function(){R(d.unstable_now())},V)}d.unstable_IdlePriority=5,d.unstable_ImmediatePriority=1,d.unstable_LowPriority=4,d.unstable_NormalPriority=3,d.unstable_Profiling=null,d.unstable_UserBlockingPriority=2,d.unstable_cancelCallback=function(R){R.callback=null},d.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):et=0<R?Math.floor(1e3/R):5},d.unstable_getCurrentPriorityLevel=function(){return C},d.unstable_next=function(R){switch(C){case 1:case 2:case 3:var V=3;break;default:V=C}var P=C;C=V;try{return R()}finally{C=P}},d.unstable_requestPaint=function(){ot=!0},d.unstable_runWithPriority=function(R,V){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var P=C;C=R;try{return V()}finally{C=P}},d.unstable_scheduleCallback=function(R,V,P){var q=d.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?q+P:q):P=q,R){case 1:var rt=-1;break;case 2:rt=250;break;case 5:rt=1073741823;break;case 4:rt=1e4;break;default:rt=5e3}return rt=P+rt,R={id:x++,callback:V,priorityLevel:R,startTime:P,expirationTime:rt,sortIndex:-1},P>q?(R.sortIndex=P,n(y,R),a(S)===null&&R===a(y)&&(J?(Et(k),k=-1):J=!0,Ut(yt,P-q))):(R.sortIndex=rt,n(S,R),$||Z||($=!0,H||(H=!0,nt()))),R},d.unstable_shouldYield=At,d.unstable_wrapCallback=function(R){var V=C;return function(){var P=C;C=V;try{return R.apply(this,arguments)}finally{C=P}}}})(uo)),uo}var mh;function Im(){return mh||(mh=1,ro.exports=Fm()),ro.exports}var oo={exports:{}},me={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ph;function Pm(){if(ph)return me;ph=1;var d=po();function n(S){var y="https://react.dev/errors/"+S;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)y+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+S+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var u={d:{f:a,r:function(){throw Error(n(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},o=Symbol.for("react.portal");function f(S,y,x){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:v==null?null:""+v,children:S,containerInfo:y,implementation:x}}var g=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(S,y){if(S==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return me.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,me.createPortal=function(S,y){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(n(299));return f(S,y,null,x)},me.flushSync=function(S){var y=g.T,x=u.p;try{if(g.T=null,u.p=2,S)return S()}finally{g.T=y,u.p=x,u.d.f()}},me.preconnect=function(S,y){typeof S=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,u.d.C(S,y))},me.prefetchDNS=function(S){typeof S=="string"&&u.d.D(S)},me.preinit=function(S,y){if(typeof S=="string"&&y&&typeof y.as=="string"){var x=y.as,v=m(x,y.crossOrigin),C=typeof y.integrity=="string"?y.integrity:void 0,Z=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;x==="style"?u.d.S(S,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:v,integrity:C,fetchPriority:Z}):x==="script"&&u.d.X(S,{crossOrigin:v,integrity:C,fetchPriority:Z,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},me.preinitModule=function(S,y){if(typeof S=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var x=m(y.as,y.crossOrigin);u.d.M(S,{crossOrigin:x,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&u.d.M(S)},me.preload=function(S,y){if(typeof S=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var x=y.as,v=m(x,y.crossOrigin);u.d.L(S,x,{crossOrigin:v,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},me.preloadModule=function(S,y){if(typeof S=="string")if(y){var x=m(y.as,y.crossOrigin);u.d.m(S,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:x,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else u.d.m(S)},me.requestFormReset=function(S){u.d.r(S)},me.unstable_batchedUpdates=function(S,y){return S(y)},me.useFormState=function(S,y,x){return g.H.useFormState(S,y,x)},me.useFormStatus=function(){return g.H.useHostTransitionStatus()},me.version="19.2.4",me}var yh;function Nh(){if(yh)return oo.exports;yh=1;function d(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(d)}catch(n){console.error(n)}}return d(),oo.exports=Pm(),oo.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var vh;function tp(){if(vh)return fa;vh=1;var d=Im(),n=po(),a=Nh();function u(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)e+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function f(t){var e=t,l=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(l=e.return),t=e.return;while(t)}return e.tag===3?l:null}function g(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function m(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function S(t){if(f(t)!==t)throw Error(u(188))}function y(t){var e=t.alternate;if(!e){if(e=f(t),e===null)throw Error(u(188));return e!==t?null:t}for(var l=t,i=e;;){var s=l.return;if(s===null)break;var r=s.alternate;if(r===null){if(i=s.return,i!==null){l=i;continue}break}if(s.child===r.child){for(r=s.child;r;){if(r===l)return S(s),t;if(r===i)return S(s),e;r=r.sibling}throw Error(u(188))}if(l.return!==i.return)l=s,i=r;else{for(var c=!1,p=s.child;p;){if(p===l){c=!0,l=s,i=r;break}if(p===i){c=!0,i=s,l=r;break}p=p.sibling}if(!c){for(p=r.child;p;){if(p===l){c=!0,l=r,i=s;break}if(p===i){c=!0,i=r,l=s;break}p=p.sibling}if(!c)throw Error(u(189))}}if(l.alternate!==i)throw Error(u(190))}if(l.tag!==3)throw Error(u(188));return l.stateNode.current===l?t:e}function x(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=x(t),e!==null)return e;t=t.sibling}return null}var v=Object.assign,C=Symbol.for("react.element"),Z=Symbol.for("react.transitional.element"),$=Symbol.for("react.portal"),J=Symbol.for("react.fragment"),ot=Symbol.for("react.strict_mode"),at=Symbol.for("react.profiler"),Et=Symbol.for("react.consumer"),X=Symbol.for("react.context"),st=Symbol.for("react.forward_ref"),yt=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),et=Symbol.for("react.lazy"),dt=Symbol.for("react.activity"),At=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function nt(t){return t===null||typeof t!="object"?null:(t=Q&&t[Q]||t["@@iterator"],typeof t=="function"?t:null)}var bt=Symbol.for("react.client.reference");function mt(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===bt?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case J:return"Fragment";case at:return"Profiler";case ot:return"StrictMode";case yt:return"Suspense";case H:return"SuspenseList";case dt:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case $:return"Portal";case X:return t.displayName||"Context";case Et:return(t._context.displayName||"Context")+".Consumer";case st:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case k:return e=t.displayName||null,e!==null?e:mt(t.type)||"Memo";case et:e=t._payload,t=t._init;try{return mt(t(e))}catch{}}return null}var Ut=Array.isArray,R=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},q=[],rt=-1;function b(t){return{current:t}}function j(t){0>rt||(t.current=q[rt],q[rt]=null,rt--)}function Y(t,e){rt++,q[rt]=t.current,t.current=e}var W=b(null),K=b(null),it=b(null),St=b(null);function Qt(t,e){switch(Y(it,e),Y(K,t),Y(W,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?Od(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=Od(e),t=Nd(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}j(W),Y(W,t)}function vt(){j(W),j(K),j(it)}function Al(t){t.memoizedState!==null&&Y(St,t);var e=W.current,l=Nd(e,t.type);e!==l&&(Y(K,t),Y(W,l))}function Ie(t){K.current===t&&(j(W),j(K)),St.current===t&&(j(St),sa._currentValue=P)}var bi,mn;function Pe(t){if(bi===void 0)try{throw Error()}catch(l){var e=l.stack.trim().match(/\n( *(at )?)/);bi=e&&e[1]||"",mn=-1<l.stack.indexOf(`
    at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
`+bi+t+mn}var Si=!1;function Ei(t,e){if(!t||Si)return"";Si=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(e){var B=function(){throw Error()};if(Object.defineProperty(B.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(B,[])}catch(O){var A=O}Reflect.construct(t,[],B)}else{try{B.call()}catch(O){A=O}t.call(B.prototype)}}else{try{throw Error()}catch(O){A=O}(B=t())&&typeof B.catch=="function"&&B.catch(function(){})}}catch(O){if(O&&A&&typeof O.stack=="string")return[O.stack,A.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=i.DetermineComponentFrameRoot(),c=r[0],p=r[1];if(c&&p){var E=c.split(`
`),M=p.split(`
`);for(s=i=0;i<E.length&&!E[i].includes("DetermineComponentFrameRoot");)i++;for(;s<M.length&&!M[s].includes("DetermineComponentFrameRoot");)s++;if(i===E.length||s===M.length)for(i=E.length-1,s=M.length-1;1<=i&&0<=s&&E[i]!==M[s];)s--;for(;1<=i&&0<=s;i--,s--)if(E[i]!==M[s]){if(i!==1||s!==1)do if(i--,s--,0>s||E[i]!==M[s]){var L=`
`+E[i].replace(" at new "," at ");return t.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",t.displayName)),L}while(1<=i&&0<=s);break}}}finally{Si=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?Pe(l):""}function ga(t,e){switch(t.tag){case 26:case 27:case 5:return Pe(t.type);case 16:return Pe("Lazy");case 13:return t.child!==e&&e!==null?Pe("Suspense Fallback"):Pe("Suspense");case 19:return Pe("SuspenseList");case 0:case 15:return Ei(t.type,!1);case 11:return Ei(t.type.render,!1);case 1:return Ei(t.type,!0);case 31:return Pe("Activity");default:return""}}function pn(t){try{var e="",l=null;do e+=ga(t,l),l=t,t=t.return;while(t);return e}catch(i){return`
Error generating stack: `+i.message+`
`+i.stack}}var _i=Object.prototype.hasOwnProperty,zi=d.unstable_scheduleCallback,Ci=d.unstable_cancelCallback,ma=d.unstable_shouldYield,pa=d.unstable_requestPaint,he=d.unstable_now,ve=d.unstable_getCurrentPriorityLevel,rl=d.unstable_ImmediatePriority,qt=d.unstable_UserBlockingPriority,Ft=d.unstable_NormalPriority,yn=d.unstable_LowPriority,ya=d.unstable_IdlePriority,Zs=d.log,vn=d.unstable_setDisableYieldValue,li=null,ge=null;function tl(t){if(typeof Zs=="function"&&vn(t),ge&&typeof ge.setStrictMode=="function")try{ge.setStrictMode(li,t)}catch{}}var ae=Math.clz32?Math.clz32:Ws,Ks=Math.log,Js=Math.LN2;function Ws(t){return t>>>=0,t===0?32:31-(Ks(t)/Js|0)|0}var Ti=256,Ri=262144,wi=4194304;function el(t){var e=t&42;if(e!==0)return e;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Mi(t,e,l){var i=t.pendingLanes;if(i===0)return 0;var s=0,r=t.suspendedLanes,c=t.pingedLanes;t=t.warmLanes;var p=i&134217727;return p!==0?(i=p&~r,i!==0?s=el(i):(c&=p,c!==0?s=el(c):l||(l=p&~t,l!==0&&(s=el(l))))):(p=i&~r,p!==0?s=el(p):c!==0?s=el(c):l||(l=i&~t,l!==0&&(s=el(l)))),s===0?0:e!==0&&e!==s&&(e&r)===0&&(r=s&-s,l=e&-e,r>=l||r===32&&(l&4194048)!==0)?e:s}function Ve(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function xn(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+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 e+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 bn(){var t=wi;return wi<<=1,(wi&62914560)===0&&(wi=4194304),t}function Sn(t){for(var e=[],l=0;31>l;l++)e.push(t);return e}function ii(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function $s(t,e,l,i,s,r){var c=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var p=t.entanglements,E=t.expirationTimes,M=t.hiddenUpdates;for(l=c&~l;0<l;){var L=31-ae(l),B=1<<L;p[L]=0,E[L]=-1;var A=M[L];if(A!==null)for(M[L]=null,L=0;L<A.length;L++){var O=A[L];O!==null&&(O.lane&=-536870913)}l&=~B}i!==0&&va(t,i,0),r!==0&&s===0&&t.tag!==0&&(t.suspendedLanes|=r&~(c&~e))}function va(t,e,l){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-ae(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|l&261930}function xa(t,e){var l=t.entangledLanes|=e;for(t=t.entanglements;l;){var i=31-ae(l),s=1<<i;s&e|t[i]&e&&(t[i]|=e),l&=~s}}function ba(t,e){var l=e&-e;return l=(l&42)!==0?1:Ai(l),(l&(t.suspendedLanes|e))!==0?0:l}function Ai(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function ji(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Sa(){var t=V.p;return t!==0?t:(t=window.event,t===void 0?32:ih(t.type))}function Ea(t,e){var l=V.p;try{return V.p=t,e()}finally{V.p=l}}var Ze=Math.random().toString(36).slice(2),Jt="__reactFiber$"+Ze,se="__reactProps$"+Ze,jl="__reactContainer$"+Ze,En="__reactEvents$"+Ze,Ke="__reactListeners$"+Ze,_="__reactHandles$"+Ze,G="__reactResources$"+Ze,F="__reactMarker$"+Ze;function I(t){delete t[Jt],delete t[se],delete t[En],delete t[Ke],delete t[_]}function pt(t){var e=t[Jt];if(e)return e;for(var l=t.parentNode;l;){if(e=l[jl]||l[Jt]){if(l=e.alternate,e.child!==null||l!==null&&l.child!==null)for(t=qd(t);t!==null;){if(l=t[Jt])return l;t=qd(t)}return e}t=l,l=t.parentNode}return null}function gt(t){if(t=t[Jt]||t[jl]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function It(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(u(33))}function Nt(t){var e=t[G];return e||(e=t[G]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function Yt(t){t[F]=!0}var ll=new Set,ul={};function ol(t,e){Dl(t,e),Dl(t+"Capture",e)}function Dl(t,e){for(ul[t]=e,t=0;t<e.length;t++)ll.add(e[t])}var Bh=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]*$"),Eo={},_o={};function kh(t){return _i.call(_o,t)?!0:_i.call(Eo,t)?!1:Bh.test(t)?_o[t]=!0:(Eo[t]=!0,!1)}function _a(t,e,l){if(kh(e))if(l===null)t.removeAttribute(e);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+l)}}function za(t,e,l){if(l===null)t.removeAttribute(e);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+l)}}function cl(t,e,l,i){if(i===null)t.removeAttribute(l);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(e,l,""+i)}}function Ne(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function zo(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Gh(t,e,l){var i=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var s=i.get,r=i.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return s.call(this)},set:function(c){l=""+c,r.call(this,c)}}),Object.defineProperty(t,e,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(c){l=""+c},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Fs(t){if(!t._valueTracker){var e=zo(t)?"checked":"value";t._valueTracker=Gh(t,e,""+t[e])}}function Co(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var l=e.getValue(),i="";return t&&(i=zo(t)?t.checked?"true":"false":t.value),t=i,t!==l?(e.setValue(t),!0):!1}function Ca(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var qh=/[\n"\\]/g;function He(t){return t.replace(qh,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Is(t,e,l,i,s,r,c,p){t.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?t.type=c:t.removeAttribute("type"),e!=null?c==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+Ne(e)):t.value!==""+Ne(e)&&(t.value=""+Ne(e)):c!=="submit"&&c!=="reset"||t.removeAttribute("value"),e!=null?Ps(t,c,Ne(e)):l!=null?Ps(t,c,Ne(l)):i!=null&&t.removeAttribute("value"),s==null&&r!=null&&(t.defaultChecked=!!r),s!=null&&(t.checked=s&&typeof s!="function"&&typeof s!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?t.name=""+Ne(p):t.removeAttribute("name")}function To(t,e,l,i,s,r,c,p){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(t.type=r),e!=null||l!=null){if(!(r!=="submit"&&r!=="reset"||e!=null)){Fs(t);return}l=l!=null?""+Ne(l):"",e=e!=null?""+Ne(e):l,p||e===t.value||(t.value=e),t.defaultValue=e}i=i??s,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=p?t.checked:!!i,t.defaultChecked=!!i,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(t.name=c),Fs(t)}function Ps(t,e,l){e==="number"&&Ca(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function Di(t,e,l,i){if(t=t.options,e){e={};for(var s=0;s<l.length;s++)e["$"+l[s]]=!0;for(l=0;l<t.length;l++)s=e.hasOwnProperty("$"+t[l].value),t[l].selected!==s&&(t[l].selected=s),s&&i&&(t[l].defaultSelected=!0)}else{for(l=""+Ne(l),e=null,s=0;s<t.length;s++){if(t[s].value===l){t[s].selected=!0,i&&(t[s].defaultSelected=!0);return}e!==null||t[s].disabled||(e=t[s])}e!==null&&(e.selected=!0)}}function Ro(t,e,l){if(e!=null&&(e=""+Ne(e),e!==t.value&&(t.value=e),l==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=l!=null?""+Ne(l):""}function wo(t,e,l,i){if(e==null){if(i!=null){if(l!=null)throw Error(u(92));if(Ut(i)){if(1<i.length)throw Error(u(93));i=i[0]}l=i}l==null&&(l=""),e=l}l=Ne(e),t.defaultValue=l,i=t.textContent,i===l&&i!==""&&i!==null&&(t.value=i),Fs(t)}function Oi(t,e){if(e){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=e;return}}t.textContent=e}var Yh=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 Mo(t,e,l){var i=e.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?i?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":i?t.setProperty(e,l):typeof l!="number"||l===0||Yh.has(e)?e==="float"?t.cssFloat=l:t[e]=(""+l).trim():t[e]=l+"px"}function Ao(t,e,l){if(e!=null&&typeof e!="object")throw Error(u(62));if(t=t.style,l!=null){for(var i in l)!l.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var s in e)i=e[s],e.hasOwnProperty(s)&&l[s]!==i&&Mo(t,s,i)}else for(var r in e)e.hasOwnProperty(r)&&Mo(t,r,e[r])}function tr(t){if(t.indexOf("-")===-1)return!1;switch(t){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 Xh=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Qh=/^[\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 Ta(t){return Qh.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function fl(){}var er=null;function lr(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ni=null,Hi=null;function jo(t){var e=gt(t);if(e&&(t=e.stateNode)){var l=t[se]||null;t:switch(t=e.stateNode,e.type){case"input":if(Is(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),e=l.name,l.type==="radio"&&e!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+He(""+e)+'"][type="radio"]'),e=0;e<l.length;e++){var i=l[e];if(i!==t&&i.form===t.form){var s=i[se]||null;if(!s)throw Error(u(90));Is(i,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(e=0;e<l.length;e++)i=l[e],i.form===t.form&&Co(i)}break t;case"textarea":Ro(t,l.value,l.defaultValue);break t;case"select":e=l.value,e!=null&&Di(t,!!l.multiple,e,!1)}}}var ir=!1;function Do(t,e,l){if(ir)return t(e,l);ir=!0;try{var i=t(e);return i}finally{if(ir=!1,(Ni!==null||Hi!==null)&&(hs(),Ni&&(e=Ni,t=Hi,Hi=Ni=null,jo(e),t)))for(e=0;e<t.length;e++)jo(t[e])}}function _n(t,e){var l=t.stateNode;if(l===null)return null;var i=l[se]||null;if(i===null)return null;l=i[e];t:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break t;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(u(231,e,typeof l));return l}var dl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),nr=!1;if(dl)try{var zn={};Object.defineProperty(zn,"passive",{get:function(){nr=!0}}),window.addEventListener("test",zn,zn),window.removeEventListener("test",zn,zn)}catch{nr=!1}var Ol=null,ar=null,Ra=null;function Oo(){if(Ra)return Ra;var t,e=ar,l=e.length,i,s="value"in Ol?Ol.value:Ol.textContent,r=s.length;for(t=0;t<l&&e[t]===s[t];t++);var c=l-t;for(i=1;i<=c&&e[l-i]===s[r-i];i++);return Ra=s.slice(t,1<i?1-i:void 0)}function wa(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Ma(){return!0}function No(){return!1}function xe(t){function e(l,i,s,r,c){this._reactName=l,this._targetInst=s,this.type=i,this.nativeEvent=r,this.target=c,this.currentTarget=null;for(var p in t)t.hasOwnProperty(p)&&(l=t[p],this[p]=l?l(r):r[p]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?Ma:No,this.isPropagationStopped=No,this}return v(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ma)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ma)},persist:function(){},isPersistent:Ma}),e}var ni={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Aa=xe(ni),Cn=v({},ni,{view:0,detail:0}),Vh=xe(Cn),sr,rr,Tn,ja=v({},Cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:or,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Tn&&(Tn&&t.type==="mousemove"?(sr=t.screenX-Tn.screenX,rr=t.screenY-Tn.screenY):rr=sr=0,Tn=t),sr)},movementY:function(t){return"movementY"in t?t.movementY:rr}}),Ho=xe(ja),Zh=v({},ja,{dataTransfer:0}),Kh=xe(Zh),Jh=v({},Cn,{relatedTarget:0}),ur=xe(Jh),Wh=v({},ni,{animationName:0,elapsedTime:0,pseudoElement:0}),$h=xe(Wh),Fh=v({},ni,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Ih=xe(Fh),Ph=v({},ni,{data:0}),Lo=xe(Ph),tg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},eg={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"},lg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ig(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=lg[t])?!!e[t]:!1}function or(){return ig}var ng=v({},Cn,{key:function(t){if(t.key){var e=tg[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=wa(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?eg[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:or,charCode:function(t){return t.type==="keypress"?wa(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?wa(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),ag=xe(ng),sg=v({},ja,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Uo=xe(sg),rg=v({},Cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:or}),ug=xe(rg),og=v({},ni,{propertyName:0,elapsedTime:0,pseudoElement:0}),cg=xe(og),fg=v({},ja,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),dg=xe(fg),hg=v({},ni,{newState:0,oldState:0}),gg=xe(hg),mg=[9,13,27,32],cr=dl&&"CompositionEvent"in window,Rn=null;dl&&"documentMode"in document&&(Rn=document.documentMode);var pg=dl&&"TextEvent"in window&&!Rn,Bo=dl&&(!cr||Rn&&8<Rn&&11>=Rn),ko=" ",Go=!1;function qo(t,e){switch(t){case"keyup":return mg.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yo(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Li=!1;function yg(t,e){switch(t){case"compositionend":return Yo(e);case"keypress":return e.which!==32?null:(Go=!0,ko);case"textInput":return t=e.data,t===ko&&Go?null:t;default:return null}}function vg(t,e){if(Li)return t==="compositionend"||!cr&&qo(t,e)?(t=Oo(),Ra=ar=Ol=null,Li=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Bo&&e.locale!=="ko"?null:e.data;default:return null}}var xg={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 Xo(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!xg[t.type]:e==="textarea"}function Qo(t,e,l,i){Ni?Hi?Hi.push(i):Hi=[i]:Ni=i,e=bs(e,"onChange"),0<e.length&&(l=new Aa("onChange","change",null,l,i),t.push({event:l,listeners:e}))}var wn=null,Mn=null;function bg(t){Rd(t,0)}function Da(t){var e=It(t);if(Co(e))return t}function Vo(t,e){if(t==="change")return e}var Zo=!1;if(dl){var fr;if(dl){var dr="oninput"in document;if(!dr){var Ko=document.createElement("div");Ko.setAttribute("oninput","return;"),dr=typeof Ko.oninput=="function"}fr=dr}else fr=!1;Zo=fr&&(!document.documentMode||9<document.documentMode)}function Jo(){wn&&(wn.detachEvent("onpropertychange",Wo),Mn=wn=null)}function Wo(t){if(t.propertyName==="value"&&Da(Mn)){var e=[];Qo(e,Mn,t,lr(t)),Do(bg,e)}}function Sg(t,e,l){t==="focusin"?(Jo(),wn=e,Mn=l,wn.attachEvent("onpropertychange",Wo)):t==="focusout"&&Jo()}function Eg(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Da(Mn)}function _g(t,e){if(t==="click")return Da(e)}function zg(t,e){if(t==="input"||t==="change")return Da(e)}function Cg(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Ce=typeof Object.is=="function"?Object.is:Cg;function An(t,e){if(Ce(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var l=Object.keys(t),i=Object.keys(e);if(l.length!==i.length)return!1;for(i=0;i<l.length;i++){var s=l[i];if(!_i.call(e,s)||!Ce(t[s],e[s]))return!1}return!0}function $o(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Fo(t,e){var l=$o(t);t=0;for(var i;l;){if(l.nodeType===3){if(i=t+l.textContent.length,t<=e&&i>=e)return{node:l,offset:e-t};t=i}t:{for(;l;){if(l.nextSibling){l=l.nextSibling;break t}l=l.parentNode}l=void 0}l=$o(l)}}function Io(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Io(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Po(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Ca(t.document);e instanceof t.HTMLIFrameElement;){try{var l=typeof e.contentWindow.location.href=="string"}catch{l=!1}if(l)t=e.contentWindow;else break;e=Ca(t.document)}return e}function hr(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var Tg=dl&&"documentMode"in document&&11>=document.documentMode,Ui=null,gr=null,jn=null,mr=!1;function tc(t,e,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;mr||Ui==null||Ui!==Ca(i)||(i=Ui,"selectionStart"in i&&hr(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),jn&&An(jn,i)||(jn=i,i=bs(gr,"onSelect"),0<i.length&&(e=new Aa("onSelect","select",null,e,l),t.push({event:e,listeners:i}),e.target=Ui)))}function ai(t,e){var l={};return l[t.toLowerCase()]=e.toLowerCase(),l["Webkit"+t]="webkit"+e,l["Moz"+t]="moz"+e,l}var Bi={animationend:ai("Animation","AnimationEnd"),animationiteration:ai("Animation","AnimationIteration"),animationstart:ai("Animation","AnimationStart"),transitionrun:ai("Transition","TransitionRun"),transitionstart:ai("Transition","TransitionStart"),transitioncancel:ai("Transition","TransitionCancel"),transitionend:ai("Transition","TransitionEnd")},pr={},ec={};dl&&(ec=document.createElement("div").style,"AnimationEvent"in window||(delete Bi.animationend.animation,delete Bi.animationiteration.animation,delete Bi.animationstart.animation),"TransitionEvent"in window||delete Bi.transitionend.transition);function si(t){if(pr[t])return pr[t];if(!Bi[t])return t;var e=Bi[t],l;for(l in e)if(e.hasOwnProperty(l)&&l in ec)return pr[t]=e[l];return t}var lc=si("animationend"),ic=si("animationiteration"),nc=si("animationstart"),Rg=si("transitionrun"),wg=si("transitionstart"),Mg=si("transitioncancel"),ac=si("transitionend"),sc=new Map,yr="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");yr.push("scrollEnd");function Je(t,e){sc.set(t,e),ol(e,[t])}var Oa=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Le=[],ki=0,vr=0;function Na(){for(var t=ki,e=vr=ki=0;e<t;){var l=Le[e];Le[e++]=null;var i=Le[e];Le[e++]=null;var s=Le[e];Le[e++]=null;var r=Le[e];if(Le[e++]=null,i!==null&&s!==null){var c=i.pending;c===null?s.next=s:(s.next=c.next,c.next=s),i.pending=s}r!==0&&rc(l,s,r)}}function Ha(t,e,l,i){Le[ki++]=t,Le[ki++]=e,Le[ki++]=l,Le[ki++]=i,vr|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function xr(t,e,l,i){return Ha(t,e,l,i),La(t)}function ri(t,e){return Ha(t,null,null,e),La(t)}function rc(t,e,l){t.lanes|=l;var i=t.alternate;i!==null&&(i.lanes|=l);for(var s=!1,r=t.return;r!==null;)r.childLanes|=l,i=r.alternate,i!==null&&(i.childLanes|=l),r.tag===22&&(t=r.stateNode,t===null||t._visibility&1||(s=!0)),t=r,r=r.return;return t.tag===3?(r=t.stateNode,s&&e!==null&&(s=31-ae(l),t=r.hiddenUpdates,i=t[s],i===null?t[s]=[e]:i.push(e),e.lane=l|536870912),r):null}function La(t){if(50<Pn)throw Pn=0,wu=null,Error(u(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Gi={};function Ag(t,e,l,i){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Te(t,e,l,i){return new Ag(t,e,l,i)}function br(t){return t=t.prototype,!(!t||!t.isReactComponent)}function hl(t,e){var l=t.alternate;return l===null?(l=Te(t.tag,e,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=e,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,e=t.dependencies,l.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function uc(t,e){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,e=l.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function Ua(t,e,l,i,s,r){var c=0;if(i=t,typeof t=="function")br(t)&&(c=1);else if(typeof t=="string")c=Hm(t,l,W.current)?26:t==="html"||t==="head"||t==="body"?27:5;else t:switch(t){case dt:return t=Te(31,l,e,s),t.elementType=dt,t.lanes=r,t;case J:return ui(l.children,s,r,e);case ot:c=8,s|=24;break;case at:return t=Te(12,l,e,s|2),t.elementType=at,t.lanes=r,t;case yt:return t=Te(13,l,e,s),t.elementType=yt,t.lanes=r,t;case H:return t=Te(19,l,e,s),t.elementType=H,t.lanes=r,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case X:c=10;break t;case Et:c=9;break t;case st:c=11;break t;case k:c=14;break t;case et:c=16,i=null;break t}c=29,l=Error(u(130,t===null?"null":typeof t,"")),i=null}return e=Te(c,l,e,s),e.elementType=t,e.type=i,e.lanes=r,e}function ui(t,e,l,i){return t=Te(7,t,i,e),t.lanes=l,t}function Sr(t,e,l){return t=Te(6,t,null,e),t.lanes=l,t}function oc(t){var e=Te(18,null,null,0);return e.stateNode=t,e}function Er(t,e,l){return e=Te(4,t.children!==null?t.children:[],t.key,e),e.lanes=l,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var cc=new WeakMap;function Ue(t,e){if(typeof t=="object"&&t!==null){var l=cc.get(t);return l!==void 0?l:(e={value:t,source:e,stack:pn(e)},cc.set(t,e),e)}return{value:t,source:e,stack:pn(e)}}var qi=[],Yi=0,Ba=null,Dn=0,Be=[],ke=0,Nl=null,il=1,nl="";function gl(t,e){qi[Yi++]=Dn,qi[Yi++]=Ba,Ba=t,Dn=e}function fc(t,e,l){Be[ke++]=il,Be[ke++]=nl,Be[ke++]=Nl,Nl=t;var i=il;t=nl;var s=32-ae(i)-1;i&=~(1<<s),l+=1;var r=32-ae(e)+s;if(30<r){var c=s-s%5;r=(i&(1<<c)-1).toString(32),i>>=c,s-=c,il=1<<32-ae(e)+s|l<<s|i,nl=r+t}else il=1<<r|l<<s|i,nl=t}function _r(t){t.return!==null&&(gl(t,1),fc(t,1,0))}function zr(t){for(;t===Ba;)Ba=qi[--Yi],qi[Yi]=null,Dn=qi[--Yi],qi[Yi]=null;for(;t===Nl;)Nl=Be[--ke],Be[ke]=null,nl=Be[--ke],Be[ke]=null,il=Be[--ke],Be[ke]=null}function dc(t,e){Be[ke++]=il,Be[ke++]=nl,Be[ke++]=Nl,il=e.id,nl=e.overflow,Nl=t}var oe=null,Vt=null,Mt=!1,Hl=null,Ge=!1,Cr=Error(u(519));function Ll(t){var e=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw On(Ue(e,t)),Cr}function hc(t){var e=t.stateNode,l=t.type,i=t.memoizedProps;switch(e[Jt]=t,e[se]=i,l){case"dialog":Tt("cancel",e),Tt("close",e);break;case"iframe":case"object":case"embed":Tt("load",e);break;case"video":case"audio":for(l=0;l<ea.length;l++)Tt(ea[l],e);break;case"source":Tt("error",e);break;case"img":case"image":case"link":Tt("error",e),Tt("load",e);break;case"details":Tt("toggle",e);break;case"input":Tt("invalid",e),To(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Tt("invalid",e);break;case"textarea":Tt("invalid",e),wo(e,i.value,i.defaultValue,i.children)}l=i.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||e.textContent===""+l||i.suppressHydrationWarning===!0||jd(e.textContent,l)?(i.popover!=null&&(Tt("beforetoggle",e),Tt("toggle",e)),i.onScroll!=null&&Tt("scroll",e),i.onScrollEnd!=null&&Tt("scrollend",e),i.onClick!=null&&(e.onclick=fl),e=!0):e=!1,e||Ll(t,!0)}function gc(t){for(oe=t.return;oe;)switch(oe.tag){case 5:case 31:case 13:Ge=!1;return;case 27:case 3:Ge=!0;return;default:oe=oe.return}}function Xi(t){if(t!==oe)return!1;if(!Mt)return gc(t),Mt=!0,!1;var e=t.tag,l;if((l=e!==3&&e!==27)&&((l=e===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||Xu(t.type,t.memoizedProps)),l=!l),l&&Vt&&Ll(t),gc(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(u(317));Vt=Gd(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(u(317));Vt=Gd(t)}else e===27?(e=Vt,$l(t.type)?(t=Ju,Ju=null,Vt=t):Vt=e):Vt=oe?Ye(t.stateNode.nextSibling):null;return!0}function oi(){Vt=oe=null,Mt=!1}function Tr(){var t=Hl;return t!==null&&(_e===null?_e=t:_e.push.apply(_e,t),Hl=null),t}function On(t){Hl===null?Hl=[t]:Hl.push(t)}var Rr=b(null),ci=null,ml=null;function Ul(t,e,l){Y(Rr,e._currentValue),e._currentValue=l}function pl(t){t._currentValue=Rr.current,j(Rr)}function wr(t,e,l){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===l)break;t=t.return}}function Mr(t,e,l,i){var s=t.child;for(s!==null&&(s.return=t);s!==null;){var r=s.dependencies;if(r!==null){var c=s.child;r=r.firstContext;t:for(;r!==null;){var p=r;r=s;for(var E=0;E<e.length;E++)if(p.context===e[E]){r.lanes|=l,p=r.alternate,p!==null&&(p.lanes|=l),wr(r.return,l,t),i||(c=null);break t}r=p.next}}else if(s.tag===18){if(c=s.return,c===null)throw Error(u(341));c.lanes|=l,r=c.alternate,r!==null&&(r.lanes|=l),wr(c,l,t),c=null}else c=s.child;if(c!==null)c.return=s;else for(c=s;c!==null;){if(c===t){c=null;break}if(s=c.sibling,s!==null){s.return=c.return,c=s;break}c=c.return}s=c}}function Qi(t,e,l,i){t=null;for(var s=e,r=!1;s!==null;){if(!r){if((s.flags&524288)!==0)r=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var c=s.alternate;if(c===null)throw Error(u(387));if(c=c.memoizedProps,c!==null){var p=s.type;Ce(s.pendingProps.value,c.value)||(t!==null?t.push(p):t=[p])}}else if(s===St.current){if(c=s.alternate,c===null)throw Error(u(387));c.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(t!==null?t.push(sa):t=[sa])}s=s.return}t!==null&&Mr(e,t,l,i),e.flags|=262144}function ka(t){for(t=t.firstContext;t!==null;){if(!Ce(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function fi(t){ci=t,ml=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function ce(t){return mc(ci,t)}function Ga(t,e){return ci===null&&fi(t),mc(t,e)}function mc(t,e){var l=e._currentValue;if(e={context:e,memoizedValue:l,next:null},ml===null){if(t===null)throw Error(u(308));ml=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else ml=ml.next=e;return l}var jg=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(l,i){t.push(i)}};this.abort=function(){e.aborted=!0,t.forEach(function(l){return l()})}},Dg=d.unstable_scheduleCallback,Og=d.unstable_NormalPriority,ee={$$typeof:X,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ar(){return{controller:new jg,data:new Map,refCount:0}}function Nn(t){t.refCount--,t.refCount===0&&Dg(Og,function(){t.controller.abort()})}var Hn=null,jr=0,Vi=0,Zi=null;function Ng(t,e){if(Hn===null){var l=Hn=[];jr=0,Vi=Nu(),Zi={status:"pending",value:void 0,then:function(i){l.push(i)}}}return jr++,e.then(pc,pc),e}function pc(){if(--jr===0&&Hn!==null){Zi!==null&&(Zi.status="fulfilled");var t=Hn;Hn=null,Vi=0,Zi=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function Hg(t,e){var l=[],i={status:"pending",value:null,reason:null,then:function(s){l.push(s)}};return t.then(function(){i.status="fulfilled",i.value=e;for(var s=0;s<l.length;s++)(0,l[s])(e)},function(s){for(i.status="rejected",i.reason=s,s=0;s<l.length;s++)(0,l[s])(void 0)}),i}var yc=R.S;R.S=function(t,e){ed=he(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&Ng(t,e),yc!==null&&yc(t,e)};var di=b(null);function Dr(){var t=di.current;return t!==null?t:Xt.pooledCache}function qa(t,e){e===null?Y(di,di.current):Y(di,e.pool)}function vc(){var t=Dr();return t===null?null:{parent:ee._currentValue,pool:t}}var Ki=Error(u(460)),Or=Error(u(474)),Ya=Error(u(542)),Xa={then:function(){}};function xc(t){return t=t.status,t==="fulfilled"||t==="rejected"}function bc(t,e,l){switch(l=t[l],l===void 0?t.push(e):l!==e&&(e.then(fl,fl),e=l),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,Ec(t),t;default:if(typeof e.status=="string")e.then(fl,fl);else{if(t=Xt,t!==null&&100<t.shellSuspendCounter)throw Error(u(482));t=e,t.status="pending",t.then(function(i){if(e.status==="pending"){var s=e;s.status="fulfilled",s.value=i}},function(i){if(e.status==="pending"){var s=e;s.status="rejected",s.reason=i}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,Ec(t),t}throw gi=e,Ki}}function hi(t){try{var e=t._init;return e(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(gi=l,Ki):l}}var gi=null;function Sc(){if(gi===null)throw Error(u(459));var t=gi;return gi=null,t}function Ec(t){if(t===Ki||t===Ya)throw Error(u(483))}var Ji=null,Ln=0;function Qa(t){var e=Ln;return Ln+=1,Ji===null&&(Ji=[]),bc(Ji,t,e)}function Un(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function Va(t,e){throw e.$$typeof===C?Error(u(525)):(t=Object.prototype.toString.call(e),Error(u(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function _c(t){function e(T,z){if(t){var w=T.deletions;w===null?(T.deletions=[z],T.flags|=16):w.push(z)}}function l(T,z){if(!t)return null;for(;z!==null;)e(T,z),z=z.sibling;return null}function i(T){for(var z=new Map;T!==null;)T.key!==null?z.set(T.key,T):z.set(T.index,T),T=T.sibling;return z}function s(T,z){return T=hl(T,z),T.index=0,T.sibling=null,T}function r(T,z,w){return T.index=w,t?(w=T.alternate,w!==null?(w=w.index,w<z?(T.flags|=67108866,z):w):(T.flags|=67108866,z)):(T.flags|=1048576,z)}function c(T){return t&&T.alternate===null&&(T.flags|=67108866),T}function p(T,z,w,U){return z===null||z.tag!==6?(z=Sr(w,T.mode,U),z.return=T,z):(z=s(z,w),z.return=T,z)}function E(T,z,w,U){var ct=w.type;return ct===J?L(T,z,w.props.children,U,w.key):z!==null&&(z.elementType===ct||typeof ct=="object"&&ct!==null&&ct.$$typeof===et&&hi(ct)===z.type)?(z=s(z,w.props),Un(z,w),z.return=T,z):(z=Ua(w.type,w.key,w.props,null,T.mode,U),Un(z,w),z.return=T,z)}function M(T,z,w,U){return z===null||z.tag!==4||z.stateNode.containerInfo!==w.containerInfo||z.stateNode.implementation!==w.implementation?(z=Er(w,T.mode,U),z.return=T,z):(z=s(z,w.children||[]),z.return=T,z)}function L(T,z,w,U,ct){return z===null||z.tag!==7?(z=ui(w,T.mode,U,ct),z.return=T,z):(z=s(z,w),z.return=T,z)}function B(T,z,w){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=Sr(""+z,T.mode,w),z.return=T,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case Z:return w=Ua(z.type,z.key,z.props,null,T.mode,w),Un(w,z),w.return=T,w;case $:return z=Er(z,T.mode,w),z.return=T,z;case et:return z=hi(z),B(T,z,w)}if(Ut(z)||nt(z))return z=ui(z,T.mode,w,null),z.return=T,z;if(typeof z.then=="function")return B(T,Qa(z),w);if(z.$$typeof===X)return B(T,Ga(T,z),w);Va(T,z)}return null}function A(T,z,w,U){var ct=z!==null?z.key:null;if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return ct!==null?null:p(T,z,""+w,U);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Z:return w.key===ct?E(T,z,w,U):null;case $:return w.key===ct?M(T,z,w,U):null;case et:return w=hi(w),A(T,z,w,U)}if(Ut(w)||nt(w))return ct!==null?null:L(T,z,w,U,null);if(typeof w.then=="function")return A(T,z,Qa(w),U);if(w.$$typeof===X)return A(T,z,Ga(T,w),U);Va(T,w)}return null}function O(T,z,w,U,ct){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return T=T.get(w)||null,p(z,T,""+U,ct);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case Z:return T=T.get(U.key===null?w:U.key)||null,E(z,T,U,ct);case $:return T=T.get(U.key===null?w:U.key)||null,M(z,T,U,ct);case et:return U=hi(U),O(T,z,w,U,ct)}if(Ut(U)||nt(U))return T=T.get(w)||null,L(z,T,U,ct,null);if(typeof U.then=="function")return O(T,z,w,Qa(U),ct);if(U.$$typeof===X)return O(T,z,w,Ga(z,U),ct);Va(z,U)}return null}function tt(T,z,w,U){for(var ct=null,jt=null,lt=z,zt=z=0,wt=null;lt!==null&&zt<w.length;zt++){lt.index>zt?(wt=lt,lt=null):wt=lt.sibling;var Dt=A(T,lt,w[zt],U);if(Dt===null){lt===null&&(lt=wt);break}t&&lt&&Dt.alternate===null&&e(T,lt),z=r(Dt,z,zt),jt===null?ct=Dt:jt.sibling=Dt,jt=Dt,lt=wt}if(zt===w.length)return l(T,lt),Mt&&gl(T,zt),ct;if(lt===null){for(;zt<w.length;zt++)lt=B(T,w[zt],U),lt!==null&&(z=r(lt,z,zt),jt===null?ct=lt:jt.sibling=lt,jt=lt);return Mt&&gl(T,zt),ct}for(lt=i(lt);zt<w.length;zt++)wt=O(lt,T,zt,w[zt],U),wt!==null&&(t&&wt.alternate!==null&&lt.delete(wt.key===null?zt:wt.key),z=r(wt,z,zt),jt===null?ct=wt:jt.sibling=wt,jt=wt);return t&&lt.forEach(function(ei){return e(T,ei)}),Mt&&gl(T,zt),ct}function ft(T,z,w,U){if(w==null)throw Error(u(151));for(var ct=null,jt=null,lt=z,zt=z=0,wt=null,Dt=w.next();lt!==null&&!Dt.done;zt++,Dt=w.next()){lt.index>zt?(wt=lt,lt=null):wt=lt.sibling;var ei=A(T,lt,Dt.value,U);if(ei===null){lt===null&&(lt=wt);break}t&&lt&&ei.alternate===null&&e(T,lt),z=r(ei,z,zt),jt===null?ct=ei:jt.sibling=ei,jt=ei,lt=wt}if(Dt.done)return l(T,lt),Mt&&gl(T,zt),ct;if(lt===null){for(;!Dt.done;zt++,Dt=w.next())Dt=B(T,Dt.value,U),Dt!==null&&(z=r(Dt,z,zt),jt===null?ct=Dt:jt.sibling=Dt,jt=Dt);return Mt&&gl(T,zt),ct}for(lt=i(lt);!Dt.done;zt++,Dt=w.next())Dt=O(lt,T,zt,Dt.value,U),Dt!==null&&(t&&Dt.alternate!==null&&lt.delete(Dt.key===null?zt:Dt.key),z=r(Dt,z,zt),jt===null?ct=Dt:jt.sibling=Dt,jt=Dt);return t&&lt.forEach(function(Zm){return e(T,Zm)}),Mt&&gl(T,zt),ct}function Gt(T,z,w,U){if(typeof w=="object"&&w!==null&&w.type===J&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Z:t:{for(var ct=w.key;z!==null;){if(z.key===ct){if(ct=w.type,ct===J){if(z.tag===7){l(T,z.sibling),U=s(z,w.props.children),U.return=T,T=U;break t}}else if(z.elementType===ct||typeof ct=="object"&&ct!==null&&ct.$$typeof===et&&hi(ct)===z.type){l(T,z.sibling),U=s(z,w.props),Un(U,w),U.return=T,T=U;break t}l(T,z);break}else e(T,z);z=z.sibling}w.type===J?(U=ui(w.props.children,T.mode,U,w.key),U.return=T,T=U):(U=Ua(w.type,w.key,w.props,null,T.mode,U),Un(U,w),U.return=T,T=U)}return c(T);case $:t:{for(ct=w.key;z!==null;){if(z.key===ct)if(z.tag===4&&z.stateNode.containerInfo===w.containerInfo&&z.stateNode.implementation===w.implementation){l(T,z.sibling),U=s(z,w.children||[]),U.return=T,T=U;break t}else{l(T,z);break}else e(T,z);z=z.sibling}U=Er(w,T.mode,U),U.return=T,T=U}return c(T);case et:return w=hi(w),Gt(T,z,w,U)}if(Ut(w))return tt(T,z,w,U);if(nt(w)){if(ct=nt(w),typeof ct!="function")throw Error(u(150));return w=ct.call(w),ft(T,z,w,U)}if(typeof w.then=="function")return Gt(T,z,Qa(w),U);if(w.$$typeof===X)return Gt(T,z,Ga(T,w),U);Va(T,w)}return typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint"?(w=""+w,z!==null&&z.tag===6?(l(T,z.sibling),U=s(z,w),U.return=T,T=U):(l(T,z),U=Sr(w,T.mode,U),U.return=T,T=U),c(T)):l(T,z)}return function(T,z,w,U){try{Ln=0;var ct=Gt(T,z,w,U);return Ji=null,ct}catch(lt){if(lt===Ki||lt===Ya)throw lt;var jt=Te(29,lt,null,T.mode);return jt.lanes=U,jt.return=T,jt}finally{}}}var mi=_c(!0),zc=_c(!1),Bl=!1;function Nr(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hr(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function kl(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Gl(t,e,l){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(Ot&2)!==0){var s=i.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),i.pending=e,e=La(t),rc(t,null,l),e}return Ha(t,i,e,l),La(t)}function Bn(t,e,l){if(e=e.updateQueue,e!==null&&(e=e.shared,(l&4194048)!==0)){var i=e.lanes;i&=t.pendingLanes,l|=i,e.lanes=l,xa(t,l)}}function Lr(t,e){var l=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,l===i)){var s=null,r=null;if(l=l.firstBaseUpdate,l!==null){do{var c={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};r===null?s=r=c:r=r.next=c,l=l.next}while(l!==null);r===null?s=r=e:r=r.next=e}else s=r=e;l={baseState:i.baseState,firstBaseUpdate:s,lastBaseUpdate:r,shared:i.shared,callbacks:i.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=e:t.next=e,l.lastBaseUpdate=e}var Ur=!1;function kn(){if(Ur){var t=Zi;if(t!==null)throw t}}function Gn(t,e,l,i){Ur=!1;var s=t.updateQueue;Bl=!1;var r=s.firstBaseUpdate,c=s.lastBaseUpdate,p=s.shared.pending;if(p!==null){s.shared.pending=null;var E=p,M=E.next;E.next=null,c===null?r=M:c.next=M,c=E;var L=t.alternate;L!==null&&(L=L.updateQueue,p=L.lastBaseUpdate,p!==c&&(p===null?L.firstBaseUpdate=M:p.next=M,L.lastBaseUpdate=E))}if(r!==null){var B=s.baseState;c=0,L=M=E=null,p=r;do{var A=p.lane&-536870913,O=A!==p.lane;if(O?(Rt&A)===A:(i&A)===A){A!==0&&A===Vi&&(Ur=!0),L!==null&&(L=L.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});t:{var tt=t,ft=p;A=e;var Gt=l;switch(ft.tag){case 1:if(tt=ft.payload,typeof tt=="function"){B=tt.call(Gt,B,A);break t}B=tt;break t;case 3:tt.flags=tt.flags&-65537|128;case 0:if(tt=ft.payload,A=typeof tt=="function"?tt.call(Gt,B,A):tt,A==null)break t;B=v({},B,A);break t;case 2:Bl=!0}}A=p.callback,A!==null&&(t.flags|=64,O&&(t.flags|=8192),O=s.callbacks,O===null?s.callbacks=[A]:O.push(A))}else O={lane:A,tag:p.tag,payload:p.payload,callback:p.callback,next:null},L===null?(M=L=O,E=B):L=L.next=O,c|=A;if(p=p.next,p===null){if(p=s.shared.pending,p===null)break;O=p,p=O.next,O.next=null,s.lastBaseUpdate=O,s.shared.pending=null}}while(!0);L===null&&(E=B),s.baseState=E,s.firstBaseUpdate=M,s.lastBaseUpdate=L,r===null&&(s.shared.lanes=0),Vl|=c,t.lanes=c,t.memoizedState=B}}function Cc(t,e){if(typeof t!="function")throw Error(u(191,t));t.call(e)}function Tc(t,e){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Cc(l[t],e)}var Wi=b(null),Za=b(0);function Rc(t,e){t=Cl,Y(Za,t),Y(Wi,e),Cl=t|e.baseLanes}function Br(){Y(Za,Cl),Y(Wi,Wi.current)}function kr(){Cl=Za.current,j(Wi),j(Za)}var Re=b(null),qe=null;function ql(t){var e=t.alternate;Y(Pt,Pt.current&1),Y(Re,t),qe===null&&(e===null||Wi.current!==null||e.memoizedState!==null)&&(qe=t)}function Gr(t){Y(Pt,Pt.current),Y(Re,t),qe===null&&(qe=t)}function wc(t){t.tag===22?(Y(Pt,Pt.current),Y(Re,t),qe===null&&(qe=t)):Yl()}function Yl(){Y(Pt,Pt.current),Y(Re,Re.current)}function we(t){j(Re),qe===t&&(qe=null),j(Pt)}var Pt=b(0);function Ka(t){for(var e=t;e!==null;){if(e.tag===13){var l=e.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Zu(l)||Ku(l)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var yl=0,_t=null,Bt=null,le=null,Ja=!1,$i=!1,pi=!1,Wa=0,qn=0,Fi=null,Lg=0;function Wt(){throw Error(u(321))}function qr(t,e){if(e===null)return!1;for(var l=0;l<e.length&&l<t.length;l++)if(!Ce(t[l],e[l]))return!1;return!0}function Yr(t,e,l,i,s,r){return yl=r,_t=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,R.H=t===null||t.memoizedState===null?df:iu,pi=!1,r=l(i,s),pi=!1,$i&&(r=Ac(e,l,i,s)),Mc(t),r}function Mc(t){R.H=Qn;var e=Bt!==null&&Bt.next!==null;if(yl=0,le=Bt=_t=null,Ja=!1,qn=0,Fi=null,e)throw Error(u(300));t===null||ie||(t=t.dependencies,t!==null&&ka(t)&&(ie=!0))}function Ac(t,e,l,i){_t=t;var s=0;do{if($i&&(Fi=null),qn=0,$i=!1,25<=s)throw Error(u(301));if(s+=1,le=Bt=null,t.updateQueue!=null){var r=t.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}R.H=hf,r=e(l,i)}while($i);return r}function Ug(){var t=R.H,e=t.useState()[0];return e=typeof e.then=="function"?Yn(e):e,t=t.useState()[0],(Bt!==null?Bt.memoizedState:null)!==t&&(_t.flags|=1024),e}function Xr(){var t=Wa!==0;return Wa=0,t}function Qr(t,e,l){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~l}function Vr(t){if(Ja){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}Ja=!1}yl=0,le=Bt=_t=null,$i=!1,qn=Wa=0,Fi=null}function pe(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return le===null?_t.memoizedState=le=t:le=le.next=t,le}function te(){if(Bt===null){var t=_t.alternate;t=t!==null?t.memoizedState:null}else t=Bt.next;var e=le===null?_t.memoizedState:le.next;if(e!==null)le=e,Bt=t;else{if(t===null)throw _t.alternate===null?Error(u(467)):Error(u(310));Bt=t,t={memoizedState:Bt.memoizedState,baseState:Bt.baseState,baseQueue:Bt.baseQueue,queue:Bt.queue,next:null},le===null?_t.memoizedState=le=t:le=le.next=t}return le}function $a(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Yn(t){var e=qn;return qn+=1,Fi===null&&(Fi=[]),t=bc(Fi,t,e),e=_t,(le===null?e.memoizedState:le.next)===null&&(e=e.alternate,R.H=e===null||e.memoizedState===null?df:iu),t}function Fa(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Yn(t);if(t.$$typeof===X)return ce(t)}throw Error(u(438,String(t)))}function Zr(t){var e=null,l=_t.updateQueue;if(l!==null&&(e=l.memoCache),e==null){var i=_t.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(s){return s.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),l===null&&(l=$a(),_t.updateQueue=l),l.memoCache=e,l=e.data[e.index],l===void 0)for(l=e.data[e.index]=Array(t),i=0;i<t;i++)l[i]=At;return e.index++,l}function vl(t,e){return typeof e=="function"?e(t):e}function Ia(t){var e=te();return Kr(e,Bt,t)}function Kr(t,e,l){var i=t.queue;if(i===null)throw Error(u(311));i.lastRenderedReducer=l;var s=t.baseQueue,r=i.pending;if(r!==null){if(s!==null){var c=s.next;s.next=r.next,r.next=c}e.baseQueue=s=r,i.pending=null}if(r=t.baseState,s===null)t.memoizedState=r;else{e=s.next;var p=c=null,E=null,M=e,L=!1;do{var B=M.lane&-536870913;if(B!==M.lane?(Rt&B)===B:(yl&B)===B){var A=M.revertLane;if(A===0)E!==null&&(E=E.next={lane:0,revertLane:0,gesture:null,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null}),B===Vi&&(L=!0);else if((yl&A)===A){M=M.next,A===Vi&&(L=!0);continue}else B={lane:0,revertLane:M.revertLane,gesture:null,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null},E===null?(p=E=B,c=r):E=E.next=B,_t.lanes|=A,Vl|=A;B=M.action,pi&&l(r,B),r=M.hasEagerState?M.eagerState:l(r,B)}else A={lane:B,revertLane:M.revertLane,gesture:M.gesture,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null},E===null?(p=E=A,c=r):E=E.next=A,_t.lanes|=B,Vl|=B;M=M.next}while(M!==null&&M!==e);if(E===null?c=r:E.next=p,!Ce(r,t.memoizedState)&&(ie=!0,L&&(l=Zi,l!==null)))throw l;t.memoizedState=r,t.baseState=c,t.baseQueue=E,i.lastRenderedState=r}return s===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function Jr(t){var e=te(),l=e.queue;if(l===null)throw Error(u(311));l.lastRenderedReducer=t;var i=l.dispatch,s=l.pending,r=e.memoizedState;if(s!==null){l.pending=null;var c=s=s.next;do r=t(r,c.action),c=c.next;while(c!==s);Ce(r,e.memoizedState)||(ie=!0),e.memoizedState=r,e.baseQueue===null&&(e.baseState=r),l.lastRenderedState=r}return[r,i]}function jc(t,e,l){var i=_t,s=te(),r=Mt;if(r){if(l===void 0)throw Error(u(407));l=l()}else l=e();var c=!Ce((Bt||s).memoizedState,l);if(c&&(s.memoizedState=l,ie=!0),s=s.queue,Fr(Nc.bind(null,i,s,t),[t]),s.getSnapshot!==e||c||le!==null&&le.memoizedState.tag&1){if(i.flags|=2048,Ii(9,{destroy:void 0},Oc.bind(null,i,s,l,e),null),Xt===null)throw Error(u(349));r||(yl&127)!==0||Dc(i,e,l)}return l}function Dc(t,e,l){t.flags|=16384,t={getSnapshot:e,value:l},e=_t.updateQueue,e===null?(e=$a(),_t.updateQueue=e,e.stores=[t]):(l=e.stores,l===null?e.stores=[t]:l.push(t))}function Oc(t,e,l,i){e.value=l,e.getSnapshot=i,Hc(e)&&Lc(t)}function Nc(t,e,l){return l(function(){Hc(e)&&Lc(t)})}function Hc(t){var e=t.getSnapshot;t=t.value;try{var l=e();return!Ce(t,l)}catch{return!0}}function Lc(t){var e=ri(t,2);e!==null&&ze(e,t,2)}function Wr(t){var e=pe();if(typeof t=="function"){var l=t;if(t=l(),pi){tl(!0);try{l()}finally{tl(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vl,lastRenderedState:t},e}function Uc(t,e,l,i){return t.baseState=l,Kr(t,Bt,typeof i=="function"?i:vl)}function Bg(t,e,l,i,s){if(es(t))throw Error(u(485));if(t=e.action,t!==null){var r={payload:s,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(c){r.listeners.push(c)}};R.T!==null?l(!0):r.isTransition=!1,i(r),l=e.pending,l===null?(r.next=e.pending=r,Bc(e,r)):(r.next=l.next,e.pending=l.next=r)}}function Bc(t,e){var l=e.action,i=e.payload,s=t.state;if(e.isTransition){var r=R.T,c={};R.T=c;try{var p=l(s,i),E=R.S;E!==null&&E(c,p),kc(t,e,p)}catch(M){$r(t,e,M)}finally{r!==null&&c.types!==null&&(r.types=c.types),R.T=r}}else try{r=l(s,i),kc(t,e,r)}catch(M){$r(t,e,M)}}function kc(t,e,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(i){Gc(t,e,i)},function(i){return $r(t,e,i)}):Gc(t,e,l)}function Gc(t,e,l){e.status="fulfilled",e.value=l,qc(e),t.state=l,e=t.pending,e!==null&&(l=e.next,l===e?t.pending=null:(l=l.next,e.next=l,Bc(t,l)))}function $r(t,e,l){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=l,qc(e),e=e.next;while(e!==i)}t.action=null}function qc(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function Yc(t,e){return e}function Xc(t,e){if(Mt){var l=Xt.formState;if(l!==null){t:{var i=_t;if(Mt){if(Vt){e:{for(var s=Vt,r=Ge;s.nodeType!==8;){if(!r){s=null;break e}if(s=Ye(s.nextSibling),s===null){s=null;break e}}r=s.data,s=r==="F!"||r==="F"?s:null}if(s){Vt=Ye(s.nextSibling),i=s.data==="F!";break t}}Ll(i)}i=!1}i&&(e=l[0])}}return l=pe(),l.memoizedState=l.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yc,lastRenderedState:e},l.queue=i,l=of.bind(null,_t,i),i.dispatch=l,i=Wr(!1),r=lu.bind(null,_t,!1,i.queue),i=pe(),s={state:e,dispatch:null,action:t,pending:null},i.queue=s,l=Bg.bind(null,_t,s,r,l),s.dispatch=l,i.memoizedState=t,[e,l,!1]}function Qc(t){var e=te();return Vc(e,Bt,t)}function Vc(t,e,l){if(e=Kr(t,e,Yc)[0],t=Ia(vl)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=Yn(e)}catch(c){throw c===Ki?Ya:c}else i=e;e=te();var s=e.queue,r=s.dispatch;return l!==e.memoizedState&&(_t.flags|=2048,Ii(9,{destroy:void 0},kg.bind(null,s,l),null)),[i,r,t]}function kg(t,e){t.action=e}function Zc(t){var e=te(),l=Bt;if(l!==null)return Vc(e,l,t);te(),e=e.memoizedState,l=te();var i=l.queue.dispatch;return l.memoizedState=t,[e,i,!1]}function Ii(t,e,l,i){return t={tag:t,create:l,deps:i,inst:e,next:null},e=_t.updateQueue,e===null&&(e=$a(),_t.updateQueue=e),l=e.lastEffect,l===null?e.lastEffect=t.next=t:(i=l.next,l.next=t,t.next=i,e.lastEffect=t),t}function Kc(){return te().memoizedState}function Pa(t,e,l,i){var s=pe();_t.flags|=t,s.memoizedState=Ii(1|e,{destroy:void 0},l,i===void 0?null:i)}function ts(t,e,l,i){var s=te();i=i===void 0?null:i;var r=s.memoizedState.inst;Bt!==null&&i!==null&&qr(i,Bt.memoizedState.deps)?s.memoizedState=Ii(e,r,l,i):(_t.flags|=t,s.memoizedState=Ii(1|e,r,l,i))}function Jc(t,e){Pa(8390656,8,t,e)}function Fr(t,e){ts(2048,8,t,e)}function Gg(t){_t.flags|=4;var e=_t.updateQueue;if(e===null)e=$a(),_t.updateQueue=e,e.events=[t];else{var l=e.events;l===null?e.events=[t]:l.push(t)}}function Wc(t){var e=te().memoizedState;return Gg({ref:e,nextImpl:t}),function(){if((Ot&2)!==0)throw Error(u(440));return e.impl.apply(void 0,arguments)}}function $c(t,e){return ts(4,2,t,e)}function Fc(t,e){return ts(4,4,t,e)}function Ic(t,e){if(typeof e=="function"){t=t();var l=e(t);return function(){typeof l=="function"?l():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function Pc(t,e,l){l=l!=null?l.concat([t]):null,ts(4,4,Ic.bind(null,e,t),l)}function Ir(){}function tf(t,e){var l=te();e=e===void 0?null:e;var i=l.memoizedState;return e!==null&&qr(e,i[1])?i[0]:(l.memoizedState=[t,e],t)}function ef(t,e){var l=te();e=e===void 0?null:e;var i=l.memoizedState;if(e!==null&&qr(e,i[1]))return i[0];if(i=t(),pi){tl(!0);try{t()}finally{tl(!1)}}return l.memoizedState=[i,e],i}function Pr(t,e,l){return l===void 0||(yl&1073741824)!==0&&(Rt&261930)===0?t.memoizedState=e:(t.memoizedState=l,t=id(),_t.lanes|=t,Vl|=t,l)}function lf(t,e,l,i){return Ce(l,e)?l:Wi.current!==null?(t=Pr(t,l,i),Ce(t,e)||(ie=!0),t):(yl&42)===0||(yl&1073741824)!==0&&(Rt&261930)===0?(ie=!0,t.memoizedState=l):(t=id(),_t.lanes|=t,Vl|=t,e)}function nf(t,e,l,i,s){var r=V.p;V.p=r!==0&&8>r?r:8;var c=R.T,p={};R.T=p,lu(t,!1,e,l);try{var E=s(),M=R.S;if(M!==null&&M(p,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var L=Hg(E,i);Xn(t,e,L,je(t))}else Xn(t,e,i,je(t))}catch(B){Xn(t,e,{then:function(){},status:"rejected",reason:B},je())}finally{V.p=r,c!==null&&p.types!==null&&(c.types=p.types),R.T=c}}function qg(){}function tu(t,e,l,i){if(t.tag!==5)throw Error(u(476));var s=af(t).queue;nf(t,s,e,P,l===null?qg:function(){return sf(t),l(i)})}function af(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vl,lastRenderedState:P},next:null};var l={};return e.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vl,lastRenderedState:l},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function sf(t){var e=af(t);e.next===null&&(e=t.alternate.memoizedState),Xn(t,e.next.queue,{},je())}function eu(){return ce(sa)}function rf(){return te().memoizedState}function uf(){return te().memoizedState}function Yg(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var l=je();t=kl(l);var i=Gl(e,t,l);i!==null&&(ze(i,e,l),Bn(i,e,l)),e={cache:Ar()},t.payload=e;return}e=e.return}}function Xg(t,e,l){var i=je();l={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},es(t)?cf(e,l):(l=xr(t,e,l,i),l!==null&&(ze(l,t,i),ff(l,e,i)))}function of(t,e,l){var i=je();Xn(t,e,l,i)}function Xn(t,e,l,i){var s={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(es(t))cf(e,s);else{var r=t.alternate;if(t.lanes===0&&(r===null||r.lanes===0)&&(r=e.lastRenderedReducer,r!==null))try{var c=e.lastRenderedState,p=r(c,l);if(s.hasEagerState=!0,s.eagerState=p,Ce(p,c))return Ha(t,e,s,0),Xt===null&&Na(),!1}catch{}finally{}if(l=xr(t,e,s,i),l!==null)return ze(l,t,i),ff(l,e,i),!0}return!1}function lu(t,e,l,i){if(i={lane:2,revertLane:Nu(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},es(t)){if(e)throw Error(u(479))}else e=xr(t,l,i,2),e!==null&&ze(e,t,2)}function es(t){var e=t.alternate;return t===_t||e!==null&&e===_t}function cf(t,e){$i=Ja=!0;var l=t.pending;l===null?e.next=e:(e.next=l.next,l.next=e),t.pending=e}function ff(t,e,l){if((l&4194048)!==0){var i=e.lanes;i&=t.pendingLanes,l|=i,e.lanes=l,xa(t,l)}}var Qn={readContext:ce,use:Fa,useCallback:Wt,useContext:Wt,useEffect:Wt,useImperativeHandle:Wt,useLayoutEffect:Wt,useInsertionEffect:Wt,useMemo:Wt,useReducer:Wt,useRef:Wt,useState:Wt,useDebugValue:Wt,useDeferredValue:Wt,useTransition:Wt,useSyncExternalStore:Wt,useId:Wt,useHostTransitionStatus:Wt,useFormState:Wt,useActionState:Wt,useOptimistic:Wt,useMemoCache:Wt,useCacheRefresh:Wt};Qn.useEffectEvent=Wt;var df={readContext:ce,use:Fa,useCallback:function(t,e){return pe().memoizedState=[t,e===void 0?null:e],t},useContext:ce,useEffect:Jc,useImperativeHandle:function(t,e,l){l=l!=null?l.concat([t]):null,Pa(4194308,4,Ic.bind(null,e,t),l)},useLayoutEffect:function(t,e){return Pa(4194308,4,t,e)},useInsertionEffect:function(t,e){Pa(4,2,t,e)},useMemo:function(t,e){var l=pe();e=e===void 0?null:e;var i=t();if(pi){tl(!0);try{t()}finally{tl(!1)}}return l.memoizedState=[i,e],i},useReducer:function(t,e,l){var i=pe();if(l!==void 0){var s=l(e);if(pi){tl(!0);try{l(e)}finally{tl(!1)}}}else s=e;return i.memoizedState=i.baseState=s,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:s},i.queue=t,t=t.dispatch=Xg.bind(null,_t,t),[i.memoizedState,t]},useRef:function(t){var e=pe();return t={current:t},e.memoizedState=t},useState:function(t){t=Wr(t);var e=t.queue,l=of.bind(null,_t,e);return e.dispatch=l,[t.memoizedState,l]},useDebugValue:Ir,useDeferredValue:function(t,e){var l=pe();return Pr(l,t,e)},useTransition:function(){var t=Wr(!1);return t=nf.bind(null,_t,t.queue,!0,!1),pe().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,l){var i=_t,s=pe();if(Mt){if(l===void 0)throw Error(u(407));l=l()}else{if(l=e(),Xt===null)throw Error(u(349));(Rt&127)!==0||Dc(i,e,l)}s.memoizedState=l;var r={value:l,getSnapshot:e};return s.queue=r,Jc(Nc.bind(null,i,r,t),[t]),i.flags|=2048,Ii(9,{destroy:void 0},Oc.bind(null,i,r,l,e),null),l},useId:function(){var t=pe(),e=Xt.identifierPrefix;if(Mt){var l=nl,i=il;l=(i&~(1<<32-ae(i)-1)).toString(32)+l,e="_"+e+"R_"+l,l=Wa++,0<l&&(e+="H"+l.toString(32)),e+="_"}else l=Lg++,e="_"+e+"r_"+l.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:eu,useFormState:Xc,useActionState:Xc,useOptimistic:function(t){var e=pe();e.memoizedState=e.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=l,e=lu.bind(null,_t,!0,l),l.dispatch=e,[t,e]},useMemoCache:Zr,useCacheRefresh:function(){return pe().memoizedState=Yg.bind(null,_t)},useEffectEvent:function(t){var e=pe(),l={impl:t};return e.memoizedState=l,function(){if((Ot&2)!==0)throw Error(u(440));return l.impl.apply(void 0,arguments)}}},iu={readContext:ce,use:Fa,useCallback:tf,useContext:ce,useEffect:Fr,useImperativeHandle:Pc,useInsertionEffect:$c,useLayoutEffect:Fc,useMemo:ef,useReducer:Ia,useRef:Kc,useState:function(){return Ia(vl)},useDebugValue:Ir,useDeferredValue:function(t,e){var l=te();return lf(l,Bt.memoizedState,t,e)},useTransition:function(){var t=Ia(vl)[0],e=te().memoizedState;return[typeof t=="boolean"?t:Yn(t),e]},useSyncExternalStore:jc,useId:rf,useHostTransitionStatus:eu,useFormState:Qc,useActionState:Qc,useOptimistic:function(t,e){var l=te();return Uc(l,Bt,t,e)},useMemoCache:Zr,useCacheRefresh:uf};iu.useEffectEvent=Wc;var hf={readContext:ce,use:Fa,useCallback:tf,useContext:ce,useEffect:Fr,useImperativeHandle:Pc,useInsertionEffect:$c,useLayoutEffect:Fc,useMemo:ef,useReducer:Jr,useRef:Kc,useState:function(){return Jr(vl)},useDebugValue:Ir,useDeferredValue:function(t,e){var l=te();return Bt===null?Pr(l,t,e):lf(l,Bt.memoizedState,t,e)},useTransition:function(){var t=Jr(vl)[0],e=te().memoizedState;return[typeof t=="boolean"?t:Yn(t),e]},useSyncExternalStore:jc,useId:rf,useHostTransitionStatus:eu,useFormState:Zc,useActionState:Zc,useOptimistic:function(t,e){var l=te();return Bt!==null?Uc(l,Bt,t,e):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:Zr,useCacheRefresh:uf};hf.useEffectEvent=Wc;function nu(t,e,l,i){e=t.memoizedState,l=l(i,e),l=l==null?e:v({},e,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var au={enqueueSetState:function(t,e,l){t=t._reactInternals;var i=je(),s=kl(i);s.payload=e,l!=null&&(s.callback=l),e=Gl(t,s,i),e!==null&&(ze(e,t,i),Bn(e,t,i))},enqueueReplaceState:function(t,e,l){t=t._reactInternals;var i=je(),s=kl(i);s.tag=1,s.payload=e,l!=null&&(s.callback=l),e=Gl(t,s,i),e!==null&&(ze(e,t,i),Bn(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var l=je(),i=kl(l);i.tag=2,e!=null&&(i.callback=e),e=Gl(t,i,l),e!==null&&(ze(e,t,l),Bn(e,t,l))}};function gf(t,e,l,i,s,r,c){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,r,c):e.prototype&&e.prototype.isPureReactComponent?!An(l,i)||!An(s,r):!0}function mf(t,e,l,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(l,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(l,i),e.state!==t&&au.enqueueReplaceState(e,e.state,null)}function yi(t,e){var l=e;if("ref"in e){l={};for(var i in e)i!=="ref"&&(l[i]=e[i])}if(t=t.defaultProps){l===e&&(l=v({},l));for(var s in t)l[s]===void 0&&(l[s]=t[s])}return l}function pf(t){Oa(t)}function yf(t){console.error(t)}function vf(t){Oa(t)}function ls(t,e){try{var l=t.onUncaughtError;l(e.value,{componentStack:e.stack})}catch(i){setTimeout(function(){throw i})}}function xf(t,e,l){try{var i=t.onCaughtError;i(l.value,{componentStack:l.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function su(t,e,l){return l=kl(l),l.tag=3,l.payload={element:null},l.callback=function(){ls(t,e)},l}function bf(t){return t=kl(t),t.tag=3,t}function Sf(t,e,l,i){var s=l.type.getDerivedStateFromError;if(typeof s=="function"){var r=i.value;t.payload=function(){return s(r)},t.callback=function(){xf(e,l,i)}}var c=l.stateNode;c!==null&&typeof c.componentDidCatch=="function"&&(t.callback=function(){xf(e,l,i),typeof s!="function"&&(Zl===null?Zl=new Set([this]):Zl.add(this));var p=i.stack;this.componentDidCatch(i.value,{componentStack:p!==null?p:""})})}function Qg(t,e,l,i,s){if(l.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=l.alternate,e!==null&&Qi(e,l,s,!0),l=Re.current,l!==null){switch(l.tag){case 31:case 13:return qe===null?gs():l.alternate===null&&$t===0&&($t=3),l.flags&=-257,l.flags|=65536,l.lanes=s,i===Xa?l.flags|=16384:(e=l.updateQueue,e===null?l.updateQueue=new Set([i]):e.add(i),ju(t,i,s)),!1;case 22:return l.flags|=65536,i===Xa?l.flags|=16384:(e=l.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},l.updateQueue=e):(l=e.retryQueue,l===null?e.retryQueue=new Set([i]):l.add(i)),ju(t,i,s)),!1}throw Error(u(435,l.tag))}return ju(t,i,s),gs(),!1}if(Mt)return e=Re.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=s,i!==Cr&&(t=Error(u(422),{cause:i}),On(Ue(t,l)))):(i!==Cr&&(e=Error(u(423),{cause:i}),On(Ue(e,l))),t=t.current.alternate,t.flags|=65536,s&=-s,t.lanes|=s,i=Ue(i,l),s=su(t.stateNode,i,s),Lr(t,s),$t!==4&&($t=2)),!1;var r=Error(u(520),{cause:i});if(r=Ue(r,l),In===null?In=[r]:In.push(r),$t!==4&&($t=2),e===null)return!0;i=Ue(i,l),l=e;do{switch(l.tag){case 3:return l.flags|=65536,t=s&-s,l.lanes|=t,t=su(l.stateNode,i,t),Lr(l,t),!1;case 1:if(e=l.type,r=l.stateNode,(l.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(Zl===null||!Zl.has(r))))return l.flags|=65536,s&=-s,l.lanes|=s,s=bf(s),Sf(s,t,l,i),Lr(l,s),!1}l=l.return}while(l!==null);return!1}var ru=Error(u(461)),ie=!1;function fe(t,e,l,i){e.child=t===null?zc(e,null,l,i):mi(e,t.child,l,i)}function Ef(t,e,l,i,s){l=l.render;var r=e.ref;if("ref"in i){var c={};for(var p in i)p!=="ref"&&(c[p]=i[p])}else c=i;return fi(e),i=Yr(t,e,l,c,r,s),p=Xr(),t!==null&&!ie?(Qr(t,e,s),xl(t,e,s)):(Mt&&p&&_r(e),e.flags|=1,fe(t,e,i,s),e.child)}function _f(t,e,l,i,s){if(t===null){var r=l.type;return typeof r=="function"&&!br(r)&&r.defaultProps===void 0&&l.compare===null?(e.tag=15,e.type=r,zf(t,e,r,i,s)):(t=Ua(l.type,null,i,e,e.mode,s),t.ref=e.ref,t.return=e,e.child=t)}if(r=t.child,!mu(t,s)){var c=r.memoizedProps;if(l=l.compare,l=l!==null?l:An,l(c,i)&&t.ref===e.ref)return xl(t,e,s)}return e.flags|=1,t=hl(r,i),t.ref=e.ref,t.return=e,e.child=t}function zf(t,e,l,i,s){if(t!==null){var r=t.memoizedProps;if(An(r,i)&&t.ref===e.ref)if(ie=!1,e.pendingProps=i=r,mu(t,s))(t.flags&131072)!==0&&(ie=!0);else return e.lanes=t.lanes,xl(t,e,s)}return uu(t,e,l,i,s)}function Cf(t,e,l,i){var s=i.children,r=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((e.flags&128)!==0){if(r=r!==null?r.baseLanes|l:l,t!==null){for(i=e.child=t.child,s=0;i!==null;)s=s|i.lanes|i.childLanes,i=i.sibling;i=s&~r}else i=0,e.child=null;return Tf(t,e,r,l,i)}if((l&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&qa(e,r!==null?r.cachePool:null),r!==null?Rc(e,r):Br(),wc(e);else return i=e.lanes=536870912,Tf(t,e,r!==null?r.baseLanes|l:l,l,i)}else r!==null?(qa(e,r.cachePool),Rc(e,r),Yl(),e.memoizedState=null):(t!==null&&qa(e,null),Br(),Yl());return fe(t,e,s,l),e.child}function Vn(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function Tf(t,e,l,i,s){var r=Dr();return r=r===null?null:{parent:ee._currentValue,pool:r},e.memoizedState={baseLanes:l,cachePool:r},t!==null&&qa(e,null),Br(),wc(e),t!==null&&Qi(t,e,i,!0),e.childLanes=s,null}function is(t,e){return e=as({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function Rf(t,e,l){return mi(e,t.child,null,l),t=is(e,e.pendingProps),t.flags|=2,we(e),e.memoizedState=null,t}function Vg(t,e,l){var i=e.pendingProps,s=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(Mt){if(i.mode==="hidden")return t=is(e,i),e.lanes=536870912,Vn(null,t);if(Gr(e),(t=Vt)?(t=kd(t,Ge),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Nl!==null?{id:il,overflow:nl}:null,retryLane:536870912,hydrationErrors:null},l=oc(t),l.return=e,e.child=l,oe=e,Vt=null)):t=null,t===null)throw Ll(e);return e.lanes=536870912,null}return is(e,i)}var r=t.memoizedState;if(r!==null){var c=r.dehydrated;if(Gr(e),s)if(e.flags&256)e.flags&=-257,e=Rf(t,e,l);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(u(558));else if(ie||Qi(t,e,l,!1),s=(l&t.childLanes)!==0,ie||s){if(i=Xt,i!==null&&(c=ba(i,l),c!==0&&c!==r.retryLane))throw r.retryLane=c,ri(t,c),ze(i,t,c),ru;gs(),e=Rf(t,e,l)}else t=r.treeContext,Vt=Ye(c.nextSibling),oe=e,Mt=!0,Hl=null,Ge=!1,t!==null&&dc(e,t),e=is(e,i),e.flags|=4096;return e}return t=hl(t.child,{mode:i.mode,children:i.children}),t.ref=e.ref,e.child=t,t.return=e,t}function ns(t,e){var l=e.ref;if(l===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(u(284));(t===null||t.ref!==l)&&(e.flags|=4194816)}}function uu(t,e,l,i,s){return fi(e),l=Yr(t,e,l,i,void 0,s),i=Xr(),t!==null&&!ie?(Qr(t,e,s),xl(t,e,s)):(Mt&&i&&_r(e),e.flags|=1,fe(t,e,l,s),e.child)}function wf(t,e,l,i,s,r){return fi(e),e.updateQueue=null,l=Ac(e,i,l,s),Mc(t),i=Xr(),t!==null&&!ie?(Qr(t,e,r),xl(t,e,r)):(Mt&&i&&_r(e),e.flags|=1,fe(t,e,l,r),e.child)}function Mf(t,e,l,i,s){if(fi(e),e.stateNode===null){var r=Gi,c=l.contextType;typeof c=="object"&&c!==null&&(r=ce(c)),r=new l(i,r),e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=au,e.stateNode=r,r._reactInternals=e,r=e.stateNode,r.props=i,r.state=e.memoizedState,r.refs={},Nr(e),c=l.contextType,r.context=typeof c=="object"&&c!==null?ce(c):Gi,r.state=e.memoizedState,c=l.getDerivedStateFromProps,typeof c=="function"&&(nu(e,l,c,i),r.state=e.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(c=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),c!==r.state&&au.enqueueReplaceState(r,r.state,null),Gn(e,i,r,s),kn(),r.state=e.memoizedState),typeof r.componentDidMount=="function"&&(e.flags|=4194308),i=!0}else if(t===null){r=e.stateNode;var p=e.memoizedProps,E=yi(l,p);r.props=E;var M=r.context,L=l.contextType;c=Gi,typeof L=="object"&&L!==null&&(c=ce(L));var B=l.getDerivedStateFromProps;L=typeof B=="function"||typeof r.getSnapshotBeforeUpdate=="function",p=e.pendingProps!==p,L||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(p||M!==c)&&mf(e,r,i,c),Bl=!1;var A=e.memoizedState;r.state=A,Gn(e,i,r,s),kn(),M=e.memoizedState,p||A!==M||Bl?(typeof B=="function"&&(nu(e,l,B,i),M=e.memoizedState),(E=Bl||gf(e,l,E,i,A,M,c))?(L||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(e.flags|=4194308)):(typeof r.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=M),r.props=i,r.state=M,r.context=c,i=E):(typeof r.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{r=e.stateNode,Hr(t,e),c=e.memoizedProps,L=yi(l,c),r.props=L,B=e.pendingProps,A=r.context,M=l.contextType,E=Gi,typeof M=="object"&&M!==null&&(E=ce(M)),p=l.getDerivedStateFromProps,(M=typeof p=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(c!==B||A!==E)&&mf(e,r,i,E),Bl=!1,A=e.memoizedState,r.state=A,Gn(e,i,r,s),kn();var O=e.memoizedState;c!==B||A!==O||Bl||t!==null&&t.dependencies!==null&&ka(t.dependencies)?(typeof p=="function"&&(nu(e,l,p,i),O=e.memoizedState),(L=Bl||gf(e,l,L,i,A,O,E)||t!==null&&t.dependencies!==null&&ka(t.dependencies))?(M||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(i,O,E),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(i,O,E)),typeof r.componentDidUpdate=="function"&&(e.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof r.componentDidUpdate!="function"||c===t.memoizedProps&&A===t.memoizedState||(e.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||c===t.memoizedProps&&A===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=O),r.props=i,r.state=O,r.context=E,i=L):(typeof r.componentDidUpdate!="function"||c===t.memoizedProps&&A===t.memoizedState||(e.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||c===t.memoizedProps&&A===t.memoizedState||(e.flags|=1024),i=!1)}return r=i,ns(t,e),i=(e.flags&128)!==0,r||i?(r=e.stateNode,l=i&&typeof l.getDerivedStateFromError!="function"?null:r.render(),e.flags|=1,t!==null&&i?(e.child=mi(e,t.child,null,s),e.child=mi(e,null,l,s)):fe(t,e,l,s),e.memoizedState=r.state,t=e.child):t=xl(t,e,s),t}function Af(t,e,l,i){return oi(),e.flags|=256,fe(t,e,l,i),e.child}var ou={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function cu(t){return{baseLanes:t,cachePool:vc()}}function fu(t,e,l){return t=t!==null?t.childLanes&~l:0,e&&(t|=Ae),t}function jf(t,e,l){var i=e.pendingProps,s=!1,r=(e.flags&128)!==0,c;if((c=r)||(c=t!==null&&t.memoizedState===null?!1:(Pt.current&2)!==0),c&&(s=!0,e.flags&=-129),c=(e.flags&32)!==0,e.flags&=-33,t===null){if(Mt){if(s?ql(e):Yl(),(t=Vt)?(t=kd(t,Ge),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Nl!==null?{id:il,overflow:nl}:null,retryLane:536870912,hydrationErrors:null},l=oc(t),l.return=e,e.child=l,oe=e,Vt=null)):t=null,t===null)throw Ll(e);return Ku(t)?e.lanes=32:e.lanes=536870912,null}var p=i.children;return i=i.fallback,s?(Yl(),s=e.mode,p=as({mode:"hidden",children:p},s),i=ui(i,s,l,null),p.return=e,i.return=e,p.sibling=i,e.child=p,i=e.child,i.memoizedState=cu(l),i.childLanes=fu(t,c,l),e.memoizedState=ou,Vn(null,i)):(ql(e),du(e,p))}var E=t.memoizedState;if(E!==null&&(p=E.dehydrated,p!==null)){if(r)e.flags&256?(ql(e),e.flags&=-257,e=hu(t,e,l)):e.memoizedState!==null?(Yl(),e.child=t.child,e.flags|=128,e=null):(Yl(),p=i.fallback,s=e.mode,i=as({mode:"visible",children:i.children},s),p=ui(p,s,l,null),p.flags|=2,i.return=e,p.return=e,i.sibling=p,e.child=i,mi(e,t.child,null,l),i=e.child,i.memoizedState=cu(l),i.childLanes=fu(t,c,l),e.memoizedState=ou,e=Vn(null,i));else if(ql(e),Ku(p)){if(c=p.nextSibling&&p.nextSibling.dataset,c)var M=c.dgst;c=M,i=Error(u(419)),i.stack="",i.digest=c,On({value:i,source:null,stack:null}),e=hu(t,e,l)}else if(ie||Qi(t,e,l,!1),c=(l&t.childLanes)!==0,ie||c){if(c=Xt,c!==null&&(i=ba(c,l),i!==0&&i!==E.retryLane))throw E.retryLane=i,ri(t,i),ze(c,t,i),ru;Zu(p)||gs(),e=hu(t,e,l)}else Zu(p)?(e.flags|=192,e.child=t.child,e=null):(t=E.treeContext,Vt=Ye(p.nextSibling),oe=e,Mt=!0,Hl=null,Ge=!1,t!==null&&dc(e,t),e=du(e,i.children),e.flags|=4096);return e}return s?(Yl(),p=i.fallback,s=e.mode,E=t.child,M=E.sibling,i=hl(E,{mode:"hidden",children:i.children}),i.subtreeFlags=E.subtreeFlags&65011712,M!==null?p=hl(M,p):(p=ui(p,s,l,null),p.flags|=2),p.return=e,i.return=e,i.sibling=p,e.child=i,Vn(null,i),i=e.child,p=t.child.memoizedState,p===null?p=cu(l):(s=p.cachePool,s!==null?(E=ee._currentValue,s=s.parent!==E?{parent:E,pool:E}:s):s=vc(),p={baseLanes:p.baseLanes|l,cachePool:s}),i.memoizedState=p,i.childLanes=fu(t,c,l),e.memoizedState=ou,Vn(t.child,i)):(ql(e),l=t.child,t=l.sibling,l=hl(l,{mode:"visible",children:i.children}),l.return=e,l.sibling=null,t!==null&&(c=e.deletions,c===null?(e.deletions=[t],e.flags|=16):c.push(t)),e.child=l,e.memoizedState=null,l)}function du(t,e){return e=as({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function as(t,e){return t=Te(22,t,null,e),t.lanes=0,t}function hu(t,e,l){return mi(e,t.child,null,l),t=du(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Df(t,e,l){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),wr(t.return,e,l)}function gu(t,e,l,i,s,r){var c=t.memoizedState;c===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:l,tailMode:s,treeForkCount:r}:(c.isBackwards=e,c.rendering=null,c.renderingStartTime=0,c.last=i,c.tail=l,c.tailMode=s,c.treeForkCount=r)}function Of(t,e,l){var i=e.pendingProps,s=i.revealOrder,r=i.tail;i=i.children;var c=Pt.current,p=(c&2)!==0;if(p?(c=c&1|2,e.flags|=128):c&=1,Y(Pt,c),fe(t,e,i,l),i=Mt?Dn:0,!p&&t!==null&&(t.flags&128)!==0)t:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Df(t,l,e);else if(t.tag===19)Df(t,l,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;t.sibling===null;){if(t.return===null||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(s){case"forwards":for(l=e.child,s=null;l!==null;)t=l.alternate,t!==null&&Ka(t)===null&&(s=l),l=l.sibling;l=s,l===null?(s=e.child,e.child=null):(s=l.sibling,l.sibling=null),gu(e,!1,s,l,r,i);break;case"backwards":case"unstable_legacy-backwards":for(l=null,s=e.child,e.child=null;s!==null;){if(t=s.alternate,t!==null&&Ka(t)===null){e.child=s;break}t=s.sibling,s.sibling=l,l=s,s=t}gu(e,!0,l,null,r,i);break;case"together":gu(e,!1,null,null,void 0,i);break;default:e.memoizedState=null}return e.child}function xl(t,e,l){if(t!==null&&(e.dependencies=t.dependencies),Vl|=e.lanes,(l&e.childLanes)===0)if(t!==null){if(Qi(t,e,l,!1),(l&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(u(153));if(e.child!==null){for(t=e.child,l=hl(t,t.pendingProps),e.child=l,l.return=e;t.sibling!==null;)t=t.sibling,l=l.sibling=hl(t,t.pendingProps),l.return=e;l.sibling=null}return e.child}function mu(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&ka(t)))}function Zg(t,e,l){switch(e.tag){case 3:Qt(e,e.stateNode.containerInfo),Ul(e,ee,t.memoizedState.cache),oi();break;case 27:case 5:Al(e);break;case 4:Qt(e,e.stateNode.containerInfo);break;case 10:Ul(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,Gr(e),null;break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?(ql(e),e.flags|=128,null):(l&e.child.childLanes)!==0?jf(t,e,l):(ql(e),t=xl(t,e,l),t!==null?t.sibling:null);ql(e);break;case 19:var s=(t.flags&128)!==0;if(i=(l&e.childLanes)!==0,i||(Qi(t,e,l,!1),i=(l&e.childLanes)!==0),s){if(i)return Of(t,e,l);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Y(Pt,Pt.current),i)break;return null;case 22:return e.lanes=0,Cf(t,e,l,e.pendingProps);case 24:Ul(e,ee,t.memoizedState.cache)}return xl(t,e,l)}function Nf(t,e,l){if(t!==null)if(t.memoizedProps!==e.pendingProps)ie=!0;else{if(!mu(t,l)&&(e.flags&128)===0)return ie=!1,Zg(t,e,l);ie=(t.flags&131072)!==0}else ie=!1,Mt&&(e.flags&1048576)!==0&&fc(e,Dn,e.index);switch(e.lanes=0,e.tag){case 16:t:{var i=e.pendingProps;if(t=hi(e.elementType),e.type=t,typeof t=="function")br(t)?(i=yi(t,i),e.tag=1,e=Mf(null,e,t,i,l)):(e.tag=0,e=uu(null,e,t,i,l));else{if(t!=null){var s=t.$$typeof;if(s===st){e.tag=11,e=Ef(null,e,t,i,l);break t}else if(s===k){e.tag=14,e=_f(null,e,t,i,l);break t}}throw e=mt(t)||t,Error(u(306,e,""))}}return e;case 0:return uu(t,e,e.type,e.pendingProps,l);case 1:return i=e.type,s=yi(i,e.pendingProps),Mf(t,e,i,s,l);case 3:t:{if(Qt(e,e.stateNode.containerInfo),t===null)throw Error(u(387));i=e.pendingProps;var r=e.memoizedState;s=r.element,Hr(t,e),Gn(e,i,null,l);var c=e.memoizedState;if(i=c.cache,Ul(e,ee,i),i!==r.cache&&Mr(e,[ee],l,!0),kn(),i=c.element,r.isDehydrated)if(r={element:i,isDehydrated:!1,cache:c.cache},e.updateQueue.baseState=r,e.memoizedState=r,e.flags&256){e=Af(t,e,i,l);break t}else if(i!==s){s=Ue(Error(u(424)),e),On(s),e=Af(t,e,i,l);break t}else{switch(t=e.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Vt=Ye(t.firstChild),oe=e,Mt=!0,Hl=null,Ge=!0,l=zc(e,null,i,l),e.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(oi(),i===s){e=xl(t,e,l);break t}fe(t,e,i,l)}e=e.child}return e;case 26:return ns(t,e),t===null?(l=Vd(e.type,null,e.pendingProps,null))?e.memoizedState=l:Mt||(l=e.type,t=e.pendingProps,i=Ss(it.current).createElement(l),i[Jt]=e,i[se]=t,de(i,l,t),Yt(i),e.stateNode=i):e.memoizedState=Vd(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Al(e),t===null&&Mt&&(i=e.stateNode=Yd(e.type,e.pendingProps,it.current),oe=e,Ge=!0,s=Vt,$l(e.type)?(Ju=s,Vt=Ye(i.firstChild)):Vt=s),fe(t,e,e.pendingProps.children,l),ns(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&Mt&&((s=i=Vt)&&(i=Em(i,e.type,e.pendingProps,Ge),i!==null?(e.stateNode=i,oe=e,Vt=Ye(i.firstChild),Ge=!1,s=!0):s=!1),s||Ll(e)),Al(e),s=e.type,r=e.pendingProps,c=t!==null?t.memoizedProps:null,i=r.children,Xu(s,r)?i=null:c!==null&&Xu(s,c)&&(e.flags|=32),e.memoizedState!==null&&(s=Yr(t,e,Ug,null,null,l),sa._currentValue=s),ns(t,e),fe(t,e,i,l),e.child;case 6:return t===null&&Mt&&((t=l=Vt)&&(l=_m(l,e.pendingProps,Ge),l!==null?(e.stateNode=l,oe=e,Vt=null,t=!0):t=!1),t||Ll(e)),null;case 13:return jf(t,e,l);case 4:return Qt(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=mi(e,null,i,l):fe(t,e,i,l),e.child;case 11:return Ef(t,e,e.type,e.pendingProps,l);case 7:return fe(t,e,e.pendingProps,l),e.child;case 8:return fe(t,e,e.pendingProps.children,l),e.child;case 12:return fe(t,e,e.pendingProps.children,l),e.child;case 10:return i=e.pendingProps,Ul(e,e.type,i.value),fe(t,e,i.children,l),e.child;case 9:return s=e.type._context,i=e.pendingProps.children,fi(e),s=ce(s),i=i(s),e.flags|=1,fe(t,e,i,l),e.child;case 14:return _f(t,e,e.type,e.pendingProps,l);case 15:return zf(t,e,e.type,e.pendingProps,l);case 19:return Of(t,e,l);case 31:return Vg(t,e,l);case 22:return Cf(t,e,l,e.pendingProps);case 24:return fi(e),i=ce(ee),t===null?(s=Dr(),s===null&&(s=Xt,r=Ar(),s.pooledCache=r,r.refCount++,r!==null&&(s.pooledCacheLanes|=l),s=r),e.memoizedState={parent:i,cache:s},Nr(e),Ul(e,ee,s)):((t.lanes&l)!==0&&(Hr(t,e),Gn(e,null,null,l),kn()),s=t.memoizedState,r=e.memoizedState,s.parent!==i?(s={parent:i,cache:i},e.memoizedState=s,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=s),Ul(e,ee,i)):(i=r.cache,Ul(e,ee,i),i!==s.cache&&Mr(e,[ee],l,!0))),fe(t,e,e.pendingProps.children,l),e.child;case 29:throw e.pendingProps}throw Error(u(156,e.tag))}function bl(t){t.flags|=4}function pu(t,e,l,i,s){if((e=(t.mode&32)!==0)&&(e=!1),e){if(t.flags|=16777216,(s&335544128)===s)if(t.stateNode.complete)t.flags|=8192;else if(rd())t.flags|=8192;else throw gi=Xa,Or}else t.flags&=-16777217}function Hf(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!$d(e))if(rd())t.flags|=8192;else throw gi=Xa,Or}function ss(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?bn():536870912,t.lanes|=e,ln|=e)}function Zn(t,e){if(!Mt)switch(t.tailMode){case"hidden":e=t.tail;for(var l=null;e!==null;)e.alternate!==null&&(l=e),e=e.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var i=null;l!==null;)l.alternate!==null&&(i=l),l=l.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function Zt(t){var e=t.alternate!==null&&t.alternate.child===t.child,l=0,i=0;if(e)for(var s=t.child;s!==null;)l|=s.lanes|s.childLanes,i|=s.subtreeFlags&65011712,i|=s.flags&65011712,s.return=t,s=s.sibling;else for(s=t.child;s!==null;)l|=s.lanes|s.childLanes,i|=s.subtreeFlags,i|=s.flags,s.return=t,s=s.sibling;return t.subtreeFlags|=i,t.childLanes=l,e}function Kg(t,e,l){var i=e.pendingProps;switch(zr(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zt(e),null;case 1:return Zt(e),null;case 3:return l=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),pl(ee),vt(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(Xi(e)?bl(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,Tr())),Zt(e),null;case 26:var s=e.type,r=e.memoizedState;return t===null?(bl(e),r!==null?(Zt(e),Hf(e,r)):(Zt(e),pu(e,s,null,i,l))):r?r!==t.memoizedState?(bl(e),Zt(e),Hf(e,r)):(Zt(e),e.flags&=-16777217):(t=t.memoizedProps,t!==i&&bl(e),Zt(e),pu(e,s,t,i,l)),null;case 27:if(Ie(e),l=it.current,s=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&bl(e);else{if(!i){if(e.stateNode===null)throw Error(u(166));return Zt(e),null}t=W.current,Xi(e)?hc(e):(t=Yd(s,i,l),e.stateNode=t,bl(e))}return Zt(e),null;case 5:if(Ie(e),s=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&bl(e);else{if(!i){if(e.stateNode===null)throw Error(u(166));return Zt(e),null}if(r=W.current,Xi(e))hc(e);else{var c=Ss(it.current);switch(r){case 1:r=c.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:r=c.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":r=c.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":r=c.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":r=c.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof i.is=="string"?c.createElement("select",{is:i.is}):c.createElement("select"),i.multiple?r.multiple=!0:i.size&&(r.size=i.size);break;default:r=typeof i.is=="string"?c.createElement(s,{is:i.is}):c.createElement(s)}}r[Jt]=e,r[se]=i;t:for(c=e.child;c!==null;){if(c.tag===5||c.tag===6)r.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break t;for(;c.sibling===null;){if(c.return===null||c.return===e)break t;c=c.return}c.sibling.return=c.return,c=c.sibling}e.stateNode=r;t:switch(de(r,s,i),s){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break t;case"img":i=!0;break t;default:i=!1}i&&bl(e)}}return Zt(e),pu(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,l),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&bl(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(u(166));if(t=it.current,Xi(e)){if(t=e.stateNode,l=e.memoizedProps,i=null,s=oe,s!==null)switch(s.tag){case 27:case 5:i=s.memoizedProps}t[Jt]=e,t=!!(t.nodeValue===l||i!==null&&i.suppressHydrationWarning===!0||jd(t.nodeValue,l)),t||Ll(e,!0)}else t=Ss(t).createTextNode(i),t[Jt]=e,e.stateNode=t}return Zt(e),null;case 31:if(l=e.memoizedState,t===null||t.memoizedState!==null){if(i=Xi(e),l!==null){if(t===null){if(!i)throw Error(u(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(u(557));t[Jt]=e}else oi(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Zt(e),t=!1}else l=Tr(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return e.flags&256?(we(e),e):(we(e),null);if((e.flags&128)!==0)throw Error(u(558))}return Zt(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(s=Xi(e),i!==null&&i.dehydrated!==null){if(t===null){if(!s)throw Error(u(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(u(317));s[Jt]=e}else oi(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Zt(e),s=!1}else s=Tr(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),s=!0;if(!s)return e.flags&256?(we(e),e):(we(e),null)}return we(e),(e.flags&128)!==0?(e.lanes=l,e):(l=i!==null,t=t!==null&&t.memoizedState!==null,l&&(i=e.child,s=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(s=i.alternate.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==s&&(i.flags|=2048)),l!==t&&l&&(e.child.flags|=8192),ss(e,e.updateQueue),Zt(e),null);case 4:return vt(),t===null&&Bu(e.stateNode.containerInfo),Zt(e),null;case 10:return pl(e.type),Zt(e),null;case 19:if(j(Pt),i=e.memoizedState,i===null)return Zt(e),null;if(s=(e.flags&128)!==0,r=i.rendering,r===null)if(s)Zn(i,!1);else{if($t!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(r=Ka(t),r!==null){for(e.flags|=128,Zn(i,!1),t=r.updateQueue,e.updateQueue=t,ss(e,t),e.subtreeFlags=0,t=l,l=e.child;l!==null;)uc(l,t),l=l.sibling;return Y(Pt,Pt.current&1|2),Mt&&gl(e,i.treeForkCount),e.child}t=t.sibling}i.tail!==null&&he()>fs&&(e.flags|=128,s=!0,Zn(i,!1),e.lanes=4194304)}else{if(!s)if(t=Ka(r),t!==null){if(e.flags|=128,s=!0,t=t.updateQueue,e.updateQueue=t,ss(e,t),Zn(i,!0),i.tail===null&&i.tailMode==="hidden"&&!r.alternate&&!Mt)return Zt(e),null}else 2*he()-i.renderingStartTime>fs&&l!==536870912&&(e.flags|=128,s=!0,Zn(i,!1),e.lanes=4194304);i.isBackwards?(r.sibling=e.child,e.child=r):(t=i.last,t!==null?t.sibling=r:e.child=r,i.last=r)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=he(),t.sibling=null,l=Pt.current,Y(Pt,s?l&1|2:l&1),Mt&&gl(e,i.treeForkCount),t):(Zt(e),null);case 22:case 23:return we(e),kr(),i=e.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?(l&536870912)!==0&&(e.flags&128)===0&&(Zt(e),e.subtreeFlags&6&&(e.flags|=8192)):Zt(e),l=e.updateQueue,l!==null&&ss(e,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==l&&(e.flags|=2048),t!==null&&j(di),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),e.memoizedState.cache!==l&&(e.flags|=2048),pl(ee),Zt(e),null;case 25:return null;case 30:return null}throw Error(u(156,e.tag))}function Jg(t,e){switch(zr(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return pl(ee),vt(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Ie(e),null;case 31:if(e.memoizedState!==null){if(we(e),e.alternate===null)throw Error(u(340));oi()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(we(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(u(340));oi()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return j(Pt),null;case 4:return vt(),null;case 10:return pl(e.type),null;case 22:case 23:return we(e),kr(),t!==null&&j(di),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return pl(ee),null;case 25:return null;default:return null}}function Lf(t,e){switch(zr(e),e.tag){case 3:pl(ee),vt();break;case 26:case 27:case 5:Ie(e);break;case 4:vt();break;case 31:e.memoizedState!==null&&we(e);break;case 13:we(e);break;case 19:j(Pt);break;case 10:pl(e.type);break;case 22:case 23:we(e),kr(),t!==null&&j(di);break;case 24:pl(ee)}}function Kn(t,e){try{var l=e.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var s=i.next;l=s;do{if((l.tag&t)===t){i=void 0;var r=l.create,c=l.inst;i=r(),c.destroy=i}l=l.next}while(l!==s)}}catch(p){Lt(e,e.return,p)}}function Xl(t,e,l){try{var i=e.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var r=s.next;i=r;do{if((i.tag&t)===t){var c=i.inst,p=c.destroy;if(p!==void 0){c.destroy=void 0,s=e;var E=l,M=p;try{M()}catch(L){Lt(s,E,L)}}}i=i.next}while(i!==r)}}catch(L){Lt(e,e.return,L)}}function Uf(t){var e=t.updateQueue;if(e!==null){var l=t.stateNode;try{Tc(e,l)}catch(i){Lt(t,t.return,i)}}}function Bf(t,e,l){l.props=yi(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(i){Lt(t,e,i)}}function Jn(t,e){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode}typeof l=="function"?t.refCleanup=l(i):l.current=i}}catch(s){Lt(t,e,s)}}function al(t,e){var l=t.ref,i=t.refCleanup;if(l!==null)if(typeof i=="function")try{i()}catch(s){Lt(t,e,s)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(s){Lt(t,e,s)}else l.current=null}function kf(t){var e=t.type,l=t.memoizedProps,i=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":l.autoFocus&&i.focus();break t;case"img":l.src?i.src=l.src:l.srcSet&&(i.srcset=l.srcSet)}}catch(s){Lt(t,t.return,s)}}function yu(t,e,l){try{var i=t.stateNode;pm(i,t.type,l,e),i[se]=e}catch(s){Lt(t,t.return,s)}}function Gf(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&$l(t.type)||t.tag===4}function vu(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||Gf(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&$l(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function xu(t,e,l){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,e):(e=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,e.appendChild(t),l=l._reactRootContainer,l!=null||e.onclick!==null||(e.onclick=fl));else if(i!==4&&(i===27&&$l(t.type)&&(l=t.stateNode,e=null),t=t.child,t!==null))for(xu(t,e,l),t=t.sibling;t!==null;)xu(t,e,l),t=t.sibling}function rs(t,e,l){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?l.insertBefore(t,e):l.appendChild(t);else if(i!==4&&(i===27&&$l(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(rs(t,e,l),t=t.sibling;t!==null;)rs(t,e,l),t=t.sibling}function qf(t){var e=t.stateNode,l=t.memoizedProps;try{for(var i=t.type,s=e.attributes;s.length;)e.removeAttributeNode(s[0]);de(e,i,l),e[Jt]=t,e[se]=l}catch(r){Lt(t,t.return,r)}}var Sl=!1,ne=!1,bu=!1,Yf=typeof WeakSet=="function"?WeakSet:Set,ue=null;function Wg(t,e){if(t=t.containerInfo,qu=ws,t=Po(t),hr(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else t:{l=(l=t.ownerDocument)&&l.defaultView||window;var i=l.getSelection&&l.getSelection();if(i&&i.rangeCount!==0){l=i.anchorNode;var s=i.anchorOffset,r=i.focusNode;i=i.focusOffset;try{l.nodeType,r.nodeType}catch{l=null;break t}var c=0,p=-1,E=-1,M=0,L=0,B=t,A=null;e:for(;;){for(var O;B!==l||s!==0&&B.nodeType!==3||(p=c+s),B!==r||i!==0&&B.nodeType!==3||(E=c+i),B.nodeType===3&&(c+=B.nodeValue.length),(O=B.firstChild)!==null;)A=B,B=O;for(;;){if(B===t)break e;if(A===l&&++M===s&&(p=c),A===r&&++L===i&&(E=c),(O=B.nextSibling)!==null)break;B=A,A=B.parentNode}B=O}l=p===-1||E===-1?null:{start:p,end:E}}else l=null}l=l||{start:0,end:0}}else l=null;for(Yu={focusedElem:t,selectionRange:l},ws=!1,ue=e;ue!==null;)if(e=ue,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ue=t;else for(;ue!==null;){switch(e=ue,r=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)s=t[l],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&r!==null){t=void 0,l=e,s=r.memoizedProps,r=r.memoizedState,i=l.stateNode;try{var tt=yi(l.type,s);t=i.getSnapshotBeforeUpdate(tt,r),i.__reactInternalSnapshotBeforeUpdate=t}catch(ft){Lt(l,l.return,ft)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,l=t.nodeType,l===9)Vu(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Vu(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(u(163))}if(t=e.sibling,t!==null){t.return=e.return,ue=t;break}ue=e.return}}function Xf(t,e,l){var i=l.flags;switch(l.tag){case 0:case 11:case 15:_l(t,l),i&4&&Kn(5,l);break;case 1:if(_l(t,l),i&4)if(t=l.stateNode,e===null)try{t.componentDidMount()}catch(c){Lt(l,l.return,c)}else{var s=yi(l.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(s,e,t.__reactInternalSnapshotBeforeUpdate)}catch(c){Lt(l,l.return,c)}}i&64&&Uf(l),i&512&&Jn(l,l.return);break;case 3:if(_l(t,l),i&64&&(t=l.updateQueue,t!==null)){if(e=null,l.child!==null)switch(l.child.tag){case 27:case 5:e=l.child.stateNode;break;case 1:e=l.child.stateNode}try{Tc(t,e)}catch(c){Lt(l,l.return,c)}}break;case 27:e===null&&i&4&&qf(l);case 26:case 5:_l(t,l),e===null&&i&4&&kf(l),i&512&&Jn(l,l.return);break;case 12:_l(t,l);break;case 31:_l(t,l),i&4&&Zf(t,l);break;case 13:_l(t,l),i&4&&Kf(t,l),i&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=nm.bind(null,l),zm(t,l))));break;case 22:if(i=l.memoizedState!==null||Sl,!i){e=e!==null&&e.memoizedState!==null||ne,s=Sl;var r=ne;Sl=i,(ne=e)&&!r?zl(t,l,(l.subtreeFlags&8772)!==0):_l(t,l),Sl=s,ne=r}break;case 30:break;default:_l(t,l)}}function Qf(t){var e=t.alternate;e!==null&&(t.alternate=null,Qf(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&I(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Kt=null,be=!1;function El(t,e,l){for(l=l.child;l!==null;)Vf(t,e,l),l=l.sibling}function Vf(t,e,l){if(ge&&typeof ge.onCommitFiberUnmount=="function")try{ge.onCommitFiberUnmount(li,l)}catch{}switch(l.tag){case 26:ne||al(l,e),El(t,e,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:ne||al(l,e);var i=Kt,s=be;$l(l.type)&&(Kt=l.stateNode,be=!1),El(t,e,l),ia(l.stateNode),Kt=i,be=s;break;case 5:ne||al(l,e);case 6:if(i=Kt,s=be,Kt=null,El(t,e,l),Kt=i,be=s,Kt!==null)if(be)try{(Kt.nodeType===9?Kt.body:Kt.nodeName==="HTML"?Kt.ownerDocument.body:Kt).removeChild(l.stateNode)}catch(r){Lt(l,e,r)}else try{Kt.removeChild(l.stateNode)}catch(r){Lt(l,e,r)}break;case 18:Kt!==null&&(be?(t=Kt,Ud(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),fn(t)):Ud(Kt,l.stateNode));break;case 4:i=Kt,s=be,Kt=l.stateNode.containerInfo,be=!0,El(t,e,l),Kt=i,be=s;break;case 0:case 11:case 14:case 15:Xl(2,l,e),ne||Xl(4,l,e),El(t,e,l);break;case 1:ne||(al(l,e),i=l.stateNode,typeof i.componentWillUnmount=="function"&&Bf(l,e,i)),El(t,e,l);break;case 21:El(t,e,l);break;case 22:ne=(i=ne)||l.memoizedState!==null,El(t,e,l),ne=i;break;default:El(t,e,l)}}function Zf(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{fn(t)}catch(l){Lt(e,e.return,l)}}}function Kf(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{fn(t)}catch(l){Lt(e,e.return,l)}}function $g(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new Yf),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new Yf),e;default:throw Error(u(435,t.tag))}}function us(t,e){var l=$g(t);e.forEach(function(i){if(!l.has(i)){l.add(i);var s=am.bind(null,t,i);i.then(s,s)}})}function Se(t,e){var l=e.deletions;if(l!==null)for(var i=0;i<l.length;i++){var s=l[i],r=t,c=e,p=c;t:for(;p!==null;){switch(p.tag){case 27:if($l(p.type)){Kt=p.stateNode,be=!1;break t}break;case 5:Kt=p.stateNode,be=!1;break t;case 3:case 4:Kt=p.stateNode.containerInfo,be=!0;break t}p=p.return}if(Kt===null)throw Error(u(160));Vf(r,c,s),Kt=null,be=!1,r=s.alternate,r!==null&&(r.return=null),s.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)Jf(e,t),e=e.sibling}var We=null;function Jf(t,e){var l=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Se(e,t),Ee(t),i&4&&(Xl(3,t,t.return),Kn(3,t),Xl(5,t,t.return));break;case 1:Se(e,t),Ee(t),i&512&&(ne||l===null||al(l,l.return)),i&64&&Sl&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?i:l.concat(i))));break;case 26:var s=We;if(Se(e,t),Ee(t),i&512&&(ne||l===null||al(l,l.return)),i&4){var r=l!==null?l.memoizedState:null;if(i=t.memoizedState,l===null)if(i===null)if(t.stateNode===null){t:{i=t.type,l=t.memoizedProps,s=s.ownerDocument||s;e:switch(i){case"title":r=s.getElementsByTagName("title")[0],(!r||r[F]||r[Jt]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=s.createElement(i),s.head.insertBefore(r,s.querySelector("head > title"))),de(r,i,l),r[Jt]=t,Yt(r),i=r;break t;case"link":var c=Jd("link","href",s).get(i+(l.href||""));if(c){for(var p=0;p<c.length;p++)if(r=c[p],r.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&r.getAttribute("rel")===(l.rel==null?null:l.rel)&&r.getAttribute("title")===(l.title==null?null:l.title)&&r.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){c.splice(p,1);break e}}r=s.createElement(i),de(r,i,l),s.head.appendChild(r);break;case"meta":if(c=Jd("meta","content",s).get(i+(l.content||""))){for(p=0;p<c.length;p++)if(r=c[p],r.getAttribute("content")===(l.content==null?null:""+l.content)&&r.getAttribute("name")===(l.name==null?null:l.name)&&r.getAttribute("property")===(l.property==null?null:l.property)&&r.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&r.getAttribute("charset")===(l.charSet==null?null:l.charSet)){c.splice(p,1);break e}}r=s.createElement(i),de(r,i,l),s.head.appendChild(r);break;default:throw Error(u(468,i))}r[Jt]=t,Yt(r),i=r}t.stateNode=i}else Wd(s,t.type,t.stateNode);else t.stateNode=Kd(s,i,t.memoizedProps);else r!==i?(r===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):r.count--,i===null?Wd(s,t.type,t.stateNode):Kd(s,i,t.memoizedProps)):i===null&&t.stateNode!==null&&yu(t,t.memoizedProps,l.memoizedProps)}break;case 27:Se(e,t),Ee(t),i&512&&(ne||l===null||al(l,l.return)),l!==null&&i&4&&yu(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Se(e,t),Ee(t),i&512&&(ne||l===null||al(l,l.return)),t.flags&32){s=t.stateNode;try{Oi(s,"")}catch(tt){Lt(t,t.return,tt)}}i&4&&t.stateNode!=null&&(s=t.memoizedProps,yu(t,s,l!==null?l.memoizedProps:s)),i&1024&&(bu=!0);break;case 6:if(Se(e,t),Ee(t),i&4){if(t.stateNode===null)throw Error(u(162));i=t.memoizedProps,l=t.stateNode;try{l.nodeValue=i}catch(tt){Lt(t,t.return,tt)}}break;case 3:if(zs=null,s=We,We=Es(e.containerInfo),Se(e,t),We=s,Ee(t),i&4&&l!==null&&l.memoizedState.isDehydrated)try{fn(e.containerInfo)}catch(tt){Lt(t,t.return,tt)}bu&&(bu=!1,Wf(t));break;case 4:i=We,We=Es(t.stateNode.containerInfo),Se(e,t),Ee(t),We=i;break;case 12:Se(e,t),Ee(t);break;case 31:Se(e,t),Ee(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,us(t,i)));break;case 13:Se(e,t),Ee(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(cs=he()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,us(t,i)));break;case 22:s=t.memoizedState!==null;var E=l!==null&&l.memoizedState!==null,M=Sl,L=ne;if(Sl=M||s,ne=L||E,Se(e,t),ne=L,Sl=M,Ee(t),i&8192)t:for(e=t.stateNode,e._visibility=s?e._visibility&-2:e._visibility|1,s&&(l===null||E||Sl||ne||vi(t)),l=null,e=t;;){if(e.tag===5||e.tag===26){if(l===null){E=l=e;try{if(r=E.stateNode,s)c=r.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none";else{p=E.stateNode;var B=E.memoizedProps.style,A=B!=null&&B.hasOwnProperty("display")?B.display:null;p.style.display=A==null||typeof A=="boolean"?"":(""+A).trim()}}catch(tt){Lt(E,E.return,tt)}}}else if(e.tag===6){if(l===null){E=e;try{E.stateNode.nodeValue=s?"":E.memoizedProps}catch(tt){Lt(E,E.return,tt)}}}else if(e.tag===18){if(l===null){E=e;try{var O=E.stateNode;s?Bd(O,!0):Bd(E.stateNode,!1)}catch(tt){Lt(E,E.return,tt)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break t;for(;e.sibling===null;){if(e.return===null||e.return===t)break t;l===e&&(l=null),e=e.return}l===e&&(l=null),e.sibling.return=e.return,e=e.sibling}i&4&&(i=t.updateQueue,i!==null&&(l=i.retryQueue,l!==null&&(i.retryQueue=null,us(t,l))));break;case 19:Se(e,t),Ee(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,us(t,i)));break;case 30:break;case 21:break;default:Se(e,t),Ee(t)}}function Ee(t){var e=t.flags;if(e&2){try{for(var l,i=t.return;i!==null;){if(Gf(i)){l=i;break}i=i.return}if(l==null)throw Error(u(160));switch(l.tag){case 27:var s=l.stateNode,r=vu(t);rs(t,r,s);break;case 5:var c=l.stateNode;l.flags&32&&(Oi(c,""),l.flags&=-33);var p=vu(t);rs(t,p,c);break;case 3:case 4:var E=l.stateNode.containerInfo,M=vu(t);xu(t,M,E);break;default:throw Error(u(161))}}catch(L){Lt(t,t.return,L)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function Wf(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;Wf(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function _l(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)Xf(t,e.alternate,e),e=e.sibling}function vi(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Xl(4,e,e.return),vi(e);break;case 1:al(e,e.return);var l=e.stateNode;typeof l.componentWillUnmount=="function"&&Bf(e,e.return,l),vi(e);break;case 27:ia(e.stateNode);case 26:case 5:al(e,e.return),vi(e);break;case 22:e.memoizedState===null&&vi(e);break;case 30:vi(e);break;default:vi(e)}t=t.sibling}}function zl(t,e,l){for(l=l&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,s=t,r=e,c=r.flags;switch(r.tag){case 0:case 11:case 15:zl(s,r,l),Kn(4,r);break;case 1:if(zl(s,r,l),i=r,s=i.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(M){Lt(i,i.return,M)}if(i=r,s=i.updateQueue,s!==null){var p=i.stateNode;try{var E=s.shared.hiddenCallbacks;if(E!==null)for(s.shared.hiddenCallbacks=null,s=0;s<E.length;s++)Cc(E[s],p)}catch(M){Lt(i,i.return,M)}}l&&c&64&&Uf(r),Jn(r,r.return);break;case 27:qf(r);case 26:case 5:zl(s,r,l),l&&i===null&&c&4&&kf(r),Jn(r,r.return);break;case 12:zl(s,r,l);break;case 31:zl(s,r,l),l&&c&4&&Zf(s,r);break;case 13:zl(s,r,l),l&&c&4&&Kf(s,r);break;case 22:r.memoizedState===null&&zl(s,r,l),Jn(r,r.return);break;case 30:break;default:zl(s,r,l)}e=e.sibling}}function Su(t,e){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&Nn(l))}function Eu(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Nn(t))}function $e(t,e,l,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)$f(t,e,l,i),e=e.sibling}function $f(t,e,l,i){var s=e.flags;switch(e.tag){case 0:case 11:case 15:$e(t,e,l,i),s&2048&&Kn(9,e);break;case 1:$e(t,e,l,i);break;case 3:$e(t,e,l,i),s&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Nn(t)));break;case 12:if(s&2048){$e(t,e,l,i),t=e.stateNode;try{var r=e.memoizedProps,c=r.id,p=r.onPostCommit;typeof p=="function"&&p(c,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(E){Lt(e,e.return,E)}}else $e(t,e,l,i);break;case 31:$e(t,e,l,i);break;case 13:$e(t,e,l,i);break;case 23:break;case 22:r=e.stateNode,c=e.alternate,e.memoizedState!==null?r._visibility&2?$e(t,e,l,i):Wn(t,e):r._visibility&2?$e(t,e,l,i):(r._visibility|=2,Pi(t,e,l,i,(e.subtreeFlags&10256)!==0||!1)),s&2048&&Su(c,e);break;case 24:$e(t,e,l,i),s&2048&&Eu(e.alternate,e);break;default:$e(t,e,l,i)}}function Pi(t,e,l,i,s){for(s=s&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var r=t,c=e,p=l,E=i,M=c.flags;switch(c.tag){case 0:case 11:case 15:Pi(r,c,p,E,s),Kn(8,c);break;case 23:break;case 22:var L=c.stateNode;c.memoizedState!==null?L._visibility&2?Pi(r,c,p,E,s):Wn(r,c):(L._visibility|=2,Pi(r,c,p,E,s)),s&&M&2048&&Su(c.alternate,c);break;case 24:Pi(r,c,p,E,s),s&&M&2048&&Eu(c.alternate,c);break;default:Pi(r,c,p,E,s)}e=e.sibling}}function Wn(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var l=t,i=e,s=i.flags;switch(i.tag){case 22:Wn(l,i),s&2048&&Su(i.alternate,i);break;case 24:Wn(l,i),s&2048&&Eu(i.alternate,i);break;default:Wn(l,i)}e=e.sibling}}var $n=8192;function tn(t,e,l){if(t.subtreeFlags&$n)for(t=t.child;t!==null;)Ff(t,e,l),t=t.sibling}function Ff(t,e,l){switch(t.tag){case 26:tn(t,e,l),t.flags&$n&&t.memoizedState!==null&&Lm(l,We,t.memoizedState,t.memoizedProps);break;case 5:tn(t,e,l);break;case 3:case 4:var i=We;We=Es(t.stateNode.containerInfo),tn(t,e,l),We=i;break;case 22:t.memoizedState===null&&(i=t.alternate,i!==null&&i.memoizedState!==null?(i=$n,$n=16777216,tn(t,e,l),$n=i):tn(t,e,l));break;default:tn(t,e,l)}}function If(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function Fn(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var l=0;l<e.length;l++){var i=e[l];ue=i,td(i,t)}If(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Pf(t),t=t.sibling}function Pf(t){switch(t.tag){case 0:case 11:case 15:Fn(t),t.flags&2048&&Xl(9,t,t.return);break;case 3:Fn(t);break;case 12:Fn(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,os(t)):Fn(t);break;default:Fn(t)}}function os(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var l=0;l<e.length;l++){var i=e[l];ue=i,td(i,t)}If(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Xl(8,e,e.return),os(e);break;case 22:l=e.stateNode,l._visibility&2&&(l._visibility&=-3,os(e));break;default:os(e)}t=t.sibling}}function td(t,e){for(;ue!==null;){var l=ue;switch(l.tag){case 0:case 11:case 15:Xl(8,l,e);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var i=l.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Nn(l.memoizedState.cache)}if(i=l.child,i!==null)i.return=l,ue=i;else t:for(l=t;ue!==null;){i=ue;var s=i.sibling,r=i.return;if(Qf(i),i===l){ue=null;break t}if(s!==null){s.return=r,ue=s;break t}ue=r}}}var Fg={getCacheForType:function(t){var e=ce(ee),l=e.data.get(t);return l===void 0&&(l=t(),e.data.set(t,l)),l},cacheSignal:function(){return ce(ee).controller.signal}},Ig=typeof WeakMap=="function"?WeakMap:Map,Ot=0,Xt=null,Ct=null,Rt=0,Ht=0,Me=null,Ql=!1,en=!1,_u=!1,Cl=0,$t=0,Vl=0,xi=0,zu=0,Ae=0,ln=0,In=null,_e=null,Cu=!1,cs=0,ed=0,fs=1/0,ds=null,Zl=null,re=0,Kl=null,nn=null,Tl=0,Tu=0,Ru=null,ld=null,Pn=0,wu=null;function je(){return(Ot&2)!==0&&Rt!==0?Rt&-Rt:R.T!==null?Nu():Sa()}function id(){if(Ae===0)if((Rt&536870912)===0||Mt){var t=Ri;Ri<<=1,(Ri&3932160)===0&&(Ri=262144),Ae=t}else Ae=536870912;return t=Re.current,t!==null&&(t.flags|=32),Ae}function ze(t,e,l){(t===Xt&&(Ht===2||Ht===9)||t.cancelPendingCommit!==null)&&(an(t,0),Jl(t,Rt,Ae,!1)),ii(t,l),((Ot&2)===0||t!==Xt)&&(t===Xt&&((Ot&2)===0&&(xi|=l),$t===4&&Jl(t,Rt,Ae,!1)),sl(t))}function nd(t,e,l){if((Ot&6)!==0)throw Error(u(327));var i=!l&&(e&127)===0&&(e&t.expiredLanes)===0||Ve(t,e),s=i?em(t,e):Au(t,e,!0),r=i;do{if(s===0){en&&!i&&Jl(t,e,0,!1);break}else{if(l=t.current.alternate,r&&!Pg(l)){s=Au(t,e,!1),r=!1;continue}if(s===2){if(r=e,t.errorRecoveryDisabledLanes&r)var c=0;else c=t.pendingLanes&-536870913,c=c!==0?c:c&536870912?536870912:0;if(c!==0){e=c;t:{var p=t;s=In;var E=p.current.memoizedState.isDehydrated;if(E&&(an(p,c).flags|=256),c=Au(p,c,!1),c!==2){if(_u&&!E){p.errorRecoveryDisabledLanes|=r,xi|=r,s=4;break t}r=_e,_e=s,r!==null&&(_e===null?_e=r:_e.push.apply(_e,r))}s=c}if(r=!1,s!==2)continue}}if(s===1){an(t,0),Jl(t,e,0,!0);break}t:{switch(i=t,r=s,r){case 0:case 1:throw Error(u(345));case 4:if((e&4194048)!==e)break;case 6:Jl(i,e,Ae,!Ql);break t;case 2:_e=null;break;case 3:case 5:break;default:throw Error(u(329))}if((e&62914560)===e&&(s=cs+300-he(),10<s)){if(Jl(i,e,Ae,!Ql),Mi(i,0,!0)!==0)break t;Tl=e,i.timeoutHandle=Hd(ad.bind(null,i,l,_e,ds,Cu,e,Ae,xi,ln,Ql,r,"Throttled",-0,0),s);break t}ad(i,l,_e,ds,Cu,e,Ae,xi,ln,Ql,r,null,-0,0)}}break}while(!0);sl(t)}function ad(t,e,l,i,s,r,c,p,E,M,L,B,A,O){if(t.timeoutHandle=-1,B=e.subtreeFlags,B&8192||(B&16785408)===16785408){B={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:fl},Ff(e,r,B);var tt=(r&62914560)===r?cs-he():(r&4194048)===r?ed-he():0;if(tt=Um(B,tt),tt!==null){Tl=r,t.cancelPendingCommit=tt(hd.bind(null,t,e,r,l,i,s,c,p,E,L,B,null,A,O)),Jl(t,r,c,!M);return}}hd(t,e,r,l,i,s,c,p,E)}function Pg(t){for(var e=t;;){var l=e.tag;if((l===0||l===11||l===15)&&e.flags&16384&&(l=e.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var i=0;i<l.length;i++){var s=l[i],r=s.getSnapshot;s=s.value;try{if(!Ce(r(),s))return!1}catch{return!1}}if(l=e.child,e.subtreeFlags&16384&&l!==null)l.return=e,e=l;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Jl(t,e,l,i){e&=~zu,e&=~xi,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var s=e;0<s;){var r=31-ae(s),c=1<<r;i[r]=-1,s&=~c}l!==0&&va(t,l,e)}function hs(){return(Ot&6)===0?(ta(0),!1):!0}function Mu(){if(Ct!==null){if(Ht===0)var t=Ct.return;else t=Ct,ml=ci=null,Vr(t),Ji=null,Ln=0,t=Ct;for(;t!==null;)Lf(t.alternate,t),t=t.return;Ct=null}}function an(t,e){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,xm(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Tl=0,Mu(),Xt=t,Ct=l=hl(t.current,null),Rt=e,Ht=0,Me=null,Ql=!1,en=Ve(t,e),_u=!1,ln=Ae=zu=xi=Vl=$t=0,_e=In=null,Cu=!1,(e&8)!==0&&(e|=e&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=e;0<i;){var s=31-ae(i),r=1<<s;e|=t[s],i&=~r}return Cl=e,Na(),l}function sd(t,e){_t=null,R.H=Qn,e===Ki||e===Ya?(e=Sc(),Ht=3):e===Or?(e=Sc(),Ht=4):Ht=e===ru?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,Me=e,Ct===null&&($t=1,ls(t,Ue(e,t.current)))}function rd(){var t=Re.current;return t===null?!0:(Rt&4194048)===Rt?qe===null:(Rt&62914560)===Rt||(Rt&536870912)!==0?t===qe:!1}function ud(){var t=R.H;return R.H=Qn,t===null?Qn:t}function od(){var t=R.A;return R.A=Fg,t}function gs(){$t=4,Ql||(Rt&4194048)!==Rt&&Re.current!==null||(en=!0),(Vl&134217727)===0&&(xi&134217727)===0||Xt===null||Jl(Xt,Rt,Ae,!1)}function Au(t,e,l){var i=Ot;Ot|=2;var s=ud(),r=od();(Xt!==t||Rt!==e)&&(ds=null,an(t,e)),e=!1;var c=$t;t:do try{if(Ht!==0&&Ct!==null){var p=Ct,E=Me;switch(Ht){case 8:Mu(),c=6;break t;case 3:case 2:case 9:case 6:Re.current===null&&(e=!0);var M=Ht;if(Ht=0,Me=null,sn(t,p,E,M),l&&en){c=0;break t}break;default:M=Ht,Ht=0,Me=null,sn(t,p,E,M)}}tm(),c=$t;break}catch(L){sd(t,L)}while(!0);return e&&t.shellSuspendCounter++,ml=ci=null,Ot=i,R.H=s,R.A=r,Ct===null&&(Xt=null,Rt=0,Na()),c}function tm(){for(;Ct!==null;)cd(Ct)}function em(t,e){var l=Ot;Ot|=2;var i=ud(),s=od();Xt!==t||Rt!==e?(ds=null,fs=he()+500,an(t,e)):en=Ve(t,e);t:do try{if(Ht!==0&&Ct!==null){e=Ct;var r=Me;e:switch(Ht){case 1:Ht=0,Me=null,sn(t,e,r,1);break;case 2:case 9:if(xc(r)){Ht=0,Me=null,fd(e);break}e=function(){Ht!==2&&Ht!==9||Xt!==t||(Ht=7),sl(t)},r.then(e,e);break t;case 3:Ht=7;break t;case 4:Ht=5;break t;case 7:xc(r)?(Ht=0,Me=null,fd(e)):(Ht=0,Me=null,sn(t,e,r,7));break;case 5:var c=null;switch(Ct.tag){case 26:c=Ct.memoizedState;case 5:case 27:var p=Ct;if(c?$d(c):p.stateNode.complete){Ht=0,Me=null;var E=p.sibling;if(E!==null)Ct=E;else{var M=p.return;M!==null?(Ct=M,ms(M)):Ct=null}break e}}Ht=0,Me=null,sn(t,e,r,5);break;case 6:Ht=0,Me=null,sn(t,e,r,6);break;case 8:Mu(),$t=6;break t;default:throw Error(u(462))}}lm();break}catch(L){sd(t,L)}while(!0);return ml=ci=null,R.H=i,R.A=s,Ot=l,Ct!==null?0:(Xt=null,Rt=0,Na(),$t)}function lm(){for(;Ct!==null&&!ma();)cd(Ct)}function cd(t){var e=Nf(t.alternate,t,Cl);t.memoizedProps=t.pendingProps,e===null?ms(t):Ct=e}function fd(t){var e=t,l=e.alternate;switch(e.tag){case 15:case 0:e=wf(l,e,e.pendingProps,e.type,void 0,Rt);break;case 11:e=wf(l,e,e.pendingProps,e.type.render,e.ref,Rt);break;case 5:Vr(e);default:Lf(l,e),e=Ct=uc(e,Cl),e=Nf(l,e,Cl)}t.memoizedProps=t.pendingProps,e===null?ms(t):Ct=e}function sn(t,e,l,i){ml=ci=null,Vr(e),Ji=null,Ln=0;var s=e.return;try{if(Qg(t,s,e,l,Rt)){$t=1,ls(t,Ue(l,t.current)),Ct=null;return}}catch(r){if(s!==null)throw Ct=s,r;$t=1,ls(t,Ue(l,t.current)),Ct=null;return}e.flags&32768?(Mt||i===1?t=!0:en||(Rt&536870912)!==0?t=!1:(Ql=t=!0,(i===2||i===9||i===3||i===6)&&(i=Re.current,i!==null&&i.tag===13&&(i.flags|=16384))),dd(e,t)):ms(e)}function ms(t){var e=t;do{if((e.flags&32768)!==0){dd(e,Ql);return}t=e.return;var l=Kg(e.alternate,e,Cl);if(l!==null){Ct=l;return}if(e=e.sibling,e!==null){Ct=e;return}Ct=e=t}while(e!==null);$t===0&&($t=5)}function dd(t,e){do{var l=Jg(t.alternate,t);if(l!==null){l.flags&=32767,Ct=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!e&&(t=t.sibling,t!==null)){Ct=t;return}Ct=t=l}while(t!==null);$t=6,Ct=null}function hd(t,e,l,i,s,r,c,p,E){t.cancelPendingCommit=null;do ps();while(re!==0);if((Ot&6)!==0)throw Error(u(327));if(e!==null){if(e===t.current)throw Error(u(177));if(r=e.lanes|e.childLanes,r|=vr,$s(t,l,r,c,p,E),t===Xt&&(Ct=Xt=null,Rt=0),nn=e,Kl=t,Tl=l,Tu=r,Ru=s,ld=i,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,sm(Ft,function(){return vd(),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||i){i=R.T,R.T=null,s=V.p,V.p=2,c=Ot,Ot|=4;try{Wg(t,e,l)}finally{Ot=c,V.p=s,R.T=i}}re=1,gd(),md(),pd()}}function gd(){if(re===1){re=0;var t=Kl,e=nn,l=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||l){l=R.T,R.T=null;var i=V.p;V.p=2;var s=Ot;Ot|=4;try{Jf(e,t);var r=Yu,c=Po(t.containerInfo),p=r.focusedElem,E=r.selectionRange;if(c!==p&&p&&p.ownerDocument&&Io(p.ownerDocument.documentElement,p)){if(E!==null&&hr(p)){var M=E.start,L=E.end;if(L===void 0&&(L=M),"selectionStart"in p)p.selectionStart=M,p.selectionEnd=Math.min(L,p.value.length);else{var B=p.ownerDocument||document,A=B&&B.defaultView||window;if(A.getSelection){var O=A.getSelection(),tt=p.textContent.length,ft=Math.min(E.start,tt),Gt=E.end===void 0?ft:Math.min(E.end,tt);!O.extend&&ft>Gt&&(c=Gt,Gt=ft,ft=c);var T=Fo(p,ft),z=Fo(p,Gt);if(T&&z&&(O.rangeCount!==1||O.anchorNode!==T.node||O.anchorOffset!==T.offset||O.focusNode!==z.node||O.focusOffset!==z.offset)){var w=B.createRange();w.setStart(T.node,T.offset),O.removeAllRanges(),ft>Gt?(O.addRange(w),O.extend(z.node,z.offset)):(w.setEnd(z.node,z.offset),O.addRange(w))}}}}for(B=[],O=p;O=O.parentNode;)O.nodeType===1&&B.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<B.length;p++){var U=B[p];U.element.scrollLeft=U.left,U.element.scrollTop=U.top}}ws=!!qu,Yu=qu=null}finally{Ot=s,V.p=i,R.T=l}}t.current=e,re=2}}function md(){if(re===2){re=0;var t=Kl,e=nn,l=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||l){l=R.T,R.T=null;var i=V.p;V.p=2;var s=Ot;Ot|=4;try{Xf(t,e.alternate,e)}finally{Ot=s,V.p=i,R.T=l}}re=3}}function pd(){if(re===4||re===3){re=0,pa();var t=Kl,e=nn,l=Tl,i=ld;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?re=5:(re=0,nn=Kl=null,yd(t,t.pendingLanes));var s=t.pendingLanes;if(s===0&&(Zl=null),ji(l),e=e.stateNode,ge&&typeof ge.onCommitFiberRoot=="function")try{ge.onCommitFiberRoot(li,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=R.T,s=V.p,V.p=2,R.T=null;try{for(var r=t.onRecoverableError,c=0;c<i.length;c++){var p=i[c];r(p.value,{componentStack:p.stack})}}finally{R.T=e,V.p=s}}(Tl&3)!==0&&ps(),sl(t),s=t.pendingLanes,(l&261930)!==0&&(s&42)!==0?t===wu?Pn++:(Pn=0,wu=t):Pn=0,ta(0)}}function yd(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Nn(e)))}function ps(){return gd(),md(),pd(),vd()}function vd(){if(re!==5)return!1;var t=Kl,e=Tu;Tu=0;var l=ji(Tl),i=R.T,s=V.p;try{V.p=32>l?32:l,R.T=null,l=Ru,Ru=null;var r=Kl,c=Tl;if(re=0,nn=Kl=null,Tl=0,(Ot&6)!==0)throw Error(u(331));var p=Ot;if(Ot|=4,Pf(r.current),$f(r,r.current,c,l),Ot=p,ta(0,!1),ge&&typeof ge.onPostCommitFiberRoot=="function")try{ge.onPostCommitFiberRoot(li,r)}catch{}return!0}finally{V.p=s,R.T=i,yd(t,e)}}function xd(t,e,l){e=Ue(l,e),e=su(t.stateNode,e,2),t=Gl(t,e,2),t!==null&&(ii(t,2),sl(t))}function Lt(t,e,l){if(t.tag===3)xd(t,t,l);else for(;e!==null;){if(e.tag===3){xd(e,t,l);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Zl===null||!Zl.has(i))){t=Ue(l,t),l=bf(2),i=Gl(e,l,2),i!==null&&(Sf(l,i,e,t),ii(i,2),sl(i));break}}e=e.return}}function ju(t,e,l){var i=t.pingCache;if(i===null){i=t.pingCache=new Ig;var s=new Set;i.set(e,s)}else s=i.get(e),s===void 0&&(s=new Set,i.set(e,s));s.has(l)||(_u=!0,s.add(l),t=im.bind(null,t,e,l),e.then(t,t))}function im(t,e,l){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,Xt===t&&(Rt&l)===l&&($t===4||$t===3&&(Rt&62914560)===Rt&&300>he()-cs?(Ot&2)===0&&an(t,0):zu|=l,ln===Rt&&(ln=0)),sl(t)}function bd(t,e){e===0&&(e=bn()),t=ri(t,e),t!==null&&(ii(t,e),sl(t))}function nm(t){var e=t.memoizedState,l=0;e!==null&&(l=e.retryLane),bd(t,l)}function am(t,e){var l=0;switch(t.tag){case 31:case 13:var i=t.stateNode,s=t.memoizedState;s!==null&&(l=s.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(u(314))}i!==null&&i.delete(e),bd(t,l)}function sm(t,e){return zi(t,e)}var ys=null,rn=null,Du=!1,vs=!1,Ou=!1,Wl=0;function sl(t){t!==rn&&t.next===null&&(rn===null?ys=rn=t:rn=rn.next=t),vs=!0,Du||(Du=!0,um())}function ta(t,e){if(!Ou&&vs){Ou=!0;do for(var l=!1,i=ys;i!==null;){if(t!==0){var s=i.pendingLanes;if(s===0)var r=0;else{var c=i.suspendedLanes,p=i.pingedLanes;r=(1<<31-ae(42|t)+1)-1,r&=s&~(c&~p),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(l=!0,zd(i,r))}else r=Rt,r=Mi(i,i===Xt?r:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(r&3)===0||Ve(i,r)||(l=!0,zd(i,r));i=i.next}while(l);Ou=!1}}function rm(){Sd()}function Sd(){vs=Du=!1;var t=0;Wl!==0&&vm()&&(t=Wl);for(var e=he(),l=null,i=ys;i!==null;){var s=i.next,r=Ed(i,e);r===0?(i.next=null,l===null?ys=s:l.next=s,s===null&&(rn=l)):(l=i,(t!==0||(r&3)!==0)&&(vs=!0)),i=s}re!==0&&re!==5||ta(t),Wl!==0&&(Wl=0)}function Ed(t,e){for(var l=t.suspendedLanes,i=t.pingedLanes,s=t.expirationTimes,r=t.pendingLanes&-62914561;0<r;){var c=31-ae(r),p=1<<c,E=s[c];E===-1?((p&l)===0||(p&i)!==0)&&(s[c]=xn(p,e)):E<=e&&(t.expiredLanes|=p),r&=~p}if(e=Xt,l=Rt,l=Mi(t,t===e?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,l===0||t===e&&(Ht===2||Ht===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&Ci(i),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||Ve(t,l)){if(e=l&-l,e===t.callbackPriority)return e;switch(i!==null&&Ci(i),ji(l)){case 2:case 8:l=qt;break;case 32:l=Ft;break;case 268435456:l=ya;break;default:l=Ft}return i=_d.bind(null,t),l=zi(l,i),t.callbackPriority=e,t.callbackNode=l,e}return i!==null&&i!==null&&Ci(i),t.callbackPriority=2,t.callbackNode=null,2}function _d(t,e){if(re!==0&&re!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(ps()&&t.callbackNode!==l)return null;var i=Rt;return i=Mi(t,t===Xt?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(nd(t,i,e),Ed(t,he()),t.callbackNode!=null&&t.callbackNode===l?_d.bind(null,t):null)}function zd(t,e){if(ps())return null;nd(t,e,!0)}function um(){bm(function(){(Ot&6)!==0?zi(rl,rm):Sd()})}function Nu(){if(Wl===0){var t=Vi;t===0&&(t=Ti,Ti<<=1,(Ti&261888)===0&&(Ti=256)),Wl=t}return Wl}function Cd(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Ta(""+t)}function Td(t,e){var l=e.ownerDocument.createElement("input");return l.name=e.name,l.value=e.value,t.id&&l.setAttribute("form",t.id),e.parentNode.insertBefore(l,e),t=new FormData(t),l.parentNode.removeChild(l),t}function om(t,e,l,i,s){if(e==="submit"&&l&&l.stateNode===s){var r=Cd((s[se]||null).action),c=i.submitter;c&&(e=(e=c[se]||null)?Cd(e.formAction):c.getAttribute("formAction"),e!==null&&(r=e,c=null));var p=new Aa("action","action",null,i,s);t.push({event:p,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Wl!==0){var E=c?Td(s,c):new FormData(s);tu(l,{pending:!0,data:E,method:s.method,action:r},null,E)}}else typeof r=="function"&&(p.preventDefault(),E=c?Td(s,c):new FormData(s),tu(l,{pending:!0,data:E,method:s.method,action:r},r,E))},currentTarget:s}]})}}for(var Hu=0;Hu<yr.length;Hu++){var Lu=yr[Hu],cm=Lu.toLowerCase(),fm=Lu[0].toUpperCase()+Lu.slice(1);Je(cm,"on"+fm)}Je(lc,"onAnimationEnd"),Je(ic,"onAnimationIteration"),Je(nc,"onAnimationStart"),Je("dblclick","onDoubleClick"),Je("focusin","onFocus"),Je("focusout","onBlur"),Je(Rg,"onTransitionRun"),Je(wg,"onTransitionStart"),Je(Mg,"onTransitionCancel"),Je(ac,"onTransitionEnd"),Dl("onMouseEnter",["mouseout","mouseover"]),Dl("onMouseLeave",["mouseout","mouseover"]),Dl("onPointerEnter",["pointerout","pointerover"]),Dl("onPointerLeave",["pointerout","pointerover"]),ol("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ol("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ol("onBeforeInput",["compositionend","keypress","textInput","paste"]),ol("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ol("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ol("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ea="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(" "),dm=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ea));function Rd(t,e){e=(e&4)!==0;for(var l=0;l<t.length;l++){var i=t[l],s=i.event;i=i.listeners;t:{var r=void 0;if(e)for(var c=i.length-1;0<=c;c--){var p=i[c],E=p.instance,M=p.currentTarget;if(p=p.listener,E!==r&&s.isPropagationStopped())break t;r=p,s.currentTarget=M;try{r(s)}catch(L){Oa(L)}s.currentTarget=null,r=E}else for(c=0;c<i.length;c++){if(p=i[c],E=p.instance,M=p.currentTarget,p=p.listener,E!==r&&s.isPropagationStopped())break t;r=p,s.currentTarget=M;try{r(s)}catch(L){Oa(L)}s.currentTarget=null,r=E}}}}function Tt(t,e){var l=e[En];l===void 0&&(l=e[En]=new Set);var i=t+"__bubble";l.has(i)||(wd(e,t,2,!1),l.add(i))}function Uu(t,e,l){var i=0;e&&(i|=4),wd(l,t,i,e)}var xs="_reactListening"+Math.random().toString(36).slice(2);function Bu(t){if(!t[xs]){t[xs]=!0,ll.forEach(function(l){l!=="selectionchange"&&(dm.has(l)||Uu(l,!1,t),Uu(l,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[xs]||(e[xs]=!0,Uu("selectionchange",!1,e))}}function wd(t,e,l,i){switch(ih(e)){case 2:var s=Gm;break;case 8:s=qm;break;default:s=Pu}l=s.bind(null,e,l,t),s=void 0,!nr||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(s=!0),i?s!==void 0?t.addEventListener(e,l,{capture:!0,passive:s}):t.addEventListener(e,l,!0):s!==void 0?t.addEventListener(e,l,{passive:s}):t.addEventListener(e,l,!1)}function ku(t,e,l,i,s){var r=i;if((e&1)===0&&(e&2)===0&&i!==null)t:for(;;){if(i===null)return;var c=i.tag;if(c===3||c===4){var p=i.stateNode.containerInfo;if(p===s)break;if(c===4)for(c=i.return;c!==null;){var E=c.tag;if((E===3||E===4)&&c.stateNode.containerInfo===s)return;c=c.return}for(;p!==null;){if(c=pt(p),c===null)return;if(E=c.tag,E===5||E===6||E===26||E===27){i=r=c;continue t}p=p.parentNode}}i=i.return}Do(function(){var M=r,L=lr(l),B=[];t:{var A=sc.get(t);if(A!==void 0){var O=Aa,tt=t;switch(t){case"keypress":if(wa(l)===0)break t;case"keydown":case"keyup":O=ag;break;case"focusin":tt="focus",O=ur;break;case"focusout":tt="blur",O=ur;break;case"beforeblur":case"afterblur":O=ur;break;case"click":if(l.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":O=Ho;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":O=Kh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":O=ug;break;case lc:case ic:case nc:O=$h;break;case ac:O=cg;break;case"scroll":case"scrollend":O=Vh;break;case"wheel":O=dg;break;case"copy":case"cut":case"paste":O=Ih;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":O=Uo;break;case"toggle":case"beforetoggle":O=gg}var ft=(e&4)!==0,Gt=!ft&&(t==="scroll"||t==="scrollend"),T=ft?A!==null?A+"Capture":null:A;ft=[];for(var z=M,w;z!==null;){var U=z;if(w=U.stateNode,U=U.tag,U!==5&&U!==26&&U!==27||w===null||T===null||(U=_n(z,T),U!=null&&ft.push(la(z,U,w))),Gt)break;z=z.return}0<ft.length&&(A=new O(A,tt,null,l,L),B.push({event:A,listeners:ft}))}}if((e&7)===0){t:{if(A=t==="mouseover"||t==="pointerover",O=t==="mouseout"||t==="pointerout",A&&l!==er&&(tt=l.relatedTarget||l.fromElement)&&(pt(tt)||tt[jl]))break t;if((O||A)&&(A=L.window===L?L:(A=L.ownerDocument)?A.defaultView||A.parentWindow:window,O?(tt=l.relatedTarget||l.toElement,O=M,tt=tt?pt(tt):null,tt!==null&&(Gt=f(tt),ft=tt.tag,tt!==Gt||ft!==5&&ft!==27&&ft!==6)&&(tt=null)):(O=null,tt=M),O!==tt)){if(ft=Ho,U="onMouseLeave",T="onMouseEnter",z="mouse",(t==="pointerout"||t==="pointerover")&&(ft=Uo,U="onPointerLeave",T="onPointerEnter",z="pointer"),Gt=O==null?A:It(O),w=tt==null?A:It(tt),A=new ft(U,z+"leave",O,l,L),A.target=Gt,A.relatedTarget=w,U=null,pt(L)===M&&(ft=new ft(T,z+"enter",tt,l,L),ft.target=w,ft.relatedTarget=Gt,U=ft),Gt=U,O&&tt)e:{for(ft=hm,T=O,z=tt,w=0,U=T;U;U=ft(U))w++;U=0;for(var ct=z;ct;ct=ft(ct))U++;for(;0<w-U;)T=ft(T),w--;for(;0<U-w;)z=ft(z),U--;for(;w--;){if(T===z||z!==null&&T===z.alternate){ft=T;break e}T=ft(T),z=ft(z)}ft=null}else ft=null;O!==null&&Md(B,A,O,ft,!1),tt!==null&&Gt!==null&&Md(B,Gt,tt,ft,!0)}}t:{if(A=M?It(M):window,O=A.nodeName&&A.nodeName.toLowerCase(),O==="select"||O==="input"&&A.type==="file")var jt=Vo;else if(Xo(A))if(Zo)jt=zg;else{jt=Eg;var lt=Sg}else O=A.nodeName,!O||O.toLowerCase()!=="input"||A.type!=="checkbox"&&A.type!=="radio"?M&&tr(M.elementType)&&(jt=Vo):jt=_g;if(jt&&(jt=jt(t,M))){Qo(B,jt,l,L);break t}lt&&lt(t,A,M),t==="focusout"&&M&&A.type==="number"&&M.memoizedProps.value!=null&&Ps(A,"number",A.value)}switch(lt=M?It(M):window,t){case"focusin":(Xo(lt)||lt.contentEditable==="true")&&(Ui=lt,gr=M,jn=null);break;case"focusout":jn=gr=Ui=null;break;case"mousedown":mr=!0;break;case"contextmenu":case"mouseup":case"dragend":mr=!1,tc(B,l,L);break;case"selectionchange":if(Tg)break;case"keydown":case"keyup":tc(B,l,L)}var zt;if(cr)t:{switch(t){case"compositionstart":var wt="onCompositionStart";break t;case"compositionend":wt="onCompositionEnd";break t;case"compositionupdate":wt="onCompositionUpdate";break t}wt=void 0}else Li?qo(t,l)&&(wt="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(wt="onCompositionStart");wt&&(Bo&&l.locale!=="ko"&&(Li||wt!=="onCompositionStart"?wt==="onCompositionEnd"&&Li&&(zt=Oo()):(Ol=L,ar="value"in Ol?Ol.value:Ol.textContent,Li=!0)),lt=bs(M,wt),0<lt.length&&(wt=new Lo(wt,t,null,l,L),B.push({event:wt,listeners:lt}),zt?wt.data=zt:(zt=Yo(l),zt!==null&&(wt.data=zt)))),(zt=pg?yg(t,l):vg(t,l))&&(wt=bs(M,"onBeforeInput"),0<wt.length&&(lt=new Lo("onBeforeInput","beforeinput",null,l,L),B.push({event:lt,listeners:wt}),lt.data=zt)),om(B,t,M,l,L)}Rd(B,e)})}function la(t,e,l){return{instance:t,listener:e,currentTarget:l}}function bs(t,e){for(var l=e+"Capture",i=[];t!==null;){var s=t,r=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||r===null||(s=_n(t,l),s!=null&&i.unshift(la(t,s,r)),s=_n(t,e),s!=null&&i.push(la(t,s,r))),t.tag===3)return i;t=t.return}return[]}function hm(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Md(t,e,l,i,s){for(var r=e._reactName,c=[];l!==null&&l!==i;){var p=l,E=p.alternate,M=p.stateNode;if(p=p.tag,E!==null&&E===i)break;p!==5&&p!==26&&p!==27||M===null||(E=M,s?(M=_n(l,r),M!=null&&c.unshift(la(l,M,E))):s||(M=_n(l,r),M!=null&&c.push(la(l,M,E)))),l=l.return}c.length!==0&&t.push({event:e,listeners:c})}var gm=/\r\n?/g,mm=/\u0000|\uFFFD/g;function Ad(t){return(typeof t=="string"?t:""+t).replace(gm,`
`).replace(mm,"")}function jd(t,e){return e=Ad(e),Ad(t)===e}function kt(t,e,l,i,s,r){switch(l){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||Oi(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&Oi(t,""+i);break;case"className":za(t,"class",i);break;case"tabIndex":za(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":za(t,l,i);break;case"style":Ao(t,i,r);break;case"data":if(e!=="object"){za(t,"data",i);break}case"src":case"href":if(i===""&&(e!=="a"||l!=="href")){t.removeAttribute(l);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(l);break}i=Ta(""+i),t.setAttribute(l,i);break;case"action":case"formAction":if(typeof i=="function"){t.setAttribute(l,"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 r=="function"&&(l==="formAction"?(e!=="input"&&kt(t,e,"name",s.name,s,null),kt(t,e,"formEncType",s.formEncType,s,null),kt(t,e,"formMethod",s.formMethod,s,null),kt(t,e,"formTarget",s.formTarget,s,null)):(kt(t,e,"encType",s.encType,s,null),kt(t,e,"method",s.method,s,null),kt(t,e,"target",s.target,s,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(l);break}i=Ta(""+i),t.setAttribute(l,i);break;case"onClick":i!=null&&(t.onclick=fl);break;case"onScroll":i!=null&&Tt("scroll",t);break;case"onScrollEnd":i!=null&&Tt("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(u(61));if(l=i.__html,l!=null){if(s.children!=null)throw Error(u(60));t.innerHTML=l}}break;case"multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}l=Ta(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(l,""+i):t.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":i===!0?t.setAttribute(l,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(l,i):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(l,i):t.removeAttribute(l);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(l):t.setAttribute(l,i);break;case"popover":Tt("beforetoggle",t),Tt("toggle",t),_a(t,"popover",i);break;case"xlinkActuate":cl(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":cl(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":cl(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":cl(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":cl(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":cl(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":cl(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":cl(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":cl(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":_a(t,"is",i);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Xh.get(l)||l,_a(t,l,i))}}function Gu(t,e,l,i,s,r){switch(l){case"style":Ao(t,i,r);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(u(61));if(l=i.__html,l!=null){if(s.children!=null)throw Error(u(60));t.innerHTML=l}}break;case"children":typeof i=="string"?Oi(t,i):(typeof i=="number"||typeof i=="bigint")&&Oi(t,""+i);break;case"onScroll":i!=null&&Tt("scroll",t);break;case"onScrollEnd":i!=null&&Tt("scrollend",t);break;case"onClick":i!=null&&(t.onclick=fl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ul.hasOwnProperty(l))t:{if(l[0]==="o"&&l[1]==="n"&&(s=l.endsWith("Capture"),e=l.slice(2,s?l.length-7:void 0),r=t[se]||null,r=r!=null?r[l]:null,typeof r=="function"&&t.removeEventListener(e,r,s),typeof i=="function")){typeof r!="function"&&r!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(e,i,s);break t}l in t?t[l]=i:i===!0?t.setAttribute(l,""):_a(t,l,i)}}}function de(t,e,l){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Tt("error",t),Tt("load",t);var i=!1,s=!1,r;for(r in l)if(l.hasOwnProperty(r)){var c=l[r];if(c!=null)switch(r){case"src":i=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,e));default:kt(t,e,r,c,l,null)}}s&&kt(t,e,"srcSet",l.srcSet,l,null),i&&kt(t,e,"src",l.src,l,null);return;case"input":Tt("invalid",t);var p=r=c=s=null,E=null,M=null;for(i in l)if(l.hasOwnProperty(i)){var L=l[i];if(L!=null)switch(i){case"name":s=L;break;case"type":c=L;break;case"checked":E=L;break;case"defaultChecked":M=L;break;case"value":r=L;break;case"defaultValue":p=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(u(137,e));break;default:kt(t,e,i,L,l,null)}}To(t,r,p,E,M,c,s,!1);return;case"select":Tt("invalid",t),i=c=r=null;for(s in l)if(l.hasOwnProperty(s)&&(p=l[s],p!=null))switch(s){case"value":r=p;break;case"defaultValue":c=p;break;case"multiple":i=p;default:kt(t,e,s,p,l,null)}e=r,l=c,t.multiple=!!i,e!=null?Di(t,!!i,e,!1):l!=null&&Di(t,!!i,l,!0);return;case"textarea":Tt("invalid",t),r=s=i=null;for(c in l)if(l.hasOwnProperty(c)&&(p=l[c],p!=null))switch(c){case"value":i=p;break;case"defaultValue":s=p;break;case"children":r=p;break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(u(91));break;default:kt(t,e,c,p,l,null)}wo(t,i,s,r);return;case"option":for(E in l)if(l.hasOwnProperty(E)&&(i=l[E],i!=null))switch(E){case"selected":t.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:kt(t,e,E,i,l,null)}return;case"dialog":Tt("beforetoggle",t),Tt("toggle",t),Tt("cancel",t),Tt("close",t);break;case"iframe":case"object":Tt("load",t);break;case"video":case"audio":for(i=0;i<ea.length;i++)Tt(ea[i],t);break;case"image":Tt("error",t),Tt("load",t);break;case"details":Tt("toggle",t);break;case"embed":case"source":case"link":Tt("error",t),Tt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(M in l)if(l.hasOwnProperty(M)&&(i=l[M],i!=null))switch(M){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,e));default:kt(t,e,M,i,l,null)}return;default:if(tr(e)){for(L in l)l.hasOwnProperty(L)&&(i=l[L],i!==void 0&&Gu(t,e,L,i,l,void 0));return}}for(p in l)l.hasOwnProperty(p)&&(i=l[p],i!=null&&kt(t,e,p,i,l,null))}function pm(t,e,l,i){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,r=null,c=null,p=null,E=null,M=null,L=null;for(O in l){var B=l[O];if(l.hasOwnProperty(O)&&B!=null)switch(O){case"checked":break;case"value":break;case"defaultValue":E=B;default:i.hasOwnProperty(O)||kt(t,e,O,null,i,B)}}for(var A in i){var O=i[A];if(B=l[A],i.hasOwnProperty(A)&&(O!=null||B!=null))switch(A){case"type":r=O;break;case"name":s=O;break;case"checked":M=O;break;case"defaultChecked":L=O;break;case"value":c=O;break;case"defaultValue":p=O;break;case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(u(137,e));break;default:O!==B&&kt(t,e,A,O,i,B)}}Is(t,c,p,E,M,L,r,s);return;case"select":O=c=p=A=null;for(r in l)if(E=l[r],l.hasOwnProperty(r)&&E!=null)switch(r){case"value":break;case"multiple":O=E;default:i.hasOwnProperty(r)||kt(t,e,r,null,i,E)}for(s in i)if(r=i[s],E=l[s],i.hasOwnProperty(s)&&(r!=null||E!=null))switch(s){case"value":A=r;break;case"defaultValue":p=r;break;case"multiple":c=r;default:r!==E&&kt(t,e,s,r,i,E)}e=p,l=c,i=O,A!=null?Di(t,!!l,A,!1):!!i!=!!l&&(e!=null?Di(t,!!l,e,!0):Di(t,!!l,l?[]:"",!1));return;case"textarea":O=A=null;for(p in l)if(s=l[p],l.hasOwnProperty(p)&&s!=null&&!i.hasOwnProperty(p))switch(p){case"value":break;case"children":break;default:kt(t,e,p,null,i,s)}for(c in i)if(s=i[c],r=l[c],i.hasOwnProperty(c)&&(s!=null||r!=null))switch(c){case"value":A=s;break;case"defaultValue":O=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(u(91));break;default:s!==r&&kt(t,e,c,s,i,r)}Ro(t,A,O);return;case"option":for(var tt in l)if(A=l[tt],l.hasOwnProperty(tt)&&A!=null&&!i.hasOwnProperty(tt))switch(tt){case"selected":t.selected=!1;break;default:kt(t,e,tt,null,i,A)}for(E in i)if(A=i[E],O=l[E],i.hasOwnProperty(E)&&A!==O&&(A!=null||O!=null))switch(E){case"selected":t.selected=A&&typeof A!="function"&&typeof A!="symbol";break;default:kt(t,e,E,A,i,O)}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 ft in l)A=l[ft],l.hasOwnProperty(ft)&&A!=null&&!i.hasOwnProperty(ft)&&kt(t,e,ft,null,i,A);for(M in i)if(A=i[M],O=l[M],i.hasOwnProperty(M)&&A!==O&&(A!=null||O!=null))switch(M){case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(u(137,e));break;default:kt(t,e,M,A,i,O)}return;default:if(tr(e)){for(var Gt in l)A=l[Gt],l.hasOwnProperty(Gt)&&A!==void 0&&!i.hasOwnProperty(Gt)&&Gu(t,e,Gt,void 0,i,A);for(L in i)A=i[L],O=l[L],!i.hasOwnProperty(L)||A===O||A===void 0&&O===void 0||Gu(t,e,L,A,i,O);return}}for(var T in l)A=l[T],l.hasOwnProperty(T)&&A!=null&&!i.hasOwnProperty(T)&&kt(t,e,T,null,i,A);for(B in i)A=i[B],O=l[B],!i.hasOwnProperty(B)||A===O||A==null&&O==null||kt(t,e,B,A,i,O)}function Dd(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ym(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,l=performance.getEntriesByType("resource"),i=0;i<l.length;i++){var s=l[i],r=s.transferSize,c=s.initiatorType,p=s.duration;if(r&&p&&Dd(c)){for(c=0,p=s.responseEnd,i+=1;i<l.length;i++){var E=l[i],M=E.startTime;if(M>p)break;var L=E.transferSize,B=E.initiatorType;L&&Dd(B)&&(E=E.responseEnd,c+=L*(E<p?1:(p-M)/(E-M)))}if(--i,e+=8*(r+c)/(s.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var qu=null,Yu=null;function Ss(t){return t.nodeType===9?t:t.ownerDocument}function Od(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Nd(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function Xu(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Qu=null;function vm(){var t=window.event;return t&&t.type==="popstate"?t===Qu?!1:(Qu=t,!0):(Qu=null,!1)}var Hd=typeof setTimeout=="function"?setTimeout:void 0,xm=typeof clearTimeout=="function"?clearTimeout:void 0,Ld=typeof Promise=="function"?Promise:void 0,bm=typeof queueMicrotask=="function"?queueMicrotask:typeof Ld<"u"?function(t){return Ld.resolve(null).then(t).catch(Sm)}:Hd;function Sm(t){setTimeout(function(){throw t})}function $l(t){return t==="head"}function Ud(t,e){var l=e,i=0;do{var s=l.nextSibling;if(t.removeChild(l),s&&s.nodeType===8)if(l=s.data,l==="/$"||l==="/&"){if(i===0){t.removeChild(s),fn(e);return}i--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")i++;else if(l==="html")ia(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,ia(l);for(var r=l.firstChild;r;){var c=r.nextSibling,p=r.nodeName;r[F]||p==="SCRIPT"||p==="STYLE"||p==="LINK"&&r.rel.toLowerCase()==="stylesheet"||l.removeChild(r),r=c}}else l==="body"&&ia(t.ownerDocument.body);l=s}while(l);fn(e)}function Bd(t,e){var l=t;t=0;do{var i=l.nextSibling;if(l.nodeType===1?e?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(e?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),i&&i.nodeType===8)if(l=i.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=i}while(l)}function Vu(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var l=e;switch(e=e.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Vu(l),I(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function Em(t,e,l,i){for(;t.nodeType===1;){var s=l;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[F])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(r=t.getAttribute("rel"),r==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(r!==s.rel||t.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||t.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||t.getAttribute("title")!==(s.title==null?null:s.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(r=t.getAttribute("src"),(r!==(s.src==null?null:s.src)||t.getAttribute("type")!==(s.type==null?null:s.type)||t.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&r&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var r=s.name==null?null:""+s.name;if(s.type==="hidden"&&t.getAttribute("name")===r)return t}else return t;if(t=Ye(t.nextSibling),t===null)break}return null}function _m(t,e,l){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=Ye(t.nextSibling),t===null))return null;return t}function kd(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=Ye(t.nextSibling),t===null))return null;return t}function Zu(t){return t.data==="$?"||t.data==="$~"}function Ku(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function zm(t,e){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||l.readyState!=="loading")e();else{var i=function(){e(),l.removeEventListener("DOMContentLoaded",i)};l.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function Ye(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="$~"||e==="&"||e==="F!"||e==="F")break;if(e==="/$"||e==="/&")return null}}return t}var Ju=null;function Gd(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(e===0)return Ye(t.nextSibling);e--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||e++}t=t.nextSibling}return null}function qd(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(e===0)return t;e--}else l!=="/$"&&l!=="/&"||e++}t=t.previousSibling}return null}function Yd(t,e,l){switch(e=Ss(l),t){case"html":if(t=e.documentElement,!t)throw Error(u(452));return t;case"head":if(t=e.head,!t)throw Error(u(453));return t;case"body":if(t=e.body,!t)throw Error(u(454));return t;default:throw Error(u(451))}}function ia(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);I(t)}var Xe=new Map,Xd=new Set;function Es(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Rl=V.d;V.d={f:Cm,r:Tm,D:Rm,C:wm,L:Mm,m:Am,X:Dm,S:jm,M:Om};function Cm(){var t=Rl.f(),e=hs();return t||e}function Tm(t){var e=gt(t);e!==null&&e.tag===5&&e.type==="form"?sf(e):Rl.r(t)}var un=typeof document>"u"?null:document;function Qd(t,e,l){var i=un;if(i&&typeof e=="string"&&e){var s=He(e);s='link[rel="'+t+'"][href="'+s+'"]',typeof l=="string"&&(s+='[crossorigin="'+l+'"]'),Xd.has(s)||(Xd.add(s),t={rel:t,crossOrigin:l,href:e},i.querySelector(s)===null&&(e=i.createElement("link"),de(e,"link",t),Yt(e),i.head.appendChild(e)))}}function Rm(t){Rl.D(t),Qd("dns-prefetch",t,null)}function wm(t,e){Rl.C(t,e),Qd("preconnect",t,e)}function Mm(t,e,l){Rl.L(t,e,l);var i=un;if(i&&t&&e){var s='link[rel="preload"][as="'+He(e)+'"]';e==="image"&&l&&l.imageSrcSet?(s+='[imagesrcset="'+He(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(s+='[imagesizes="'+He(l.imageSizes)+'"]')):s+='[href="'+He(t)+'"]';var r=s;switch(e){case"style":r=on(t);break;case"script":r=cn(t)}Xe.has(r)||(t=v({rel:"preload",href:e==="image"&&l&&l.imageSrcSet?void 0:t,as:e},l),Xe.set(r,t),i.querySelector(s)!==null||e==="style"&&i.querySelector(na(r))||e==="script"&&i.querySelector(aa(r))||(e=i.createElement("link"),de(e,"link",t),Yt(e),i.head.appendChild(e)))}}function Am(t,e){Rl.m(t,e);var l=un;if(l&&t){var i=e&&typeof e.as=="string"?e.as:"script",s='link[rel="modulepreload"][as="'+He(i)+'"][href="'+He(t)+'"]',r=s;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=cn(t)}if(!Xe.has(r)&&(t=v({rel:"modulepreload",href:t},e),Xe.set(r,t),l.querySelector(s)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(aa(r)))return}i=l.createElement("link"),de(i,"link",t),Yt(i),l.head.appendChild(i)}}}function jm(t,e,l){Rl.S(t,e,l);var i=un;if(i&&t){var s=Nt(i).hoistableStyles,r=on(t);e=e||"default";var c=s.get(r);if(!c){var p={loading:0,preload:null};if(c=i.querySelector(na(r)))p.loading=5;else{t=v({rel:"stylesheet",href:t,"data-precedence":e},l),(l=Xe.get(r))&&Wu(t,l);var E=c=i.createElement("link");Yt(E),de(E,"link",t),E._p=new Promise(function(M,L){E.onload=M,E.onerror=L}),E.addEventListener("load",function(){p.loading|=1}),E.addEventListener("error",function(){p.loading|=2}),p.loading|=4,_s(c,e,i)}c={type:"stylesheet",instance:c,count:1,state:p},s.set(r,c)}}}function Dm(t,e){Rl.X(t,e);var l=un;if(l&&t){var i=Nt(l).hoistableScripts,s=cn(t),r=i.get(s);r||(r=l.querySelector(aa(s)),r||(t=v({src:t,async:!0},e),(e=Xe.get(s))&&$u(t,e),r=l.createElement("script"),Yt(r),de(r,"link",t),l.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},i.set(s,r))}}function Om(t,e){Rl.M(t,e);var l=un;if(l&&t){var i=Nt(l).hoistableScripts,s=cn(t),r=i.get(s);r||(r=l.querySelector(aa(s)),r||(t=v({src:t,async:!0,type:"module"},e),(e=Xe.get(s))&&$u(t,e),r=l.createElement("script"),Yt(r),de(r,"link",t),l.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},i.set(s,r))}}function Vd(t,e,l,i){var s=(s=it.current)?Es(s):null;if(!s)throw Error(u(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(e=on(l.href),l=Nt(s).hoistableStyles,i=l.get(e),i||(i={type:"style",instance:null,count:0,state:null},l.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=on(l.href);var r=Nt(s).hoistableStyles,c=r.get(t);if(c||(s=s.ownerDocument||s,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(t,c),(r=s.querySelector(na(t)))&&!r._p&&(c.instance=r,c.state.loading=5),Xe.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Xe.set(t,l),r||Nm(s,t,l,c.state))),e&&i===null)throw Error(u(528,""));return c}if(e&&i!==null)throw Error(u(529,""));return null;case"script":return e=l.async,l=l.src,typeof l=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=cn(l),l=Nt(s).hoistableScripts,i=l.get(e),i||(i={type:"script",instance:null,count:0,state:null},l.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,t))}}function on(t){return'href="'+He(t)+'"'}function na(t){return'link[rel="stylesheet"]['+t+"]"}function Zd(t){return v({},t,{"data-precedence":t.precedence,precedence:null})}function Nm(t,e,l,i){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=t.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),de(e,"link",l),Yt(e),t.head.appendChild(e))}function cn(t){return'[src="'+He(t)+'"]'}function aa(t){return"script[async]"+t}function Kd(t,e,l){if(e.count++,e.instance===null)switch(e.type){case"style":var i=t.querySelector('style[data-href~="'+He(l.href)+'"]');if(i)return e.instance=i,Yt(i),i;var s=v({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),Yt(i),de(i,"style",s),_s(i,l.precedence,t),e.instance=i;case"stylesheet":s=on(l.href);var r=t.querySelector(na(s));if(r)return e.state.loading|=4,e.instance=r,Yt(r),r;i=Zd(l),(s=Xe.get(s))&&Wu(i,s),r=(t.ownerDocument||t).createElement("link"),Yt(r);var c=r;return c._p=new Promise(function(p,E){c.onload=p,c.onerror=E}),de(r,"link",i),e.state.loading|=4,_s(r,l.precedence,t),e.instance=r;case"script":return r=cn(l.src),(s=t.querySelector(aa(r)))?(e.instance=s,Yt(s),s):(i=l,(s=Xe.get(r))&&(i=v({},l),$u(i,s)),t=t.ownerDocument||t,s=t.createElement("script"),Yt(s),de(s,"link",i),t.head.appendChild(s),e.instance=s);case"void":return null;default:throw Error(u(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(i=e.instance,e.state.loading|=4,_s(i,l.precedence,t));return e.instance}function _s(t,e,l){for(var i=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=i.length?i[i.length-1]:null,r=s,c=0;c<i.length;c++){var p=i[c];if(p.dataset.precedence===e)r=p;else if(r!==s)break}r?r.parentNode.insertBefore(t,r.nextSibling):(e=l.nodeType===9?l.head:l,e.insertBefore(t,e.firstChild))}function Wu(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function $u(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var zs=null;function Jd(t,e,l){if(zs===null){var i=new Map,s=zs=new Map;s.set(l,i)}else s=zs,i=s.get(l),i||(i=new Map,s.set(l,i));if(i.has(t))return i;for(i.set(t,null),l=l.getElementsByTagName(t),s=0;s<l.length;s++){var r=l[s];if(!(r[F]||r[Jt]||t==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var c=r.getAttribute(e)||"";c=t+c;var p=i.get(c);p?p.push(r):i.set(c,[r])}}return i}function Wd(t,e,l){t=t.ownerDocument||t,t.head.insertBefore(l,e==="title"?t.querySelector("head > title"):null)}function Hm(t,e,l){if(l===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function $d(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Lm(t,e,l,i){if(l.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var s=on(i.href),r=e.querySelector(na(s));if(r){e=r._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=Cs.bind(t),e.then(t,t)),l.state.loading|=4,l.instance=r,Yt(r);return}r=e.ownerDocument||e,i=Zd(i),(s=Xe.get(s))&&Wu(i,s),r=r.createElement("link"),Yt(r);var c=r;c._p=new Promise(function(p,E){c.onload=p,c.onerror=E}),de(r,"link",i),l.instance=r}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,e),(e=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=Cs.bind(t),e.addEventListener("load",l),e.addEventListener("error",l))}}var Fu=0;function Um(t,e){return t.stylesheets&&t.count===0&&Rs(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var i=setTimeout(function(){if(t.stylesheets&&Rs(t,t.stylesheets),t.unsuspend){var r=t.unsuspend;t.unsuspend=null,r()}},6e4+e);0<t.imgBytes&&Fu===0&&(Fu=62500*ym());var s=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Rs(t,t.stylesheets),t.unsuspend)){var r=t.unsuspend;t.unsuspend=null,r()}},(t.imgBytes>Fu?50:800)+e);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(i),clearTimeout(s)}}:null}function Cs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Rs(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Ts=null;function Rs(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Ts=new Map,e.forEach(Bm,t),Ts=null,Cs.call(t))}function Bm(t,e){if(!(e.state.loading&4)){var l=Ts.get(t);if(l)var i=l.get(null);else{l=new Map,Ts.set(t,l);for(var s=t.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<s.length;r++){var c=s[r];(c.nodeName==="LINK"||c.getAttribute("media")!=="not all")&&(l.set(c.dataset.precedence,c),i=c)}i&&l.set(null,i)}s=e.instance,c=s.getAttribute("data-precedence"),r=l.get(c)||i,r===i&&l.set(null,s),l.set(c,s),this.count++,i=Cs.bind(this),s.addEventListener("load",i),s.addEventListener("error",i),r?r.parentNode.insertBefore(s,r.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(s,t.firstChild)),e.state.loading|=4}}var sa={$$typeof:X,Provider:null,Consumer:null,_currentValue:P,_currentValue2:P,_threadCount:0};function km(t,e,l,i,s,r,c,p,E){this.tag=1,this.containerInfo=t,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=Sn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sn(0),this.hiddenUpdates=Sn(null),this.identifierPrefix=i,this.onUncaughtError=s,this.onCaughtError=r,this.onRecoverableError=c,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=E,this.incompleteTransitions=new Map}function Fd(t,e,l,i,s,r,c,p,E,M,L,B){return t=new km(t,e,l,c,E,M,L,B,p),e=1,r===!0&&(e|=24),r=Te(3,null,null,e),t.current=r,r.stateNode=t,e=Ar(),e.refCount++,t.pooledCache=e,e.refCount++,r.memoizedState={element:i,isDehydrated:l,cache:e},Nr(r),t}function Id(t){return t?(t=Gi,t):Gi}function Pd(t,e,l,i,s,r){s=Id(s),i.context===null?i.context=s:i.pendingContext=s,i=kl(e),i.payload={element:l},r=r===void 0?null:r,r!==null&&(i.callback=r),l=Gl(t,i,e),l!==null&&(ze(l,t,e),Bn(l,t,e))}function th(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<e?l:e}}function Iu(t,e){th(t,e),(t=t.alternate)&&th(t,e)}function eh(t){if(t.tag===13||t.tag===31){var e=ri(t,67108864);e!==null&&ze(e,t,67108864),Iu(t,67108864)}}function lh(t){if(t.tag===13||t.tag===31){var e=je();e=Ai(e);var l=ri(t,e);l!==null&&ze(l,t,e),Iu(t,e)}}var ws=!0;function Gm(t,e,l,i){var s=R.T;R.T=null;var r=V.p;try{V.p=2,Pu(t,e,l,i)}finally{V.p=r,R.T=s}}function qm(t,e,l,i){var s=R.T;R.T=null;var r=V.p;try{V.p=8,Pu(t,e,l,i)}finally{V.p=r,R.T=s}}function Pu(t,e,l,i){if(ws){var s=to(i);if(s===null)ku(t,e,i,Ms,l),nh(t,i);else if(Xm(s,t,e,l,i))i.stopPropagation();else if(nh(t,i),e&4&&-1<Ym.indexOf(t)){for(;s!==null;){var r=gt(s);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var c=el(r.pendingLanes);if(c!==0){var p=r;for(p.pendingLanes|=2,p.entangledLanes|=2;c;){var E=1<<31-ae(c);p.entanglements[1]|=E,c&=~E}sl(r),(Ot&6)===0&&(fs=he()+500,ta(0))}}break;case 31:case 13:p=ri(r,2),p!==null&&ze(p,r,2),hs(),Iu(r,2)}if(r=to(i),r===null&&ku(t,e,i,Ms,l),r===s)break;s=r}s!==null&&i.stopPropagation()}else ku(t,e,i,null,l)}}function to(t){return t=lr(t),eo(t)}var Ms=null;function eo(t){if(Ms=null,t=pt(t),t!==null){var e=f(t);if(e===null)t=null;else{var l=e.tag;if(l===13){if(t=g(e),t!==null)return t;t=null}else if(l===31){if(t=m(e),t!==null)return t;t=null}else if(l===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return Ms=t,null}function ih(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ve()){case rl:return 2;case qt:return 8;case Ft:case yn:return 32;case ya:return 268435456;default:return 32}default:return 32}}var lo=!1,Fl=null,Il=null,Pl=null,ra=new Map,ua=new Map,ti=[],Ym="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 nh(t,e){switch(t){case"focusin":case"focusout":Fl=null;break;case"dragenter":case"dragleave":Il=null;break;case"mouseover":case"mouseout":Pl=null;break;case"pointerover":case"pointerout":ra.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":ua.delete(e.pointerId)}}function oa(t,e,l,i,s,r){return t===null||t.nativeEvent!==r?(t={blockedOn:e,domEventName:l,eventSystemFlags:i,nativeEvent:r,targetContainers:[s]},e!==null&&(e=gt(e),e!==null&&eh(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,s!==null&&e.indexOf(s)===-1&&e.push(s),t)}function Xm(t,e,l,i,s){switch(e){case"focusin":return Fl=oa(Fl,t,e,l,i,s),!0;case"dragenter":return Il=oa(Il,t,e,l,i,s),!0;case"mouseover":return Pl=oa(Pl,t,e,l,i,s),!0;case"pointerover":var r=s.pointerId;return ra.set(r,oa(ra.get(r)||null,t,e,l,i,s)),!0;case"gotpointercapture":return r=s.pointerId,ua.set(r,oa(ua.get(r)||null,t,e,l,i,s)),!0}return!1}function ah(t){var e=pt(t.target);if(e!==null){var l=f(e);if(l!==null){if(e=l.tag,e===13){if(e=g(l),e!==null){t.blockedOn=e,Ea(t.priority,function(){lh(l)});return}}else if(e===31){if(e=m(l),e!==null){t.blockedOn=e,Ea(t.priority,function(){lh(l)});return}}else if(e===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function As(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var l=to(t.nativeEvent);if(l===null){l=t.nativeEvent;var i=new l.constructor(l.type,l);er=i,l.target.dispatchEvent(i),er=null}else return e=gt(l),e!==null&&eh(e),t.blockedOn=l,!1;e.shift()}return!0}function sh(t,e,l){As(t)&&l.delete(e)}function Qm(){lo=!1,Fl!==null&&As(Fl)&&(Fl=null),Il!==null&&As(Il)&&(Il=null),Pl!==null&&As(Pl)&&(Pl=null),ra.forEach(sh),ua.forEach(sh)}function js(t,e){t.blockedOn===e&&(t.blockedOn=null,lo||(lo=!0,d.unstable_scheduleCallback(d.unstable_NormalPriority,Qm)))}var Ds=null;function rh(t){Ds!==t&&(Ds=t,d.unstable_scheduleCallback(d.unstable_NormalPriority,function(){Ds===t&&(Ds=null);for(var e=0;e<t.length;e+=3){var l=t[e],i=t[e+1],s=t[e+2];if(typeof i!="function"){if(eo(i||l)===null)continue;break}var r=gt(l);r!==null&&(t.splice(e,3),e-=3,tu(r,{pending:!0,data:s,method:l.method,action:i},i,s))}}))}function fn(t){function e(E){return js(E,t)}Fl!==null&&js(Fl,t),Il!==null&&js(Il,t),Pl!==null&&js(Pl,t),ra.forEach(e),ua.forEach(e);for(var l=0;l<ti.length;l++){var i=ti[l];i.blockedOn===t&&(i.blockedOn=null)}for(;0<ti.length&&(l=ti[0],l.blockedOn===null);)ah(l),l.blockedOn===null&&ti.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(i=0;i<l.length;i+=3){var s=l[i],r=l[i+1],c=s[se]||null;if(typeof r=="function")c||rh(l);else if(c){var p=null;if(r&&r.hasAttribute("formAction")){if(s=r,c=r[se]||null)p=c.formAction;else if(eo(s)!==null)continue}else p=c.action;typeof p=="function"?l[i+1]=p:(l.splice(i,3),i-=3),rh(l)}}}function uh(){function t(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(c){return s=c})},focusReset:"manual",scroll:"manual"})}function e(){s!==null&&(s(),s=null),i||setTimeout(l,20)}function l(){if(!i&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,s=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(l,100),function(){i=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),s!==null&&(s(),s=null)}}}function io(t){this._internalRoot=t}Os.prototype.render=io.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(u(409));var l=e.current,i=je();Pd(l,i,t,e,null,null)},Os.prototype.unmount=io.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Pd(t.current,2,null,t,null,null),hs(),e[jl]=null}};function Os(t){this._internalRoot=t}Os.prototype.unstable_scheduleHydration=function(t){if(t){var e=Sa();t={blockedOn:null,target:t,priority:e};for(var l=0;l<ti.length&&e!==0&&e<ti[l].priority;l++);ti.splice(l,0,t),l===0&&ah(t)}};var oh=n.version;if(oh!=="19.2.4")throw Error(u(527,oh,"19.2.4"));V.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(u(188)):(t=Object.keys(t).join(","),Error(u(268,t)));return t=y(e),t=t!==null?x(t):null,t=t===null?null:t.stateNode,t};var Vm={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ns=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ns.isDisabled&&Ns.supportsFiber)try{li=Ns.inject(Vm),ge=Ns}catch{}}return fa.createRoot=function(t,e){if(!o(t))throw Error(u(299));var l=!1,i="",s=pf,r=yf,c=vf;return e!=null&&(e.unstable_strictMode===!0&&(l=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(s=e.onUncaughtError),e.onCaughtError!==void 0&&(r=e.onCaughtError),e.onRecoverableError!==void 0&&(c=e.onRecoverableError)),e=Fd(t,1,!1,null,null,l,i,null,s,r,c,uh),t[jl]=e.current,Bu(t),new io(e)},fa.hydrateRoot=function(t,e,l){if(!o(t))throw Error(u(299));var i=!1,s="",r=pf,c=yf,p=vf,E=null;return l!=null&&(l.unstable_strictMode===!0&&(i=!0),l.identifierPrefix!==void 0&&(s=l.identifierPrefix),l.onUncaughtError!==void 0&&(r=l.onUncaughtError),l.onCaughtError!==void 0&&(c=l.onCaughtError),l.onRecoverableError!==void 0&&(p=l.onRecoverableError),l.formState!==void 0&&(E=l.formState)),e=Fd(t,1,!0,e,l??null,i,s,E,r,c,p,uh),e.context=Id(null),l=e.current,i=je(),i=Ai(i),s=kl(i),s.callback=null,Gl(l,s,i),l=i,e.current.lanes=l,ii(e,l),sl(e),t[jl]=e.current,Bu(t),new Os(e)},fa.version="19.2.4",fa}var xh;function ep(){if(xh)return so.exports;xh=1;function d(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(d)}catch(n){console.error(n)}}return d(),so.exports=tp(),so.exports}var lp=ep();const ip=Oh(lp);function hn({label:d,active:n,onClick:a,color:u}){return h.jsx("button",{onMouseDown:o=>{o.preventDefault(),a()},title:d,style:{background:n?u+"22":"transparent",border:`1px solid ${n?u+"66":"transparent"}`,borderRadius:3,padding:"1px 4px",cursor:"pointer",fontFamily:"inherit",fontSize:11,fontWeight:600,color:n?u:"var(--text-dim)",lineHeight:1.3,transition:"all 0.15s"},children:d})}function np({label:d,color:n,bgColor:a,value:u,onChange:o,columns:f,columnsOnly:g=!1,plainText:m=!1,highlightOptions:S,onHighlightOptionToggle:y}){const[x,v]=N.useState(!1),[C,Z]=N.useState(0),[$,J]=N.useState([]),ot=N.useRef(null),at=N.useRef(null),Et=N.useCallback(()=>{const k=ot.current;if(!k)return{text:"",start:0,end:0};const et=k.selectionStart||0,dt=k.value;let At=dt.lastIndexOf(",",et-1)+1,Q=dt.indexOf(",",et);Q===-1&&(Q=dt.length);const nt=dt.slice(At,Q).trimStart(),bt=dt.slice(At,Q).length-dt.slice(At,Q).trimStart().length;return{text:nt,start:At+bt,end:Q}},[]),X=N.useCallback(()=>{const{text:k}=Et();if(!g&&k.includes(":")){v(!1);return}const et=k.toLowerCase(),dt=f.filter(At=>!et||At.name.toLowerCase().includes(et));J(dt),Z(0),v(dt.length>0&&document.activeElement===ot.current)},[f,g,Et]),st=N.useCallback(k=>{const et=ot.current;if(!et)return;const{start:dt,end:At}=Et(),Q=et.value,nt=Q.slice(0,dt),bt=Q.slice(At),mt=g?k+", ":k+":",Ut=nt+mt+bt;o(Ut),v(!1),requestAnimationFrame(()=>{const R=dt+mt.length;et.setSelectionRange(R,R),et.focus()})},[g,Et,o]),yt=k=>{x&&(k.key==="ArrowDown"?(k.preventDefault(),Z(et=>Math.min(et+1,$.length-1))):k.key==="ArrowUp"?(k.preventDefault(),Z(et=>Math.max(et-1,0))):k.key==="Tab"||k.key==="Enter"?$.length>0&&(k.preventDefault(),st($[C].name)):k.key==="Escape"&&v(!1))},H=k=>{o(k.target.value),m||requestAnimationFrame(X)};return N.useEffect(()=>{const k=et=>{at.current&&!at.current.contains(et.target)&&et.target!==ot.current&&v(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[]),N.useEffect(()=>{if(x&&at.current){const k=at.current.children[C];k&&k.scrollIntoView({block:"nearest"})}},[C,x]),h.jsxs("div",{style:{position:"relative",flex:1,minWidth:200},children:[h.jsx("label",{style:{display:"block",fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.1em",color:n,marginBottom:4},children:d}),h.jsxs("div",{style:{display:"flex",alignItems:"center",background:a,border:`1px solid ${n}33`,borderRadius:6,transition:"border-color 0.15s"},children:[h.jsx("input",{ref:ot,type:"text",value:u,onChange:H,onFocus:m?void 0:X,onKeyDown:m?void 0:yt,placeholder:`${d.toLowerCase()}...`,spellCheck:!1,style:{flex:1,background:"transparent",border:"none",padding:"8px 12px",color:"var(--text)",fontFamily:"inherit",fontSize:13,outline:"none",minWidth:0},onFocusCapture:k=>{k.target.closest("div").style.borderColor=n+"66"},onBlurCapture:k=>{k.target.closest("div").style.borderColor=n+"33",setTimeout(()=>v(!1),150)}}),S&&h.jsxs("div",{style:{display:"flex",gap:2,paddingRight:6,flexShrink:0},children:[h.jsx(hn,{label:"Aa",active:S.caseSensitive,onClick:()=>y("caseSensitive"),color:n}),h.jsx(hn,{label:"ab",active:S.wholeWord,onClick:()=>y("wholeWord"),color:n}),h.jsx(hn,{label:".*",active:S.regex,onClick:()=>y("regex"),color:n})]})]}),x&&$.length>0&&h.jsx("div",{ref:at,style:{position:"absolute",top:"100%",left:0,right:0,marginTop:4,background:"var(--panel)",border:"1px solid var(--border)",borderRadius:6,maxHeight:200,overflowY:"auto",zIndex:100,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},children:$.map((k,et)=>h.jsxs("div",{onMouseDown:dt=>{dt.preventDefault(),st(k.name)},style:{padding:"6px 12px",cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center",background:et===C?"rgba(255,255,255,0.05)":"transparent"},children:[h.jsx("span",{style:{color:"var(--text)"},children:k.name}),h.jsx("span",{style:{color:"var(--text-dim)",fontSize:11},children:k.type})]},k.name))})]})}function yo({onClick:d}){return h.jsx("button",{onClick:d,title:"Refresh",style:{alignSelf:"flex-end",background:"none",border:"1px solid var(--border)",borderRadius:6,padding:"8px 10px",color:"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:14,lineHeight:1,flexShrink:0,display:"flex",alignItems:"center"},onMouseEnter:n=>{n.currentTarget.style.color="var(--text)",n.currentTarget.style.borderColor="var(--text-dim)"},onMouseLeave:n=>{n.currentTarget.style.color="var(--text-dim)",n.currentTarget.style.borderColor="var(--border)"},children:"↻"})}function ap({filters:d,onFilterChange:n,columns:a,highlightOptions:u,onHighlightOptionToggle:o,onRefresh:f}){const g=[{key:"include",label:"Include",color:"var(--green)",bgColor:"var(--green-bg)"},{key:"exclude",label:"Exclude",color:"var(--red)",bgColor:"var(--red-bg)"},{key:"highlight",label:"Highlight",color:"var(--yellow)",bgColor:"var(--yellow-bg)",plainText:!0},{key:"columns",label:"Columns",color:"var(--purple)",bgColor:"var(--purple-bg)",columnsOnly:!0}];return h.jsxs("div",{style:{display:"flex",gap:12,padding:"16px 20px",background:"var(--panel)",borderBottom:"1px solid var(--border)",flexWrap:"wrap"},children:[g.map(m=>h.jsx(np,{label:m.label,color:m.color,bgColor:m.bgColor,value:d[m.key],onChange:S=>n(m.key,S),columns:a,columnsOnly:m.columnsOnly||!1,plainText:m.plainText||!1,highlightOptions:m.key==="highlight"?u:void 0,onHighlightOptionToggle:m.key==="highlight"?o:void 0},m.key)),f&&h.jsx(yo,{onClick:f})]})}function sp({sql:d}){const[n,a]=N.useState(!1);return d?h.jsxs("div",{style:{borderBottom:"1px solid var(--border)",background:"var(--panel)"},children:[h.jsxs("button",{onClick:()=>a(!n),style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"8px 20px",background:"none",border:"none",color:"var(--text-dim)",fontFamily:"inherit",fontSize:11,cursor:"pointer",textAlign:"left"},children:[h.jsx("span",{style:{transform:n?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.15s"},children:"▶"}),"SQL Preview"]}),n&&h.jsx("pre",{style:{padding:"8px 20px 12px",margin:0,color:"var(--text-dim)",fontSize:11,lineHeight:1.6,overflowX:"auto",whiteSpace:"pre-wrap",wordBreak:"break-all"},children:d})]}):null}function rp(d){return typeof d=="number"?d.toLocaleString(void 0,{maximumFractionDigits:2}):String(d)}function up({results:d,config:n,tableName:a}){const u=(d==null?void 0:d.value)??0,o=(d==null?void 0:d.label)??((n==null?void 0:n.aggregation)||"COUNT").toUpperCase();return h.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:20,gap:8,overflow:"hidden"},children:[h.jsx("span",{style:{fontSize:11,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:"0.1em"},children:o}),h.jsx("span",{style:{fontSize:48,fontWeight:700,color:"var(--cyan)",lineHeight:1.1,textAlign:"center",wordBreak:"break-all"},children:rp(u)}),h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)",opacity:.6},children:a})]})}function vo(d){return typeof d=="number"?d.toLocaleString(void 0,{maximumFractionDigits:2}):String(d)}const Us=["var(--cyan)","var(--purple)","var(--green)","var(--yellow)","var(--red)","#ff9f43","#a29bfe","#fd79a8","#00cec9","#e17055"];function bh({data:d,maxValue:n}){return h.jsx("div",{style:{flex:1,overflow:"auto",padding:"4px 0"},children:d.length===0?h.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--text-dim)"},children:"No data"}):d.map((a,u)=>h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"4px 16px",fontSize:12,background:u%2===1?"var(--row-alt)":"transparent"},onMouseEnter:o=>{o.currentTarget.style.background="var(--row-hover)"},onMouseLeave:o=>{o.currentTarget.style.background=u%2===1?"var(--row-alt)":"transparent"},children:[h.jsx("span",{style:{width:120,flexShrink:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--text)",fontSize:11},title:a.group,children:a.group}),h.jsx("div",{style:{flex:1,height:18,background:"rgba(34, 211, 238, 0.06)",borderRadius:3,overflow:"hidden"},children:h.jsx("div",{style:{width:`${Math.abs(a.value)/n*100}%`,height:"100%",background:"var(--cyan)",opacity:.4,borderRadius:3,transition:"width 0.3s ease",minWidth:2}})}),h.jsx("span",{style:{width:80,flexShrink:0,textAlign:"right",color:"var(--cyan)",fontWeight:600,fontSize:11},children:vo(a.value)})]},a.group))})}function op({data:d,maxValue:n}){const a=N.useRef(null),[u,o]=N.useState({w:400,h:300});N.useEffect(()=>{if(!a.current)return;const x=new ResizeObserver(v=>{const{width:C,height:Z}=v[0].contentRect;o({w:C,h:Z})});return x.observe(a.current),()=>x.disconnect()},[]);const f={top:20,right:20,bottom:60,left:60},g=u.w-f.left-f.right,m=u.h-f.top-f.bottom,S=d.length>0?Math.min(40,g/d.length*.7):20,y=d.length>0?g/d.length:0;return h.jsx("div",{ref:a,style:{flex:1,overflow:"hidden"},children:h.jsxs("svg",{width:u.w,height:u.h,children:[h.jsx("line",{x1:f.left,y1:f.top,x2:f.left,y2:f.top+m,stroke:"var(--border)",strokeWidth:1}),h.jsx("line",{x1:f.left,y1:f.top+m,x2:f.left+g,y2:f.top+m,stroke:"var(--border)",strokeWidth:1}),[0,.25,.5,.75,1].map(x=>{const v=f.top+m*(1-x);return h.jsxs("g",{children:[h.jsx("line",{x1:f.left-4,y1:v,x2:f.left+g,y2:v,stroke:"var(--border)",strokeWidth:.5,strokeDasharray:x>0?"2,4":"0"}),h.jsx("text",{x:f.left-8,y:v+3,textAnchor:"end",fill:"var(--text-dim)",fontSize:9,children:vo(Math.round(n*x))})]},x)}),d.map((x,v)=>{const C=f.left+y*v+(y-S)/2,Z=n>0?Math.abs(x.value)/n*m:0,$=f.top+m-Z;return h.jsxs("g",{children:[h.jsx("rect",{x:C,y:$,width:S,height:Z,fill:Us[v%Us.length],opacity:.6,rx:2}),h.jsx("text",{x:C+S/2,y:f.top+m+12,textAnchor:"middle",fill:"var(--text-dim)",fontSize:9,transform:`rotate(-35, ${C+S/2}, ${f.top+m+12})`,children:x.group.length>10?x.group.slice(0,9)+"…":x.group})]},x.group)})]})})}function cp({data:d}){const n=N.useRef(null),[a,u]=N.useState({w:400,h:300});N.useEffect(()=>{if(!n.current)return;const v=new ResizeObserver(C=>{const{width:Z,height:$}=C[0].contentRect;u({w:Z,h:$})});return v.observe(n.current),()=>v.disconnect()},[]);const o=d.reduce((v,C)=>v+Math.abs(C.value),0),f=Math.min(a.w*.35,(a.h-20)*.45),g=a.w*.4,m=a.h/2;let S=-Math.PI/2;const y=d.map((v,C)=>{const Z=o>0?Math.abs(v.value)/o:0,$=Z*Math.PI*2,J=S;S+=$;const ot=S,at=$>Math.PI?1:0,Et=g+f*Math.cos(J),X=m+f*Math.sin(J),st=g+f*Math.cos(ot),yt=m+f*Math.sin(ot),H=Z>=1?`M ${g-f} ${m} A ${f} ${f} 0 1 1 ${g+f} ${m} A ${f} ${f} 0 1 1 ${g-f} ${m}`:`M ${g} ${m} L ${Et} ${X} A ${f} ${f} 0 ${at} 1 ${st} ${yt} Z`;return{...v,d:H,color:Us[C%Us.length],frac:Z}}),x=a.w*.72;return h.jsx("div",{ref:n,style:{flex:1,overflow:"hidden"},children:h.jsxs("svg",{width:a.w,height:a.h,children:[y.map(v=>h.jsx("path",{d:v.d,fill:v.color,opacity:.7,stroke:"var(--bg)",strokeWidth:1.5},v.group)),y.slice(0,12).map((v,C)=>h.jsxs("g",{transform:`translate(${x}, ${20+C*18})`,children:[h.jsx("rect",{width:10,height:10,fill:v.color,opacity:.7,rx:2}),h.jsx("text",{x:14,y:9,fill:"var(--text)",fontSize:10,children:v.group.length>14?v.group.slice(0,13)+"…":v.group}),h.jsxs("text",{x:124,y:9,fill:"var(--text-dim)",fontSize:9,textAnchor:"end",children:[(v.frac*100).toFixed(1),"%"]})]},v.group)),d.length>12&&h.jsxs("text",{x,y:246,fill:"var(--text-dim)",fontSize:9,children:["+",d.length-12," more..."]})]})})}function Sh({data:d,maxValue:n,filled:a}){const u=N.useRef(null),[o,f]=N.useState({w:400,h:300});N.useEffect(()=>{if(!u.current)return;const C=new ResizeObserver(Z=>{const{width:$,height:J}=Z[0].contentRect;f({w:$,h:J})});return C.observe(u.current),()=>C.disconnect()},[]);const g={top:20,right:20,bottom:60,left:60},m=o.w-g.left-g.right,S=o.h-g.top-g.bottom,y=d.map((C,Z)=>{const $=g.left+(d.length>1?Z/(d.length-1)*m:m/2),J=g.top+S-(n>0?Math.abs(C.value)/n*S:0);return{x:$,y:J,...C}}),x=y.map(C=>`${C.x},${C.y}`).join(" "),v=y.length>0?`M ${g.left} ${g.top+S} `+y.map(C=>`L ${C.x} ${C.y}`).join(" ")+` L ${g.left+m} ${g.top+S} Z`:"";return h.jsx("div",{ref:u,style:{flex:1,overflow:"hidden"},children:h.jsxs("svg",{width:o.w,height:o.h,children:[h.jsx("line",{x1:g.left,y1:g.top,x2:g.left,y2:g.top+S,stroke:"var(--border)",strokeWidth:1}),h.jsx("line",{x1:g.left,y1:g.top+S,x2:g.left+m,y2:g.top+S,stroke:"var(--border)",strokeWidth:1}),[0,.25,.5,.75,1].map(C=>{const Z=g.top+S*(1-C);return h.jsxs("g",{children:[h.jsx("line",{x1:g.left-4,y1:Z,x2:g.left+m,y2:Z,stroke:"var(--border)",strokeWidth:.5,strokeDasharray:C>0?"2,4":"0"}),h.jsx("text",{x:g.left-8,y:Z+3,textAnchor:"end",fill:"var(--text-dim)",fontSize:9,children:vo(Math.round(n*C))})]},C)}),a&&v&&h.jsx("path",{d:v,fill:"var(--cyan)",opacity:.15}),y.length>1&&h.jsx("polyline",{points:x,fill:"none",stroke:"var(--cyan)",strokeWidth:2,opacity:.8}),y.map(C=>h.jsx("circle",{cx:C.x,cy:C.y,r:3.5,fill:"var(--cyan)",opacity:.9},C.group)),y.map((C,Z)=>h.jsx("text",{x:C.x,y:g.top+S+12,textAnchor:"middle",fill:"var(--text-dim)",fontSize:9,transform:`rotate(-35, ${C.x}, ${g.top+S+12})`,children:C.group.length>10?C.group.slice(0,9)+"…":C.group},C.group))]})})}function fp({results:d,config:n,tableName:a,chartType:u="hbar"}){const o=(d==null?void 0:d.results)??[],f=N.useMemo(()=>Math.max(...o.map(m=>Math.abs(m.value)),1),[o]),g=(n==null?void 0:n.aggregation)==="count"?"COUNT":`${((n==null?void 0:n.aggregation)||"count").toUpperCase()} of ${(n==null?void 0:n.valueColumn)||"?"}`;return h.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[h.jsxs("div",{style:{padding:"6px 16px",fontSize:11,color:"var(--text-dim)",borderBottom:"1px solid var(--border)",background:"var(--panel)",flexShrink:0},children:["GROUP BY ",h.jsx("span",{style:{color:"var(--text)"},children:n==null?void 0:n.groupByColumn})," — ",g,h.jsxs("span",{style:{marginLeft:8,opacity:.6},children:[o.length," groups"]})]}),o.length===0?h.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-dim)"},children:"No data"}):u==="hbar"?h.jsx(bh,{data:o,maxValue:f}):u==="vbar"?h.jsx(op,{data:o,maxValue:f}):u==="pie"?h.jsx(cp,{data:o}):u==="line"?h.jsx(Sh,{data:o,maxValue:f,filled:!1}):u==="area"?h.jsx(Sh,{data:o,maxValue:f,filled:!0}):h.jsx(bh,{data:o,maxValue:f})]})}const Qe="";async function dp(){const d=await fetch(`${Qe}/api/health`);if(!d.ok)throw new Error(`Health check failed: ${d.statusText}`);return d.json()}async function hp(d,n=""){const a=await fetch(`${Qe}/api/pg/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connection_string:d,label:n})});if(!a.ok){const u=await a.json().catch(()=>({detail:a.statusText}));throw new Error(u.detail||a.statusText)}return a.json()}async function co(d){const n=await fetch(`${Qe}/api/pg/${encodeURIComponent(d)}/tables`);if(!n.ok)throw new Error(`Failed to fetch tables: ${n.statusText}`);return n.json()}async function gp(d,n,a){const u=await fetch(`${Qe}/api/pg/${encodeURIComponent(d)}/tables/${encodeURIComponent(n)}/${encodeURIComponent(a)}/columns`);if(!u.ok)throw new Error(`Failed to fetch columns: ${u.statusText}`);return u.json()}async function Eh(d,{schema:n,table:a,include:u="",exclude:o="",highlight:f="",columns:g="",limit:m=500,offset:S=0,view_mode:y,aggregation:x,agg_column:v,group_by_column:C,value_column:Z}){const $={schema:n,table:a,include:u,exclude:o,highlight:f,columns:g,limit:m,offset:S};y&&($.view_mode=y),x&&($.aggregation=x),v&&($.agg_column=v),C&&($.group_by_column=C),Z&&($.value_column=Z);const J=await fetch(`${Qe}/api/pg/${encodeURIComponent(d)}/query`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)});if(!J.ok){const ot=await J.json().catch(()=>({detail:J.statusText}));throw new Error(ot.detail||J.statusText)}return J.json()}async function mp(d,n=""){const a=await fetch(`${Qe}/api/redis/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connection_string:d,label:n})});if(!a.ok){const u=await a.json().catch(()=>({detail:a.statusText}));throw new Error(u.detail||a.statusText)}return a.json()}async function pp(d,{pattern:n="*",offset:a=0,limit:u=100}){const o=await fetch(`${Qe}/api/redis/${encodeURIComponent(d)}/keys`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pattern:n,offset:a,limit:u})});if(!o.ok){const f=await o.json().catch(()=>({detail:o.statusText}));throw new Error(f.detail||o.statusText)}return o.json()}async function yp(d,n){const a=await fetch(`${Qe}/api/redis/${encodeURIComponent(d)}/keys/${encodeURIComponent(n)}`);if(!a.ok){const u=await a.json().catch(()=>({detail:a.statusText}));throw new Error(u.detail||a.statusText)}return a.json()}async function vp({endpointUrl:d,accessKey:n,secretKey:a,region:u,label:o=""}){const f=await fetch(`${Qe}/api/s3/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint_url:d,access_key:n,secret_key:a,region:u||"us-east-1",label:o})});if(!f.ok){const g=await f.json().catch(()=>({detail:f.statusText}));throw new Error(g.detail||f.statusText)}return f.json()}async function fo(d){const n=await fetch(`${Qe}/api/s3/${encodeURIComponent(d)}/buckets`);if(!n.ok)throw new Error(`Failed to fetch buckets: ${n.statusText}`);return n.json()}async function xp(d,{bucket:n,prefix:a="",continuationToken:u=null,limit:o=100}){const f=await fetch(`${Qe}/api/s3/${encodeURIComponent(d)}/keys`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({bucket:n,prefix:a,continuation_token:u,limit:o})});if(!f.ok){const g=await f.json().catch(()=>({detail:f.statusText}));throw new Error(g.detail||f.statusText)}return f.json()}async function bp(d,n,a){const u=await fetch(`${Qe}/api/s3/${encodeURIComponent(d)}/keys/${encodeURIComponent(n)}/${encodeURIComponent(a)}`);if(!u.ok){const o=await u.json().catch(()=>({detail:u.statusText}));throw new Error(o.detail||u.statusText)}return u.json()}function Sp(d,n,a={}){if(!n)return!1;const{caseSensitive:u,wholeWord:o,regex:f}=a;return Object.values(d).some(g=>{if(g==null)return!1;const m=String(g);if(f)try{const S=u?"":"i",y=o?`\\b${n}\\b`:n;return new RegExp(y,S).test(m)}catch{return!1}if(o){const S=u?"":"i";try{return new RegExp(`\\b${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,S).test(m)}catch{return!1}}return u?m.includes(n):m.toLowerCase().includes(n.toLowerCase())})}const _h=d=>({background:"none",border:"1px solid var(--border)",borderRadius:4,padding:"2px 8px",color:d?"var(--text)":"var(--text-dim)",cursor:d?"pointer":"default",fontFamily:"inherit",fontSize:11,opacity:d?1:.4});function zh(d,n){return d==="number"?{view_mode:"number",aggregation:(n==null?void 0:n.aggregation)||"count",agg_column:(n==null?void 0:n.column)||null}:d==="chart"?{view_mode:"chart",aggregation:(n==null?void 0:n.aggregation)||"count",group_by_column:(n==null?void 0:n.groupByColumn)||null,value_column:(n==null?void 0:n.valueColumn)||null}:{}}function Ep({tab:d,updateTab:n,pageSize:a,setError:u,refreshKey:o,locked:f}){var H,k,et,dt,At;const g=N.useRef(null),m=N.useRef(a);m.current=a;const S=N.useRef(o);N.useEffect(()=>{d.columns.length>0||gp(d.instanceId,d.schema,d.name).then(Q=>n({columns:Q.columns})).catch(Q=>u(Q.message))},[]),N.useEffect(()=>{d.columns.length===0||d.results||x(d,0)},[d.columns.length]),N.useEffect(()=>{o!==S.current&&x(d,d.page)},[o]);const y=N.useRef({viewMode:d.viewMode,viewConfig:d.viewConfig});N.useEffect(()=>{const Q=y.current,nt={viewMode:d.viewMode,viewConfig:d.viewConfig};y.current=nt,d.columns.length!==0&&JSON.stringify(Q)!==JSON.stringify(nt)&&x(d,0)},[d.viewMode,d.viewConfig]);const x=N.useCallback((Q,nt=0)=>{const bt=m.current,mt=Q.viewMode||"table";n({loading:!0}),u(null),Eh(Q.instanceId,{schema:Q.schema,table:Q.name,include:Q.filters.include,exclude:Q.filters.exclude,highlight:Q.filters.highlight,columns:Q.filters.columns,limit:bt,offset:nt*bt,...zh(mt,Q.viewConfig)}).then(Ut=>n({results:Ut,loading:!1})).catch(Ut=>{u(Ut.message),n({loading:!1})})},[n,u]),v=(Q,nt)=>{const bt={...d.filters,[Q]:nt};n({filters:bt}),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{n({page:0,loading:!0}),u(null),Eh(d.instanceId,{schema:d.schema,table:d.name,include:Q==="include"?nt:d.filters.include,exclude:Q==="exclude"?nt:d.filters.exclude,highlight:Q==="highlight"?nt:d.filters.highlight,columns:Q==="columns"?nt:d.filters.columns,limit:m.current,offset:0,...zh(d.viewMode||"table",d.viewConfig)}).then(mt=>n({results:mt,loading:!1})).catch(mt=>{u(mt.message),n({loading:!1})})},300)},C=Q=>{n({page:Q}),x({...d,page:Q},Q)},Z=(H=d.results)==null?void 0:H.rows,$=Z&&Z.length>0?Object.keys(Z[0]):[],J=(k=d.results)==null?void 0:k.total_count,ot=J!=null?Math.ceil(J/a):0,at=d.page>0,Et=J!=null&&(d.page+1)*a<J,X=d.page*a+1,st=d.page*a+((Z==null?void 0:Z.length)||0),yt=d.viewMode||"table";return h.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden"},children:[!f&&d.filtersVisible!==!1&&d.columns.length>0&&yt==="table"&&h.jsx(ap,{filters:d.filters,onFilterChange:v,columns:d.columns,highlightOptions:d.highlightOptions,onHighlightOptionToggle:Q=>n({highlightOptions:{...d.highlightOptions,[Q]:!d.highlightOptions[Q]}}),onRefresh:()=>x(d,d.page)}),!f&&d.filtersVisible!==!1&&yt==="table"&&h.jsx(sp,{sql:(et=d.results)==null?void 0:et.sql}),yt==="number"&&((dt=d.results)==null?void 0:dt.view_mode)==="number"&&h.jsx(up,{results:d.results,config:d.viewConfig,tableName:d.displayName}),yt==="number"&&!d.results&&h.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-dim)"},children:"Loading..."}),yt==="chart"&&((At=d.results)==null?void 0:At.view_mode)==="chart"&&h.jsx(fp,{results:d.results,config:d.viewConfig,tableName:d.displayName,chartType:d.chartType||"hbar"}),yt==="chart"&&!d.results&&h.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-dim)"},children:"Loading..."}),yt==="table"&&Z&&h.jsxs("div",{style:{flex:1,overflow:"auto",position:"relative"},children:[h.jsxs("div",{style:{padding:"8px 20px",fontSize:11,color:"var(--text-dim)",borderBottom:"1px solid var(--border)",background:"var(--panel)",position:"sticky",top:0,zIndex:10,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsx("span",{children:Z.length>0?`${X}–${st} of ${J??"?"}`:`0 of ${J??"?"}`}),ot>1&&h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[h.jsx("button",{style:_h(at),disabled:!at,onClick:()=>at&&C(d.page-1),children:"Prev"}),h.jsxs("span",{children:[d.page+1," / ",ot]}),h.jsx("button",{style:_h(Et),disabled:!Et,onClick:()=>Et&&C(d.page+1),children:"Next"})]})]}),Z.length===0?h.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--text-dim)"},children:"No results"}):h.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[h.jsx("thead",{children:h.jsx("tr",{children:$.map(Q=>h.jsx("th",{style:{position:"sticky",top:33,background:"var(--bg)",padding:"8px 12px",textAlign:"left",fontWeight:600,fontSize:11,textTransform:"uppercase",letterSpacing:"0.05em",color:"var(--text-dim)",borderBottom:"1px solid var(--border)",whiteSpace:"nowrap",zIndex:5},children:Q},Q))})}),h.jsx("tbody",{children:Z.map((Q,nt)=>{const bt=Sp(Q,d.filters.highlight,d.highlightOptions);return h.jsx("tr",{style:{background:bt?"var(--highlight-row)":nt%2===1?"var(--row-alt)":"transparent",borderLeft:bt?"3px solid var(--yellow)":"3px solid transparent"},onMouseEnter:mt=>{bt||(mt.currentTarget.style.background="var(--row-hover)")},onMouseLeave:mt=>{mt.currentTarget.style.background=bt?"var(--highlight-row)":nt%2===1?"var(--row-alt)":"transparent"},children:$.map(mt=>h.jsx("td",{style:{padding:"6px 12px",borderBottom:"1px solid var(--border)",whiteSpace:"nowrap",maxWidth:300,overflow:"hidden",textOverflow:"ellipsis"},children:Q[mt]===null?h.jsx("span",{style:{color:"var(--text-dim)",fontStyle:"italic"},children:"null"}):String(Q[mt])},mt))},nt)})})]})]})]})}function _p(d,n){return d==null?"null":n==="hash"&&typeof d=="object"&&!Array.isArray(d)?JSON.stringify(d,null,2):n==="zset"&&Array.isArray(d)?d.map(([a,u])=>`${u}  ${a}`).join(`
`):Array.isArray(d)?d.map((a,u)=>`[${u}] ${typeof a=="object"?JSON.stringify(a):a}`).join(`
`):typeof d=="object"?JSON.stringify(d,null,2):String(d)}function zp(d){return d<1024?`${d} B`:d<1048576?`${(d/1024).toFixed(1)} KB`:d<1073741824?`${(d/1048576).toFixed(1)} MB`:`${(d/1073741824).toFixed(1)} GB`}function Cp({detail:d,loading:n,onClose:a}){return!d&&!n?null:h.jsxs("div",{style:{width:420,minWidth:320,borderLeft:"1px solid var(--border)",background:"var(--panel)",display:"flex",flexDirection:"column",overflow:"hidden",flexShrink:0},children:[h.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--cyan)"},children:n?"Loading...":(d==null?void 0:d.key)||"Key Detail"}),h.jsx("button",{onClick:a,style:{background:"none",border:"none",color:"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:14,padding:"0 4px",borderRadius:3},onMouseEnter:u=>{u.target.style.color="var(--red)"},onMouseLeave:u=>{u.target.style.color="var(--text-dim)"},children:"x"})]}),n&&h.jsx("div",{style:{padding:20,color:"var(--text-dim)",fontSize:12},children:"Loading..."}),d&&!n&&h.jsxs("div",{style:{flex:1,overflow:"auto",padding:16},children:[h.jsxs("div",{style:{display:"flex",gap:12,marginBottom:16,flexWrap:"wrap"},children:[h.jsxs("div",{style:{fontSize:11},children:[h.jsx("span",{style:{color:"var(--text-dim)"},children:"Type "}),h.jsx("span",{style:{color:"var(--cyan)",background:"var(--cyan-bg)",padding:"2px 6px",borderRadius:3,fontSize:10,fontWeight:600},children:d.type})]}),d.ttl!==null&&d.ttl!==void 0&&h.jsxs("div",{style:{fontSize:11},children:[h.jsx("span",{style:{color:"var(--text-dim)"},children:"TTL "}),h.jsxs("span",{style:{color:"var(--yellow)"},children:[d.ttl,"s"]})]}),d.size!==null&&d.size!==void 0&&h.jsxs("div",{style:{fontSize:11},children:[h.jsx("span",{style:{color:"var(--text-dim)"},children:"Size "}),h.jsxs("span",{style:{color:"var(--text)"},children:[d.size," bytes"]})]})]}),h.jsx("div",{style:{marginBottom:8},children:h.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.1em",color:"var(--text-dim)"},children:"Value"})}),h.jsx("pre",{style:{background:"var(--bg)",border:"1px solid var(--border)",borderRadius:6,padding:12,margin:0,color:"var(--text)",fontSize:12,lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-all",overflow:"auto",maxHeight:"calc(100vh - 200px)"},children:_p(d.value,d.type)})]})]})}function Tp({detail:d,loading:n,onClose:a}){return!d&&!n?null:h.jsxs("div",{style:{width:420,minWidth:320,borderLeft:"1px solid var(--border)",background:"var(--panel)",display:"flex",flexDirection:"column",overflow:"hidden",flexShrink:0},children:[h.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--orange)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,marginRight:8},children:n?"Loading...":(d==null?void 0:d.key)||"Object Detail"}),h.jsx("button",{onClick:a,style:{background:"none",border:"none",color:"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:14,padding:"0 4px",borderRadius:3,flexShrink:0},onMouseEnter:u=>{u.target.style.color="var(--red)"},onMouseLeave:u=>{u.target.style.color="var(--text-dim)"},children:"x"})]}),n&&h.jsx("div",{style:{padding:20,color:"var(--text-dim)",fontSize:12},children:"Loading..."}),d&&!n&&h.jsxs("div",{style:{flex:1,overflow:"auto",padding:16},children:[h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,marginBottom:16},children:[h.jsxs("div",{style:{fontSize:11},children:[h.jsx("span",{style:{color:"var(--text-dim)"},children:"Size "}),h.jsx("span",{style:{color:"var(--text)"},children:zp(d.size)})]}),h.jsxs("div",{style:{fontSize:11},children:[h.jsx("span",{style:{color:"var(--text-dim)"},children:"Type "}),h.jsx("span",{style:{color:"var(--orange)",background:"var(--orange-bg)",padding:"2px 6px",borderRadius:3,fontSize:10,fontWeight:600},children:d.content_type})]}),h.jsxs("div",{style:{fontSize:11},children:[h.jsx("span",{style:{color:"var(--text-dim)"},children:"Modified "}),h.jsx("span",{style:{color:"var(--text)"},children:d.last_modified})]}),h.jsxs("div",{style:{fontSize:11},children:[h.jsx("span",{style:{color:"var(--text-dim)"},children:"ETag "}),h.jsx("span",{style:{color:"var(--text-dim)"},children:d.etag})]}),d.metadata&&Object.keys(d.metadata).length>0&&h.jsxs("div",{style:{fontSize:11},children:[h.jsx("span",{style:{color:"var(--text-dim)"},children:"Metadata "}),h.jsx("span",{style:{color:"var(--text)"},children:JSON.stringify(d.metadata)})]})]}),h.jsx("div",{style:{marginBottom:8},children:h.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.1em",color:"var(--text-dim)"},children:"Content"})}),h.jsx("pre",{style:{background:"var(--bg)",border:"1px solid var(--border)",borderRadius:6,padding:12,margin:0,color:"var(--text)",fontSize:12,lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-all",overflow:"auto",maxHeight:"calc(100vh - 280px)"},children:d.value||"[no preview available]"})]})]})}function Ch(d){return{string:"var(--green)",list:"var(--yellow)",set:"var(--purple)",zset:"var(--cyan)",hash:"#ff9f43",stream:"var(--red)"}[d]||"var(--text-dim)"}const Th=d=>({background:"none",border:"1px solid var(--border)",borderRadius:4,padding:"2px 8px",color:d?"var(--text)":"var(--text-dim)",cursor:d?"pointer":"default",fontFamily:"inherit",fontSize:11,opacity:d?1:.4});function Rp({tab:d,updateTab:n,pageSize:a,setError:u,refreshKey:o,locked:f}){var et,dt,At;const[g,m]=N.useState(null),[S,y]=N.useState(null),[x,v]=N.useState(!1),C=N.useRef(null),Z=N.useRef(a);Z.current=a;const $=N.useRef(o);N.useEffect(()=>{d.results||J(d.filter||"*",0)},[]),N.useEffect(()=>{o!==$.current&&J(d.filter||"*",d.page*a)},[o]);const J=N.useCallback((Q,nt=0)=>{n({loading:!0}),u(null),pp(d.instanceId,{pattern:Q||"*",offset:nt,limit:Z.current}).then(bt=>{n({results:bt,loading:!1})}).catch(bt=>{u(bt.message),n({loading:!1})})},[n,u]),ot=Q=>{n({filter:Q}),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{n({page:0}),J(Q||"*",0)},300)},at=()=>{var nt;if(!((nt=d.results)!=null&&nt.has_more))return;const Q=d.page+1;n({page:Q}),J(d.filter||"*",Q*a)},Et=()=>{if(d.page<=0)return;const Q=d.page-1;n({page:Q}),J(d.filter||"*",Q*a)},X=Q=>{if(g===Q){m(null),y(null);return}m(Q),v(!0),y(null),yp(d.instanceId,Q).then(nt=>{y(nt),v(!1)}).catch(nt=>{u(nt.message),v(!1)})},st=(et=d.results)==null?void 0:et.rows,yt=((dt=d.results)==null?void 0:dt.total_count)||0,H=((At=d.results)==null?void 0:At.has_more)||!1,k=st&&st.length>0?Object.keys(st[0]):[];return h.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[h.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden"},children:[!f&&d.filtersVisible!==!1&&h.jsxs("div",{style:{display:"flex",gap:12,padding:"12px 20px",background:"var(--panel)",borderBottom:"1px solid var(--border)",alignItems:"flex-end"},children:[h.jsxs("div",{style:{flex:1},children:[h.jsx("label",{style:{display:"block",fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.1em",color:"var(--green)",marginBottom:4},children:"Filter keys"}),h.jsx("div",{style:{display:"flex",alignItems:"center",background:"var(--green-bg)",border:"1px solid var(--green)33",borderRadius:6},children:h.jsx("input",{type:"text",value:d.filter||"",onChange:Q=>ot(Q.target.value),placeholder:"pattern (e.g. user:*, session:abc*, *config*)",spellCheck:!1,style:{flex:1,background:"transparent",border:"none",padding:"8px 12px",color:"var(--text)",fontFamily:"inherit",fontSize:13,outline:"none"},onFocus:Q=>{Q.target.closest("div").style.borderColor="var(--green)66"},onBlur:Q=>{Q.target.closest("div").style.borderColor="var(--green)33"}})}),h.jsx("div",{style:{fontSize:10,color:"var(--text-dim)",marginTop:4},children:"Supports glob patterns: * ? [abc]. Plain text auto-wraps as *text*."})]}),h.jsx(yo,{onClick:()=>J(d.filter||"*",d.page*a)})]}),st!=null&&h.jsxs("div",{style:{flex:1,overflow:"auto",position:"relative"},children:[h.jsxs("div",{style:{padding:"8px 20px",fontSize:11,color:"var(--text-dim)",borderBottom:"1px solid var(--border)",background:"var(--panel)",position:"sticky",top:0,zIndex:10,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsxs("span",{children:[yt," keys",d.filter?` matching "${d.filter}"`:"",yt>a?` (showing ${d.page*a+1}–${Math.min((d.page+1)*a,yt)})`:""]}),(H||d.page>0)&&h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[h.jsx("button",{style:Th(d.page>0),disabled:d.page<=0,onClick:Et,children:"Prev"}),h.jsxs("span",{children:["Page ",d.page+1," of ",Math.ceil(yt/a)]}),h.jsx("button",{style:Th(H),disabled:!H,onClick:at,children:"Next"})]})]}),st.length===0?h.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--text-dim)"},children:"No keys found"}):h.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[h.jsx("thead",{children:h.jsx("tr",{children:k.map(Q=>h.jsx("th",{style:{position:"sticky",top:33,background:"var(--bg)",padding:"8px 12px",textAlign:"left",fontWeight:600,fontSize:11,textTransform:"uppercase",letterSpacing:"0.05em",color:"var(--text-dim)",borderBottom:"1px solid var(--border)",whiteSpace:"nowrap",zIndex:5},children:Q},Q))})}),h.jsx("tbody",{children:st.map((Q,nt)=>{const bt=g===Q.key;return h.jsx("tr",{onClick:()=>X(Q.key),style:{cursor:"pointer",background:bt?"var(--selected-row)":nt%2===1?"var(--row-alt)":"transparent",borderLeft:bt?"3px solid var(--purple)":"3px solid transparent"},onMouseEnter:mt=>{bt||(mt.currentTarget.style.background="var(--row-hover)")},onMouseLeave:mt=>{mt.currentTarget.style.background=bt?"var(--selected-row)":nt%2===1?"var(--row-alt)":"transparent"},children:k.map(mt=>h.jsx("td",{style:{padding:"6px 12px",borderBottom:"1px solid var(--border)",whiteSpace:"nowrap",maxWidth:500,overflow:"hidden",textOverflow:"ellipsis"},children:mt==="type"?h.jsx("span",{style:{color:Ch(Q[mt]),background:Ch(Q[mt])+"15",padding:"1px 6px",borderRadius:3,fontSize:10,fontWeight:600},children:Q[mt]}):String(Q[mt])},mt))},Q.key)})})]})]})]}),g&&h.jsx(Cp,{detail:S,loading:x,onClose:()=>{m(null),y(null)}})]})}function wp(d,n,a={}){if(!n)return!0;const{caseSensitive:u,wholeWord:o,regex:f}=a,g=String(d);if(f)try{const m=u?"":"i",S=o?`\\b${n}\\b`:n;return new RegExp(S,m).test(g)}catch{return!1}if(o){const m=u?"":"i";try{return new RegExp(`\\b${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,m).test(g)}catch{return!1}}return u?g.includes(n):g.toLowerCase().includes(n.toLowerCase())}function Mp(d){return d<1024?`${d} B`:d<1048576?`${(d/1024).toFixed(1)} KB`:d<1073741824?`${(d/1048576).toFixed(1)} MB`:`${(d/1073741824).toFixed(1)} GB`}const Rh=d=>({background:"none",border:"1px solid var(--border)",borderRadius:4,padding:"2px 8px",color:d?"var(--text)":"var(--text-dim)",cursor:d?"pointer":"default",fontFamily:"inherit",fontSize:11,opacity:d?1:.4});function Ap({tab:d,updateTab:n,pageSize:a,setError:u,refreshKey:o,locked:f}){var bt,mt,Ut;const[g,m]=N.useState(null),[S,y]=N.useState(null),[x,v]=N.useState(!1),[C,Z]=N.useState(""),[$,J]=N.useState({caseSensitive:!1,wholeWord:!1,regex:!1}),ot=N.useRef(null),at=N.useRef(a);at.current=a;const Et=N.useRef(o);N.useEffect(()=>{d.results||X(d.filter||"",null)},[]),N.useEffect(()=>{o!==Et.current&&X(d.filter||"",(d.tokens||[null])[d.page])},[o]);const X=N.useCallback((R,V)=>{n({loading:!0}),u(null),xp(d.instanceId,{bucket:d.bucket,prefix:R,continuationToken:V,limit:at.current}).then(P=>{n({results:P,loading:!1,nextToken:P.next_token})}).catch(P=>{u(P.message),n({loading:!1})})},[d.bucket,n,u]),st=R=>{n({filter:R}),ot.current&&clearTimeout(ot.current),ot.current=setTimeout(()=>{n({page:0,tokens:[null]}),X(R,null)},300)},yt=()=>{var P;if(!((P=d.results)!=null&&P.has_more))return;const R=d.page+1,V=[...d.tokens||[null]];V.length<=R&&V.push(d.nextToken),n({page:R,tokens:V}),X(d.filter||"",d.nextToken)},H=()=>{if(d.page<=0)return;const R=d.page-1;n({page:R}),X(d.filter||"",(d.tokens||[null])[R])},k=R=>{if(g===R){m(null),y(null);return}m(R),v(!0),y(null),bp(d.instanceId,d.bucket,R).then(V=>{y(V),v(!1)}).catch(V=>{u(V.message),v(!1)})},et=(bt=d.results)==null?void 0:bt.rows,dt=((mt=d.results)==null?void 0:mt.total_count)||0,At=((Ut=d.results)==null?void 0:Ut.has_more)||!1,Q=et&&et.length>0?Object.keys(et[0]):[],nt=et&&C?et.filter(R=>Object.values(R).some(V=>wp(V,C,$))):et;return h.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[h.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden"},children:[!f&&d.filtersVisible!==!1&&h.jsxs("div",{style:{display:"flex",gap:12,padding:"12px 20px",background:"var(--panel)",borderBottom:"1px solid var(--border)",alignItems:"flex-end"},children:[h.jsxs("div",{style:{flex:1,minWidth:200},children:[h.jsx("label",{style:{display:"block",fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.1em",color:"var(--green)",marginBottom:4},children:"Prefix"}),h.jsx("div",{style:{display:"flex",alignItems:"center",background:"var(--green-bg)",border:"1px solid var(--green)33",borderRadius:6},children:h.jsx("input",{type:"text",value:d.filter||"",onChange:R=>st(R.target.value),placeholder:"e.g. logs/, data/2024-, config",spellCheck:!1,style:{flex:1,background:"transparent",border:"none",padding:"8px 12px",color:"var(--text)",fontFamily:"inherit",fontSize:13,outline:"none"},onFocus:R=>{R.target.closest("div").style.borderColor="var(--green)66"},onBlur:R=>{R.target.closest("div").style.borderColor="var(--green)33"}})})]}),h.jsxs("div",{style:{flex:1,minWidth:200},children:[h.jsx("label",{style:{display:"block",fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.1em",color:"var(--yellow)",marginBottom:4},children:"Filter"}),h.jsxs("div",{style:{display:"flex",alignItems:"center",background:"var(--yellow-bg)",border:"1px solid var(--yellow)33",borderRadius:6},children:[h.jsx("input",{type:"text",value:C,onChange:R=>Z(R.target.value),placeholder:"filter returned keys...",spellCheck:!1,style:{flex:1,background:"transparent",border:"none",padding:"8px 12px",color:"var(--text)",fontFamily:"inherit",fontSize:13,outline:"none"},onFocus:R=>{R.target.closest("div").style.borderColor="var(--yellow)66"},onBlur:R=>{R.target.closest("div").style.borderColor="var(--yellow)33"}}),h.jsxs("div",{style:{display:"flex",gap:2,paddingRight:6,flexShrink:0},children:[h.jsx(hn,{label:"Aa",active:$.caseSensitive,onClick:()=>J(R=>({...R,caseSensitive:!R.caseSensitive})),color:"var(--yellow)"}),h.jsx(hn,{label:"ab",active:$.wholeWord,onClick:()=>J(R=>({...R,wholeWord:!R.wholeWord})),color:"var(--yellow)"}),h.jsx(hn,{label:".*",active:$.regex,onClick:()=>J(R=>({...R,regex:!R.regex})),color:"var(--yellow)"})]})]})]}),h.jsx(yo,{onClick:()=>X(d.filter||"",(d.tokens||[null])[d.page])})]}),et!=null&&h.jsxs("div",{style:{flex:1,overflow:"auto",position:"relative"},children:[h.jsxs("div",{style:{padding:"8px 20px",fontSize:11,color:"var(--text-dim)",borderBottom:"1px solid var(--border)",background:"var(--panel)",position:"sticky",top:0,zIndex:10,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsxs("span",{children:[C?`${nt.length} of ${dt} objects`:`${dt} objects`,d.filter?` with prefix "${d.filter}"`:""]}),(At||d.page>0)&&h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[h.jsx("button",{style:Rh(d.page>0),disabled:d.page<=0,onClick:H,children:"Prev"}),h.jsxs("span",{children:["Page ",d.page+1]}),h.jsx("button",{style:Rh(At),disabled:!At,onClick:yt,children:"Next"})]})]}),nt&&nt.length===0?h.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--text-dim)"},children:C?"No matching objects":"No objects found"}):nt&&h.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[h.jsx("thead",{children:h.jsx("tr",{children:Q.map(R=>h.jsx("th",{style:{position:"sticky",top:33,background:"var(--bg)",padding:"8px 12px",textAlign:"left",fontWeight:600,fontSize:11,textTransform:"uppercase",letterSpacing:"0.05em",color:"var(--text-dim)",borderBottom:"1px solid var(--border)",whiteSpace:"nowrap",zIndex:5},children:R},R))})}),h.jsx("tbody",{children:nt.map((R,V)=>{const P=g===R.key;return h.jsx("tr",{onClick:()=>k(R.key),style:{cursor:"pointer",background:P?"var(--selected-row)":V%2===1?"var(--row-alt)":"transparent",borderLeft:P?"3px solid var(--purple)":"3px solid transparent"},onMouseEnter:q=>{P||(q.currentTarget.style.background="var(--row-hover)")},onMouseLeave:q=>{q.currentTarget.style.background=P?"var(--selected-row)":V%2===1?"var(--row-alt)":"transparent"},children:Q.map(q=>h.jsx("td",{style:{padding:"6px 12px",borderBottom:"1px solid var(--border)",whiteSpace:"nowrap",maxWidth:500,overflow:"hidden",textOverflow:"ellipsis"},children:q==="size"?Mp(R[q]):String(R[q])},q))},R.key)})})]})]})]}),g&&h.jsx(Tp,{detail:S,loading:x,onClose:()=>{m(null),y(null)}})]})}var xo=Nh();class D{static getElements(n,a=document){if(typeof n=="string"){const u="getElementById"in a?a:void 0;if(u&&!isNaN(+n[0])){const f=u.getElementById(n);return f?[f]:[]}let o=a.querySelectorAll(n);if(!o.length&&n[0]!=="."&&n[0]!=="#"&&(o=a.querySelectorAll("."+n),o.length||(o=a.querySelectorAll("#"+n)),!o.length)){const f=a.querySelector(`[gs-id="${n}"]`);return f?[f]:[]}return Array.from(o)}return[n]}static getElement(n,a=document){if(typeof n=="string"){const u="getElementById"in a?a:void 0;if(!n.length)return null;if(u&&n[0]==="#")return u.getElementById(n.substring(1));if(n[0]==="#"||n[0]==="."||n[0]==="[")return a.querySelector(n);if(u&&!isNaN(+n[0]))return u.getElementById(n);let o=a.querySelector(n);return u&&!o&&(o=u.getElementById(n)),o||(o=a.querySelector("."+n)),o}return n}static lazyLoad(n){var a,u;return n.lazyLoad||((u=(a=n.grid)==null?void 0:a.opts)==null?void 0:u.lazyLoad)&&n.lazyLoad!==!1}static createDiv(n,a){const u=document.createElement("div");return n.forEach(o=>{o&&u.classList.add(o)}),a==null||a.appendChild(u),u}static shouldSizeToContent(n,a=!1){return(n==null?void 0:n.grid)&&(a?n.sizeToContent===!0||n.grid.opts.sizeToContent===!0&&n.sizeToContent===void 0:!!n.sizeToContent||n.grid.opts.sizeToContent&&n.sizeToContent!==!1)}static isIntercepted(n,a){return!(n.y>=a.y+a.h||n.y+n.h<=a.y||n.x+n.w<=a.x||n.x>=a.x+a.w)}static isTouching(n,a){return D.isIntercepted(n,{x:a.x-.5,y:a.y-.5,w:a.w+1,h:a.h+1})}static areaIntercept(n,a){const u=n.x>a.x?n.x:a.x,o=n.x+n.w<a.x+a.w?n.x+n.w:a.x+a.w;if(o<=u)return 0;const f=n.y>a.y?n.y:a.y,g=n.y+n.h<a.y+a.h?n.y+n.h:a.y+a.h;return g<=f?0:(o-u)*(g-f)}static area(n){return n.w*n.h}static sort(n,a=1){return n.sort((o,f)=>{const g=a*((o.y??1e4)-(f.y??1e4));return g===0?a*((o.x??1e4)-(f.x??1e4)):g})}static find(n,a){return a?n.find(u=>u.id===a):void 0}static toBool(n){return typeof n=="boolean"?n:typeof n=="string"?(n=n.toLowerCase(),!(n===""||n==="no"||n==="false"||n==="0")):!!n}static toNumber(n){return n===null||n.length===0?void 0:Number(n)}static parseHeight(n){let a,u="px";if(typeof n=="string")if(n==="auto"||n==="")a=0;else{const o=n.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!o)throw new Error(`Invalid height val = ${n}`);u=o[2]||"px",a=parseFloat(o[1])}else a=n;return{h:a,unit:u}}static defaults(n,...a){return a.forEach(u=>{for(const o in u){if(!u.hasOwnProperty(o))return;n[o]===null||n[o]===void 0?n[o]=u[o]:typeof u[o]=="object"&&typeof n[o]=="object"&&D.defaults(n[o],u[o])}}),n}static same(n,a){if(typeof n!="object")return n==a;if(typeof n!=typeof a||Object.keys(n).length!==Object.keys(a).length)return!1;for(const u in n)if(n[u]!==a[u])return!1;return!0}static copyPos(n,a,u=!1){return a.x!==void 0&&(n.x=a.x),a.y!==void 0&&(n.y=a.y),a.w!==void 0&&(n.w=a.w),a.h!==void 0&&(n.h=a.h),u&&(a.minW&&(n.minW=a.minW),a.minH&&(n.minH=a.minH),a.maxW&&(n.maxW=a.maxW),a.maxH&&(n.maxH=a.maxH)),n}static samePos(n,a){return n&&a&&n.x===a.x&&n.y===a.y&&(n.w||1)===(a.w||1)&&(n.h||1)===(a.h||1)}static sanitizeMinMax(n){n.minW||delete n.minW,n.minH||delete n.minH,n.maxW||delete n.maxW,n.maxH||delete n.maxH}static removeInternalAndSame(n,a){if(!(typeof n!="object"||typeof a!="object")&&!(Array.isArray(n)||Array.isArray(a)))for(let u in n){const o=n[u],f=a[u];u[0]==="_"||o===f?delete n[u]:o&&typeof o=="object"&&f!==void 0&&(D.removeInternalAndSame(o,f),Object.keys(o).length||delete n[u])}}static removeInternalForSave(n,a=!0){for(let u in n)(u[0]==="_"||n[u]===null||n[u]===void 0)&&delete n[u];delete n.grid,a&&delete n.el,n.autoPosition||delete n.autoPosition,n.noResize||delete n.noResize,n.noMove||delete n.noMove,n.locked||delete n.locked,(n.w===1||n.w===n.minW)&&delete n.w,(n.h===1||n.h===n.minH)&&delete n.h}static throttle(n,a){let u=!1;return(...o)=>{u||(u=!0,setTimeout(()=>{n(...o),u=!1},a))}}static removePositioningStyles(n){const a=n.style;a.position&&a.removeProperty("position"),a.left&&a.removeProperty("left"),a.top&&a.removeProperty("top"),a.width&&a.removeProperty("width"),a.height&&a.removeProperty("height")}static getScrollElement(n){if(!n)return document.scrollingElement||document.documentElement;const a=getComputedStyle(n);return/(auto|scroll)/.test(a.overflow+a.overflowY)?n:D.getScrollElement(n.parentElement)}static updateScrollPosition(n,a,u){const o=D.getScrollElement(n);if(!o)return;const f=n.getBoundingClientRect(),g=o.getBoundingClientRect(),m=window.innerHeight||document.documentElement.clientHeight,S=f.bottom-Math.min(g.bottom,m),y=f.top-Math.max(g.top,0),x=o.scrollTop;y<0&&u<0?n.offsetHeight>g.height?o.scrollTop+=u:o.scrollTop+=Math.abs(y)>Math.abs(u)?u:y:S>0&&u>0&&(n.offsetHeight>g.height?o.scrollTop+=u:o.scrollTop+=S>u?u:S),a.top+=o.scrollTop-x}static updateScrollResize(n,a,u){const o=D.getScrollElement(a),f=o.clientHeight,g=o===D.getScrollElement()?0:o.getBoundingClientRect().top,m=n.clientY-g,S=m<u,y=m>f-u;S?o.scrollBy({behavior:"smooth",top:m-u}):y&&o.scrollBy({behavior:"smooth",top:u-(f-m)})}static clone(n){return n==null||typeof n!="object"?n:n instanceof Array?[...n]:{...n}}static cloneDeep(n){const a=["parentGrid","el","grid","subGrid","engine"],u=D.clone(n);for(const o in u)u.hasOwnProperty(o)&&typeof u[o]=="object"&&o.substring(0,2)!=="__"&&!a.find(f=>f===o)&&(u[o]=D.cloneDeep(n[o]));return u}static cloneNode(n){const a=n.cloneNode(!0);return a.removeAttribute("id"),a}static appendTo(n,a){let u;typeof a=="string"?u=D.getElement(a):u=a,u&&u.appendChild(n)}static addElStyles(n,a){if(a instanceof Object)for(const u in a)a.hasOwnProperty(u)&&(Array.isArray(a[u])?a[u].forEach(o=>{n.style[u]=o}):n.style[u]=a[u])}static initEvent(n,a){const u={type:a.type},o={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:a.target?a.target:n.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(f=>u[f]=n[f]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(f=>u[f]=n[f]),{...u,...o}}static simulateMouseEvent(n,a,u){const o=n,f=new MouseEvent(a,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY,ctrlKey:o.ctrlKey??!1,altKey:o.altKey??!1,shiftKey:o.shiftKey??!1,metaKey:o.metaKey??!1,button:0,relatedTarget:n.target});(u||n.target).dispatchEvent(f)}static getValuesFromTransformedElement(n){const a=document.createElement("div");D.addElStyles(a,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),n.appendChild(a);const u=a.getBoundingClientRect();return n.removeChild(a),a.remove(),{xScale:1/u.width,yScale:1/u.height,xOffset:u.left,yOffset:u.top}}static swap(n,a,u){if(!n)return;const o=n[a];n[a]=n[u],n[u]=o}static canBeRotated(n){var a;return!(!n||n.w===n.h||n.locked||n.noResize||(a=n.grid)!=null&&a.opts.disableResize||n.minW&&n.minW===n.maxW||n.minH&&n.minH===n.maxH)}}class Ml{constructor(n={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=n.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=n.maxRow,this._float=n.float,this.nodes=n.nodes||[],this.onChange=n.onChange}batchUpdate(n=!0,a=!0){return!!this.batchMode===n?this:(this.batchMode=n,n?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,a&&this._packNodes(),this._notify()),this)}_useEntireRowArea(n,a){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!n._moving||n._skipDown||a.y<=n.y)}_fixCollisions(n,a=n,u,o={}){if(this.sortNodes(-1),u=u||this.collide(n,a),!u)return!1;if(n._moving&&!o.nested&&!this.float&&this.swap(n,u))return!0;let f=a;!this._loading&&this._useEntireRowArea(n,a)&&(f={x:0,w:this.column,y:a.y,h:a.h},u=this.collide(n,f,o.skip));let g=!1;const m={nested:!0,pack:!1};let S=0;for(;u=u||this.collide(n,f,o.skip);){if(S++>this.nodes.length*2)throw new Error("Infinite collide check");let y;if(u.locked||this._loading||n._moving&&!n._skipDown&&a.y>n.y&&!this.float&&(!this.collide(u,{...u,y:n.y},n)||!this.collide(u,{...u,y:a.y-u.h},n))){n._skipDown=n._skipDown||a.y>n.y;const x={...a,y:u.y+u.h,...m};y=this._loading&&D.samePos(n,x)?!0:this.moveNode(n,x),(u.locked||this._loading)&&y?D.copyPos(a,n):!u.locked&&y&&o.pack&&(this._packNodes(),a.y=u.y+u.h,D.copyPos(n,a)),g=g||y}else y=this.moveNode(u,{...u,y:a.y+a.h,skip:n,...m});if(!y)return g;u=void 0}return g}collide(n,a=n,u){const o=n._id,f=u==null?void 0:u._id;return this.nodes.find(g=>g._id!==o&&g._id!==f&&D.isIntercepted(g,a))}collideAll(n,a=n,u){const o=n._id,f=u==null?void 0:u._id;return this.nodes.filter(g=>g._id!==o&&g._id!==f&&D.isIntercepted(g,a))}directionCollideCoverage(n,a,u){if(!a.rect||!n._rect)return;const o=n._rect,f={...a.rect};f.y>o.y?(f.h+=f.y-o.y,f.y=o.y):f.h+=o.y-f.y,f.x>o.x?(f.w+=f.x-o.x,f.x=o.x):f.w+=o.x-f.x;let g,m=.5;for(let S of u){if(S.locked||!S._rect)break;const y=S._rect;let x=Number.MAX_VALUE,v=Number.MAX_VALUE;o.y<y.y?x=(f.y+f.h-y.y)/y.h:o.y+o.h>y.y+y.h&&(x=(y.y+y.h-f.y)/y.h),o.x<y.x?v=(f.x+f.w-y.x)/y.w:o.x+o.w>y.x+y.w&&(v=(y.x+y.w-f.x)/y.w);const C=Math.min(v,x);C>m&&(m=C,g=S)}return a.collide=g,g}cacheRects(n,a,u,o,f,g){return this.nodes.forEach(m=>m._rect={y:m.y*a+u,x:m.x*n+g,w:m.w*n-g-o,h:m.h*a-u-f}),this}swap(n,a){if(!a||a.locked||!n||n.locked)return!1;function u(){const f=a.x,g=a.y;return a.x=n.x,a.y=n.y,n.h!=a.h?(n.x=f,n.y=a.y+a.h):n.w!=a.w?(n.x=a.x+a.w,n.y=g):(n.x=f,n.y=g),n._dirty=a._dirty=!0,!0}let o;if(n.w===a.w&&n.h===a.h&&(n.x===a.x||n.y===a.y)&&(o=D.isTouching(n,a)))return u();if(o!==!1){if(n.w===a.w&&n.x===a.x&&(o||(o=D.isTouching(n,a)))){if(a.y<n.y){const f=n;n=a,a=f}return u()}if(o!==!1){if(n.h===a.h&&n.y===a.y&&(o||(o=D.isTouching(n,a)))){if(a.x<n.x){const f=n;n=a,a=f}return u()}return!1}}}isAreaEmpty(n,a,u,o){const f={x:n||0,y:a||0,w:u||1,h:o||1};return!this.collide(f)}compact(n="compact",a=!0){if(this.nodes.length===0)return this;a&&this.sortNodes();const u=this.batchMode;u||this.batchUpdate();const o=this._inColumnResize;o||(this._inColumnResize=!0);const f=this.nodes;return this.nodes=[],f.forEach((g,m,S)=>{let y;g.locked||(g.autoPosition=!0,n==="list"&&m&&(y=S[m-1])),this.addNode(g,!1,y)}),o||delete this._inColumnResize,u||this.batchUpdate(!1),this}set float(n){this._float!==n&&(this._float=n||!1,n||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(n=1){return this.nodes=D.sort(this.nodes,n),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(n=>{if(n._updating||n._orig===void 0||n.y===n._orig.y)return;let a=n.y;for(;a>n._orig.y;)--a,this.collide(n,{x:n.x,y:a,w:n.w,h:n.h})||(n._dirty=!0,n.y=a)}):this.nodes.forEach((n,a)=>{if(!n.locked)for(;n.y>0;){const u=a===0?0:n.y-1;if(!(a===0||!this.collide(n,{x:n.x,y:u,w:n.w,h:n.h})))break;n._dirty=n.y!==u,n.y=u}}),this)}prepareNode(n,a){n._id=n._id??Ml._idSeq++;const u=n.id;if(u){let f=1;for(;this.nodes.find(g=>g.id===n.id&&g!==n);)n.id=u+"_"+f++}(n.x===void 0||n.y===void 0||n.x===null||n.y===null)&&(n.autoPosition=!0);const o={x:0,y:0,w:1,h:1};return D.defaults(n,o),n.autoPosition||delete n.autoPosition,n.noResize||delete n.noResize,n.noMove||delete n.noMove,D.sanitizeMinMax(n),typeof n.x=="string"&&(n.x=Number(n.x)),typeof n.y=="string"&&(n.y=Number(n.y)),typeof n.w=="string"&&(n.w=Number(n.w)),typeof n.h=="string"&&(n.h=Number(n.h)),isNaN(n.x)&&(n.x=o.x,n.autoPosition=!0),isNaN(n.y)&&(n.y=o.y,n.autoPosition=!0),isNaN(n.w)&&(n.w=o.w),isNaN(n.h)&&(n.h=o.h),this.nodeBoundFix(n,a),n}nodeBoundFix(n,a){const u=n._orig||D.copyPos({},n);if(n.maxW&&(n.w=Math.min(n.w||1,n.maxW)),n.maxH&&(n.h=Math.min(n.h||1,n.maxH)),n.minW&&(n.w=Math.max(n.w||1,n.minW)),n.minH&&(n.h=Math.max(n.h||1,n.minH)),(n.x||0)+(n.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&n._id!=null&&this.findCacheLayout(n,this.defaultColumn)===-1){const f={...n};f.autoPosition||f.x===void 0?(delete f.x,delete f.y):f.x=Math.min(this.defaultColumn-1,f.x),f.w=Math.min(this.defaultColumn,f.w||1),this.cacheOneLayout(f,this.defaultColumn)}return n.w>this.column?n.w=this.column:n.w<1&&(n.w=1),this.maxRow&&n.h>this.maxRow?n.h=this.maxRow:n.h<1&&(n.h=1),n.x<0&&(n.x=0),n.y<0&&(n.y=0),n.x+n.w>this.column&&(a?n.w=this.column-n.x:n.x=this.column-n.w),this.maxRow&&n.y+n.h>this.maxRow&&(a?n.h=this.maxRow-n.y:n.y=this.maxRow-n.h),D.samePos(n,u)||(n._dirty=!0),this}getDirtyNodes(n){return n?this.nodes.filter(a=>a._dirty&&!D.samePos(a,a._orig)):this.nodes.filter(a=>a._dirty)}_notify(n){if(this.batchMode||!this.onChange)return this;const a=(n||[]).concat(this.getDirtyNodes());return this.onChange(a),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(n=>{delete n._dirty,delete n._lastTried}),this)}saveInitial(){return this.nodes.forEach(n=>{n._orig=D.copyPos({},n),delete n._dirty}),this._hasLocked=this.nodes.some(n=>n.locked),this}restoreInitial(){return this.nodes.forEach(n=>{!n._orig||D.samePos(n,n._orig)||(D.copyPos(n,n._orig),n._dirty=!0)}),this._notify(),this}findEmptyPosition(n,a=this.nodes,u=this.column,o){const f=o?o.y*u+(o.x+o.w):0;let g=!1;for(let m=f;!g;++m){const S=m%u,y=Math.floor(m/u);if(S+n.w>u)continue;const x={x:S,y,w:n.w,h:n.h};a.find(v=>D.isIntercepted(x,v))||((n.x!==S||n.y!==y)&&(n._dirty=!0),n.x=S,n.y=y,delete n.autoPosition,g=!0)}return g}addNode(n,a=!1,u){const o=this.nodes.find(g=>g._id===n._id);if(o)return o;this._inColumnResize?this.nodeBoundFix(n):this.prepareNode(n),delete n._temporaryRemoved,delete n._removeDOM;let f;return n.autoPosition&&this.findEmptyPosition(n,this.nodes,this.column,u)&&(delete n.autoPosition,f=!0),this.nodes.push(n),a&&this.addedNodes.push(n),f||this._fixCollisions(n),this.batchMode||this._packNodes()._notify(),n}removeNode(n,a=!0,u=!1){return this.nodes.find(o=>o._id===n._id)?(u&&this.removedNodes.push(n),a&&(n._removeDOM=!0),this.nodes=this.nodes.filter(o=>o._id!==n._id),n._isAboutToRemove||this._packNodes(),this._notify([n]),this):this}removeAll(n=!0,a=!0){if(delete this._layouts,!this.nodes.length)return this;n&&this.nodes.forEach(o=>o._removeDOM=!0);const u=this.nodes;return this.removedNodes=a?u:[],this.nodes=[],this._notify(u)}moveNodeCheck(n,a){if(!this.changedPosConstrain(n,a))return!1;if(a.pack=!0,!this.maxRow)return this.moveNode(n,a);let u;const o=new Ml({column:this.column,float:this.float,nodes:this.nodes.map(g=>g._id===n._id?(u={...g},u):{...g})});if(!u)return!1;const f=o.moveNode(u,a)&&o.getRow()<=Math.max(this.getRow(),this.maxRow);if(!f&&!a.resizing&&a.collide){const g=a.collide.el.gridstackNode;if(this.swap(n,g))return this._notify(),!0}return f?(o.nodes.filter(g=>g._dirty).forEach(g=>{const m=this.nodes.find(S=>S._id===g._id);m&&(D.copyPos(m,g),m._dirty=!0)}),this._notify(),!0):!1}willItFit(n){if(delete n._willFitPos,!this.maxRow)return!0;const a=new Ml({column:this.column,float:this.float,nodes:this.nodes.map(o=>({...o}))}),u={...n};return this.cleanupNode(u),delete u.el,delete u._id,delete u.content,delete u.grid,a.addNode(u),a.getRow()<=this.maxRow?(n._willFitPos=D.copyPos({},u),!0):!1}changedPosConstrain(n,a){return a.w=a.w||n.w,a.h=a.h||n.h,n.x!==a.x||n.y!==a.y?!0:(n.maxW&&(a.w=Math.min(a.w,n.maxW)),n.maxH&&(a.h=Math.min(a.h,n.maxH)),n.minW&&(a.w=Math.max(a.w,n.minW)),n.minH&&(a.h=Math.max(a.h,n.minH)),n.w!==a.w||n.h!==a.h)}moveNode(n,a){var y,x;if(!n||!a)return!1;let u;a.pack===void 0&&!this.batchMode&&(u=a.pack=!0),typeof a.x!="number"&&(a.x=n.x),typeof a.y!="number"&&(a.y=n.y),typeof a.w!="number"&&(a.w=n.w),typeof a.h!="number"&&(a.h=n.h);const o=n.w!==a.w||n.h!==a.h,f=D.copyPos({},n,!0);if(D.copyPos(f,a),this.nodeBoundFix(f,o),D.copyPos(a,f),!a.forceCollide&&D.samePos(n,a))return!1;const g=D.copyPos({},n),m=this.collideAll(n,f,a.skip);let S=!0;if(m.length){const v=n._moving&&!a.nested;let C=v?this.directionCollideCoverage(n,a,m):m[0];if(v&&C&&((x=(y=n.grid)==null?void 0:y.opts)!=null&&x.subGridDynamic)&&!n.grid._isTemp){const Z=D.areaIntercept(a.rect,C._rect),$=D.area(a.rect),J=D.area(C._rect);Z/($<J?$:J)>.8&&(C.grid.makeSubGrid(C.el,void 0,n),C=void 0)}C?S=!this._fixCollisions(n,f,C,a):(S=!1,u&&delete a.pack)}return S&&!D.samePos(n,f)&&(n._dirty=!0,D.copyPos(n,f)),a.pack&&this._packNodes()._notify(),!D.samePos(n,g)}getRow(){return this.nodes.reduce((n,a)=>Math.max(n,a.y+a.h),0)}beginUpdate(n){return n._updating||(n._updating=!0,delete n._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const n=this.nodes.find(a=>a._updating);return n&&(delete n._updating,delete n._skipDown),this}save(n=!0,a,u){var m;const o=((m=this._layouts)==null?void 0:m.length)||0;let f;o&&(u?u!==this.column&&(f=this._layouts[u]):this.column!==o-1&&(f=this._layouts[o-1]));const g=[];return this.sortNodes(),this.nodes.forEach(S=>{const y=f==null?void 0:f.find(v=>v._id===S._id),x={...S,...y||{}};D.removeInternalForSave(x,!n),a&&a(S,x),g.push(x)}),g}layoutsNodesChange(n){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((a,u)=>{if(!a||u===this.column)return this;if(u<this.column)this._layouts[u]=void 0;else{const o=u/this.column;n.forEach(f=>{if(!f._orig)return;const g=a.find(m=>m._id===f._id);g&&(g.y>=0&&f.y!==f._orig.y&&(g.y+=f.y-f._orig.y,g.y<0&&(g.y=0)),f.x!==f._orig.x&&(g.x=Math.round(f.x*o),g.x<0&&(g.x=0)),f.w!==f._orig.w&&(g.w=Math.round(f.w*o),g.w<1&&(g.w=1)))})}}),this)}columnChanged(n,a,u="moveScale"){var m;if(!this.nodes.length||!a||n===a)return this;const o=u==="compact"||u==="list";o&&this.sortNodes(1),a<n&&this.cacheLayout(this.nodes,n),this.batchUpdate();let f=[],g=o?this.nodes:D.sort(this.nodes,-1);if(a>n&&this._layouts){const S=this._layouts[a]||[],y=this._layouts.length-1;!S.length&&n!==y&&((m=this._layouts[y])!=null&&m.length)&&(n=y,this._layouts[y].forEach(x=>{const v=g.find(C=>C._id===x._id);v&&(!o&&!x.autoPosition&&(v.x=x.x??v.x,v.y=x.y??v.y),v.w=x.w??v.w,(x.x==null||x.y===void 0)&&(v.autoPosition=!0))})),S.forEach(x=>{const v=g.findIndex(C=>C._id===x._id);if(v!==-1){const C=g[v];if(o){C.w=x.w;return}(x.autoPosition||isNaN(x.x)||isNaN(x.y))&&this.findEmptyPosition(x,f),x.autoPosition||(C.x=x.x??C.x,C.y=x.y??C.y,C.w=x.w??C.w,f.push(C)),g.splice(v,1)}})}if(o)this.compact(u,!1);else{if(g.length)if(typeof u=="function")u(a,n,f,g);else{const S=o||u==="none"?1:a/n,y=u==="move"||u==="moveScale",x=u==="scale"||u==="moveScale";g.forEach(v=>{v.x=a===1?0:y?Math.round(v.x*S):Math.min(v.x,a-1),v.w=a===1||n===1?1:x?Math.round(v.w*S)||1:Math.min(v.w,a),f.push(v)}),g=[]}f=D.sort(f,-1),this._inColumnResize=!0,this.nodes=[],f.forEach(S=>{this.addNode(S,!1),delete S._orig})}return this.nodes.forEach(S=>delete S._orig),this.batchUpdate(!1,!o),delete this._inColumnResize,this}cacheLayout(n,a,u=!1){const o=[];return n.forEach((f,g)=>{if(f._id===void 0){const m=f.id?this.nodes.find(S=>S.id===f.id):void 0;f._id=(m==null?void 0:m._id)??Ml._idSeq++}o[g]={x:f.x,y:f.y,w:f.w,_id:f._id}}),this._layouts=u?[]:this._layouts||[],this._layouts[a]=o,this}cacheOneLayout(n,a){n._id=n._id??Ml._idSeq++;const u={x:n.x,y:n.y,w:n.w,_id:n._id};(n.autoPosition||n.x===void 0)&&(delete u.x,delete u.y,n.autoPosition&&(u.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[a]=this._layouts[a]||[];const o=this.findCacheLayout(n,a);return o===-1?this._layouts[a].push(u):this._layouts[a][o]=u,this}findCacheLayout(n,a){var u,o;return((o=(u=this._layouts)==null?void 0:u[a])==null?void 0:o.findIndex(f=>f._id===n._id))??-1}removeNodeFromLayoutCache(n){if(this._layouts)for(let a=0;a<this._layouts.length;a++){const u=this.findCacheLayout(n,a);u!==-1&&this._layouts[a].splice(u,1)}}cleanupNode(n){for(const a in n)a[0]==="_"&&a!=="_id"&&delete n[a];return this}}Ml._idSeq=0;const De={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"};class ht{}const Fe=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);class Oe{}function Bs(d,n){d.touches.length>1||(d.cancelable&&d.preventDefault(),D.simulateMouseEvent(d.changedTouches[0],n))}function Hh(d,n){d.cancelable&&d.preventDefault(),D.simulateMouseEvent(d,n)}function ks(d){Oe.touchHandled||(Oe.touchHandled=!0,Bs(d,"mousedown"))}function Gs(d){Oe.touchHandled&&Bs(d,"mousemove")}function qs(d){if(!Oe.touchHandled)return;Oe.pointerLeaveTimeout&&(window.clearTimeout(Oe.pointerLeaveTimeout),delete Oe.pointerLeaveTimeout);const n=!!ht.dragElement;Bs(d,"mouseup"),n||Bs(d,"click"),Oe.touchHandled=!1}function Ys(d){d.pointerType!=="mouse"&&d.target.releasePointerCapture(d.pointerId)}function wh(d){ht.dragElement&&d.pointerType!=="mouse"&&Hh(d,"mouseenter")}function Mh(d){ht.dragElement&&d.pointerType!=="mouse"&&(Oe.pointerLeaveTimeout=window.setTimeout(()=>{delete Oe.pointerLeaveTimeout,Hh(d,"mouseleave")},10))}class Qs{constructor(n,a,u){this.host=n,this.dir=a,this.option=u,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){if(this.option.element)try{this.el=this.option.element instanceof HTMLElement?this.option.element:this.host.querySelector(this.option.element)}catch(n){this.option.element=void 0,console.error("Query for resizeable handle failed, falling back",n)}return this.el||(this.el=document.createElement("div"),this.host.appendChild(this.el)),this.el.classList.add("ui-resizable-handle"),this.el.classList.add(`${Qs.prefix}${this.dir}`),this.el.style.zIndex="100",this.el.style.userSelect="none",this.el.addEventListener("mousedown",this._mouseDown),Fe&&(this.el.addEventListener("touchstart",ks),this.el.addEventListener("pointerdown",Ys)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),Fe&&(this.el.removeEventListener("touchstart",ks),this.el.removeEventListener("pointerdown",Ys)),this.option.element||this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(n){this.mouseDownEvent=n,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Fe&&(this.el.addEventListener("touchmove",Gs),this.el.addEventListener("touchend",qs)),n.stopPropagation(),n.preventDefault()}_mouseMove(n){const a=this.mouseDownEvent;this.moving?this._triggerEvent("move",n):Math.abs(n.x-a.x)+Math.abs(n.y-a.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",n),document.addEventListener("keydown",this._keyEvent)),n.stopPropagation()}_mouseUp(n){this.moving&&(this._triggerEvent("stop",n),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Fe&&(this.el.removeEventListener("touchmove",Gs),this.el.removeEventListener("touchend",qs)),delete this.moving,delete this.mouseDownEvent,n.stopPropagation(),n.preventDefault()}_keyEvent(n){var a,u;n.key==="Escape"&&((u=(a=this.host.gridstackNode)==null?void 0:a.grid)==null||u.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(n,a){return this.option[n]&&this.option[n](a),this}}Qs.prefix="ui-resizable-";class bo{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(n,a){this._eventRegister[n]=a}off(n){delete this._eventRegister[n]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(n,a){if(!this.disabled&&this._eventRegister&&this._eventRegister[n])return this._eventRegister[n](a)}}class da extends bo{constructor(n,a={}){super(),this.el=n,this.option=a,this.rectScale={x:1,y:1},this._ui=()=>{const o=this.el.parentElement.getBoundingClientRect(),f={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},g=this.temporalRect||f;return{position:{left:(g.left-o.left)*this.rectScale.x,top:(g.top-o.top)*this.rectScale.y},size:{width:g.width*this.rectScale.x,height:g.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(n,a){super.on(n,a)}off(n){super.off(n)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(n){const a=n.handles&&n.handles!==this.option.handles,u=n.autoHide&&n.autoHide!==this.option.autoHide;return Object.keys(n).forEach(o=>this.option[o]=n[o]),a&&(this._removeHandlers(),this._setupHandlers()),u&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(n){return n?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),ht.overResizeElement===this&&delete ht.overResizeElement),this}_mouseOver(n){ht.overResizeElement||ht.dragElement||(ht.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(n){ht.overResizeElement===this&&(delete ht.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(n=>n.trim()).map(n=>new Qs(this.el,n,{element:this.option.element,start:a=>this._resizeStart(a),stop:a=>this._resizeStop(a),move:a=>this._resizing(a,n)})),this}_resizeStart(n){this.sizeToContent=D.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=D.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=n,this._setupHelper(),this._applyChange();const a=D.initEvent(n,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(a,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",a),this}_resizing(n,a){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(n,a),this._applyChange();const u=D.initEvent(n,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(u,this._ui()),this.triggerEvent("resize",u),this}_resizeStop(n){const a=D.initEvent(n,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(a),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",a),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=da._originStyleProp.map(u=>this.el.style[u]),this.parentOriginStylePosition=this.el.parentElement.style.position;const n=this.el.parentElement,a=D.getValuesFromTransformedElement(n);return this.rectScale={x:a.xScale,y:a.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return da._originStyleProp.forEach((n,a)=>{this.el.style[n]=this.elOriginStyleVal[a]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(n,a){const u=this.startEvent,o={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},f=n.clientX-u.clientX,g=this.sizeToContent?0:n.clientY-u.clientY;let m,S;a.indexOf("e")>-1?o.width+=f:a.indexOf("w")>-1&&(o.width-=f,o.left+=f,m=!0),a.indexOf("s")>-1?o.height+=g:a.indexOf("n")>-1&&(o.height-=g,o.top+=g,S=!0);const y=this._constrainSize(o.width,o.height,m,S);return Math.round(o.width)!==Math.round(y.width)&&(a.indexOf("w")>-1&&(o.left+=o.width-y.width),o.width=y.width),Math.round(o.height)!==Math.round(y.height)&&(a.indexOf("n")>-1&&(o.top+=o.height-y.height),o.height=y.height),o}_constrainSize(n,a,u,o){const f=this.option,g=(u?f.maxWidthMoveLeft:f.maxWidth)||Number.MAX_SAFE_INTEGER,m=f.minWidth/this.rectScale.x||n,S=(o?f.maxHeightMoveUp:f.maxHeight)||Number.MAX_SAFE_INTEGER,y=f.minHeight/this.rectScale.y||a,x=Math.min(g,Math.max(m,n)),v=Math.min(S,Math.max(y,a));return{width:x,height:v}}_applyChange(){let n={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const a=this.el.parentElement,{left:u,top:o}=a.getBoundingClientRect();n={left:u,top:o,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(a=>{const u=this.temporalRect[a],o=a==="width"||a==="left"?this.rectScale.x:a==="height"||a==="top"?this.rectScale.y:1;this.el.style[a]=(u-n[a])*o+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(n=>n.destroy()),delete this.handlers,this}}da._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const jp='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class ha extends bo{constructor(n,a={}){var f;super(),this.el=n,this.option=a,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const u=(f=a==null?void 0:a.handle)==null?void 0:f.substring(1),o=n.gridstackNode;this.dragEls=!u||n.classList.contains(u)?[n]:o!=null&&o.subGrid?[n.querySelector(a.handle)||n]:Array.from(n.querySelectorAll(a.handle)),this.dragEls.length===0&&(this.dragEls=[n]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(n,a){super.on(n,a)}off(n){super.off(n)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(n=>{n.addEventListener("mousedown",this._mouseDown),Fe&&(n.addEventListener("touchstart",ks),n.addEventListener("pointerdown",Ys))}),this.el.classList.remove("ui-draggable-disabled"))}disable(n=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(a=>{a.removeEventListener("mousedown",this._mouseDown),Fe&&(a.removeEventListener("touchstart",ks),a.removeEventListener("pointerdown",Ys))}),n||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(n){return Object.keys(n).forEach(a=>this.option[a]=n[a]),this}_mouseDown(n){if(Oe.touchHandled&&n.isTrusted&&(Oe.touchHandled=!1),!ht.mouseHandled)return n.button!==0||!this.dragEls.find(a=>a===n.target)&&n.target.closest(jp)||this.option.cancel&&n.target.closest(this.option.cancel)||(this.mouseDownEvent=n,delete this.dragging,delete ht.dragElement,delete ht.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Fe&&(n.currentTarget.addEventListener("touchmove",Gs),n.currentTarget.addEventListener("touchend",qs)),n.preventDefault(),document.activeElement&&document.activeElement.blur(),ht.mouseHandled=!0),!0}_callDrag(n){if(!this.dragging)return;const a=D.initEvent(n,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(a,this.ui()),this.triggerEvent("drag",a)}_mouseMove(n){var u;const a=this.mouseDownEvent;if(this.lastDrag=n,this.dragging)if(this._dragFollow(n),ht.pauseDrag){const o=Number.isInteger(ht.pauseDrag)?ht.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(n),o)}else this._callDrag(n);else if(Math.abs(n.x-a.x)+Math.abs(n.y-a.y)>3){this.dragging=!0,ht.dragElement=this;const o=(u=this.el.gridstackNode)==null?void 0:u.grid;o?ht.dropElement=o.el.ddElement.ddDroppable:delete ht.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=D.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(n,this.el,this.helperContainment),this._setupHelperStyle(n);const f=D.initEvent(n,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(f,this.ui()),this.triggerEvent("dragstart",f),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(n){var a,u;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Fe&&n.currentTarget&&(n.currentTarget.removeEventListener("touchmove",Gs,!0),n.currentTarget.removeEventListener("touchend",qs,!0)),this.dragging){delete this.dragging,(a=this.el.gridstackNode)==null||delete a._origRotate,document.removeEventListener("keydown",this._keyEvent),((u=ht.dropElement)==null?void 0:u.el)===this.el.parentElement&&delete ht.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const o=D.initEvent(n,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(o),this.triggerEvent("dragstop",o),ht.dropElement&&ht.dropElement.drop(n)}delete this.helper,delete this.mouseDownEvent,delete ht.dragElement,delete ht.dropElement,delete ht.mouseHandled,n.preventDefault()}_keyEvent(n){var o,f;const a=this.el.gridstackNode,u=(a==null?void 0:a.grid)||((f=(o=ht.dropElement)==null?void 0:o.el)==null?void 0:f.gridstack);if(n.key==="Escape")a&&a._origRotate&&(a._orig=a._origRotate,delete a._origRotate),u==null||u.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(a&&u&&(n.key==="r"||n.key==="R")){if(!D.canBeRotated(a))return;a._origRotate=a._origRotate||{...a._orig},delete a._moving,u.setAnimation(!1).rotate(a.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),a._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,a.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",D.swap(a._orig,"w","h"),delete a._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let n=this.el;return typeof this.option.helper=="function"?n=this.option.helper(this.el):this.option.helper==="clone"&&(n=D.cloneNode(this.el)),n.parentElement||D.appendTo(n,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=ha.originStyleProp.map(a=>this.el.style[a]),n}_setupHelperStyle(n){var u,o;this.helper.classList.add("ui-draggable-dragging"),(o=(u=this.el.gridstackNode)==null?void 0:u.grid)==null||o.el.classList.add("grid-stack-dragging");const a=this.helper.style;return a.pointerEvents="none",a.width=this.dragOffset.width+"px",a.height=this.dragOffset.height+"px",a.willChange="left, top",a.position="fixed",this._dragFollow(n),a.transition="none",setTimeout(()=>{this.helper&&(a.transition=null)},0),this}_removeHelperStyle(){var a,u,o;this.helper.classList.remove("ui-draggable-dragging"),(u=(a=this.el.gridstackNode)==null?void 0:a.grid)==null||u.el.classList.remove("grid-stack-dragging");const n=(o=this.helper)==null?void 0:o.gridstackNode;if(!(n!=null&&n._isAboutToRemove)&&this.dragElementOriginStyle){const f=this.helper,g=this.dragElementOriginStyle.transition||null;f.style.transition=this.dragElementOriginStyle.transition="none",ha.originStyleProp.forEach(m=>f.style[m]=this.dragElementOriginStyle[m]||null),setTimeout(()=>f.style.transition=g,50)}return delete this.dragElementOriginStyle,this}_dragFollow(n){const a={left:0,top:0},u=this.helper.style,o=this.dragOffset;u.left=(n.clientX+o.offsetLeft-a.left)*this.dragTransform.xScale+"px",u.top=(n.clientY+o.offsetTop-a.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(n,a,u){let o=0,f=0;u&&(o=this.dragTransform.xOffset,f=this.dragTransform.yOffset);const g=a.getBoundingClientRect();return{left:g.left,top:g.top,offsetLeft:-n.clientX+g.left-o,offsetTop:-n.clientY+g.top-f,width:g.width*this.dragTransform.xScale,height:g.height*this.dragTransform.yScale}}ui(){const a=this.el.parentElement.getBoundingClientRect(),u=this.helper.getBoundingClientRect();return{position:{top:(u.top-a.top)*this.dragTransform.yScale,left:(u.left-a.left)*this.dragTransform.xScale}}}}ha.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];class Dp extends bo{constructor(n,a={}){super(),this.el=n,this.option=a,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(n,a){super.on(n,a)}off(n){super.off(n)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),Fe&&(this.el.addEventListener("pointerenter",wh),this.el.addEventListener("pointerleave",Mh)))}disable(n=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),n||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),Fe&&(this.el.removeEventListener("pointerenter",wh),this.el.removeEventListener("pointerleave",Mh)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(n){return Object.keys(n).forEach(a=>this.option[a]=n[a]),this._setupAccept(),this}_mouseEnter(n){if(!ht.dragElement||Oe.touchHandled&&n.isTrusted||!this._canDrop(ht.dragElement.el))return;n.preventDefault(),n.stopPropagation(),ht.dropElement&&ht.dropElement!==this&&ht.dropElement._mouseLeave(n,!0),ht.dropElement=this;const a=D.initEvent(n,{target:this.el,type:"dropover"});this.option.over&&this.option.over(a,this._ui(ht.dragElement)),this.triggerEvent("dropover",a),this.el.classList.add("ui-droppable-over")}_mouseLeave(n,a=!1){var o;if(!ht.dragElement||ht.dropElement!==this)return;n.preventDefault(),n.stopPropagation();const u=D.initEvent(n,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(u,this._ui(ht.dragElement)),this.triggerEvent("dropout",u),ht.dropElement===this&&(delete ht.dropElement,!a)){let f,g=this.el.parentElement;for(;!f&&g;)f=(o=g.ddElement)==null?void 0:o.ddDroppable,g=g.parentElement;f&&f._mouseEnter(n)}}drop(n){n.preventDefault();const a=D.initEvent(n,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(a,this._ui(ht.dragElement)),this.triggerEvent("drop",a)}_canDrop(n){return n&&(!this.accept||this.accept(n))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=n=>n.classList.contains(this.option.accept)||n.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(n){return{draggable:n.el,...n.ui()}}}class So{static init(n){return n.ddElement||(n.ddElement=new So(n)),n.ddElement}constructor(n){this.el=n}on(n,a){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(n)>-1?this.ddDraggable.on(n,a):this.ddDroppable&&["drop","dropover","dropout"].indexOf(n)>-1?this.ddDroppable.on(n,a):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(n)>-1&&this.ddResizable.on(n,a),this}off(n){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(n)>-1?this.ddDraggable.off(n):this.ddDroppable&&["drop","dropover","dropout"].indexOf(n)>-1?this.ddDroppable.off(n):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(n)>-1&&this.ddResizable.off(n),this}setupDraggable(n){return this.ddDraggable?this.ddDraggable.updateOption(n):this.ddDraggable=new ha(this.el,n),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(n){return this.ddResizable?this.ddResizable.updateOption(n):this.ddResizable=new da(this.el,n),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(n){return this.ddDroppable?this.ddDroppable.updateOption(n):this.ddDroppable=new Dp(this.el,n),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class Op{resizable(n,a,u,o){return this._getDDElements(n,a).forEach(f=>{if(a==="disable"||a==="enable")f.ddResizable&&f.ddResizable[a]();else if(a==="destroy")f.ddResizable&&f.cleanResizable();else if(a==="option")f.setupResizable({[u]:o});else{const m=f.el.gridstackNode.grid;let S=f.el.getAttribute("gs-resize-handles")||m.opts.resizable.handles||"e,s,se";S==="all"&&(S="n,e,s,w,se,sw,ne,nw");const y=!m.opts.alwaysShowResizeHandle;f.setupResizable({...m.opts.resizable,handles:S,autoHide:y,start:a.start,stop:a.stop,resize:a.resize})}}),this}draggable(n,a,u,o){return this._getDDElements(n,a).forEach(f=>{if(a==="disable"||a==="enable")f.ddDraggable&&f.ddDraggable[a]();else if(a==="destroy")f.ddDraggable&&f.cleanDraggable();else if(a==="option")f.setupDraggable({[u]:o});else{const g=f.el.gridstackNode.grid;f.setupDraggable({...g.opts.draggable,start:a.start,stop:a.stop,drag:a.drag})}}),this}dragIn(n,a){return this._getDDElements(n).forEach(u=>u.setupDraggable(a)),this}droppable(n,a,u,o){return typeof a.accept=="function"&&!a._accept&&(a._accept=a.accept,a.accept=f=>a._accept(f)),this._getDDElements(n,a).forEach(f=>{a==="disable"||a==="enable"?f.ddDroppable&&f.ddDroppable[a]():a==="destroy"?f.ddDroppable&&f.cleanDroppable():a==="option"?f.setupDroppable({[u]:o}):f.setupDroppable(a)}),this}isDroppable(n){var a;return!!((a=n==null?void 0:n.ddElement)!=null&&a.ddDroppable&&!n.ddElement.ddDroppable.disabled)}isDraggable(n){var a;return!!((a=n==null?void 0:n.ddElement)!=null&&a.ddDraggable&&!n.ddElement.ddDraggable.disabled)}isResizable(n){var a;return!!((a=n==null?void 0:n.ddElement)!=null&&a.ddResizable&&!n.ddElement.ddResizable.disabled)}on(n,a,u){return this._getDDElements(n).forEach(o=>o.on(a,f=>{u(f,ht.dragElement?ht.dragElement.el:f.target,ht.dragElement?ht.dragElement.helper:null)})),this}off(n,a){return this._getDDElements(n).forEach(u=>u.off(a)),this}_getDDElements(n,a){const u=n.gridstack||a!=="destroy"&&a!=="disable",o=D.getElements(n);return o.length?o.map(g=>g.ddElement||(u?So.init(g):null)).filter(g=>g):[]}}/*!
 * GridStack 12.4.2
 * https://gridstackjs.com/
 *
 * Copyright (c) 2021-2025  Alain Dumesny
 * see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
 */const ye=new Op;class ut{static init(n={},a=".grid-stack"){if(typeof document>"u")return null;const u=ut.getGridElement(a);return u?(u.gridstack||(u.gridstack=new ut(u,D.cloneDeep(n))),u.gridstack):(console.error(typeof a=="string"?'GridStack.initAll() no grid was found with selector "'+a+`" - element missing or wrong selector ?
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(n={},a=".grid-stack"){const u=[];return typeof document>"u"||(ut.getGridElements(a).forEach(o=>{o.gridstack||(o.gridstack=new ut(o,D.cloneDeep(n))),u.push(o.gridstack)}),u.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+a+`" - element missing or wrong selector ?
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),u}static addGrid(n,a={}){if(!n)return null;let u=n;if(u.gridstack){const g=u.gridstack;return a&&(g.opts={...g.opts,...a}),a.children!==void 0&&g.load(a.children),g}return(!n.classList.contains("grid-stack")||ut.addRemoveCB)&&(ut.addRemoveCB?u=ut.addRemoveCB(n,a,!0,!0):u=D.createDiv(["grid-stack",a.class],n)),ut.init(a,u)}static registerEngine(n){ut.engineClass=n}get placeholder(){if(!this._placeholder){this._placeholder=D.createDiv([this.opts.placeholderClass,De.itemClass,this.opts.itemClass]);const n=D.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(n.textContent=this.opts.placeholderText)}return this._placeholder}constructor(n,a={}){var y;this.el=n,this.opts=a,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},n.gridstack=this,this.opts=a=a||{},n.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),a.row&&(a.minRow=a.maxRow=a.row,delete a.row);const u=D.toNumber(n.getAttribute("gs-row"));a.column==="auto"&&delete a.column,a.alwaysShowResizeHandle!==void 0&&(a._alwaysShowResizeHandle=a.alwaysShowResizeHandle);const o=a.columnOpts;if(o){const x=o.breakpoints;!o.columnWidth&&!(x!=null&&x.length)?delete a.columnOpts:(o.columnMax=o.columnMax||12,(x==null?void 0:x.length)>1&&x.sort((v,C)=>(C.w||0)-(v.w||0)))}const f={...D.cloneDeep(De),column:D.toNumber(n.getAttribute("gs-column"))||De.column,minRow:u||D.toNumber(n.getAttribute("gs-min-row"))||De.minRow,maxRow:u||D.toNumber(n.getAttribute("gs-max-row"))||De.maxRow,staticGrid:D.toBool(n.getAttribute("gs-static"))||De.staticGrid,sizeToContent:D.toBool(n.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(a.handleClass?"."+a.handleClass:a.handle?a.handle:"")||De.draggable.handle},removableOptions:{accept:a.itemClass||De.removableOptions.accept,decline:De.removableOptions.decline}};n.getAttribute("gs-animate")&&(f.animate=D.toBool(n.getAttribute("gs-animate"))),a=D.defaults(a,f),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(a),a.rtl==="auto"&&(a.rtl=n.style.direction==="rtl"),a.rtl&&this.el.classList.add("grid-stack-rtl");const g=this.el.closest("."+De.itemClass),m=g==null?void 0:g.gridstackNode;if(m&&(m.subGrid=this,this.parentGridNode=m,this.el.classList.add("grid-stack-nested"),m.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=a.cellHeight==="auto",this._isAutoCellHeight||a.cellHeight==="initial")this.cellHeight(void 0);else{typeof a.cellHeight=="number"&&a.cellHeightUnit&&a.cellHeightUnit!==De.cellHeightUnit&&(a.cellHeight=a.cellHeight+a.cellHeightUnit,delete a.cellHeightUnit);const x=a.cellHeight;delete a.cellHeight,this.cellHeight(x)}a.alwaysShowResizeHandle==="mobile"&&(a.alwaysShowResizeHandle=Fe),this._setStaticClass();const S=a.engineClass||ut.engineClass||Ml;if(this.engine=new S({column:this.getColumn(),float:a.float,maxRow:a.maxRow,onChange:x=>{x.forEach(v=>{const C=v.el;C&&(v._removeDOM?(C&&C.remove(),delete v._removeDOM):this._writePosAttr(C,v))}),this._updateContainerHeight()}}),a.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(x=>this._prepareElement(x)),delete this.engine._loading,this.batchUpdate(!1)),a.children){const x=a.children;delete a.children,x.length&&this.load(x)}this.setAnimation(),a.subGridDynamic&&!ht.pauseDrag&&(ht.pauseDrag=!0),((y=a.draggable)==null?void 0:y.pause)!==void 0&&(ht.pauseDrag=a.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(n=this.opts){this.el.classList.add("gs-"+n.column),typeof n.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/n.column}%`)}addWidget(n){if(!n)return;if(typeof n=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(n.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(n);let a,u=n;if(u.grid=this,u.el?a=u.el:ut.addRemoveCB?a=ut.addRemoveCB(this.el,n,!0,!1):a=this.createWidgetDivs(u),!a)return;if(u=a.gridstackNode,u&&a.parentElement===this.el&&this.engine.nodes.find(f=>f._id===u._id))return a;const o=this._readAttr(a);return D.defaults(n,o),this.engine.prepareNode(n),this.el.appendChild(a),this.makeWidget(a,n),a}createWidgetDivs(n){const a=D.createDiv(["grid-stack-item",this.opts.itemClass]),u=D.createDiv(["grid-stack-item-content"],a);return D.lazyLoad(n)?n.visibleObservable||(n.visibleObservable=new IntersectionObserver(([o])=>{var f,g;o.isIntersecting&&((f=n.visibleObservable)==null||f.disconnect(),delete n.visibleObservable,ut.renderCB(u,n),(g=n.grid)==null||g.prepareDragDrop(n.el))}),window.setTimeout(()=>{var o;return(o=n.visibleObservable)==null?void 0:o.observe(a)})):ut.renderCB(u,n),a}makeSubGrid(n,a,u,o=!0){var Z,$,J;let f=n.gridstackNode;if(f||(f=this.makeWidget(n).gridstackNode),(Z=f.subGrid)!=null&&Z.el)return f.subGrid;let g,m=this;for(;m&&!g;)g=($=m.opts)==null?void 0:$.subGridOpts,m=(J=m.parentGridNode)==null?void 0:J.grid;a=D.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...g||{},...a||f.subGridOpts||{}}),f.subGridOpts=a;let S;a.column==="auto"&&(S=!0,a.column=Math.max(f.w||1,(u==null?void 0:u.w)||1),delete a.columnOpts);let y=f.el.querySelector(".grid-stack-item-content"),x,v;if(o&&(this._removeDD(f.el),v={...f,x:0,y:0},D.removeInternalForSave(v),delete v.subGridOpts,f.content&&(v.content=f.content,delete f.content),ut.addRemoveCB?x=ut.addRemoveCB(this.el,v,!0,!1):(x=D.createDiv(["grid-stack-item"]),x.appendChild(y),y=D.createDiv(["grid-stack-item-content"],f.el)),this.prepareDragDrop(f.el)),u){const ot=S?a.column:f.w,at=f.h+u.h,Et=f.el.style;Et.transition="none",this.update(f.el,{w:ot,h:at}),setTimeout(()=>Et.transition=null)}const C=f.subGrid=ut.addGrid(y,a);return u!=null&&u._moving&&(C._isTemp=!0),S&&(C._autoColumn=!0),o&&C.makeWidget(x,v),u&&(u._moving?window.setTimeout(()=>D.simulateMouseEvent(u._event,"mouseenter",C.el),0):C.makeWidget(f.el,f)),this.resizeToContentCheck(!1,f),C}removeAsSubGrid(n){var u;const a=(u=this.parentGridNode)==null?void 0:u.grid;a&&(a.batchUpdate(),a.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(o=>{o.x+=this.parentGridNode.x,o.y+=this.parentGridNode.y,a.makeWidget(o.el,o)}),a.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,n&&window.setTimeout(()=>D.simulateMouseEvent(n._event,"mouseenter",a.el),0))}save(n=!0,a=!1,u=ut.saveCB,o){const f=this.engine.save(n,u,o);if(f.forEach(g=>{var m;if(n&&g.el&&!g.subGrid&&!u){const S=g.el.querySelector(".grid-stack-item-content");g.content=S==null?void 0:S.innerHTML,g.content||delete g.content}else if(!n&&!u&&delete g.content,(m=g.subGrid)!=null&&m.el){const S=g.w||g.subGrid.getColumn(),y=g.subGrid.save(n,a,u,S);g.subGridOpts=a?y:{children:y},delete g.subGrid}delete g.el}),a){const g=D.cloneDeep(this.opts);g.marginBottom===g.marginTop&&g.marginRight===g.marginLeft&&g.marginTop===g.marginRight&&(g.margin=g.marginTop,delete g.marginTop,delete g.marginRight,delete g.marginBottom,delete g.marginLeft),g.rtl===(this.el.style.direction==="rtl")&&(g.rtl="auto"),this._isAutoCellHeight&&(g.cellHeight="auto"),this._autoColumn&&(g.column="auto");const m=g._alwaysShowResizeHandle;return delete g._alwaysShowResizeHandle,m!==void 0?g.alwaysShowResizeHandle=m:delete g.alwaysShowResizeHandle,D.removeInternalAndSame(g,De),g.children=f,g}return f}load(n,a=ut.addRemoveCB||!0){n=D.cloneDeep(n);const u=this.getColumn();n.forEach(x=>{x.w=x.w||x.minW||1,x.h=x.h||x.minH||1}),n=D.sort(n),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let o=0;n.forEach(x=>{o=Math.max(o,(x.x||0)+x.w)}),o>this.engine.defaultColumn&&(this.engine.defaultColumn=o),o>u&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=n,this.engine.columnChanged(o,u,this.responseLayout),n=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(n,o,!0));const f=ut.addRemoveCB;typeof a=="function"&&(ut.addRemoveCB=a);const g=[];this.batchUpdate();const m=!this.engine.nodes.length,S=m&&this.opts.animate;S&&this.setAnimation(!1),!m&&a&&[...this.engine.nodes].forEach(v=>{if(!v.id)return;D.find(n,v.id)||(ut.addRemoveCB&&ut.addRemoveCB(this.el,v,!1,!1),g.push(v),this.removeWidget(v.el,!0,!1))}),this.engine._loading=!0;const y=[];return this.engine.nodes=this.engine.nodes.filter(x=>D.find(n,x.id)?(y.push(x),!1):!0),n.forEach(x=>{var C;const v=D.find(y,x.id);if(v){if(D.shouldSizeToContent(v)&&(x.h=v.h),this.engine.nodeBoundFix(x),(x.autoPosition||x.x===void 0||x.y===void 0)&&(x.w=x.w||v.w,x.h=x.h||v.h,this.engine.findEmptyPosition(x)),this.engine.nodes.push(v),D.samePos(v,x)&&this.engine.nodes.length>1&&(this.moveNode(v,{...x,forceCollide:!0}),D.copyPos(x,v)),this.update(v.el,x),(C=x.subGridOpts)!=null&&C.children){const Z=v.el.querySelector(".grid-stack");Z&&Z.gridstack&&Z.gridstack.load(x.subGridOpts.children)}}else a&&this.addWidget(x)}),delete this.engine._loading,this.engine.removedNodes=g,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,f?ut.addRemoveCB=f:delete ut.addRemoveCB,S&&this.setAnimation(!0,!0),this}batchUpdate(n=!0){return this.engine.batchUpdate(n),n||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(n=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!n||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;const a=this.el.querySelector("."+this.opts.itemClass);if(a){const o=D.toNumber(a.getAttribute("gs-h"))||1;return Math.round(a.offsetHeight/o)}const u=parseInt(this.el.getAttribute("gs-current-row"));return u?Math.round(this.el.getBoundingClientRect().height/u):this.opts.cellHeight}cellHeight(n){if(n!==void 0&&this._isAutoCellHeight!==(n==="auto")&&(this._isAutoCellHeight=n==="auto",this._updateResizeEvent()),(n==="initial"||n==="auto")&&(n=void 0),n===void 0){const u=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;n=this.cellWidth()+u}const a=D.parseHeight(n);return this.opts.cellHeightUnit===a.unit&&this.opts.cellHeight===a.h?this:(this.opts.cellHeightUnit=a.unit,this.opts.cellHeight=a.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(n=!1){var a;return n&&((a=this.opts.columnOpts)!=null&&a.breakpointForWindow)?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var f,g;const n=this.opts.columnOpts;if(!n||!n.columnWidth&&!((f=n.breakpoints)!=null&&f.length))return!1;const a=this.getColumn();let u=a;const o=this._widthOrContainer(!0);if(n.columnWidth)u=Math.min(Math.round(o/n.columnWidth)||1,n.columnMax);else{u=n.columnMax;let m=0;for(;m<n.breakpoints.length&&o<=n.breakpoints[m].w;)u=n.breakpoints[m++].c||a}if(u!==a){const m=(g=n.breakpoints)==null?void 0:g.find(S=>S.c===u);return this.column(u,(m==null?void 0:m.layout)||n.layout),!0}return!1}compact(n="compact",a=!0){return this.engine.compact(n,a),this._triggerChangeEvent(),this}column(n,a="moveScale"){if(!n||n<1||this.opts.column===n)return this;const u=this.getColumn();return this.opts.column=n,this.engine?(this.engine.column=n,this.el.classList.remove("gs-"+u),this._updateColumnVar(),this.engine.columnChanged(u,n,a),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=a,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(n=>n.matches("."+this.opts.itemClass)&&!n.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(n=!0){var a;if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),n?this.el.parentNode.removeChild(this.el):(this.removeAll(n),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,(a=this._placeholder)==null||delete a.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(n){return this.opts.float!==n&&(this.opts.float=this.engine.float=n,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(n,a=!1){const u=this.el.getBoundingClientRect();let o;a?o={top:u.top+document.documentElement.scrollTop,left:u.left}:o={top:this.el.offsetTop,left:this.el.offsetLeft};const f=n.left-o.left,g=n.top-o.top,m=u.width/this.getColumn(),S=u.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(f/m),y:Math.floor(g/S)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(n,a,u,o){return this.engine.isAreaEmpty(n,a,u,o)}makeWidget(n,a){const u=ut.getElement(n);if(!u||u.gridstackNode)return u;u.parentElement||this.el.appendChild(u),this._prepareElement(u,!0,a);const o=u.gridstackNode;this._updateContainerHeight(),o.subGridOpts&&this.makeSubGrid(u,o.subGridOpts,void 0,!1);let f;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(f=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),f&&delete this._ignoreLayoutsNodeChange,u}on(n,a){return n.indexOf(" ")!==-1?(n.split(" ").forEach(o=>this.on(o,a)),this):(n==="change"||n==="added"||n==="removed"||n==="enable"||n==="disable"?(n==="enable"||n==="disable"?this._gsEventHandler[n]=o=>a(o):this._gsEventHandler[n]=o=>{o.detail&&a(o,o.detail)},this.el.addEventListener(n,this._gsEventHandler[n])):n==="drag"||n==="dragstart"||n==="dragstop"||n==="resizestart"||n==="resize"||n==="resizestop"||n==="dropped"||n==="resizecontent"?this._gsEventHandler[n]=a:console.error("GridStack.on("+n+") event not supported"),this)}off(n){return n.indexOf(" ")!==-1?(n.split(" ").forEach(u=>this.off(u)),this):((n==="change"||n==="added"||n==="removed"||n==="enable"||n==="disable")&&this._gsEventHandler[n]&&this.el.removeEventListener(n,this._gsEventHandler[n]),delete this._gsEventHandler[n],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(n=>this.off(n)),this}removeWidget(n,a=!0,u=!0){return n?(ut.getElements(n).forEach(o=>{if(o.parentElement&&o.parentElement!==this.el)return;let f=o.gridstackNode;f||(f=this.engine.nodes.find(g=>o===g.el)),f&&(a&&ut.addRemoveCB&&ut.addRemoveCB(this.el,f,!1,!1),delete o.gridstackNode,this._removeDD(o),this.engine.removeNode(f,a,u),a&&o.parentElement&&o.remove())}),u&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(n=!0,a=!0){return this.engine.nodes.forEach(u=>{n&&ut.addRemoveCB&&ut.addRemoveCB(this.el,u,!1,!1),delete u.el.gridstackNode,this.opts.staticGrid||this._removeDD(u.el)}),this.engine.removeAll(n,a),a&&this._triggerRemoveEvent(),this}setAnimation(n=this.opts.animate,a){return a?setTimeout(()=>{this.opts&&this.setAnimation(n)}):n?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=n,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(n,a=!0,u=!0){return!!this.opts.staticGrid===n?this:(n?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(o=>{this.prepareDragDrop(o.el),o.subGrid&&u&&o.subGrid.setStatic(n,a,u)}),a&&this._setStaticClass(),this)}updateOptions(n){var u;const a=this.opts;return n===a?this:(n.acceptWidgets!==void 0&&(a.acceptWidgets=n.acceptWidgets,this._setupAcceptWidget()),n.animate!==void 0&&this.setAnimation(n.animate),n.cellHeight&&this.cellHeight(n.cellHeight),n.class!==void 0&&n.class!==a.class&&(a.class&&this.el.classList.remove(a.class),n.class&&this.el.classList.add(n.class)),n.columnOpts?(this.opts.columnOpts=n.columnOpts,this.checkDynamicColumn()):n.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof n.column=="number"&&this.column(n.column),n.margin!==void 0&&this.margin(n.margin),n.staticGrid!==void 0&&this.setStatic(n.staticGrid),n.disableDrag!==void 0&&!n.staticGrid&&this.enableMove(!n.disableDrag),n.disableResize!==void 0&&!n.staticGrid&&this.enableResize(!n.disableResize),n.float!==void 0&&this.float(n.float),n.row!==void 0?(a.minRow=a.maxRow=a.row=n.row,this._updateContainerHeight()):(n.minRow!==void 0&&(a.minRow=n.minRow,this._updateContainerHeight()),n.maxRow!==void 0&&(a.maxRow=n.maxRow)),n.lazyLoad!==void 0&&(a.lazyLoad=n.lazyLoad),(u=n.children)!=null&&u.length&&this.load(n.children),this)}update(n,a){return ut.getElements(n).forEach(u=>{var x;const o=u==null?void 0:u.gridstackNode;if(!o)return;const f={...D.copyPos({},o),...D.cloneDeep(a)};this.engine.nodeBoundFix(f),delete f.autoPosition;const g=["x","y","w","h"];let m;if(g.some(v=>f[v]!==void 0&&f[v]!==o[v])&&(m={},g.forEach(v=>{m[v]=f[v]!==void 0?f[v]:o[v],delete f[v]})),!m&&(f.minW||f.minH||f.maxW||f.maxH)&&(m={}),f.content!==void 0){const v=u.querySelector(".grid-stack-item-content");v&&v.textContent!==f.content&&(o.content=f.content,ut.renderCB(v,f),(x=o.subGrid)!=null&&x.el&&(v.appendChild(o.subGrid.el),o.subGrid._updateContainerHeight())),delete f.content}let S=!1,y=!1;for(const v in f)v[0]!=="_"&&o[v]!==f[v]&&(o[v]=f[v],S=!0,y=y||!this.opts.staticGrid&&(v==="noResize"||v==="noMove"||v==="locked"));if(D.sanitizeMinMax(o),m){const v=m.w!==void 0&&m.w!==o.w;this.moveNode(o,m),v&&o.subGrid?o.subGrid.onResize(this.hasAnimationCSS()?o.w:void 0):this.resizeToContentCheck(v,o),delete o._orig}(m||S)&&this._writeAttr(u,o),y&&this.prepareDragDrop(o.el),ut.updateCB&&ut.updateCB(o)}),this}moveNode(n,a){const u=n._updating;u||this.engine.cleanNodes().beginUpdate(n),this.engine.moveNode(n,a),this._updateContainerHeight(),u||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(n){var C,Z;if(!n||(n.classList.remove("size-to-content-max"),!n.clientHeight))return;const a=n.gridstackNode;if(!a)return;const u=a.grid;if(!u||n.parentElement!==u.el)return;const o=u.getCellHeight(!0);if(!o)return;let f=a.h?a.h*o:n.clientHeight,g;if(a.resizeToContentParent&&(g=n.querySelector(a.resizeToContentParent)),g||(g=n.querySelector(ut.resizeToContentParent)),!g)return;const m=n.clientHeight-g.clientHeight,S=a.h?a.h*o-m:g.clientHeight;let y;if(a.subGrid){y=a.subGrid.getRow()*a.subGrid.getCellHeight(!0);const $=a.subGrid.el.getBoundingClientRect(),J=n.getBoundingClientRect();y+=$.top-J.top}else{if((Z=(C=a.subGridOpts)==null?void 0:C.children)!=null&&Z.length)return;{const $=g.firstElementChild;if(!$){console.error(`Error: GridStack.resizeToContent() widget id:${a.id} '${ut.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}y=$.getBoundingClientRect().height||S}}if(S===y)return;f+=y-S;let x=Math.ceil(f/o);const v=Number.isInteger(a.sizeToContent)?a.sizeToContent:0;v&&x>v&&(x=v,n.classList.add("size-to-content-max")),a.minH&&x<a.minH?x=a.minH:a.maxH&&x>a.maxH&&(x=a.maxH),x!==a.h&&(u._ignoreLayoutsNodeChange=!0,u.moveNode(a,{h:x}),delete u._ignoreLayoutsNodeChange)}resizeToContentCBCheck(n){ut.resizeToContentCB?ut.resizeToContentCB(n):this.resizeToContent(n)}rotate(n,a){return ut.getElements(n).forEach(u=>{const o=u.gridstackNode;if(!D.canBeRotated(o))return;const f={w:o.h,h:o.w,minH:o.minW,minW:o.minH,maxH:o.maxW,maxW:o.maxH};if(a){const m=a.left>0?Math.floor(a.left/this.cellWidth()):0,S=a.top>0?Math.floor(a.top/this.opts.cellHeight):0;f.x=o.x+m-(o.h-(S+1)),f.y=o.y+S-m}Object.keys(f).forEach(m=>{f[m]===void 0&&delete f[m]});const g=o._orig;this.update(u,f),o._orig=g}),this}margin(n){if(!(typeof n=="string"&&n.split(" ").length>1)){const u=D.parseHeight(n);if(this.opts.marginUnit===u.unit&&this.opts.margin===u.h)return}return this.opts.margin=n,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(n){return this.engine.willItFit(n)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const n=this.engine.getDirtyNodes(!0);return n&&n.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(n),this._triggerEvent("change",n)),this.engine.saveInitial(),this}_triggerAddEvent(){var n;if(this.engine.batchMode)return this;if((n=this.engine.addedNodes)!=null&&n.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(u=>{delete u._dirty});const a=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",a)}return this}_triggerRemoveEvent(){var n;if(this.engine.batchMode)return this;if((n=this.engine.removedNodes)!=null&&n.length){const a=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",a)}return this}_triggerEvent(n,a){const u=a?new CustomEvent(n,{bubbles:!1,detail:a}):new Event(n);let o=this;for(;o.parentGridNode;)o=o.parentGridNode.grid;return o.el.dispatchEvent(u),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const n=this.parentGridNode;let a=this.getRow()+this._extraDragRow;const u=this.opts.cellHeight,o=this.opts.cellHeightUnit;if(!u)return this;if(!n&&!this.opts.minRow){const f=D.parseHeight(getComputedStyle(this.el).minHeight);if(f.h>0&&f.unit===o){const g=Math.floor(f.h/u);a<g&&(a=g)}}return this.el.setAttribute("gs-current-row",String(a)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),a&&(this.el.style[n?"minHeight":"height"]=a*u+o),n&&D.shouldSizeToContent(n)&&n.grid.resizeToContentCBCheck(n.el),this}_prepareElement(n,a=!1,u){u=u||this._readAttr(n),n.gridstackNode=u,u.el=n,u.grid=this,u=this.engine.addNode(u,a),this._writeAttr(n,u),n.classList.add(De.itemClass,this.opts.itemClass);const o=D.shouldSizeToContent(u);return o?n.classList.add("size-to-content"):n.classList.remove("size-to-content"),o&&this.resizeToContentCheck(!1,u),D.lazyLoad(u)||this.prepareDragDrop(u.el),this}_writePosAttr(n,a){return(!a._moving&&!a._resizing||this._placeholder===n)&&(n.style.top=a.y?a.y===1?"var(--gs-cell-height)":`calc(${a.y} * var(--gs-cell-height))`:null,n.style.left=a.x?a.x===1?"var(--gs-column-width)":`calc(${a.x} * var(--gs-column-width))`:null,n.style.width=a.w>1?`calc(${a.w} * var(--gs-column-width))`:null,n.style.height=a.h>1?`calc(${a.h} * var(--gs-cell-height))`:null),n.setAttribute("gs-x",String(a.x)),n.setAttribute("gs-y",String(a.y)),a.w>1?n.setAttribute("gs-w",String(a.w)):n.removeAttribute("gs-w"),a.h>1?n.setAttribute("gs-h",String(a.h)):n.removeAttribute("gs-h"),this}_writeAttr(n,a){if(!a)return this;this._writePosAttr(n,a);const u={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const o in u)a[o]?n.setAttribute(u[o],String(a[o])):n.removeAttribute(u[o]);return this}_readAttr(n,a=!0){const u={};u.x=D.toNumber(n.getAttribute("gs-x")),u.y=D.toNumber(n.getAttribute("gs-y")),u.w=D.toNumber(n.getAttribute("gs-w")),u.h=D.toNumber(n.getAttribute("gs-h")),u.autoPosition=D.toBool(n.getAttribute("gs-auto-position")),u.noResize=D.toBool(n.getAttribute("gs-no-resize")),u.noMove=D.toBool(n.getAttribute("gs-no-move")),u.locked=D.toBool(n.getAttribute("gs-locked"));const o=n.getAttribute("gs-size-to-content");o&&(o==="true"||o==="false"?u.sizeToContent=D.toBool(o):u.sizeToContent=parseInt(o,10)),u.id=n.getAttribute("gs-id"),u.maxW=D.toNumber(n.getAttribute("gs-max-w")),u.minW=D.toNumber(n.getAttribute("gs-min-w")),u.maxH=D.toNumber(n.getAttribute("gs-max-h")),u.minH=D.toNumber(n.getAttribute("gs-min-h")),a&&(u.w===1&&n.removeAttribute("gs-w"),u.h===1&&n.removeAttribute("gs-h"),u.maxW&&n.removeAttribute("gs-max-w"),u.minW&&n.removeAttribute("gs-min-w"),u.maxH&&n.removeAttribute("gs-max-h"),u.minH&&n.removeAttribute("gs-min-h"));for(const f in u){if(!u.hasOwnProperty(f))return;!u[f]&&u[f]!==0&&f!=="sizeToContent"&&delete u[f]}return u}_setStaticClass(){const n=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...n),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...n),this.el.removeAttribute("gs-static")),this}onResize(n=(a=>(a=this.el)==null?void 0:a.clientWidth)()){if(!n||this.prevWidth===n)return;this.prevWidth=n,this.batchUpdate();let u=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),u=!0):u=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(o=>{o.subGrid&&o.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(u),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(n=!1,a=void 0){if(this.engine){if(n&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,a),this.animationDelay);if(a)D.shouldSizeToContent(a)&&this.resizeToContentCBCheck(a.el);else if(this.engine.nodes.some(u=>D.shouldSizeToContent(u))){const u=[...this.engine.nodes];this.batchUpdate(),u.forEach(o=>{D.shouldSizeToContent(o)&&this.resizeToContentCBCheck(o.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,a?[a]:this.engine.nodes)}}_updateResizeEvent(n=!1){const a=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(u=>u.sizeToContent));return!n&&a&&!this.resizeObserver?(this._sizeThrottle=D.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(n||!a)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(n=".grid-stack-item"){return D.getElement(n)}static getElements(n=".grid-stack-item"){return D.getElements(n)}static getGridElement(n){return ut.getElement(n)}static getGridElements(n){return D.getElements(n)}_initMargin(){let n,a=0,u=[];typeof this.opts.margin=="string"&&(u=this.opts.margin.split(" ")),u.length===2?(this.opts.marginTop=this.opts.marginBottom=u[0],this.opts.marginLeft=this.opts.marginRight=u[1]):u.length===4?(this.opts.marginTop=u[0],this.opts.marginRight=u[1],this.opts.marginBottom=u[2],this.opts.marginLeft=u[3]):(n=D.parseHeight(this.opts.margin),this.opts.marginUnit=n.unit,a=this.opts.margin=n.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(g=>{this.opts[g]===void 0?this.opts[g]=a:(n=D.parseHeight(this.opts[g]),this.opts[g]=n.h,delete this.opts.margin)}),this.opts.marginUnit=n.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop);const f=this.el.style;return f.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),f.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),f.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),f.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return ye}static setupDragIn(n,a,u,o=document){(a==null?void 0:a.pause)!==void 0&&(ht.pauseDrag=a.pause),a={appendTo:"body",helper:"clone",...a||{}},(typeof n=="string"?D.getElements(n,o):n).forEach((g,m)=>{ye.isDraggable(g)||ye.dragIn(g,a),u!=null&&u[m]&&(g.gridstackNode=u[m])})}movable(n,a){return this.opts.staticGrid?this:(ut.getElements(n).forEach(u=>{const o=u.gridstackNode;o&&(a?delete o.noMove:o.noMove=!0,this.prepareDragDrop(o.el))}),this)}resizable(n,a){return this.opts.staticGrid?this:(ut.getElements(n).forEach(u=>{const o=u.gridstackNode;o&&(a?delete o.noResize:o.noResize=!0,this.prepareDragDrop(o.el))}),this)}disable(n=!0){if(!this.opts.staticGrid)return this.enableMove(!1,n),this.enableResize(!1,n),this._triggerEvent("disable"),this}enable(n=!0){if(!this.opts.staticGrid)return this.enableMove(!0,n),this.enableResize(!0,n),this._triggerEvent("enable"),this}enableMove(n,a=!0){return this.opts.staticGrid?this:(n?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(u=>{this.prepareDragDrop(u.el),u.subGrid&&a&&u.subGrid.enableMove(n,a)}),this)}enableResize(n,a=!0){return this.opts.staticGrid?this:(n?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(u=>{this.prepareDragDrop(u.el),u.subGrid&&a&&u.subGrid.enableResize(n,a)}),this)}cancelDrag(){var a;const n=(a=this._placeholder)==null?void 0:a.gridstackNode;n&&(n._isExternal?(n._isAboutToRemove=!0,this.engine.removeNode(n)):n._isAboutToRemove&&ut._itemRemoving(n.el,!1),this.engine.restoreInitial())}_removeDD(n){return ye.draggable(n,"destroy").resizable(n,"destroy"),n.gridstackNode&&delete n.gridstackNode._initDD,delete n.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return ye.droppable(this.el,"destroy"),this;let n,a;const u=(o,f,g)=>{var C;g=g||f;const m=g.gridstackNode;if(!m)return;if(!((C=m.grid)!=null&&C.el)){g.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const Z=g.getBoundingClientRect();g.style.left=Z.x+(this.dragTransform.xScale-1)*(o.clientX-Z.x)/this.dragTransform.xScale+"px",g.style.top=Z.y+(this.dragTransform.yScale-1)*(o.clientY-Z.y)/this.dragTransform.yScale+"px",g.style.transformOrigin="0px 0px"}let{top:S,left:y}=g.getBoundingClientRect();const x=this.el.getBoundingClientRect();y-=x.left,S-=x.top;const v={position:{top:S*this.dragTransform.xScale,left:y*this.dragTransform.yScale}};if(m._temporaryRemoved){if(m.x=Math.max(0,Math.round(y/a)),m.y=Math.max(0,Math.round(S/n)),delete m.autoPosition,this.engine.nodeBoundFix(m),!this.engine.willItFit(m)){if(m.autoPosition=!0,!this.engine.willItFit(m)){ye.off(f,"drag");return}m._willFitPos&&(D.copyPos(m,m._willFitPos),delete m._willFitPos)}this._onStartMoving(g,o,v,m,a,n)}else this._dragOrResize(g,o,v,m,a,n)};return ye.droppable(this.el,{accept:o=>{const f=o.gridstackNode||this._readAttr(o,!1);if((f==null?void 0:f.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let g=!0;if(typeof this.opts.acceptWidgets=="function")g=this.opts.acceptWidgets(o);else{const m=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;g=o.matches(m)}if(g&&f&&this.opts.maxRow){const m={w:f.w,h:f.h,minW:f.minW,minH:f.minH};g=this.engine.willItFit(m)}return g}}).on(this.el,"dropover",(o,f,g)=>{let m=(g==null?void 0:g.gridstackNode)||f.gridstackNode;if((m==null?void 0:m.grid)===this&&!m._temporaryRemoved)return!1;if(m!=null&&m._sidebarOrig&&(m.w=m._sidebarOrig.w,m.h=m._sidebarOrig.h),m!=null&&m.grid&&m.grid!==this&&!m._temporaryRemoved&&m.grid._leave(f,g),g=g||f,a=this.cellWidth(),n=this.getCellHeight(!0),!m){const x=g.getAttribute("data-gs-widget")||g.getAttribute("gridstacknode");if(x){try{m=JSON.parse(x)}catch{console.error("Gridstack dropover: Bad JSON format: ",x)}g.removeAttribute("data-gs-widget"),g.removeAttribute("gridstacknode")}m||(m=this._readAttr(g)),m._sidebarOrig={w:m.w,h:m.h}}m.grid||(m.el||(m={...m}),m._isExternal=!0,g.gridstackNode=m);const S=m.w||Math.round(g.offsetWidth/a)||1,y=m.h||Math.round(g.offsetHeight/n)||1;return m.grid&&m.grid!==this?(f._gridstackNodeOrig||(f._gridstackNodeOrig=m),f.gridstackNode=m={...m,w:S,h:y,grid:this},delete m.x,delete m.y,this.engine.cleanupNode(m).nodeBoundFix(m),m._initDD=m._isExternal=m._temporaryRemoved=!0):(m.w=S,m.h=y,m._temporaryRemoved=!0),ut._itemRemoving(m.el,!1),ye.on(f,"drag",u),u(o,f,g),!1}).on(this.el,"dropout",(o,f,g)=>{const m=(g==null?void 0:g.gridstackNode)||f.gridstackNode;return m&&(!m.grid||m.grid===this)&&(this._leave(f,g),this._isTemp&&this.removeAsSubGrid(m)),!1}).on(this.el,"drop",(o,f,g)=>{var C,Z,$;const m=(g==null?void 0:g.gridstackNode)||f.gridstackNode;if((m==null?void 0:m.grid)===this&&!m._isExternal)return!1;const S=!!this.placeholder.parentElement,y=f!==g;this.placeholder.remove(),delete this.placeholder.gridstackNode,S&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const x=f._gridstackNodeOrig;if(delete f._gridstackNodeOrig,S&&(x!=null&&x.grid)&&x.grid!==this){const J=x.grid;J.engine.removeNodeFromLayoutCache(x),J.engine.removedNodes.push(x),J._triggerRemoveEvent()._triggerChangeEvent(),J.parentGridNode&&!J.engine.nodes.length&&J.opts.subGridDynamic&&J.removeAsSubGrid()}if(!m||(S&&(this.engine.cleanupNode(m),m.grid=this),(C=m.grid)==null||delete C._isTemp,ye.off(f,"drag"),g!==f?(g.remove(),f=g):f.remove(),this._removeDD(f),!S))return!1;const v=($=(Z=m.subGrid)==null?void 0:Z.el)==null?void 0:$.gridstack;return D.copyPos(m,this._readAttr(this.placeholder)),D.removePositioningStyles(f),y&&(m.content||m.subGridOpts||ut.addRemoveCB)?(delete m.el,f=this.addWidget(m)):(this._prepareElement(f,!0,m),this.el.appendChild(f),this.resizeToContentCheck(!1,m),v&&(v.parentGridNode=m),this._updateContainerHeight()),this.engine.addedNodes.push(m),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...o,type:"dropped"},x&&x.grid?x:void 0,m),!1}),this}static _itemRemoving(n,a){if(!n)return;const u=n?n.gridstackNode:void 0;!(u!=null&&u.grid)||n.classList.contains(u.grid.opts.removableOptions.decline)||(a?u._isAboutToRemove=!0:delete u._isAboutToRemove,a?n.classList.add("grid-stack-item-removing"):n.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const n=document.querySelector(this.opts.removable);return n?(!this.opts.staticGrid&&!ye.isDroppable(n)&&ye.droppable(n,this.opts.removableOptions).on(n,"dropover",(a,u)=>ut._itemRemoving(u,!0)).on(n,"dropout",(a,u)=>ut._itemRemoving(u,!1)),this):this}prepareDragDrop(n,a=!1){const u=n==null?void 0:n.gridstackNode;if(!u)return;const o=u.noMove||this.opts.disableDrag,f=u.noResize||this.opts.disableResize,g=this.opts.staticGrid||o&&f;if((a||g)&&(u._initDD&&(this._removeDD(n),delete u._initDD),g&&n.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!a))return this;if(!u._initDD){let m,S;const y=(C,Z)=>{this.triggerEvent(C,C.target),m=this.cellWidth(),S=this.getCellHeight(!0),this._onStartMoving(n,C,Z,u,m,S)},x=(C,Z)=>{this._dragOrResize(n,C,Z,u,m,S)},v=C=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete u._moving,delete u._resizing,delete u._event,delete u._lastTried;const Z=u.w!==u._orig.w,$=C.target;if(!(!$.gridstackNode||$.gridstackNode.grid!==this)){if(u.el=$,u._isAboutToRemove){const J=n.gridstackNode.grid;J._gsEventHandler[C.type]&&J._gsEventHandler[C.type](C,$),J.engine.nodes.push(u),J.removeWidget(n,!0,!0)}else D.removePositioningStyles($),u._temporaryRemoved?(this._writePosAttr($,u),this.engine.addNode(u)):this._writePosAttr($,u),this.triggerEvent(C,$);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),C.type==="resizestop"&&(Number.isInteger(u.sizeToContent)&&(u.sizeToContent=u.h),this.resizeToContentCheck(Z,u))}};ye.draggable(n,{start:y,stop:v,drag:x}).resizable(n,{start:y,stop:v,resize:x}),u._initDD=!0}return ye.draggable(n,o?"disable":"enable").resizable(n,f?"disable":"enable"),this}_onStartMoving(n,a,u,o,f,g){var m;if(this.engine.cleanNodes().beginUpdate(o),this._writePosAttr(this.placeholder,o),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=o,(m=o.grid)!=null&&m.el)this.dragTransform=D.getValuesFromTransformedElement(n);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const S=this.placeholder.closest(".grid-stack");this.dragTransform=D.getValuesFromTransformedElement(S)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(o.el=this.placeholder,o._lastUiPosition=u.position,o._prevYPix=u.position.top,o._moving=a.type==="dragstart",o._resizing=a.type==="resizestart",delete o._lastTried,a.type==="dropover"&&o._temporaryRemoved&&(this.engine.addNode(o),o._moving=!0),this.engine.cacheRects(f,g,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),a.type==="resizestart"){const S=this.getColumn()-o.x,y=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-o.y;ye.resizable(n,"option","minWidth",f*Math.min(o.minW||1,S)).resizable(n,"option","minHeight",g*Math.min(o.minH||1,y)).resizable(n,"option","maxWidth",f*Math.min(o.maxW||Number.MAX_SAFE_INTEGER,S)).resizable(n,"option","maxWidthMoveLeft",f*Math.min(o.maxW||Number.MAX_SAFE_INTEGER,o.x+o.w)).resizable(n,"option","maxHeight",g*Math.min(o.maxH||Number.MAX_SAFE_INTEGER,y)).resizable(n,"option","maxHeightMoveUp",g*Math.min(o.maxH||Number.MAX_SAFE_INTEGER,o.y+o.h))}}_dragOrResize(n,a,u,o,f,g){const m={...o._orig};let S,y=this.opts.marginLeft,x=this.opts.marginRight,v=this.opts.marginTop,C=this.opts.marginBottom;const Z=Math.round(g*.1),$=Math.round(f*.1);if(y=Math.min(y,$),x=Math.min(x,$),v=Math.min(v,Z),C=Math.min(C,Z),a.type==="drag"){if(o._temporaryRemoved)return;const ot=u.position.top-o._prevYPix;o._prevYPix=u.position.top,this.opts.draggable.scroll!==!1&&D.updateScrollPosition(n,u.position,ot);const at=u.position.left+(u.position.left>o._lastUiPosition.left?-x:y),Et=u.position.top+(u.position.top>o._lastUiPosition.top?-C:v);m.x=Math.round(at/f),m.y=Math.round(Et/g);const X=this._extraDragRow;if(this.engine.collide(o,m)){const st=this.getRow();let yt=Math.max(0,m.y+o.h-st);this.opts.maxRow&&st+yt>this.opts.maxRow&&(yt=Math.max(0,this.opts.maxRow-st)),this._extraDragRow=yt}else this._extraDragRow=0;if(this._extraDragRow!==X&&this._updateContainerHeight(),o.x===m.x&&o.y===m.y)return}else if(a.type==="resize"){if(m.x<0||(D.updateScrollResize(a,n,g),m.w=Math.round((u.size.width-y)/f),m.h=Math.round((u.size.height-v)/g),o.w===m.w&&o.h===m.h)||o._lastTried&&o._lastTried.w===m.w&&o._lastTried.h===m.h)return;const ot=u.position.left+y,at=u.position.top+v;m.x=Math.round(ot/f),m.y=Math.round(at/g),S=!0}o._event=a,o._lastTried=m;const J={x:u.position.left+y,y:u.position.top+v,w:(u.size?u.size.width:o.w*f)-y-x,h:(u.size?u.size.height:o.h*g)-v-C};if(this.engine.moveNodeCheck(o,{...m,cellWidth:f,cellHeight:g,rect:J,resizing:S})){o._lastUiPosition=u.position,this.engine.cacheRects(f,g,v,x,C,y),delete o._skipDown,S&&o.subGrid&&o.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const ot=a.target;o._sidebarOrig||this._writePosAttr(ot,o),this.triggerEvent(a,ot)}}triggerEvent(n,a){let u=this;for(;u.parentGridNode;)u=u.parentGridNode.grid;u._gsEventHandler[n.type]&&u._gsEventHandler[n.type](n,a)}_leave(n,a){a=a||n;const u=a.gridstackNode;if(!u||(a.style.transform=a.style.transformOrigin=null,ye.off(n,"drag"),u._temporaryRemoved))return;u._temporaryRemoved=!0,this.engine.removeNode(u),u.el=u._isExternal&&a?a:n;const o=u._sidebarOrig;u._isExternal&&this.engine.cleanupNode(u),u._sidebarOrig=o,this.opts.removable===!0&&ut._itemRemoving(n,!0),n._gridstackNodeOrig?(n.gridstackNode=n._gridstackNodeOrig,delete n._gridstackNodeOrig):u._isExternal&&this.engine.restoreInitial()}}ut.renderCB=(d,n)=>{d&&(n!=null&&n.content)&&(d.textContent=n.content)};ut.resizeToContentParent=".grid-stack-item-content";ut.Utils=D;ut.Engine=Ml;ut.GDRev="12.4.2";const Np={column:12,cellHeight:80,margin:4,animate:!0,float:!0,resizable:{handles:"e, se, s, sw, w"},draggable:{handle:".widget-drag-handle"}},wl={background:"none",border:"1px solid var(--border)",borderRadius:3,padding:"1px 5px",color:"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:10,lineHeight:"16px",display:"flex",alignItems:"center",justifyContent:"center",minWidth:22,height:20,flexShrink:0},Hs={...wl,color:"var(--cyan)",borderColor:"var(--cyan)",background:"rgba(34, 211, 238, 0.08)"},Hp={color:"var(--border)",fontSize:12,margin:"0 2px",userSelect:"none",flexShrink:0},Ah=["count","sum","avg","min","max"],Lp=[{key:"hbar",label:"☰",title:"Horizontal bars"},{key:"vbar",label:"▥",title:"Vertical bars"},{key:"pie",label:"◔",title:"Pie chart"},{key:"line",label:"⌇",title:"Line chart"},{key:"area",label:"▤",title:"Area chart"}];function Up({panelId:d,panel:n,onCopy:a,onChartTypeChange:u,onClose:o,anchorEl:f}){const g=N.useRef(null),[m,S]=N.useState({top:0,left:0});return N.useEffect(()=>{if(!f)return;const y=()=>{const x=f.getBoundingClientRect(),v=160;let C=x.right-v;C<4&&(C=x.left),C+v>window.innerWidth-4&&(C=window.innerWidth-v-4),S({top:x.bottom+4,left:C})};return y(),window.addEventListener("scroll",y,!0),window.addEventListener("resize",y),()=>{window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",y)}},[f]),N.useEffect(()=>{const y=x=>{g.current&&!g.current.contains(x.target)&&(!f||!f.contains(x.target))&&o()};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[o,f]),xo.createPortal(h.jsxs("div",{ref:g,style:{position:"fixed",top:m.top,left:m.left,background:"var(--panel)",border:"1px solid var(--border)",borderRadius:6,minWidth:160,zIndex:1e4,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},onClick:y=>y.stopPropagation(),children:[h.jsxs("div",{onClick:()=>{a(d),o()},style:{padding:"7px 12px",cursor:"pointer",fontSize:12,display:"flex",justifyContent:"space-between",alignItems:"center",color:"var(--text)"},onMouseEnter:y=>{y.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:y=>{y.currentTarget.style.background="transparent"},children:[h.jsx("span",{children:"Copy panel"}),h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:"then ⌘V"})]}),(n==null?void 0:n.viewMode)==="chart"&&h.jsxs(h.Fragment,{children:[h.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"4px 0"}}),h.jsx("div",{style:{padding:"4px 12px 2px",fontSize:10,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Chart type"}),Lp.map(y=>{const x=(n.chartType||"hbar")===y.key;return h.jsxs("div",{onClick:()=>{u(d,y.key),o()},style:{padding:"6px 12px",cursor:"pointer",fontSize:12,display:"flex",alignItems:"center",gap:8,color:x?"var(--cyan)":"var(--text)",background:x?"rgba(34, 211, 238, 0.08)":"transparent"},onMouseEnter:v=>{x||(v.currentTarget.style.background="rgba(255,255,255,0.05)")},onMouseLeave:v=>{v.currentTarget.style.background=x?"rgba(34, 211, 238, 0.08)":"transparent"},children:[h.jsx("span",{style:{width:18,textAlign:"center"},children:y.label}),h.jsx("span",{children:y.title}),x&&h.jsx("span",{style:{marginLeft:"auto",fontSize:11},children:"✓"})]},y.key)})]})]}),document.body)}function Lh(d,n){var u;if(!d)return null;const a=((u=d.aggregation)==null?void 0:u.toUpperCase())||"";return n==="chart"||d.groupByColumn?`${d.valueColumn?`${a}(${d.valueColumn})`:a} by ${d.groupByColumn}`:d.column?`${a}(${d.column})`:a}function Bp({panel:d,columns:n,onSelect:a,onClose:u,anchorEl:o}){const[f,g]=N.useState("main"),[m,S]=N.useState(null),[y,x]=N.useState(null),[v,C]=N.useState(null),Z=N.useRef(null),[$,J]=N.useState({top:0,left:0});N.useEffect(()=>{if(!o)return;const H=()=>{const k=o.getBoundingClientRect(),et=220;let dt=k.right-et;dt<4&&(dt=k.left),dt+et>window.innerWidth-4&&(dt=window.innerWidth-et-4),J({top:k.bottom+4,left:dt})};return H(),window.addEventListener("scroll",H,!0),window.addEventListener("resize",H),()=>{window.removeEventListener("scroll",H,!0),window.removeEventListener("resize",H)}},[o]),N.useEffect(()=>{const H=k=>{Z.current&&!Z.current.contains(k.target)&&(!o||!o.contains(k.target))&&u()};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[u,o]);const ot={padding:"7px 12px",cursor:"pointer",fontSize:12,display:"flex",justifyContent:"space-between",alignItems:"center",color:"var(--text)"},at=H=>{H==="count"?a("number",{aggregation:"count",column:null}):(S(H),g("pickColumn"))},Et=H=>{a("number",{aggregation:m,column:H})},X=H=>{x(H),g("groupByAgg")},st=H=>{H==="count"?a("chart",{groupByColumn:y,valueColumn:null,aggregation:"count"}):(C(H),g("groupByValCol"))},yt=H=>{a("chart",{groupByColumn:y,valueColumn:H,aggregation:v})};return xo.createPortal(h.jsxs("div",{ref:Z,style:{position:"fixed",top:$.top,left:$.left,background:"var(--panel)",border:"1px solid var(--border)",borderRadius:6,minWidth:220,maxHeight:320,overflowY:"auto",zIndex:1e4,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},onClick:H=>H.stopPropagation(),children:[f==="main"&&h.jsxs(h.Fragment,{children:[d.savedViewConfig&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{onClick:()=>a(d.savedViewMode||"number",d.savedViewConfig),style:{padding:"8px 12px",cursor:"pointer",fontSize:12,display:"flex",justifyContent:"space-between",alignItems:"center",color:"var(--cyan)",background:"rgba(34, 211, 238, 0.05)"},onMouseEnter:H=>{H.currentTarget.style.background="rgba(34, 211, 238, 0.1)"},onMouseLeave:H=>{H.currentTarget.style.background="rgba(34, 211, 238, 0.05)"},children:[h.jsx("span",{children:Lh(d.savedViewConfig,d.savedViewMode)}),h.jsx("span",{style:{fontSize:10},children:"↻"})]}),h.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"2px 0"}})]}),h.jsx("div",{style:{padding:"6px 12px",fontSize:10,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Single value"}),Ah.map(H=>h.jsxs("div",{onClick:()=>at(H),style:ot,onMouseEnter:k=>{k.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:k=>{k.currentTarget.style.background="transparent"},children:[h.jsx("span",{children:H.toUpperCase()}),H!=="count"&&h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:"▶"})]},H)),h.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"2px 0"}}),h.jsx("div",{style:{padding:"6px 12px",fontSize:10,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Grouped"}),h.jsxs("div",{onClick:()=>g("groupByCol"),style:ot,onMouseEnter:H=>{H.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:H=>{H.currentTarget.style.background="transparent"},children:[h.jsx("span",{children:"Group By..."}),h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:"▶"})]})]}),f==="pickColumn"&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{onClick:()=>{g("main"),S(null)},style:{padding:"6px 12px",cursor:"pointer",fontSize:11,color:"var(--text-dim)",borderBottom:"1px solid var(--border)"},onMouseEnter:H=>{H.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:H=>{H.currentTarget.style.background="transparent"},children:["◀ ",m==null?void 0:m.toUpperCase()," — pick column"]}),n.map(H=>h.jsxs("div",{onClick:()=>Et(H.name),style:ot,onMouseEnter:k=>{k.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:k=>{k.currentTarget.style.background="transparent"},children:[h.jsx("span",{children:H.name}),h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:H.type})]},H.name))]}),f==="groupByCol"&&h.jsxs(h.Fragment,{children:[h.jsx("div",{onClick:()=>{g("main"),x(null)},style:{padding:"6px 12px",cursor:"pointer",fontSize:11,color:"var(--text-dim)",borderBottom:"1px solid var(--border)"},onMouseEnter:H=>{H.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:H=>{H.currentTarget.style.background="transparent"},children:"◀ Group By — pick column"}),n.map(H=>h.jsxs("div",{onClick:()=>X(H.name),style:ot,onMouseEnter:k=>{k.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:k=>{k.currentTarget.style.background="transparent"},children:[h.jsx("span",{children:H.name}),h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:H.type})]},H.name))]}),f==="groupByAgg"&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{onClick:()=>{g("groupByCol")},style:{padding:"6px 12px",cursor:"pointer",fontSize:11,color:"var(--text-dim)",borderBottom:"1px solid var(--border)"},onMouseEnter:H=>{H.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:H=>{H.currentTarget.style.background="transparent"},children:["◀ Group by ",y," — pick aggregation"]}),Ah.map(H=>h.jsxs("div",{onClick:()=>st(H),style:ot,onMouseEnter:k=>{k.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:k=>{k.currentTarget.style.background="transparent"},children:[h.jsx("span",{children:H.toUpperCase()}),H!=="count"&&h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:"▶"})]},H))]}),f==="groupByValCol"&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{onClick:()=>{g("groupByAgg"),C(null)},style:{padding:"6px 12px",cursor:"pointer",fontSize:11,color:"var(--text-dim)",borderBottom:"1px solid var(--border)"},onMouseEnter:H=>{H.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:H=>{H.currentTarget.style.background="transparent"},children:["◀ ",v==null?void 0:v.toUpperCase()," — pick column"]}),n.filter(H=>H.name!==y).map(H=>h.jsxs("div",{onClick:()=>yt(H.name),style:ot,onMouseEnter:k=>{k.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:k=>{k.currentTarget.style.background="transparent"},children:[h.jsx("span",{children:H.name}),h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:H.type})]},H.name))]})]}),document.body)}const kp=N.forwardRef(function({panels:n,locked:a,renderPanel:u,onPanelClose:o,onToggleFilters:f,onLayoutChange:g,onViewModeChange:m,onCopyPanel:S,onChartTypeChange:y,focusPanelId:x,focusCounter:v,SOURCE_CONFIG:C,panelDisplayName:Z},$){const J=N.useRef(null),ot=N.useRef(null),at=N.useRef({}),Et=N.useRef(g),[X,st]=N.useState(!1),[yt,H]=N.useState(0),[k,et]=N.useState(null),dt=N.useRef(null),[At,Q]=N.useState(null),nt=N.useRef(null),bt=N.useRef({}),mt=N.useRef({});N.useEffect(()=>{Et.current=g},[g]),N.useImperativeHandle($,()=>({resizePanel:(q,rt,b)=>{const j=J.current,Y=at.current[String(q)];j&&Y&&j.update(Y.el,{w:rt,h:b})},getPanelSize:q=>{const rt=at.current[String(q)];if(rt){const b=rt.el.gridstackNode;if(b)return{w:b.w,h:b.h}}return null}}),[]),N.useEffect(()=>{if(!ot.current)return;const q=ut.init(Np,ot.current);J.current=q,st(!0);const rt=(b,j)=>{if(!Et.current||!j)return;const Y={};for(const W of j)W.id&&(Y[W.id]={x:W.x,y:W.y,w:W.w,h:W.h});Et.current(Y)};return q.on("change",rt),q.on("added",rt),()=>{q.off("change"),q.off("added"),q.destroy(!1),J.current=null,at.current={},st(!1)}},[]),N.useEffect(()=>{if(!J.current||!X)return;const q=J.current,rt=new Set(n.map(Y=>String(Y.id))),b=new Set(Object.keys(at.current));let j=!1;for(const Y of n){const W=String(Y.id);if(!b.has(W)){const K=Y.gridPos,it=document.createElement("div");it.className="grid-stack-item",it.setAttribute("gs-id",W),it.setAttribute("gs-w",String((K==null?void 0:K.w)??6)),it.setAttribute("gs-h",String((K==null?void 0:K.h)??5)),K&&K.x!=null&&K.y!=null?(it.setAttribute("gs-x",String(K.x)),it.setAttribute("gs-y",String(K.y))):it.setAttribute("gs-auto-position","true");const St=document.createElement("div");St.className="grid-stack-item-content widget-content-wrapper",it.appendChild(St);const Qt=document.createElement("div");Qt.className="widget-portal-root",St.appendChild(Qt),ot.current.appendChild(it),q.makeWidget(it),at.current[W]={el:it,portalRoot:Qt},j=!0}}for(const Y of b)if(!rt.has(Y)){const{el:W}=at.current[Y];q.removeWidget(W,!0),delete at.current[Y],j=!0}j&&H(Y=>Y+1)},[n,X]),N.useEffect(()=>{!J.current||!X||J.current.setStatic(!!a)},[a,X]),N.useEffect(()=>{if(!x||!at.current[String(x)])return;const{el:q}=at.current[String(x)];q.scrollIntoView({behavior:"smooth",block:"nearest"}),q.classList.add("widget-focused");const rt=setTimeout(()=>q.classList.remove("widget-focused"),1e3);return()=>clearTimeout(rt)},[x,v]);const Ut=q=>{const rt=J.current,b=at.current[String(q)];if(!rt||!b)return;const j=b.el.gridstackNode;if(!j)return;const Y=String(q);j.w===12&&bt.current[Y]?(rt.update(b.el,{w:bt.current[Y]}),delete bt.current[Y]):(bt.current[Y]=j.w,rt.update(b.el,{w:12}))},R=q=>{const rt=J.current,b=at.current[String(q)];if(!rt||!b)return;const j=b.el.gridstackNode;if(!j)return;const Y=String(q);j.h===12&&mt.current[Y]?(rt.update(b.el,{h:mt.current[Y]}),delete mt.current[Y]):(mt.current[Y]=j.h,rt.update(b.el,{h:12}))},V=(q,rt,b)=>{et(null),m&&m(q,rt,b)},P=q=>{et(null),m&&m(q,"table",null)};return h.jsxs("div",{style:{flex:1,overflow:"auto",padding:4},children:[h.jsx("div",{ref:ot,className:"grid-stack"}),X&&n.map(q=>{const rt=at.current[String(q.id)];if(!rt)return null;const b=C[q.sourceType],j=q.filtersVisible!==!1,Y=q.sourceType==="postgres",W=q.viewMode||"table";return xo.createPortal(h.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"},children:[!a&&h.jsxs("div",{className:"widget-drag-handle",style:{display:"flex",alignItems:"center",gap:4,padding:"4px 8px",background:"var(--panel)",borderBottom:"1px solid var(--border)",cursor:"grab",flexShrink:0,minHeight:28},children:[h.jsx("span",{style:{color:"var(--text-dim)",fontSize:10,cursor:"grab",userSelect:"none"},children:"⠿"}),h.jsx("span",{style:{fontSize:9,fontWeight:700,color:b.color,background:b.color+"20",padding:"1px 4px",borderRadius:3,letterSpacing:"0.05em"},children:b.label}),h.jsx("span",{style:{fontSize:11,color:"var(--text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginRight:4},children:Z(q)}),q.loading&&h.jsx("span",{style:{color:"var(--yellow)",fontSize:10,flexShrink:0},children:"..."}),h.jsx("div",{style:{flex:1}}),h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:2,flexShrink:0},children:[h.jsx("button",{onClick:K=>{K.stopPropagation(),nt.current=K.currentTarget,Q(At===q.id?null:q.id)},title:"Panel options",style:wl,onMouseEnter:K=>{K.currentTarget.style.borderColor="var(--text-dim)"},onMouseLeave:K=>{K.currentTarget.style.borderColor="var(--border)"},children:"⋮"}),At===q.id&&h.jsx(Up,{panelId:q.id,panel:q,onCopy:S,onChartTypeChange:y,onClose:()=>Q(null),anchorEl:nt.current}),h.jsxs("button",{onClick:K=>{K.stopPropagation(),f(q.id)},title:j?"Hide filters":"Show filters",style:{...wl,color:j?"var(--text)":"var(--text-dim)",background:j?"rgba(255,255,255,0.04)":"none",gap:3,paddingLeft:6,paddingRight:7,minWidth:"auto"},onMouseEnter:K=>{K.currentTarget.style.borderColor="var(--text-dim)"},onMouseLeave:K=>{K.currentTarget.style.borderColor="var(--border)"},children:[h.jsx("span",{style:{fontSize:8},children:j?"▾":"▸"}),h.jsx("span",{children:"filters"})]}),Y&&h.jsxs(h.Fragment,{children:[h.jsx("button",{onClick:K=>{K.stopPropagation(),P(q.id)},title:"Table view",style:W==="table"?Hs:wl,onMouseEnter:K=>{W!=="table"&&(K.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:K=>{W!=="table"&&(K.currentTarget.style.borderColor="var(--border)")},children:"⊞"}),h.jsx("button",{onClick:K=>{K.stopPropagation(),W==="table"&&q.savedViewConfig?V(q.id,q.savedViewMode||"number",q.savedViewConfig):(dt.current=K.currentTarget,et(k===q.id?null:q.id))},title:W==="table"&&q.savedViewConfig?`Restore: ${Lh(q.savedViewConfig,q.savedViewMode)}`:"Summary view",style:W!=="table"?Hs:q.savedViewConfig?{...wl,color:"var(--cyan)"}:wl,onMouseEnter:K=>{W==="table"&&(K.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:K=>{W==="table"&&(K.currentTarget.style.borderColor="var(--border)")},children:"Σ"}),k===q.id&&h.jsx(Bp,{panel:q,columns:q.columns||[],onSelect:(K,it)=>V(q.id,K,it),onClose:()=>et(null),anchorEl:dt.current})]}),(()=>{var St,Qt;const K=((St=q.gridPos)==null?void 0:St.w)===12,it=((Qt=q.gridPos)==null?void 0:Qt.h)===12;return h.jsxs(h.Fragment,{children:[h.jsx("span",{style:Hp,children:"|"}),h.jsx("button",{onClick:vt=>{vt.stopPropagation(),Ut(q.id)},title:K?"Restore width":"Full row",style:K?Hs:wl,onMouseEnter:vt=>{K||(vt.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:vt=>{K||(vt.currentTarget.style.borderColor="var(--border)")},children:"⇔"}),h.jsx("button",{onClick:vt=>{vt.stopPropagation(),R(q.id)},title:it?"Restore height":"Full column",style:it?Hs:wl,onMouseEnter:vt=>{it||(vt.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:vt=>{it||(vt.currentTarget.style.borderColor="var(--border)")},children:"⇕"}),h.jsx("button",{onClick:vt=>{vt.stopPropagation(),o(q.id)},style:{...wl,border:"none",color:"var(--text-dim)",fontSize:12,minWidth:18,padding:"0 2px"},onMouseEnter:vt=>{vt.currentTarget.style.color="var(--red)",vt.currentTarget.style.background="var(--red-bg)"},onMouseLeave:vt=>{vt.currentTarget.style.color="var(--text-dim)",vt.currentTarget.style.background="none"},children:"×"})]})})()]})]}),h.jsx("div",{style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column"},children:u(q)})]},q.id),rt.portalRoot)})]})}),Gp=100,Uh="mdash_state",Xs={postgres:{color:"var(--purple)",label:"PG"},redis:{color:"var(--red)",label:"RD"},s3:{color:"var(--orange)",label:"S3"}};let Vs=1,gn=1,dn=null;function ho(d){return d.map(n=>({...n,panels:n.panels.map(a=>{const{results:u,loading:o,columns:f,tokens:g,nextToken:m,...S}=a;return S})}))}function qp(){var d;try{const n=localStorage.getItem(Uh);if(!n)return null;const a=JSON.parse(n);if(!((d=a.dashboards)!=null&&d.length))return null;let u=0,o=0;for(const g of a.dashboards){g.id>u&&(u=g.id);for(const m of g.panels)m.id>o&&(o=m.id)}return Vs=u+1,gn=o+1,{dashboards:a.dashboards.map(g=>({...g,locked:g.locked??!1,panels:g.panels.map(m=>({results:null,loading:!1,...m.sourceType==="postgres"?{columns:[]}:{},...m.sourceType==="s3"?{tokens:[null],nextToken:null}:{},...m}))})),activeDashboardId:a.activeDashboardId,autoRefreshInterval:a.autoRefreshInterval??null}}catch{return null}}const Yp={table:{w:6,h:5},number:{w:3,h:2},chart:{w:6,h:5}};function Xp(d,n,a,u){return{id:gn++,sourceType:"postgres",instanceId:d,instanceLabel:n,schema:a,name:u,displayName:`${a}.${u}`,filters:{include:"",exclude:"",highlight:"",columns:""},highlightOptions:{caseSensitive:!1,wholeWord:!1,regex:!1},page:0,columns:[],results:null,loading:!1,filtersVisible:!0,viewMode:"table",viewConfig:null,savedViewConfig:null,savedViewMode:null,viewSizes:{},chartType:"hbar"}}function Qp(d,n){return{id:gn++,sourceType:"redis",instanceId:d,instanceLabel:n,displayName:"keys",filter:"",page:0,results:null,loading:!1,filtersVisible:!0}}function Vp(d,n,a){return{id:gn++,sourceType:"s3",instanceId:d,instanceLabel:n,bucket:a,displayName:a,filter:"",page:0,tokens:[null],nextToken:null,results:null,loading:!1,filtersVisible:!0}}function jh(d){return{id:Vs++,name:d,panels:[],locked:!1}}function Dh(d,n){const a=JSON.stringify(d,null,2),u=new Blob([a],{type:"application/json"}),o=URL.createObjectURL(u),f=document.createElement("a");f.href=o,f.download=n,f.click(),URL.revokeObjectURL(o)}function Zp(d){if(!d||typeof d!="object")return null;let n;if(Array.isArray(d.dashboards))n=d.dashboards;else if(d.dashboard&&typeof d.dashboard=="object")n=[d.dashboard];else return null;for(const a of n){if(typeof a.name!="string"||!Array.isArray(a.panels))return null;for(const u of a.panels)if(!u.sourceType||typeof u.sourceType!="string")return null}return n}function Kp(d){return d.map(n=>({...n,id:Vs++,panels:n.panels.map(a=>({results:null,loading:!1,...a.sourceType==="postgres"?{columns:[]}:{},...a.sourceType==="s3"?{tokens:[null],nextToken:null}:{},...a,id:gn++}))}))}function Jp(){const[d,n]=N.useState([]),[a,u]=N.useState(Gp),[o,f]=N.useState(null),[g]=N.useState(()=>qp()),[m,S]=N.useState(()=>g?g.dashboards:[jh("Dashboard 1")]),[y,x]=N.useState(()=>g?g.activeDashboardId:1),[v,C]=N.useState(null),[Z,$]=N.useState(0),[J,ot]=N.useState(0),[at,Et]=N.useState(null),[X,st]=N.useState(()=>(g==null?void 0:g.autoRefreshInterval)??null),[yt,H]=N.useState(!1),[k,et]=N.useState(""),dt=N.useRef(null),At=N.useRef(null),Q=N.useRef(null),[nt,bt]=N.useState(!1),[mt,Ut]=N.useState("type"),[R,V]=N.useState(null),[P,q]=N.useState(null),rt=N.useRef(null),[b,j]=N.useState(null),[Y,W]=N.useState({}),[K,it]=N.useState({}),[St,Qt]=N.useState(""),[vt,Al]=N.useState(""),[Ie,bi]=N.useState(""),[mn,Pe]=N.useState(""),[Si,Ei]=N.useState(""),[ga,pn]=N.useState(""),[_i,zi]=N.useState(""),[Ci,ma]=N.useState("us-east-1"),[pa,he]=N.useState(""),[ve,rl]=N.useState(!1),qt=m.find(_=>_.id===y)||null,Ft=(qt==null?void 0:qt.panels)||[],yn=_=>d.filter(G=>G.type===_&&G.status==="connected"),ya=_=>yn(_).length>1,Zs=d.some(_=>_.status==="connected"),vn=N.useCallback((_,G)=>{S(F=>F.map(I=>({...I,panels:I.panels.map(pt=>pt.id===_?{...pt,...G}:pt)})))},[]),li=()=>{const _=jh(`Dashboard ${Vs}`);S(G=>[...G,_]),x(_.id)},ge=(_,G)=>{const F=G.trim();F&&S(I=>I.map(pt=>pt.id===_?{...pt,name:F}:pt))},tl=(_,G)=>{G&&G.stopPropagation(),S(F=>{const I=F.filter(pt=>pt.id!==_);if(y===_){const pt=F.findIndex(It=>It.id===_),gt=I[Math.min(pt,I.length-1)];x(gt?gt.id:null)}return I})},ae=_=>{S(G=>G.map(F=>F.id===y?{...F,panels:[...F.panels,_]}:F)),C(_.id),$(G=>G+1)},Ks=_=>{S(G=>G.map(F=>({...F,panels:F.panels.filter(I=>I.id!==_)})))},Js=_=>{S(G=>G.map(F=>F.id===_?{...F,locked:!F.locked}:F))},Ws=N.useCallback(_=>{S(G=>G.map(F=>({...F,panels:F.panels.map(I=>I.id===_?{...I,filtersVisible:!I.filtersVisible}:I)})))},[]),Ti=N.useCallback((_,G,F)=>{var pt;const I=(pt=Q.current)==null?void 0:pt.getPanelSize(_);S(gt=>gt.map(It=>({...It,panels:It.panels.map(Nt=>{if(Nt.id!==_)return Nt;const Yt=Nt.viewMode||"table",ll=G==="table"?null:F;if(Yt===G&&JSON.stringify(Nt.viewConfig)===JSON.stringify(ll))return Nt;const ul={...Nt.viewSizes};I&&(ul[Yt]={w:I.w,h:I.h});const ol=G==="table"?Nt.viewConfig||Nt.savedViewConfig:F,Dl=G==="table"?Nt.viewMode!=="table"?Nt.viewMode:Nt.savedViewMode:G;return{...Nt,viewMode:G,viewConfig:ll,savedViewConfig:ol,savedViewMode:Dl,viewSizes:ul,results:null}})}))),requestAnimationFrame(()=>{var ll;const gt=Ft.find(ul=>ul.id===_),It=(gt==null?void 0:gt.viewSizes)||{},Nt=(gt==null?void 0:gt.viewMode)||"table";I&&(It[Nt]={w:I.w,h:I.h});const Yt=It[G]||Yp[G]||{w:6,h:5};(ll=Q.current)==null||ll.resizePanel(_,Yt.w,Yt.h)})},[Ft]),Ri=N.useCallback((_,G)=>{S(F=>F.map(I=>({...I,panels:I.panels.map(pt=>pt.id===_?{...pt,chartType:G}:pt)})))},[]),wi=N.useCallback(_=>{const G=Ft.find(ul=>ul.id===_);if(!G)return;const{results:F,loading:I,columns:pt,tokens:gt,nextToken:It,id:Nt,gridPos:Yt,...ll}=G;dn=ll},[Ft]),el=N.useCallback(()=>{if(!dn)return;const _={...dn,id:gn++,results:null,loading:!1,...dn.sourceType==="postgres"?{columns:[]}:{},...dn.sourceType==="s3"?{tokens:[null],nextToken:null}:{}};ae(_)},[ae]),[Mi,Ve]=N.useState(!1),xn=N.useRef(null),bn=N.useRef(null),Sn=N.useCallback(()=>{if(!qt)return;const _=ho([qt])[0],G=new Date().toISOString().slice(0,10);Dh({dashboard:_},`mdash-${_.name.replace(/\s+/g,"-").toLowerCase()}-${G}.json`),Ve(!1)},[qt]),ii=N.useCallback(()=>{const _=ho(m),G=new Date().toISOString().slice(0,10);Dh({dashboards:_,activeDashboardId:y,autoRefreshInterval:X},`mdash-all-dashboards-${G}.json`),Ve(!1)},[m,y,X]),$s=N.useCallback(_=>{var I;const G=(I=_.target.files)==null?void 0:I[0];if(!G)return;const F=new FileReader;F.onload=pt=>{try{const gt=JSON.parse(pt.target.result),It=Zp(gt);if(!It){f("Invalid dashboard config file. Expected JSON with 'dashboard' or 'dashboards' key.");return}const Nt=Kp(It);S(Yt=>[...Yt,...Nt]),x(Nt[0].id)}catch{f("Failed to parse JSON file.")}},F.readAsText(G),_.target.value="",Ve(!1)},[]);N.useEffect(()=>{const _=G=>{var F,I;if((G.metaKey||G.ctrlKey)&&G.key==="v"){const pt=(F=document.activeElement)==null?void 0:F.tagName;if(pt==="INPUT"||pt==="TEXTAREA"||(I=document.activeElement)!=null&&I.isContentEditable||!dn)return;G.preventDefault(),el()}};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[el]);const va=(_,G,F,I)=>{const pt=Ft.find(gt=>gt.sourceType==="postgres"&&gt.instanceId===_&&gt.schema===F&&gt.name===I);pt?(C(pt.id),$(gt=>gt+1)):ae(Xp(_,G,F,I)),Jt()},xa=(_,G)=>{const F=Ft.find(I=>I.sourceType==="redis"&&I.instanceId===_);F?(C(F.id),$(I=>I+1)):ae(Qp(_,G)),Jt()},ba=(_,G,F)=>{const I=Ft.find(pt=>pt.sourceType==="s3"&&pt.instanceId===_&&pt.bucket===F);I?(C(I.id),$(pt=>pt+1)):ae(Vp(_,G,F)),Jt()};N.useEffect(()=>{dp().then(_=>{var F,I,pt;_.page_size&&u(_.page_size);const G=[];for(const gt of((F=_.sources)==null?void 0:F.postgres)||[])G.push({id:gt.id,type:"postgres",label:gt.label,status:gt.status});for(const gt of((I=_.sources)==null?void 0:I.redis)||[])G.push({id:gt.id,type:"redis",label:gt.label,status:gt.status});for(const gt of((pt=_.sources)==null?void 0:pt.s3)||[])G.push({id:gt.id,type:"s3",label:gt.label,status:gt.status});n(G);for(const gt of G)gt.status==="connected"&&(gt.type==="postgres"&&co(gt.id).then(It=>W(Nt=>({...Nt,[gt.id]:It.tables}))).catch(()=>{}),gt.type==="s3"&&fo(gt.id).then(It=>it(Nt=>({...Nt,[gt.id]:It.buckets}))).catch(()=>{}))}).catch(()=>n([]))},[]);const Ai=()=>{rl(!0),f(null),hp(St,vt).then(_=>{const G={id:_.instance_id,type:"postgres",label:_.label||_.instance_id,status:"connected"};return n(F=>[...F,G]),j(null),Qt(""),Al(""),co(_.instance_id).then(F=>{W(I=>({...I,[_.instance_id]:F.tables}))})}).catch(_=>f(_.message)).finally(()=>rl(!1))},ji=()=>{rl(!0),f(null),mp(Ie,mn).then(_=>{const G={id:_.instance_id,type:"redis",label:_.label||_.instance_id,status:"connected"};n(F=>[...F,G]),j(null),bi(""),Pe("")}).catch(_=>f(_.message)).finally(()=>rl(!1))},Sa=()=>{rl(!0),f(null),vp({endpointUrl:Si,accessKey:ga,secretKey:_i,region:Ci,label:pa}).then(_=>{const G={id:_.instance_id,type:"s3",label:_.label||_.instance_id,status:"connected"};return n(F=>[...F,G]),j(null),Ei(""),pn(""),zi(""),ma("us-east-1"),he(""),fo(_.instance_id).then(F=>{it(I=>({...I,[_.instance_id]:F.buckets}))})}).catch(_=>f(_.message)).finally(()=>rl(!1))},Ea=_=>{const G=yn(_);if(G.length===0){bt(!1),j(_);return}if(G.length===1){Ze(G[0],_);return}V(_),Ut("instance")},Ze=(_,G)=>{const F=G||R;if(F==="redis"){xa(_.id,_.label);return}q(_.id),V(F),Ut("target"),F==="postgres"&&!Y[_.id]&&co(_.id).then(I=>W(pt=>({...pt,[_.id]:I.tables}))).catch(I=>f(I.message)),F==="s3"&&!K[_.id]&&fo(_.id).then(I=>it(pt=>({...pt,[_.id]:I.buckets}))).catch(I=>f(I.message))},Jt=()=>{bt(!1),Ut("type"),V(null),q(null)};N.useEffect(()=>{const _=G=>{rt.current&&!rt.current.contains(G.target)&&Jt(),At.current&&!At.current.contains(G.target)&&H(!1),xn.current&&!xn.current.contains(G.target)&&Ve(!1)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[]);const se=N.useCallback(()=>{S(_=>_.map(G=>G.id===y?{...G,panels:G.panels.map(F=>({...F,results:null}))}:G)),ot(_=>_+1)},[y]);N.useEffect(()=>(dt.current&&(clearInterval(dt.current),dt.current=null),X&&Ft.length>0&&(dt.current=setInterval(()=>{se()},X*60*1e3)),()=>{dt.current&&clearInterval(dt.current)}),[X,Ft.length,se]),N.useEffect(()=>{try{localStorage.setItem(Uh,JSON.stringify({dashboards:ho(m),activeDashboardId:y,autoRefreshInterval:X}))}catch{}},[m,y,X]);const jl=N.useCallback(_=>{S(G=>G.map(F=>F.id===y?{...F,panels:F.panels.map(I=>_[String(I.id)]?{...I,gridPos:_[String(I.id)]}:I)}:F))},[y]),En=_=>(ya(_.sourceType)?`${_.instanceLabel} `:"")+_.displayName,Ke={background:"var(--bg)",border:"1px solid var(--border)",borderRadius:6,padding:"10px 12px",color:"var(--text)",fontFamily:"inherit",fontSize:13,outline:"none",width:"100%"};return h.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",background:"var(--bg)"},children:[h.jsxs("div",{style:{display:"flex",alignItems:"stretch",borderBottom:"1px solid var(--border)",background:"var(--panel)",minHeight:40},children:[h.jsx("div",{style:{display:"flex",alignItems:"center",padding:"0 16px",borderRight:"1px solid var(--border)",flexShrink:0},children:h.jsx("span",{style:{fontWeight:700,fontSize:14,color:"var(--cyan)"},children:"mdash"})}),h.jsx("div",{style:{display:"flex",alignItems:"stretch",overflowX:"auto"},children:m.map(_=>h.jsxs("div",{onClick:()=>x(_.id),style:{display:"flex",alignItems:"center",gap:6,padding:"0 14px",cursor:"pointer",fontSize:12,borderRight:"1px solid var(--border)",background:_.id===y?"var(--bg)":"transparent",borderBottom:_.id===y?"2px solid var(--cyan)":"2px solid transparent",color:_.id===y?"var(--text)":"var(--text-dim)",transition:"all 0.1s",whiteSpace:"nowrap",flexShrink:0},children:[at===_.id?h.jsx("input",{autoFocus:!0,defaultValue:_.name,onClick:G=>G.stopPropagation(),onFocus:G=>G.target.select(),onBlur:G=>{ge(_.id,G.target.value),Et(null)},onKeyDown:G=>{G.key==="Enter"?(ge(_.id,G.target.value),Et(null)):G.key==="Escape"&&Et(null)},style:{background:"transparent",border:"1px solid var(--cyan)",borderRadius:3,color:"inherit",fontFamily:"inherit",fontSize:"inherit",padding:"1px 4px",outline:"none",width:Math.max(60,_.name.length*7.5)}}):h.jsx("span",{onDoubleClick:G=>{G.stopPropagation(),Et(_.id)},children:_.name}),_.panels.length>0&&h.jsx("span",{style:{fontSize:9,color:"var(--text-dim)",background:"rgba(255,255,255,0.06)",padding:"1px 4px",borderRadius:3},children:_.panels.length}),m.length>1&&h.jsx("button",{onClick:G=>tl(_.id,G),style:{background:"none",border:"none",color:"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:13,padding:"0 2px",lineHeight:1,borderRadius:3},onMouseEnter:G=>{G.target.style.color="var(--red)",G.target.style.background="var(--red-bg)"},onMouseLeave:G=>{G.target.style.color="var(--text-dim)",G.target.style.background="none"},children:"x"})]},_.id))}),h.jsx("button",{onClick:li,style:{background:"none",border:"none",borderLeft:"1px solid var(--border)",color:"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:16,padding:"0 12px",flexShrink:0,lineHeight:1},onMouseEnter:_=>{_.target.style.color="var(--text)"},onMouseLeave:_=>{_.target.style.color="var(--text-dim)"},title:"New dashboard",children:"+"}),h.jsx("div",{style:{flex:1}}),qt&&Ft.length>0&&h.jsx("div",{style:{display:"flex",alignItems:"center",paddingLeft:10,flexShrink:0},children:h.jsxs("button",{onClick:()=>Js(y),title:qt.locked?"Unlock layout (allow moving panels)":"Lock layout (prevent moving panels)",style:{background:qt.locked?"rgba(250, 204, 21, 0.08)":"none",border:"1px solid",borderColor:qt.locked?"var(--yellow)":"var(--border)",borderRadius:4,color:qt.locked?"var(--yellow)":"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:11,padding:"3px 10px",lineHeight:1,display:"flex",alignItems:"center",gap:5,transition:"all 0.15s"},onMouseEnter:_=>{qt.locked||(_.currentTarget.style.color="var(--text)",_.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:_=>{qt.locked||(_.currentTarget.style.color="var(--text-dim)",_.currentTarget.style.borderColor="var(--border)")},children:[h.jsx("span",{style:{fontSize:12},children:qt.locked?"🔒":"🔓"}),qt.locked?"Locked":"Unlocked"]})}),h.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",flexShrink:0},ref:xn,children:[h.jsx("input",{ref:bn,type:"file",accept:".json",style:{display:"none"},onChange:$s}),h.jsx("button",{onClick:()=>Ve(_=>!_),title:"Import / Export dashboards",style:{background:"none",border:"1px solid var(--border)",borderRadius:4,color:"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:11,padding:"3px 10px",lineHeight:1,display:"flex",alignItems:"center",gap:4},onMouseEnter:_=>{_.currentTarget.style.color="var(--text)",_.currentTarget.style.borderColor="var(--text-dim)"},onMouseLeave:_=>{_.currentTarget.style.color="var(--text-dim)",_.currentTarget.style.borderColor="var(--border)"},children:"Config"}),Mi&&h.jsxs("div",{style:{position:"absolute",top:"100%",right:0,marginTop:4,background:"var(--panel)",border:"1px solid var(--border)",borderRadius:6,minWidth:200,zIndex:200,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},children:[qt&&h.jsx(go,{label:`Export "${qt.name}"`,onClick:Sn}),m.length>0&&h.jsx(go,{label:"Export all dashboards",onClick:ii}),h.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"2px 0"}}),h.jsx(go,{label:"Import from file...",onClick:()=>{var _;return(_=bn.current)==null?void 0:_.click()}})]})]}),qt&&h.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",flexShrink:0},ref:rt,children:[h.jsx("button",{onClick:()=>{bt(!nt),Ut("type"),V(null),q(null)},style:{background:"none",border:"1px solid var(--border)",borderRadius:4,color:"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:11,padding:"3px 10px",lineHeight:1,display:"flex",alignItems:"center",gap:4},onMouseEnter:_=>{_.currentTarget.style.color="var(--text)",_.currentTarget.style.borderColor="var(--text-dim)"},onMouseLeave:_=>{_.currentTarget.style.color="var(--text-dim)",_.currentTarget.style.borderColor="var(--border)"},children:"+ Panel"}),nt&&h.jsx(Wp,{pickerStage:mt,pickerType:R,pickerInstance:P,instancesOfType:yn,handlePickType:Ea,handlePickInstance:Ze,setShowSourcePicker:bt,setShowConnectForm:j,setPickerStage:Ut,setPickerType:V,setPickerInstance:q,pgTablesCache:Y,s3BucketsCache:K,instances:d,activePanels:Ft,addPgPanel:va,addS3Panel:ba})]}),h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,paddingRight:16,paddingLeft:10,flexShrink:0},ref:At,children:[Ft.some(_=>_.loading)&&h.jsx("span",{style:{color:"var(--yellow)",fontSize:11},children:"loading..."}),Ft.length>0&&h.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",gap:0},children:[h.jsxs("button",{onClick:se,title:"Refresh all panels",style:{background:X?"rgba(34, 211, 238, 0.08)":"none",border:"1px solid",borderColor:X?"var(--cyan)":"var(--border)",borderRadius:"4px 0 0 4px",padding:"3px 8px",color:X?"var(--cyan)":"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:11,lineHeight:1,display:"flex",alignItems:"center",gap:4},onMouseEnter:_=>{X||(_.currentTarget.style.color="var(--text)",_.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:_=>{X||(_.currentTarget.style.color="var(--text-dim)",_.currentTarget.style.borderColor="var(--border)")},children:[h.jsx("span",{style:{fontSize:13,...X?{animation:"spin 2s linear infinite"}:{}},children:"↻"}),X?`${X}m`:"all"]}),h.jsx("button",{onClick:()=>H(_=>!_),title:"Auto-refresh options",style:{background:X?"rgba(34, 211, 238, 0.08)":"none",border:"1px solid",borderColor:X?"var(--cyan)":"var(--border)",borderLeft:"none",borderRadius:"0 4px 4px 0",padding:"3px 5px",color:X?"var(--cyan)":"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:8,lineHeight:1,display:"flex",alignItems:"center"},onMouseEnter:_=>{X||(_.currentTarget.style.color="var(--text)",_.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:_=>{X||(_.currentTarget.style.color="var(--text-dim)",_.currentTarget.style.borderColor="var(--border)")},children:"▼"}),yt&&h.jsxs("div",{style:{position:"absolute",top:"100%",right:0,marginTop:4,background:"var(--panel)",border:"1px solid var(--border)",borderRadius:6,minWidth:180,zIndex:200,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},children:[h.jsx(Ls,{label:"Refresh now",hint:"↻",onClick:()=>{se(),H(!1)}}),h.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"2px 0"}}),h.jsx(Ls,{label:"Every 1 min",active:X===1,onClick:()=>{st(X===1?null:1),H(!1)}}),h.jsx(Ls,{label:"Every 5 min",active:X===5,onClick:()=>{st(X===5?null:5),H(!1)}}),h.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"2px 0"}}),h.jsxs("div",{style:{padding:"6px 12px",display:"flex",alignItems:"center",gap:6},children:[h.jsx("span",{style:{fontSize:11,color:"var(--text-dim)",whiteSpace:"nowrap"},children:"Every"}),h.jsx("input",{type:"number",min:"1",value:k,onChange:_=>et(_.target.value),onKeyDown:_=>{if(_.key==="Enter"){const G=parseInt(k,10);G>0&&(st(G),H(!1),et(""))}},placeholder:"N",style:{background:"var(--bg)",border:"1px solid var(--border)",borderRadius:3,padding:"3px 6px",color:"var(--text)",fontFamily:"inherit",fontSize:11,outline:"none",width:44,textAlign:"center"},autoFocus:!0}),h.jsx("span",{style:{fontSize:11,color:"var(--text-dim)"},children:"min"}),h.jsx("button",{onClick:()=>{const _=parseInt(k,10);_>0&&(st(_),H(!1),et(""))},style:{background:"none",border:"1px solid var(--border)",borderRadius:3,padding:"2px 8px",color:"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:10},children:"Set"})]}),X&&h.jsxs(h.Fragment,{children:[h.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"2px 0"}}),h.jsx(Ls,{label:"Turn off auto-refresh",hint:"✕",onClick:()=>{st(null),H(!1),et("")}})]})]})]})]})]}),o&&h.jsxs("div",{style:{padding:"8px 20px",background:"var(--red-bg)",borderBottom:"1px solid var(--red)",color:"var(--red)",fontSize:12,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsx("span",{children:o}),h.jsx("button",{onClick:()=>f(null),style:{background:"none",border:"none",color:"var(--red)",cursor:"pointer",fontFamily:"inherit",fontSize:14},children:"x"})]}),h.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[b&&h.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},children:h.jsxs("div",{style:{background:"var(--panel)",border:"1px solid var(--border)",borderRadius:8,padding:"32px 40px",display:"flex",flexDirection:"column",gap:12,minWidth:420},children:[b==="postgres"&&h.jsxs(h.Fragment,{children:[h.jsx("span",{style:{color:"var(--text)",fontSize:14,fontWeight:600},children:"Connect to PostgreSQL"}),h.jsx("input",{type:"text",value:St,onChange:_=>Qt(_.target.value),onKeyDown:_=>{_.key==="Enter"&&St.trim()&&Ai()},placeholder:"postgresql://user:password@host:5432/dbname",style:Ke,autoFocus:!0}),h.jsx("input",{type:"text",value:vt,onChange:_=>Al(_.target.value),placeholder:"Label (optional, e.g. prod, staging)",style:Ke}),h.jsxs("div",{style:{display:"flex",gap:8},children:[h.jsx("button",{onClick:Ai,disabled:ve||!St.trim(),style:{background:"var(--purple)",border:"none",borderRadius:6,padding:"10px 16px",color:"#fff",fontFamily:"inherit",fontSize:13,fontWeight:600,cursor:ve?"wait":"pointer",opacity:ve||!St.trim()?.5:1,flex:1},children:ve?"Connecting...":"Connect"}),h.jsx("button",{onClick:()=>j(null),style:{background:"none",border:"1px solid var(--border)",borderRadius:6,padding:"10px 16px",color:"var(--text-dim)",fontFamily:"inherit",fontSize:13,cursor:"pointer"},children:"Cancel"})]})]}),b==="redis"&&h.jsxs(h.Fragment,{children:[h.jsx("span",{style:{color:"var(--text)",fontSize:14,fontWeight:600},children:"Connect to Redis"}),h.jsx("input",{type:"text",value:Ie,onChange:_=>bi(_.target.value),onKeyDown:_=>{_.key==="Enter"&&Ie.trim()&&ji()},placeholder:"redis://localhost:6379",style:Ke,autoFocus:!0}),h.jsx("input",{type:"text",value:mn,onChange:_=>Pe(_.target.value),placeholder:"Label (optional, e.g. cache, sessions)",style:Ke}),h.jsxs("div",{style:{display:"flex",gap:8},children:[h.jsx("button",{onClick:ji,disabled:ve||!Ie.trim(),style:{background:"var(--red)",border:"none",borderRadius:6,padding:"10px 16px",color:"#fff",fontFamily:"inherit",fontSize:13,fontWeight:600,cursor:ve?"wait":"pointer",opacity:ve||!Ie.trim()?.5:1,flex:1},children:ve?"Connecting...":"Connect"}),h.jsx("button",{onClick:()=>j(null),style:{background:"none",border:"1px solid var(--border)",borderRadius:6,padding:"10px 16px",color:"var(--text-dim)",fontFamily:"inherit",fontSize:13,cursor:"pointer"},children:"Cancel"})]})]}),b==="s3"&&h.jsxs(h.Fragment,{children:[h.jsx("span",{style:{color:"var(--text)",fontSize:14,fontWeight:600},children:"Connect to S3"}),h.jsx("input",{type:"text",value:Si,onChange:_=>Ei(_.target.value),placeholder:"Endpoint URL (e.g. http://localhost:9000)",style:Ke,autoFocus:!0}),h.jsx("input",{type:"text",value:ga,onChange:_=>pn(_.target.value),placeholder:"Access Key ID",style:Ke}),h.jsx("input",{type:"password",value:_i,onChange:_=>zi(_.target.value),placeholder:"Secret Access Key",style:Ke}),h.jsx("input",{type:"text",value:Ci,onChange:_=>ma(_.target.value),placeholder:"Region (default: us-east-1)",style:Ke}),h.jsx("input",{type:"text",value:pa,onChange:_=>he(_.target.value),placeholder:"Label (optional, e.g. prod, logs)",style:Ke}),h.jsxs("div",{style:{display:"flex",gap:8},children:[h.jsx("button",{onClick:Sa,disabled:ve,style:{background:"var(--orange)",border:"none",borderRadius:6,padding:"10px 16px",color:"#fff",fontFamily:"inherit",fontSize:13,fontWeight:600,cursor:ve?"wait":"pointer",opacity:ve?.5:1,flex:1},children:ve?"Connecting...":"Connect"}),h.jsx("button",{onClick:()=>j(null),style:{background:"none",border:"1px solid var(--border)",borderRadius:6,padding:"10px 16px",color:"var(--text-dim)",fontFamily:"inherit",fontSize:13,cursor:"pointer"},children:"Cancel"})]})]})]})}),!b&&qt&&Ft.length>0&&h.jsx(kp,{ref:Q,panels:Ft,locked:qt.locked,focusPanelId:v,focusCounter:Z,SOURCE_CONFIG:Xs,panelDisplayName:En,onPanelClose:Ks,onToggleFilters:Ws,onLayoutChange:jl,onViewModeChange:Ti,onCopyPanel:wi,onChartTypeChange:Ri,renderPanel:_=>{const G=qt.locked;return _.sourceType==="postgres"?h.jsx(Ep,{tab:_,updateTab:F=>vn(_.id,F),pageSize:a,setError:f,refreshKey:J,locked:G},_.id):_.sourceType==="redis"?h.jsx(Rp,{tab:_,updateTab:F=>vn(_.id,F),pageSize:a,setError:f,refreshKey:J,locked:G},_.id):_.sourceType==="s3"?h.jsx(Ap,{tab:_,updateTab:F=>vn(_.id,F),pageSize:a,setError:f,refreshKey:J,locked:G},_.id):null}},y),!b&&!qt&&h.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-dim)",flexDirection:"column",gap:8},children:h.jsx("span",{children:"Click + to create a dashboard"})}),!b&&qt&&Ft.length===0&&h.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-dim)",flexDirection:"column",gap:12},children:[h.jsx("span",{style:{fontSize:14},children:qt.name}),h.jsxs("span",{children:["Click ",h.jsx("strong",{children:"+ Panel"})," to add a data source"]}),!Zs&&h.jsx("span",{style:{fontSize:11},children:"Connect to PostgreSQL, Redis, or S3 to get started"})]})]})]})}function Wp({pickerStage:d,pickerType:n,pickerInstance:a,instancesOfType:u,handlePickType:o,handlePickInstance:f,setShowSourcePicker:g,setShowConnectForm:m,setPickerStage:S,setPickerType:y,setPickerInstance:x,pgTablesCache:v,s3BucketsCache:C,instances:Z,activePanels:$,addPgPanel:J,addS3Panel:ot}){var at,Et;return h.jsxs("div",{style:{position:"absolute",top:"100%",right:0,marginTop:4,background:"var(--panel)",border:"1px solid var(--border)",borderRadius:6,minWidth:240,maxHeight:400,overflowY:"auto",zIndex:200,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},children:[d==="type"&&h.jsxs(h.Fragment,{children:[h.jsx(mo,{typeKey:"postgres",label:"PostgreSQL",badge:"PG",connected:u("postgres"),onClick:()=>o("postgres"),onConnect:()=>{g(!1),m("postgres")}}),h.jsx(mo,{typeKey:"redis",label:"Redis",badge:"RD",connected:u("redis"),onClick:()=>o("redis"),onConnect:()=>{g(!1),m("redis")}}),h.jsx(mo,{typeKey:"s3",label:"S3",badge:"S3",connected:u("s3"),onClick:()=>o("s3"),onConnect:()=>{g(!1),m("s3")}})]}),d==="instance"&&n&&h.jsxs(h.Fragment,{children:[h.jsx("div",{onClick:()=>{S("type"),y(null)},style:{padding:"6px 12px",cursor:"pointer",fontSize:11,color:"var(--text-dim)",borderBottom:"1px solid var(--border)"},onMouseEnter:X=>{X.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:X=>{X.currentTarget.style.background="transparent"},children:"◀ Back"}),u(n).map(X=>h.jsxs("div",{onClick:()=>f(X),style:{padding:"8px 12px",cursor:"pointer",fontSize:12,display:"flex",alignItems:"center",gap:8,color:"var(--text)"},onMouseEnter:st=>{st.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:st=>{st.currentTarget.style.background="transparent"},children:[h.jsx("span",{style:{color:Xs[n].color,fontWeight:600,fontSize:10},children:Xs[n].label}),h.jsx("span",{children:X.label}),n!=="redis"&&h.jsx("span",{style:{color:"var(--text-dim)",fontSize:10,marginLeft:"auto"},children:"▶"})]},X.id)),h.jsx("div",{onClick:()=>{g(!1),m(n)},style:{padding:"8px 12px",cursor:"pointer",fontSize:12,color:"var(--text-dim)",borderTop:"1px solid var(--border)"},onMouseEnter:X=>{X.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:X=>{X.currentTarget.style.background="transparent"},children:"+ Connect new..."})]}),d==="target"&&a&&h.jsxs(h.Fragment,{children:[h.jsx("div",{onClick:()=>{u(n).length>1?(S("instance"),x(null)):(S("type"),y(null),x(null))},style:{padding:"6px 12px",cursor:"pointer",fontSize:11,color:"var(--text-dim)",borderBottom:"1px solid var(--border)"},onMouseEnter:X=>{X.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:X=>{X.currentTarget.style.background="transparent"},children:"◀ Back"}),n==="postgres"&&h.jsxs(h.Fragment,{children:[(v[a]||[]).map(X=>{const st=Z.find(H=>H.id===a),yt=$.some(H=>H.sourceType==="postgres"&&H.instanceId===a&&H.schema===X.schema&&H.name===X.name);return h.jsxs("div",{onClick:()=>J(a,(st==null?void 0:st.label)||a,X.schema,X.name),style:{padding:"8px 12px",cursor:"pointer",fontSize:12,display:"flex",justifyContent:"space-between",alignItems:"center",color:yt?"var(--text-dim)":"var(--text)"},onMouseEnter:H=>{H.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:H=>{H.currentTarget.style.background="transparent"},children:[h.jsxs("span",{children:[X.schema,".",X.name]}),yt&&h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:"open"})]},`${X.schema}.${X.name}`)}),!v[a]&&h.jsx("div",{style:{padding:"12px",fontSize:12,color:"var(--text-dim)"},children:"Loading tables..."}),((at=v[a])==null?void 0:at.length)===0&&h.jsx("div",{style:{padding:"12px",fontSize:12,color:"var(--text-dim)"},children:"No tables found"})]}),n==="s3"&&h.jsxs(h.Fragment,{children:[(C[a]||[]).map(X=>{const st=Z.find(H=>H.id===a),yt=$.some(H=>H.sourceType==="s3"&&H.instanceId===a&&H.bucket===X.name);return h.jsxs("div",{onClick:()=>ot(a,(st==null?void 0:st.label)||a,X.name),style:{padding:"8px 12px",cursor:"pointer",fontSize:12,display:"flex",justifyContent:"space-between",alignItems:"center",color:yt?"var(--text-dim)":"var(--text)"},onMouseEnter:H=>{H.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:H=>{H.currentTarget.style.background="transparent"},children:[h.jsx("span",{children:X.name}),yt&&h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:"open"})]},X.name)}),!C[a]&&h.jsx("div",{style:{padding:"12px",fontSize:12,color:"var(--text-dim)"},children:"Loading buckets..."}),((Et=C[a])==null?void 0:Et.length)===0&&h.jsx("div",{style:{padding:"12px",fontSize:12,color:"var(--text-dim)"},children:"No buckets found"})]})]})]})}function Ls({label:d,hint:n,active:a,onClick:u}){return h.jsxs("div",{onClick:u,style:{padding:"7px 12px",cursor:"pointer",fontSize:12,display:"flex",justifyContent:"space-between",alignItems:"center",color:a?"var(--cyan)":"var(--text)"},onMouseEnter:o=>{o.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:o=>{o.currentTarget.style.background="transparent"},children:[h.jsx("span",{children:d}),n&&h.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:n}),a&&h.jsx("span",{style:{fontSize:10,color:"var(--cyan)"},children:"●"})]})}function go({label:d,onClick:n}){return h.jsx("div",{onClick:n,style:{padding:"7px 12px",cursor:"pointer",fontSize:12,color:"var(--text)"},onMouseEnter:a=>{a.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:d})}function mo({typeKey:d,label:n,badge:a,connected:u,onClick:o,onConnect:f}){const g=Xs[d];return u.length>0?h.jsxs("div",{onClick:o,style:{padding:"8px 12px",cursor:"pointer",fontSize:12,display:"flex",alignItems:"center",gap:8},onMouseEnter:m=>{m.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:m=>{m.currentTarget.style.background="transparent"},children:[h.jsx("span",{style:{color:g.color,fontWeight:600,fontSize:10},children:a}),h.jsxs("span",{style:{color:"var(--text)"},children:[n,u.length>1&&h.jsxs("span",{style:{color:"var(--text-dim)",fontSize:10,marginLeft:4},children:["(",u.length,")"]})]}),h.jsx("span",{style:{color:"var(--text-dim)",fontSize:10,marginLeft:"auto"},children:"▶"})]}):h.jsxs("div",{onClick:f,style:{padding:"8px 12px",cursor:"pointer",fontSize:12,display:"flex",alignItems:"center",gap:8},onMouseEnter:m=>{m.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:m=>{m.currentTarget.style.background="transparent"},children:[h.jsx("span",{style:{color:g.color,fontWeight:600,fontSize:10},children:a}),h.jsxs("span",{style:{color:"var(--text-dim)"},children:["Connect ",n,"..."]})]})}ip.createRoot(document.getElementById("root")).render(h.jsx($m.StrictMode,{children:h.jsx(Jp,{})}));
