(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const g of c.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&r(g)}).observe(document,{childList:!0,subtree:!0});function a(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(o){if(o.ep)return;o.ep=!0;const c=a(o);fetch(o.href,c)}})();function Uh(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}var go={exports:{}},ma={};/**
 * @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 gh;function Wm(){if(gh)return ma;gh=1;var h=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(r,o,c){var g=null;if(c!==void 0&&(g=""+c),o.key!==void 0&&(g=""+o.key),"key"in o){c={};for(var m in o)m!=="key"&&(c[m]=o[m])}else c=o;return o=c.ref,{$$typeof:h,type:r,key:g,ref:o!==void 0?o:null,props:c}}return ma.Fragment=n,ma.jsx=a,ma.jsxs=a,ma}var mh;function $m(){return mh||(mh=1,go.exports=Wm()),go.exports}var d=$m(),mo={exports:{}},_e={};/**
 * @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 ph;function Fm(){if(ph)return _e;ph=1;var h=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=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"),b=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),T=Symbol.iterator;function Z(_){return _===null||typeof _!="object"?null:(_=T&&_[T]||_["@@iterator"],typeof _=="function"?_:null)}var K={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$=Object.assign,ae={};function me(_,k,w){this.props=_,this.context=k,this.refs=ae,this.updater=w||K}me.prototype.isReactComponent={},me.prototype.setState=function(_,k){if(typeof _!="object"&&typeof _!="function"&&_!=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,_,k,"setState")},me.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function he(){}he.prototype=me.prototype;function Q(_,k,w){this.props=_,this.context=k,this.refs=ae,this.updater=w||K}var se=Q.prototype=new he;se.constructor=Q,$(se,me.prototype),se.isPureReactComponent=!0;var ye=Array.isArray;function H(){}var G={H:null,A:null,T:null,S:null},re=Object.prototype.hasOwnProperty;function de(_,k,w){var V=w.ref;return{$$typeof:h,type:_,key:k,ref:V!==void 0?V:null,props:w}}function Oe(_,k){return de(_.type,k,_.props)}function F(_){return typeof _=="object"&&_!==null&&_.$$typeof===h}function ve(_){var k={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(w){return k[w]})}var W=/\/+/g;function ee(_,k){return typeof _=="object"&&_!==null&&_.key!=null?ve(""+_.key):k.toString(36)}function Se(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(H,H):(_.status="pending",_.then(function(k){_.status==="pending"&&(_.status="fulfilled",_.value=k)},function(k){_.status==="pending"&&(_.status="rejected",_.reason=k)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function C(_,k,w,V,I){var te=typeof _;(te==="undefined"||te==="boolean")&&(_=null);var le=!1;if(_===null)le=!0;else switch(te){case"bigint":case"string":case"number":le=!0;break;case"object":switch(_.$$typeof){case h:case n:le=!0;break;case b:return le=_._init,C(le(_._payload),k,w,V,I)}}if(le)return I=I(_),le=V===""?"."+ee(_,0):V,ye(I)?(w="",le!=null&&(w=le.replace(W,"$&/")+"/"),C(I,k,w,"",function(Fe){return Fe})):I!=null&&(F(I)&&(I=Oe(I,w+(I.key==null||_&&_.key===I.key?"":(""+I.key).replace(W,"$&/")+"/")+le)),k.push(I)),1;le=0;var Te=V===""?".":V+":";if(ye(_))for(var Re=0;Re<_.length;Re++)V=_[Re],te=Te+ee(V,Re),le+=C(V,k,w,te,I);else if(Re=Z(_),typeof Re=="function")for(_=Re.call(_),Re=0;!(V=_.next()).done;)V=V.value,te=Te+ee(V,Re++),le+=C(V,k,w,te,I);else if(te==="object"){if(typeof _.then=="function")return C(Se(_),k,w,V,I);throw k=String(_),Error("Objects are not valid as a React child (found: "+(k==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}return le}function X(_,k,w){if(_==null)return _;var V=[],I=0;return C(_,V,"","",function(te){return k.call(w,te,I++)}),V}function B(_){if(_._status===-1){var k=_._result;k=k(),k.then(function(w){(_._status===0||_._status===-1)&&(_._status=1,_._result=w)},function(w){(_._status===0||_._status===-1)&&(_._status=2,_._result=w)}),_._status===-1&&(_._status=0,_._result=k)}if(_._status===1)return _._result.default;throw _._result}var ie=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var k=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(k))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},Ee={map:X,forEach:function(_,k,w){X(_,function(){k.apply(this,arguments)},w)},count:function(_){var k=0;return X(_,function(){k++}),k},toArray:function(_){return X(_,function(k){return k})||[]},only:function(_){if(!F(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return _e.Activity=v,_e.Children=Ee,_e.Component=me,_e.Fragment=a,_e.Profiler=o,_e.PureComponent=Q,_e.StrictMode=r,_e.Suspense=S,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=G,_e.__COMPILER_RUNTIME={__proto__:null,c:function(_){return G.H.useMemoCache(_)}},_e.cache=function(_){return function(){return _.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(_,k,w){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var V=$({},_.props),I=_.key;if(k!=null)for(te in k.key!==void 0&&(I=""+k.key),k)!re.call(k,te)||te==="key"||te==="__self"||te==="__source"||te==="ref"&&k.ref===void 0||(V[te]=k[te]);var te=arguments.length-2;if(te===1)V.children=w;else if(1<te){for(var le=Array(te),Te=0;Te<te;Te++)le[Te]=arguments[Te+2];V.children=le}return de(_.type,I,V)},_e.createContext=function(_){return _={$$typeof:g,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:c,_context:_},_},_e.createElement=function(_,k,w){var V,I={},te=null;if(k!=null)for(V in k.key!==void 0&&(te=""+k.key),k)re.call(k,V)&&V!=="key"&&V!=="__self"&&V!=="__source"&&(I[V]=k[V]);var le=arguments.length-2;if(le===1)I.children=w;else if(1<le){for(var Te=Array(le),Re=0;Re<le;Re++)Te[Re]=arguments[Re+2];I.children=Te}if(_&&_.defaultProps)for(V in le=_.defaultProps,le)I[V]===void 0&&(I[V]=le[V]);return de(_,te,I)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(_){return{$$typeof:m,render:_}},_e.isValidElement=F,_e.lazy=function(_){return{$$typeof:b,_payload:{_status:-1,_result:_},_init:B}},_e.memo=function(_,k){return{$$typeof:y,type:_,compare:k===void 0?null:k}},_e.startTransition=function(_){var k=G.T,w={};G.T=w;try{var V=_(),I=G.S;I!==null&&I(w,V),typeof V=="object"&&V!==null&&typeof V.then=="function"&&V.then(H,ie)}catch(te){ie(te)}finally{k!==null&&w.types!==null&&(k.types=w.types),G.T=k}},_e.unstable_useCacheRefresh=function(){return G.H.useCacheRefresh()},_e.use=function(_){return G.H.use(_)},_e.useActionState=function(_,k,w){return G.H.useActionState(_,k,w)},_e.useCallback=function(_,k){return G.H.useCallback(_,k)},_e.useContext=function(_){return G.H.useContext(_)},_e.useDebugValue=function(){},_e.useDeferredValue=function(_,k){return G.H.useDeferredValue(_,k)},_e.useEffect=function(_,k){return G.H.useEffect(_,k)},_e.useEffectEvent=function(_){return G.H.useEffectEvent(_)},_e.useId=function(){return G.H.useId()},_e.useImperativeHandle=function(_,k,w){return G.H.useImperativeHandle(_,k,w)},_e.useInsertionEffect=function(_,k){return G.H.useInsertionEffect(_,k)},_e.useLayoutEffect=function(_,k){return G.H.useLayoutEffect(_,k)},_e.useMemo=function(_,k){return G.H.useMemo(_,k)},_e.useOptimistic=function(_,k){return G.H.useOptimistic(_,k)},_e.useReducer=function(_,k,w){return G.H.useReducer(_,k,w)},_e.useRef=function(_){return G.H.useRef(_)},_e.useState=function(_){return G.H.useState(_)},_e.useSyncExternalStore=function(_,k,w){return G.H.useSyncExternalStore(_,k,w)},_e.useTransition=function(){return G.H.useTransition()},_e.version="19.2.4",_e}var yh;function zo(){return yh||(yh=1,mo.exports=Fm()),mo.exports}var D=zo();const Im=Uh(D);var po={exports:{}},pa={},yo={exports:{}},vo={};/**
 * @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 vh;function Pm(){return vh||(vh=1,(function(h){function n(C,X){var B=C.length;C.push(X);e:for(;0<B;){var ie=B-1>>>1,Ee=C[ie];if(0<o(Ee,X))C[ie]=X,C[B]=Ee,B=ie;else break e}}function a(C){return C.length===0?null:C[0]}function r(C){if(C.length===0)return null;var X=C[0],B=C.pop();if(B!==X){C[0]=B;e:for(var ie=0,Ee=C.length,_=Ee>>>1;ie<_;){var k=2*(ie+1)-1,w=C[k],V=k+1,I=C[V];if(0>o(w,B))V<Ee&&0>o(I,w)?(C[ie]=I,C[V]=B,ie=V):(C[ie]=w,C[k]=B,ie=k);else if(V<Ee&&0>o(I,B))C[ie]=I,C[V]=B,ie=V;else break e}}return X}function o(C,X){var B=C.sortIndex-X.sortIndex;return B!==0?B:C.id-X.id}if(h.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;h.unstable_now=function(){return c.now()}}else{var g=Date,m=g.now();h.unstable_now=function(){return g.now()-m}}var S=[],y=[],b=1,v=null,T=3,Z=!1,K=!1,$=!1,ae=!1,me=typeof setTimeout=="function"?setTimeout:null,he=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function se(C){for(var X=a(y);X!==null;){if(X.callback===null)r(y);else if(X.startTime<=C)r(y),X.sortIndex=X.expirationTime,n(S,X);else break;X=a(y)}}function ye(C){if($=!1,se(C),!K)if(a(S)!==null)K=!0,H||(H=!0,ve());else{var X=a(y);X!==null&&Se(ye,X.startTime-C)}}var H=!1,G=-1,re=5,de=-1;function Oe(){return ae?!0:!(h.unstable_now()-de<re)}function F(){if(ae=!1,H){var C=h.unstable_now();de=C;var X=!0;try{e:{K=!1,$&&($=!1,he(G),G=-1),Z=!0;var B=T;try{t:{for(se(C),v=a(S);v!==null&&!(v.expirationTime>C&&Oe());){var ie=v.callback;if(typeof ie=="function"){v.callback=null,T=v.priorityLevel;var Ee=ie(v.expirationTime<=C);if(C=h.unstable_now(),typeof Ee=="function"){v.callback=Ee,se(C),X=!0;break t}v===a(S)&&r(S),se(C)}else r(S);v=a(S)}if(v!==null)X=!0;else{var _=a(y);_!==null&&Se(ye,_.startTime-C),X=!1}}break e}finally{v=null,T=B,Z=!1}X=void 0}}finally{X?ve():H=!1}}}var ve;if(typeof Q=="function")ve=function(){Q(F)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,ee=W.port2;W.port1.onmessage=F,ve=function(){ee.postMessage(null)}}else ve=function(){me(F,0)};function Se(C,X){G=me(function(){C(h.unstable_now())},X)}h.unstable_IdlePriority=5,h.unstable_ImmediatePriority=1,h.unstable_LowPriority=4,h.unstable_NormalPriority=3,h.unstable_Profiling=null,h.unstable_UserBlockingPriority=2,h.unstable_cancelCallback=function(C){C.callback=null},h.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):re=0<C?Math.floor(1e3/C):5},h.unstable_getCurrentPriorityLevel=function(){return T},h.unstable_next=function(C){switch(T){case 1:case 2:case 3:var X=3;break;default:X=T}var B=T;T=X;try{return C()}finally{T=B}},h.unstable_requestPaint=function(){ae=!0},h.unstable_runWithPriority=function(C,X){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var B=T;T=C;try{return X()}finally{T=B}},h.unstable_scheduleCallback=function(C,X,B){var ie=h.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?ie+B:ie):B=ie,C){case 1:var Ee=-1;break;case 2:Ee=250;break;case 5:Ee=1073741823;break;case 4:Ee=1e4;break;default:Ee=5e3}return Ee=B+Ee,C={id:b++,callback:X,priorityLevel:C,startTime:B,expirationTime:Ee,sortIndex:-1},B>ie?(C.sortIndex=B,n(y,C),a(S)===null&&C===a(y)&&($?(he(G),G=-1):$=!0,Se(ye,B-ie))):(C.sortIndex=Ee,n(S,C),K||Z||(K=!0,H||(H=!0,ve()))),C},h.unstable_shouldYield=Oe,h.unstable_wrapCallback=function(C){var X=T;return function(){var B=T;T=X;try{return C.apply(this,arguments)}finally{T=B}}}})(vo)),vo}var xh;function ep(){return xh||(xh=1,yo.exports=Pm()),yo.exports}var xo={exports:{}},zt={};/**
 * @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 bh;function tp(){if(bh)return zt;bh=1;var h=zo();function n(S){var y="https://react.dev/errors/"+S;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)y+="&args[]="+encodeURIComponent(arguments[b])}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 r={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 c(S,y,b){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:b}}var g=h.__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 zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,zt.createPortal=function(S,y){var b=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 c(S,y,null,b)},zt.flushSync=function(S){var y=g.T,b=r.p;try{if(g.T=null,r.p=2,S)return S()}finally{g.T=y,r.p=b,r.d.f()}},zt.preconnect=function(S,y){typeof S=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,r.d.C(S,y))},zt.prefetchDNS=function(S){typeof S=="string"&&r.d.D(S)},zt.preinit=function(S,y){if(typeof S=="string"&&y&&typeof y.as=="string"){var b=y.as,v=m(b,y.crossOrigin),T=typeof y.integrity=="string"?y.integrity:void 0,Z=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;b==="style"?r.d.S(S,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:v,integrity:T,fetchPriority:Z}):b==="script"&&r.d.X(S,{crossOrigin:v,integrity:T,fetchPriority:Z,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},zt.preinitModule=function(S,y){if(typeof S=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var b=m(y.as,y.crossOrigin);r.d.M(S,{crossOrigin:b,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&r.d.M(S)},zt.preload=function(S,y){if(typeof S=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var b=y.as,v=m(b,y.crossOrigin);r.d.L(S,b,{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})}},zt.preloadModule=function(S,y){if(typeof S=="string")if(y){var b=m(y.as,y.crossOrigin);r.d.m(S,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:b,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else r.d.m(S)},zt.requestFormReset=function(S){r.d.r(S)},zt.unstable_batchedUpdates=function(S,y){return S(y)},zt.useFormState=function(S,y,b){return g.H.useFormState(S,y,b)},zt.useFormStatus=function(){return g.H.useHostTransitionStatus()},zt.version="19.2.4",zt}var Sh;function Bh(){if(Sh)return xo.exports;Sh=1;function h(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(h)}catch(n){console.error(n)}}return h(),xo.exports=tp(),xo.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 Eh;function lp(){if(Eh)return pa;Eh=1;var h=ep(),n=zo(),a=Bh();function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function g(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function S(e){if(c(e)!==e)throw Error(r(188))}function y(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(r(188));return t!==e?null:e}for(var l=e,i=t;;){var s=l.return;if(s===null)break;var u=s.alternate;if(u===null){if(i=s.return,i!==null){l=i;continue}break}if(s.child===u.child){for(u=s.child;u;){if(u===l)return S(s),e;if(u===i)return S(s),t;u=u.sibling}throw Error(r(188))}if(l.return!==i.return)l=s,i=u;else{for(var f=!1,p=s.child;p;){if(p===l){f=!0,l=s,i=u;break}if(p===i){f=!0,i=s,l=u;break}p=p.sibling}if(!f){for(p=u.child;p;){if(p===l){f=!0,l=u,i=s;break}if(p===i){f=!0,i=u,l=s;break}p=p.sibling}if(!f)throw Error(r(189))}}if(l.alternate!==i)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,T=Symbol.for("react.element"),Z=Symbol.for("react.transitional.element"),K=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),ae=Symbol.for("react.strict_mode"),me=Symbol.for("react.profiler"),he=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),se=Symbol.for("react.forward_ref"),ye=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),re=Symbol.for("react.lazy"),de=Symbol.for("react.activity"),Oe=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function ve(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var W=Symbol.for("react.client.reference");function ee(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===W?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case $:return"Fragment";case me:return"Profiler";case ae:return"StrictMode";case ye:return"Suspense";case H:return"SuspenseList";case de:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case K:return"Portal";case Q:return e.displayName||"Context";case he:return(e._context.displayName||"Context")+".Consumer";case se:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return t=e.displayName||null,t!==null?t:ee(e.type)||"Memo";case re:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var Se=Array.isArray,C=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B={pending:!1,data:null,method:null,action:null},ie=[],Ee=-1;function _(e){return{current:e}}function k(e){0>Ee||(e.current=ie[Ee],ie[Ee]=null,Ee--)}function w(e,t){Ee++,ie[Ee]=e.current,e.current=t}var V=_(null),I=_(null),te=_(null),le=_(null);function Te(e,t){switch(w(te,t),w(I,e),w(V,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ld(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ld(t),e=Ud(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}k(V),w(V,e)}function Re(){k(V),k(I),k(te)}function Fe(e){e.memoizedState!==null&&w(le,e);var t=V.current,l=Ud(t,e.type);t!==l&&(w(I,e),w(V,l))}function gt(e){I.current===e&&(k(V),k(I)),le.current===e&&(k(le),fa._currentValue=B)}var Ot,ue;function Be(e){if(Ot===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);Ot=t&&t[1]||"",ue=-1<l.stack.indexOf(`
    at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Ot+e+ue}var Pt=!1;function hl(e,t){if(!e||Pt)return"";Pt=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(N){var A=N}Reflect.construct(e,[],Y)}else{try{Y.call()}catch(N){A=N}e.call(Y.prototype)}}else{try{throw Error()}catch(N){A=N}(Y=e())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(N){if(N&&A&&typeof N.stack=="string")return[N.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 u=i.DetermineComponentFrameRoot(),f=u[0],p=u[1];if(f&&p){var E=f.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 e.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",e.displayName)),L}while(1<=i&&0<=s);break}}}finally{Pt=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Be(l):""}function We(e,t){switch(e.tag){case 26:case 27:case 5:return Be(e.type);case 16:return Be("Lazy");case 13:return e.child!==t&&t!==null?Be("Suspense Fallback"):Be("Suspense");case 19:return Be("SuspenseList");case 0:case 15:return hl(e.type,!1);case 11:return hl(e.type.render,!1);case 1:return hl(e.type,!0);case 31:return Be("Activity");default:return""}}function xn(e){try{var t="",l=null;do t+=We(e,l),l=e,e=e.return;while(e);return t}catch(i){return`
Error generating stack: `+i.message+`
`+i.stack}}var Di=Object.prototype.hasOwnProperty,Oi=h.unstable_scheduleCallback,Ni=h.unstable_cancelCallback,ba=h.unstable_shouldYield,Sa=h.unstable_requestPaint,bt=h.unstable_now,oi=h.unstable_getCurrentPriorityLevel,bn=h.unstable_ImmediatePriority,Hl=h.unstable_UserBlockingPriority,ci=h.unstable_NormalPriority,Ea=h.unstable_LowPriority,Sn=h.unstable_IdlePriority,_a=h.log,za=h.unstable_setDisableYieldValue,Pe=null,et=null;function Ne(e){if(typeof _a=="function"&&za(e),et&&typeof et.setStrictMode=="function")try{et.setStrictMode(Pe,e)}catch{}}var Le=Math.clz32?Math.clz32:lr,En=Math.log,tr=Math.LN2;function lr(e){return e>>>=0,e===0?32:31-(En(e)/tr|0)|0}var kl=256,Hi=262144,fi=4194304;function gl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function sl(e,t,l){var i=e.pendingLanes;if(i===0)return 0;var s=0,u=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var p=i&134217727;return p!==0?(i=p&~u,i!==0?s=gl(i):(f&=p,f!==0?s=gl(f):l||(l=p&~e,l!==0&&(s=gl(l))))):(p=i&~u,p!==0?s=gl(p):f!==0?s=gl(f):l||(l=i&~e,l!==0&&(s=gl(l)))),s===0?0:t!==0&&t!==s&&(t&u)===0&&(u=s&-s,l=t&-t,u>=l||u===32&&(l&4194048)!==0)?t:s}function di(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ir(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Ca(){var e=fi;return fi<<=1,(fi&62914560)===0&&(fi=4194304),e}function _n(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function hi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function nr(e,t,l,i,s,u){var f=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var p=e.entanglements,E=e.expirationTimes,M=e.hiddenUpdates;for(l=f&~l;0<l;){var L=31-Le(l),Y=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 N=A[L];N!==null&&(N.lane&=-536870913)}l&=~Y}i!==0&&Ta(e,i,0),u!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=u&~(f&~t))}function Ta(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Le(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|l&261930}function zn(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var i=31-Le(l),s=1<<i;s&t|e[i]&t&&(e[i]|=t),l&=~s}}function Ra(e,t){var l=t&-t;return l=(l&42)!==0?1:ml(l),(l&(e.suspendedLanes|t))!==0?0:l}function ml(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function gi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Cn(){var e=X.p;return e!==0?e:(e=window.event,e===void 0?32:rh(e.type))}function wa(e,t){var l=X.p;try{return X.p=e,t()}finally{X.p=l}}var rl=Math.random().toString(36).slice(2),ct="__reactFiber$"+rl,St="__reactProps$"+rl,Ll="__reactContainer$"+rl,Tn="__reactEvents$"+rl,ja="__reactListeners$"+rl,Ma="__reactHandles$"+rl,Aa="__reactResources$"+rl,Ul="__reactMarker$"+rl;function Rn(e){delete e[ct],delete e[St],delete e[Tn],delete e[ja],delete e[Ma]}function pl(e){var t=e[ct];if(t)return t;for(var l=e.parentNode;l;){if(t=l[Ll]||l[ct]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Vd(e);e!==null;){if(l=e[ct])return l;e=Vd(e)}return t}e=l,l=e.parentNode}return null}function el(e){if(e=e[ct]||e[Ll]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ul(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function Bl(e){var t=e[Aa];return t||(t=e[Aa]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function at(e){e[Ul]=!0}var Et=new Set,x={};function U(e,t){J(e,t),J(e+"Capture",t)}function J(e,t){for(x[e]=t,e=0;e<t.length;e++)Et.add(t[e])}var P=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]*$"),xe={},Ie={};function be(e){return Di.call(Ie,e)?!0:Di.call(xe,e)?!1:P.test(e)?Ie[e]=!0:(xe[e]=!0,!1)}function Ve(e,t,l){if(be(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function mt(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function _t(e,t,l,i){if(i===null)e.removeAttribute(l);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+i)}}function ft(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ki(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ar(e,t,l){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var s=i.get,u=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(f){l=""+f,u.call(this,f)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(f){l=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function sr(e){if(!e._valueTracker){var t=ki(e)?"checked":"value";e._valueTracker=ar(e,t,""+e[t])}}function jo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),i="";return e&&(i=ki(e)?e.checked?"true":"false":e.value),e=i,e!==l?(t.setValue(e),!0):!1}function Da(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Xh=/[\n"\\]/g;function Qt(e){return e.replace(Xh,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function rr(e,t,l,i,s,u,f,p){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ft(t)):e.value!==""+ft(t)&&(e.value=""+ft(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?ur(e,f,ft(t)):l!=null?ur(e,f,ft(l)):i!=null&&e.removeAttribute("value"),s==null&&u!=null&&(e.defaultChecked=!!u),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.name=""+ft(p):e.removeAttribute("name")}function Mo(e,t,l,i,s,u,f,p){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||l!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){sr(e);return}l=l!=null?""+ft(l):"",t=t!=null?""+ft(t):l,p||t===e.value||(e.value=t),e.defaultValue=t}i=i??s,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=p?e.checked:!!i,e.defaultChecked=!!i,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),sr(e)}function ur(e,t,l){t==="number"&&Da(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Li(e,t,l,i){if(e=e.options,t){t={};for(var s=0;s<l.length;s++)t["$"+l[s]]=!0;for(l=0;l<e.length;l++)s=t.hasOwnProperty("$"+e[l].value),e[l].selected!==s&&(e[l].selected=s),s&&i&&(e[l].defaultSelected=!0)}else{for(l=""+ft(l),t=null,s=0;s<e.length;s++){if(e[s].value===l){e[s].selected=!0,i&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Ao(e,t,l){if(t!=null&&(t=""+ft(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+ft(l):""}function Do(e,t,l,i){if(t==null){if(i!=null){if(l!=null)throw Error(r(92));if(Se(i)){if(1<i.length)throw Error(r(93));i=i[0]}l=i}l==null&&(l=""),t=l}l=ft(t),e.defaultValue=l,i=e.textContent,i===l&&i!==""&&i!==null&&(e.value=i),sr(e)}function Ui(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var Qh=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 Oo(e,t,l){var i=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,l):typeof l!="number"||l===0||Qh.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function No(e,t,l){if(t!=null&&typeof t!="object")throw Error(r(62));if(e=e.style,l!=null){for(var i in l)!l.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var s in t)i=t[s],t.hasOwnProperty(s)&&l[s]!==i&&Oo(e,s,i)}else for(var u in t)t.hasOwnProperty(u)&&Oo(e,u,t[u])}function or(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Vh=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"]]),Zh=/^[\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 Oa(e){return Zh.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function yl(){}var cr=null;function fr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Bi=null,qi=null;function Ho(e){var t=el(e);if(t&&(e=t.stateNode)){var l=e[St]||null;e:switch(e=t.stateNode,t.type){case"input":if(rr(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Qt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var i=l[t];if(i!==e&&i.form===e.form){var s=i[St]||null;if(!s)throw Error(r(90));rr(i,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<l.length;t++)i=l[t],i.form===e.form&&jo(i)}break e;case"textarea":Ao(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&Li(e,!!l.multiple,t,!1)}}}var dr=!1;function ko(e,t,l){if(dr)return e(t,l);dr=!0;try{var i=e(t);return i}finally{if(dr=!1,(Bi!==null||qi!==null)&&(bs(),Bi&&(t=Bi,e=qi,qi=Bi=null,Ho(t),e)))for(t=0;t<e.length;t++)Ho(e[t])}}function wn(e,t){var l=e.stateNode;if(l===null)return null;var i=l[St]||null;if(i===null)return null;l=i[t];e:switch(t){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)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(r(231,t,typeof l));return l}var vl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hr=!1;if(vl)try{var jn={};Object.defineProperty(jn,"passive",{get:function(){hr=!0}}),window.addEventListener("test",jn,jn),window.removeEventListener("test",jn,jn)}catch{hr=!1}var ql=null,gr=null,Na=null;function Lo(){if(Na)return Na;var e,t=gr,l=t.length,i,s="value"in ql?ql.value:ql.textContent,u=s.length;for(e=0;e<l&&t[e]===s[e];e++);var f=l-e;for(i=1;i<=f&&t[l-i]===s[u-i];i++);return Na=s.slice(e,1<i?1-i:void 0)}function Ha(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ka(){return!0}function Uo(){return!1}function Rt(e){function t(l,i,s,u,f){this._reactName=l,this._targetInst=s,this.type=i,this.nativeEvent=u,this.target=f,this.currentTarget=null;for(var p in e)e.hasOwnProperty(p)&&(l=e[p],this[p]=l?l(u):u[p]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?ka:Uo,this.isPropagationStopped=Uo,this}return v(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=ka)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=ka)},persist:function(){},isPersistent:ka}),t}var mi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},La=Rt(mi),Mn=v({},mi,{view:0,detail:0}),Kh=Rt(Mn),mr,pr,An,Ua=v({},Mn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==An&&(An&&e.type==="mousemove"?(mr=e.screenX-An.screenX,pr=e.screenY-An.screenY):pr=mr=0,An=e),mr)},movementY:function(e){return"movementY"in e?e.movementY:pr}}),Bo=Rt(Ua),Jh=v({},Ua,{dataTransfer:0}),Wh=Rt(Jh),$h=v({},Mn,{relatedTarget:0}),yr=Rt($h),Fh=v({},mi,{animationName:0,elapsedTime:0,pseudoElement:0}),Ih=Rt(Fh),Ph=v({},mi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),eg=Rt(Ph),tg=v({},mi,{data:0}),qo=Rt(tg),lg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ig={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"},ng={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ag(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ng[e])?!!t[e]:!1}function vr(){return ag}var sg=v({},Mn,{key:function(e){if(e.key){var t=lg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ha(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ig[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vr,charCode:function(e){return e.type==="keypress"?Ha(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ha(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),rg=Rt(sg),ug=v({},Ua,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Go=Rt(ug),og=v({},Mn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vr}),cg=Rt(og),fg=v({},mi,{propertyName:0,elapsedTime:0,pseudoElement:0}),dg=Rt(fg),hg=v({},Ua,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),gg=Rt(hg),mg=v({},mi,{newState:0,oldState:0}),pg=Rt(mg),yg=[9,13,27,32],xr=vl&&"CompositionEvent"in window,Dn=null;vl&&"documentMode"in document&&(Dn=document.documentMode);var vg=vl&&"TextEvent"in window&&!Dn,Yo=vl&&(!xr||Dn&&8<Dn&&11>=Dn),Xo=" ",Qo=!1;function Vo(e,t){switch(e){case"keyup":return yg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Gi=!1;function xg(e,t){switch(e){case"compositionend":return Zo(t);case"keypress":return t.which!==32?null:(Qo=!0,Xo);case"textInput":return e=t.data,e===Xo&&Qo?null:e;default:return null}}function bg(e,t){if(Gi)return e==="compositionend"||!xr&&Vo(e,t)?(e=Lo(),Na=gr=ql=null,Gi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Yo&&t.locale!=="ko"?null:t.data;default:return null}}var Sg={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 Ko(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Sg[e.type]:t==="textarea"}function Jo(e,t,l,i){Bi?qi?qi.push(i):qi=[i]:Bi=i,t=Rs(t,"onChange"),0<t.length&&(l=new La("onChange","change",null,l,i),e.push({event:l,listeners:t}))}var On=null,Nn=null;function Eg(e){Ad(e,0)}function Ba(e){var t=ul(e);if(jo(t))return e}function Wo(e,t){if(e==="change")return t}var $o=!1;if(vl){var br;if(vl){var Sr="oninput"in document;if(!Sr){var Fo=document.createElement("div");Fo.setAttribute("oninput","return;"),Sr=typeof Fo.oninput=="function"}br=Sr}else br=!1;$o=br&&(!document.documentMode||9<document.documentMode)}function Io(){On&&(On.detachEvent("onpropertychange",Po),Nn=On=null)}function Po(e){if(e.propertyName==="value"&&Ba(Nn)){var t=[];Jo(t,Nn,e,fr(e)),ko(Eg,t)}}function _g(e,t,l){e==="focusin"?(Io(),On=t,Nn=l,On.attachEvent("onpropertychange",Po)):e==="focusout"&&Io()}function zg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ba(Nn)}function Cg(e,t){if(e==="click")return Ba(t)}function Tg(e,t){if(e==="input"||e==="change")return Ba(t)}function Rg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nt=typeof Object.is=="function"?Object.is:Rg;function Hn(e,t){if(Nt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),i=Object.keys(t);if(l.length!==i.length)return!1;for(i=0;i<l.length;i++){var s=l[i];if(!Di.call(t,s)||!Nt(e[s],t[s]))return!1}return!0}function ec(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function tc(e,t){var l=ec(e);e=0;for(var i;l;){if(l.nodeType===3){if(i=e+l.textContent.length,e<=t&&i>=t)return{node:l,offset:t-e};e=i}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=ec(l)}}function lc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?lc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ic(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Da(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=Da(e.document)}return t}function Er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var wg=vl&&"documentMode"in document&&11>=document.documentMode,Yi=null,_r=null,kn=null,zr=!1;function nc(e,t,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;zr||Yi==null||Yi!==Da(i)||(i=Yi,"selectionStart"in i&&Er(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}),kn&&Hn(kn,i)||(kn=i,i=Rs(_r,"onSelect"),0<i.length&&(t=new La("onSelect","select",null,t,l),e.push({event:t,listeners:i}),t.target=Yi)))}function pi(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Xi={animationend:pi("Animation","AnimationEnd"),animationiteration:pi("Animation","AnimationIteration"),animationstart:pi("Animation","AnimationStart"),transitionrun:pi("Transition","TransitionRun"),transitionstart:pi("Transition","TransitionStart"),transitioncancel:pi("Transition","TransitionCancel"),transitionend:pi("Transition","TransitionEnd")},Cr={},ac={};vl&&(ac=document.createElement("div").style,"AnimationEvent"in window||(delete Xi.animationend.animation,delete Xi.animationiteration.animation,delete Xi.animationstart.animation),"TransitionEvent"in window||delete Xi.transitionend.transition);function yi(e){if(Cr[e])return Cr[e];if(!Xi[e])return e;var t=Xi[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in ac)return Cr[e]=t[l];return e}var sc=yi("animationend"),rc=yi("animationiteration"),uc=yi("animationstart"),jg=yi("transitionrun"),Mg=yi("transitionstart"),Ag=yi("transitioncancel"),oc=yi("transitionend"),cc=new Map,Tr="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(" ");Tr.push("scrollEnd");function tl(e,t){cc.set(e,t),U(t,[e])}var qa=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Vt=[],Qi=0,Rr=0;function Ga(){for(var e=Qi,t=Rr=Qi=0;t<e;){var l=Vt[t];Vt[t++]=null;var i=Vt[t];Vt[t++]=null;var s=Vt[t];Vt[t++]=null;var u=Vt[t];if(Vt[t++]=null,i!==null&&s!==null){var f=i.pending;f===null?s.next=s:(s.next=f.next,f.next=s),i.pending=s}u!==0&&fc(l,s,u)}}function Ya(e,t,l,i){Vt[Qi++]=e,Vt[Qi++]=t,Vt[Qi++]=l,Vt[Qi++]=i,Rr|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function wr(e,t,l,i){return Ya(e,t,l,i),Xa(e)}function vi(e,t){return Ya(e,null,null,t),Xa(e)}function fc(e,t,l){e.lanes|=l;var i=e.alternate;i!==null&&(i.lanes|=l);for(var s=!1,u=e.return;u!==null;)u.childLanes|=l,i=u.alternate,i!==null&&(i.childLanes|=l),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(s=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,s&&t!==null&&(s=31-Le(l),e=u.hiddenUpdates,i=e[s],i===null?e[s]=[t]:i.push(t),t.lane=l|536870912),u):null}function Xa(e){if(50<na)throw na=0,Lu=null,Error(r(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Vi={};function Dg(e,t,l,i){this.tag=e,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=t,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 Ht(e,t,l,i){return new Dg(e,t,l,i)}function jr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function xl(e,t){var l=e.alternate;return l===null?(l=Ht(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function dc(e,t){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Qa(e,t,l,i,s,u){var f=0;if(i=e,typeof e=="function")jr(e)&&(f=1);else if(typeof e=="string")f=Lm(e,l,V.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case de:return e=Ht(31,l,t,s),e.elementType=de,e.lanes=u,e;case $:return xi(l.children,s,u,t);case ae:f=8,s|=24;break;case me:return e=Ht(12,l,t,s|2),e.elementType=me,e.lanes=u,e;case ye:return e=Ht(13,l,t,s),e.elementType=ye,e.lanes=u,e;case H:return e=Ht(19,l,t,s),e.elementType=H,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Q:f=10;break e;case he:f=9;break e;case se:f=11;break e;case G:f=14;break e;case re:f=16,i=null;break e}f=29,l=Error(r(130,e===null?"null":typeof e,"")),i=null}return t=Ht(f,l,t,s),t.elementType=e,t.type=i,t.lanes=u,t}function xi(e,t,l,i){return e=Ht(7,e,i,t),e.lanes=l,e}function Mr(e,t,l){return e=Ht(6,e,null,t),e.lanes=l,e}function hc(e){var t=Ht(18,null,null,0);return t.stateNode=e,t}function Ar(e,t,l){return t=Ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var gc=new WeakMap;function Zt(e,t){if(typeof e=="object"&&e!==null){var l=gc.get(e);return l!==void 0?l:(t={value:e,source:t,stack:xn(t)},gc.set(e,t),t)}return{value:e,source:t,stack:xn(t)}}var Zi=[],Ki=0,Va=null,Ln=0,Kt=[],Jt=0,Gl=null,ol=1,cl="";function bl(e,t){Zi[Ki++]=Ln,Zi[Ki++]=Va,Va=e,Ln=t}function mc(e,t,l){Kt[Jt++]=ol,Kt[Jt++]=cl,Kt[Jt++]=Gl,Gl=e;var i=ol;e=cl;var s=32-Le(i)-1;i&=~(1<<s),l+=1;var u=32-Le(t)+s;if(30<u){var f=s-s%5;u=(i&(1<<f)-1).toString(32),i>>=f,s-=f,ol=1<<32-Le(t)+s|l<<s|i,cl=u+e}else ol=1<<u|l<<s|i,cl=e}function Dr(e){e.return!==null&&(bl(e,1),mc(e,1,0))}function Or(e){for(;e===Va;)Va=Zi[--Ki],Zi[Ki]=null,Ln=Zi[--Ki],Zi[Ki]=null;for(;e===Gl;)Gl=Kt[--Jt],Kt[Jt]=null,cl=Kt[--Jt],Kt[Jt]=null,ol=Kt[--Jt],Kt[Jt]=null}function pc(e,t){Kt[Jt++]=ol,Kt[Jt++]=cl,Kt[Jt++]=Gl,ol=t.id,cl=t.overflow,Gl=e}var pt=null,Ke=null,De=!1,Yl=null,Wt=!1,Nr=Error(r(519));function Xl(e){var t=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Un(Zt(t,e)),Nr}function yc(e){var t=e.stateNode,l=e.type,i=e.memoizedProps;switch(t[ct]=e,t[St]=i,l){case"dialog":je("cancel",t),je("close",t);break;case"iframe":case"object":case"embed":je("load",t);break;case"video":case"audio":for(l=0;l<sa.length;l++)je(sa[l],t);break;case"source":je("error",t);break;case"img":case"image":case"link":je("error",t),je("load",t);break;case"details":je("toggle",t);break;case"input":je("invalid",t),Mo(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":je("invalid",t);break;case"textarea":je("invalid",t),Do(t,i.value,i.defaultValue,i.children)}l=i.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||i.suppressHydrationWarning===!0||Hd(t.textContent,l)?(i.popover!=null&&(je("beforetoggle",t),je("toggle",t)),i.onScroll!=null&&je("scroll",t),i.onScrollEnd!=null&&je("scrollend",t),i.onClick!=null&&(t.onclick=yl),t=!0):t=!1,t||Xl(e,!0)}function vc(e){for(pt=e.return;pt;)switch(pt.tag){case 5:case 31:case 13:Wt=!1;return;case 27:case 3:Wt=!0;return;default:pt=pt.return}}function Ji(e){if(e!==pt)return!1;if(!De)return vc(e),De=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Iu(e.type,e.memoizedProps)),l=!l),l&&Ke&&Xl(e),vc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));Ke=Qd(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));Ke=Qd(e)}else t===27?(t=Ke,ii(e.type)?(e=io,io=null,Ke=e):Ke=t):Ke=pt?Ft(e.stateNode.nextSibling):null;return!0}function bi(){Ke=pt=null,De=!1}function Hr(){var e=Yl;return e!==null&&(At===null?At=e:At.push.apply(At,e),Yl=null),e}function Un(e){Yl===null?Yl=[e]:Yl.push(e)}var kr=_(null),Si=null,Sl=null;function Ql(e,t,l){w(kr,t._currentValue),t._currentValue=l}function El(e){e._currentValue=kr.current,k(kr)}function Lr(e,t,l){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===l)break;e=e.return}}function Ur(e,t,l,i){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var u=s.dependencies;if(u!==null){var f=s.child;u=u.firstContext;e:for(;u!==null;){var p=u;u=s;for(var E=0;E<t.length;E++)if(p.context===t[E]){u.lanes|=l,p=u.alternate,p!==null&&(p.lanes|=l),Lr(u.return,l,e),i||(f=null);break e}u=p.next}}else if(s.tag===18){if(f=s.return,f===null)throw Error(r(341));f.lanes|=l,u=f.alternate,u!==null&&(u.lanes|=l),Lr(f,l,e),f=null}else f=s.child;if(f!==null)f.return=s;else for(f=s;f!==null;){if(f===e){f=null;break}if(s=f.sibling,s!==null){s.return=f.return,f=s;break}f=f.return}s=f}}function Wi(e,t,l,i){e=null;for(var s=t,u=!1;s!==null;){if(!u){if((s.flags&524288)!==0)u=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var f=s.alternate;if(f===null)throw Error(r(387));if(f=f.memoizedProps,f!==null){var p=s.type;Nt(s.pendingProps.value,f.value)||(e!==null?e.push(p):e=[p])}}else if(s===le.current){if(f=s.alternate,f===null)throw Error(r(387));f.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(fa):e=[fa])}s=s.return}e!==null&&Ur(t,e,l,i),t.flags|=262144}function Za(e){for(e=e.firstContext;e!==null;){if(!Nt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ei(e){Si=e,Sl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function yt(e){return xc(Si,e)}function Ka(e,t){return Si===null&&Ei(e),xc(e,t)}function xc(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},Sl===null){if(e===null)throw Error(r(308));Sl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Sl=Sl.next=t;return l}var Og=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},Ng=h.unstable_scheduleCallback,Hg=h.unstable_NormalPriority,st={$$typeof:Q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Br(){return{controller:new Og,data:new Map,refCount:0}}function Bn(e){e.refCount--,e.refCount===0&&Ng(Hg,function(){e.controller.abort()})}var qn=null,qr=0,$i=0,Fi=null;function kg(e,t){if(qn===null){var l=qn=[];qr=0,$i=Xu(),Fi={status:"pending",value:void 0,then:function(i){l.push(i)}}}return qr++,t.then(bc,bc),t}function bc(){if(--qr===0&&qn!==null){Fi!==null&&(Fi.status="fulfilled");var e=qn;qn=null,$i=0,Fi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Lg(e,t){var l=[],i={status:"pending",value:null,reason:null,then:function(s){l.push(s)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var s=0;s<l.length;s++)(0,l[s])(t)},function(s){for(i.status="rejected",i.reason=s,s=0;s<l.length;s++)(0,l[s])(void 0)}),i}var Sc=C.S;C.S=function(e,t){ad=bt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&kg(e,t),Sc!==null&&Sc(e,t)};var _i=_(null);function Gr(){var e=_i.current;return e!==null?e:Ze.pooledCache}function Ja(e,t){t===null?w(_i,_i.current):w(_i,t.pool)}function Ec(){var e=Gr();return e===null?null:{parent:st._currentValue,pool:e}}var Ii=Error(r(460)),Yr=Error(r(474)),Wa=Error(r(542)),$a={then:function(){}};function _c(e){return e=e.status,e==="fulfilled"||e==="rejected"}function zc(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(yl,yl),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Tc(e),e;default:if(typeof t.status=="string")t.then(yl,yl);else{if(e=Ze,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=i}},function(i){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Tc(e),e}throw Ci=t,Ii}}function zi(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Ci=l,Ii):l}}var Ci=null;function Cc(){if(Ci===null)throw Error(r(459));var e=Ci;return Ci=null,e}function Tc(e){if(e===Ii||e===Wa)throw Error(r(483))}var Pi=null,Gn=0;function Fa(e){var t=Gn;return Gn+=1,Pi===null&&(Pi=[]),zc(Pi,e,t)}function Yn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ia(e,t){throw t.$$typeof===T?Error(r(525)):(e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Rc(e){function t(R,z){if(e){var j=R.deletions;j===null?(R.deletions=[z],R.flags|=16):j.push(z)}}function l(R,z){if(!e)return null;for(;z!==null;)t(R,z),z=z.sibling;return null}function i(R){for(var z=new Map;R!==null;)R.key!==null?z.set(R.key,R):z.set(R.index,R),R=R.sibling;return z}function s(R,z){return R=xl(R,z),R.index=0,R.sibling=null,R}function u(R,z,j){return R.index=j,e?(j=R.alternate,j!==null?(j=j.index,j<z?(R.flags|=67108866,z):j):(R.flags|=67108866,z)):(R.flags|=1048576,z)}function f(R){return e&&R.alternate===null&&(R.flags|=67108866),R}function p(R,z,j,q){return z===null||z.tag!==6?(z=Mr(j,R.mode,q),z.return=R,z):(z=s(z,j),z.return=R,z)}function E(R,z,j,q){var fe=j.type;return fe===$?L(R,z,j.props.children,q,j.key):z!==null&&(z.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===re&&zi(fe)===z.type)?(z=s(z,j.props),Yn(z,j),z.return=R,z):(z=Qa(j.type,j.key,j.props,null,R.mode,q),Yn(z,j),z.return=R,z)}function M(R,z,j,q){return z===null||z.tag!==4||z.stateNode.containerInfo!==j.containerInfo||z.stateNode.implementation!==j.implementation?(z=Ar(j,R.mode,q),z.return=R,z):(z=s(z,j.children||[]),z.return=R,z)}function L(R,z,j,q,fe){return z===null||z.tag!==7?(z=xi(j,R.mode,q,fe),z.return=R,z):(z=s(z,j),z.return=R,z)}function Y(R,z,j){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=Mr(""+z,R.mode,j),z.return=R,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case Z:return j=Qa(z.type,z.key,z.props,null,R.mode,j),Yn(j,z),j.return=R,j;case K:return z=Ar(z,R.mode,j),z.return=R,z;case re:return z=zi(z),Y(R,z,j)}if(Se(z)||ve(z))return z=xi(z,R.mode,j,null),z.return=R,z;if(typeof z.then=="function")return Y(R,Fa(z),j);if(z.$$typeof===Q)return Y(R,Ka(R,z),j);Ia(R,z)}return null}function A(R,z,j,q){var fe=z!==null?z.key:null;if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return fe!==null?null:p(R,z,""+j,q);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Z:return j.key===fe?E(R,z,j,q):null;case K:return j.key===fe?M(R,z,j,q):null;case re:return j=zi(j),A(R,z,j,q)}if(Se(j)||ve(j))return fe!==null?null:L(R,z,j,q,null);if(typeof j.then=="function")return A(R,z,Fa(j),q);if(j.$$typeof===Q)return A(R,z,Ka(R,j),q);Ia(R,j)}return null}function N(R,z,j,q,fe){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return R=R.get(j)||null,p(z,R,""+q,fe);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case Z:return R=R.get(q.key===null?j:q.key)||null,E(z,R,q,fe);case K:return R=R.get(q.key===null?j:q.key)||null,M(z,R,q,fe);case re:return q=zi(q),N(R,z,j,q,fe)}if(Se(q)||ve(q))return R=R.get(j)||null,L(z,R,q,fe,null);if(typeof q.then=="function")return N(R,z,j,Fa(q),fe);if(q.$$typeof===Q)return N(R,z,j,Ka(z,q),fe);Ia(z,q)}return null}function ne(R,z,j,q){for(var fe=null,He=null,oe=z,Ce=z=0,Ae=null;oe!==null&&Ce<j.length;Ce++){oe.index>Ce?(Ae=oe,oe=null):Ae=oe.sibling;var ke=A(R,oe,j[Ce],q);if(ke===null){oe===null&&(oe=Ae);break}e&&oe&&ke.alternate===null&&t(R,oe),z=u(ke,z,Ce),He===null?fe=ke:He.sibling=ke,He=ke,oe=Ae}if(Ce===j.length)return l(R,oe),De&&bl(R,Ce),fe;if(oe===null){for(;Ce<j.length;Ce++)oe=Y(R,j[Ce],q),oe!==null&&(z=u(oe,z,Ce),He===null?fe=oe:He.sibling=oe,He=oe);return De&&bl(R,Ce),fe}for(oe=i(oe);Ce<j.length;Ce++)Ae=N(oe,R,Ce,j[Ce],q),Ae!==null&&(e&&Ae.alternate!==null&&oe.delete(Ae.key===null?Ce:Ae.key),z=u(Ae,z,Ce),He===null?fe=Ae:He.sibling=Ae,He=Ae);return e&&oe.forEach(function(ui){return t(R,ui)}),De&&bl(R,Ce),fe}function ge(R,z,j,q){if(j==null)throw Error(r(151));for(var fe=null,He=null,oe=z,Ce=z=0,Ae=null,ke=j.next();oe!==null&&!ke.done;Ce++,ke=j.next()){oe.index>Ce?(Ae=oe,oe=null):Ae=oe.sibling;var ui=A(R,oe,ke.value,q);if(ui===null){oe===null&&(oe=Ae);break}e&&oe&&ui.alternate===null&&t(R,oe),z=u(ui,z,Ce),He===null?fe=ui:He.sibling=ui,He=ui,oe=Ae}if(ke.done)return l(R,oe),De&&bl(R,Ce),fe;if(oe===null){for(;!ke.done;Ce++,ke=j.next())ke=Y(R,ke.value,q),ke!==null&&(z=u(ke,z,Ce),He===null?fe=ke:He.sibling=ke,He=ke);return De&&bl(R,Ce),fe}for(oe=i(oe);!ke.done;Ce++,ke=j.next())ke=N(oe,R,Ce,ke.value,q),ke!==null&&(e&&ke.alternate!==null&&oe.delete(ke.key===null?Ce:ke.key),z=u(ke,z,Ce),He===null?fe=ke:He.sibling=ke,He=ke);return e&&oe.forEach(function(Jm){return t(R,Jm)}),De&&bl(R,Ce),fe}function Qe(R,z,j,q){if(typeof j=="object"&&j!==null&&j.type===$&&j.key===null&&(j=j.props.children),typeof j=="object"&&j!==null){switch(j.$$typeof){case Z:e:{for(var fe=j.key;z!==null;){if(z.key===fe){if(fe=j.type,fe===$){if(z.tag===7){l(R,z.sibling),q=s(z,j.props.children),q.return=R,R=q;break e}}else if(z.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===re&&zi(fe)===z.type){l(R,z.sibling),q=s(z,j.props),Yn(q,j),q.return=R,R=q;break e}l(R,z);break}else t(R,z);z=z.sibling}j.type===$?(q=xi(j.props.children,R.mode,q,j.key),q.return=R,R=q):(q=Qa(j.type,j.key,j.props,null,R.mode,q),Yn(q,j),q.return=R,R=q)}return f(R);case K:e:{for(fe=j.key;z!==null;){if(z.key===fe)if(z.tag===4&&z.stateNode.containerInfo===j.containerInfo&&z.stateNode.implementation===j.implementation){l(R,z.sibling),q=s(z,j.children||[]),q.return=R,R=q;break e}else{l(R,z);break}else t(R,z);z=z.sibling}q=Ar(j,R.mode,q),q.return=R,R=q}return f(R);case re:return j=zi(j),Qe(R,z,j,q)}if(Se(j))return ne(R,z,j,q);if(ve(j)){if(fe=ve(j),typeof fe!="function")throw Error(r(150));return j=fe.call(j),ge(R,z,j,q)}if(typeof j.then=="function")return Qe(R,z,Fa(j),q);if(j.$$typeof===Q)return Qe(R,z,Ka(R,j),q);Ia(R,j)}return typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint"?(j=""+j,z!==null&&z.tag===6?(l(R,z.sibling),q=s(z,j),q.return=R,R=q):(l(R,z),q=Mr(j,R.mode,q),q.return=R,R=q),f(R)):l(R,z)}return function(R,z,j,q){try{Gn=0;var fe=Qe(R,z,j,q);return Pi=null,fe}catch(oe){if(oe===Ii||oe===Wa)throw oe;var He=Ht(29,oe,null,R.mode);return He.lanes=q,He.return=R,He}finally{}}}var Ti=Rc(!0),wc=Rc(!1),Vl=!1;function Xr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qr(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Zl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Kl(e,t,l){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ue&2)!==0){var s=i.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),i.pending=t,t=Xa(e),fc(e,null,l),t}return Ya(e,i,t,l),Xa(e)}function Xn(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,zn(e,l)}}function Vr(e,t){var l=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,l===i)){var s=null,u=null;if(l=l.firstBaseUpdate,l!==null){do{var f={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};u===null?s=u=f:u=u.next=f,l=l.next}while(l!==null);u===null?s=u=t:u=u.next=t}else s=u=t;l={baseState:i.baseState,firstBaseUpdate:s,lastBaseUpdate:u,shared:i.shared,callbacks:i.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Zr=!1;function Qn(){if(Zr){var e=Fi;if(e!==null)throw e}}function Vn(e,t,l,i){Zr=!1;var s=e.updateQueue;Vl=!1;var u=s.firstBaseUpdate,f=s.lastBaseUpdate,p=s.shared.pending;if(p!==null){s.shared.pending=null;var E=p,M=E.next;E.next=null,f===null?u=M:f.next=M,f=E;var L=e.alternate;L!==null&&(L=L.updateQueue,p=L.lastBaseUpdate,p!==f&&(p===null?L.firstBaseUpdate=M:p.next=M,L.lastBaseUpdate=E))}if(u!==null){var Y=s.baseState;f=0,L=M=E=null,p=u;do{var A=p.lane&-536870913,N=A!==p.lane;if(N?(Me&A)===A:(i&A)===A){A!==0&&A===$i&&(Zr=!0),L!==null&&(L=L.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var ne=e,ge=p;A=t;var Qe=l;switch(ge.tag){case 1:if(ne=ge.payload,typeof ne=="function"){Y=ne.call(Qe,Y,A);break e}Y=ne;break e;case 3:ne.flags=ne.flags&-65537|128;case 0:if(ne=ge.payload,A=typeof ne=="function"?ne.call(Qe,Y,A):ne,A==null)break e;Y=v({},Y,A);break e;case 2:Vl=!0}}A=p.callback,A!==null&&(e.flags|=64,N&&(e.flags|=8192),N=s.callbacks,N===null?s.callbacks=[A]:N.push(A))}else N={lane:A,tag:p.tag,payload:p.payload,callback:p.callback,next:null},L===null?(M=L=N,E=Y):L=L.next=N,f|=A;if(p=p.next,p===null){if(p=s.shared.pending,p===null)break;N=p,p=N.next,N.next=null,s.lastBaseUpdate=N,s.shared.pending=null}}while(!0);L===null&&(E=Y),s.baseState=E,s.firstBaseUpdate=M,s.lastBaseUpdate=L,u===null&&(s.shared.lanes=0),Il|=f,e.lanes=f,e.memoizedState=Y}}function jc(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function Mc(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)jc(l[e],t)}var en=_(null),Pa=_(0);function Ac(e,t){e=Al,w(Pa,e),w(en,t),Al=e|t.baseLanes}function Kr(){w(Pa,Al),w(en,en.current)}function Jr(){Al=Pa.current,k(en),k(Pa)}var kt=_(null),$t=null;function Jl(e){var t=e.alternate;w(it,it.current&1),w(kt,e),$t===null&&(t===null||en.current!==null||t.memoizedState!==null)&&($t=e)}function Wr(e){w(it,it.current),w(kt,e),$t===null&&($t=e)}function Dc(e){e.tag===22?(w(it,it.current),w(kt,e),$t===null&&($t=e)):Wl()}function Wl(){w(it,it.current),w(kt,kt.current)}function Lt(e){k(kt),$t===e&&($t=null),k(it)}var it=_(0);function es(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||to(l)||lo(l)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var _l=0,ze=null,Ye=null,rt=null,ts=!1,tn=!1,Ri=!1,ls=0,Zn=0,ln=null,Ug=0;function tt(){throw Error(r(321))}function $r(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!Nt(e[l],t[l]))return!1;return!0}function Fr(e,t,l,i,s,u){return _l=u,ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,C.H=e===null||e.memoizedState===null?pf:du,Ri=!1,u=l(i,s),Ri=!1,tn&&(u=Nc(t,l,i,s)),Oc(e),u}function Oc(e){C.H=Wn;var t=Ye!==null&&Ye.next!==null;if(_l=0,rt=Ye=ze=null,ts=!1,Zn=0,ln=null,t)throw Error(r(300));e===null||ut||(e=e.dependencies,e!==null&&Za(e)&&(ut=!0))}function Nc(e,t,l,i){ze=e;var s=0;do{if(tn&&(ln=null),Zn=0,tn=!1,25<=s)throw Error(r(301));if(s+=1,rt=Ye=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}C.H=yf,u=t(l,i)}while(tn);return u}function Bg(){var e=C.H,t=e.useState()[0];return t=typeof t.then=="function"?Kn(t):t,e=e.useState()[0],(Ye!==null?Ye.memoizedState:null)!==e&&(ze.flags|=1024),t}function Ir(){var e=ls!==0;return ls=0,e}function Pr(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function eu(e){if(ts){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ts=!1}_l=0,rt=Ye=ze=null,tn=!1,Zn=ls=0,ln=null}function Ct(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rt===null?ze.memoizedState=rt=e:rt=rt.next=e,rt}function nt(){if(Ye===null){var e=ze.alternate;e=e!==null?e.memoizedState:null}else e=Ye.next;var t=rt===null?ze.memoizedState:rt.next;if(t!==null)rt=t,Ye=e;else{if(e===null)throw ze.alternate===null?Error(r(467)):Error(r(310));Ye=e,e={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},rt===null?ze.memoizedState=rt=e:rt=rt.next=e}return rt}function is(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Kn(e){var t=Zn;return Zn+=1,ln===null&&(ln=[]),e=zc(ln,e,t),t=ze,(rt===null?t.memoizedState:rt.next)===null&&(t=t.alternate,C.H=t===null||t.memoizedState===null?pf:du),e}function ns(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Kn(e);if(e.$$typeof===Q)return yt(e)}throw Error(r(438,String(e)))}function tu(e){var t=null,l=ze.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var i=ze.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=is(),ze.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),i=0;i<e;i++)l[i]=Oe;return t.index++,l}function zl(e,t){return typeof t=="function"?t(e):t}function as(e){var t=nt();return lu(t,Ye,e)}function lu(e,t,l){var i=e.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=l;var s=e.baseQueue,u=i.pending;if(u!==null){if(s!==null){var f=s.next;s.next=u.next,u.next=f}t.baseQueue=s=u,i.pending=null}if(u=e.baseState,s===null)e.memoizedState=u;else{t=s.next;var p=f=null,E=null,M=t,L=!1;do{var Y=M.lane&-536870913;if(Y!==M.lane?(Me&Y)===Y:(_l&Y)===Y){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}),Y===$i&&(L=!0);else if((_l&A)===A){M=M.next,A===$i&&(L=!0);continue}else Y={lane:0,revertLane:M.revertLane,gesture:null,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null},E===null?(p=E=Y,f=u):E=E.next=Y,ze.lanes|=A,Il|=A;Y=M.action,Ri&&l(u,Y),u=M.hasEagerState?M.eagerState:l(u,Y)}else A={lane:Y,revertLane:M.revertLane,gesture:M.gesture,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null},E===null?(p=E=A,f=u):E=E.next=A,ze.lanes|=Y,Il|=Y;M=M.next}while(M!==null&&M!==t);if(E===null?f=u:E.next=p,!Nt(u,e.memoizedState)&&(ut=!0,L&&(l=Fi,l!==null)))throw l;e.memoizedState=u,e.baseState=f,e.baseQueue=E,i.lastRenderedState=u}return s===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function iu(e){var t=nt(),l=t.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=e;var i=l.dispatch,s=l.pending,u=t.memoizedState;if(s!==null){l.pending=null;var f=s=s.next;do u=e(u,f.action),f=f.next;while(f!==s);Nt(u,t.memoizedState)||(ut=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),l.lastRenderedState=u}return[u,i]}function Hc(e,t,l){var i=ze,s=nt(),u=De;if(u){if(l===void 0)throw Error(r(407));l=l()}else l=t();var f=!Nt((Ye||s).memoizedState,l);if(f&&(s.memoizedState=l,ut=!0),s=s.queue,su(Uc.bind(null,i,s,e),[e]),s.getSnapshot!==t||f||rt!==null&&rt.memoizedState.tag&1){if(i.flags|=2048,nn(9,{destroy:void 0},Lc.bind(null,i,s,l,t),null),Ze===null)throw Error(r(349));u||(_l&127)!==0||kc(i,t,l)}return l}function kc(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=ze.updateQueue,t===null?(t=is(),ze.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function Lc(e,t,l,i){t.value=l,t.getSnapshot=i,Bc(t)&&qc(e)}function Uc(e,t,l){return l(function(){Bc(t)&&qc(e)})}function Bc(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!Nt(e,l)}catch{return!0}}function qc(e){var t=vi(e,2);t!==null&&Dt(t,e,2)}function nu(e){var t=Ct();if(typeof e=="function"){var l=e;if(e=l(),Ri){Ne(!0);try{l()}finally{Ne(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zl,lastRenderedState:e},t}function Gc(e,t,l,i){return e.baseState=l,lu(e,Ye,typeof i=="function"?i:zl)}function qg(e,t,l,i,s){if(us(e))throw Error(r(485));if(e=t.action,e!==null){var u={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){u.listeners.push(f)}};C.T!==null?l(!0):u.isTransition=!1,i(u),l=t.pending,l===null?(u.next=t.pending=u,Yc(t,u)):(u.next=l.next,t.pending=l.next=u)}}function Yc(e,t){var l=t.action,i=t.payload,s=e.state;if(t.isTransition){var u=C.T,f={};C.T=f;try{var p=l(s,i),E=C.S;E!==null&&E(f,p),Xc(e,t,p)}catch(M){au(e,t,M)}finally{u!==null&&f.types!==null&&(u.types=f.types),C.T=u}}else try{u=l(s,i),Xc(e,t,u)}catch(M){au(e,t,M)}}function Xc(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(i){Qc(e,t,i)},function(i){return au(e,t,i)}):Qc(e,t,l)}function Qc(e,t,l){t.status="fulfilled",t.value=l,Vc(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Yc(e,l)))}function au(e,t,l){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=l,Vc(t),t=t.next;while(t!==i)}e.action=null}function Vc(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zc(e,t){return t}function Kc(e,t){if(De){var l=Ze.formState;if(l!==null){e:{var i=ze;if(De){if(Ke){t:{for(var s=Ke,u=Wt;s.nodeType!==8;){if(!u){s=null;break t}if(s=Ft(s.nextSibling),s===null){s=null;break t}}u=s.data,s=u==="F!"||u==="F"?s:null}if(s){Ke=Ft(s.nextSibling),i=s.data==="F!";break e}}Xl(i)}i=!1}i&&(t=l[0])}}return l=Ct(),l.memoizedState=l.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zc,lastRenderedState:t},l.queue=i,l=hf.bind(null,ze,i),i.dispatch=l,i=nu(!1),u=fu.bind(null,ze,!1,i.queue),i=Ct(),s={state:t,dispatch:null,action:e,pending:null},i.queue=s,l=qg.bind(null,ze,s,u,l),s.dispatch=l,i.memoizedState=e,[t,l,!1]}function Jc(e){var t=nt();return Wc(t,Ye,e)}function Wc(e,t,l){if(t=lu(e,t,Zc)[0],e=as(zl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=Kn(t)}catch(f){throw f===Ii?Wa:f}else i=t;t=nt();var s=t.queue,u=s.dispatch;return l!==t.memoizedState&&(ze.flags|=2048,nn(9,{destroy:void 0},Gg.bind(null,s,l),null)),[i,u,e]}function Gg(e,t){e.action=t}function $c(e){var t=nt(),l=Ye;if(l!==null)return Wc(t,l,e);nt(),t=t.memoizedState,l=nt();var i=l.queue.dispatch;return l.memoizedState=e,[t,i,!1]}function nn(e,t,l,i){return e={tag:e,create:l,deps:i,inst:t,next:null},t=ze.updateQueue,t===null&&(t=is(),ze.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(i=l.next,l.next=e,e.next=i,t.lastEffect=e),e}function Fc(){return nt().memoizedState}function ss(e,t,l,i){var s=Ct();ze.flags|=e,s.memoizedState=nn(1|t,{destroy:void 0},l,i===void 0?null:i)}function rs(e,t,l,i){var s=nt();i=i===void 0?null:i;var u=s.memoizedState.inst;Ye!==null&&i!==null&&$r(i,Ye.memoizedState.deps)?s.memoizedState=nn(t,u,l,i):(ze.flags|=e,s.memoizedState=nn(1|t,u,l,i))}function Ic(e,t){ss(8390656,8,e,t)}function su(e,t){rs(2048,8,e,t)}function Yg(e){ze.flags|=4;var t=ze.updateQueue;if(t===null)t=is(),ze.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Pc(e){var t=nt().memoizedState;return Yg({ref:t,nextImpl:e}),function(){if((Ue&2)!==0)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function ef(e,t){return rs(4,2,e,t)}function tf(e,t){return rs(4,4,e,t)}function lf(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function nf(e,t,l){l=l!=null?l.concat([e]):null,rs(4,4,lf.bind(null,t,e),l)}function ru(){}function af(e,t){var l=nt();t=t===void 0?null:t;var i=l.memoizedState;return t!==null&&$r(t,i[1])?i[0]:(l.memoizedState=[e,t],e)}function sf(e,t){var l=nt();t=t===void 0?null:t;var i=l.memoizedState;if(t!==null&&$r(t,i[1]))return i[0];if(i=e(),Ri){Ne(!0);try{e()}finally{Ne(!1)}}return l.memoizedState=[i,t],i}function uu(e,t,l){return l===void 0||(_l&1073741824)!==0&&(Me&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=rd(),ze.lanes|=e,Il|=e,l)}function rf(e,t,l,i){return Nt(l,t)?l:en.current!==null?(e=uu(e,l,i),Nt(e,t)||(ut=!0),e):(_l&42)===0||(_l&1073741824)!==0&&(Me&261930)===0?(ut=!0,e.memoizedState=l):(e=rd(),ze.lanes|=e,Il|=e,t)}function uf(e,t,l,i,s){var u=X.p;X.p=u!==0&&8>u?u:8;var f=C.T,p={};C.T=p,fu(e,!1,t,l);try{var E=s(),M=C.S;if(M!==null&&M(p,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var L=Lg(E,i);Jn(e,t,L,qt(e))}else Jn(e,t,i,qt(e))}catch(Y){Jn(e,t,{then:function(){},status:"rejected",reason:Y},qt())}finally{X.p=u,f!==null&&p.types!==null&&(f.types=p.types),C.T=f}}function Xg(){}function ou(e,t,l,i){if(e.tag!==5)throw Error(r(476));var s=of(e).queue;uf(e,s,t,B,l===null?Xg:function(){return cf(e),l(i)})}function of(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zl,lastRenderedState:B},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zl,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function cf(e){var t=of(e);t.next===null&&(t=e.alternate.memoizedState),Jn(e,t.next.queue,{},qt())}function cu(){return yt(fa)}function ff(){return nt().memoizedState}function df(){return nt().memoizedState}function Qg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=qt();e=Zl(l);var i=Kl(t,e,l);i!==null&&(Dt(i,t,l),Xn(i,t,l)),t={cache:Br()},e.payload=t;return}t=t.return}}function Vg(e,t,l){var i=qt();l={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},us(e)?gf(t,l):(l=wr(e,t,l,i),l!==null&&(Dt(l,e,i),mf(l,t,i)))}function hf(e,t,l){var i=qt();Jn(e,t,l,i)}function Jn(e,t,l,i){var s={lane:i,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(us(e))gf(t,s);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var f=t.lastRenderedState,p=u(f,l);if(s.hasEagerState=!0,s.eagerState=p,Nt(p,f))return Ya(e,t,s,0),Ze===null&&Ga(),!1}catch{}finally{}if(l=wr(e,t,s,i),l!==null)return Dt(l,e,i),mf(l,t,i),!0}return!1}function fu(e,t,l,i){if(i={lane:2,revertLane:Xu(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},us(e)){if(t)throw Error(r(479))}else t=wr(e,l,i,2),t!==null&&Dt(t,e,2)}function us(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function gf(e,t){tn=ts=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function mf(e,t,l){if((l&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,zn(e,l)}}var Wn={readContext:yt,use:ns,useCallback:tt,useContext:tt,useEffect:tt,useImperativeHandle:tt,useLayoutEffect:tt,useInsertionEffect:tt,useMemo:tt,useReducer:tt,useRef:tt,useState:tt,useDebugValue:tt,useDeferredValue:tt,useTransition:tt,useSyncExternalStore:tt,useId:tt,useHostTransitionStatus:tt,useFormState:tt,useActionState:tt,useOptimistic:tt,useMemoCache:tt,useCacheRefresh:tt};Wn.useEffectEvent=tt;var pf={readContext:yt,use:ns,useCallback:function(e,t){return Ct().memoizedState=[e,t===void 0?null:t],e},useContext:yt,useEffect:Ic,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,ss(4194308,4,lf.bind(null,t,e),l)},useLayoutEffect:function(e,t){return ss(4194308,4,e,t)},useInsertionEffect:function(e,t){ss(4,2,e,t)},useMemo:function(e,t){var l=Ct();t=t===void 0?null:t;var i=e();if(Ri){Ne(!0);try{e()}finally{Ne(!1)}}return l.memoizedState=[i,t],i},useReducer:function(e,t,l){var i=Ct();if(l!==void 0){var s=l(t);if(Ri){Ne(!0);try{l(t)}finally{Ne(!1)}}}else s=t;return i.memoizedState=i.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},i.queue=e,e=e.dispatch=Vg.bind(null,ze,e),[i.memoizedState,e]},useRef:function(e){var t=Ct();return e={current:e},t.memoizedState=e},useState:function(e){e=nu(e);var t=e.queue,l=hf.bind(null,ze,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:ru,useDeferredValue:function(e,t){var l=Ct();return uu(l,e,t)},useTransition:function(){var e=nu(!1);return e=uf.bind(null,ze,e.queue,!0,!1),Ct().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var i=ze,s=Ct();if(De){if(l===void 0)throw Error(r(407));l=l()}else{if(l=t(),Ze===null)throw Error(r(349));(Me&127)!==0||kc(i,t,l)}s.memoizedState=l;var u={value:l,getSnapshot:t};return s.queue=u,Ic(Uc.bind(null,i,u,e),[e]),i.flags|=2048,nn(9,{destroy:void 0},Lc.bind(null,i,u,l,t),null),l},useId:function(){var e=Ct(),t=Ze.identifierPrefix;if(De){var l=cl,i=ol;l=(i&~(1<<32-Le(i)-1)).toString(32)+l,t="_"+t+"R_"+l,l=ls++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=Ug++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:cu,useFormState:Kc,useActionState:Kc,useOptimistic:function(e){var t=Ct();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=fu.bind(null,ze,!0,l),l.dispatch=t,[e,t]},useMemoCache:tu,useCacheRefresh:function(){return Ct().memoizedState=Qg.bind(null,ze)},useEffectEvent:function(e){var t=Ct(),l={impl:e};return t.memoizedState=l,function(){if((Ue&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},du={readContext:yt,use:ns,useCallback:af,useContext:yt,useEffect:su,useImperativeHandle:nf,useInsertionEffect:ef,useLayoutEffect:tf,useMemo:sf,useReducer:as,useRef:Fc,useState:function(){return as(zl)},useDebugValue:ru,useDeferredValue:function(e,t){var l=nt();return rf(l,Ye.memoizedState,e,t)},useTransition:function(){var e=as(zl)[0],t=nt().memoizedState;return[typeof e=="boolean"?e:Kn(e),t]},useSyncExternalStore:Hc,useId:ff,useHostTransitionStatus:cu,useFormState:Jc,useActionState:Jc,useOptimistic:function(e,t){var l=nt();return Gc(l,Ye,e,t)},useMemoCache:tu,useCacheRefresh:df};du.useEffectEvent=Pc;var yf={readContext:yt,use:ns,useCallback:af,useContext:yt,useEffect:su,useImperativeHandle:nf,useInsertionEffect:ef,useLayoutEffect:tf,useMemo:sf,useReducer:iu,useRef:Fc,useState:function(){return iu(zl)},useDebugValue:ru,useDeferredValue:function(e,t){var l=nt();return Ye===null?uu(l,e,t):rf(l,Ye.memoizedState,e,t)},useTransition:function(){var e=iu(zl)[0],t=nt().memoizedState;return[typeof e=="boolean"?e:Kn(e),t]},useSyncExternalStore:Hc,useId:ff,useHostTransitionStatus:cu,useFormState:$c,useActionState:$c,useOptimistic:function(e,t){var l=nt();return Ye!==null?Gc(l,Ye,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:tu,useCacheRefresh:df};yf.useEffectEvent=Pc;function hu(e,t,l,i){t=e.memoizedState,l=l(i,t),l=l==null?t:v({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var gu={enqueueSetState:function(e,t,l){e=e._reactInternals;var i=qt(),s=Zl(i);s.payload=t,l!=null&&(s.callback=l),t=Kl(e,s,i),t!==null&&(Dt(t,e,i),Xn(t,e,i))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var i=qt(),s=Zl(i);s.tag=1,s.payload=t,l!=null&&(s.callback=l),t=Kl(e,s,i),t!==null&&(Dt(t,e,i),Xn(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=qt(),i=Zl(l);i.tag=2,t!=null&&(i.callback=t),t=Kl(e,i,l),t!==null&&(Dt(t,e,l),Xn(t,e,l))}};function vf(e,t,l,i,s,u,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,u,f):t.prototype&&t.prototype.isPureReactComponent?!Hn(l,i)||!Hn(s,u):!0}function xf(e,t,l,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,i),t.state!==e&&gu.enqueueReplaceState(t,t.state,null)}function wi(e,t){var l=t;if("ref"in t){l={};for(var i in t)i!=="ref"&&(l[i]=t[i])}if(e=e.defaultProps){l===t&&(l=v({},l));for(var s in e)l[s]===void 0&&(l[s]=e[s])}return l}function bf(e){qa(e)}function Sf(e){console.error(e)}function Ef(e){qa(e)}function os(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function _f(e,t,l){try{var i=e.onCaughtError;i(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function mu(e,t,l){return l=Zl(l),l.tag=3,l.payload={element:null},l.callback=function(){os(e,t)},l}function zf(e){return e=Zl(e),e.tag=3,e}function Cf(e,t,l,i){var s=l.type.getDerivedStateFromError;if(typeof s=="function"){var u=i.value;e.payload=function(){return s(u)},e.callback=function(){_f(t,l,i)}}var f=l.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){_f(t,l,i),typeof s!="function"&&(Pl===null?Pl=new Set([this]):Pl.add(this));var p=i.stack;this.componentDidCatch(i.value,{componentStack:p!==null?p:""})})}function Zg(e,t,l,i,s){if(l.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=l.alternate,t!==null&&Wi(t,l,s,!0),l=kt.current,l!==null){switch(l.tag){case 31:case 13:return $t===null?Ss():l.alternate===null&&lt===0&&(lt=3),l.flags&=-257,l.flags|=65536,l.lanes=s,i===$a?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([i]):t.add(i),qu(e,i,s)),!1;case 22:return l.flags|=65536,i===$a?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([i]):l.add(i)),qu(e,i,s)),!1}throw Error(r(435,l.tag))}return qu(e,i,s),Ss(),!1}if(De)return t=kt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,i!==Nr&&(e=Error(r(422),{cause:i}),Un(Zt(e,l)))):(i!==Nr&&(t=Error(r(423),{cause:i}),Un(Zt(t,l))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,i=Zt(i,l),s=mu(e.stateNode,i,s),Vr(e,s),lt!==4&&(lt=2)),!1;var u=Error(r(520),{cause:i});if(u=Zt(u,l),ia===null?ia=[u]:ia.push(u),lt!==4&&(lt=2),t===null)return!0;i=Zt(i,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=s&-s,l.lanes|=e,e=mu(l.stateNode,i,e),Vr(l,e),!1;case 1:if(t=l.type,u=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Pl===null||!Pl.has(u))))return l.flags|=65536,s&=-s,l.lanes|=s,s=zf(s),Cf(s,e,l,i),Vr(l,s),!1}l=l.return}while(l!==null);return!1}var pu=Error(r(461)),ut=!1;function vt(e,t,l,i){t.child=e===null?wc(t,null,l,i):Ti(t,e.child,l,i)}function Tf(e,t,l,i,s){l=l.render;var u=t.ref;if("ref"in i){var f={};for(var p in i)p!=="ref"&&(f[p]=i[p])}else f=i;return Ei(t),i=Fr(e,t,l,f,u,s),p=Ir(),e!==null&&!ut?(Pr(e,t,s),Cl(e,t,s)):(De&&p&&Dr(t),t.flags|=1,vt(e,t,i,s),t.child)}function Rf(e,t,l,i,s){if(e===null){var u=l.type;return typeof u=="function"&&!jr(u)&&u.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=u,wf(e,t,u,i,s)):(e=Qa(l.type,null,i,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!zu(e,s)){var f=u.memoizedProps;if(l=l.compare,l=l!==null?l:Hn,l(f,i)&&e.ref===t.ref)return Cl(e,t,s)}return t.flags|=1,e=xl(u,i),e.ref=t.ref,e.return=t,t.child=e}function wf(e,t,l,i,s){if(e!==null){var u=e.memoizedProps;if(Hn(u,i)&&e.ref===t.ref)if(ut=!1,t.pendingProps=i=u,zu(e,s))(e.flags&131072)!==0&&(ut=!0);else return t.lanes=e.lanes,Cl(e,t,s)}return yu(e,t,l,i,s)}function jf(e,t,l,i){var s=i.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|l:l,e!==null){for(i=t.child=e.child,s=0;i!==null;)s=s|i.lanes|i.childLanes,i=i.sibling;i=s&~u}else i=0,t.child=null;return Mf(e,t,u,l,i)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ja(t,u!==null?u.cachePool:null),u!==null?Ac(t,u):Kr(),Dc(t);else return i=t.lanes=536870912,Mf(e,t,u!==null?u.baseLanes|l:l,l,i)}else u!==null?(Ja(t,u.cachePool),Ac(t,u),Wl(),t.memoizedState=null):(e!==null&&Ja(t,null),Kr(),Wl());return vt(e,t,s,l),t.child}function $n(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Mf(e,t,l,i,s){var u=Gr();return u=u===null?null:{parent:st._currentValue,pool:u},t.memoizedState={baseLanes:l,cachePool:u},e!==null&&Ja(t,null),Kr(),Dc(t),e!==null&&Wi(e,t,i,!0),t.childLanes=s,null}function cs(e,t){return t=ds({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Af(e,t,l){return Ti(t,e.child,null,l),e=cs(t,t.pendingProps),e.flags|=2,Lt(t),t.memoizedState=null,e}function Kg(e,t,l){var i=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(De){if(i.mode==="hidden")return e=cs(t,i),t.lanes=536870912,$n(null,e);if(Wr(t),(e=Ke)?(e=Xd(e,Wt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gl!==null?{id:ol,overflow:cl}:null,retryLane:536870912,hydrationErrors:null},l=hc(e),l.return=t,t.child=l,pt=t,Ke=null)):e=null,e===null)throw Xl(t);return t.lanes=536870912,null}return cs(t,i)}var u=e.memoizedState;if(u!==null){var f=u.dehydrated;if(Wr(t),s)if(t.flags&256)t.flags&=-257,t=Af(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(r(558));else if(ut||Wi(e,t,l,!1),s=(l&e.childLanes)!==0,ut||s){if(i=Ze,i!==null&&(f=Ra(i,l),f!==0&&f!==u.retryLane))throw u.retryLane=f,vi(e,f),Dt(i,e,f),pu;Ss(),t=Af(e,t,l)}else e=u.treeContext,Ke=Ft(f.nextSibling),pt=t,De=!0,Yl=null,Wt=!1,e!==null&&pc(t,e),t=cs(t,i),t.flags|=4096;return t}return e=xl(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fs(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function yu(e,t,l,i,s){return Ei(t),l=Fr(e,t,l,i,void 0,s),i=Ir(),e!==null&&!ut?(Pr(e,t,s),Cl(e,t,s)):(De&&i&&Dr(t),t.flags|=1,vt(e,t,l,s),t.child)}function Df(e,t,l,i,s,u){return Ei(t),t.updateQueue=null,l=Nc(t,i,l,s),Oc(e),i=Ir(),e!==null&&!ut?(Pr(e,t,u),Cl(e,t,u)):(De&&i&&Dr(t),t.flags|=1,vt(e,t,l,u),t.child)}function Of(e,t,l,i,s){if(Ei(t),t.stateNode===null){var u=Vi,f=l.contextType;typeof f=="object"&&f!==null&&(u=yt(f)),u=new l(i,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=gu,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=i,u.state=t.memoizedState,u.refs={},Xr(t),f=l.contextType,u.context=typeof f=="object"&&f!==null?yt(f):Vi,u.state=t.memoizedState,f=l.getDerivedStateFromProps,typeof f=="function"&&(hu(t,l,f,i),u.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(f=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),f!==u.state&&gu.enqueueReplaceState(u,u.state,null),Vn(t,i,u,s),Qn(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){u=t.stateNode;var p=t.memoizedProps,E=wi(l,p);u.props=E;var M=u.context,L=l.contextType;f=Vi,typeof L=="object"&&L!==null&&(f=yt(L));var Y=l.getDerivedStateFromProps;L=typeof Y=="function"||typeof u.getSnapshotBeforeUpdate=="function",p=t.pendingProps!==p,L||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(p||M!==f)&&xf(t,u,i,f),Vl=!1;var A=t.memoizedState;u.state=A,Vn(t,i,u,s),Qn(),M=t.memoizedState,p||A!==M||Vl?(typeof Y=="function"&&(hu(t,l,Y,i),M=t.memoizedState),(E=Vl||vf(t,l,E,i,A,M,f))?(L||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=M),u.props=i,u.state=M,u.context=f,i=E):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{u=t.stateNode,Qr(e,t),f=t.memoizedProps,L=wi(l,f),u.props=L,Y=t.pendingProps,A=u.context,M=l.contextType,E=Vi,typeof M=="object"&&M!==null&&(E=yt(M)),p=l.getDerivedStateFromProps,(M=typeof p=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(f!==Y||A!==E)&&xf(t,u,i,E),Vl=!1,A=t.memoizedState,u.state=A,Vn(t,i,u,s),Qn();var N=t.memoizedState;f!==Y||A!==N||Vl||e!==null&&e.dependencies!==null&&Za(e.dependencies)?(typeof p=="function"&&(hu(t,l,p,i),N=t.memoizedState),(L=Vl||vf(t,l,L,i,A,N,E)||e!==null&&e.dependencies!==null&&Za(e.dependencies))?(M||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(i,N,E),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(i,N,E)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||f===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=N),u.props=i,u.state=N,u.context=E,i=L):(typeof u.componentDidUpdate!="function"||f===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),i=!1)}return u=i,fs(e,t),i=(t.flags&128)!==0,u||i?(u=t.stateNode,l=i&&typeof l.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&i?(t.child=Ti(t,e.child,null,s),t.child=Ti(t,null,l,s)):vt(e,t,l,s),t.memoizedState=u.state,e=t.child):e=Cl(e,t,s),e}function Nf(e,t,l,i){return bi(),t.flags|=256,vt(e,t,l,i),t.child}var vu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xu(e){return{baseLanes:e,cachePool:Ec()}}function bu(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=Bt),e}function Hf(e,t,l){var i=t.pendingProps,s=!1,u=(t.flags&128)!==0,f;if((f=u)||(f=e!==null&&e.memoizedState===null?!1:(it.current&2)!==0),f&&(s=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(De){if(s?Jl(t):Wl(),(e=Ke)?(e=Xd(e,Wt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Gl!==null?{id:ol,overflow:cl}:null,retryLane:536870912,hydrationErrors:null},l=hc(e),l.return=t,t.child=l,pt=t,Ke=null)):e=null,e===null)throw Xl(t);return lo(e)?t.lanes=32:t.lanes=536870912,null}var p=i.children;return i=i.fallback,s?(Wl(),s=t.mode,p=ds({mode:"hidden",children:p},s),i=xi(i,s,l,null),p.return=t,i.return=t,p.sibling=i,t.child=p,i=t.child,i.memoizedState=xu(l),i.childLanes=bu(e,f,l),t.memoizedState=vu,$n(null,i)):(Jl(t),Su(t,p))}var E=e.memoizedState;if(E!==null&&(p=E.dehydrated,p!==null)){if(u)t.flags&256?(Jl(t),t.flags&=-257,t=Eu(e,t,l)):t.memoizedState!==null?(Wl(),t.child=e.child,t.flags|=128,t=null):(Wl(),p=i.fallback,s=t.mode,i=ds({mode:"visible",children:i.children},s),p=xi(p,s,l,null),p.flags|=2,i.return=t,p.return=t,i.sibling=p,t.child=i,Ti(t,e.child,null,l),i=t.child,i.memoizedState=xu(l),i.childLanes=bu(e,f,l),t.memoizedState=vu,t=$n(null,i));else if(Jl(t),lo(p)){if(f=p.nextSibling&&p.nextSibling.dataset,f)var M=f.dgst;f=M,i=Error(r(419)),i.stack="",i.digest=f,Un({value:i,source:null,stack:null}),t=Eu(e,t,l)}else if(ut||Wi(e,t,l,!1),f=(l&e.childLanes)!==0,ut||f){if(f=Ze,f!==null&&(i=Ra(f,l),i!==0&&i!==E.retryLane))throw E.retryLane=i,vi(e,i),Dt(f,e,i),pu;to(p)||Ss(),t=Eu(e,t,l)}else to(p)?(t.flags|=192,t.child=e.child,t=null):(e=E.treeContext,Ke=Ft(p.nextSibling),pt=t,De=!0,Yl=null,Wt=!1,e!==null&&pc(t,e),t=Su(t,i.children),t.flags|=4096);return t}return s?(Wl(),p=i.fallback,s=t.mode,E=e.child,M=E.sibling,i=xl(E,{mode:"hidden",children:i.children}),i.subtreeFlags=E.subtreeFlags&65011712,M!==null?p=xl(M,p):(p=xi(p,s,l,null),p.flags|=2),p.return=t,i.return=t,i.sibling=p,t.child=i,$n(null,i),i=t.child,p=e.child.memoizedState,p===null?p=xu(l):(s=p.cachePool,s!==null?(E=st._currentValue,s=s.parent!==E?{parent:E,pool:E}:s):s=Ec(),p={baseLanes:p.baseLanes|l,cachePool:s}),i.memoizedState=p,i.childLanes=bu(e,f,l),t.memoizedState=vu,$n(e.child,i)):(Jl(t),l=e.child,e=l.sibling,l=xl(l,{mode:"visible",children:i.children}),l.return=t,l.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=l,t.memoizedState=null,l)}function Su(e,t){return t=ds({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ds(e,t){return e=Ht(22,e,null,t),e.lanes=0,e}function Eu(e,t,l){return Ti(t,e.child,null,l),e=Su(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kf(e,t,l){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Lr(e.return,t,l)}function _u(e,t,l,i,s,u){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:l,tailMode:s,treeForkCount:u}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=i,f.tail=l,f.tailMode=s,f.treeForkCount=u)}function Lf(e,t,l){var i=t.pendingProps,s=i.revealOrder,u=i.tail;i=i.children;var f=it.current,p=(f&2)!==0;if(p?(f=f&1|2,t.flags|=128):f&=1,w(it,f),vt(e,t,i,l),i=De?Ln:0,!p&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&kf(e,l,t);else if(e.tag===19)kf(e,l,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(s){case"forwards":for(l=t.child,s=null;l!==null;)e=l.alternate,e!==null&&es(e)===null&&(s=l),l=l.sibling;l=s,l===null?(s=t.child,t.child=null):(s=l.sibling,l.sibling=null),_u(t,!1,s,l,u,i);break;case"backwards":case"unstable_legacy-backwards":for(l=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&es(e)===null){t.child=s;break}e=s.sibling,s.sibling=l,l=s,s=e}_u(t,!0,l,null,u,i);break;case"together":_u(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function Cl(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Il|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Wi(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,l=xl(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=xl(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function zu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Za(e)))}function Jg(e,t,l){switch(t.tag){case 3:Te(t,t.stateNode.containerInfo),Ql(t,st,e.memoizedState.cache),bi();break;case 27:case 5:Fe(t);break;case 4:Te(t,t.stateNode.containerInfo);break;case 10:Ql(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Wr(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Jl(t),t.flags|=128,null):(l&t.child.childLanes)!==0?Hf(e,t,l):(Jl(t),e=Cl(e,t,l),e!==null?e.sibling:null);Jl(t);break;case 19:var s=(e.flags&128)!==0;if(i=(l&t.childLanes)!==0,i||(Wi(e,t,l,!1),i=(l&t.childLanes)!==0),s){if(i)return Lf(e,t,l);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),w(it,it.current),i)break;return null;case 22:return t.lanes=0,jf(e,t,l,t.pendingProps);case 24:Ql(t,st,e.memoizedState.cache)}return Cl(e,t,l)}function Uf(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)ut=!0;else{if(!zu(e,l)&&(t.flags&128)===0)return ut=!1,Jg(e,t,l);ut=(e.flags&131072)!==0}else ut=!1,De&&(t.flags&1048576)!==0&&mc(t,Ln,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=zi(t.elementType),t.type=e,typeof e=="function")jr(e)?(i=wi(e,i),t.tag=1,t=Of(null,t,e,i,l)):(t.tag=0,t=yu(null,t,e,i,l));else{if(e!=null){var s=e.$$typeof;if(s===se){t.tag=11,t=Tf(null,t,e,i,l);break e}else if(s===G){t.tag=14,t=Rf(null,t,e,i,l);break e}}throw t=ee(e)||e,Error(r(306,t,""))}}return t;case 0:return yu(e,t,t.type,t.pendingProps,l);case 1:return i=t.type,s=wi(i,t.pendingProps),Of(e,t,i,s,l);case 3:e:{if(Te(t,t.stateNode.containerInfo),e===null)throw Error(r(387));i=t.pendingProps;var u=t.memoizedState;s=u.element,Qr(e,t),Vn(t,i,null,l);var f=t.memoizedState;if(i=f.cache,Ql(t,st,i),i!==u.cache&&Ur(t,[st],l,!0),Qn(),i=f.element,u.isDehydrated)if(u={element:i,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=Nf(e,t,i,l);break e}else if(i!==s){s=Zt(Error(r(424)),t),Un(s),t=Nf(e,t,i,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ke=Ft(e.firstChild),pt=t,De=!0,Yl=null,Wt=!0,l=wc(t,null,i,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(bi(),i===s){t=Cl(e,t,l);break e}vt(e,t,i,l)}t=t.child}return t;case 26:return fs(e,t),e===null?(l=Wd(t.type,null,t.pendingProps,null))?t.memoizedState=l:De||(l=t.type,e=t.pendingProps,i=ws(te.current).createElement(l),i[ct]=t,i[St]=e,xt(i,l,e),at(i),t.stateNode=i):t.memoizedState=Wd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Fe(t),e===null&&De&&(i=t.stateNode=Zd(t.type,t.pendingProps,te.current),pt=t,Wt=!0,s=Ke,ii(t.type)?(io=s,Ke=Ft(i.firstChild)):Ke=s),vt(e,t,t.pendingProps.children,l),fs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&De&&((s=i=Ke)&&(i=zm(i,t.type,t.pendingProps,Wt),i!==null?(t.stateNode=i,pt=t,Ke=Ft(i.firstChild),Wt=!1,s=!0):s=!1),s||Xl(t)),Fe(t),s=t.type,u=t.pendingProps,f=e!==null?e.memoizedProps:null,i=u.children,Iu(s,u)?i=null:f!==null&&Iu(s,f)&&(t.flags|=32),t.memoizedState!==null&&(s=Fr(e,t,Bg,null,null,l),fa._currentValue=s),fs(e,t),vt(e,t,i,l),t.child;case 6:return e===null&&De&&((e=l=Ke)&&(l=Cm(l,t.pendingProps,Wt),l!==null?(t.stateNode=l,pt=t,Ke=null,e=!0):e=!1),e||Xl(t)),null;case 13:return Hf(e,t,l);case 4:return Te(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ti(t,null,i,l):vt(e,t,i,l),t.child;case 11:return Tf(e,t,t.type,t.pendingProps,l);case 7:return vt(e,t,t.pendingProps,l),t.child;case 8:return vt(e,t,t.pendingProps.children,l),t.child;case 12:return vt(e,t,t.pendingProps.children,l),t.child;case 10:return i=t.pendingProps,Ql(t,t.type,i.value),vt(e,t,i.children,l),t.child;case 9:return s=t.type._context,i=t.pendingProps.children,Ei(t),s=yt(s),i=i(s),t.flags|=1,vt(e,t,i,l),t.child;case 14:return Rf(e,t,t.type,t.pendingProps,l);case 15:return wf(e,t,t.type,t.pendingProps,l);case 19:return Lf(e,t,l);case 31:return Kg(e,t,l);case 22:return jf(e,t,l,t.pendingProps);case 24:return Ei(t),i=yt(st),e===null?(s=Gr(),s===null&&(s=Ze,u=Br(),s.pooledCache=u,u.refCount++,u!==null&&(s.pooledCacheLanes|=l),s=u),t.memoizedState={parent:i,cache:s},Xr(t),Ql(t,st,s)):((e.lanes&l)!==0&&(Qr(e,t),Vn(t,null,null,l),Qn()),s=e.memoizedState,u=t.memoizedState,s.parent!==i?(s={parent:i,cache:i},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),Ql(t,st,i)):(i=u.cache,Ql(t,st,i),i!==s.cache&&Ur(t,[st],l,!0))),vt(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function Tl(e){e.flags|=4}function Cu(e,t,l,i,s){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(fd())e.flags|=8192;else throw Ci=$a,Yr}else e.flags&=-16777217}function Bf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!eh(t))if(fd())e.flags|=8192;else throw Ci=$a,Yr}function hs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ca():536870912,e.lanes|=t,un|=t)}function Fn(e,t){if(!De)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var i=null;l!==null;)l.alternate!==null&&(i=l),l=l.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Je(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,i=0;if(t)for(var s=e.child;s!==null;)l|=s.lanes|s.childLanes,i|=s.subtreeFlags&65011712,i|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)l|=s.lanes|s.childLanes,i|=s.subtreeFlags,i|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=i,e.childLanes=l,t}function Wg(e,t,l){var i=t.pendingProps;switch(Or(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Je(t),null;case 1:return Je(t),null;case 3:return l=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),El(st),Re(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Ji(t)?Tl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Hr())),Je(t),null;case 26:var s=t.type,u=t.memoizedState;return e===null?(Tl(t),u!==null?(Je(t),Bf(t,u)):(Je(t),Cu(t,s,null,i,l))):u?u!==e.memoizedState?(Tl(t),Je(t),Bf(t,u)):(Je(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&Tl(t),Je(t),Cu(t,s,e,i,l)),null;case 27:if(gt(t),l=te.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Tl(t);else{if(!i){if(t.stateNode===null)throw Error(r(166));return Je(t),null}e=V.current,Ji(t)?yc(t):(e=Zd(s,i,l),t.stateNode=e,Tl(t))}return Je(t),null;case 5:if(gt(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Tl(t);else{if(!i){if(t.stateNode===null)throw Error(r(166));return Je(t),null}if(u=V.current,Ji(t))yc(t);else{var f=ws(te.current);switch(u){case 1:u=f.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:u=f.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":u=f.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":u=f.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":u=f.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof i.is=="string"?f.createElement("select",{is:i.is}):f.createElement("select"),i.multiple?u.multiple=!0:i.size&&(u.size=i.size);break;default:u=typeof i.is=="string"?f.createElement(s,{is:i.is}):f.createElement(s)}}u[ct]=t,u[St]=i;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)u.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=u;e:switch(xt(u,s,i),s){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Tl(t)}}return Je(t),Cu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Tl(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(r(166));if(e=te.current,Ji(t)){if(e=t.stateNode,l=t.memoizedProps,i=null,s=pt,s!==null)switch(s.tag){case 27:case 5:i=s.memoizedProps}e[ct]=t,e=!!(e.nodeValue===l||i!==null&&i.suppressHydrationWarning===!0||Hd(e.nodeValue,l)),e||Xl(t,!0)}else e=ws(e).createTextNode(i),e[ct]=t,t.stateNode=e}return Je(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(i=Ji(t),l!==null){if(e===null){if(!i)throw Error(r(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[ct]=t}else bi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),e=!1}else l=Hr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Lt(t),t):(Lt(t),null);if((t.flags&128)!==0)throw Error(r(558))}return Je(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Ji(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));s[ct]=t}else bi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),s=!1}else s=Hr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(Lt(t),t):(Lt(t),null)}return Lt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=i!==null,e=e!==null&&e.memoizedState!==null,l&&(i=t.child,s=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(s=i.alternate.memoizedState.cachePool.pool),u=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),u!==s&&(i.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),hs(t,t.updateQueue),Je(t),null);case 4:return Re(),e===null&&Ku(t.stateNode.containerInfo),Je(t),null;case 10:return El(t.type),Je(t),null;case 19:if(k(it),i=t.memoizedState,i===null)return Je(t),null;if(s=(t.flags&128)!==0,u=i.rendering,u===null)if(s)Fn(i,!1);else{if(lt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=es(e),u!==null){for(t.flags|=128,Fn(i,!1),e=u.updateQueue,t.updateQueue=e,hs(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)dc(l,e),l=l.sibling;return w(it,it.current&1|2),De&&bl(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&bt()>vs&&(t.flags|=128,s=!0,Fn(i,!1),t.lanes=4194304)}else{if(!s)if(e=es(u),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,hs(t,e),Fn(i,!0),i.tail===null&&i.tailMode==="hidden"&&!u.alternate&&!De)return Je(t),null}else 2*bt()-i.renderingStartTime>vs&&l!==536870912&&(t.flags|=128,s=!0,Fn(i,!1),t.lanes=4194304);i.isBackwards?(u.sibling=t.child,t.child=u):(e=i.last,e!==null?e.sibling=u:t.child=u,i.last=u)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=bt(),e.sibling=null,l=it.current,w(it,s?l&1|2:l&1),De&&bl(t,i.treeForkCount),e):(Je(t),null);case 22:case 23:return Lt(t),Jr(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(l&536870912)!==0&&(t.flags&128)===0&&(Je(t),t.subtreeFlags&6&&(t.flags|=8192)):Je(t),l=t.updateQueue,l!==null&&hs(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==l&&(t.flags|=2048),e!==null&&k(_i),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),El(st),Je(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function $g(e,t){switch(Or(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return El(st),Re(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return gt(t),null;case 31:if(t.memoizedState!==null){if(Lt(t),t.alternate===null)throw Error(r(340));bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Lt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return k(it),null;case 4:return Re(),null;case 10:return El(t.type),null;case 22:case 23:return Lt(t),Jr(),e!==null&&k(_i),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return El(st),null;case 25:return null;default:return null}}function qf(e,t){switch(Or(t),t.tag){case 3:El(st),Re();break;case 26:case 27:case 5:gt(t);break;case 4:Re();break;case 31:t.memoizedState!==null&&Lt(t);break;case 13:Lt(t);break;case 19:k(it);break;case 10:El(t.type);break;case 22:case 23:Lt(t),Jr(),e!==null&&k(_i);break;case 24:El(st)}}function In(e,t){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var s=i.next;l=s;do{if((l.tag&e)===e){i=void 0;var u=l.create,f=l.inst;i=u(),f.destroy=i}l=l.next}while(l!==s)}}catch(p){Ge(t,t.return,p)}}function $l(e,t,l){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var u=s.next;i=u;do{if((i.tag&e)===e){var f=i.inst,p=f.destroy;if(p!==void 0){f.destroy=void 0,s=t;var E=l,M=p;try{M()}catch(L){Ge(s,E,L)}}}i=i.next}while(i!==u)}}catch(L){Ge(t,t.return,L)}}function Gf(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Mc(t,l)}catch(i){Ge(e,e.return,i)}}}function Yf(e,t,l){l.props=wi(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(i){Ge(e,t,i)}}function Pn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof l=="function"?e.refCleanup=l(i):l.current=i}}catch(s){Ge(e,t,s)}}function fl(e,t){var l=e.ref,i=e.refCleanup;if(l!==null)if(typeof i=="function")try{i()}catch(s){Ge(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(s){Ge(e,t,s)}else l.current=null}function Xf(e){var t=e.type,l=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&i.focus();break e;case"img":l.src?i.src=l.src:l.srcSet&&(i.srcset=l.srcSet)}}catch(s){Ge(e,e.return,s)}}function Tu(e,t,l){try{var i=e.stateNode;vm(i,e.type,l,t),i[St]=t}catch(s){Ge(e,e.return,s)}}function Qf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ii(e.type)||e.tag===4}function Ru(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Qf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ii(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function wu(e,t,l){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=yl));else if(i!==4&&(i===27&&ii(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(wu(e,t,l),e=e.sibling;e!==null;)wu(e,t,l),e=e.sibling}function gs(e,t,l){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(i!==4&&(i===27&&ii(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(gs(e,t,l),e=e.sibling;e!==null;)gs(e,t,l),e=e.sibling}function Vf(e){var t=e.stateNode,l=e.memoizedProps;try{for(var i=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);xt(t,i,l),t[ct]=e,t[St]=l}catch(u){Ge(e,e.return,u)}}var Rl=!1,ot=!1,ju=!1,Zf=typeof WeakSet=="function"?WeakSet:Set,ht=null;function Fg(e,t){if(e=e.containerInfo,$u=Hs,e=ic(e),Er(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var i=l.getSelection&&l.getSelection();if(i&&i.rangeCount!==0){l=i.anchorNode;var s=i.anchorOffset,u=i.focusNode;i=i.focusOffset;try{l.nodeType,u.nodeType}catch{l=null;break e}var f=0,p=-1,E=-1,M=0,L=0,Y=e,A=null;t:for(;;){for(var N;Y!==l||s!==0&&Y.nodeType!==3||(p=f+s),Y!==u||i!==0&&Y.nodeType!==3||(E=f+i),Y.nodeType===3&&(f+=Y.nodeValue.length),(N=Y.firstChild)!==null;)A=Y,Y=N;for(;;){if(Y===e)break t;if(A===l&&++M===s&&(p=f),A===u&&++L===i&&(E=f),(N=Y.nextSibling)!==null)break;Y=A,A=Y.parentNode}Y=N}l=p===-1||E===-1?null:{start:p,end:E}}else l=null}l=l||{start:0,end:0}}else l=null;for(Fu={focusedElem:e,selectionRange:l},Hs=!1,ht=t;ht!==null;)if(t=ht,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ht=e;else for(;ht!==null;){switch(t=ht,u=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)s=e[l],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,l=t,s=u.memoizedProps,u=u.memoizedState,i=l.stateNode;try{var ne=wi(l.type,s);e=i.getSnapshotBeforeUpdate(ne,u),i.__reactInternalSnapshotBeforeUpdate=e}catch(ge){Ge(l,l.return,ge)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)eo(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":eo(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(r(163))}if(e=t.sibling,e!==null){e.return=t.return,ht=e;break}ht=t.return}}function Kf(e,t,l){var i=l.flags;switch(l.tag){case 0:case 11:case 15:jl(e,l),i&4&&In(5,l);break;case 1:if(jl(e,l),i&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(f){Ge(l,l.return,f)}else{var s=wi(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){Ge(l,l.return,f)}}i&64&&Gf(l),i&512&&Pn(l,l.return);break;case 3:if(jl(e,l),i&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{Mc(e,t)}catch(f){Ge(l,l.return,f)}}break;case 27:t===null&&i&4&&Vf(l);case 26:case 5:jl(e,l),t===null&&i&4&&Xf(l),i&512&&Pn(l,l.return);break;case 12:jl(e,l);break;case 31:jl(e,l),i&4&&$f(e,l);break;case 13:jl(e,l),i&4&&Ff(e,l),i&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=sm.bind(null,l),Tm(e,l))));break;case 22:if(i=l.memoizedState!==null||Rl,!i){t=t!==null&&t.memoizedState!==null||ot,s=Rl;var u=ot;Rl=i,(ot=t)&&!u?Ml(e,l,(l.subtreeFlags&8772)!==0):jl(e,l),Rl=s,ot=u}break;case 30:break;default:jl(e,l)}}function Jf(e){var t=e.alternate;t!==null&&(e.alternate=null,Jf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Rn(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var $e=null,wt=!1;function wl(e,t,l){for(l=l.child;l!==null;)Wf(e,t,l),l=l.sibling}function Wf(e,t,l){if(et&&typeof et.onCommitFiberUnmount=="function")try{et.onCommitFiberUnmount(Pe,l)}catch{}switch(l.tag){case 26:ot||fl(l,t),wl(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:ot||fl(l,t);var i=$e,s=wt;ii(l.type)&&($e=l.stateNode,wt=!1),wl(e,t,l),ua(l.stateNode),$e=i,wt=s;break;case 5:ot||fl(l,t);case 6:if(i=$e,s=wt,$e=null,wl(e,t,l),$e=i,wt=s,$e!==null)if(wt)try{($e.nodeType===9?$e.body:$e.nodeName==="HTML"?$e.ownerDocument.body:$e).removeChild(l.stateNode)}catch(u){Ge(l,t,u)}else try{$e.removeChild(l.stateNode)}catch(u){Ge(l,t,u)}break;case 18:$e!==null&&(wt?(e=$e,Gd(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),pn(e)):Gd($e,l.stateNode));break;case 4:i=$e,s=wt,$e=l.stateNode.containerInfo,wt=!0,wl(e,t,l),$e=i,wt=s;break;case 0:case 11:case 14:case 15:$l(2,l,t),ot||$l(4,l,t),wl(e,t,l);break;case 1:ot||(fl(l,t),i=l.stateNode,typeof i.componentWillUnmount=="function"&&Yf(l,t,i)),wl(e,t,l);break;case 21:wl(e,t,l);break;case 22:ot=(i=ot)||l.memoizedState!==null,wl(e,t,l),ot=i;break;default:wl(e,t,l)}}function $f(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{pn(e)}catch(l){Ge(t,t.return,l)}}}function Ff(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{pn(e)}catch(l){Ge(t,t.return,l)}}function Ig(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Zf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Zf),t;default:throw Error(r(435,e.tag))}}function ms(e,t){var l=Ig(e);t.forEach(function(i){if(!l.has(i)){l.add(i);var s=rm.bind(null,e,i);i.then(s,s)}})}function jt(e,t){var l=t.deletions;if(l!==null)for(var i=0;i<l.length;i++){var s=l[i],u=e,f=t,p=f;e:for(;p!==null;){switch(p.tag){case 27:if(ii(p.type)){$e=p.stateNode,wt=!1;break e}break;case 5:$e=p.stateNode,wt=!1;break e;case 3:case 4:$e=p.stateNode.containerInfo,wt=!0;break e}p=p.return}if($e===null)throw Error(r(160));Wf(u,f,s),$e=null,wt=!1,u=s.alternate,u!==null&&(u.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)If(t,e),t=t.sibling}var ll=null;function If(e,t){var l=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:jt(t,e),Mt(e),i&4&&($l(3,e,e.return),In(3,e),$l(5,e,e.return));break;case 1:jt(t,e),Mt(e),i&512&&(ot||l===null||fl(l,l.return)),i&64&&Rl&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?i:l.concat(i))));break;case 26:var s=ll;if(jt(t,e),Mt(e),i&512&&(ot||l===null||fl(l,l.return)),i&4){var u=l!==null?l.memoizedState:null;if(i=e.memoizedState,l===null)if(i===null)if(e.stateNode===null){e:{i=e.type,l=e.memoizedProps,s=s.ownerDocument||s;t:switch(i){case"title":u=s.getElementsByTagName("title")[0],(!u||u[Ul]||u[ct]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=s.createElement(i),s.head.insertBefore(u,s.querySelector("head > title"))),xt(u,i,l),u[ct]=e,at(u),i=u;break e;case"link":var f=Id("link","href",s).get(i+(l.href||""));if(f){for(var p=0;p<f.length;p++)if(u=f[p],u.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&u.getAttribute("rel")===(l.rel==null?null:l.rel)&&u.getAttribute("title")===(l.title==null?null:l.title)&&u.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){f.splice(p,1);break t}}u=s.createElement(i),xt(u,i,l),s.head.appendChild(u);break;case"meta":if(f=Id("meta","content",s).get(i+(l.content||""))){for(p=0;p<f.length;p++)if(u=f[p],u.getAttribute("content")===(l.content==null?null:""+l.content)&&u.getAttribute("name")===(l.name==null?null:l.name)&&u.getAttribute("property")===(l.property==null?null:l.property)&&u.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&u.getAttribute("charset")===(l.charSet==null?null:l.charSet)){f.splice(p,1);break t}}u=s.createElement(i),xt(u,i,l),s.head.appendChild(u);break;default:throw Error(r(468,i))}u[ct]=e,at(u),i=u}e.stateNode=i}else Pd(s,e.type,e.stateNode);else e.stateNode=Fd(s,i,e.memoizedProps);else u!==i?(u===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):u.count--,i===null?Pd(s,e.type,e.stateNode):Fd(s,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Tu(e,e.memoizedProps,l.memoizedProps)}break;case 27:jt(t,e),Mt(e),i&512&&(ot||l===null||fl(l,l.return)),l!==null&&i&4&&Tu(e,e.memoizedProps,l.memoizedProps);break;case 5:if(jt(t,e),Mt(e),i&512&&(ot||l===null||fl(l,l.return)),e.flags&32){s=e.stateNode;try{Ui(s,"")}catch(ne){Ge(e,e.return,ne)}}i&4&&e.stateNode!=null&&(s=e.memoizedProps,Tu(e,s,l!==null?l.memoizedProps:s)),i&1024&&(ju=!0);break;case 6:if(jt(t,e),Mt(e),i&4){if(e.stateNode===null)throw Error(r(162));i=e.memoizedProps,l=e.stateNode;try{l.nodeValue=i}catch(ne){Ge(e,e.return,ne)}}break;case 3:if(As=null,s=ll,ll=js(t.containerInfo),jt(t,e),ll=s,Mt(e),i&4&&l!==null&&l.memoizedState.isDehydrated)try{pn(t.containerInfo)}catch(ne){Ge(e,e.return,ne)}ju&&(ju=!1,Pf(e));break;case 4:i=ll,ll=js(e.stateNode.containerInfo),jt(t,e),Mt(e),ll=i;break;case 12:jt(t,e),Mt(e);break;case 31:jt(t,e),Mt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,ms(e,i)));break;case 13:jt(t,e),Mt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(ys=bt()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,ms(e,i)));break;case 22:s=e.memoizedState!==null;var E=l!==null&&l.memoizedState!==null,M=Rl,L=ot;if(Rl=M||s,ot=L||E,jt(t,e),ot=L,Rl=M,Mt(e),i&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(l===null||E||Rl||ot||ji(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){E=l=t;try{if(u=E.stateNode,s)f=u.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{p=E.stateNode;var Y=E.memoizedProps.style,A=Y!=null&&Y.hasOwnProperty("display")?Y.display:null;p.style.display=A==null||typeof A=="boolean"?"":(""+A).trim()}}catch(ne){Ge(E,E.return,ne)}}}else if(t.tag===6){if(l===null){E=t;try{E.stateNode.nodeValue=s?"":E.memoizedProps}catch(ne){Ge(E,E.return,ne)}}}else if(t.tag===18){if(l===null){E=t;try{var N=E.stateNode;s?Yd(N,!0):Yd(E.stateNode,!1)}catch(ne){Ge(E,E.return,ne)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(l=i.retryQueue,l!==null&&(i.retryQueue=null,ms(e,l))));break;case 19:jt(t,e),Mt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,ms(e,i)));break;case 30:break;case 21:break;default:jt(t,e),Mt(e)}}function Mt(e){var t=e.flags;if(t&2){try{for(var l,i=e.return;i!==null;){if(Qf(i)){l=i;break}i=i.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var s=l.stateNode,u=Ru(e);gs(e,u,s);break;case 5:var f=l.stateNode;l.flags&32&&(Ui(f,""),l.flags&=-33);var p=Ru(e);gs(e,p,f);break;case 3:case 4:var E=l.stateNode.containerInfo,M=Ru(e);wu(e,M,E);break;default:throw Error(r(161))}}catch(L){Ge(e,e.return,L)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Pf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Pf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function jl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Kf(e,t.alternate,t),t=t.sibling}function ji(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:$l(4,t,t.return),ji(t);break;case 1:fl(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Yf(t,t.return,l),ji(t);break;case 27:ua(t.stateNode);case 26:case 5:fl(t,t.return),ji(t);break;case 22:t.memoizedState===null&&ji(t);break;case 30:ji(t);break;default:ji(t)}e=e.sibling}}function Ml(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,s=e,u=t,f=u.flags;switch(u.tag){case 0:case 11:case 15:Ml(s,u,l),In(4,u);break;case 1:if(Ml(s,u,l),i=u,s=i.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(M){Ge(i,i.return,M)}if(i=u,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++)jc(E[s],p)}catch(M){Ge(i,i.return,M)}}l&&f&64&&Gf(u),Pn(u,u.return);break;case 27:Vf(u);case 26:case 5:Ml(s,u,l),l&&i===null&&f&4&&Xf(u),Pn(u,u.return);break;case 12:Ml(s,u,l);break;case 31:Ml(s,u,l),l&&f&4&&$f(s,u);break;case 13:Ml(s,u,l),l&&f&4&&Ff(s,u);break;case 22:u.memoizedState===null&&Ml(s,u,l),Pn(u,u.return);break;case 30:break;default:Ml(s,u,l)}t=t.sibling}}function Mu(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&Bn(l))}function Au(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Bn(e))}function il(e,t,l,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ed(e,t,l,i),t=t.sibling}function ed(e,t,l,i){var s=t.flags;switch(t.tag){case 0:case 11:case 15:il(e,t,l,i),s&2048&&In(9,t);break;case 1:il(e,t,l,i);break;case 3:il(e,t,l,i),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Bn(e)));break;case 12:if(s&2048){il(e,t,l,i),e=t.stateNode;try{var u=t.memoizedProps,f=u.id,p=u.onPostCommit;typeof p=="function"&&p(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(E){Ge(t,t.return,E)}}else il(e,t,l,i);break;case 31:il(e,t,l,i);break;case 13:il(e,t,l,i);break;case 23:break;case 22:u=t.stateNode,f=t.alternate,t.memoizedState!==null?u._visibility&2?il(e,t,l,i):ea(e,t):u._visibility&2?il(e,t,l,i):(u._visibility|=2,an(e,t,l,i,(t.subtreeFlags&10256)!==0||!1)),s&2048&&Mu(f,t);break;case 24:il(e,t,l,i),s&2048&&Au(t.alternate,t);break;default:il(e,t,l,i)}}function an(e,t,l,i,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,f=t,p=l,E=i,M=f.flags;switch(f.tag){case 0:case 11:case 15:an(u,f,p,E,s),In(8,f);break;case 23:break;case 22:var L=f.stateNode;f.memoizedState!==null?L._visibility&2?an(u,f,p,E,s):ea(u,f):(L._visibility|=2,an(u,f,p,E,s)),s&&M&2048&&Mu(f.alternate,f);break;case 24:an(u,f,p,E,s),s&&M&2048&&Au(f.alternate,f);break;default:an(u,f,p,E,s)}t=t.sibling}}function ea(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,i=t,s=i.flags;switch(i.tag){case 22:ea(l,i),s&2048&&Mu(i.alternate,i);break;case 24:ea(l,i),s&2048&&Au(i.alternate,i);break;default:ea(l,i)}t=t.sibling}}var ta=8192;function sn(e,t,l){if(e.subtreeFlags&ta)for(e=e.child;e!==null;)td(e,t,l),e=e.sibling}function td(e,t,l){switch(e.tag){case 26:sn(e,t,l),e.flags&ta&&e.memoizedState!==null&&Um(l,ll,e.memoizedState,e.memoizedProps);break;case 5:sn(e,t,l);break;case 3:case 4:var i=ll;ll=js(e.stateNode.containerInfo),sn(e,t,l),ll=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=ta,ta=16777216,sn(e,t,l),ta=i):sn(e,t,l));break;default:sn(e,t,l)}}function ld(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function la(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var i=t[l];ht=i,nd(i,e)}ld(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)id(e),e=e.sibling}function id(e){switch(e.tag){case 0:case 11:case 15:la(e),e.flags&2048&&$l(9,e,e.return);break;case 3:la(e);break;case 12:la(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ps(e)):la(e);break;default:la(e)}}function ps(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var i=t[l];ht=i,nd(i,e)}ld(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:$l(8,t,t.return),ps(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,ps(t));break;default:ps(t)}e=e.sibling}}function nd(e,t){for(;ht!==null;){var l=ht;switch(l.tag){case 0:case 11:case 15:$l(8,l,t);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:Bn(l.memoizedState.cache)}if(i=l.child,i!==null)i.return=l,ht=i;else e:for(l=e;ht!==null;){i=ht;var s=i.sibling,u=i.return;if(Jf(i),i===l){ht=null;break e}if(s!==null){s.return=u,ht=s;break e}ht=u}}}var Pg={getCacheForType:function(e){var t=yt(st),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return yt(st).controller.signal}},em=typeof WeakMap=="function"?WeakMap:Map,Ue=0,Ze=null,we=null,Me=0,qe=0,Ut=null,Fl=!1,rn=!1,Du=!1,Al=0,lt=0,Il=0,Mi=0,Ou=0,Bt=0,un=0,ia=null,At=null,Nu=!1,ys=0,ad=0,vs=1/0,xs=null,Pl=null,dt=0,ei=null,on=null,Dl=0,Hu=0,ku=null,sd=null,na=0,Lu=null;function qt(){return(Ue&2)!==0&&Me!==0?Me&-Me:C.T!==null?Xu():Cn()}function rd(){if(Bt===0)if((Me&536870912)===0||De){var e=Hi;Hi<<=1,(Hi&3932160)===0&&(Hi=262144),Bt=e}else Bt=536870912;return e=kt.current,e!==null&&(e.flags|=32),Bt}function Dt(e,t,l){(e===Ze&&(qe===2||qe===9)||e.cancelPendingCommit!==null)&&(cn(e,0),ti(e,Me,Bt,!1)),hi(e,l),((Ue&2)===0||e!==Ze)&&(e===Ze&&((Ue&2)===0&&(Mi|=l),lt===4&&ti(e,Me,Bt,!1)),dl(e))}function ud(e,t,l){if((Ue&6)!==0)throw Error(r(327));var i=!l&&(t&127)===0&&(t&e.expiredLanes)===0||di(e,t),s=i?im(e,t):Bu(e,t,!0),u=i;do{if(s===0){rn&&!i&&ti(e,t,0,!1);break}else{if(l=e.current.alternate,u&&!tm(l)){s=Bu(e,t,!1),u=!1;continue}if(s===2){if(u=t,e.errorRecoveryDisabledLanes&u)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var p=e;s=ia;var E=p.current.memoizedState.isDehydrated;if(E&&(cn(p,f).flags|=256),f=Bu(p,f,!1),f!==2){if(Du&&!E){p.errorRecoveryDisabledLanes|=u,Mi|=u,s=4;break e}u=At,At=s,u!==null&&(At===null?At=u:At.push.apply(At,u))}s=f}if(u=!1,s!==2)continue}}if(s===1){cn(e,0),ti(e,t,0,!0);break}e:{switch(i=e,u=s,u){case 0:case 1:throw Error(r(345));case 4:if((t&4194048)!==t)break;case 6:ti(i,t,Bt,!Fl);break e;case 2:At=null;break;case 3:case 5:break;default:throw Error(r(329))}if((t&62914560)===t&&(s=ys+300-bt(),10<s)){if(ti(i,t,Bt,!Fl),sl(i,0,!0)!==0)break e;Dl=t,i.timeoutHandle=Bd(od.bind(null,i,l,At,xs,Nu,t,Bt,Mi,un,Fl,u,"Throttled",-0,0),s);break e}od(i,l,At,xs,Nu,t,Bt,Mi,un,Fl,u,null,-0,0)}}break}while(!0);dl(e)}function od(e,t,l,i,s,u,f,p,E,M,L,Y,A,N){if(e.timeoutHandle=-1,Y=t.subtreeFlags,Y&8192||(Y&16785408)===16785408){Y={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yl},td(t,u,Y);var ne=(u&62914560)===u?ys-bt():(u&4194048)===u?ad-bt():0;if(ne=Bm(Y,ne),ne!==null){Dl=u,e.cancelPendingCommit=ne(yd.bind(null,e,t,u,l,i,s,f,p,E,L,Y,null,A,N)),ti(e,u,f,!M);return}}yd(e,t,u,l,i,s,f,p,E)}function tm(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var i=0;i<l.length;i++){var s=l[i],u=s.getSnapshot;s=s.value;try{if(!Nt(u(),s))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ti(e,t,l,i){t&=~Ou,t&=~Mi,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var s=t;0<s;){var u=31-Le(s),f=1<<u;i[u]=-1,s&=~f}l!==0&&Ta(e,l,t)}function bs(){return(Ue&6)===0?(aa(0),!1):!0}function Uu(){if(we!==null){if(qe===0)var e=we.return;else e=we,Sl=Si=null,eu(e),Pi=null,Gn=0,e=we;for(;e!==null;)qf(e.alternate,e),e=e.return;we=null}}function cn(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Sm(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Dl=0,Uu(),Ze=e,we=l=xl(e.current,null),Me=t,qe=0,Ut=null,Fl=!1,rn=di(e,t),Du=!1,un=Bt=Ou=Mi=Il=lt=0,At=ia=null,Nu=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var s=31-Le(i),u=1<<s;t|=e[s],i&=~u}return Al=t,Ga(),l}function cd(e,t){ze=null,C.H=Wn,t===Ii||t===Wa?(t=Cc(),qe=3):t===Yr?(t=Cc(),qe=4):qe=t===pu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ut=t,we===null&&(lt=1,os(e,Zt(t,e.current)))}function fd(){var e=kt.current;return e===null?!0:(Me&4194048)===Me?$t===null:(Me&62914560)===Me||(Me&536870912)!==0?e===$t:!1}function dd(){var e=C.H;return C.H=Wn,e===null?Wn:e}function hd(){var e=C.A;return C.A=Pg,e}function Ss(){lt=4,Fl||(Me&4194048)!==Me&&kt.current!==null||(rn=!0),(Il&134217727)===0&&(Mi&134217727)===0||Ze===null||ti(Ze,Me,Bt,!1)}function Bu(e,t,l){var i=Ue;Ue|=2;var s=dd(),u=hd();(Ze!==e||Me!==t)&&(xs=null,cn(e,t)),t=!1;var f=lt;e:do try{if(qe!==0&&we!==null){var p=we,E=Ut;switch(qe){case 8:Uu(),f=6;break e;case 3:case 2:case 9:case 6:kt.current===null&&(t=!0);var M=qe;if(qe=0,Ut=null,fn(e,p,E,M),l&&rn){f=0;break e}break;default:M=qe,qe=0,Ut=null,fn(e,p,E,M)}}lm(),f=lt;break}catch(L){cd(e,L)}while(!0);return t&&e.shellSuspendCounter++,Sl=Si=null,Ue=i,C.H=s,C.A=u,we===null&&(Ze=null,Me=0,Ga()),f}function lm(){for(;we!==null;)gd(we)}function im(e,t){var l=Ue;Ue|=2;var i=dd(),s=hd();Ze!==e||Me!==t?(xs=null,vs=bt()+500,cn(e,t)):rn=di(e,t);e:do try{if(qe!==0&&we!==null){t=we;var u=Ut;t:switch(qe){case 1:qe=0,Ut=null,fn(e,t,u,1);break;case 2:case 9:if(_c(u)){qe=0,Ut=null,md(t);break}t=function(){qe!==2&&qe!==9||Ze!==e||(qe=7),dl(e)},u.then(t,t);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:_c(u)?(qe=0,Ut=null,md(t)):(qe=0,Ut=null,fn(e,t,u,7));break;case 5:var f=null;switch(we.tag){case 26:f=we.memoizedState;case 5:case 27:var p=we;if(f?eh(f):p.stateNode.complete){qe=0,Ut=null;var E=p.sibling;if(E!==null)we=E;else{var M=p.return;M!==null?(we=M,Es(M)):we=null}break t}}qe=0,Ut=null,fn(e,t,u,5);break;case 6:qe=0,Ut=null,fn(e,t,u,6);break;case 8:Uu(),lt=6;break e;default:throw Error(r(462))}}nm();break}catch(L){cd(e,L)}while(!0);return Sl=Si=null,C.H=i,C.A=s,Ue=l,we!==null?0:(Ze=null,Me=0,Ga(),lt)}function nm(){for(;we!==null&&!ba();)gd(we)}function gd(e){var t=Uf(e.alternate,e,Al);e.memoizedProps=e.pendingProps,t===null?Es(e):we=t}function md(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Df(l,t,t.pendingProps,t.type,void 0,Me);break;case 11:t=Df(l,t,t.pendingProps,t.type.render,t.ref,Me);break;case 5:eu(t);default:qf(l,t),t=we=dc(t,Al),t=Uf(l,t,Al)}e.memoizedProps=e.pendingProps,t===null?Es(e):we=t}function fn(e,t,l,i){Sl=Si=null,eu(t),Pi=null,Gn=0;var s=t.return;try{if(Zg(e,s,t,l,Me)){lt=1,os(e,Zt(l,e.current)),we=null;return}}catch(u){if(s!==null)throw we=s,u;lt=1,os(e,Zt(l,e.current)),we=null;return}t.flags&32768?(De||i===1?e=!0:rn||(Me&536870912)!==0?e=!1:(Fl=e=!0,(i===2||i===9||i===3||i===6)&&(i=kt.current,i!==null&&i.tag===13&&(i.flags|=16384))),pd(t,e)):Es(t)}function Es(e){var t=e;do{if((t.flags&32768)!==0){pd(t,Fl);return}e=t.return;var l=Wg(t.alternate,t,Al);if(l!==null){we=l;return}if(t=t.sibling,t!==null){we=t;return}we=t=e}while(t!==null);lt===0&&(lt=5)}function pd(e,t){do{var l=$g(e.alternate,e);if(l!==null){l.flags&=32767,we=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){we=e;return}we=e=l}while(e!==null);lt=6,we=null}function yd(e,t,l,i,s,u,f,p,E){e.cancelPendingCommit=null;do _s();while(dt!==0);if((Ue&6)!==0)throw Error(r(327));if(t!==null){if(t===e.current)throw Error(r(177));if(u=t.lanes|t.childLanes,u|=Rr,nr(e,l,u,f,p,E),e===Ze&&(we=Ze=null,Me=0),on=t,ei=e,Dl=l,Hu=u,ku=s,sd=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,um(ci,function(){return Ed(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=C.T,C.T=null,s=X.p,X.p=2,f=Ue,Ue|=4;try{Fg(e,t,l)}finally{Ue=f,X.p=s,C.T=i}}dt=1,vd(),xd(),bd()}}function vd(){if(dt===1){dt=0;var e=ei,t=on,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=C.T,C.T=null;var i=X.p;X.p=2;var s=Ue;Ue|=4;try{If(t,e);var u=Fu,f=ic(e.containerInfo),p=u.focusedElem,E=u.selectionRange;if(f!==p&&p&&p.ownerDocument&&lc(p.ownerDocument.documentElement,p)){if(E!==null&&Er(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 Y=p.ownerDocument||document,A=Y&&Y.defaultView||window;if(A.getSelection){var N=A.getSelection(),ne=p.textContent.length,ge=Math.min(E.start,ne),Qe=E.end===void 0?ge:Math.min(E.end,ne);!N.extend&&ge>Qe&&(f=Qe,Qe=ge,ge=f);var R=tc(p,ge),z=tc(p,Qe);if(R&&z&&(N.rangeCount!==1||N.anchorNode!==R.node||N.anchorOffset!==R.offset||N.focusNode!==z.node||N.focusOffset!==z.offset)){var j=Y.createRange();j.setStart(R.node,R.offset),N.removeAllRanges(),ge>Qe?(N.addRange(j),N.extend(z.node,z.offset)):(j.setEnd(z.node,z.offset),N.addRange(j))}}}}for(Y=[],N=p;N=N.parentNode;)N.nodeType===1&&Y.push({element:N,left:N.scrollLeft,top:N.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<Y.length;p++){var q=Y[p];q.element.scrollLeft=q.left,q.element.scrollTop=q.top}}Hs=!!$u,Fu=$u=null}finally{Ue=s,X.p=i,C.T=l}}e.current=t,dt=2}}function xd(){if(dt===2){dt=0;var e=ei,t=on,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=C.T,C.T=null;var i=X.p;X.p=2;var s=Ue;Ue|=4;try{Kf(e,t.alternate,t)}finally{Ue=s,X.p=i,C.T=l}}dt=3}}function bd(){if(dt===4||dt===3){dt=0,Sa();var e=ei,t=on,l=Dl,i=sd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?dt=5:(dt=0,on=ei=null,Sd(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Pl=null),gi(l),t=t.stateNode,et&&typeof et.onCommitFiberRoot=="function")try{et.onCommitFiberRoot(Pe,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=C.T,s=X.p,X.p=2,C.T=null;try{for(var u=e.onRecoverableError,f=0;f<i.length;f++){var p=i[f];u(p.value,{componentStack:p.stack})}}finally{C.T=t,X.p=s}}(Dl&3)!==0&&_s(),dl(e),s=e.pendingLanes,(l&261930)!==0&&(s&42)!==0?e===Lu?na++:(na=0,Lu=e):na=0,aa(0)}}function Sd(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Bn(t)))}function _s(){return vd(),xd(),bd(),Ed()}function Ed(){if(dt!==5)return!1;var e=ei,t=Hu;Hu=0;var l=gi(Dl),i=C.T,s=X.p;try{X.p=32>l?32:l,C.T=null,l=ku,ku=null;var u=ei,f=Dl;if(dt=0,on=ei=null,Dl=0,(Ue&6)!==0)throw Error(r(331));var p=Ue;if(Ue|=4,id(u.current),ed(u,u.current,f,l),Ue=p,aa(0,!1),et&&typeof et.onPostCommitFiberRoot=="function")try{et.onPostCommitFiberRoot(Pe,u)}catch{}return!0}finally{X.p=s,C.T=i,Sd(e,t)}}function _d(e,t,l){t=Zt(l,t),t=mu(e.stateNode,t,2),e=Kl(e,t,2),e!==null&&(hi(e,2),dl(e))}function Ge(e,t,l){if(e.tag===3)_d(e,e,l);else for(;t!==null;){if(t.tag===3){_d(t,e,l);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Pl===null||!Pl.has(i))){e=Zt(l,e),l=zf(2),i=Kl(t,l,2),i!==null&&(Cf(l,i,t,e),hi(i,2),dl(i));break}}t=t.return}}function qu(e,t,l){var i=e.pingCache;if(i===null){i=e.pingCache=new em;var s=new Set;i.set(t,s)}else s=i.get(t),s===void 0&&(s=new Set,i.set(t,s));s.has(l)||(Du=!0,s.add(l),e=am.bind(null,e,t,l),t.then(e,e))}function am(e,t,l){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Ze===e&&(Me&l)===l&&(lt===4||lt===3&&(Me&62914560)===Me&&300>bt()-ys?(Ue&2)===0&&cn(e,0):Ou|=l,un===Me&&(un=0)),dl(e)}function zd(e,t){t===0&&(t=Ca()),e=vi(e,t),e!==null&&(hi(e,t),dl(e))}function sm(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),zd(e,l)}function rm(e,t){var l=0;switch(e.tag){case 31:case 13:var i=e.stateNode,s=e.memoizedState;s!==null&&(l=s.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(r(314))}i!==null&&i.delete(t),zd(e,l)}function um(e,t){return Oi(e,t)}var zs=null,dn=null,Gu=!1,Cs=!1,Yu=!1,li=0;function dl(e){e!==dn&&e.next===null&&(dn===null?zs=dn=e:dn=dn.next=e),Cs=!0,Gu||(Gu=!0,cm())}function aa(e,t){if(!Yu&&Cs){Yu=!0;do for(var l=!1,i=zs;i!==null;){if(e!==0){var s=i.pendingLanes;if(s===0)var u=0;else{var f=i.suspendedLanes,p=i.pingedLanes;u=(1<<31-Le(42|e)+1)-1,u&=s&~(f&~p),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(l=!0,wd(i,u))}else u=Me,u=sl(i,i===Ze?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(u&3)===0||di(i,u)||(l=!0,wd(i,u));i=i.next}while(l);Yu=!1}}function om(){Cd()}function Cd(){Cs=Gu=!1;var e=0;li!==0&&bm()&&(e=li);for(var t=bt(),l=null,i=zs;i!==null;){var s=i.next,u=Td(i,t);u===0?(i.next=null,l===null?zs=s:l.next=s,s===null&&(dn=l)):(l=i,(e!==0||(u&3)!==0)&&(Cs=!0)),i=s}dt!==0&&dt!==5||aa(e),li!==0&&(li=0)}function Td(e,t){for(var l=e.suspendedLanes,i=e.pingedLanes,s=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var f=31-Le(u),p=1<<f,E=s[f];E===-1?((p&l)===0||(p&i)!==0)&&(s[f]=ir(p,t)):E<=t&&(e.expiredLanes|=p),u&=~p}if(t=Ze,l=Me,l=sl(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,l===0||e===t&&(qe===2||qe===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Ni(i),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||di(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(i!==null&&Ni(i),gi(l)){case 2:case 8:l=Hl;break;case 32:l=ci;break;case 268435456:l=Sn;break;default:l=ci}return i=Rd.bind(null,e),l=Oi(l,i),e.callbackPriority=t,e.callbackNode=l,t}return i!==null&&i!==null&&Ni(i),e.callbackPriority=2,e.callbackNode=null,2}function Rd(e,t){if(dt!==0&&dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(_s()&&e.callbackNode!==l)return null;var i=Me;return i=sl(e,e===Ze?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(ud(e,i,t),Td(e,bt()),e.callbackNode!=null&&e.callbackNode===l?Rd.bind(null,e):null)}function wd(e,t){if(_s())return null;ud(e,t,!0)}function cm(){Em(function(){(Ue&6)!==0?Oi(bn,om):Cd()})}function Xu(){if(li===0){var e=$i;e===0&&(e=kl,kl<<=1,(kl&261888)===0&&(kl=256)),li=e}return li}function jd(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Oa(""+e)}function Md(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function fm(e,t,l,i,s){if(t==="submit"&&l&&l.stateNode===s){var u=jd((s[St]||null).action),f=i.submitter;f&&(t=(t=f[St]||null)?jd(t.formAction):f.getAttribute("formAction"),t!==null&&(u=t,f=null));var p=new La("action","action",null,i,s);e.push({event:p,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(li!==0){var E=f?Md(s,f):new FormData(s);ou(l,{pending:!0,data:E,method:s.method,action:u},null,E)}}else typeof u=="function"&&(p.preventDefault(),E=f?Md(s,f):new FormData(s),ou(l,{pending:!0,data:E,method:s.method,action:u},u,E))},currentTarget:s}]})}}for(var Qu=0;Qu<Tr.length;Qu++){var Vu=Tr[Qu],dm=Vu.toLowerCase(),hm=Vu[0].toUpperCase()+Vu.slice(1);tl(dm,"on"+hm)}tl(sc,"onAnimationEnd"),tl(rc,"onAnimationIteration"),tl(uc,"onAnimationStart"),tl("dblclick","onDoubleClick"),tl("focusin","onFocus"),tl("focusout","onBlur"),tl(jg,"onTransitionRun"),tl(Mg,"onTransitionStart"),tl(Ag,"onTransitionCancel"),tl(oc,"onTransitionEnd"),J("onMouseEnter",["mouseout","mouseover"]),J("onMouseLeave",["mouseout","mouseover"]),J("onPointerEnter",["pointerout","pointerover"]),J("onPointerLeave",["pointerout","pointerover"]),U("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),U("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),U("onBeforeInput",["compositionend","keypress","textInput","paste"]),U("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),U("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),U("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var sa="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(" "),gm=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(sa));function Ad(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var i=e[l],s=i.event;i=i.listeners;e:{var u=void 0;if(t)for(var f=i.length-1;0<=f;f--){var p=i[f],E=p.instance,M=p.currentTarget;if(p=p.listener,E!==u&&s.isPropagationStopped())break e;u=p,s.currentTarget=M;try{u(s)}catch(L){qa(L)}s.currentTarget=null,u=E}else for(f=0;f<i.length;f++){if(p=i[f],E=p.instance,M=p.currentTarget,p=p.listener,E!==u&&s.isPropagationStopped())break e;u=p,s.currentTarget=M;try{u(s)}catch(L){qa(L)}s.currentTarget=null,u=E}}}}function je(e,t){var l=t[Tn];l===void 0&&(l=t[Tn]=new Set);var i=e+"__bubble";l.has(i)||(Dd(t,e,2,!1),l.add(i))}function Zu(e,t,l){var i=0;t&&(i|=4),Dd(l,e,i,t)}var Ts="_reactListening"+Math.random().toString(36).slice(2);function Ku(e){if(!e[Ts]){e[Ts]=!0,Et.forEach(function(l){l!=="selectionchange"&&(gm.has(l)||Zu(l,!1,e),Zu(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ts]||(t[Ts]=!0,Zu("selectionchange",!1,t))}}function Dd(e,t,l,i){switch(rh(t)){case 2:var s=Ym;break;case 8:s=Xm;break;default:s=uo}l=s.bind(null,t,l,e),s=void 0,!hr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),i?s!==void 0?e.addEventListener(t,l,{capture:!0,passive:s}):e.addEventListener(t,l,!0):s!==void 0?e.addEventListener(t,l,{passive:s}):e.addEventListener(t,l,!1)}function Ju(e,t,l,i,s){var u=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var f=i.tag;if(f===3||f===4){var p=i.stateNode.containerInfo;if(p===s)break;if(f===4)for(f=i.return;f!==null;){var E=f.tag;if((E===3||E===4)&&f.stateNode.containerInfo===s)return;f=f.return}for(;p!==null;){if(f=pl(p),f===null)return;if(E=f.tag,E===5||E===6||E===26||E===27){i=u=f;continue e}p=p.parentNode}}i=i.return}ko(function(){var M=u,L=fr(l),Y=[];e:{var A=cc.get(e);if(A!==void 0){var N=La,ne=e;switch(e){case"keypress":if(Ha(l)===0)break e;case"keydown":case"keyup":N=rg;break;case"focusin":ne="focus",N=yr;break;case"focusout":ne="blur",N=yr;break;case"beforeblur":case"afterblur":N=yr;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":N=Bo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":N=Wh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":N=cg;break;case sc:case rc:case uc:N=Ih;break;case oc:N=dg;break;case"scroll":case"scrollend":N=Kh;break;case"wheel":N=gg;break;case"copy":case"cut":case"paste":N=eg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":N=Go;break;case"toggle":case"beforetoggle":N=pg}var ge=(t&4)!==0,Qe=!ge&&(e==="scroll"||e==="scrollend"),R=ge?A!==null?A+"Capture":null:A;ge=[];for(var z=M,j;z!==null;){var q=z;if(j=q.stateNode,q=q.tag,q!==5&&q!==26&&q!==27||j===null||R===null||(q=wn(z,R),q!=null&&ge.push(ra(z,q,j))),Qe)break;z=z.return}0<ge.length&&(A=new N(A,ne,null,l,L),Y.push({event:A,listeners:ge}))}}if((t&7)===0){e:{if(A=e==="mouseover"||e==="pointerover",N=e==="mouseout"||e==="pointerout",A&&l!==cr&&(ne=l.relatedTarget||l.fromElement)&&(pl(ne)||ne[Ll]))break e;if((N||A)&&(A=L.window===L?L:(A=L.ownerDocument)?A.defaultView||A.parentWindow:window,N?(ne=l.relatedTarget||l.toElement,N=M,ne=ne?pl(ne):null,ne!==null&&(Qe=c(ne),ge=ne.tag,ne!==Qe||ge!==5&&ge!==27&&ge!==6)&&(ne=null)):(N=null,ne=M),N!==ne)){if(ge=Bo,q="onMouseLeave",R="onMouseEnter",z="mouse",(e==="pointerout"||e==="pointerover")&&(ge=Go,q="onPointerLeave",R="onPointerEnter",z="pointer"),Qe=N==null?A:ul(N),j=ne==null?A:ul(ne),A=new ge(q,z+"leave",N,l,L),A.target=Qe,A.relatedTarget=j,q=null,pl(L)===M&&(ge=new ge(R,z+"enter",ne,l,L),ge.target=j,ge.relatedTarget=Qe,q=ge),Qe=q,N&&ne)t:{for(ge=mm,R=N,z=ne,j=0,q=R;q;q=ge(q))j++;q=0;for(var fe=z;fe;fe=ge(fe))q++;for(;0<j-q;)R=ge(R),j--;for(;0<q-j;)z=ge(z),q--;for(;j--;){if(R===z||z!==null&&R===z.alternate){ge=R;break t}R=ge(R),z=ge(z)}ge=null}else ge=null;N!==null&&Od(Y,A,N,ge,!1),ne!==null&&Qe!==null&&Od(Y,Qe,ne,ge,!0)}}e:{if(A=M?ul(M):window,N=A.nodeName&&A.nodeName.toLowerCase(),N==="select"||N==="input"&&A.type==="file")var He=Wo;else if(Ko(A))if($o)He=Tg;else{He=zg;var oe=_g}else N=A.nodeName,!N||N.toLowerCase()!=="input"||A.type!=="checkbox"&&A.type!=="radio"?M&&or(M.elementType)&&(He=Wo):He=Cg;if(He&&(He=He(e,M))){Jo(Y,He,l,L);break e}oe&&oe(e,A,M),e==="focusout"&&M&&A.type==="number"&&M.memoizedProps.value!=null&&ur(A,"number",A.value)}switch(oe=M?ul(M):window,e){case"focusin":(Ko(oe)||oe.contentEditable==="true")&&(Yi=oe,_r=M,kn=null);break;case"focusout":kn=_r=Yi=null;break;case"mousedown":zr=!0;break;case"contextmenu":case"mouseup":case"dragend":zr=!1,nc(Y,l,L);break;case"selectionchange":if(wg)break;case"keydown":case"keyup":nc(Y,l,L)}var Ce;if(xr)e:{switch(e){case"compositionstart":var Ae="onCompositionStart";break e;case"compositionend":Ae="onCompositionEnd";break e;case"compositionupdate":Ae="onCompositionUpdate";break e}Ae=void 0}else Gi?Vo(e,l)&&(Ae="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Ae="onCompositionStart");Ae&&(Yo&&l.locale!=="ko"&&(Gi||Ae!=="onCompositionStart"?Ae==="onCompositionEnd"&&Gi&&(Ce=Lo()):(ql=L,gr="value"in ql?ql.value:ql.textContent,Gi=!0)),oe=Rs(M,Ae),0<oe.length&&(Ae=new qo(Ae,e,null,l,L),Y.push({event:Ae,listeners:oe}),Ce?Ae.data=Ce:(Ce=Zo(l),Ce!==null&&(Ae.data=Ce)))),(Ce=vg?xg(e,l):bg(e,l))&&(Ae=Rs(M,"onBeforeInput"),0<Ae.length&&(oe=new qo("onBeforeInput","beforeinput",null,l,L),Y.push({event:oe,listeners:Ae}),oe.data=Ce)),fm(Y,e,M,l,L)}Ad(Y,t)})}function ra(e,t,l){return{instance:e,listener:t,currentTarget:l}}function Rs(e,t){for(var l=t+"Capture",i=[];e!==null;){var s=e,u=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||u===null||(s=wn(e,l),s!=null&&i.unshift(ra(e,s,u)),s=wn(e,t),s!=null&&i.push(ra(e,s,u))),e.tag===3)return i;e=e.return}return[]}function mm(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(e,t,l,i,s){for(var u=t._reactName,f=[];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=wn(l,u),M!=null&&f.unshift(ra(l,M,E))):s||(M=wn(l,u),M!=null&&f.push(ra(l,M,E)))),l=l.return}f.length!==0&&e.push({event:t,listeners:f})}var pm=/\r\n?/g,ym=/\u0000|\uFFFD/g;function Nd(e){return(typeof e=="string"?e:""+e).replace(pm,`
`).replace(ym,"")}function Hd(e,t){return t=Nd(t),Nd(e)===t}function Xe(e,t,l,i,s,u){switch(l){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Ui(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Ui(e,""+i);break;case"className":mt(e,"class",i);break;case"tabIndex":mt(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":mt(e,l,i);break;case"style":No(e,i,u);break;case"data":if(t!=="object"){mt(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(l);break}i=Oa(""+i),e.setAttribute(l,i);break;case"action":case"formAction":if(typeof i=="function"){e.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 u=="function"&&(l==="formAction"?(t!=="input"&&Xe(e,t,"name",s.name,s,null),Xe(e,t,"formEncType",s.formEncType,s,null),Xe(e,t,"formMethod",s.formMethod,s,null),Xe(e,t,"formTarget",s.formTarget,s,null)):(Xe(e,t,"encType",s.encType,s,null),Xe(e,t,"method",s.method,s,null),Xe(e,t,"target",s.target,s,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(l);break}i=Oa(""+i),e.setAttribute(l,i);break;case"onClick":i!=null&&(e.onclick=yl);break;case"onScroll":i!=null&&je("scroll",e);break;case"onScrollEnd":i!=null&&je("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(r(61));if(l=i.__html,l!=null){if(s.children!=null)throw Error(r(60));e.innerHTML=l}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.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"){e.removeAttribute("xlink:href");break}l=Oa(""+i),e.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"?e.setAttribute(l,""+i):e.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"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":i===!0?e.setAttribute(l,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(l,i):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(l,i):e.removeAttribute(l);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(l):e.setAttribute(l,i);break;case"popover":je("beforetoggle",e),je("toggle",e),Ve(e,"popover",i);break;case"xlinkActuate":_t(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":_t(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":_t(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":_t(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":_t(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":_t(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":_t(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":_t(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":_t(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Ve(e,"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=Vh.get(l)||l,Ve(e,l,i))}}function Wu(e,t,l,i,s,u){switch(l){case"style":No(e,i,u);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(r(61));if(l=i.__html,l!=null){if(s.children!=null)throw Error(r(60));e.innerHTML=l}}break;case"children":typeof i=="string"?Ui(e,i):(typeof i=="number"||typeof i=="bigint")&&Ui(e,""+i);break;case"onScroll":i!=null&&je("scroll",e);break;case"onScrollEnd":i!=null&&je("scrollend",e);break;case"onClick":i!=null&&(e.onclick=yl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!x.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(s=l.endsWith("Capture"),t=l.slice(2,s?l.length-7:void 0),u=e[St]||null,u=u!=null?u[l]:null,typeof u=="function"&&e.removeEventListener(t,u,s),typeof i=="function")){typeof u!="function"&&u!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,i,s);break e}l in e?e[l]=i:i===!0?e.setAttribute(l,""):Ve(e,l,i)}}}function xt(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":je("error",e),je("load",e);var i=!1,s=!1,u;for(u in l)if(l.hasOwnProperty(u)){var f=l[u];if(f!=null)switch(u){case"src":i=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:Xe(e,t,u,f,l,null)}}s&&Xe(e,t,"srcSet",l.srcSet,l,null),i&&Xe(e,t,"src",l.src,l,null);return;case"input":je("invalid",e);var p=u=f=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":f=L;break;case"checked":E=L;break;case"defaultChecked":M=L;break;case"value":u=L;break;case"defaultValue":p=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(137,t));break;default:Xe(e,t,i,L,l,null)}}Mo(e,u,p,E,M,f,s,!1);return;case"select":je("invalid",e),i=f=u=null;for(s in l)if(l.hasOwnProperty(s)&&(p=l[s],p!=null))switch(s){case"value":u=p;break;case"defaultValue":f=p;break;case"multiple":i=p;default:Xe(e,t,s,p,l,null)}t=u,l=f,e.multiple=!!i,t!=null?Li(e,!!i,t,!1):l!=null&&Li(e,!!i,l,!0);return;case"textarea":je("invalid",e),u=s=i=null;for(f in l)if(l.hasOwnProperty(f)&&(p=l[f],p!=null))switch(f){case"value":i=p;break;case"defaultValue":s=p;break;case"children":u=p;break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(r(91));break;default:Xe(e,t,f,p,l,null)}Do(e,i,s,u);return;case"option":for(E in l)if(l.hasOwnProperty(E)&&(i=l[E],i!=null))switch(E){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Xe(e,t,E,i,l,null)}return;case"dialog":je("beforetoggle",e),je("toggle",e),je("cancel",e),je("close",e);break;case"iframe":case"object":je("load",e);break;case"video":case"audio":for(i=0;i<sa.length;i++)je(sa[i],e);break;case"image":je("error",e),je("load",e);break;case"details":je("toggle",e);break;case"embed":case"source":case"link":je("error",e),je("load",e);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(r(137,t));default:Xe(e,t,M,i,l,null)}return;default:if(or(t)){for(L in l)l.hasOwnProperty(L)&&(i=l[L],i!==void 0&&Wu(e,t,L,i,l,void 0));return}}for(p in l)l.hasOwnProperty(p)&&(i=l[p],i!=null&&Xe(e,t,p,i,l,null))}function vm(e,t,l,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,u=null,f=null,p=null,E=null,M=null,L=null;for(N in l){var Y=l[N];if(l.hasOwnProperty(N)&&Y!=null)switch(N){case"checked":break;case"value":break;case"defaultValue":E=Y;default:i.hasOwnProperty(N)||Xe(e,t,N,null,i,Y)}}for(var A in i){var N=i[A];if(Y=l[A],i.hasOwnProperty(A)&&(N!=null||Y!=null))switch(A){case"type":u=N;break;case"name":s=N;break;case"checked":M=N;break;case"defaultChecked":L=N;break;case"value":f=N;break;case"defaultValue":p=N;break;case"children":case"dangerouslySetInnerHTML":if(N!=null)throw Error(r(137,t));break;default:N!==Y&&Xe(e,t,A,N,i,Y)}}rr(e,f,p,E,M,L,u,s);return;case"select":N=f=p=A=null;for(u in l)if(E=l[u],l.hasOwnProperty(u)&&E!=null)switch(u){case"value":break;case"multiple":N=E;default:i.hasOwnProperty(u)||Xe(e,t,u,null,i,E)}for(s in i)if(u=i[s],E=l[s],i.hasOwnProperty(s)&&(u!=null||E!=null))switch(s){case"value":A=u;break;case"defaultValue":p=u;break;case"multiple":f=u;default:u!==E&&Xe(e,t,s,u,i,E)}t=p,l=f,i=N,A!=null?Li(e,!!l,A,!1):!!i!=!!l&&(t!=null?Li(e,!!l,t,!0):Li(e,!!l,l?[]:"",!1));return;case"textarea":N=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:Xe(e,t,p,null,i,s)}for(f in i)if(s=i[f],u=l[f],i.hasOwnProperty(f)&&(s!=null||u!=null))switch(f){case"value":A=s;break;case"defaultValue":N=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(r(91));break;default:s!==u&&Xe(e,t,f,s,i,u)}Ao(e,A,N);return;case"option":for(var ne in l)if(A=l[ne],l.hasOwnProperty(ne)&&A!=null&&!i.hasOwnProperty(ne))switch(ne){case"selected":e.selected=!1;break;default:Xe(e,t,ne,null,i,A)}for(E in i)if(A=i[E],N=l[E],i.hasOwnProperty(E)&&A!==N&&(A!=null||N!=null))switch(E){case"selected":e.selected=A&&typeof A!="function"&&typeof A!="symbol";break;default:Xe(e,t,E,A,i,N)}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 ge in l)A=l[ge],l.hasOwnProperty(ge)&&A!=null&&!i.hasOwnProperty(ge)&&Xe(e,t,ge,null,i,A);for(M in i)if(A=i[M],N=l[M],i.hasOwnProperty(M)&&A!==N&&(A!=null||N!=null))switch(M){case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(r(137,t));break;default:Xe(e,t,M,A,i,N)}return;default:if(or(t)){for(var Qe in l)A=l[Qe],l.hasOwnProperty(Qe)&&A!==void 0&&!i.hasOwnProperty(Qe)&&Wu(e,t,Qe,void 0,i,A);for(L in i)A=i[L],N=l[L],!i.hasOwnProperty(L)||A===N||A===void 0&&N===void 0||Wu(e,t,L,A,i,N);return}}for(var R in l)A=l[R],l.hasOwnProperty(R)&&A!=null&&!i.hasOwnProperty(R)&&Xe(e,t,R,null,i,A);for(Y in i)A=i[Y],N=l[Y],!i.hasOwnProperty(Y)||A===N||A==null&&N==null||Xe(e,t,Y,A,i,N)}function kd(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function xm(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),i=0;i<l.length;i++){var s=l[i],u=s.transferSize,f=s.initiatorType,p=s.duration;if(u&&p&&kd(f)){for(f=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,Y=E.initiatorType;L&&kd(Y)&&(E=E.responseEnd,f+=L*(E<p?1:(p-M)/(E-M)))}if(--i,t+=8*(u+f)/(s.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var $u=null,Fu=null;function ws(e){return e.nodeType===9?e:e.ownerDocument}function Ld(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ud(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Iu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Pu=null;function bm(){var e=window.event;return e&&e.type==="popstate"?e===Pu?!1:(Pu=e,!0):(Pu=null,!1)}var Bd=typeof setTimeout=="function"?setTimeout:void 0,Sm=typeof clearTimeout=="function"?clearTimeout:void 0,qd=typeof Promise=="function"?Promise:void 0,Em=typeof queueMicrotask=="function"?queueMicrotask:typeof qd<"u"?function(e){return qd.resolve(null).then(e).catch(_m)}:Bd;function _m(e){setTimeout(function(){throw e})}function ii(e){return e==="head"}function Gd(e,t){var l=t,i=0;do{var s=l.nextSibling;if(e.removeChild(l),s&&s.nodeType===8)if(l=s.data,l==="/$"||l==="/&"){if(i===0){e.removeChild(s),pn(t);return}i--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")i++;else if(l==="html")ua(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,ua(l);for(var u=l.firstChild;u;){var f=u.nextSibling,p=u.nodeName;u[Ul]||p==="SCRIPT"||p==="STYLE"||p==="LINK"&&u.rel.toLowerCase()==="stylesheet"||l.removeChild(u),u=f}}else l==="body"&&ua(e.ownerDocument.body);l=s}while(l);pn(t)}function Yd(e,t){var l=e;e=0;do{var i=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),i&&i.nodeType===8)if(l=i.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=i}while(l)}function eo(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":eo(l),Rn(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function zm(e,t,l,i){for(;e.nodeType===1;){var s=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Ul])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=Ft(e.nextSibling),e===null)break}return null}function Cm(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Ft(e.nextSibling),e===null))return null;return e}function Xd(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ft(e.nextSibling),e===null))return null;return e}function to(e){return e.data==="$?"||e.data==="$~"}function lo(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Tm(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var i=function(){t(),l.removeEventListener("DOMContentLoaded",i)};l.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function Ft(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var io=null;function Qd(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return Ft(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function Vd(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function Zd(e,t,l){switch(t=ws(l),e){case"html":if(e=t.documentElement,!e)throw Error(r(452));return e;case"head":if(e=t.head,!e)throw Error(r(453));return e;case"body":if(e=t.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function ua(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Rn(e)}var It=new Map,Kd=new Set;function js(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ol=X.d;X.d={f:Rm,r:wm,D:jm,C:Mm,L:Am,m:Dm,X:Nm,S:Om,M:Hm};function Rm(){var e=Ol.f(),t=bs();return e||t}function wm(e){var t=el(e);t!==null&&t.tag===5&&t.type==="form"?cf(t):Ol.r(e)}var hn=typeof document>"u"?null:document;function Jd(e,t,l){var i=hn;if(i&&typeof t=="string"&&t){var s=Qt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof l=="string"&&(s+='[crossorigin="'+l+'"]'),Kd.has(s)||(Kd.add(s),e={rel:e,crossOrigin:l,href:t},i.querySelector(s)===null&&(t=i.createElement("link"),xt(t,"link",e),at(t),i.head.appendChild(t)))}}function jm(e){Ol.D(e),Jd("dns-prefetch",e,null)}function Mm(e,t){Ol.C(e,t),Jd("preconnect",e,t)}function Am(e,t,l){Ol.L(e,t,l);var i=hn;if(i&&e&&t){var s='link[rel="preload"][as="'+Qt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(s+='[imagesrcset="'+Qt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(s+='[imagesizes="'+Qt(l.imageSizes)+'"]')):s+='[href="'+Qt(e)+'"]';var u=s;switch(t){case"style":u=gn(e);break;case"script":u=mn(e)}It.has(u)||(e=v({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),It.set(u,e),i.querySelector(s)!==null||t==="style"&&i.querySelector(oa(u))||t==="script"&&i.querySelector(ca(u))||(t=i.createElement("link"),xt(t,"link",e),at(t),i.head.appendChild(t)))}}function Dm(e,t){Ol.m(e,t);var l=hn;if(l&&e){var i=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Qt(i)+'"][href="'+Qt(e)+'"]',u=s;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=mn(e)}if(!It.has(u)&&(e=v({rel:"modulepreload",href:e},t),It.set(u,e),l.querySelector(s)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(ca(u)))return}i=l.createElement("link"),xt(i,"link",e),at(i),l.head.appendChild(i)}}}function Om(e,t,l){Ol.S(e,t,l);var i=hn;if(i&&e){var s=Bl(i).hoistableStyles,u=gn(e);t=t||"default";var f=s.get(u);if(!f){var p={loading:0,preload:null};if(f=i.querySelector(oa(u)))p.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},l),(l=It.get(u))&&no(e,l);var E=f=i.createElement("link");at(E),xt(E,"link",e),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,Ms(f,t,i)}f={type:"stylesheet",instance:f,count:1,state:p},s.set(u,f)}}}function Nm(e,t){Ol.X(e,t);var l=hn;if(l&&e){var i=Bl(l).hoistableScripts,s=mn(e),u=i.get(s);u||(u=l.querySelector(ca(s)),u||(e=v({src:e,async:!0},t),(t=It.get(s))&&ao(e,t),u=l.createElement("script"),at(u),xt(u,"link",e),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},i.set(s,u))}}function Hm(e,t){Ol.M(e,t);var l=hn;if(l&&e){var i=Bl(l).hoistableScripts,s=mn(e),u=i.get(s);u||(u=l.querySelector(ca(s)),u||(e=v({src:e,async:!0,type:"module"},t),(t=It.get(s))&&ao(e,t),u=l.createElement("script"),at(u),xt(u,"link",e),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},i.set(s,u))}}function Wd(e,t,l,i){var s=(s=te.current)?js(s):null;if(!s)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=gn(l.href),l=Bl(s).hoistableStyles,i=l.get(t),i||(i={type:"style",instance:null,count:0,state:null},l.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=gn(l.href);var u=Bl(s).hoistableStyles,f=u.get(e);if(f||(s=s.ownerDocument||s,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,f),(u=s.querySelector(oa(e)))&&!u._p&&(f.instance=u,f.state.loading=5),It.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},It.set(e,l),u||km(s,e,l,f.state))),t&&i===null)throw Error(r(528,""));return f}if(t&&i!==null)throw Error(r(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=mn(l),l=Bl(s).hoistableScripts,i=l.get(t),i||(i={type:"script",instance:null,count:0,state:null},l.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function gn(e){return'href="'+Qt(e)+'"'}function oa(e){return'link[rel="stylesheet"]['+e+"]"}function $d(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function km(e,t,l,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),xt(t,"link",l),at(t),e.head.appendChild(t))}function mn(e){return'[src="'+Qt(e)+'"]'}function ca(e){return"script[async]"+e}function Fd(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Qt(l.href)+'"]');if(i)return t.instance=i,at(i),i;var s=v({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),at(i),xt(i,"style",s),Ms(i,l.precedence,e),t.instance=i;case"stylesheet":s=gn(l.href);var u=e.querySelector(oa(s));if(u)return t.state.loading|=4,t.instance=u,at(u),u;i=$d(l),(s=It.get(s))&&no(i,s),u=(e.ownerDocument||e).createElement("link"),at(u);var f=u;return f._p=new Promise(function(p,E){f.onload=p,f.onerror=E}),xt(u,"link",i),t.state.loading|=4,Ms(u,l.precedence,e),t.instance=u;case"script":return u=mn(l.src),(s=e.querySelector(ca(u)))?(t.instance=s,at(s),s):(i=l,(s=It.get(u))&&(i=v({},l),ao(i,s)),e=e.ownerDocument||e,s=e.createElement("script"),at(s),xt(s,"link",i),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Ms(i,l.precedence,e));return t.instance}function Ms(e,t,l){for(var i=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=i.length?i[i.length-1]:null,u=s,f=0;f<i.length;f++){var p=i[f];if(p.dataset.precedence===t)u=p;else if(u!==s)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function no(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ao(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var As=null;function Id(e,t,l){if(As===null){var i=new Map,s=As=new Map;s.set(l,i)}else s=As,i=s.get(l),i||(i=new Map,s.set(l,i));if(i.has(e))return i;for(i.set(e,null),l=l.getElementsByTagName(e),s=0;s<l.length;s++){var u=l[s];if(!(u[Ul]||u[ct]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var f=u.getAttribute(t)||"";f=e+f;var p=i.get(f);p?p.push(u):i.set(f,[u])}}return i}function Pd(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function Lm(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function eh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Um(e,t,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=gn(i.href),u=t.querySelector(oa(s));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ds.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=u,at(u);return}u=t.ownerDocument||t,i=$d(i),(s=It.get(s))&&no(i,s),u=u.createElement("link"),at(u);var f=u;f._p=new Promise(function(p,E){f.onload=p,f.onerror=E}),xt(u,"link",i),l.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Ds.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var so=0;function Bm(e,t){return e.stylesheets&&e.count===0&&Ns(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var i=setTimeout(function(){if(e.stylesheets&&Ns(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&so===0&&(so=62500*xm());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ns(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>so?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(s)}}:null}function Ds(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ns(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Os=null;function Ns(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Os=new Map,t.forEach(qm,e),Os=null,Ds.call(e))}function qm(e,t){if(!(t.state.loading&4)){var l=Os.get(e);if(l)var i=l.get(null);else{l=new Map,Os.set(e,l);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<s.length;u++){var f=s[u];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(l.set(f.dataset.precedence,f),i=f)}i&&l.set(null,i)}s=t.instance,f=s.getAttribute("data-precedence"),u=l.get(f)||i,u===i&&l.set(null,s),l.set(f,s),this.count++,i=Ds.bind(this),s.addEventListener("load",i),s.addEventListener("error",i),u?u.parentNode.insertBefore(s,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var fa={$$typeof:Q,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function Gm(e,t,l,i,s,u,f,p,E){this.tag=1,this.containerInfo=e,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=_n(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_n(0),this.hiddenUpdates=_n(null),this.identifierPrefix=i,this.onUncaughtError=s,this.onCaughtError=u,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=E,this.incompleteTransitions=new Map}function th(e,t,l,i,s,u,f,p,E,M,L,Y){return e=new Gm(e,t,l,f,E,M,L,Y,p),t=1,u===!0&&(t|=24),u=Ht(3,null,null,t),e.current=u,u.stateNode=e,t=Br(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:i,isDehydrated:l,cache:t},Xr(u),e}function lh(e){return e?(e=Vi,e):Vi}function ih(e,t,l,i,s,u){s=lh(s),i.context===null?i.context=s:i.pendingContext=s,i=Zl(t),i.payload={element:l},u=u===void 0?null:u,u!==null&&(i.callback=u),l=Kl(e,i,t),l!==null&&(Dt(l,e,t),Xn(l,e,t))}function nh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function ro(e,t){nh(e,t),(e=e.alternate)&&nh(e,t)}function ah(e){if(e.tag===13||e.tag===31){var t=vi(e,67108864);t!==null&&Dt(t,e,67108864),ro(e,67108864)}}function sh(e){if(e.tag===13||e.tag===31){var t=qt();t=ml(t);var l=vi(e,t);l!==null&&Dt(l,e,t),ro(e,t)}}var Hs=!0;function Ym(e,t,l,i){var s=C.T;C.T=null;var u=X.p;try{X.p=2,uo(e,t,l,i)}finally{X.p=u,C.T=s}}function Xm(e,t,l,i){var s=C.T;C.T=null;var u=X.p;try{X.p=8,uo(e,t,l,i)}finally{X.p=u,C.T=s}}function uo(e,t,l,i){if(Hs){var s=oo(i);if(s===null)Ju(e,t,i,ks,l),uh(e,i);else if(Vm(s,e,t,l,i))i.stopPropagation();else if(uh(e,i),t&4&&-1<Qm.indexOf(e)){for(;s!==null;){var u=el(s);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var f=gl(u.pendingLanes);if(f!==0){var p=u;for(p.pendingLanes|=2,p.entangledLanes|=2;f;){var E=1<<31-Le(f);p.entanglements[1]|=E,f&=~E}dl(u),(Ue&6)===0&&(vs=bt()+500,aa(0))}}break;case 31:case 13:p=vi(u,2),p!==null&&Dt(p,u,2),bs(),ro(u,2)}if(u=oo(i),u===null&&Ju(e,t,i,ks,l),u===s)break;s=u}s!==null&&i.stopPropagation()}else Ju(e,t,i,null,l)}}function oo(e){return e=fr(e),co(e)}var ks=null;function co(e){if(ks=null,e=pl(e),e!==null){var t=c(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=g(t),e!==null)return e;e=null}else if(l===31){if(e=m(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ks=e,null}function rh(e){switch(e){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(oi()){case bn:return 2;case Hl:return 8;case ci:case Ea:return 32;case Sn:return 268435456;default:return 32}default:return 32}}var fo=!1,ni=null,ai=null,si=null,da=new Map,ha=new Map,ri=[],Qm="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 uh(e,t){switch(e){case"focusin":case"focusout":ni=null;break;case"dragenter":case"dragleave":ai=null;break;case"mouseover":case"mouseout":si=null;break;case"pointerover":case"pointerout":da.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ha.delete(t.pointerId)}}function ga(e,t,l,i,s,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:l,eventSystemFlags:i,nativeEvent:u,targetContainers:[s]},t!==null&&(t=el(t),t!==null&&ah(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Vm(e,t,l,i,s){switch(t){case"focusin":return ni=ga(ni,e,t,l,i,s),!0;case"dragenter":return ai=ga(ai,e,t,l,i,s),!0;case"mouseover":return si=ga(si,e,t,l,i,s),!0;case"pointerover":var u=s.pointerId;return da.set(u,ga(da.get(u)||null,e,t,l,i,s)),!0;case"gotpointercapture":return u=s.pointerId,ha.set(u,ga(ha.get(u)||null,e,t,l,i,s)),!0}return!1}function oh(e){var t=pl(e.target);if(t!==null){var l=c(t);if(l!==null){if(t=l.tag,t===13){if(t=g(l),t!==null){e.blockedOn=t,wa(e.priority,function(){sh(l)});return}}else if(t===31){if(t=m(l),t!==null){e.blockedOn=t,wa(e.priority,function(){sh(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ls(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=oo(e.nativeEvent);if(l===null){l=e.nativeEvent;var i=new l.constructor(l.type,l);cr=i,l.target.dispatchEvent(i),cr=null}else return t=el(l),t!==null&&ah(t),e.blockedOn=l,!1;t.shift()}return!0}function ch(e,t,l){Ls(e)&&l.delete(t)}function Zm(){fo=!1,ni!==null&&Ls(ni)&&(ni=null),ai!==null&&Ls(ai)&&(ai=null),si!==null&&Ls(si)&&(si=null),da.forEach(ch),ha.forEach(ch)}function Us(e,t){e.blockedOn===t&&(e.blockedOn=null,fo||(fo=!0,h.unstable_scheduleCallback(h.unstable_NormalPriority,Zm)))}var Bs=null;function fh(e){Bs!==e&&(Bs=e,h.unstable_scheduleCallback(h.unstable_NormalPriority,function(){Bs===e&&(Bs=null);for(var t=0;t<e.length;t+=3){var l=e[t],i=e[t+1],s=e[t+2];if(typeof i!="function"){if(co(i||l)===null)continue;break}var u=el(l);u!==null&&(e.splice(t,3),t-=3,ou(u,{pending:!0,data:s,method:l.method,action:i},i,s))}}))}function pn(e){function t(E){return Us(E,e)}ni!==null&&Us(ni,e),ai!==null&&Us(ai,e),si!==null&&Us(si,e),da.forEach(t),ha.forEach(t);for(var l=0;l<ri.length;l++){var i=ri[l];i.blockedOn===e&&(i.blockedOn=null)}for(;0<ri.length&&(l=ri[0],l.blockedOn===null);)oh(l),l.blockedOn===null&&ri.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(i=0;i<l.length;i+=3){var s=l[i],u=l[i+1],f=s[St]||null;if(typeof u=="function")f||fh(l);else if(f){var p=null;if(u&&u.hasAttribute("formAction")){if(s=u,f=u[St]||null)p=f.formAction;else if(co(s)!==null)continue}else p=f.action;typeof p=="function"?l[i+1]=p:(l.splice(i,3),i-=3),fh(l)}}}function dh(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(f){return s=f})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),i||setTimeout(l,20)}function l(){if(!i&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function ho(e){this._internalRoot=e}qs.prototype.render=ho.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));var l=t.current,i=qt();ih(l,i,e,t,null,null)},qs.prototype.unmount=ho.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ih(e.current,2,null,e,null,null),bs(),t[Ll]=null}};function qs(e){this._internalRoot=e}qs.prototype.unstable_scheduleHydration=function(e){if(e){var t=Cn();e={blockedOn:null,target:e,priority:t};for(var l=0;l<ri.length&&t!==0&&t<ri[l].priority;l++);ri.splice(l,0,e),l===0&&oh(e)}};var hh=n.version;if(hh!=="19.2.4")throw Error(r(527,hh,"19.2.4"));X.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=y(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var Km={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Gs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gs.isDisabled&&Gs.supportsFiber)try{Pe=Gs.inject(Km),et=Gs}catch{}}return pa.createRoot=function(e,t){if(!o(e))throw Error(r(299));var l=!1,i="",s=bf,u=Sf,f=Ef;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=th(e,1,!1,null,null,l,i,null,s,u,f,dh),e[Ll]=t.current,Ku(e),new ho(t)},pa.hydrateRoot=function(e,t,l){if(!o(e))throw Error(r(299));var i=!1,s="",u=bf,f=Sf,p=Ef,E=null;return l!=null&&(l.unstable_strictMode===!0&&(i=!0),l.identifierPrefix!==void 0&&(s=l.identifierPrefix),l.onUncaughtError!==void 0&&(u=l.onUncaughtError),l.onCaughtError!==void 0&&(f=l.onCaughtError),l.onRecoverableError!==void 0&&(p=l.onRecoverableError),l.formState!==void 0&&(E=l.formState)),t=th(e,1,!0,t,l??null,i,s,E,u,f,p,dh),t.context=lh(null),l=t.current,i=qt(),i=ml(i),s=Zl(i),s.callback=null,Kl(l,s,i),l=i,t.current.lanes=l,hi(t,l),dl(t),e[Ll]=t.current,Ku(e),new qs(t)},pa.version="19.2.4",pa}var _h;function ip(){if(_h)return po.exports;_h=1;function h(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(h)}catch(n){console.error(n)}}return h(),po.exports=lp(),po.exports}var np=ip();const ap=Uh(np);function yn({label:h,active:n,onClick:a,color:r}){return d.jsx("button",{onMouseDown:o=>{o.preventDefault(),a()},title:h,style:{background:n?r+"22":"transparent",border:`1px solid ${n?r+"66":"transparent"}`,borderRadius:3,padding:"1px 4px",cursor:"pointer",fontFamily:"inherit",fontSize:11,fontWeight:600,color:n?r:"var(--text-dim)",lineHeight:1.3,transition:"all 0.15s"},children:h})}function sp({label:h,color:n,bgColor:a,value:r,onChange:o,columns:c,columnsOnly:g=!1,plainText:m=!1,highlightOptions:S,onHighlightOptionToggle:y}){const[b,v]=D.useState(!1),[T,Z]=D.useState(0),[K,$]=D.useState([]),ae=D.useRef(null),me=D.useRef(null),he=D.useCallback(()=>{const G=ae.current;if(!G)return{text:"",start:0,end:0};const re=G.selectionStart||0,de=G.value;let Oe=de.lastIndexOf(",",re-1)+1,F=de.indexOf(",",re);F===-1&&(F=de.length);const ve=de.slice(Oe,F).trimStart(),W=de.slice(Oe,F).length-de.slice(Oe,F).trimStart().length;return{text:ve,start:Oe+W,end:F}},[]),Q=D.useCallback(()=>{const{text:G}=he();if(!g&&G.includes(":")){v(!1);return}const re=G.toLowerCase(),de=c.filter(Oe=>!re||Oe.name.toLowerCase().includes(re));$(de),Z(0),v(de.length>0&&document.activeElement===ae.current)},[c,g,he]),se=D.useCallback(G=>{const re=ae.current;if(!re)return;const{start:de,end:Oe}=he(),F=re.value,ve=F.slice(0,de),W=F.slice(Oe),ee=g?G+", ":G+":",Se=ve+ee+W;o(Se),v(!1),requestAnimationFrame(()=>{const C=de+ee.length;re.setSelectionRange(C,C),re.focus()})},[g,he,o]),ye=G=>{b&&(G.key==="ArrowDown"?(G.preventDefault(),Z(re=>Math.min(re+1,K.length-1))):G.key==="ArrowUp"?(G.preventDefault(),Z(re=>Math.max(re-1,0))):G.key==="Tab"||G.key==="Enter"?K.length>0&&(G.preventDefault(),se(K[T].name)):G.key==="Escape"&&v(!1))},H=G=>{o(G.target.value),m||requestAnimationFrame(Q)};return D.useEffect(()=>{const G=re=>{me.current&&!me.current.contains(re.target)&&re.target!==ae.current&&v(!1)};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[]),D.useEffect(()=>{if(b&&me.current){const G=me.current.children[T];G&&G.scrollIntoView({block:"nearest"})}},[T,b]),d.jsxs("div",{style:{position:"relative",flex:1,minWidth:200},children:[d.jsx("label",{style:{display:"block",fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.1em",color:n,marginBottom:4},children:h}),d.jsxs("div",{style:{display:"flex",alignItems:"center",background:a,border:`1px solid ${n}33`,borderRadius:6,transition:"border-color 0.15s"},children:[d.jsx("input",{ref:ae,type:"text",value:r,onChange:H,onFocus:m?void 0:Q,onKeyDown:m?void 0:ye,placeholder:`${h.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:G=>{G.target.closest("div").style.borderColor=n+"66"},onBlurCapture:G=>{G.target.closest("div").style.borderColor=n+"33",setTimeout(()=>v(!1),150)}}),S&&d.jsxs("div",{style:{display:"flex",gap:2,paddingRight:6,flexShrink:0},children:[d.jsx(yn,{label:"Aa",active:S.caseSensitive,onClick:()=>y("caseSensitive"),color:n}),d.jsx(yn,{label:"ab",active:S.wholeWord,onClick:()=>y("wholeWord"),color:n}),d.jsx(yn,{label:".*",active:S.regex,onClick:()=>y("regex"),color:n})]})]}),b&&K.length>0&&d.jsx("div",{ref:me,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:K.map((G,re)=>d.jsxs("div",{onMouseDown:de=>{de.preventDefault(),se(G.name)},style:{padding:"6px 12px",cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center",background:re===T?"rgba(255,255,255,0.05)":"transparent"},children:[d.jsx("span",{style:{color:"var(--text)"},children:G.name}),d.jsx("span",{style:{color:"var(--text-dim)",fontSize:11},children:G.type})]},G.name))})]})}function Co({onClick:h}){return d.jsx("button",{onClick:h,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 rp({filters:h,onFilterChange:n,columns:a,highlightOptions:r,onHighlightOptionToggle:o,onRefresh:c}){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 d.jsxs("div",{style:{display:"flex",gap:12,padding:"16px 20px",background:"var(--panel)",borderBottom:"1px solid var(--border)",flexWrap:"wrap"},children:[g.map(m=>d.jsx(sp,{label:m.label,color:m.color,bgColor:m.bgColor,value:h[m.key],onChange:S=>n(m.key,S),columns:a,columnsOnly:m.columnsOnly||!1,plainText:m.plainText||!1,highlightOptions:m.key==="highlight"?r:void 0,onHighlightOptionToggle:m.key==="highlight"?o:void 0},m.key)),c&&d.jsx(Co,{onClick:c})]})}function up({sql:h}){const[n,a]=D.useState(!1);return h?d.jsxs("div",{style:{borderBottom:"1px solid var(--border)",background:"var(--panel)"},children:[d.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:[d.jsx("span",{style:{transform:n?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.15s"},children:"▶"}),"SQL Preview"]}),n&&d.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:h})]}):null}function op(h){return typeof h=="number"?h.toLocaleString(void 0,{maximumFractionDigits:2}):String(h)}function cp({results:h,config:n,tableName:a}){const r=(h==null?void 0:h.value)??0,o=(h==null?void 0:h.label)??((n==null?void 0:n.aggregation)||"COUNT").toUpperCase();return d.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:20,gap:8,overflow:"hidden"},children:[d.jsx("span",{style:{fontSize:11,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:"0.1em"},children:o}),d.jsx("span",{style:{fontSize:48,fontWeight:700,color:"var(--cyan)",lineHeight:1.1,textAlign:"center",wordBreak:"break-all"},children:op(r)}),d.jsx("span",{style:{fontSize:10,color:"var(--text-dim)",opacity:.6},children:a})]})}function To(h){return typeof h=="number"?h.toLocaleString(void 0,{maximumFractionDigits:2}):String(h)}const Vs=["var(--cyan)","var(--purple)","var(--green)","var(--yellow)","var(--red)","#ff9f43","#a29bfe","#fd79a8","#00cec9","#e17055"];function zh({data:h,maxValue:n}){return d.jsx("div",{style:{flex:1,overflow:"auto",padding:"4px 0"},children:h.length===0?d.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--text-dim)"},children:"No data"}):h.map((a,r)=>d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"4px 16px",fontSize:12,background:r%2===1?"var(--row-alt)":"transparent"},onMouseEnter:o=>{o.currentTarget.style.background="var(--row-hover)"},onMouseLeave:o=>{o.currentTarget.style.background=r%2===1?"var(--row-alt)":"transparent"},children:[d.jsx("span",{style:{width:120,flexShrink:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--text)",fontSize:11},title:a.group,children:a.group}),d.jsx("div",{style:{flex:1,height:18,background:"rgba(34, 211, 238, 0.06)",borderRadius:3,overflow:"hidden"},children:d.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}})}),d.jsx("span",{style:{width:80,flexShrink:0,textAlign:"right",color:"var(--cyan)",fontWeight:600,fontSize:11},children:To(a.value)})]},a.group))})}function fp({data:h,maxValue:n}){const a=D.useRef(null),[r,o]=D.useState({w:400,h:300});D.useEffect(()=>{if(!a.current)return;const b=new ResizeObserver(v=>{const{width:T,height:Z}=v[0].contentRect;o({w:T,h:Z})});return b.observe(a.current),()=>b.disconnect()},[]);const c={top:20,right:20,bottom:60,left:60},g=r.w-c.left-c.right,m=r.h-c.top-c.bottom,S=h.length>0?Math.min(40,g/h.length*.7):20,y=h.length>0?g/h.length:0;return d.jsx("div",{ref:a,style:{flex:1,overflow:"hidden"},children:d.jsxs("svg",{width:r.w,height:r.h,children:[d.jsx("line",{x1:c.left,y1:c.top,x2:c.left,y2:c.top+m,stroke:"var(--border)",strokeWidth:1}),d.jsx("line",{x1:c.left,y1:c.top+m,x2:c.left+g,y2:c.top+m,stroke:"var(--border)",strokeWidth:1}),[0,.25,.5,.75,1].map(b=>{const v=c.top+m*(1-b);return d.jsxs("g",{children:[d.jsx("line",{x1:c.left-4,y1:v,x2:c.left+g,y2:v,stroke:"var(--border)",strokeWidth:.5,strokeDasharray:b>0?"2,4":"0"}),d.jsx("text",{x:c.left-8,y:v+3,textAnchor:"end",fill:"var(--text-dim)",fontSize:9,children:To(Math.round(n*b))})]},b)}),h.map((b,v)=>{const T=c.left+y*v+(y-S)/2,Z=n>0?Math.abs(b.value)/n*m:0,K=c.top+m-Z;return d.jsxs("g",{children:[d.jsx("rect",{x:T,y:K,width:S,height:Z,fill:Vs[v%Vs.length],opacity:.6,rx:2}),d.jsx("text",{x:T+S/2,y:c.top+m+12,textAnchor:"middle",fill:"var(--text-dim)",fontSize:9,transform:`rotate(-35, ${T+S/2}, ${c.top+m+12})`,children:b.group.length>10?b.group.slice(0,9)+"…":b.group})]},b.group)})]})})}function dp({data:h}){const n=D.useRef(null),[a,r]=D.useState({w:400,h:300});D.useEffect(()=>{if(!n.current)return;const v=new ResizeObserver(T=>{const{width:Z,height:K}=T[0].contentRect;r({w:Z,h:K})});return v.observe(n.current),()=>v.disconnect()},[]);const o=h.reduce((v,T)=>v+Math.abs(T.value),0),c=Math.min(a.w*.35,(a.h-20)*.45),g=a.w*.4,m=a.h/2;let S=-Math.PI/2;const y=h.map((v,T)=>{const Z=o>0?Math.abs(v.value)/o:0,K=Z*Math.PI*2,$=S;S+=K;const ae=S,me=K>Math.PI?1:0,he=g+c*Math.cos($),Q=m+c*Math.sin($),se=g+c*Math.cos(ae),ye=m+c*Math.sin(ae),H=Z>=1?`M ${g-c} ${m} A ${c} ${c} 0 1 1 ${g+c} ${m} A ${c} ${c} 0 1 1 ${g-c} ${m}`:`M ${g} ${m} L ${he} ${Q} A ${c} ${c} 0 ${me} 1 ${se} ${ye} Z`;return{...v,d:H,color:Vs[T%Vs.length],frac:Z}}),b=a.w*.72;return d.jsx("div",{ref:n,style:{flex:1,overflow:"hidden"},children:d.jsxs("svg",{width:a.w,height:a.h,children:[y.map(v=>d.jsx("path",{d:v.d,fill:v.color,opacity:.7,stroke:"var(--bg)",strokeWidth:1.5},v.group)),y.slice(0,12).map((v,T)=>d.jsxs("g",{transform:`translate(${b}, ${20+T*18})`,children:[d.jsx("rect",{width:10,height:10,fill:v.color,opacity:.7,rx:2}),d.jsx("text",{x:14,y:9,fill:"var(--text)",fontSize:10,children:v.group.length>14?v.group.slice(0,13)+"…":v.group}),d.jsxs("text",{x:124,y:9,fill:"var(--text-dim)",fontSize:9,textAnchor:"end",children:[(v.frac*100).toFixed(1),"%"]})]},v.group)),h.length>12&&d.jsxs("text",{x:b,y:246,fill:"var(--text-dim)",fontSize:9,children:["+",h.length-12," more..."]})]})})}function Ch({data:h,maxValue:n,filled:a}){const r=D.useRef(null),[o,c]=D.useState({w:400,h:300});D.useEffect(()=>{if(!r.current)return;const T=new ResizeObserver(Z=>{const{width:K,height:$}=Z[0].contentRect;c({w:K,h:$})});return T.observe(r.current),()=>T.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=h.map((T,Z)=>{const K=g.left+(h.length>1?Z/(h.length-1)*m:m/2),$=g.top+S-(n>0?Math.abs(T.value)/n*S:0);return{x:K,y:$,...T}}),b=y.map(T=>`${T.x},${T.y}`).join(" "),v=y.length>0?`M ${g.left} ${g.top+S} `+y.map(T=>`L ${T.x} ${T.y}`).join(" ")+` L ${g.left+m} ${g.top+S} Z`:"";return d.jsx("div",{ref:r,style:{flex:1,overflow:"hidden"},children:d.jsxs("svg",{width:o.w,height:o.h,children:[d.jsx("line",{x1:g.left,y1:g.top,x2:g.left,y2:g.top+S,stroke:"var(--border)",strokeWidth:1}),d.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(T=>{const Z=g.top+S*(1-T);return d.jsxs("g",{children:[d.jsx("line",{x1:g.left-4,y1:Z,x2:g.left+m,y2:Z,stroke:"var(--border)",strokeWidth:.5,strokeDasharray:T>0?"2,4":"0"}),d.jsx("text",{x:g.left-8,y:Z+3,textAnchor:"end",fill:"var(--text-dim)",fontSize:9,children:To(Math.round(n*T))})]},T)}),a&&v&&d.jsx("path",{d:v,fill:"var(--cyan)",opacity:.15}),y.length>1&&d.jsx("polyline",{points:b,fill:"none",stroke:"var(--cyan)",strokeWidth:2,opacity:.8}),y.map(T=>d.jsx("circle",{cx:T.x,cy:T.y,r:3.5,fill:"var(--cyan)",opacity:.9},T.group)),y.map((T,Z)=>d.jsx("text",{x:T.x,y:g.top+S+12,textAnchor:"middle",fill:"var(--text-dim)",fontSize:9,transform:`rotate(-35, ${T.x}, ${g.top+S+12})`,children:T.group.length>10?T.group.slice(0,9)+"…":T.group},T.group))]})})}function hp({results:h,config:n,tableName:a,chartType:r="hbar"}){const o=(h==null?void 0:h.results)??[],c=D.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 d.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[d.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 ",d.jsx("span",{style:{color:"var(--text)"},children:n==null?void 0:n.groupByColumn})," — ",g,d.jsxs("span",{style:{marginLeft:8,opacity:.6},children:[o.length," groups"]})]}),o.length===0?d.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-dim)"},children:"No data"}):r==="hbar"?d.jsx(zh,{data:o,maxValue:c}):r==="vbar"?d.jsx(fp,{data:o,maxValue:c}):r==="pie"?d.jsx(dp,{data:o}):r==="line"?d.jsx(Ch,{data:o,maxValue:c,filled:!1}):r==="area"?d.jsx(Ch,{data:o,maxValue:c,filled:!0}):d.jsx(zh,{data:o,maxValue:c})]})}const Xt="";async function gp(){const h=await fetch(`${Xt}/api/health`);if(!h.ok)throw new Error(`Health check failed: ${h.statusText}`);return h.json()}async function mp(h,n=""){const a=await fetch(`${Xt}/api/pg/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connection_string:h,label:n})});if(!a.ok){const r=await a.json().catch(()=>({detail:a.statusText}));throw new Error(r.detail||a.statusText)}return a.json()}async function Ys(h){const n=await fetch(`${Xt}/api/pg/${encodeURIComponent(h)}/tables`);if(!n.ok)throw new Error(`Failed to fetch tables: ${n.statusText}`);return n.json()}async function pp(h,n,a){const r=await fetch(`${Xt}/api/pg/${encodeURIComponent(h)}/tables/${encodeURIComponent(n)}/${encodeURIComponent(a)}/columns`);if(!r.ok)throw new Error(`Failed to fetch columns: ${r.statusText}`);return r.json()}async function Th(h,{schema:n,table:a,include:r="",exclude:o="",highlight:c="",columns:g="",limit:m=500,offset:S=0,view_mode:y,aggregation:b,agg_column:v,group_by_column:T,value_column:Z}){const K={schema:n,table:a,include:r,exclude:o,highlight:c,columns:g,limit:m,offset:S};y&&(K.view_mode=y),b&&(K.aggregation=b),v&&(K.agg_column=v),T&&(K.group_by_column=T),Z&&(K.value_column=Z);const $=await fetch(`${Xt}/api/pg/${encodeURIComponent(h)}/query`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(K)});if(!$.ok){const ae=await $.json().catch(()=>({detail:$.statusText}));throw new Error(ae.detail||$.statusText)}return $.json()}async function yp({project:h,dataset:n,credentialsPath:a,label:r=""}){const o=await fetch(`${Xt}/api/bigquery/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:h,dataset:n,credentials_path:a||"",label:r})});if(!o.ok){const c=await o.json().catch(()=>({detail:o.statusText}));throw new Error(c.detail||o.statusText)}return o.json()}async function vp(h,n=""){const a=await fetch(`${Xt}/api/redis/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connection_string:h,label:n})});if(!a.ok){const r=await a.json().catch(()=>({detail:a.statusText}));throw new Error(r.detail||a.statusText)}return a.json()}async function xp(h,{pattern:n="*",offset:a=0,limit:r=100}){const o=await fetch(`${Xt}/api/redis/${encodeURIComponent(h)}/keys`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pattern:n,offset:a,limit:r})});if(!o.ok){const c=await o.json().catch(()=>({detail:o.statusText}));throw new Error(c.detail||o.statusText)}return o.json()}async function bp(h,n){const a=await fetch(`${Xt}/api/redis/${encodeURIComponent(h)}/keys/${encodeURIComponent(n)}`);if(!a.ok){const r=await a.json().catch(()=>({detail:a.statusText}));throw new Error(r.detail||a.statusText)}return a.json()}async function Sp({endpointUrl:h,accessKey:n,secretKey:a,region:r,label:o=""}){const c=await fetch(`${Xt}/api/s3/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint_url:h,access_key:n,secret_key:a,region:r||"us-east-1",label:o})});if(!c.ok){const g=await c.json().catch(()=>({detail:c.statusText}));throw new Error(g.detail||c.statusText)}return c.json()}async function bo(h){const n=await fetch(`${Xt}/api/s3/${encodeURIComponent(h)}/buckets`);if(!n.ok)throw new Error(`Failed to fetch buckets: ${n.statusText}`);return n.json()}async function Ep(h,{bucket:n,prefix:a="",continuationToken:r=null,limit:o=100}){const c=await fetch(`${Xt}/api/s3/${encodeURIComponent(h)}/keys`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({bucket:n,prefix:a,continuation_token:r,limit:o})});if(!c.ok){const g=await c.json().catch(()=>({detail:c.statusText}));throw new Error(g.detail||c.statusText)}return c.json()}async function _p(h,n,a){const r=await fetch(`${Xt}/api/s3/${encodeURIComponent(h)}/keys/${encodeURIComponent(n)}/${encodeURIComponent(a)}`);if(!r.ok){const o=await r.json().catch(()=>({detail:r.statusText}));throw new Error(o.detail||r.statusText)}return r.json()}function zp(h,n,a={}){if(!n)return!1;const{caseSensitive:r,wholeWord:o,regex:c}=a;return Object.values(h).some(g=>{if(g==null)return!1;const m=String(g);if(c)try{const S=r?"":"i",y=o?`\\b${n}\\b`:n;return new RegExp(y,S).test(m)}catch{return!1}if(o){const S=r?"":"i";try{return new RegExp(`\\b${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,S).test(m)}catch{return!1}}return r?m.includes(n):m.toLowerCase().includes(n.toLowerCase())})}const Rh=h=>({background:"none",border:"1px solid var(--border)",borderRadius:4,padding:"2px 8px",color:h?"var(--text)":"var(--text-dim)",cursor:h?"pointer":"default",fontFamily:"inherit",fontSize:11,opacity:h?1:.4});function wh(h,n){return h==="number"?{view_mode:"number",aggregation:(n==null?void 0:n.aggregation)||"count",agg_column:(n==null?void 0:n.column)||null}:h==="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 So(h,n){const a=[];for(const r of h){const o=n.find(c=>c.id===r.parentPanelId);if(o!=null&&o.selectedRow)for(const c of r.mappings){const g=o.selectedRow[c.parentColumn];g!=null&&a.push({column:c.childColumn,value:String(g),parentColumn:c.parentColumn,parentName:o.displayName})}}return a}function Cp(h){return h.map(n=>`${n.column}:=${n.value}`).join(", ")}function jh(h,n){const a=Cp(n);return a?!h||!h.trim()?a:`${h}, ${a}`:h}function Tp({tab:h,updateTab:n,allPanels:a=[],pageSize:r,setError:o,refreshKey:c,locked:g}){var ve,W,ee,Se,C,X;const m=D.useRef(null),S=D.useRef(r);S.current=r;const y=D.useRef(c);D.useEffect(()=>{h.columns.length>0||pp(h.instanceId,h.schema,h.name).then(B=>n({columns:B.columns})).catch(B=>o(B.message))},[]),D.useEffect(()=>{h.columns.length===0||h.results||K(h,0)},[h.columns.length]),D.useEffect(()=>{c!==y.current&&K(h,h.page)},[c]);const b=D.useRef({viewMode:h.viewMode,viewConfig:h.viewConfig});D.useEffect(()=>{const B=b.current,ie={viewMode:h.viewMode,viewConfig:h.viewConfig};b.current=ie,h.columns.length!==0&&JSON.stringify(B)!==JSON.stringify(ie)&&K(h,0)},[h.viewMode,h.viewConfig]);const v=So(h.links||[],a),T=JSON.stringify(v),Z=D.useRef(T);D.useEffect(()=>{Z.current!==T&&(Z.current=T,h.columns.length!==0&&K(h,0))},[T]);const K=D.useCallback((B,ie=0)=>{const Ee=S.current,_=B.viewMode||"table",k=So(B.links||[],a),w=jh(B.filters.include,k);n({loading:!0}),o(null),Th(B.instanceId,{schema:B.schema,table:B.name,include:w,exclude:B.filters.exclude,highlight:B.filters.highlight,columns:B.filters.columns,limit:Ee,offset:ie*Ee,...wh(_,B.viewConfig)}).then(V=>n({results:V,loading:!1})).catch(V=>{o(V.message),n({loading:!1})})},[n,o,a]),$=(B,ie)=>{const Ee={...h.filters,[B]:ie};n({filters:Ee}),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{const _=So(h.links||[],a),k=jh(B==="include"?ie:h.filters.include,_);n({page:0,loading:!0}),o(null),Th(h.instanceId,{schema:h.schema,table:h.name,include:k,exclude:B==="exclude"?ie:h.filters.exclude,highlight:B==="highlight"?ie:h.filters.highlight,columns:B==="columns"?ie:h.filters.columns,limit:S.current,offset:0,...wh(h.viewMode||"table",h.viewConfig)}).then(w=>n({results:w,loading:!1})).catch(w=>{o(w.message),n({loading:!1})})},300)},ae=B=>{n({page:B}),K({...h,page:B},B)},me=B=>{const ie=h.selectedRow&&Object.keys(B).every(Ee=>h.selectedRow[Ee]===B[Ee]);n({selectedRow:ie?null:B})},he=B=>h.selectedRow?Object.keys(B).every(ie=>h.selectedRow[ie]===B[ie]):!1,Q=(ve=h.results)==null?void 0:ve.rows,se=Q&&Q.length>0?Object.keys(Q[0]):[],ye=(W=h.results)==null?void 0:W.total_count,H=ye!=null?Math.ceil(ye/r):0,G=h.page>0,re=ye!=null&&(h.page+1)*r<ye,de=h.page*r+1,Oe=h.page*r+((Q==null?void 0:Q.length)||0),F=h.viewMode||"table";return d.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden"},children:[v.length>0&&F==="table"&&d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 20px",background:"rgba(34, 211, 238, 0.04)",borderBottom:"1px solid var(--border)",flexWrap:"wrap",fontSize:11},children:[d.jsx("span",{style:{color:"var(--cyan)",fontWeight:600,fontSize:10,flexShrink:0},children:"LINKED"}),v.map((B,ie)=>d.jsxs("span",{style:{background:"rgba(34, 211, 238, 0.10)",border:"1px solid rgba(34, 211, 238, 0.25)",borderRadius:4,padding:"2px 8px",color:"var(--cyan)",whiteSpace:"nowrap"},children:[B.column," = ",B.value]},ie)),d.jsxs("span",{style:{color:"var(--text-dim)",fontSize:10,marginLeft:4},children:["from ",(ee=v[0])==null?void 0:ee.parentName]})]}),!g&&h.filtersVisible!==!1&&h.columns.length>0&&F==="table"&&d.jsx(rp,{filters:h.filters,onFilterChange:$,columns:h.columns,highlightOptions:h.highlightOptions,onHighlightOptionToggle:B=>n({highlightOptions:{...h.highlightOptions,[B]:!h.highlightOptions[B]}}),onRefresh:()=>K(h,h.page)}),!g&&h.filtersVisible!==!1&&F==="table"&&d.jsx(up,{sql:(Se=h.results)==null?void 0:Se.sql}),F==="number"&&((C=h.results)==null?void 0:C.view_mode)==="number"&&d.jsx(cp,{results:h.results,config:h.viewConfig,tableName:h.displayName}),F==="number"&&!h.results&&d.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-dim)"},children:"Loading..."}),F==="chart"&&((X=h.results)==null?void 0:X.view_mode)==="chart"&&d.jsx(hp,{results:h.results,config:h.viewConfig,tableName:h.displayName,chartType:h.chartType||"hbar"}),F==="chart"&&!h.results&&d.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-dim)"},children:"Loading..."}),F==="table"&&Q&&d.jsxs("div",{style:{flex:1,overflow:"auto",position:"relative"},children:[d.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:[d.jsx("span",{children:Q.length>0?`${de}–${Oe} of ${ye??"?"}`:`0 of ${ye??"?"}`}),H>1&&d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[d.jsx("button",{style:Rh(G),disabled:!G,onClick:()=>G&&ae(h.page-1),children:"Prev"}),d.jsxs("span",{children:[h.page+1," / ",H]}),d.jsx("button",{style:Rh(re),disabled:!re,onClick:()=>re&&ae(h.page+1),children:"Next"})]})]}),Q.length===0?d.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--text-dim)"},children:"No results"}):d.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[d.jsx("thead",{children:d.jsx("tr",{children:se.map(B=>d.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:B},B))})}),d.jsx("tbody",{children:Q.map((B,ie)=>{const Ee=zp(B,h.filters.highlight,h.highlightOptions),_=he(B),k=_?"rgba(34, 211, 238, 0.10)":Ee?"var(--highlight-row)":ie%2===1?"var(--row-alt)":"transparent",w=_?"var(--cyan)":Ee?"var(--yellow)":"transparent";return d.jsx("tr",{onClick:()=>me(B),style:{background:k,borderLeft:`3px solid ${w}`,cursor:"pointer"},onMouseEnter:V=>{!_&&!Ee&&(V.currentTarget.style.background="var(--row-hover)")},onMouseLeave:V=>{V.currentTarget.style.background=k},children:se.map(V=>d.jsx("td",{style:{padding:"6px 12px",borderBottom:"1px solid var(--border)",whiteSpace:"nowrap",maxWidth:300,overflow:"hidden",textOverflow:"ellipsis"},children:B[V]===null?d.jsx("span",{style:{color:"var(--text-dim)",fontStyle:"italic"},children:"null"}):String(B[V])},V))},ie)})})]})]})]})}function Rp(h,n){return h==null?"null":n==="hash"&&typeof h=="object"&&!Array.isArray(h)?JSON.stringify(h,null,2):n==="zset"&&Array.isArray(h)?h.map(([a,r])=>`${r}  ${a}`).join(`
`):Array.isArray(h)?h.map((a,r)=>`[${r}] ${typeof a=="object"?JSON.stringify(a):a}`).join(`
`):typeof h=="object"?JSON.stringify(h,null,2):String(h)}function wp(h){return h<1024?`${h} B`:h<1048576?`${(h/1024).toFixed(1)} KB`:h<1073741824?`${(h/1048576).toFixed(1)} MB`:`${(h/1073741824).toFixed(1)} GB`}function jp({detail:h,loading:n,onClose:a}){return!h&&!n?null:d.jsxs("div",{style:{width:420,minWidth:320,borderLeft:"1px solid var(--border)",background:"var(--panel)",display:"flex",flexDirection:"column",overflow:"hidden",flexShrink:0},children:[d.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[d.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--cyan)"},children:n?"Loading...":(h==null?void 0:h.key)||"Key Detail"}),d.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:r=>{r.target.style.color="var(--red)"},onMouseLeave:r=>{r.target.style.color="var(--text-dim)"},children:"x"})]}),n&&d.jsx("div",{style:{padding:20,color:"var(--text-dim)",fontSize:12},children:"Loading..."}),h&&!n&&d.jsxs("div",{style:{flex:1,overflow:"auto",padding:16},children:[d.jsxs("div",{style:{display:"flex",gap:12,marginBottom:16,flexWrap:"wrap"},children:[d.jsxs("div",{style:{fontSize:11},children:[d.jsx("span",{style:{color:"var(--text-dim)"},children:"Type "}),d.jsx("span",{style:{color:"var(--cyan)",background:"var(--cyan-bg)",padding:"2px 6px",borderRadius:3,fontSize:10,fontWeight:600},children:h.type})]}),h.ttl!==null&&h.ttl!==void 0&&d.jsxs("div",{style:{fontSize:11},children:[d.jsx("span",{style:{color:"var(--text-dim)"},children:"TTL "}),d.jsxs("span",{style:{color:"var(--yellow)"},children:[h.ttl,"s"]})]}),h.size!==null&&h.size!==void 0&&d.jsxs("div",{style:{fontSize:11},children:[d.jsx("span",{style:{color:"var(--text-dim)"},children:"Size "}),d.jsxs("span",{style:{color:"var(--text)"},children:[h.size," bytes"]})]})]}),d.jsx("div",{style:{marginBottom:8},children:d.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.1em",color:"var(--text-dim)"},children:"Value"})}),d.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:Rp(h.value,h.type)})]})]})}function Mp({detail:h,loading:n,onClose:a}){return!h&&!n?null:d.jsxs("div",{style:{width:420,minWidth:320,borderLeft:"1px solid var(--border)",background:"var(--panel)",display:"flex",flexDirection:"column",overflow:"hidden",flexShrink:0},children:[d.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[d.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--orange)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,marginRight:8},children:n?"Loading...":(h==null?void 0:h.key)||"Object Detail"}),d.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:r=>{r.target.style.color="var(--red)"},onMouseLeave:r=>{r.target.style.color="var(--text-dim)"},children:"x"})]}),n&&d.jsx("div",{style:{padding:20,color:"var(--text-dim)",fontSize:12},children:"Loading..."}),h&&!n&&d.jsxs("div",{style:{flex:1,overflow:"auto",padding:16},children:[d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,marginBottom:16},children:[d.jsxs("div",{style:{fontSize:11},children:[d.jsx("span",{style:{color:"var(--text-dim)"},children:"Size "}),d.jsx("span",{style:{color:"var(--text)"},children:wp(h.size)})]}),d.jsxs("div",{style:{fontSize:11},children:[d.jsx("span",{style:{color:"var(--text-dim)"},children:"Type "}),d.jsx("span",{style:{color:"var(--orange)",background:"var(--orange-bg)",padding:"2px 6px",borderRadius:3,fontSize:10,fontWeight:600},children:h.content_type})]}),d.jsxs("div",{style:{fontSize:11},children:[d.jsx("span",{style:{color:"var(--text-dim)"},children:"Modified "}),d.jsx("span",{style:{color:"var(--text)"},children:h.last_modified})]}),d.jsxs("div",{style:{fontSize:11},children:[d.jsx("span",{style:{color:"var(--text-dim)"},children:"ETag "}),d.jsx("span",{style:{color:"var(--text-dim)"},children:h.etag})]}),h.metadata&&Object.keys(h.metadata).length>0&&d.jsxs("div",{style:{fontSize:11},children:[d.jsx("span",{style:{color:"var(--text-dim)"},children:"Metadata "}),d.jsx("span",{style:{color:"var(--text)"},children:JSON.stringify(h.metadata)})]})]}),d.jsx("div",{style:{marginBottom:8},children:d.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.1em",color:"var(--text-dim)"},children:"Content"})}),d.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:h.value||"[no preview available]"})]})]})}function Mh(h){return{string:"var(--green)",list:"var(--yellow)",set:"var(--purple)",zset:"var(--cyan)",hash:"#ff9f43",stream:"var(--red)"}[h]||"var(--text-dim)"}const Ah=h=>({background:"none",border:"1px solid var(--border)",borderRadius:4,padding:"2px 8px",color:h?"var(--text)":"var(--text-dim)",cursor:h?"pointer":"default",fontFamily:"inherit",fontSize:11,opacity:h?1:.4});function Ap({tab:h,updateTab:n,pageSize:a,setError:r,refreshKey:o,locked:c}){var re,de,Oe;const[g,m]=D.useState(null),[S,y]=D.useState(null),[b,v]=D.useState(!1),T=D.useRef(null),Z=D.useRef(a);Z.current=a;const K=D.useRef(o);D.useEffect(()=>{h.results||$(h.filter||"*",0)},[]),D.useEffect(()=>{o!==K.current&&$(h.filter||"*",h.page*a)},[o]);const $=D.useCallback((F,ve=0)=>{n({loading:!0}),r(null),xp(h.instanceId,{pattern:F||"*",offset:ve,limit:Z.current}).then(W=>{n({results:W,loading:!1})}).catch(W=>{r(W.message),n({loading:!1})})},[n,r]),ae=F=>{n({filter:F}),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{n({page:0}),$(F||"*",0)},300)},me=()=>{var ve;if(!((ve=h.results)!=null&&ve.has_more))return;const F=h.page+1;n({page:F}),$(h.filter||"*",F*a)},he=()=>{if(h.page<=0)return;const F=h.page-1;n({page:F}),$(h.filter||"*",F*a)},Q=F=>{if(g===F){m(null),y(null);return}m(F),v(!0),y(null),bp(h.instanceId,F).then(ve=>{y(ve),v(!1)}).catch(ve=>{r(ve.message),v(!1)})},se=(re=h.results)==null?void 0:re.rows,ye=((de=h.results)==null?void 0:de.total_count)||0,H=((Oe=h.results)==null?void 0:Oe.has_more)||!1,G=se&&se.length>0?Object.keys(se[0]):[];return d.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[d.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden"},children:[!c&&h.filtersVisible!==!1&&d.jsxs("div",{style:{display:"flex",gap:12,padding:"12px 20px",background:"var(--panel)",borderBottom:"1px solid var(--border)",alignItems:"flex-end"},children:[d.jsxs("div",{style:{flex:1},children:[d.jsx("label",{style:{display:"block",fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.1em",color:"var(--green)",marginBottom:4},children:"Filter keys"}),d.jsx("div",{style:{display:"flex",alignItems:"center",background:"var(--green-bg)",border:"1px solid var(--green)33",borderRadius:6},children:d.jsx("input",{type:"text",value:h.filter||"",onChange:F=>ae(F.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:F=>{F.target.closest("div").style.borderColor="var(--green)66"},onBlur:F=>{F.target.closest("div").style.borderColor="var(--green)33"}})}),d.jsx("div",{style:{fontSize:10,color:"var(--text-dim)",marginTop:4},children:"Supports glob patterns: * ? [abc]. Plain text auto-wraps as *text*."})]}),d.jsx(Co,{onClick:()=>$(h.filter||"*",h.page*a)})]}),se!=null&&d.jsxs("div",{style:{flex:1,overflow:"auto",position:"relative"},children:[d.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:[d.jsxs("span",{children:[ye," keys",h.filter?` matching "${h.filter}"`:"",ye>a?` (showing ${h.page*a+1}–${Math.min((h.page+1)*a,ye)})`:""]}),(H||h.page>0)&&d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[d.jsx("button",{style:Ah(h.page>0),disabled:h.page<=0,onClick:he,children:"Prev"}),d.jsxs("span",{children:["Page ",h.page+1," of ",Math.ceil(ye/a)]}),d.jsx("button",{style:Ah(H),disabled:!H,onClick:me,children:"Next"})]})]}),se.length===0?d.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--text-dim)"},children:"No keys found"}):d.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[d.jsx("thead",{children:d.jsx("tr",{children:G.map(F=>d.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:F},F))})}),d.jsx("tbody",{children:se.map((F,ve)=>{const W=g===F.key;return d.jsx("tr",{onClick:()=>Q(F.key),style:{cursor:"pointer",background:W?"var(--selected-row)":ve%2===1?"var(--row-alt)":"transparent",borderLeft:W?"3px solid var(--purple)":"3px solid transparent"},onMouseEnter:ee=>{W||(ee.currentTarget.style.background="var(--row-hover)")},onMouseLeave:ee=>{ee.currentTarget.style.background=W?"var(--selected-row)":ve%2===1?"var(--row-alt)":"transparent"},children:G.map(ee=>d.jsx("td",{style:{padding:"6px 12px",borderBottom:"1px solid var(--border)",whiteSpace:"nowrap",maxWidth:500,overflow:"hidden",textOverflow:"ellipsis"},children:ee==="type"?d.jsx("span",{style:{color:Mh(F[ee]),background:Mh(F[ee])+"15",padding:"1px 6px",borderRadius:3,fontSize:10,fontWeight:600},children:F[ee]}):String(F[ee])},ee))},F.key)})})]})]})]}),g&&d.jsx(jp,{detail:S,loading:b,onClose:()=>{m(null),y(null)}})]})}function Dp(h,n,a={}){if(!n)return!0;const{caseSensitive:r,wholeWord:o,regex:c}=a,g=String(h);if(c)try{const m=r?"":"i",S=o?`\\b${n}\\b`:n;return new RegExp(S,m).test(g)}catch{return!1}if(o){const m=r?"":"i";try{return new RegExp(`\\b${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,m).test(g)}catch{return!1}}return r?g.includes(n):g.toLowerCase().includes(n.toLowerCase())}function Op(h){return h<1024?`${h} B`:h<1048576?`${(h/1024).toFixed(1)} KB`:h<1073741824?`${(h/1048576).toFixed(1)} MB`:`${(h/1073741824).toFixed(1)} GB`}const Dh=h=>({background:"none",border:"1px solid var(--border)",borderRadius:4,padding:"2px 8px",color:h?"var(--text)":"var(--text-dim)",cursor:h?"pointer":"default",fontFamily:"inherit",fontSize:11,opacity:h?1:.4});function Np({tab:h,updateTab:n,pageSize:a,setError:r,refreshKey:o,locked:c}){var W,ee,Se;const[g,m]=D.useState(null),[S,y]=D.useState(null),[b,v]=D.useState(!1),[T,Z]=D.useState(""),[K,$]=D.useState({caseSensitive:!1,wholeWord:!1,regex:!1}),ae=D.useRef(null),me=D.useRef(a);me.current=a;const he=D.useRef(o);D.useEffect(()=>{h.results||Q(h.filter||"",null)},[]),D.useEffect(()=>{o!==he.current&&Q(h.filter||"",(h.tokens||[null])[h.page])},[o]);const Q=D.useCallback((C,X)=>{n({loading:!0}),r(null),Ep(h.instanceId,{bucket:h.bucket,prefix:C,continuationToken:X,limit:me.current}).then(B=>{n({results:B,loading:!1,nextToken:B.next_token})}).catch(B=>{r(B.message),n({loading:!1})})},[h.bucket,n,r]),se=C=>{n({filter:C}),ae.current&&clearTimeout(ae.current),ae.current=setTimeout(()=>{n({page:0,tokens:[null]}),Q(C,null)},300)},ye=()=>{var B;if(!((B=h.results)!=null&&B.has_more))return;const C=h.page+1,X=[...h.tokens||[null]];X.length<=C&&X.push(h.nextToken),n({page:C,tokens:X}),Q(h.filter||"",h.nextToken)},H=()=>{if(h.page<=0)return;const C=h.page-1;n({page:C}),Q(h.filter||"",(h.tokens||[null])[C])},G=C=>{if(g===C){m(null),y(null);return}m(C),v(!0),y(null),_p(h.instanceId,h.bucket,C).then(X=>{y(X),v(!1)}).catch(X=>{r(X.message),v(!1)})},re=(W=h.results)==null?void 0:W.rows,de=((ee=h.results)==null?void 0:ee.total_count)||0,Oe=((Se=h.results)==null?void 0:Se.has_more)||!1,F=re&&re.length>0?Object.keys(re[0]):[],ve=re&&T?re.filter(C=>Object.values(C).some(X=>Dp(X,T,K))):re;return d.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[d.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden"},children:[!c&&h.filtersVisible!==!1&&d.jsxs("div",{style:{display:"flex",gap:12,padding:"12px 20px",background:"var(--panel)",borderBottom:"1px solid var(--border)",alignItems:"flex-end"},children:[d.jsxs("div",{style:{flex:1,minWidth:200},children:[d.jsx("label",{style:{display:"block",fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.1em",color:"var(--green)",marginBottom:4},children:"Prefix"}),d.jsx("div",{style:{display:"flex",alignItems:"center",background:"var(--green-bg)",border:"1px solid var(--green)33",borderRadius:6},children:d.jsx("input",{type:"text",value:h.filter||"",onChange:C=>se(C.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:C=>{C.target.closest("div").style.borderColor="var(--green)66"},onBlur:C=>{C.target.closest("div").style.borderColor="var(--green)33"}})})]}),d.jsxs("div",{style:{flex:1,minWidth:200},children:[d.jsx("label",{style:{display:"block",fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.1em",color:"var(--yellow)",marginBottom:4},children:"Filter"}),d.jsxs("div",{style:{display:"flex",alignItems:"center",background:"var(--yellow-bg)",border:"1px solid var(--yellow)33",borderRadius:6},children:[d.jsx("input",{type:"text",value:T,onChange:C=>Z(C.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:C=>{C.target.closest("div").style.borderColor="var(--yellow)66"},onBlur:C=>{C.target.closest("div").style.borderColor="var(--yellow)33"}}),d.jsxs("div",{style:{display:"flex",gap:2,paddingRight:6,flexShrink:0},children:[d.jsx(yn,{label:"Aa",active:K.caseSensitive,onClick:()=>$(C=>({...C,caseSensitive:!C.caseSensitive})),color:"var(--yellow)"}),d.jsx(yn,{label:"ab",active:K.wholeWord,onClick:()=>$(C=>({...C,wholeWord:!C.wholeWord})),color:"var(--yellow)"}),d.jsx(yn,{label:".*",active:K.regex,onClick:()=>$(C=>({...C,regex:!C.regex})),color:"var(--yellow)"})]})]})]}),d.jsx(Co,{onClick:()=>Q(h.filter||"",(h.tokens||[null])[h.page])})]}),re!=null&&d.jsxs("div",{style:{flex:1,overflow:"auto",position:"relative"},children:[d.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:[d.jsxs("span",{children:[T?`${ve.length} of ${de} objects`:`${de} objects`,h.filter?` with prefix "${h.filter}"`:""]}),(Oe||h.page>0)&&d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[d.jsx("button",{style:Dh(h.page>0),disabled:h.page<=0,onClick:H,children:"Prev"}),d.jsxs("span",{children:["Page ",h.page+1]}),d.jsx("button",{style:Dh(Oe),disabled:!Oe,onClick:ye,children:"Next"})]})]}),ve&&ve.length===0?d.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--text-dim)"},children:T?"No matching objects":"No objects found"}):ve&&d.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12},children:[d.jsx("thead",{children:d.jsx("tr",{children:F.map(C=>d.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:C},C))})}),d.jsx("tbody",{children:ve.map((C,X)=>{const B=g===C.key;return d.jsx("tr",{onClick:()=>G(C.key),style:{cursor:"pointer",background:B?"var(--selected-row)":X%2===1?"var(--row-alt)":"transparent",borderLeft:B?"3px solid var(--purple)":"3px solid transparent"},onMouseEnter:ie=>{B||(ie.currentTarget.style.background="var(--row-hover)")},onMouseLeave:ie=>{ie.currentTarget.style.background=B?"var(--selected-row)":X%2===1?"var(--row-alt)":"transparent"},children:F.map(ie=>d.jsx("td",{style:{padding:"6px 12px",borderBottom:"1px solid var(--border)",whiteSpace:"nowrap",maxWidth:500,overflow:"hidden",textOverflow:"ellipsis"},children:ie==="size"?Op(C[ie]):String(C[ie])},ie))},C.key)})})]})]})]}),g&&d.jsx(Mp,{detail:S,loading:b,onClose:()=>{m(null),y(null)}})]})}var Is=Bh();class O{static getElements(n,a=document){if(typeof n=="string"){const r="getElementById"in a?a:void 0;if(r&&!isNaN(+n[0])){const c=r.getElementById(n);return c?[c]:[]}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 c=a.querySelector(`[gs-id="${n}"]`);return c?[c]:[]}return Array.from(o)}return[n]}static getElement(n,a=document){if(typeof n=="string"){const r="getElementById"in a?a:void 0;if(!n.length)return null;if(r&&n[0]==="#")return r.getElementById(n.substring(1));if(n[0]==="#"||n[0]==="."||n[0]==="[")return a.querySelector(n);if(r&&!isNaN(+n[0]))return r.getElementById(n);let o=a.querySelector(n);return r&&!o&&(o=r.getElementById(n)),o||(o=a.querySelector("."+n)),o}return n}static lazyLoad(n){var a,r;return n.lazyLoad||((r=(a=n.grid)==null?void 0:a.opts)==null?void 0:r.lazyLoad)&&n.lazyLoad!==!1}static createDiv(n,a){const r=document.createElement("div");return n.forEach(o=>{o&&r.classList.add(o)}),a==null||a.appendChild(r),r}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 O.isIntercepted(n,{x:a.x-.5,y:a.y-.5,w:a.w+1,h:a.h+1})}static areaIntercept(n,a){const r=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<=r)return 0;const c=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<=c?0:(o-r)*(g-c)}static area(n){return n.w*n.h}static sort(n,a=1){return n.sort((o,c)=>{const g=a*((o.y??1e4)-(c.y??1e4));return g===0?a*((o.x??1e4)-(c.x??1e4)):g})}static find(n,a){return a?n.find(r=>r.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,r="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}`);r=o[2]||"px",a=parseFloat(o[1])}else a=n;return{h:a,unit:r}}static defaults(n,...a){return a.forEach(r=>{for(const o in r){if(!r.hasOwnProperty(o))return;n[o]===null||n[o]===void 0?n[o]=r[o]:typeof r[o]=="object"&&typeof n[o]=="object"&&O.defaults(n[o],r[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 r in n)if(n[r]!==a[r])return!1;return!0}static copyPos(n,a,r=!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),r&&(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 r in n){const o=n[r],c=a[r];r[0]==="_"||o===c?delete n[r]:o&&typeof o=="object"&&c!==void 0&&(O.removeInternalAndSame(o,c),Object.keys(o).length||delete n[r])}}static removeInternalForSave(n,a=!0){for(let r in n)(r[0]==="_"||n[r]===null||n[r]===void 0)&&delete n[r];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 r=!1;return(...o)=>{r||(r=!0,setTimeout(()=>{n(...o),r=!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:O.getScrollElement(n.parentElement)}static updateScrollPosition(n,a,r){const o=O.getScrollElement(n);if(!o)return;const c=n.getBoundingClientRect(),g=o.getBoundingClientRect(),m=window.innerHeight||document.documentElement.clientHeight,S=c.bottom-Math.min(g.bottom,m),y=c.top-Math.max(g.top,0),b=o.scrollTop;y<0&&r<0?n.offsetHeight>g.height?o.scrollTop+=r:o.scrollTop+=Math.abs(y)>Math.abs(r)?r:y:S>0&&r>0&&(n.offsetHeight>g.height?o.scrollTop+=r:o.scrollTop+=S>r?r:S),a.top+=o.scrollTop-b}static updateScrollResize(n,a,r){const o=O.getScrollElement(a),c=o.clientHeight,g=o===O.getScrollElement()?0:o.getBoundingClientRect().top,m=n.clientY-g,S=m<r,y=m>c-r;S?o.scrollBy({behavior:"smooth",top:m-r}):y&&o.scrollBy({behavior:"smooth",top:r-(c-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"],r=O.clone(n);for(const o in r)r.hasOwnProperty(o)&&typeof r[o]=="object"&&o.substring(0,2)!=="__"&&!a.find(c=>c===o)&&(r[o]=O.cloneDeep(n[o]));return r}static cloneNode(n){const a=n.cloneNode(!0);return a.removeAttribute("id"),a}static appendTo(n,a){let r;typeof a=="string"?r=O.getElement(a):r=a,r&&r.appendChild(n)}static addElStyles(n,a){if(a instanceof Object)for(const r in a)a.hasOwnProperty(r)&&(Array.isArray(a[r])?a[r].forEach(o=>{n.style[r]=o}):n.style[r]=a[r])}static initEvent(n,a){const r={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(c=>r[c]=n[c]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(c=>r[c]=n[c]),{...r,...o}}static simulateMouseEvent(n,a,r){const o=n,c=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});(r||n.target).dispatchEvent(c)}static getValuesFromTransformedElement(n){const a=document.createElement("div");O.addElStyles(a,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),n.appendChild(a);const r=a.getBoundingClientRect();return n.removeChild(a),a.remove(),{xScale:1/r.width,yScale:1/r.height,xOffset:r.left,yOffset:r.top}}static swap(n,a,r){if(!n)return;const o=n[a];n[a]=n[r],n[r]=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 Nl{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,r,o={}){if(this.sortNodes(-1),r=r||this.collide(n,a),!r)return!1;if(n._moving&&!o.nested&&!this.float&&this.swap(n,r))return!0;let c=a;!this._loading&&this._useEntireRowArea(n,a)&&(c={x:0,w:this.column,y:a.y,h:a.h},r=this.collide(n,c,o.skip));let g=!1;const m={nested:!0,pack:!1};let S=0;for(;r=r||this.collide(n,c,o.skip);){if(S++>this.nodes.length*2)throw new Error("Infinite collide check");let y;if(r.locked||this._loading||n._moving&&!n._skipDown&&a.y>n.y&&!this.float&&(!this.collide(r,{...r,y:n.y},n)||!this.collide(r,{...r,y:a.y-r.h},n))){n._skipDown=n._skipDown||a.y>n.y;const b={...a,y:r.y+r.h,...m};y=this._loading&&O.samePos(n,b)?!0:this.moveNode(n,b),(r.locked||this._loading)&&y?O.copyPos(a,n):!r.locked&&y&&o.pack&&(this._packNodes(),a.y=r.y+r.h,O.copyPos(n,a)),g=g||y}else y=this.moveNode(r,{...r,y:a.y+a.h,skip:n,...m});if(!y)return g;r=void 0}return g}collide(n,a=n,r){const o=n._id,c=r==null?void 0:r._id;return this.nodes.find(g=>g._id!==o&&g._id!==c&&O.isIntercepted(g,a))}collideAll(n,a=n,r){const o=n._id,c=r==null?void 0:r._id;return this.nodes.filter(g=>g._id!==o&&g._id!==c&&O.isIntercepted(g,a))}directionCollideCoverage(n,a,r){if(!a.rect||!n._rect)return;const o=n._rect,c={...a.rect};c.y>o.y?(c.h+=c.y-o.y,c.y=o.y):c.h+=o.y-c.y,c.x>o.x?(c.w+=c.x-o.x,c.x=o.x):c.w+=o.x-c.x;let g,m=.5;for(let S of r){if(S.locked||!S._rect)break;const y=S._rect;let b=Number.MAX_VALUE,v=Number.MAX_VALUE;o.y<y.y?b=(c.y+c.h-y.y)/y.h:o.y+o.h>y.y+y.h&&(b=(y.y+y.h-c.y)/y.h),o.x<y.x?v=(c.x+c.w-y.x)/y.w:o.x+o.w>y.x+y.w&&(v=(y.x+y.w-c.x)/y.w);const T=Math.min(v,b);T>m&&(m=T,g=S)}return a.collide=g,g}cacheRects(n,a,r,o,c,g){return this.nodes.forEach(m=>m._rect={y:m.y*a+r,x:m.x*n+g,w:m.w*n-g-o,h:m.h*a-r-c}),this}swap(n,a){if(!a||a.locked||!n||n.locked)return!1;function r(){const c=a.x,g=a.y;return a.x=n.x,a.y=n.y,n.h!=a.h?(n.x=c,n.y=a.y+a.h):n.w!=a.w?(n.x=a.x+a.w,n.y=g):(n.x=c,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=O.isTouching(n,a)))return r();if(o!==!1){if(n.w===a.w&&n.x===a.x&&(o||(o=O.isTouching(n,a)))){if(a.y<n.y){const c=n;n=a,a=c}return r()}if(o!==!1){if(n.h===a.h&&n.y===a.y&&(o||(o=O.isTouching(n,a)))){if(a.x<n.x){const c=n;n=a,a=c}return r()}return!1}}}isAreaEmpty(n,a,r,o){const c={x:n||0,y:a||0,w:r||1,h:o||1};return!this.collide(c)}compact(n="compact",a=!0){if(this.nodes.length===0)return this;a&&this.sortNodes();const r=this.batchMode;r||this.batchUpdate();const o=this._inColumnResize;o||(this._inColumnResize=!0);const c=this.nodes;return this.nodes=[],c.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,r||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=O.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 r=a===0?0:n.y-1;if(!(a===0||!this.collide(n,{x:n.x,y:r,w:n.w,h:n.h})))break;n._dirty=n.y!==r,n.y=r}}),this)}prepareNode(n,a){n._id=n._id??Nl._idSeq++;const r=n.id;if(r){let c=1;for(;this.nodes.find(g=>g.id===n.id&&g!==n);)n.id=r+"_"+c++}(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 O.defaults(n,o),n.autoPosition||delete n.autoPosition,n.noResize||delete n.noResize,n.noMove||delete n.noMove,O.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 r=n._orig||O.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 c={...n};c.autoPosition||c.x===void 0?(delete c.x,delete c.y):c.x=Math.min(this.defaultColumn-1,c.x),c.w=Math.min(this.defaultColumn,c.w||1),this.cacheOneLayout(c,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),O.samePos(n,r)||(n._dirty=!0),this}getDirtyNodes(n){return n?this.nodes.filter(a=>a._dirty&&!O.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=O.copyPos({},n),delete n._dirty}),this._hasLocked=this.nodes.some(n=>n.locked),this}restoreInitial(){return this.nodes.forEach(n=>{!n._orig||O.samePos(n,n._orig)||(O.copyPos(n,n._orig),n._dirty=!0)}),this._notify(),this}findEmptyPosition(n,a=this.nodes,r=this.column,o){const c=o?o.y*r+(o.x+o.w):0;let g=!1;for(let m=c;!g;++m){const S=m%r,y=Math.floor(m/r);if(S+n.w>r)continue;const b={x:S,y,w:n.w,h:n.h};a.find(v=>O.isIntercepted(b,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,r){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 c;return n.autoPosition&&this.findEmptyPosition(n,this.nodes,this.column,r)&&(delete n.autoPosition,c=!0),this.nodes.push(n),a&&this.addedNodes.push(n),c||this._fixCollisions(n),this.batchMode||this._packNodes()._notify(),n}removeNode(n,a=!0,r=!1){return this.nodes.find(o=>o._id===n._id)?(r&&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 r=this.nodes;return this.removedNodes=a?r:[],this.nodes=[],this._notify(r)}moveNodeCheck(n,a){if(!this.changedPosConstrain(n,a))return!1;if(a.pack=!0,!this.maxRow)return this.moveNode(n,a);let r;const o=new Nl({column:this.column,float:this.float,nodes:this.nodes.map(g=>g._id===n._id?(r={...g},r):{...g})});if(!r)return!1;const c=o.moveNode(r,a)&&o.getRow()<=Math.max(this.getRow(),this.maxRow);if(!c&&!a.resizing&&a.collide){const g=a.collide.el.gridstackNode;if(this.swap(n,g))return this._notify(),!0}return c?(o.nodes.filter(g=>g._dirty).forEach(g=>{const m=this.nodes.find(S=>S._id===g._id);m&&(O.copyPos(m,g),m._dirty=!0)}),this._notify(),!0):!1}willItFit(n){if(delete n._willFitPos,!this.maxRow)return!0;const a=new Nl({column:this.column,float:this.float,nodes:this.nodes.map(o=>({...o}))}),r={...n};return this.cleanupNode(r),delete r.el,delete r._id,delete r.content,delete r.grid,a.addNode(r),a.getRow()<=this.maxRow?(n._willFitPos=O.copyPos({},r),!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,b;if(!n||!a)return!1;let r;a.pack===void 0&&!this.batchMode&&(r=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,c=O.copyPos({},n,!0);if(O.copyPos(c,a),this.nodeBoundFix(c,o),O.copyPos(a,c),!a.forceCollide&&O.samePos(n,a))return!1;const g=O.copyPos({},n),m=this.collideAll(n,c,a.skip);let S=!0;if(m.length){const v=n._moving&&!a.nested;let T=v?this.directionCollideCoverage(n,a,m):m[0];if(v&&T&&((b=(y=n.grid)==null?void 0:y.opts)!=null&&b.subGridDynamic)&&!n.grid._isTemp){const Z=O.areaIntercept(a.rect,T._rect),K=O.area(a.rect),$=O.area(T._rect);Z/(K<$?K:$)>.8&&(T.grid.makeSubGrid(T.el,void 0,n),T=void 0)}T?S=!this._fixCollisions(n,c,T,a):(S=!1,r&&delete a.pack)}return S&&!O.samePos(n,c)&&(n._dirty=!0,O.copyPos(n,c)),a.pack&&this._packNodes()._notify(),!O.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,r){var m;const o=((m=this._layouts)==null?void 0:m.length)||0;let c;o&&(r?r!==this.column&&(c=this._layouts[r]):this.column!==o-1&&(c=this._layouts[o-1]));const g=[];return this.sortNodes(),this.nodes.forEach(S=>{const y=c==null?void 0:c.find(v=>v._id===S._id),b={...S,...y||{}};O.removeInternalForSave(b,!n),a&&a(S,b),g.push(b)}),g}layoutsNodesChange(n){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((a,r)=>{if(!a||r===this.column)return this;if(r<this.column)this._layouts[r]=void 0;else{const o=r/this.column;n.forEach(c=>{if(!c._orig)return;const g=a.find(m=>m._id===c._id);g&&(g.y>=0&&c.y!==c._orig.y&&(g.y+=c.y-c._orig.y,g.y<0&&(g.y=0)),c.x!==c._orig.x&&(g.x=Math.round(c.x*o),g.x<0&&(g.x=0)),c.w!==c._orig.w&&(g.w=Math.round(c.w*o),g.w<1&&(g.w=1)))})}}),this)}columnChanged(n,a,r="moveScale"){var m;if(!this.nodes.length||!a||n===a)return this;const o=r==="compact"||r==="list";o&&this.sortNodes(1),a<n&&this.cacheLayout(this.nodes,n),this.batchUpdate();let c=[],g=o?this.nodes:O.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(b=>{const v=g.find(T=>T._id===b._id);v&&(!o&&!b.autoPosition&&(v.x=b.x??v.x,v.y=b.y??v.y),v.w=b.w??v.w,(b.x==null||b.y===void 0)&&(v.autoPosition=!0))})),S.forEach(b=>{const v=g.findIndex(T=>T._id===b._id);if(v!==-1){const T=g[v];if(o){T.w=b.w;return}(b.autoPosition||isNaN(b.x)||isNaN(b.y))&&this.findEmptyPosition(b,c),b.autoPosition||(T.x=b.x??T.x,T.y=b.y??T.y,T.w=b.w??T.w,c.push(T)),g.splice(v,1)}})}if(o)this.compact(r,!1);else{if(g.length)if(typeof r=="function")r(a,n,c,g);else{const S=o||r==="none"?1:a/n,y=r==="move"||r==="moveScale",b=r==="scale"||r==="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:b?Math.round(v.w*S)||1:Math.min(v.w,a),c.push(v)}),g=[]}c=O.sort(c,-1),this._inColumnResize=!0,this.nodes=[],c.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,r=!1){const o=[];return n.forEach((c,g)=>{if(c._id===void 0){const m=c.id?this.nodes.find(S=>S.id===c.id):void 0;c._id=(m==null?void 0:m._id)??Nl._idSeq++}o[g]={x:c.x,y:c.y,w:c.w,_id:c._id}}),this._layouts=r?[]:this._layouts||[],this._layouts[a]=o,this}cacheOneLayout(n,a){n._id=n._id??Nl._idSeq++;const r={x:n.x,y:n.y,w:n.w,_id:n._id};(n.autoPosition||n.x===void 0)&&(delete r.x,delete r.y,n.autoPosition&&(r.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(r):this._layouts[a][o]=r,this}findCacheLayout(n,a){var r,o;return((o=(r=this._layouts)==null?void 0:r[a])==null?void 0:o.findIndex(c=>c._id===n._id))??-1}removeNodeFromLayoutCache(n){if(this._layouts)for(let a=0;a<this._layouts.length;a++){const r=this.findCacheLayout(n,a);r!==-1&&this._layouts[a].splice(r,1)}}cleanupNode(n){for(const a in n)a[0]==="_"&&a!=="_id"&&delete n[a];return this}}Nl._idSeq=0;const Gt={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 pe{}const al=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 Yt{}function Zs(h,n){h.touches.length>1||(h.cancelable&&h.preventDefault(),O.simulateMouseEvent(h.changedTouches[0],n))}function qh(h,n){h.cancelable&&h.preventDefault(),O.simulateMouseEvent(h,n)}function Ks(h){Yt.touchHandled||(Yt.touchHandled=!0,Zs(h,"mousedown"))}function Js(h){Yt.touchHandled&&Zs(h,"mousemove")}function Ws(h){if(!Yt.touchHandled)return;Yt.pointerLeaveTimeout&&(window.clearTimeout(Yt.pointerLeaveTimeout),delete Yt.pointerLeaveTimeout);const n=!!pe.dragElement;Zs(h,"mouseup"),n||Zs(h,"click"),Yt.touchHandled=!1}function $s(h){h.pointerType!=="mouse"&&h.target.releasePointerCapture(h.pointerId)}function Oh(h){pe.dragElement&&h.pointerType!=="mouse"&&qh(h,"mouseenter")}function Nh(h){pe.dragElement&&h.pointerType!=="mouse"&&(Yt.pointerLeaveTimeout=window.setTimeout(()=>{delete Yt.pointerLeaveTimeout,qh(h,"mouseleave")},10))}class Ps{constructor(n,a,r){this.host=n,this.dir=a,this.option=r,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(`${Ps.prefix}${this.dir}`),this.el.style.zIndex="100",this.el.style.userSelect="none",this.el.addEventListener("mousedown",this._mouseDown),al&&(this.el.addEventListener("touchstart",Ks),this.el.addEventListener("pointerdown",$s)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),al&&(this.el.removeEventListener("touchstart",Ks),this.el.removeEventListener("pointerdown",$s)),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),al&&(this.el.addEventListener("touchmove",Js),this.el.addEventListener("touchend",Ws)),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),al&&(this.el.removeEventListener("touchmove",Js),this.el.removeEventListener("touchend",Ws)),delete this.moving,delete this.mouseDownEvent,n.stopPropagation(),n.preventDefault()}_keyEvent(n){var a,r;n.key==="Escape"&&((r=(a=this.host.gridstackNode)==null?void 0:a.grid)==null||r.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(n,a){return this.option[n]&&this.option[n](a),this}}Ps.prefix="ui-resizable-";class Ro{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 va extends Ro{constructor(n,a={}){super(),this.el=n,this.option=a,this.rectScale={x:1,y:1},this._ui=()=>{const o=this.el.parentElement.getBoundingClientRect(),c={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},g=this.temporalRect||c;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,r=n.autoHide&&n.autoHide!==this.option.autoHide;return Object.keys(n).forEach(o=>this.option[o]=n[o]),a&&(this._removeHandlers(),this._setupHandlers()),r&&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),pe.overResizeElement===this&&delete pe.overResizeElement),this}_mouseOver(n){pe.overResizeElement||pe.dragElement||(pe.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(n){pe.overResizeElement===this&&(delete pe.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(n=>n.trim()).map(n=>new Ps(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=O.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=O.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=n,this._setupHelper(),this._applyChange();const a=O.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 r=O.initEvent(n,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(r,this._ui()),this.triggerEvent("resize",r),this}_resizeStop(n){const a=O.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=va._originStyleProp.map(r=>this.el.style[r]),this.parentOriginStylePosition=this.el.parentElement.style.position;const n=this.el.parentElement,a=O.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 va._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 r=this.startEvent,o={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},c=n.clientX-r.clientX,g=this.sizeToContent?0:n.clientY-r.clientY;let m,S;a.indexOf("e")>-1?o.width+=c:a.indexOf("w")>-1&&(o.width-=c,o.left+=c,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,r,o){const c=this.option,g=(r?c.maxWidthMoveLeft:c.maxWidth)||Number.MAX_SAFE_INTEGER,m=c.minWidth/this.rectScale.x||n,S=(o?c.maxHeightMoveUp:c.maxHeight)||Number.MAX_SAFE_INTEGER,y=c.minHeight/this.rectScale.y||a,b=Math.min(g,Math.max(m,n)),v=Math.min(S,Math.max(y,a));return{width:b,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:r,top:o}=a.getBoundingClientRect();n={left:r,top:o,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(a=>{const r=this.temporalRect[a],o=a==="width"||a==="left"?this.rectScale.x:a==="height"||a==="top"?this.rectScale.y:1;this.el.style[a]=(r-n[a])*o+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(n=>n.destroy()),delete this.handlers,this}}va._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const Hp='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class xa extends Ro{constructor(n,a={}){var c;super(),this.el=n,this.option=a,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const r=(c=a==null?void 0:a.handle)==null?void 0:c.substring(1),o=n.gridstackNode;this.dragEls=!r||n.classList.contains(r)?[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),al&&(n.addEventListener("touchstart",Ks),n.addEventListener("pointerdown",$s))}),this.el.classList.remove("ui-draggable-disabled"))}disable(n=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(a=>{a.removeEventListener("mousedown",this._mouseDown),al&&(a.removeEventListener("touchstart",Ks),a.removeEventListener("pointerdown",$s))}),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(Yt.touchHandled&&n.isTrusted&&(Yt.touchHandled=!1),!pe.mouseHandled)return n.button!==0||!this.dragEls.find(a=>a===n.target)&&n.target.closest(Hp)||this.option.cancel&&n.target.closest(this.option.cancel)||(this.mouseDownEvent=n,delete this.dragging,delete pe.dragElement,delete pe.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),al&&(n.currentTarget.addEventListener("touchmove",Js),n.currentTarget.addEventListener("touchend",Ws)),n.preventDefault(),document.activeElement&&document.activeElement.blur(),pe.mouseHandled=!0),!0}_callDrag(n){if(!this.dragging)return;const a=O.initEvent(n,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(a,this.ui()),this.triggerEvent("drag",a)}_mouseMove(n){var r;const a=this.mouseDownEvent;if(this.lastDrag=n,this.dragging)if(this._dragFollow(n),pe.pauseDrag){const o=Number.isInteger(pe.pauseDrag)?pe.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,pe.dragElement=this;const o=(r=this.el.gridstackNode)==null?void 0:r.grid;o?pe.dropElement=o.el.ddElement.ddDroppable:delete pe.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=O.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(n,this.el,this.helperContainment),this._setupHelperStyle(n);const c=O.initEvent(n,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(c,this.ui()),this.triggerEvent("dragstart",c),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(n){var a,r;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),al&&n.currentTarget&&(n.currentTarget.removeEventListener("touchmove",Js,!0),n.currentTarget.removeEventListener("touchend",Ws,!0)),this.dragging){delete this.dragging,(a=this.el.gridstackNode)==null||delete a._origRotate,document.removeEventListener("keydown",this._keyEvent),((r=pe.dropElement)==null?void 0:r.el)===this.el.parentElement&&delete pe.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const o=O.initEvent(n,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(o),this.triggerEvent("dragstop",o),pe.dropElement&&pe.dropElement.drop(n)}delete this.helper,delete this.mouseDownEvent,delete pe.dragElement,delete pe.dropElement,delete pe.mouseHandled,n.preventDefault()}_keyEvent(n){var o,c;const a=this.el.gridstackNode,r=(a==null?void 0:a.grid)||((c=(o=pe.dropElement)==null?void 0:o.el)==null?void 0:c.gridstack);if(n.key==="Escape")a&&a._origRotate&&(a._orig=a._origRotate,delete a._origRotate),r==null||r.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(a&&r&&(n.key==="r"||n.key==="R")){if(!O.canBeRotated(a))return;a._origRotate=a._origRotate||{...a._orig},delete a._moving,r.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",O.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=O.cloneNode(this.el)),n.parentElement||O.appendTo(n,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=xa.originStyleProp.map(a=>this.el.style[a]),n}_setupHelperStyle(n){var r,o;this.helper.classList.add("ui-draggable-dragging"),(o=(r=this.el.gridstackNode)==null?void 0:r.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,r,o;this.helper.classList.remove("ui-draggable-dragging"),(r=(a=this.el.gridstackNode)==null?void 0:a.grid)==null||r.el.classList.remove("grid-stack-dragging");const n=(o=this.helper)==null?void 0:o.gridstackNode;if(!(n!=null&&n._isAboutToRemove)&&this.dragElementOriginStyle){const c=this.helper,g=this.dragElementOriginStyle.transition||null;c.style.transition=this.dragElementOriginStyle.transition="none",xa.originStyleProp.forEach(m=>c.style[m]=this.dragElementOriginStyle[m]||null),setTimeout(()=>c.style.transition=g,50)}return delete this.dragElementOriginStyle,this}_dragFollow(n){const a={left:0,top:0},r=this.helper.style,o=this.dragOffset;r.left=(n.clientX+o.offsetLeft-a.left)*this.dragTransform.xScale+"px",r.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,r){let o=0,c=0;r&&(o=this.dragTransform.xOffset,c=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-c,width:g.width*this.dragTransform.xScale,height:g.height*this.dragTransform.yScale}}ui(){const a=this.el.parentElement.getBoundingClientRect(),r=this.helper.getBoundingClientRect();return{position:{top:(r.top-a.top)*this.dragTransform.yScale,left:(r.left-a.left)*this.dragTransform.xScale}}}}xa.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];class kp extends Ro{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),al&&(this.el.addEventListener("pointerenter",Oh),this.el.addEventListener("pointerleave",Nh)))}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),al&&(this.el.removeEventListener("pointerenter",Oh),this.el.removeEventListener("pointerleave",Nh)))}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(!pe.dragElement||Yt.touchHandled&&n.isTrusted||!this._canDrop(pe.dragElement.el))return;n.preventDefault(),n.stopPropagation(),pe.dropElement&&pe.dropElement!==this&&pe.dropElement._mouseLeave(n,!0),pe.dropElement=this;const a=O.initEvent(n,{target:this.el,type:"dropover"});this.option.over&&this.option.over(a,this._ui(pe.dragElement)),this.triggerEvent("dropover",a),this.el.classList.add("ui-droppable-over")}_mouseLeave(n,a=!1){var o;if(!pe.dragElement||pe.dropElement!==this)return;n.preventDefault(),n.stopPropagation();const r=O.initEvent(n,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(r,this._ui(pe.dragElement)),this.triggerEvent("dropout",r),pe.dropElement===this&&(delete pe.dropElement,!a)){let c,g=this.el.parentElement;for(;!c&&g;)c=(o=g.ddElement)==null?void 0:o.ddDroppable,g=g.parentElement;c&&c._mouseEnter(n)}}drop(n){n.preventDefault();const a=O.initEvent(n,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(a,this._ui(pe.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 wo{static init(n){return n.ddElement||(n.ddElement=new wo(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 xa(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 va(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 kp(this.el,n),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class Lp{resizable(n,a,r,o){return this._getDDElements(n,a).forEach(c=>{if(a==="disable"||a==="enable")c.ddResizable&&c.ddResizable[a]();else if(a==="destroy")c.ddResizable&&c.cleanResizable();else if(a==="option")c.setupResizable({[r]:o});else{const m=c.el.gridstackNode.grid;let S=c.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;c.setupResizable({...m.opts.resizable,handles:S,autoHide:y,start:a.start,stop:a.stop,resize:a.resize})}}),this}draggable(n,a,r,o){return this._getDDElements(n,a).forEach(c=>{if(a==="disable"||a==="enable")c.ddDraggable&&c.ddDraggable[a]();else if(a==="destroy")c.ddDraggable&&c.cleanDraggable();else if(a==="option")c.setupDraggable({[r]:o});else{const g=c.el.gridstackNode.grid;c.setupDraggable({...g.opts.draggable,start:a.start,stop:a.stop,drag:a.drag})}}),this}dragIn(n,a){return this._getDDElements(n).forEach(r=>r.setupDraggable(a)),this}droppable(n,a,r,o){return typeof a.accept=="function"&&!a._accept&&(a._accept=a.accept,a.accept=c=>a._accept(c)),this._getDDElements(n,a).forEach(c=>{a==="disable"||a==="enable"?c.ddDroppable&&c.ddDroppable[a]():a==="destroy"?c.ddDroppable&&c.cleanDroppable():a==="option"?c.setupDroppable({[r]:o}):c.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,r){return this._getDDElements(n).forEach(o=>o.on(a,c=>{r(c,pe.dragElement?pe.dragElement.el:c.target,pe.dragElement?pe.dragElement.helper:null)})),this}off(n,a){return this._getDDElements(n).forEach(r=>r.off(a)),this}_getDDElements(n,a){const r=n.gridstack||a!=="destroy"&&a!=="disable",o=O.getElements(n);return o.length?o.map(g=>g.ddElement||(r?wo.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 Tt=new Lp;class ce{static init(n={},a=".grid-stack"){if(typeof document>"u")return null;const r=ce.getGridElement(a);return r?(r.gridstack||(r.gridstack=new ce(r,O.cloneDeep(n))),r.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 r=[];return typeof document>"u"||(ce.getGridElements(a).forEach(o=>{o.gridstack||(o.gridstack=new ce(o,O.cloneDeep(n))),r.push(o.gridstack)}),r.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.`)),r}static addGrid(n,a={}){if(!n)return null;let r=n;if(r.gridstack){const g=r.gridstack;return a&&(g.opts={...g.opts,...a}),a.children!==void 0&&g.load(a.children),g}return(!n.classList.contains("grid-stack")||ce.addRemoveCB)&&(ce.addRemoveCB?r=ce.addRemoveCB(n,a,!0,!0):r=O.createDiv(["grid-stack",a.class],n)),ce.init(a,r)}static registerEngine(n){ce.engineClass=n}get placeholder(){if(!this._placeholder){this._placeholder=O.createDiv([this.opts.placeholderClass,Gt.itemClass,this.opts.itemClass]);const n=O.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 r=O.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 b=o.breakpoints;!o.columnWidth&&!(b!=null&&b.length)?delete a.columnOpts:(o.columnMax=o.columnMax||12,(b==null?void 0:b.length)>1&&b.sort((v,T)=>(T.w||0)-(v.w||0)))}const c={...O.cloneDeep(Gt),column:O.toNumber(n.getAttribute("gs-column"))||Gt.column,minRow:r||O.toNumber(n.getAttribute("gs-min-row"))||Gt.minRow,maxRow:r||O.toNumber(n.getAttribute("gs-max-row"))||Gt.maxRow,staticGrid:O.toBool(n.getAttribute("gs-static"))||Gt.staticGrid,sizeToContent:O.toBool(n.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(a.handleClass?"."+a.handleClass:a.handle?a.handle:"")||Gt.draggable.handle},removableOptions:{accept:a.itemClass||Gt.removableOptions.accept,decline:Gt.removableOptions.decline}};n.getAttribute("gs-animate")&&(c.animate=O.toBool(n.getAttribute("gs-animate"))),a=O.defaults(a,c),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("."+Gt.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!==Gt.cellHeightUnit&&(a.cellHeight=a.cellHeight+a.cellHeightUnit,delete a.cellHeightUnit);const b=a.cellHeight;delete a.cellHeight,this.cellHeight(b)}a.alwaysShowResizeHandle==="mobile"&&(a.alwaysShowResizeHandle=al),this._setStaticClass();const S=a.engineClass||ce.engineClass||Nl;if(this.engine=new S({column:this.getColumn(),float:a.float,maxRow:a.maxRow,onChange:b=>{b.forEach(v=>{const T=v.el;T&&(v._removeDOM?(T&&T.remove(),delete v._removeDOM):this._writePosAttr(T,v))}),this._updateContainerHeight()}}),a.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(b=>this._prepareElement(b)),delete this.engine._loading,this.batchUpdate(!1)),a.children){const b=a.children;delete a.children,b.length&&this.load(b)}this.setAnimation(),a.subGridDynamic&&!pe.pauseDrag&&(pe.pauseDrag=!0),((y=a.draggable)==null?void 0:y.pause)!==void 0&&(pe.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,r=n;if(r.grid=this,r.el?a=r.el:ce.addRemoveCB?a=ce.addRemoveCB(this.el,n,!0,!1):a=this.createWidgetDivs(r),!a)return;if(r=a.gridstackNode,r&&a.parentElement===this.el&&this.engine.nodes.find(c=>c._id===r._id))return a;const o=this._readAttr(a);return O.defaults(n,o),this.engine.prepareNode(n),this.el.appendChild(a),this.makeWidget(a,n),a}createWidgetDivs(n){const a=O.createDiv(["grid-stack-item",this.opts.itemClass]),r=O.createDiv(["grid-stack-item-content"],a);return O.lazyLoad(n)?n.visibleObservable||(n.visibleObservable=new IntersectionObserver(([o])=>{var c,g;o.isIntersecting&&((c=n.visibleObservable)==null||c.disconnect(),delete n.visibleObservable,ce.renderCB(r,n),(g=n.grid)==null||g.prepareDragDrop(n.el))}),window.setTimeout(()=>{var o;return(o=n.visibleObservable)==null?void 0:o.observe(a)})):ce.renderCB(r,n),a}makeSubGrid(n,a,r,o=!0){var Z,K,$;let c=n.gridstackNode;if(c||(c=this.makeWidget(n).gridstackNode),(Z=c.subGrid)!=null&&Z.el)return c.subGrid;let g,m=this;for(;m&&!g;)g=(K=m.opts)==null?void 0:K.subGridOpts,m=($=m.parentGridNode)==null?void 0:$.grid;a=O.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...g||{},...a||c.subGridOpts||{}}),c.subGridOpts=a;let S;a.column==="auto"&&(S=!0,a.column=Math.max(c.w||1,(r==null?void 0:r.w)||1),delete a.columnOpts);let y=c.el.querySelector(".grid-stack-item-content"),b,v;if(o&&(this._removeDD(c.el),v={...c,x:0,y:0},O.removeInternalForSave(v),delete v.subGridOpts,c.content&&(v.content=c.content,delete c.content),ce.addRemoveCB?b=ce.addRemoveCB(this.el,v,!0,!1):(b=O.createDiv(["grid-stack-item"]),b.appendChild(y),y=O.createDiv(["grid-stack-item-content"],c.el)),this.prepareDragDrop(c.el)),r){const ae=S?a.column:c.w,me=c.h+r.h,he=c.el.style;he.transition="none",this.update(c.el,{w:ae,h:me}),setTimeout(()=>he.transition=null)}const T=c.subGrid=ce.addGrid(y,a);return r!=null&&r._moving&&(T._isTemp=!0),S&&(T._autoColumn=!0),o&&T.makeWidget(b,v),r&&(r._moving?window.setTimeout(()=>O.simulateMouseEvent(r._event,"mouseenter",T.el),0):T.makeWidget(c.el,c)),this.resizeToContentCheck(!1,c),T}removeAsSubGrid(n){var r;const a=(r=this.parentGridNode)==null?void 0:r.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(()=>O.simulateMouseEvent(n._event,"mouseenter",a.el),0))}save(n=!0,a=!1,r=ce.saveCB,o){const c=this.engine.save(n,r,o);if(c.forEach(g=>{var m;if(n&&g.el&&!g.subGrid&&!r){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&&!r&&delete g.content,(m=g.subGrid)!=null&&m.el){const S=g.w||g.subGrid.getColumn(),y=g.subGrid.save(n,a,r,S);g.subGridOpts=a?y:{children:y},delete g.subGrid}delete g.el}),a){const g=O.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,O.removeInternalAndSame(g,Gt),g.children=c,g}return c}load(n,a=ce.addRemoveCB||!0){n=O.cloneDeep(n);const r=this.getColumn();n.forEach(b=>{b.w=b.w||b.minW||1,b.h=b.h||b.minH||1}),n=O.sort(n),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let o=0;n.forEach(b=>{o=Math.max(o,(b.x||0)+b.w)}),o>this.engine.defaultColumn&&(this.engine.defaultColumn=o),o>r&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=n,this.engine.columnChanged(o,r,this.responseLayout),n=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(n,o,!0));const c=ce.addRemoveCB;typeof a=="function"&&(ce.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;O.find(n,v.id)||(ce.addRemoveCB&&ce.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(b=>O.find(n,b.id)?(y.push(b),!1):!0),n.forEach(b=>{var T;const v=O.find(y,b.id);if(v){if(O.shouldSizeToContent(v)&&(b.h=v.h),this.engine.nodeBoundFix(b),(b.autoPosition||b.x===void 0||b.y===void 0)&&(b.w=b.w||v.w,b.h=b.h||v.h,this.engine.findEmptyPosition(b)),this.engine.nodes.push(v),O.samePos(v,b)&&this.engine.nodes.length>1&&(this.moveNode(v,{...b,forceCollide:!0}),O.copyPos(b,v)),this.update(v.el,b),(T=b.subGridOpts)!=null&&T.children){const Z=v.el.querySelector(".grid-stack");Z&&Z.gridstack&&Z.gridstack.load(b.subGridOpts.children)}}else a&&this.addWidget(b)}),delete this.engine._loading,this.engine.removedNodes=g,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,c?ce.addRemoveCB=c:delete ce.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=O.toNumber(a.getAttribute("gs-h"))||1;return Math.round(a.offsetHeight/o)}const r=parseInt(this.el.getAttribute("gs-current-row"));return r?Math.round(this.el.getBoundingClientRect().height/r):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 r=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;n=this.cellWidth()+r}const a=O.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 c,g;const n=this.opts.columnOpts;if(!n||!n.columnWidth&&!((c=n.breakpoints)!=null&&c.length))return!1;const a=this.getColumn();let r=a;const o=this._widthOrContainer(!0);if(n.columnWidth)r=Math.min(Math.round(o/n.columnWidth)||1,n.columnMax);else{r=n.columnMax;let m=0;for(;m<n.breakpoints.length&&o<=n.breakpoints[m].w;)r=n.breakpoints[m++].c||a}if(r!==a){const m=(g=n.breakpoints)==null?void 0:g.find(S=>S.c===r);return this.column(r,(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 r=this.getColumn();return this.opts.column=n,this.engine?(this.engine.column=n,this.el.classList.remove("gs-"+r),this._updateColumnVar(),this.engine.columnChanged(r,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 r=this.el.getBoundingClientRect();let o;a?o={top:r.top+document.documentElement.scrollTop,left:r.left}:o={top:this.el.offsetTop,left:this.el.offsetLeft};const c=n.left-o.left,g=n.top-o.top,m=r.width/this.getColumn(),S=r.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(c/m),y:Math.floor(g/S)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(n,a,r,o){return this.engine.isAreaEmpty(n,a,r,o)}makeWidget(n,a){const r=ce.getElement(n);if(!r||r.gridstackNode)return r;r.parentElement||this.el.appendChild(r),this._prepareElement(r,!0,a);const o=r.gridstackNode;this._updateContainerHeight(),o.subGridOpts&&this.makeSubGrid(r,o.subGridOpts,void 0,!1);let c;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(c=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),c&&delete this._ignoreLayoutsNodeChange,r}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(r=>this.off(r)),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,r=!0){return n?(ce.getElements(n).forEach(o=>{if(o.parentElement&&o.parentElement!==this.el)return;let c=o.gridstackNode;c||(c=this.engine.nodes.find(g=>o===g.el)),c&&(a&&ce.addRemoveCB&&ce.addRemoveCB(this.el,c,!1,!1),delete o.gridstackNode,this._removeDD(o),this.engine.removeNode(c,a,r),a&&o.parentElement&&o.remove())}),r&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(n=!0,a=!0){return this.engine.nodes.forEach(r=>{n&&ce.addRemoveCB&&ce.addRemoveCB(this.el,r,!1,!1),delete r.el.gridstackNode,this.opts.staticGrid||this._removeDD(r.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,r=!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&&r&&o.subGrid.setStatic(n,a,r)}),a&&this._setStaticClass(),this)}updateOptions(n){var r;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),(r=n.children)!=null&&r.length&&this.load(n.children),this)}update(n,a){return ce.getElements(n).forEach(r=>{var b;const o=r==null?void 0:r.gridstackNode;if(!o)return;const c={...O.copyPos({},o),...O.cloneDeep(a)};this.engine.nodeBoundFix(c),delete c.autoPosition;const g=["x","y","w","h"];let m;if(g.some(v=>c[v]!==void 0&&c[v]!==o[v])&&(m={},g.forEach(v=>{m[v]=c[v]!==void 0?c[v]:o[v],delete c[v]})),!m&&(c.minW||c.minH||c.maxW||c.maxH)&&(m={}),c.content!==void 0){const v=r.querySelector(".grid-stack-item-content");v&&v.textContent!==c.content&&(o.content=c.content,ce.renderCB(v,c),(b=o.subGrid)!=null&&b.el&&(v.appendChild(o.subGrid.el),o.subGrid._updateContainerHeight())),delete c.content}let S=!1,y=!1;for(const v in c)v[0]!=="_"&&o[v]!==c[v]&&(o[v]=c[v],S=!0,y=y||!this.opts.staticGrid&&(v==="noResize"||v==="noMove"||v==="locked"));if(O.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(r,o),y&&this.prepareDragDrop(o.el),ce.updateCB&&ce.updateCB(o)}),this}moveNode(n,a){const r=n._updating;r||this.engine.cleanNodes().beginUpdate(n),this.engine.moveNode(n,a),this._updateContainerHeight(),r||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(n){var T,Z;if(!n||(n.classList.remove("size-to-content-max"),!n.clientHeight))return;const a=n.gridstackNode;if(!a)return;const r=a.grid;if(!r||n.parentElement!==r.el)return;const o=r.getCellHeight(!0);if(!o)return;let c=a.h?a.h*o:n.clientHeight,g;if(a.resizeToContentParent&&(g=n.querySelector(a.resizeToContentParent)),g||(g=n.querySelector(ce.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 K=a.subGrid.el.getBoundingClientRect(),$=n.getBoundingClientRect();y+=K.top-$.top}else{if((Z=(T=a.subGridOpts)==null?void 0:T.children)!=null&&Z.length)return;{const K=g.firstElementChild;if(!K){console.error(`Error: GridStack.resizeToContent() widget id:${a.id} '${ce.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}y=K.getBoundingClientRect().height||S}}if(S===y)return;c+=y-S;let b=Math.ceil(c/o);const v=Number.isInteger(a.sizeToContent)?a.sizeToContent:0;v&&b>v&&(b=v,n.classList.add("size-to-content-max")),a.minH&&b<a.minH?b=a.minH:a.maxH&&b>a.maxH&&(b=a.maxH),b!==a.h&&(r._ignoreLayoutsNodeChange=!0,r.moveNode(a,{h:b}),delete r._ignoreLayoutsNodeChange)}resizeToContentCBCheck(n){ce.resizeToContentCB?ce.resizeToContentCB(n):this.resizeToContent(n)}rotate(n,a){return ce.getElements(n).forEach(r=>{const o=r.gridstackNode;if(!O.canBeRotated(o))return;const c={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;c.x=o.x+m-(o.h-(S+1)),c.y=o.y+S-m}Object.keys(c).forEach(m=>{c[m]===void 0&&delete c[m]});const g=o._orig;this.update(r,c),o._orig=g}),this}margin(n){if(!(typeof n=="string"&&n.split(" ").length>1)){const r=O.parseHeight(n);if(this.opts.marginUnit===r.unit&&this.opts.margin===r.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(r=>{delete r._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 r=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(r),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const n=this.parentGridNode;let a=this.getRow()+this._extraDragRow;const r=this.opts.cellHeight,o=this.opts.cellHeightUnit;if(!r)return this;if(!n&&!this.opts.minRow){const c=O.parseHeight(getComputedStyle(this.el).minHeight);if(c.h>0&&c.unit===o){const g=Math.floor(c.h/r);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*r+o),n&&O.shouldSizeToContent(n)&&n.grid.resizeToContentCBCheck(n.el),this}_prepareElement(n,a=!1,r){r=r||this._readAttr(n),n.gridstackNode=r,r.el=n,r.grid=this,r=this.engine.addNode(r,a),this._writeAttr(n,r),n.classList.add(Gt.itemClass,this.opts.itemClass);const o=O.shouldSizeToContent(r);return o?n.classList.add("size-to-content"):n.classList.remove("size-to-content"),o&&this.resizeToContentCheck(!1,r),O.lazyLoad(r)||this.prepareDragDrop(r.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 r={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const o in r)a[o]?n.setAttribute(r[o],String(a[o])):n.removeAttribute(r[o]);return this}_readAttr(n,a=!0){const r={};r.x=O.toNumber(n.getAttribute("gs-x")),r.y=O.toNumber(n.getAttribute("gs-y")),r.w=O.toNumber(n.getAttribute("gs-w")),r.h=O.toNumber(n.getAttribute("gs-h")),r.autoPosition=O.toBool(n.getAttribute("gs-auto-position")),r.noResize=O.toBool(n.getAttribute("gs-no-resize")),r.noMove=O.toBool(n.getAttribute("gs-no-move")),r.locked=O.toBool(n.getAttribute("gs-locked"));const o=n.getAttribute("gs-size-to-content");o&&(o==="true"||o==="false"?r.sizeToContent=O.toBool(o):r.sizeToContent=parseInt(o,10)),r.id=n.getAttribute("gs-id"),r.maxW=O.toNumber(n.getAttribute("gs-max-w")),r.minW=O.toNumber(n.getAttribute("gs-min-w")),r.maxH=O.toNumber(n.getAttribute("gs-max-h")),r.minH=O.toNumber(n.getAttribute("gs-min-h")),a&&(r.w===1&&n.removeAttribute("gs-w"),r.h===1&&n.removeAttribute("gs-h"),r.maxW&&n.removeAttribute("gs-max-w"),r.minW&&n.removeAttribute("gs-min-w"),r.maxH&&n.removeAttribute("gs-max-h"),r.minH&&n.removeAttribute("gs-min-h"));for(const c in r){if(!r.hasOwnProperty(c))return;!r[c]&&r[c]!==0&&c!=="sizeToContent"&&delete r[c]}return r}_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 r=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),r=!0):r=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(o=>{o.subGrid&&o.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(r),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)O.shouldSizeToContent(a)&&this.resizeToContentCBCheck(a.el);else if(this.engine.nodes.some(r=>O.shouldSizeToContent(r))){const r=[...this.engine.nodes];this.batchUpdate(),r.forEach(o=>{O.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(r=>r.sizeToContent));return!n&&a&&!this.resizeObserver?(this._sizeThrottle=O.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 O.getElement(n)}static getElements(n=".grid-stack-item"){return O.getElements(n)}static getGridElement(n){return ce.getElement(n)}static getGridElements(n){return O.getElements(n)}_initMargin(){let n,a=0,r=[];typeof this.opts.margin=="string"&&(r=this.opts.margin.split(" ")),r.length===2?(this.opts.marginTop=this.opts.marginBottom=r[0],this.opts.marginLeft=this.opts.marginRight=r[1]):r.length===4?(this.opts.marginTop=r[0],this.opts.marginRight=r[1],this.opts.marginBottom=r[2],this.opts.marginLeft=r[3]):(n=O.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=O.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 c=this.el.style;return c.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),c.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),c.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),c.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return Tt}static setupDragIn(n,a,r,o=document){(a==null?void 0:a.pause)!==void 0&&(pe.pauseDrag=a.pause),a={appendTo:"body",helper:"clone",...a||{}},(typeof n=="string"?O.getElements(n,o):n).forEach((g,m)=>{Tt.isDraggable(g)||Tt.dragIn(g,a),r!=null&&r[m]&&(g.gridstackNode=r[m])})}movable(n,a){return this.opts.staticGrid?this:(ce.getElements(n).forEach(r=>{const o=r.gridstackNode;o&&(a?delete o.noMove:o.noMove=!0,this.prepareDragDrop(o.el))}),this)}resizable(n,a){return this.opts.staticGrid?this:(ce.getElements(n).forEach(r=>{const o=r.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(r=>{this.prepareDragDrop(r.el),r.subGrid&&a&&r.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(r=>{this.prepareDragDrop(r.el),r.subGrid&&a&&r.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&&ce._itemRemoving(n.el,!1),this.engine.restoreInitial())}_removeDD(n){return Tt.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 Tt.droppable(this.el,"destroy"),this;let n,a;const r=(o,c,g)=>{var T;g=g||c;const m=g.gridstackNode;if(!m)return;if(!((T=m.grid)!=null&&T.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 b=this.el.getBoundingClientRect();y-=b.left,S-=b.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)){Tt.off(c,"drag");return}m._willFitPos&&(O.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 Tt.droppable(this.el,{accept:o=>{const c=o.gridstackNode||this._readAttr(o,!1);if((c==null?void 0:c.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&&c&&this.opts.maxRow){const m={w:c.w,h:c.h,minW:c.minW,minH:c.minH};g=this.engine.willItFit(m)}return g}}).on(this.el,"dropover",(o,c,g)=>{let m=(g==null?void 0:g.gridstackNode)||c.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(c,g),g=g||c,a=this.cellWidth(),n=this.getCellHeight(!0),!m){const b=g.getAttribute("data-gs-widget")||g.getAttribute("gridstacknode");if(b){try{m=JSON.parse(b)}catch{console.error("Gridstack dropover: Bad JSON format: ",b)}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?(c._gridstackNodeOrig||(c._gridstackNodeOrig=m),c.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),ce._itemRemoving(m.el,!1),Tt.on(c,"drag",r),r(o,c,g),!1}).on(this.el,"dropout",(o,c,g)=>{const m=(g==null?void 0:g.gridstackNode)||c.gridstackNode;return m&&(!m.grid||m.grid===this)&&(this._leave(c,g),this._isTemp&&this.removeAsSubGrid(m)),!1}).on(this.el,"drop",(o,c,g)=>{var T,Z,K;const m=(g==null?void 0:g.gridstackNode)||c.gridstackNode;if((m==null?void 0:m.grid)===this&&!m._isExternal)return!1;const S=!!this.placeholder.parentElement,y=c!==g;this.placeholder.remove(),delete this.placeholder.gridstackNode,S&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const b=c._gridstackNodeOrig;if(delete c._gridstackNodeOrig,S&&(b!=null&&b.grid)&&b.grid!==this){const $=b.grid;$.engine.removeNodeFromLayoutCache(b),$.engine.removedNodes.push(b),$._triggerRemoveEvent()._triggerChangeEvent(),$.parentGridNode&&!$.engine.nodes.length&&$.opts.subGridDynamic&&$.removeAsSubGrid()}if(!m||(S&&(this.engine.cleanupNode(m),m.grid=this),(T=m.grid)==null||delete T._isTemp,Tt.off(c,"drag"),g!==c?(g.remove(),c=g):c.remove(),this._removeDD(c),!S))return!1;const v=(K=(Z=m.subGrid)==null?void 0:Z.el)==null?void 0:K.gridstack;return O.copyPos(m,this._readAttr(this.placeholder)),O.removePositioningStyles(c),y&&(m.content||m.subGridOpts||ce.addRemoveCB)?(delete m.el,c=this.addWidget(m)):(this._prepareElement(c,!0,m),this.el.appendChild(c),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"},b&&b.grid?b:void 0,m),!1}),this}static _itemRemoving(n,a){if(!n)return;const r=n?n.gridstackNode:void 0;!(r!=null&&r.grid)||n.classList.contains(r.grid.opts.removableOptions.decline)||(a?r._isAboutToRemove=!0:delete r._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&&!Tt.isDroppable(n)&&Tt.droppable(n,this.opts.removableOptions).on(n,"dropover",(a,r)=>ce._itemRemoving(r,!0)).on(n,"dropout",(a,r)=>ce._itemRemoving(r,!1)),this):this}prepareDragDrop(n,a=!1){const r=n==null?void 0:n.gridstackNode;if(!r)return;const o=r.noMove||this.opts.disableDrag,c=r.noResize||this.opts.disableResize,g=this.opts.staticGrid||o&&c;if((a||g)&&(r._initDD&&(this._removeDD(n),delete r._initDD),g&&n.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!a))return this;if(!r._initDD){let m,S;const y=(T,Z)=>{this.triggerEvent(T,T.target),m=this.cellWidth(),S=this.getCellHeight(!0),this._onStartMoving(n,T,Z,r,m,S)},b=(T,Z)=>{this._dragOrResize(n,T,Z,r,m,S)},v=T=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete r._moving,delete r._resizing,delete r._event,delete r._lastTried;const Z=r.w!==r._orig.w,K=T.target;if(!(!K.gridstackNode||K.gridstackNode.grid!==this)){if(r.el=K,r._isAboutToRemove){const $=n.gridstackNode.grid;$._gsEventHandler[T.type]&&$._gsEventHandler[T.type](T,K),$.engine.nodes.push(r),$.removeWidget(n,!0,!0)}else O.removePositioningStyles(K),r._temporaryRemoved?(this._writePosAttr(K,r),this.engine.addNode(r)):this._writePosAttr(K,r),this.triggerEvent(T,K);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),T.type==="resizestop"&&(Number.isInteger(r.sizeToContent)&&(r.sizeToContent=r.h),this.resizeToContentCheck(Z,r))}};Tt.draggable(n,{start:y,stop:v,drag:b}).resizable(n,{start:y,stop:v,resize:b}),r._initDD=!0}return Tt.draggable(n,o?"disable":"enable").resizable(n,c?"disable":"enable"),this}_onStartMoving(n,a,r,o,c,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=O.getValuesFromTransformedElement(n);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const S=this.placeholder.closest(".grid-stack");this.dragTransform=O.getValuesFromTransformedElement(S)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(o.el=this.placeholder,o._lastUiPosition=r.position,o._prevYPix=r.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(c,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;Tt.resizable(n,"option","minWidth",c*Math.min(o.minW||1,S)).resizable(n,"option","minHeight",g*Math.min(o.minH||1,y)).resizable(n,"option","maxWidth",c*Math.min(o.maxW||Number.MAX_SAFE_INTEGER,S)).resizable(n,"option","maxWidthMoveLeft",c*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,r,o,c,g){const m={...o._orig};let S,y=this.opts.marginLeft,b=this.opts.marginRight,v=this.opts.marginTop,T=this.opts.marginBottom;const Z=Math.round(g*.1),K=Math.round(c*.1);if(y=Math.min(y,K),b=Math.min(b,K),v=Math.min(v,Z),T=Math.min(T,Z),a.type==="drag"){if(o._temporaryRemoved)return;const ae=r.position.top-o._prevYPix;o._prevYPix=r.position.top,this.opts.draggable.scroll!==!1&&O.updateScrollPosition(n,r.position,ae);const me=r.position.left+(r.position.left>o._lastUiPosition.left?-b:y),he=r.position.top+(r.position.top>o._lastUiPosition.top?-T:v);m.x=Math.round(me/c),m.y=Math.round(he/g);const Q=this._extraDragRow;if(this.engine.collide(o,m)){const se=this.getRow();let ye=Math.max(0,m.y+o.h-se);this.opts.maxRow&&se+ye>this.opts.maxRow&&(ye=Math.max(0,this.opts.maxRow-se)),this._extraDragRow=ye}else this._extraDragRow=0;if(this._extraDragRow!==Q&&this._updateContainerHeight(),o.x===m.x&&o.y===m.y)return}else if(a.type==="resize"){if(m.x<0||(O.updateScrollResize(a,n,g),m.w=Math.round((r.size.width-y)/c),m.h=Math.round((r.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 ae=r.position.left+y,me=r.position.top+v;m.x=Math.round(ae/c),m.y=Math.round(me/g),S=!0}o._event=a,o._lastTried=m;const $={x:r.position.left+y,y:r.position.top+v,w:(r.size?r.size.width:o.w*c)-y-b,h:(r.size?r.size.height:o.h*g)-v-T};if(this.engine.moveNodeCheck(o,{...m,cellWidth:c,cellHeight:g,rect:$,resizing:S})){o._lastUiPosition=r.position,this.engine.cacheRects(c,g,v,b,T,y),delete o._skipDown,S&&o.subGrid&&o.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const ae=a.target;o._sidebarOrig||this._writePosAttr(ae,o),this.triggerEvent(a,ae)}}triggerEvent(n,a){let r=this;for(;r.parentGridNode;)r=r.parentGridNode.grid;r._gsEventHandler[n.type]&&r._gsEventHandler[n.type](n,a)}_leave(n,a){a=a||n;const r=a.gridstackNode;if(!r||(a.style.transform=a.style.transformOrigin=null,Tt.off(n,"drag"),r._temporaryRemoved))return;r._temporaryRemoved=!0,this.engine.removeNode(r),r.el=r._isExternal&&a?a:n;const o=r._sidebarOrig;r._isExternal&&this.engine.cleanupNode(r),r._sidebarOrig=o,this.opts.removable===!0&&ce._itemRemoving(n,!0),n._gridstackNodeOrig?(n.gridstackNode=n._gridstackNodeOrig,delete n._gridstackNodeOrig):r._isExternal&&this.engine.restoreInitial()}}ce.renderCB=(h,n)=>{h&&(n!=null&&n.content)&&(h.textContent=n.content)};ce.resizeToContentParent=".grid-stack-item-content";ce.Utils=O;ce.Engine=Nl;ce.GDRev="12.4.2";const Up={column:12,cellHeight:80,margin:4,animate:!0,float:!0,resizable:{handles:"e, se, s, sw, w"},draggable:{handle:".widget-drag-handle"}},nl={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},ya={...nl,color:"var(--cyan)",borderColor:"var(--cyan)",background:"rgba(34, 211, 238, 0.08)"},Bp={color:"var(--border)",fontSize:12,margin:"0 2px",userSelect:"none",flexShrink:0},Hh=["count","sum","avg","min","max"],qp=[{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 Gp({panelId:h,panel:n,onCopy:a,onChartTypeChange:r,onClose:o,anchorEl:c}){const g=D.useRef(null),[m,S]=D.useState({top:0,left:0});return D.useEffect(()=>{if(!c)return;const y=()=>{const b=c.getBoundingClientRect(),v=160;let T=b.right-v;T<4&&(T=b.left),T+v>window.innerWidth-4&&(T=window.innerWidth-v-4),S({top:b.bottom+4,left:T})};return y(),window.addEventListener("scroll",y,!0),window.addEventListener("resize",y),()=>{window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",y)}},[c]),D.useEffect(()=>{const y=b=>{g.current&&!g.current.contains(b.target)&&(!c||!c.contains(b.target))&&o()};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[o,c]),Is.createPortal(d.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:[d.jsxs("div",{onClick:()=>{a(h),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:[d.jsx("span",{children:"Copy panel"}),d.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:"then ⌘V"})]}),(n==null?void 0:n.viewMode)==="chart"&&d.jsxs(d.Fragment,{children:[d.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"4px 0"}}),d.jsx("div",{style:{padding:"4px 12px 2px",fontSize:10,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Chart type"}),qp.map(y=>{const b=(n.chartType||"hbar")===y.key;return d.jsxs("div",{onClick:()=>{r(h,y.key),o()},style:{padding:"6px 12px",cursor:"pointer",fontSize:12,display:"flex",alignItems:"center",gap:8,color:b?"var(--cyan)":"var(--text)",background:b?"rgba(34, 211, 238, 0.08)":"transparent"},onMouseEnter:v=>{b||(v.currentTarget.style.background="rgba(255,255,255,0.05)")},onMouseLeave:v=>{v.currentTarget.style.background=b?"rgba(34, 211, 238, 0.08)":"transparent"},children:[d.jsx("span",{style:{width:18,textAlign:"center"},children:y.label}),d.jsx("span",{children:y.title}),b&&d.jsx("span",{style:{marginLeft:"auto",fontSize:11},children:"✓"})]},y.key)})]})]}),document.body)}function Gh(h,n){var r;if(!h)return null;const a=((r=h.aggregation)==null?void 0:r.toUpperCase())||"";return n==="chart"||h.groupByColumn?`${h.valueColumn?`${a}(${h.valueColumn})`:a} by ${h.groupByColumn}`:h.column?`${a}(${h.column})`:a}function Yp({panel:h,columns:n,onSelect:a,onClose:r,anchorEl:o}){const[c,g]=D.useState("main"),[m,S]=D.useState(null),[y,b]=D.useState(null),[v,T]=D.useState(null),Z=D.useRef(null),[K,$]=D.useState({top:0,left:0});D.useEffect(()=>{if(!o)return;const H=()=>{const G=o.getBoundingClientRect(),re=220;let de=G.right-re;de<4&&(de=G.left),de+re>window.innerWidth-4&&(de=window.innerWidth-re-4),$({top:G.bottom+4,left:de})};return H(),window.addEventListener("scroll",H,!0),window.addEventListener("resize",H),()=>{window.removeEventListener("scroll",H,!0),window.removeEventListener("resize",H)}},[o]),D.useEffect(()=>{const H=G=>{Z.current&&!Z.current.contains(G.target)&&(!o||!o.contains(G.target))&&r()};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[r,o]);const ae={padding:"7px 12px",cursor:"pointer",fontSize:12,display:"flex",justifyContent:"space-between",alignItems:"center",color:"var(--text)"},me=H=>{H==="count"?a("number",{aggregation:"count",column:null}):(S(H),g("pickColumn"))},he=H=>{a("number",{aggregation:m,column:H})},Q=H=>{b(H),g("groupByAgg")},se=H=>{H==="count"?a("chart",{groupByColumn:y,valueColumn:null,aggregation:"count"}):(T(H),g("groupByValCol"))},ye=H=>{a("chart",{groupByColumn:y,valueColumn:H,aggregation:v})};return Is.createPortal(d.jsxs("div",{ref:Z,style:{position:"fixed",top:K.top,left:K.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:[c==="main"&&d.jsxs(d.Fragment,{children:[h.savedViewConfig&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{onClick:()=>a(h.savedViewMode||"number",h.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:[d.jsx("span",{children:Gh(h.savedViewConfig,h.savedViewMode)}),d.jsx("span",{style:{fontSize:10},children:"↻"})]}),d.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"2px 0"}})]}),d.jsx("div",{style:{padding:"6px 12px",fontSize:10,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Single value"}),Hh.map(H=>d.jsxs("div",{onClick:()=>me(H),style:ae,onMouseEnter:G=>{G.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:G=>{G.currentTarget.style.background="transparent"},children:[d.jsx("span",{children:H.toUpperCase()}),H!=="count"&&d.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:"▶"})]},H)),d.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"2px 0"}}),d.jsx("div",{style:{padding:"6px 12px",fontSize:10,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Grouped"}),d.jsxs("div",{onClick:()=>g("groupByCol"),style:ae,onMouseEnter:H=>{H.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:H=>{H.currentTarget.style.background="transparent"},children:[d.jsx("span",{children:"Group By..."}),d.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:"▶"})]})]}),c==="pickColumn"&&d.jsxs(d.Fragment,{children:[d.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=>d.jsxs("div",{onClick:()=>he(H.name),style:ae,onMouseEnter:G=>{G.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:G=>{G.currentTarget.style.background="transparent"},children:[d.jsx("span",{children:H.name}),d.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:H.type})]},H.name))]}),c==="groupByCol"&&d.jsxs(d.Fragment,{children:[d.jsx("div",{onClick:()=>{g("main"),b(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=>d.jsxs("div",{onClick:()=>Q(H.name),style:ae,onMouseEnter:G=>{G.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:G=>{G.currentTarget.style.background="transparent"},children:[d.jsx("span",{children:H.name}),d.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:H.type})]},H.name))]}),c==="groupByAgg"&&d.jsxs(d.Fragment,{children:[d.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"]}),Hh.map(H=>d.jsxs("div",{onClick:()=>se(H),style:ae,onMouseEnter:G=>{G.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:G=>{G.currentTarget.style.background="transparent"},children:[d.jsx("span",{children:H.toUpperCase()}),H!=="count"&&d.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:"▶"})]},H))]}),c==="groupByValCol"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{onClick:()=>{g("groupByAgg"),T(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=>d.jsxs("div",{onClick:()=>ye(H.name),style:ae,onMouseEnter:G=>{G.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:G=>{G.currentTarget.style.background="transparent"},children:[d.jsx("span",{children:H.name}),d.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:H.type})]},H.name))]})]}),document.body)}function Xp({panel:h,panels:n,onSave:a,onClose:r,anchorEl:o,SOURCE_CONFIG:c,panelDisplayName:g}){const m=D.useRef(null),[S,y]=D.useState({top:0,left:0}),b=(h.links||[])[0]||null,[v,T]=D.useState((b==null?void 0:b.parentPanelId)??null),[Z,K]=D.useState((b==null?void 0:b.mappings)||[]),[$,ae]=D.useState(!1),me=new Set,he=W=>{for(const ee of n)if(!me.has(ee.id))for(const Se of ee.links||[])Se.parentPanelId===W&&(me.add(ee.id),he(ee.id))};he(h.id);const Q=n.filter(W=>W.id!==h.id&&(W.sourceType==="postgres"||W.sourceType==="bigquery")&&!me.has(W.id)),se=n.find(W=>W.id===v),ye=(se==null?void 0:se.columns)||[],H=h.columns||[],G=ye.filter(W=>H.some(ee=>ee.name===W.name)&&!Z.some(ee=>ee.parentColumn===W.name&&ee.childColumn===W.name));D.useEffect(()=>{if(!o)return;const W=()=>{const ee=o.getBoundingClientRect(),Se=280;let C=ee.right-Se;C<4&&(C=ee.left),C+Se>window.innerWidth-4&&(C=window.innerWidth-Se-4),y({top:ee.bottom+4,left:C})};return W(),window.addEventListener("scroll",W,!0),window.addEventListener("resize",W),()=>{window.removeEventListener("scroll",W,!0),window.removeEventListener("resize",W)}},[o]),D.useEffect(()=>{const W=ee=>{m.current&&!m.current.contains(ee.target)&&(!o||!o.contains(ee.target))&&r()};return document.addEventListener("mousedown",W),()=>document.removeEventListener("mousedown",W)},[r,o]);const re=()=>{!v||Z.length===0?a([]):a([{parentPanelId:v,mappings:Z}]),r()},de=()=>{a([]),r()},Oe=W=>{T(W);const ee=n.find(X=>X.id===W),C=((ee==null?void 0:ee.columns)||[]).filter(X=>H.some(B=>B.name===X.name)).map(X=>({parentColumn:X.name,childColumn:X.name}));K(C)},F=(W,ee)=>{K(Se=>[...Se,{parentColumn:W,childColumn:ee}]),ae(!1)},ve=W=>{K(ee=>ee.filter((Se,C)=>C!==W))};return Is.createPortal(d.jsxs("div",{ref:m,style:{position:"fixed",top:S.top,left:S.left,background:"var(--panel)",border:"1px solid var(--border)",borderRadius:6,minWidth:280,maxHeight:400,overflowY:"auto",zIndex:1e4,boxShadow:"0 8px 24px rgba(0,0,0,0.4)"},onClick:W=>W.stopPropagation(),children:[d.jsx("div",{style:{padding:"8px 12px",fontSize:10,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:"0.05em",borderBottom:"1px solid var(--border)"},children:"Link Panel"}),d.jsxs("div",{style:{padding:"8px 12px"},children:[d.jsx("div",{style:{fontSize:10,color:"var(--text-dim)",marginBottom:4},children:"Parent panel"}),Q.length===0?d.jsx("div",{style:{fontSize:11,color:"var(--text-dim)",fontStyle:"italic"},children:"No other panels available"}):d.jsxs("select",{value:v||"",onChange:W=>Oe(Number(W.target.value)),style:{width:"100%",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:4,padding:"5px 8px",color:"var(--text)",fontFamily:"inherit",fontSize:12,outline:"none"},children:[d.jsx("option",{value:"",children:"Select parent..."}),Q.map(W=>d.jsx("option",{value:W.id,children:g(W)},W.id))]})]}),v&&d.jsxs("div",{style:{padding:"0 12px 8px"},children:[d.jsx("div",{style:{fontSize:10,color:"var(--text-dim)",marginBottom:4},children:"Column mappings"}),Z.map((W,ee)=>d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,marginBottom:4,fontSize:11},children:[d.jsx("span",{style:{color:"var(--text)",background:"var(--bg)",padding:"2px 6px",borderRadius:3,border:"1px solid var(--border)"},children:W.parentColumn}),d.jsx("span",{style:{color:"var(--text-dim)"},children:"="}),d.jsx("span",{style:{color:"var(--text)",background:"var(--bg)",padding:"2px 6px",borderRadius:3,border:"1px solid var(--border)"},children:W.childColumn}),d.jsx("button",{onClick:()=>ve(ee),style:{background:"none",border:"none",color:"var(--text-dim)",cursor:"pointer",fontSize:11,padding:"0 4px"},onMouseEnter:Se=>{Se.currentTarget.style.color="var(--red)"},onMouseLeave:Se=>{Se.currentTarget.style.color="var(--text-dim)"},children:"x"})]},ee)),!$&&G.length>0&&Z.length===0&&d.jsxs("div",{style:{fontSize:10,color:"var(--text-dim)",fontStyle:"italic",marginBottom:4},children:["Auto-matched ",G.length," column",G.length>1?"s":""]}),$?d.jsxs("div",{style:{display:"flex",gap:4,alignItems:"center",fontSize:11},children:[d.jsx("select",{id:"link-parent-col",style:{flex:1,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:3,padding:"3px 4px",color:"var(--text)",fontFamily:"inherit",fontSize:11},children:ye.filter(W=>!Z.some(ee=>ee.parentColumn===W.name)).map(W=>d.jsx("option",{value:W.name,children:W.name},W.name))}),d.jsx("span",{style:{color:"var(--text-dim)"},children:"="}),d.jsx("select",{id:"link-child-col",style:{flex:1,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:3,padding:"3px 4px",color:"var(--text)",fontFamily:"inherit",fontSize:11},children:H.filter(W=>!Z.some(ee=>ee.childColumn===W.name)).map(W=>d.jsx("option",{value:W.name,children:W.name},W.name))}),d.jsx("button",{onClick:()=>{var Se,C;const W=(Se=document.getElementById("link-parent-col"))==null?void 0:Se.value,ee=(C=document.getElementById("link-child-col"))==null?void 0:C.value;W&&ee&&F(W,ee)},style:{background:"none",border:"1px solid var(--border)",borderRadius:3,padding:"2px 6px",color:"var(--cyan)",cursor:"pointer",fontFamily:"inherit",fontSize:10},children:"Add"}),d.jsx("button",{onClick:()=>ae(!1),style:{background:"none",border:"none",color:"var(--text-dim)",cursor:"pointer",fontSize:11},children:"x"})]}):d.jsx("button",{onClick:()=>ae(!0),style:{background:"none",border:"none",color:"var(--cyan)",cursor:"pointer",fontFamily:"inherit",fontSize:11,padding:0},children:"+ Add column mapping"})]}),d.jsxs("div",{style:{borderTop:"1px solid var(--border)",padding:"8px 12px",display:"flex",gap:8},children:[d.jsx("button",{onClick:re,disabled:v&&Z.length===0,style:{flex:1,background:v&&Z.length>0?"var(--cyan)":"var(--border)",border:"none",borderRadius:4,padding:"5px 10px",color:v&&Z.length>0?"#000":"var(--text-dim)",fontFamily:"inherit",fontSize:11,fontWeight:600,cursor:v&&Z.length>0?"pointer":"default"},children:"Save"}),b&&d.jsx("button",{onClick:de,style:{background:"none",border:"1px solid var(--red)",borderRadius:4,padding:"5px 10px",color:"var(--red)",fontFamily:"inherit",fontSize:11,cursor:"pointer"},children:"Remove"})]})]}),document.body)}const Qp=D.forwardRef(function({panels:n,locked:a,renderPanel:r,onPanelClose:o,onToggleFilters:c,onLayoutChange:g,onViewModeChange:m,onCopyPanel:S,onChartTypeChange:y,onUpdatePanelLinks:b,focusPanelId:v,focusCounter:T,SOURCE_CONFIG:Z,panelDisplayName:K},$){const ae=D.useRef(null),me=D.useRef(null),he=D.useRef({}),Q=D.useRef(g),[se,ye]=D.useState(!1),[H,G]=D.useState(0),[re,de]=D.useState(null),Oe=D.useRef(null),[F,ve]=D.useState(null),W=D.useRef(null),[ee,Se]=D.useState(null),C=D.useRef(null),X=D.useRef({}),B=D.useRef({});D.useEffect(()=>{Q.current=g},[g]),D.useImperativeHandle($,()=>({resizePanel:(w,V,I)=>{const te=ae.current,le=he.current[String(w)];te&&le&&te.update(le.el,{w:V,h:I})},getPanelSize:w=>{const V=he.current[String(w)];if(V){const I=V.el.gridstackNode;if(I)return{w:I.w,h:I.h}}return null}}),[]),D.useEffect(()=>{if(!me.current)return;const w=ce.init(Up,me.current);ae.current=w,ye(!0);const V=(I,te)=>{if(!Q.current||!te)return;const le={};for(const Te of te)Te.id&&(le[Te.id]={x:Te.x,y:Te.y,w:Te.w,h:Te.h});Q.current(le)};return w.on("change",V),w.on("added",V),()=>{w.off("change"),w.off("added"),w.destroy(!1),ae.current=null,he.current={},ye(!1)}},[]),D.useEffect(()=>{if(!ae.current||!se)return;const w=ae.current,V=new Set(n.map(le=>String(le.id))),I=new Set(Object.keys(he.current));let te=!1;for(const le of n){const Te=String(le.id);if(!I.has(Te)){const Re=le.gridPos,Fe=document.createElement("div");Fe.className="grid-stack-item",Fe.setAttribute("gs-id",Te),Fe.setAttribute("gs-w",String((Re==null?void 0:Re.w)??6)),Fe.setAttribute("gs-h",String((Re==null?void 0:Re.h)??5)),Re&&Re.x!=null&&Re.y!=null?(Fe.setAttribute("gs-x",String(Re.x)),Fe.setAttribute("gs-y",String(Re.y))):Fe.setAttribute("gs-auto-position","true");const gt=document.createElement("div");gt.className="grid-stack-item-content widget-content-wrapper",Fe.appendChild(gt);const Ot=document.createElement("div");Ot.className="widget-portal-root",gt.appendChild(Ot),me.current.appendChild(Fe),w.makeWidget(Fe),he.current[Te]={el:Fe,portalRoot:Ot},te=!0}}for(const le of I)if(!V.has(le)){const{el:Te}=he.current[le];w.removeWidget(Te,!0),delete he.current[le],te=!0}te&&G(le=>le+1)},[n,se]),D.useEffect(()=>{!ae.current||!se||ae.current.setStatic(!!a)},[a,se]),D.useEffect(()=>{if(!v||!he.current[String(v)])return;const{el:w}=he.current[String(v)];w.scrollIntoView({behavior:"smooth",block:"nearest"}),w.classList.add("widget-focused");const V=setTimeout(()=>w.classList.remove("widget-focused"),1e3);return()=>clearTimeout(V)},[v,T]);const ie=w=>{const V=ae.current,I=he.current[String(w)];if(!V||!I)return;const te=I.el.gridstackNode;if(!te)return;const le=String(w);te.w===12&&X.current[le]?(V.update(I.el,{w:X.current[le]}),delete X.current[le]):(X.current[le]=te.w,V.update(I.el,{w:12}))},Ee=w=>{const V=ae.current,I=he.current[String(w)];if(!V||!I)return;const te=I.el.gridstackNode;if(!te)return;const le=String(w);te.h===12&&B.current[le]?(V.update(I.el,{h:B.current[le]}),delete B.current[le]):(B.current[le]=te.h,V.update(I.el,{h:12}))},_=(w,V,I)=>{de(null),m&&m(w,V,I)},k=w=>{de(null),m&&m(w,"table",null)};return d.jsxs("div",{style:{flex:1,overflow:"auto",padding:4},children:[d.jsx("div",{ref:me,className:"grid-stack"}),se&&n.map(w=>{var Re,Fe,gt,Ot;const V=he.current[String(w.id)];if(!V)return null;const I=Z[w.sourceType],te=w.filtersVisible!==!1,le=w.sourceType==="postgres",Te=w.viewMode||"table";return Is.createPortal(d.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"},children:[!a&&d.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:[d.jsx("span",{style:{color:"var(--text-dim)",fontSize:10,cursor:"grab",userSelect:"none"},children:"⠿"}),d.jsx("span",{style:{fontSize:9,fontWeight:700,color:I.color,background:I.color+"20",padding:"1px 4px",borderRadius:3,letterSpacing:"0.05em"},children:I.label}),d.jsx("span",{style:{fontSize:11,color:"var(--text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginRight:4},children:K(w)}),((Re=w.links)==null?void 0:Re.length)>0&&(()=>{const ue=n.find(Pt=>Pt.id===w.links[0].parentPanelId),Be=(ue==null?void 0:ue.selectedRow)!=null;return d.jsxs("span",{style:{fontSize:9,color:Be?"var(--cyan)":"var(--text-dim)",background:Be?"rgba(34, 211, 238, 0.10)":"rgba(255,255,255,0.06)",padding:"1px 5px",borderRadius:3,whiteSpace:"nowrap",flexShrink:0},children:["⛓"," ",ue?K(ue):"?"]})})(),w.loading&&d.jsx("span",{style:{color:"var(--yellow)",fontSize:10,flexShrink:0},children:"..."}),d.jsx("div",{style:{flex:1}}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:2,flexShrink:0},children:[d.jsx("button",{onClick:ue=>{ue.stopPropagation(),W.current=ue.currentTarget,ve(F===w.id?null:w.id)},title:"Panel options",style:nl,onMouseEnter:ue=>{ue.currentTarget.style.borderColor="var(--text-dim)"},onMouseLeave:ue=>{ue.currentTarget.style.borderColor="var(--border)"},children:"⋮"}),F===w.id&&d.jsx(Gp,{panelId:w.id,panel:w,onCopy:S,onChartTypeChange:y,onClose:()=>ve(null),anchorEl:W.current}),le&&d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:ue=>{ue.stopPropagation(),C.current=ue.currentTarget,Se(ee===w.id?null:w.id)},title:((Fe=w.links)==null?void 0:Fe.length)>0?`Linked to ${K(n.find(ue=>{var Be;return ue.id===((Be=w.links[0])==null?void 0:Be.parentPanelId)})||{})}`:"Link to parent panel",style:((gt=w.links)==null?void 0:gt.length)>0?ya:nl,onMouseEnter:ue=>{var Be;(Be=w.links)!=null&&Be.length||(ue.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:ue=>{var Be;(Be=w.links)!=null&&Be.length||(ue.currentTarget.style.borderColor="var(--border)")},children:(((Ot=w.links)==null?void 0:Ot.length)>0,"🔗")}),ee===w.id&&d.jsx(Xp,{panel:w,panels:n,onSave:ue=>b(w.id,ue),onClose:()=>Se(null),anchorEl:C.current,SOURCE_CONFIG:Z,panelDisplayName:K})]}),d.jsxs("button",{onClick:ue=>{ue.stopPropagation(),c(w.id)},title:te?"Hide filters":"Show filters",style:{...nl,color:te?"var(--text)":"var(--text-dim)",background:te?"rgba(255,255,255,0.04)":"none",gap:3,paddingLeft:6,paddingRight:7,minWidth:"auto"},onMouseEnter:ue=>{ue.currentTarget.style.borderColor="var(--text-dim)"},onMouseLeave:ue=>{ue.currentTarget.style.borderColor="var(--border)"},children:[d.jsx("span",{style:{fontSize:8},children:te?"▾":"▸"}),d.jsx("span",{children:"filters"})]}),le&&d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:ue=>{ue.stopPropagation(),k(w.id)},title:"Table view",style:Te==="table"?ya:nl,onMouseEnter:ue=>{Te!=="table"&&(ue.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:ue=>{Te!=="table"&&(ue.currentTarget.style.borderColor="var(--border)")},children:"⊞"}),d.jsx("button",{onClick:ue=>{ue.stopPropagation(),Te==="table"&&w.savedViewConfig?_(w.id,w.savedViewMode||"number",w.savedViewConfig):(Oe.current=ue.currentTarget,de(re===w.id?null:w.id))},title:Te==="table"&&w.savedViewConfig?`Restore: ${Gh(w.savedViewConfig,w.savedViewMode)}`:"Summary view",style:Te!=="table"?ya:w.savedViewConfig?{...nl,color:"var(--cyan)"}:nl,onMouseEnter:ue=>{Te==="table"&&(ue.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:ue=>{Te==="table"&&(ue.currentTarget.style.borderColor="var(--border)")},children:"Σ"}),re===w.id&&d.jsx(Yp,{panel:w,columns:w.columns||[],onSelect:(ue,Be)=>_(w.id,ue,Be),onClose:()=>de(null),anchorEl:Oe.current})]}),(()=>{var Pt,hl;const ue=((Pt=w.gridPos)==null?void 0:Pt.w)===12,Be=((hl=w.gridPos)==null?void 0:hl.h)===12;return d.jsxs(d.Fragment,{children:[d.jsx("span",{style:Bp,children:"|"}),d.jsx("button",{onClick:We=>{We.stopPropagation(),ie(w.id)},title:ue?"Restore width":"Full row",style:ue?ya:nl,onMouseEnter:We=>{ue||(We.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:We=>{ue||(We.currentTarget.style.borderColor="var(--border)")},children:"⇔"}),d.jsx("button",{onClick:We=>{We.stopPropagation(),Ee(w.id)},title:Be?"Restore height":"Full column",style:Be?ya:nl,onMouseEnter:We=>{Be||(We.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:We=>{Be||(We.currentTarget.style.borderColor="var(--border)")},children:"⇕"}),d.jsx("button",{onClick:We=>{We.stopPropagation(),o(w.id)},style:{...nl,border:"none",color:"var(--text-dim)",fontSize:12,minWidth:18,padding:"0 2px"},onMouseEnter:We=>{We.currentTarget.style.color="var(--red)",We.currentTarget.style.background="var(--red-bg)"},onMouseLeave:We=>{We.currentTarget.style.color="var(--text-dim)",We.currentTarget.style.background="none"},children:"×"})]})})()]})]}),a&&d.jsx("div",{style:{display:"flex",alignItems:"center",padding:"2px 8px",background:"var(--panel)",borderBottom:"1px solid var(--border)",flexShrink:0},children:d.jsxs("button",{onClick:ue=>{ue.stopPropagation(),c(w.id)},title:te?"Hide filters":"Show filters",style:{...nl,color:te?"var(--text)":"var(--text-dim)",background:te?"rgba(255,255,255,0.04)":"none",gap:3,paddingLeft:6,paddingRight:7,minWidth:"auto"},onMouseEnter:ue=>{ue.currentTarget.style.borderColor="var(--text-dim)"},onMouseLeave:ue=>{ue.currentTarget.style.borderColor="var(--border)"},children:[d.jsx("span",{style:{fontSize:8},children:te?"▾":"▸"}),d.jsx("span",{children:"filters"})]})}),d.jsx("div",{style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column"},children:r(w)})]},w.id),V.portalRoot)})]})}),Vp=100,Yh="mdash_state",Fs={postgres:{color:"var(--purple)",label:"PG"},bigquery:{color:"var(--green)",label:"BQ"},redis:{color:"var(--red)",label:"RD"},s3:{color:"var(--orange)",label:"S3"}};let er=1,vn=1,Ai=null;function Eo(h){return h.map(n=>({...n,panels:n.panels.map(a=>{const{results:r,loading:o,columns:c,tokens:g,nextToken:m,selectedRow:S,...y}=a;return y})}))}function Zp(){var h;try{const n=localStorage.getItem(Yh);if(!n)return null;const a=JSON.parse(n);if(!((h=a.dashboards)!=null&&h.length))return null;let r=0,o=0;for(const g of a.dashboards){g.id>r&&(r=g.id);for(const m of g.panels)m.id>o&&(o=m.id)}return er=r+1,vn=o+1,{dashboards:a.dashboards.map(g=>({...g,locked:g.locked??!1,panels:g.panels.map(m=>({results:null,loading:!1,selectedRow:null,...m.sourceType==="postgres"||m.sourceType==="bigquery"?{columns:[],links:m.links??[]}:{},...m.sourceType==="s3"?{tokens:[null],nextToken:null}:{},...m}))})),activeDashboardId:a.activeDashboardId,autoRefreshInterval:a.autoRefreshInterval??null}}catch{return null}}const Kp={table:{w:6,h:5},number:{w:3,h:2},chart:{w:6,h:5}};function Jp(h,n,a,r,o="postgres"){return{id:vn++,sourceType:o,instanceId:h,instanceLabel:n,schema:a,name:r,displayName:`${a}.${r}`,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",links:[],selectedRow:null}}function Wp(h,n){return{id:vn++,sourceType:"redis",instanceId:h,instanceLabel:n,displayName:"keys",filter:"",page:0,results:null,loading:!1,filtersVisible:!0}}function $p(h,n,a){return{id:vn++,sourceType:"s3",instanceId:h,instanceLabel:n,bucket:a,displayName:a,filter:"",page:0,tokens:[null],nextToken:null,results:null,loading:!1,filtersVisible:!0}}function kh(h){return{id:er++,name:h,panels:[],locked:!1}}function Lh(h,n){const a=JSON.stringify(h,null,2),r=new Blob([a],{type:"application/json"}),o=URL.createObjectURL(r),c=document.createElement("a");c.href=o,c.download=n,c.click(),URL.revokeObjectURL(o)}function Fp(h){if(!h||typeof h!="object")return null;let n;if(Array.isArray(h.dashboards))n=h.dashboards;else if(h.dashboard&&typeof h.dashboard=="object")n=[h.dashboard];else return null;for(const a of n){if(typeof a.name!="string"||!Array.isArray(a.panels))return null;for(const r of a.panels)if(!r.sourceType||typeof r.sourceType!="string")return null}return n}function Ip(h){return h.map(n=>{const a={},r=n.panels.map(o=>{const c=vn++;return a[o.id]=c,{results:null,loading:!1,selectedRow:null,...o.sourceType==="postgres"||o.sourceType==="bigquery"?{columns:[],links:o.links??[]}:{},...o.sourceType==="s3"?{tokens:[null],nextToken:null}:{},...o,id:c}});for(const o of r)o.links&&(o.links=o.links.map(c=>({...c,parentPanelId:a[c.parentPanelId]})).filter(c=>c.parentPanelId!=null));return{...n,id:er++,panels:r}})}function Pp(){const[h,n]=D.useState([]),[a,r]=D.useState(Vp),[o,c]=D.useState(null),[g]=D.useState(()=>Zp()),[m,S]=D.useState(()=>g?g.dashboards:[kh("Dashboard 1")]),[y,b]=D.useState(()=>g?g.activeDashboardId:1),[v,T]=D.useState(null),[Z,K]=D.useState(0),[$,ae]=D.useState(0),[me,he]=D.useState(null),[Q,se]=D.useState(()=>(g==null?void 0:g.autoRefreshInterval)??null),[ye,H]=D.useState(!1),[G,re]=D.useState(""),de=D.useRef(null),Oe=D.useRef(null),F=D.useRef(null),[ve,W]=D.useState(!1),[ee,Se]=D.useState("type"),[C,X]=D.useState(null),[B,ie]=D.useState(null),Ee=D.useRef(null),[_,k]=D.useState(null),[w,V]=D.useState({}),[I,te]=D.useState({}),[le,Te]=D.useState(""),[Re,Fe]=D.useState(""),[gt,Ot]=D.useState(""),[ue,Be]=D.useState(""),[Pt,hl]=D.useState(""),[We,xn]=D.useState(""),[Di,Oi]=D.useState(""),[Ni,ba]=D.useState("us-east-1"),[Sa,bt]=D.useState(""),[oi,bn]=D.useState(""),[Hl,ci]=D.useState(""),[Ea,Sn]=D.useState(""),[_a,za]=D.useState(""),[Pe,et]=D.useState(!1),Ne=m.find(x=>x.id===y)||null,Le=(Ne==null?void 0:Ne.panels)||[],En=x=>h.filter(U=>U.type===x&&U.status==="connected"),tr=x=>En(x).length>1,lr=h.some(x=>x.status==="connected"),kl=D.useCallback((x,U)=>{S(J=>J.map(P=>({...P,panels:P.panels.map(xe=>xe.id===x?{...xe,...U}:xe)})))},[]),Hi=()=>{const x=kh(`Dashboard ${er}`);S(U=>[...U,x]),b(x.id)},fi=(x,U)=>{const J=U.trim();J&&S(P=>P.map(xe=>xe.id===x?{...xe,name:J}:xe))},gl=(x,U)=>{U&&U.stopPropagation(),S(J=>{const P=J.filter(xe=>xe.id!==x);if(y===x){const xe=J.findIndex(be=>be.id===x),Ie=P[Math.min(xe,P.length-1)];b(Ie?Ie.id:null)}return P})},sl=x=>{S(U=>U.map(J=>J.id===y?{...J,panels:[...J.panels,x]}:J)),T(x.id),K(U=>U+1)},di=x=>{S(U=>U.map(J=>({...J,panels:J.panels.filter(P=>P.id!==x)})))},ir=x=>{S(U=>U.map(J=>J.id===x?{...J,locked:!J.locked}:J))},Ca=D.useCallback((x,U)=>{S(J=>J.map(P=>({...P,panels:P.panels.map(xe=>xe.id===x?{...xe,links:U,selectedRow:null}:xe)})))},[]),_n=D.useCallback(x=>{S(U=>U.map(J=>({...J,panels:J.panels.map(P=>P.id===x?{...P,filtersVisible:!P.filtersVisible}:P)})))},[]),hi=D.useCallback((x,U,J)=>{var xe;const P=(xe=F.current)==null?void 0:xe.getPanelSize(x);S(Ie=>Ie.map(be=>({...be,panels:be.panels.map(Ve=>{if(Ve.id!==x)return Ve;const mt=Ve.viewMode||"table",_t=U==="table"?null:J;if(mt===U&&JSON.stringify(Ve.viewConfig)===JSON.stringify(_t))return Ve;const ft={...Ve.viewSizes};P&&(ft[mt]={w:P.w,h:P.h});const ki=U==="table"?Ve.viewConfig||Ve.savedViewConfig:J,ar=U==="table"?Ve.viewMode!=="table"?Ve.viewMode:Ve.savedViewMode:U;return{...Ve,viewMode:U,viewConfig:_t,savedViewConfig:ki,savedViewMode:ar,viewSizes:ft,results:null}})}))),requestAnimationFrame(()=>{var _t;const Ie=Le.find(ft=>ft.id===x),be=(Ie==null?void 0:Ie.viewSizes)||{},Ve=(Ie==null?void 0:Ie.viewMode)||"table";P&&(be[Ve]={w:P.w,h:P.h});const mt=be[U]||Kp[U]||{w:6,h:5};(_t=F.current)==null||_t.resizePanel(x,mt.w,mt.h)})},[Le]),nr=D.useCallback((x,U)=>{S(J=>J.map(P=>({...P,panels:P.panels.map(xe=>xe.id===x?{...xe,chartType:U}:xe)})))},[]),Ta=D.useCallback(x=>{const U=Le.find(ki=>ki.id===x);if(!U)return;const{results:J,loading:P,columns:xe,tokens:Ie,nextToken:be,id:Ve,gridPos:mt,selectedRow:_t,...ft}=U;Ai=ft},[Le]),zn=D.useCallback(()=>{if(!Ai)return;const x={...Ai,id:vn++,results:null,loading:!1,...Ai.sourceType==="postgres"||Ai.sourceType==="bigquery"?{columns:[]}:{},...Ai.sourceType==="s3"?{tokens:[null],nextToken:null}:{}};sl(x)},[sl]),[Ra,ml]=D.useState(!1),gi=D.useRef(null),Cn=D.useRef(null),wa=D.useCallback(()=>{if(!Ne)return;const x=Eo([Ne])[0],U=new Date().toISOString().slice(0,10);Lh({dashboard:x},`mdash-${x.name.replace(/\s+/g,"-").toLowerCase()}-${U}.json`),ml(!1)},[Ne]),rl=D.useCallback(()=>{const x=Eo(m),U=new Date().toISOString().slice(0,10);Lh({dashboards:x,activeDashboardId:y,autoRefreshInterval:Q},`mdash-all-dashboards-${U}.json`),ml(!1)},[m,y,Q]),ct=D.useCallback(x=>{var P;const U=(P=x.target.files)==null?void 0:P[0];if(!U)return;const J=new FileReader;J.onload=xe=>{try{const Ie=JSON.parse(xe.target.result),be=Fp(Ie);if(!be){c("Invalid dashboard config file. Expected JSON with 'dashboard' or 'dashboards' key.");return}const Ve=Ip(be);S(mt=>[...mt,...Ve]),b(Ve[0].id)}catch{c("Failed to parse JSON file.")}},J.readAsText(U),x.target.value="",ml(!1)},[]);D.useEffect(()=>{const x=U=>{var J,P;if((U.metaKey||U.ctrlKey)&&U.key==="v"){const xe=(J=document.activeElement)==null?void 0:J.tagName;if(xe==="INPUT"||xe==="TEXTAREA"||(P=document.activeElement)!=null&&P.isContentEditable||!Ai)return;U.preventDefault(),zn()}};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[zn]);const St=(x,U,J,P,xe="postgres")=>{const Ie=Le.find(be=>(be.sourceType==="postgres"||be.sourceType==="bigquery")&&be.instanceId===x&&be.schema===J&&be.name===P);Ie?(T(Ie.id),K(be=>be+1)):sl(Jp(x,U,J,P,xe)),el()},Ll=(x,U)=>{const J=Le.find(P=>P.sourceType==="redis"&&P.instanceId===x);J?(T(J.id),K(P=>P+1)):sl(Wp(x,U)),el()},Tn=(x,U,J)=>{const P=Le.find(xe=>xe.sourceType==="s3"&&xe.instanceId===x&&xe.bucket===J);P?(T(P.id),K(xe=>xe+1)):sl($p(x,U,J)),el()};D.useEffect(()=>{gp().then(x=>{var J,P,xe,Ie;x.page_size&&r(x.page_size);const U=[];for(const be of((J=x.sources)==null?void 0:J.postgres)||[])U.push({id:be.id,type:"postgres",label:be.label,status:be.status});for(const be of((P=x.sources)==null?void 0:P.bigquery)||[])U.push({id:be.id,type:"bigquery",label:be.label,status:be.status});for(const be of((xe=x.sources)==null?void 0:xe.redis)||[])U.push({id:be.id,type:"redis",label:be.label,status:be.status});for(const be of((Ie=x.sources)==null?void 0:Ie.s3)||[])U.push({id:be.id,type:"s3",label:be.label,status:be.status});n(U);for(const be of U)be.status==="connected"&&((be.type==="postgres"||be.type==="bigquery")&&Ys(be.id).then(Ve=>V(mt=>({...mt,[be.id]:Ve.tables}))).catch(()=>{}),be.type==="s3"&&bo(be.id).then(Ve=>te(mt=>({...mt,[be.id]:Ve.buckets}))).catch(()=>{}))}).catch(()=>n([]))},[]);const ja=()=>{et(!0),c(null),mp(le,Re).then(x=>{const U={id:x.instance_id,type:"postgres",label:x.label||x.instance_id,status:"connected"};return n(J=>[...J,U]),k(null),Te(""),Fe(""),Ys(x.instance_id).then(J=>{V(P=>({...P,[x.instance_id]:J.tables}))})}).catch(x=>c(x.message)).finally(()=>et(!1))},Ma=()=>{et(!0),c(null),vp(gt,ue).then(x=>{const U={id:x.instance_id,type:"redis",label:x.label||x.instance_id,status:"connected"};n(J=>[...J,U]),k(null),Ot(""),Be("")}).catch(x=>c(x.message)).finally(()=>et(!1))},Aa=()=>{et(!0),c(null),Sp({endpointUrl:Pt,accessKey:We,secretKey:Di,region:Ni,label:Sa}).then(x=>{const U={id:x.instance_id,type:"s3",label:x.label||x.instance_id,status:"connected"};return n(J=>[...J,U]),k(null),hl(""),xn(""),Oi(""),ba("us-east-1"),bt(""),bo(x.instance_id).then(J=>{te(P=>({...P,[x.instance_id]:J.buckets}))})}).catch(x=>c(x.message)).finally(()=>et(!1))},Ul=()=>{et(!0),c(null),yp({project:oi,dataset:Hl,credentialsPath:Ea,label:_a}).then(x=>{const U={id:x.instance_id,type:"bigquery",label:x.label||x.instance_id,status:"connected"};return n(J=>[...J,U]),k(null),bn(""),ci(""),Sn(""),za(""),Ys(x.instance_id).then(J=>{V(P=>({...P,[x.instance_id]:J.tables}))})}).catch(x=>c(x.message)).finally(()=>et(!1))},Rn=x=>{const U=En(x);if(U.length===0){W(!1),k(x);return}if(U.length===1){pl(U[0],x);return}X(x),Se("instance")},pl=(x,U)=>{const J=U||C;if(J==="redis"){Ll(x.id,x.label);return}ie(x.id),X(J),Se("target"),(J==="postgres"||J==="bigquery")&&!w[x.id]&&Ys(x.id).then(P=>V(xe=>({...xe,[x.id]:P.tables}))).catch(P=>c(P.message)),J==="s3"&&!I[x.id]&&bo(x.id).then(P=>te(xe=>({...xe,[x.id]:P.buckets}))).catch(P=>c(P.message))},el=()=>{W(!1),Se("type"),X(null),ie(null)};D.useEffect(()=>{const x=U=>{Ee.current&&!Ee.current.contains(U.target)&&el(),Oe.current&&!Oe.current.contains(U.target)&&H(!1),gi.current&&!gi.current.contains(U.target)&&ml(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[]);const ul=D.useCallback(()=>{S(x=>x.map(U=>U.id===y?{...U,panels:U.panels.map(J=>({...J,results:null}))}:U)),ae(x=>x+1)},[y]);D.useEffect(()=>(de.current&&(clearInterval(de.current),de.current=null),Q&&Le.length>0&&(de.current=setInterval(()=>{ul()},Q*60*1e3)),()=>{de.current&&clearInterval(de.current)}),[Q,Le.length,ul]),D.useEffect(()=>{try{localStorage.setItem(Yh,JSON.stringify({dashboards:Eo(m),activeDashboardId:y,autoRefreshInterval:Q}))}catch{}},[m,y,Q]);const Bl=D.useCallback(x=>{S(U=>U.map(J=>J.id===y?{...J,panels:J.panels.map(P=>x[String(P.id)]?{...P,gridPos:x[String(P.id)]}:P)}:J))},[y]),at=x=>(tr(x.sourceType)?`${x.instanceLabel} `:"")+x.displayName,Et={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 d.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",background:"var(--bg)"},children:[d.jsxs("div",{style:{display:"flex",alignItems:"stretch",borderBottom:"1px solid var(--border)",background:"var(--panel)",minHeight:40},children:[d.jsx("div",{style:{display:"flex",alignItems:"center",padding:"0 16px",borderRight:"1px solid var(--border)",flexShrink:0},children:d.jsx("span",{style:{fontWeight:700,fontSize:14,color:"var(--cyan)"},children:"mdash"})}),d.jsx("div",{style:{display:"flex",alignItems:"stretch",overflowX:"auto"},children:m.map(x=>d.jsxs("div",{onClick:()=>b(x.id),style:{display:"flex",alignItems:"center",gap:6,padding:"0 14px",cursor:"pointer",fontSize:12,borderRight:"1px solid var(--border)",background:x.id===y?"var(--bg)":"transparent",borderBottom:x.id===y?"2px solid var(--cyan)":"2px solid transparent",color:x.id===y?"var(--text)":"var(--text-dim)",transition:"all 0.1s",whiteSpace:"nowrap",flexShrink:0},children:[me===x.id?d.jsx("input",{autoFocus:!0,defaultValue:x.name,onClick:U=>U.stopPropagation(),onFocus:U=>U.target.select(),onBlur:U=>{fi(x.id,U.target.value),he(null)},onKeyDown:U=>{U.key==="Enter"?(fi(x.id,U.target.value),he(null)):U.key==="Escape"&&he(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,x.name.length*7.5)}}):d.jsx("span",{onDoubleClick:U=>{U.stopPropagation(),he(x.id)},children:x.name}),x.panels.length>0&&d.jsx("span",{style:{fontSize:9,color:"var(--text-dim)",background:"rgba(255,255,255,0.06)",padding:"1px 4px",borderRadius:3},children:x.panels.length}),m.length>1&&d.jsx("button",{onClick:U=>gl(x.id,U),style:{background:"none",border:"none",color:"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:13,padding:"0 2px",lineHeight:1,borderRadius:3},onMouseEnter:U=>{U.target.style.color="var(--red)",U.target.style.background="var(--red-bg)"},onMouseLeave:U=>{U.target.style.color="var(--text-dim)",U.target.style.background="none"},children:"x"})]},x.id))}),d.jsx("button",{onClick:Hi,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:x=>{x.target.style.color="var(--text)"},onMouseLeave:x=>{x.target.style.color="var(--text-dim)"},title:"New dashboard",children:"+"}),d.jsx("div",{style:{flex:1}}),Ne&&Le.length>0&&d.jsx("div",{style:{display:"flex",alignItems:"center",paddingLeft:10,flexShrink:0},children:d.jsxs("button",{onClick:()=>ir(y),title:Ne.locked?"Unlock layout (allow moving panels)":"Lock layout (prevent moving panels)",style:{background:Ne.locked?"rgba(250, 204, 21, 0.08)":"none",border:"1px solid",borderColor:Ne.locked?"var(--yellow)":"var(--border)",borderRadius:4,color:Ne.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:x=>{Ne.locked||(x.currentTarget.style.color="var(--text)",x.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:x=>{Ne.locked||(x.currentTarget.style.color="var(--text-dim)",x.currentTarget.style.borderColor="var(--border)")},children:[d.jsx("span",{style:{fontSize:12},children:Ne.locked?"🔒":"🔓"}),Ne.locked?"Locked":"Unlocked"]})}),d.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",flexShrink:0},ref:gi,children:[d.jsx("input",{ref:Cn,type:"file",accept:".json",style:{display:"none"},onChange:ct}),d.jsx("button",{onClick:()=>ml(x=>!x),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:x=>{x.currentTarget.style.color="var(--text)",x.currentTarget.style.borderColor="var(--text-dim)"},onMouseLeave:x=>{x.currentTarget.style.color="var(--text-dim)",x.currentTarget.style.borderColor="var(--border)"},children:"Config"}),Ra&&d.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:[Ne&&d.jsx(_o,{label:`Export "${Ne.name}"`,onClick:wa}),m.length>0&&d.jsx(_o,{label:"Export all dashboards",onClick:rl}),d.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"2px 0"}}),d.jsx(_o,{label:"Import from file...",onClick:()=>{var x;return(x=Cn.current)==null?void 0:x.click()}})]})]}),Ne&&d.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",flexShrink:0},ref:Ee,children:[d.jsx("button",{onClick:()=>{W(!ve),Se("type"),X(null),ie(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:x=>{x.currentTarget.style.color="var(--text)",x.currentTarget.style.borderColor="var(--text-dim)"},onMouseLeave:x=>{x.currentTarget.style.color="var(--text-dim)",x.currentTarget.style.borderColor="var(--border)"},children:"+ Panel"}),ve&&d.jsx(ey,{pickerStage:ee,pickerType:C,pickerInstance:B,instancesOfType:En,handlePickType:Rn,handlePickInstance:pl,setShowSourcePicker:W,setShowConnectForm:k,setPickerStage:Se,setPickerType:X,setPickerInstance:ie,pgTablesCache:w,s3BucketsCache:I,instances:h,activePanels:Le,addPgPanel:St,addS3Panel:Tn})]}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,paddingRight:16,paddingLeft:10,flexShrink:0},ref:Oe,children:[Le.some(x=>x.loading)&&d.jsx("span",{style:{color:"var(--yellow)",fontSize:11},children:"loading..."}),Le.length>0&&d.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",gap:0},children:[d.jsxs("button",{onClick:ul,title:"Refresh all panels",style:{background:Q?"rgba(34, 211, 238, 0.08)":"none",border:"1px solid",borderColor:Q?"var(--cyan)":"var(--border)",borderRadius:"4px 0 0 4px",padding:"3px 8px",color:Q?"var(--cyan)":"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:11,lineHeight:1,display:"flex",alignItems:"center",gap:4},onMouseEnter:x=>{Q||(x.currentTarget.style.color="var(--text)",x.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:x=>{Q||(x.currentTarget.style.color="var(--text-dim)",x.currentTarget.style.borderColor="var(--border)")},children:[d.jsx("span",{style:{fontSize:13,...Q?{animation:"spin 2s linear infinite"}:{}},children:"↻"}),Q?`${Q}m`:"all"]}),d.jsx("button",{onClick:()=>H(x=>!x),title:"Auto-refresh options",style:{background:Q?"rgba(34, 211, 238, 0.08)":"none",border:"1px solid",borderColor:Q?"var(--cyan)":"var(--border)",borderLeft:"none",borderRadius:"0 4px 4px 0",padding:"3px 5px",color:Q?"var(--cyan)":"var(--text-dim)",cursor:"pointer",fontFamily:"inherit",fontSize:8,lineHeight:1,display:"flex",alignItems:"center"},onMouseEnter:x=>{Q||(x.currentTarget.style.color="var(--text)",x.currentTarget.style.borderColor="var(--text-dim)")},onMouseLeave:x=>{Q||(x.currentTarget.style.color="var(--text-dim)",x.currentTarget.style.borderColor="var(--border)")},children:"▼"}),ye&&d.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:[d.jsx(Xs,{label:"Refresh now",hint:"↻",onClick:()=>{ul(),H(!1)}}),d.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"2px 0"}}),d.jsx(Xs,{label:"Every 1 min",active:Q===1,onClick:()=>{se(Q===1?null:1),H(!1)}}),d.jsx(Xs,{label:"Every 5 min",active:Q===5,onClick:()=>{se(Q===5?null:5),H(!1)}}),d.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"2px 0"}}),d.jsxs("div",{style:{padding:"6px 12px",display:"flex",alignItems:"center",gap:6},children:[d.jsx("span",{style:{fontSize:11,color:"var(--text-dim)",whiteSpace:"nowrap"},children:"Every"}),d.jsx("input",{type:"number",min:"1",value:G,onChange:x=>re(x.target.value),onKeyDown:x=>{if(x.key==="Enter"){const U=parseInt(G,10);U>0&&(se(U),H(!1),re(""))}},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}),d.jsx("span",{style:{fontSize:11,color:"var(--text-dim)"},children:"min"}),d.jsx("button",{onClick:()=>{const x=parseInt(G,10);x>0&&(se(x),H(!1),re(""))},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"})]}),Q&&d.jsxs(d.Fragment,{children:[d.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"2px 0"}}),d.jsx(Xs,{label:"Turn off auto-refresh",hint:"✕",onClick:()=>{se(null),H(!1),re("")}})]})]})]})]})]}),o&&d.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:[d.jsx("span",{children:o}),d.jsx("button",{onClick:()=>c(null),style:{background:"none",border:"none",color:"var(--red)",cursor:"pointer",fontFamily:"inherit",fontSize:14},children:"x"})]}),d.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[_&&d.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},children:d.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:[_==="postgres"&&d.jsxs(d.Fragment,{children:[d.jsx("span",{style:{color:"var(--text)",fontSize:14,fontWeight:600},children:"Connect to PostgreSQL"}),d.jsx("input",{type:"text",value:le,onChange:x=>Te(x.target.value),onKeyDown:x=>{x.key==="Enter"&&le.trim()&&ja()},placeholder:"postgresql://user:password@host:5432/dbname",style:Et,autoFocus:!0}),d.jsx("input",{type:"text",value:Re,onChange:x=>Fe(x.target.value),placeholder:"Label (optional, e.g. prod, staging)",style:Et}),d.jsxs("div",{style:{display:"flex",gap:8},children:[d.jsx("button",{onClick:ja,disabled:Pe||!le.trim(),style:{background:"var(--purple)",border:"none",borderRadius:6,padding:"10px 16px",color:"#fff",fontFamily:"inherit",fontSize:13,fontWeight:600,cursor:Pe?"wait":"pointer",opacity:Pe||!le.trim()?.5:1,flex:1},children:Pe?"Connecting...":"Connect"}),d.jsx("button",{onClick:()=>k(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"})]})]}),_==="redis"&&d.jsxs(d.Fragment,{children:[d.jsx("span",{style:{color:"var(--text)",fontSize:14,fontWeight:600},children:"Connect to Redis"}),d.jsx("input",{type:"text",value:gt,onChange:x=>Ot(x.target.value),onKeyDown:x=>{x.key==="Enter"&&gt.trim()&&Ma()},placeholder:"redis://localhost:6379",style:Et,autoFocus:!0}),d.jsx("input",{type:"text",value:ue,onChange:x=>Be(x.target.value),placeholder:"Label (optional, e.g. cache, sessions)",style:Et}),d.jsxs("div",{style:{display:"flex",gap:8},children:[d.jsx("button",{onClick:Ma,disabled:Pe||!gt.trim(),style:{background:"var(--red)",border:"none",borderRadius:6,padding:"10px 16px",color:"#fff",fontFamily:"inherit",fontSize:13,fontWeight:600,cursor:Pe?"wait":"pointer",opacity:Pe||!gt.trim()?.5:1,flex:1},children:Pe?"Connecting...":"Connect"}),d.jsx("button",{onClick:()=>k(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"})]})]}),_==="bigquery"&&d.jsxs(d.Fragment,{children:[d.jsx("span",{style:{color:"var(--text)",fontSize:14,fontWeight:600},children:"Connect to BigQuery"}),d.jsx("input",{type:"text",value:oi,onChange:x=>bn(x.target.value),placeholder:"GCP Project ID (e.g. my-project)",style:Et,autoFocus:!0}),d.jsx("input",{type:"text",value:Hl,onChange:x=>ci(x.target.value),onKeyDown:x=>{x.key==="Enter"&&oi.trim()&&Hl.trim()&&Ul()},placeholder:"Dataset (e.g. my_dataset)",style:Et}),d.jsx("input",{type:"text",value:Ea,onChange:x=>Sn(x.target.value),placeholder:"Service account JSON path (optional)",style:Et}),d.jsx("input",{type:"text",value:_a,onChange:x=>za(x.target.value),placeholder:"Label (optional)",style:Et}),d.jsxs("div",{style:{display:"flex",gap:8},children:[d.jsx("button",{onClick:Ul,disabled:Pe||!oi.trim()||!Hl.trim(),style:{background:"var(--green)",border:"none",borderRadius:6,padding:"10px 16px",color:"#fff",fontFamily:"inherit",fontSize:13,fontWeight:600,cursor:Pe?"wait":"pointer",opacity:Pe||!oi.trim()||!Hl.trim()?.5:1,flex:1},children:Pe?"Connecting...":"Connect"}),d.jsx("button",{onClick:()=>k(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"})]})]}),_==="s3"&&d.jsxs(d.Fragment,{children:[d.jsx("span",{style:{color:"var(--text)",fontSize:14,fontWeight:600},children:"Connect to S3"}),d.jsx("input",{type:"text",value:Pt,onChange:x=>hl(x.target.value),placeholder:"Endpoint URL (e.g. http://localhost:9000)",style:Et,autoFocus:!0}),d.jsx("input",{type:"text",value:We,onChange:x=>xn(x.target.value),placeholder:"Access Key ID",style:Et}),d.jsx("input",{type:"password",value:Di,onChange:x=>Oi(x.target.value),placeholder:"Secret Access Key",style:Et}),d.jsx("input",{type:"text",value:Ni,onChange:x=>ba(x.target.value),placeholder:"Region (default: us-east-1)",style:Et}),d.jsx("input",{type:"text",value:Sa,onChange:x=>bt(x.target.value),placeholder:"Label (optional, e.g. prod, logs)",style:Et}),d.jsxs("div",{style:{display:"flex",gap:8},children:[d.jsx("button",{onClick:Aa,disabled:Pe,style:{background:"var(--orange)",border:"none",borderRadius:6,padding:"10px 16px",color:"#fff",fontFamily:"inherit",fontSize:13,fontWeight:600,cursor:Pe?"wait":"pointer",opacity:Pe?.5:1,flex:1},children:Pe?"Connecting...":"Connect"}),d.jsx("button",{onClick:()=>k(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"})]})]})]})}),!_&&Ne&&Le.length>0&&d.jsx(Qp,{ref:F,panels:Le,locked:Ne.locked,focusPanelId:v,focusCounter:Z,SOURCE_CONFIG:Fs,panelDisplayName:at,onPanelClose:di,onToggleFilters:_n,onLayoutChange:Bl,onViewModeChange:hi,onCopyPanel:Ta,onChartTypeChange:nr,onUpdatePanelLinks:Ca,renderPanel:x=>{const U=Ne.locked;return x.sourceType==="postgres"||x.sourceType==="bigquery"?d.jsx(Tp,{tab:x,updateTab:J=>kl(x.id,J),allPanels:Le,pageSize:a,setError:c,refreshKey:$,locked:U},x.id):x.sourceType==="redis"?d.jsx(Ap,{tab:x,updateTab:J=>kl(x.id,J),pageSize:a,setError:c,refreshKey:$,locked:U},x.id):x.sourceType==="s3"?d.jsx(Np,{tab:x,updateTab:J=>kl(x.id,J),pageSize:a,setError:c,refreshKey:$,locked:U},x.id):null}},y),!_&&!Ne&&d.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-dim)",flexDirection:"column",gap:8},children:d.jsx("span",{children:"Click + to create a dashboard"})}),!_&&Ne&&Le.length===0&&d.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-dim)",flexDirection:"column",gap:12},children:[d.jsx("span",{style:{fontSize:14},children:Ne.name}),d.jsxs("span",{children:["Click ",d.jsx("strong",{children:"+ Panel"})," to add a data source"]}),!lr&&d.jsx("span",{style:{fontSize:11},children:"Connect to PostgreSQL, BigQuery, Redis, or S3 to get started"})]})]})]})}function ey({pickerStage:h,pickerType:n,pickerInstance:a,instancesOfType:r,handlePickType:o,handlePickInstance:c,setShowSourcePicker:g,setShowConnectForm:m,setPickerStage:S,setPickerType:y,setPickerInstance:b,pgTablesCache:v,s3BucketsCache:T,instances:Z,activePanels:K,addPgPanel:$,addS3Panel:ae}){var me,he;return d.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:[h==="type"&&d.jsxs(d.Fragment,{children:[d.jsx(Qs,{typeKey:"postgres",label:"PostgreSQL",badge:"PG",connected:r("postgres"),onClick:()=>o("postgres"),onConnect:()=>{g(!1),m("postgres")}}),d.jsx(Qs,{typeKey:"bigquery",label:"BigQuery",badge:"BQ",connected:r("bigquery"),onClick:()=>o("bigquery"),onConnect:()=>{g(!1),m("bigquery")}}),d.jsx(Qs,{typeKey:"redis",label:"Redis",badge:"RD",connected:r("redis"),onClick:()=>o("redis"),onConnect:()=>{g(!1),m("redis")}}),d.jsx(Qs,{typeKey:"s3",label:"S3",badge:"S3",connected:r("s3"),onClick:()=>o("s3"),onConnect:()=>{g(!1),m("s3")}})]}),h==="instance"&&n&&d.jsxs(d.Fragment,{children:[d.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:Q=>{Q.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:Q=>{Q.currentTarget.style.background="transparent"},children:"◀ Back"}),r(n).map(Q=>d.jsxs("div",{onClick:()=>c(Q),style:{padding:"8px 12px",cursor:"pointer",fontSize:12,display:"flex",alignItems:"center",gap:8,color:"var(--text)"},onMouseEnter:se=>{se.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:se=>{se.currentTarget.style.background="transparent"},children:[d.jsx("span",{style:{color:Fs[n].color,fontWeight:600,fontSize:10},children:Fs[n].label}),d.jsx("span",{children:Q.label}),n!=="redis"&&d.jsx("span",{style:{color:"var(--text-dim)",fontSize:10,marginLeft:"auto"},children:"▶"})]},Q.id)),d.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:Q=>{Q.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:Q=>{Q.currentTarget.style.background="transparent"},children:"+ Connect new..."})]}),h==="target"&&a&&d.jsxs(d.Fragment,{children:[d.jsx("div",{onClick:()=>{r(n).length>1?(S("instance"),b(null)):(S("type"),y(null),b(null))},style:{padding:"6px 12px",cursor:"pointer",fontSize:11,color:"var(--text-dim)",borderBottom:"1px solid var(--border)"},onMouseEnter:Q=>{Q.currentTarget.style.background="rgba(255,255,255,0.05)"},onMouseLeave:Q=>{Q.currentTarget.style.background="transparent"},children:"◀ Back"}),(n==="postgres"||n==="bigquery")&&d.jsxs(d.Fragment,{children:[(v[a]||[]).map(Q=>{const se=Z.find(H=>H.id===a),ye=K.some(H=>(H.sourceType==="postgres"||H.sourceType==="bigquery")&&H.instanceId===a&&H.schema===Q.schema&&H.name===Q.name);return d.jsxs("div",{onClick:()=>$(a,(se==null?void 0:se.label)||a,Q.schema,Q.name,n),style:{padding:"8px 12px",cursor:"pointer",fontSize:12,display:"flex",justifyContent:"space-between",alignItems:"center",color:ye?"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:[d.jsxs("span",{children:[Q.schema,".",Q.name]}),ye&&d.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:"open"})]},`${Q.schema}.${Q.name}`)}),!v[a]&&d.jsx("div",{style:{padding:"12px",fontSize:12,color:"var(--text-dim)"},children:"Loading tables..."}),((me=v[a])==null?void 0:me.length)===0&&d.jsx("div",{style:{padding:"12px",fontSize:12,color:"var(--text-dim)"},children:"No tables found"})]}),n==="s3"&&d.jsxs(d.Fragment,{children:[(T[a]||[]).map(Q=>{const se=Z.find(H=>H.id===a),ye=K.some(H=>H.sourceType==="s3"&&H.instanceId===a&&H.bucket===Q.name);return d.jsxs("div",{onClick:()=>ae(a,(se==null?void 0:se.label)||a,Q.name),style:{padding:"8px 12px",cursor:"pointer",fontSize:12,display:"flex",justifyContent:"space-between",alignItems:"center",color:ye?"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:[d.jsx("span",{children:Q.name}),ye&&d.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:"open"})]},Q.name)}),!T[a]&&d.jsx("div",{style:{padding:"12px",fontSize:12,color:"var(--text-dim)"},children:"Loading buckets..."}),((he=T[a])==null?void 0:he.length)===0&&d.jsx("div",{style:{padding:"12px",fontSize:12,color:"var(--text-dim)"},children:"No buckets found"})]})]})]})}function Xs({label:h,hint:n,active:a,onClick:r}){return d.jsxs("div",{onClick:r,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:[d.jsx("span",{children:h}),n&&d.jsx("span",{style:{fontSize:10,color:"var(--text-dim)"},children:n}),a&&d.jsx("span",{style:{fontSize:10,color:"var(--cyan)"},children:"●"})]})}function _o({label:h,onClick:n}){return d.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:h})}function Qs({typeKey:h,label:n,badge:a,connected:r,onClick:o,onConnect:c}){const g=Fs[h];return r.length>0?d.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:[d.jsx("span",{style:{color:g.color,fontWeight:600,fontSize:10},children:a}),d.jsxs("span",{style:{color:"var(--text)"},children:[n,r.length>1&&d.jsxs("span",{style:{color:"var(--text-dim)",fontSize:10,marginLeft:4},children:["(",r.length,")"]})]}),d.jsx("span",{style:{color:"var(--text-dim)",fontSize:10,marginLeft:"auto"},children:"▶"})]}):d.jsxs("div",{onClick:c,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:[d.jsx("span",{style:{color:g.color,fontWeight:600,fontSize:10},children:a}),d.jsxs("span",{style:{color:"var(--text-dim)"},children:["Connect ",n,"..."]})]})}ap.createRoot(document.getElementById("root")).render(d.jsx(Im.StrictMode,{children:d.jsx(Pp,{})}));
