safeclaw 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,226 @@
1
+ (function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))c(d);new MutationObserver(d=>{for(const p of d)if(p.type==="childList")for(const h of p.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function l(d){const p={};return d.integrity&&(p.integrity=d.integrity),d.referrerPolicy&&(p.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?p.credentials="include":d.crossOrigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function c(d){if(d.ep)return;d.ep=!0;const p=l(d);fetch(d.href,p)}})();function bd(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Ci={exports:{}},ss={},Ei={exports:{}},ue={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Qu;function eh(){if(Qu)return ue;Qu=1;var r=Symbol.for("react.element"),o=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),h=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),C=Symbol.iterator;function P(k){return k===null||typeof k!="object"?null:(k=C&&k[C]||k["@@iterator"],typeof k=="function"?k:null)}var I={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},W=Object.assign,_={};function T(k,L,oe){this.props=k,this.context=L,this.refs=_,this.updater=oe||I}T.prototype.isReactComponent={},T.prototype.setState=function(k,L){if(typeof k!="object"&&typeof k!="function"&&k!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,k,L,"setState")},T.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function z(){}z.prototype=T.prototype;function H(k,L,oe){this.props=k,this.context=L,this.refs=_,this.updater=oe||I}var $=H.prototype=new z;$.constructor=H,W($,T.prototype),$.isPureReactComponent=!0;var ee=Array.isArray,R=Object.prototype.hasOwnProperty,Q={current:null},te={key:!0,ref:!0,__self:!0,__source:!0};function me(k,L,oe){var ie,de={},fe=null,ve=null;if(L!=null)for(ie in L.ref!==void 0&&(ve=L.ref),L.key!==void 0&&(fe=""+L.key),L)R.call(L,ie)&&!te.hasOwnProperty(ie)&&(de[ie]=L[ie]);var pe=arguments.length-2;if(pe===1)de.children=oe;else if(1<pe){for(var xe=Array(pe),F=0;F<pe;F++)xe[F]=arguments[F+2];de.children=xe}if(k&&k.defaultProps)for(ie in pe=k.defaultProps,pe)de[ie]===void 0&&(de[ie]=pe[ie]);return{$$typeof:r,type:k,key:fe,ref:ve,props:de,_owner:Q.current}}function Ae(k,L){return{$$typeof:r,type:k.type,key:L,ref:k.ref,props:k.props,_owner:k._owner}}function Re(k){return typeof k=="object"&&k!==null&&k.$$typeof===r}function Ze(k){var L={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(oe){return L[oe]})}var le=/\/+/g;function Ve(k,L){return typeof k=="object"&&k!==null&&k.key!=null?Ze(""+k.key):L.toString(36)}function De(k,L,oe,ie,de){var fe=typeof k;(fe==="undefined"||fe==="boolean")&&(k=null);var ve=!1;if(k===null)ve=!0;else switch(fe){case"string":case"number":ve=!0;break;case"object":switch(k.$$typeof){case r:case o:ve=!0}}if(ve)return ve=k,de=de(ve),k=ie===""?"."+Ve(ve,0):ie,ee(de)?(oe="",k!=null&&(oe=k.replace(le,"$&/")+"/"),De(de,L,oe,"",function(F){return F})):de!=null&&(Re(de)&&(de=Ae(de,oe+(!de.key||ve&&ve.key===de.key?"":(""+de.key).replace(le,"$&/")+"/")+k)),L.push(de)),1;if(ve=0,ie=ie===""?".":ie+":",ee(k))for(var pe=0;pe<k.length;pe++){fe=k[pe];var xe=ie+Ve(fe,pe);ve+=De(fe,L,oe,xe,de)}else if(xe=P(k),typeof xe=="function")for(k=xe.call(k),pe=0;!(fe=k.next()).done;)fe=fe.value,xe=ie+Ve(fe,pe++),ve+=De(fe,L,oe,xe,de);else if(fe==="object")throw L=String(k),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.");return ve}function Ke(k,L,oe){if(k==null)return k;var ie=[],de=0;return De(k,ie,"","",function(fe){return L.call(oe,fe,de++)}),ie}function Ce(k){if(k._status===-1){var L=k._result;L=L(),L.then(function(oe){(k._status===0||k._status===-1)&&(k._status=1,k._result=oe)},function(oe){(k._status===0||k._status===-1)&&(k._status=2,k._result=oe)}),k._status===-1&&(k._status=0,k._result=L)}if(k._status===1)return k._result.default;throw k._result}var we={current:null},U={transition:null},Z={ReactCurrentDispatcher:we,ReactCurrentBatchConfig:U,ReactCurrentOwner:Q};function V(){throw Error("act(...) is not supported in production builds of React.")}return ue.Children={map:Ke,forEach:function(k,L,oe){Ke(k,function(){L.apply(this,arguments)},oe)},count:function(k){var L=0;return Ke(k,function(){L++}),L},toArray:function(k){return Ke(k,function(L){return L})||[]},only:function(k){if(!Re(k))throw Error("React.Children.only expected to receive a single React element child.");return k}},ue.Component=T,ue.Fragment=l,ue.Profiler=d,ue.PureComponent=H,ue.StrictMode=c,ue.Suspense=y,ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z,ue.act=V,ue.cloneElement=function(k,L,oe){if(k==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+k+".");var ie=W({},k.props),de=k.key,fe=k.ref,ve=k._owner;if(L!=null){if(L.ref!==void 0&&(fe=L.ref,ve=Q.current),L.key!==void 0&&(de=""+L.key),k.type&&k.type.defaultProps)var pe=k.type.defaultProps;for(xe in L)R.call(L,xe)&&!te.hasOwnProperty(xe)&&(ie[xe]=L[xe]===void 0&&pe!==void 0?pe[xe]:L[xe])}var xe=arguments.length-2;if(xe===1)ie.children=oe;else if(1<xe){pe=Array(xe);for(var F=0;F<xe;F++)pe[F]=arguments[F+2];ie.children=pe}return{$$typeof:r,type:k.type,key:de,ref:fe,props:ie,_owner:ve}},ue.createContext=function(k){return k={$$typeof:h,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},k.Provider={$$typeof:p,_context:k},k.Consumer=k},ue.createElement=me,ue.createFactory=function(k){var L=me.bind(null,k);return L.type=k,L},ue.createRef=function(){return{current:null}},ue.forwardRef=function(k){return{$$typeof:x,render:k}},ue.isValidElement=Re,ue.lazy=function(k){return{$$typeof:N,_payload:{_status:-1,_result:k},_init:Ce}},ue.memo=function(k,L){return{$$typeof:b,type:k,compare:L===void 0?null:L}},ue.startTransition=function(k){var L=U.transition;U.transition={};try{k()}finally{U.transition=L}},ue.unstable_act=V,ue.useCallback=function(k,L){return we.current.useCallback(k,L)},ue.useContext=function(k){return we.current.useContext(k)},ue.useDebugValue=function(){},ue.useDeferredValue=function(k){return we.current.useDeferredValue(k)},ue.useEffect=function(k,L){return we.current.useEffect(k,L)},ue.useId=function(){return we.current.useId()},ue.useImperativeHandle=function(k,L,oe){return we.current.useImperativeHandle(k,L,oe)},ue.useInsertionEffect=function(k,L){return we.current.useInsertionEffect(k,L)},ue.useLayoutEffect=function(k,L){return we.current.useLayoutEffect(k,L)},ue.useMemo=function(k,L){return we.current.useMemo(k,L)},ue.useReducer=function(k,L,oe){return we.current.useReducer(k,L,oe)},ue.useRef=function(k){return we.current.useRef(k)},ue.useState=function(k){return we.current.useState(k)},ue.useSyncExternalStore=function(k,L,oe){return we.current.useSyncExternalStore(k,L,oe)},ue.useTransition=function(){return we.current.useTransition()},ue.version="18.3.1",ue}var Yu;function Xi(){return Yu||(Yu=1,Ei.exports=eh()),Ei.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Gu;function th(){if(Gu)return ss;Gu=1;var r=Xi(),o=Symbol.for("react.element"),l=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,d=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function h(x,y,b){var N,C={},P=null,I=null;b!==void 0&&(P=""+b),y.key!==void 0&&(P=""+y.key),y.ref!==void 0&&(I=y.ref);for(N in y)c.call(y,N)&&!p.hasOwnProperty(N)&&(C[N]=y[N]);if(x&&x.defaultProps)for(N in y=x.defaultProps,y)C[N]===void 0&&(C[N]=y[N]);return{$$typeof:o,type:x,key:P,ref:I,props:C,_owner:d.current}}return ss.Fragment=l,ss.jsx=h,ss.jsxs=h,ss}var Xu;function nh(){return Xu||(Xu=1,Ci.exports=th()),Ci.exports}var i=nh(),g=Xi();const rh=bd(g);var No={},_i={exports:{}},at={},Ri={exports:{}},Ti={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Ju;function sh(){return Ju||(Ju=1,(function(r){function o(U,Z){var V=U.length;U.push(Z);e:for(;0<V;){var k=V-1>>>1,L=U[k];if(0<d(L,Z))U[k]=Z,U[V]=L,V=k;else break e}}function l(U){return U.length===0?null:U[0]}function c(U){if(U.length===0)return null;var Z=U[0],V=U.pop();if(V!==Z){U[0]=V;e:for(var k=0,L=U.length,oe=L>>>1;k<oe;){var ie=2*(k+1)-1,de=U[ie],fe=ie+1,ve=U[fe];if(0>d(de,V))fe<L&&0>d(ve,de)?(U[k]=ve,U[fe]=V,k=fe):(U[k]=de,U[ie]=V,k=ie);else if(fe<L&&0>d(ve,V))U[k]=ve,U[fe]=V,k=fe;else break e}}return Z}function d(U,Z){var V=U.sortIndex-Z.sortIndex;return V!==0?V:U.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var p=performance;r.unstable_now=function(){return p.now()}}else{var h=Date,x=h.now();r.unstable_now=function(){return h.now()-x}}var y=[],b=[],N=1,C=null,P=3,I=!1,W=!1,_=!1,T=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function $(U){for(var Z=l(b);Z!==null;){if(Z.callback===null)c(b);else if(Z.startTime<=U)c(b),Z.sortIndex=Z.expirationTime,o(y,Z);else break;Z=l(b)}}function ee(U){if(_=!1,$(U),!W)if(l(y)!==null)W=!0,Ce(R);else{var Z=l(b);Z!==null&&we(ee,Z.startTime-U)}}function R(U,Z){W=!1,_&&(_=!1,z(me),me=-1),I=!0;var V=P;try{for($(Z),C=l(y);C!==null&&(!(C.expirationTime>Z)||U&&!Ze());){var k=C.callback;if(typeof k=="function"){C.callback=null,P=C.priorityLevel;var L=k(C.expirationTime<=Z);Z=r.unstable_now(),typeof L=="function"?C.callback=L:C===l(y)&&c(y),$(Z)}else c(y);C=l(y)}if(C!==null)var oe=!0;else{var ie=l(b);ie!==null&&we(ee,ie.startTime-Z),oe=!1}return oe}finally{C=null,P=V,I=!1}}var Q=!1,te=null,me=-1,Ae=5,Re=-1;function Ze(){return!(r.unstable_now()-Re<Ae)}function le(){if(te!==null){var U=r.unstable_now();Re=U;var Z=!0;try{Z=te(!0,U)}finally{Z?Ve():(Q=!1,te=null)}}else Q=!1}var Ve;if(typeof H=="function")Ve=function(){H(le)};else if(typeof MessageChannel<"u"){var De=new MessageChannel,Ke=De.port2;De.port1.onmessage=le,Ve=function(){Ke.postMessage(null)}}else Ve=function(){T(le,0)};function Ce(U){te=U,Q||(Q=!0,Ve())}function we(U,Z){me=T(function(){U(r.unstable_now())},Z)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(U){U.callback=null},r.unstable_continueExecution=function(){W||I||(W=!0,Ce(R))},r.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Ae=0<U?Math.floor(1e3/U):5},r.unstable_getCurrentPriorityLevel=function(){return P},r.unstable_getFirstCallbackNode=function(){return l(y)},r.unstable_next=function(U){switch(P){case 1:case 2:case 3:var Z=3;break;default:Z=P}var V=P;P=Z;try{return U()}finally{P=V}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(U,Z){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var V=P;P=U;try{return Z()}finally{P=V}},r.unstable_scheduleCallback=function(U,Z,V){var k=r.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?k+V:k):V=k,U){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=V+L,U={id:N++,callback:Z,priorityLevel:U,startTime:V,expirationTime:L,sortIndex:-1},V>k?(U.sortIndex=V,o(b,U),l(y)===null&&U===l(b)&&(_?(z(me),me=-1):_=!0,we(ee,V-k))):(U.sortIndex=L,o(y,U),W||I||(W=!0,Ce(R))),U},r.unstable_shouldYield=Ze,r.unstable_wrapCallback=function(U){var Z=P;return function(){var V=P;P=Z;try{return U.apply(this,arguments)}finally{P=V}}}})(Ti)),Ti}var Zu;function oh(){return Zu||(Zu=1,Ri.exports=sh()),Ri.exports}/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var ed;function lh(){if(ed)return at;ed=1;var r=Xi(),o=oh();function l(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);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."}var c=new Set,d={};function p(e,t){h(e,t),h(e+"Capture",t)}function h(e,t){for(d[e]=t,e=0;e<t.length;e++)c.add(t[e])}var x=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),y=Object.prototype.hasOwnProperty,b=/^[: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]*$/,N={},C={};function P(e){return y.call(C,e)?!0:y.call(N,e)?!1:b.test(e)?C[e]=!0:(N[e]=!0,!1)}function I(e,t,n,s){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function W(e,t,n,s){if(t===null||typeof t>"u"||I(e,t,n,s))return!0;if(s)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function _(e,t,n,s,a,u,f){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=u,this.removeEmptyString=f}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){T[e]=new _(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];T[t]=new _(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){T[e]=new _(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){T[e]=new _(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){T[e]=new _(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){T[e]=new _(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){T[e]=new _(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){T[e]=new _(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){T[e]=new _(e,5,!1,e.toLowerCase(),null,!1,!1)});var z=/[\-:]([a-z])/g;function H(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(z,H);T[t]=new _(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(z,H);T[t]=new _(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(z,H);T[t]=new _(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){T[e]=new _(e,1,!1,e.toLowerCase(),null,!1,!1)}),T.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){T[e]=new _(e,1,!1,e.toLowerCase(),null,!0,!0)});function $(e,t,n,s){var a=T.hasOwnProperty(t)?T[t]:null;(a!==null?a.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(W(t,n,a,s)&&(n=null),s||a===null?P(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=n===null?a.type===3?!1:"":n:(t=a.attributeName,s=a.attributeNamespace,n===null?e.removeAttribute(t):(a=a.type,n=a===3||a===4&&n===!0?"":""+n,s?e.setAttributeNS(s,t,n):e.setAttribute(t,n))))}var ee=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),Q=Symbol.for("react.portal"),te=Symbol.for("react.fragment"),me=Symbol.for("react.strict_mode"),Ae=Symbol.for("react.profiler"),Re=Symbol.for("react.provider"),Ze=Symbol.for("react.context"),le=Symbol.for("react.forward_ref"),Ve=Symbol.for("react.suspense"),De=Symbol.for("react.suspense_list"),Ke=Symbol.for("react.memo"),Ce=Symbol.for("react.lazy"),we=Symbol.for("react.offscreen"),U=Symbol.iterator;function Z(e){return e===null||typeof e!="object"?null:(e=U&&e[U]||e["@@iterator"],typeof e=="function"?e:null)}var V=Object.assign,k;function L(e){if(k===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);k=t&&t[1]||""}return`
34
+ `+k+e}var oe=!1;function ie(e,t){if(!e||oe)return"";oe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(E){var s=E}Reflect.construct(e,[],t)}else{try{t.call()}catch(E){s=E}e.call(t.prototype)}else{try{throw Error()}catch(E){s=E}e()}}catch(E){if(E&&s&&typeof E.stack=="string"){for(var a=E.stack.split(`
35
+ `),u=s.stack.split(`
36
+ `),f=a.length-1,m=u.length-1;1<=f&&0<=m&&a[f]!==u[m];)m--;for(;1<=f&&0<=m;f--,m--)if(a[f]!==u[m]){if(f!==1||m!==1)do if(f--,m--,0>m||a[f]!==u[m]){var v=`
37
+ `+a[f].replace(" at new "," at ");return e.displayName&&v.includes("<anonymous>")&&(v=v.replace("<anonymous>",e.displayName)),v}while(1<=f&&0<=m);break}}}finally{oe=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?L(e):""}function de(e){switch(e.tag){case 5:return L(e.type);case 16:return L("Lazy");case 13:return L("Suspense");case 19:return L("SuspenseList");case 0:case 2:case 15:return e=ie(e.type,!1),e;case 11:return e=ie(e.type.render,!1),e;case 1:return e=ie(e.type,!0),e;default:return""}}function fe(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case te:return"Fragment";case Q:return"Portal";case Ae:return"Profiler";case me:return"StrictMode";case Ve:return"Suspense";case De:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ze:return(e.displayName||"Context")+".Consumer";case Re:return(e._context.displayName||"Context")+".Provider";case le:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ke:return t=e.displayName||null,t!==null?t:fe(e.type)||"Memo";case Ce:t=e._payload,e=e._init;try{return fe(e(t))}catch{}}return null}function ve(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fe(t);case 8:return t===me?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function pe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xe(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function F(e){var t=xe(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,u=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(f){s=""+f,u.call(this,f)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(f){s=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function q(e){e._valueTracker||(e._valueTracker=F(e))}function ae(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=xe(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function ce(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}}function et(e,t){var n=t.checked;return V({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ee(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=pe(t.value!=null?t.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function At(e,t){t=t.checked,t!=null&&$(e,"checked",t,!1)}function pt(e,t){At(e,t);var n=pe(t.value),s=t.type;if(n!=null)s==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Wt(e,t.type,n):t.hasOwnProperty("defaultValue")&&Wt(e,t.type,pe(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function rn(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Wt(e,t,n){(t!=="number"||ce(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var kt=Array.isArray;function ht(e,t,n,s){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&s&&(e[n].defaultSelected=!0)}else{for(n=""+pe(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,s&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Vt(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(l(91));return V({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function sn(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(l(92));if(kt(n)){if(1<n.length)throw Error(l(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:pe(n)}}function on(e,t){var n=pe(t.value),s=pe(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),s!=null&&(e.defaultValue=""+s)}function ln(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function an(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Kt(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?an(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ot,cn=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,s,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,s,a)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ot=Ot||document.createElement("div"),Ot.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ot.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function un(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Nr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rf=["Webkit","ms","Moz","O"];Object.keys(Nr).forEach(function(e){rf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Nr[t]=Nr[e]})});function ca(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Nr.hasOwnProperty(e)&&Nr[e]?(""+t).trim():t+"px"}function ua(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,a=ca(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,a):e[n]=a}}var sf=V({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Fo(e,t){if(t){if(sf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(l(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(l(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(l(61))}if(t.style!=null&&typeof t.style!="object")throw Error(l(62))}}function Bo(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 zo=null;function $o(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Uo=null,qn=null,Qn=null;function da(e){if(e=Hr(e)){if(typeof Uo!="function")throw Error(l(280));var t=e.stateNode;t&&(t=Is(t),Uo(e.stateNode,e.type,t))}}function fa(e){qn?Qn?Qn.push(e):Qn=[e]:qn=e}function pa(){if(qn){var e=qn,t=Qn;if(Qn=qn=null,da(e),t)for(e=0;e<t.length;e++)da(t[e])}}function ha(e,t){return e(t)}function ma(){}var Ho=!1;function ga(e,t,n){if(Ho)return e(t,n);Ho=!0;try{return ha(e,t,n)}finally{Ho=!1,(qn!==null||Qn!==null)&&(ma(),pa())}}function br(e,t){var n=e.stateNode;if(n===null)return null;var s=Is(n);if(s===null)return null;n=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(l(231,t,typeof n));return n}var Wo=!1;if(x)try{var kr={};Object.defineProperty(kr,"passive",{get:function(){Wo=!0}}),window.addEventListener("test",kr,kr),window.removeEventListener("test",kr,kr)}catch{Wo=!1}function of(e,t,n,s,a,u,f,m,v){var E=Array.prototype.slice.call(arguments,3);try{t.apply(n,E)}catch(O){this.onError(O)}}var Sr=!1,ps=null,hs=!1,Vo=null,lf={onError:function(e){Sr=!0,ps=e}};function af(e,t,n,s,a,u,f,m,v){Sr=!1,ps=null,of.apply(lf,arguments)}function cf(e,t,n,s,a,u,f,m,v){if(af.apply(this,arguments),Sr){if(Sr){var E=ps;Sr=!1,ps=null}else throw Error(l(198));hs||(hs=!0,Vo=E)}}function An(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function xa(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 ya(e){if(An(e)!==e)throw Error(l(188))}function uf(e){var t=e.alternate;if(!t){if(t=An(e),t===null)throw Error(l(188));return t!==e?null:e}for(var n=e,s=t;;){var a=n.return;if(a===null)break;var u=a.alternate;if(u===null){if(s=a.return,s!==null){n=s;continue}break}if(a.child===u.child){for(u=a.child;u;){if(u===n)return ya(a),e;if(u===s)return ya(a),t;u=u.sibling}throw Error(l(188))}if(n.return!==s.return)n=a,s=u;else{for(var f=!1,m=a.child;m;){if(m===n){f=!0,n=a,s=u;break}if(m===s){f=!0,s=a,n=u;break}m=m.sibling}if(!f){for(m=u.child;m;){if(m===n){f=!0,n=u,s=a;break}if(m===s){f=!0,s=u,n=a;break}m=m.sibling}if(!f)throw Error(l(189))}}if(n.alternate!==s)throw Error(l(190))}if(n.tag!==3)throw Error(l(188));return n.stateNode.current===n?e:t}function va(e){return e=uf(e),e!==null?wa(e):null}function wa(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=wa(e);if(t!==null)return t;e=e.sibling}return null}var Na=o.unstable_scheduleCallback,ba=o.unstable_cancelCallback,df=o.unstable_shouldYield,ff=o.unstable_requestPaint,Ie=o.unstable_now,pf=o.unstable_getCurrentPriorityLevel,Ko=o.unstable_ImmediatePriority,ka=o.unstable_UserBlockingPriority,ms=o.unstable_NormalPriority,hf=o.unstable_LowPriority,Sa=o.unstable_IdlePriority,gs=null,It=null;function mf(e){if(It&&typeof It.onCommitFiberRoot=="function")try{It.onCommitFiberRoot(gs,e,void 0,(e.current.flags&128)===128)}catch{}}var St=Math.clz32?Math.clz32:yf,gf=Math.log,xf=Math.LN2;function yf(e){return e>>>=0,e===0?32:31-(gf(e)/xf|0)|0}var xs=64,ys=4194304;function jr(e){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:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function vs(e,t){var n=e.pendingLanes;if(n===0)return 0;var s=0,a=e.suspendedLanes,u=e.pingedLanes,f=n&268435455;if(f!==0){var m=f&~a;m!==0?s=jr(m):(u&=f,u!==0&&(s=jr(u)))}else f=n&~a,f!==0?s=jr(f):u!==0&&(s=jr(u));if(s===0)return 0;if(t!==0&&t!==s&&(t&a)===0&&(a=s&-s,u=t&-t,a>=u||a===16&&(u&4194240)!==0))return t;if((s&4)!==0&&(s|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)n=31-St(t),a=1<<n,s|=e[n],t&=~a;return s}function vf(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wf(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,a=e.expirationTimes,u=e.pendingLanes;0<u;){var f=31-St(u),m=1<<f,v=a[f];v===-1?((m&n)===0||(m&s)!==0)&&(a[f]=vf(m,t)):v<=t&&(e.expiredLanes|=m),u&=~m}}function qo(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function ja(){var e=xs;return xs<<=1,(xs&4194240)===0&&(xs=64),e}function Qo(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Cr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-St(t),e[t]=n}function Nf(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-St(n),u=1<<a;t[a]=0,s[a]=-1,e[a]=-1,n&=~u}}function Yo(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-St(n),a=1<<s;a&t|e[s]&t&&(e[s]|=t),n&=~a}}var Ne=0;function Ca(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Ea,Go,_a,Ra,Ta,Xo=!1,ws=[],dn=null,fn=null,pn=null,Er=new Map,_r=new Map,hn=[],bf="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 submit".split(" ");function Pa(e,t){switch(e){case"focusin":case"focusout":dn=null;break;case"dragenter":case"dragleave":fn=null;break;case"mouseover":case"mouseout":pn=null;break;case"pointerover":case"pointerout":Er.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_r.delete(t.pointerId)}}function Rr(e,t,n,s,a,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:u,targetContainers:[a]},t!==null&&(t=Hr(t),t!==null&&Go(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function kf(e,t,n,s,a){switch(t){case"focusin":return dn=Rr(dn,e,t,n,s,a),!0;case"dragenter":return fn=Rr(fn,e,t,n,s,a),!0;case"mouseover":return pn=Rr(pn,e,t,n,s,a),!0;case"pointerover":var u=a.pointerId;return Er.set(u,Rr(Er.get(u)||null,e,t,n,s,a)),!0;case"gotpointercapture":return u=a.pointerId,_r.set(u,Rr(_r.get(u)||null,e,t,n,s,a)),!0}return!1}function La(e){var t=On(e.target);if(t!==null){var n=An(t);if(n!==null){if(t=n.tag,t===13){if(t=xa(n),t!==null){e.blockedOn=t,Ta(e.priority,function(){_a(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ns(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Zo(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);zo=s,n.target.dispatchEvent(s),zo=null}else return t=Hr(n),t!==null&&Go(t),e.blockedOn=n,!1;t.shift()}return!0}function Aa(e,t,n){Ns(e)&&n.delete(t)}function Sf(){Xo=!1,dn!==null&&Ns(dn)&&(dn=null),fn!==null&&Ns(fn)&&(fn=null),pn!==null&&Ns(pn)&&(pn=null),Er.forEach(Aa),_r.forEach(Aa)}function Tr(e,t){e.blockedOn===t&&(e.blockedOn=null,Xo||(Xo=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,Sf)))}function Pr(e){function t(a){return Tr(a,e)}if(0<ws.length){Tr(ws[0],e);for(var n=1;n<ws.length;n++){var s=ws[n];s.blockedOn===e&&(s.blockedOn=null)}}for(dn!==null&&Tr(dn,e),fn!==null&&Tr(fn,e),pn!==null&&Tr(pn,e),Er.forEach(t),_r.forEach(t),n=0;n<hn.length;n++)s=hn[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<hn.length&&(n=hn[0],n.blockedOn===null);)La(n),n.blockedOn===null&&hn.shift()}var Yn=ee.ReactCurrentBatchConfig,bs=!0;function jf(e,t,n,s){var a=Ne,u=Yn.transition;Yn.transition=null;try{Ne=1,Jo(e,t,n,s)}finally{Ne=a,Yn.transition=u}}function Cf(e,t,n,s){var a=Ne,u=Yn.transition;Yn.transition=null;try{Ne=4,Jo(e,t,n,s)}finally{Ne=a,Yn.transition=u}}function Jo(e,t,n,s){if(bs){var a=Zo(e,t,n,s);if(a===null)gl(e,t,s,ks,n),Pa(e,s);else if(kf(a,e,t,n,s))s.stopPropagation();else if(Pa(e,s),t&4&&-1<bf.indexOf(e)){for(;a!==null;){var u=Hr(a);if(u!==null&&Ea(u),u=Zo(e,t,n,s),u===null&&gl(e,t,s,ks,n),u===a)break;a=u}a!==null&&s.stopPropagation()}else gl(e,t,s,null,n)}}var ks=null;function Zo(e,t,n,s){if(ks=null,e=$o(s),e=On(e),e!==null)if(t=An(e),t===null)e=null;else if(n=t.tag,n===13){if(e=xa(t),e!==null)return e;e=null}else if(n===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 Oa(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(pf()){case Ko:return 1;case ka:return 4;case ms:case hf:return 16;case Sa:return 536870912;default:return 16}default:return 16}}var mn=null,el=null,Ss=null;function Ia(){if(Ss)return Ss;var e,t=el,n=t.length,s,a="value"in mn?mn.value:mn.textContent,u=a.length;for(e=0;e<n&&t[e]===a[e];e++);var f=n-e;for(s=1;s<=f&&t[n-s]===a[u-s];s++);return Ss=a.slice(e,1<s?1-s:void 0)}function js(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 Cs(){return!0}function Ma(){return!1}function ct(e){function t(n,s,a,u,f){this._reactName=n,this._targetInst=a,this.type=s,this.nativeEvent=u,this.target=f,this.currentTarget=null;for(var m in e)e.hasOwnProperty(m)&&(n=e[m],this[m]=n?n(u):u[m]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?Cs:Ma,this.isPropagationStopped=Ma,this}return V(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Cs)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Cs)},persist:function(){},isPersistent:Cs}),t}var Gn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},tl=ct(Gn),Lr=V({},Gn,{view:0,detail:0}),Ef=ct(Lr),nl,rl,Ar,Es=V({},Lr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ol,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!==Ar&&(Ar&&e.type==="mousemove"?(nl=e.screenX-Ar.screenX,rl=e.screenY-Ar.screenY):rl=nl=0,Ar=e),nl)},movementY:function(e){return"movementY"in e?e.movementY:rl}}),Da=ct(Es),_f=V({},Es,{dataTransfer:0}),Rf=ct(_f),Tf=V({},Lr,{relatedTarget:0}),sl=ct(Tf),Pf=V({},Gn,{animationName:0,elapsedTime:0,pseudoElement:0}),Lf=ct(Pf),Af=V({},Gn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Of=ct(Af),If=V({},Gn,{data:0}),Fa=ct(If),Mf={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Df={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"},Ff={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Bf(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ff[e])?!!t[e]:!1}function ol(){return Bf}var zf=V({},Lr,{key:function(e){if(e.key){var t=Mf[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=js(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Df[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ol,charCode:function(e){return e.type==="keypress"?js(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?js(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),$f=ct(zf),Uf=V({},Es,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ba=ct(Uf),Hf=V({},Lr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ol}),Wf=ct(Hf),Vf=V({},Gn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Kf=ct(Vf),qf=V({},Es,{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}),Qf=ct(qf),Yf=[9,13,27,32],ll=x&&"CompositionEvent"in window,Or=null;x&&"documentMode"in document&&(Or=document.documentMode);var Gf=x&&"TextEvent"in window&&!Or,za=x&&(!ll||Or&&8<Or&&11>=Or),$a=" ",Ua=!1;function Ha(e,t){switch(e){case"keyup":return Yf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wa(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xn=!1;function Xf(e,t){switch(e){case"compositionend":return Wa(t);case"keypress":return t.which!==32?null:(Ua=!0,$a);case"textInput":return e=t.data,e===$a&&Ua?null:e;default:return null}}function Jf(e,t){if(Xn)return e==="compositionend"||!ll&&Ha(e,t)?(e=Ia(),Ss=el=mn=null,Xn=!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 za&&t.locale!=="ko"?null:t.data;default:return null}}var Zf={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 Va(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Zf[e.type]:t==="textarea"}function Ka(e,t,n,s){fa(s),t=Ls(t,"onChange"),0<t.length&&(n=new tl("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Ir=null,Mr=null;function ep(e){uc(e,0)}function _s(e){var t=nr(e);if(ae(t))return e}function tp(e,t){if(e==="change")return t}var qa=!1;if(x){var il;if(x){var al="oninput"in document;if(!al){var Qa=document.createElement("div");Qa.setAttribute("oninput","return;"),al=typeof Qa.oninput=="function"}il=al}else il=!1;qa=il&&(!document.documentMode||9<document.documentMode)}function Ya(){Ir&&(Ir.detachEvent("onpropertychange",Ga),Mr=Ir=null)}function Ga(e){if(e.propertyName==="value"&&_s(Mr)){var t=[];Ka(t,Mr,e,$o(e)),ga(ep,t)}}function np(e,t,n){e==="focusin"?(Ya(),Ir=t,Mr=n,Ir.attachEvent("onpropertychange",Ga)):e==="focusout"&&Ya()}function rp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return _s(Mr)}function sp(e,t){if(e==="click")return _s(t)}function op(e,t){if(e==="input"||e==="change")return _s(t)}function lp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var jt=typeof Object.is=="function"?Object.is:lp;function Dr(e,t){if(jt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var a=n[s];if(!y.call(t,a)||!jt(e[a],t[a]))return!1}return!0}function Xa(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ja(e,t){var n=Xa(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Xa(n)}}function Za(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Za(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ec(){for(var e=window,t=ce();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ce(e.document)}return t}function cl(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")}function ip(e){var t=ec(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Za(n.ownerDocument.documentElement,n)){if(s!==null&&cl(n)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=n.textContent.length,u=Math.min(s.start,a);s=s.end===void 0?u:Math.min(s.end,a),!e.extend&&u>s&&(a=s,s=u,u=a),a=Ja(n,u);var f=Ja(n,s);a&&f&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==f.node||e.focusOffset!==f.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),u>s?(e.addRange(t),e.extend(f.node,f.offset)):(t.setEnd(f.node,f.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ap=x&&"documentMode"in document&&11>=document.documentMode,Jn=null,ul=null,Fr=null,dl=!1;function tc(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;dl||Jn==null||Jn!==ce(s)||(s=Jn,"selectionStart"in s&&cl(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Fr&&Dr(Fr,s)||(Fr=s,s=Ls(ul,"onSelect"),0<s.length&&(t=new tl("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=Jn)))}function Rs(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Zn={animationend:Rs("Animation","AnimationEnd"),animationiteration:Rs("Animation","AnimationIteration"),animationstart:Rs("Animation","AnimationStart"),transitionend:Rs("Transition","TransitionEnd")},fl={},nc={};x&&(nc=document.createElement("div").style,"AnimationEvent"in window||(delete Zn.animationend.animation,delete Zn.animationiteration.animation,delete Zn.animationstart.animation),"TransitionEvent"in window||delete Zn.transitionend.transition);function Ts(e){if(fl[e])return fl[e];if(!Zn[e])return e;var t=Zn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in nc)return fl[e]=t[n];return e}var rc=Ts("animationend"),sc=Ts("animationiteration"),oc=Ts("animationstart"),lc=Ts("transitionend"),ic=new Map,ac="abort auxClick 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(" ");function gn(e,t){ic.set(e,t),p(t,[e])}for(var pl=0;pl<ac.length;pl++){var hl=ac[pl],cp=hl.toLowerCase(),up=hl[0].toUpperCase()+hl.slice(1);gn(cp,"on"+up)}gn(rc,"onAnimationEnd"),gn(sc,"onAnimationIteration"),gn(oc,"onAnimationStart"),gn("dblclick","onDoubleClick"),gn("focusin","onFocus"),gn("focusout","onBlur"),gn(lc,"onTransitionEnd"),h("onMouseEnter",["mouseout","mouseover"]),h("onMouseLeave",["mouseout","mouseover"]),h("onPointerEnter",["pointerout","pointerover"]),h("onPointerLeave",["pointerout","pointerover"]),p("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),p("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),p("onBeforeInput",["compositionend","keypress","textInput","paste"]),p("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),p("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),p("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Br="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(" "),dp=new Set("cancel close invalid load scroll toggle".split(" ").concat(Br));function cc(e,t,n){var s=e.type||"unknown-event";e.currentTarget=n,cf(s,t,void 0,e),e.currentTarget=null}function uc(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],a=s.event;s=s.listeners;e:{var u=void 0;if(t)for(var f=s.length-1;0<=f;f--){var m=s[f],v=m.instance,E=m.currentTarget;if(m=m.listener,v!==u&&a.isPropagationStopped())break e;cc(a,m,E),u=v}else for(f=0;f<s.length;f++){if(m=s[f],v=m.instance,E=m.currentTarget,m=m.listener,v!==u&&a.isPropagationStopped())break e;cc(a,m,E),u=v}}}if(hs)throw e=Vo,hs=!1,Vo=null,e}function Se(e,t){var n=t[bl];n===void 0&&(n=t[bl]=new Set);var s=e+"__bubble";n.has(s)||(dc(t,e,2,!1),n.add(s))}function ml(e,t,n){var s=0;t&&(s|=4),dc(n,e,s,t)}var Ps="_reactListening"+Math.random().toString(36).slice(2);function zr(e){if(!e[Ps]){e[Ps]=!0,c.forEach(function(n){n!=="selectionchange"&&(dp.has(n)||ml(n,!1,e),ml(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ps]||(t[Ps]=!0,ml("selectionchange",!1,t))}}function dc(e,t,n,s){switch(Oa(t)){case 1:var a=jf;break;case 4:a=Cf;break;default:a=Jo}n=a.bind(null,t,n,e),a=void 0,!Wo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),s?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function gl(e,t,n,s,a){var u=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var f=s.tag;if(f===3||f===4){var m=s.stateNode.containerInfo;if(m===a||m.nodeType===8&&m.parentNode===a)break;if(f===4)for(f=s.return;f!==null;){var v=f.tag;if((v===3||v===4)&&(v=f.stateNode.containerInfo,v===a||v.nodeType===8&&v.parentNode===a))return;f=f.return}for(;m!==null;){if(f=On(m),f===null)return;if(v=f.tag,v===5||v===6){s=u=f;continue e}m=m.parentNode}}s=s.return}ga(function(){var E=u,O=$o(n),M=[];e:{var A=ic.get(e);if(A!==void 0){var K=tl,G=e;switch(e){case"keypress":if(js(n)===0)break e;case"keydown":case"keyup":K=$f;break;case"focusin":G="focus",K=sl;break;case"focusout":G="blur",K=sl;break;case"beforeblur":case"afterblur":K=sl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":K=Da;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=Rf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=Wf;break;case rc:case sc:case oc:K=Lf;break;case lc:K=Kf;break;case"scroll":K=Ef;break;case"wheel":K=Qf;break;case"copy":case"cut":case"paste":K=Of;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=Ba}var X=(t&4)!==0,Me=!X&&e==="scroll",S=X?A!==null?A+"Capture":null:A;X=[];for(var w=E,j;w!==null;){j=w;var D=j.stateNode;if(j.tag===5&&D!==null&&(j=D,S!==null&&(D=br(w,S),D!=null&&X.push($r(w,D,j)))),Me)break;w=w.return}0<X.length&&(A=new K(A,G,null,n,O),M.push({event:A,listeners:X}))}}if((t&7)===0){e:{if(A=e==="mouseover"||e==="pointerover",K=e==="mouseout"||e==="pointerout",A&&n!==zo&&(G=n.relatedTarget||n.fromElement)&&(On(G)||G[qt]))break e;if((K||A)&&(A=O.window===O?O:(A=O.ownerDocument)?A.defaultView||A.parentWindow:window,K?(G=n.relatedTarget||n.toElement,K=E,G=G?On(G):null,G!==null&&(Me=An(G),G!==Me||G.tag!==5&&G.tag!==6)&&(G=null)):(K=null,G=E),K!==G)){if(X=Da,D="onMouseLeave",S="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(X=Ba,D="onPointerLeave",S="onPointerEnter",w="pointer"),Me=K==null?A:nr(K),j=G==null?A:nr(G),A=new X(D,w+"leave",K,n,O),A.target=Me,A.relatedTarget=j,D=null,On(O)===E&&(X=new X(S,w+"enter",G,n,O),X.target=j,X.relatedTarget=Me,D=X),Me=D,K&&G)t:{for(X=K,S=G,w=0,j=X;j;j=er(j))w++;for(j=0,D=S;D;D=er(D))j++;for(;0<w-j;)X=er(X),w--;for(;0<j-w;)S=er(S),j--;for(;w--;){if(X===S||S!==null&&X===S.alternate)break t;X=er(X),S=er(S)}X=null}else X=null;K!==null&&fc(M,A,K,X,!1),G!==null&&Me!==null&&fc(M,Me,G,X,!0)}}e:{if(A=E?nr(E):window,K=A.nodeName&&A.nodeName.toLowerCase(),K==="select"||K==="input"&&A.type==="file")var J=tp;else if(Va(A))if(qa)J=op;else{J=rp;var ne=np}else(K=A.nodeName)&&K.toLowerCase()==="input"&&(A.type==="checkbox"||A.type==="radio")&&(J=sp);if(J&&(J=J(e,E))){Ka(M,J,n,O);break e}ne&&ne(e,A,E),e==="focusout"&&(ne=A._wrapperState)&&ne.controlled&&A.type==="number"&&Wt(A,"number",A.value)}switch(ne=E?nr(E):window,e){case"focusin":(Va(ne)||ne.contentEditable==="true")&&(Jn=ne,ul=E,Fr=null);break;case"focusout":Fr=ul=Jn=null;break;case"mousedown":dl=!0;break;case"contextmenu":case"mouseup":case"dragend":dl=!1,tc(M,n,O);break;case"selectionchange":if(ap)break;case"keydown":case"keyup":tc(M,n,O)}var re;if(ll)e:{switch(e){case"compositionstart":var se="onCompositionStart";break e;case"compositionend":se="onCompositionEnd";break e;case"compositionupdate":se="onCompositionUpdate";break e}se=void 0}else Xn?Ha(e,n)&&(se="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(se="onCompositionStart");se&&(za&&n.locale!=="ko"&&(Xn||se!=="onCompositionStart"?se==="onCompositionEnd"&&Xn&&(re=Ia()):(mn=O,el="value"in mn?mn.value:mn.textContent,Xn=!0)),ne=Ls(E,se),0<ne.length&&(se=new Fa(se,e,null,n,O),M.push({event:se,listeners:ne}),re?se.data=re:(re=Wa(n),re!==null&&(se.data=re)))),(re=Gf?Xf(e,n):Jf(e,n))&&(E=Ls(E,"onBeforeInput"),0<E.length&&(O=new Fa("onBeforeInput","beforeinput",null,n,O),M.push({event:O,listeners:E}),O.data=re))}uc(M,t)})}function $r(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ls(e,t){for(var n=t+"Capture",s=[];e!==null;){var a=e,u=a.stateNode;a.tag===5&&u!==null&&(a=u,u=br(e,n),u!=null&&s.unshift($r(e,u,a)),u=br(e,t),u!=null&&s.push($r(e,u,a))),e=e.return}return s}function er(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function fc(e,t,n,s,a){for(var u=t._reactName,f=[];n!==null&&n!==s;){var m=n,v=m.alternate,E=m.stateNode;if(v!==null&&v===s)break;m.tag===5&&E!==null&&(m=E,a?(v=br(n,u),v!=null&&f.unshift($r(n,v,m))):a||(v=br(n,u),v!=null&&f.push($r(n,v,m)))),n=n.return}f.length!==0&&e.push({event:t,listeners:f})}var fp=/\r\n?/g,pp=/\u0000|\uFFFD/g;function pc(e){return(typeof e=="string"?e:""+e).replace(fp,`
38
+ `).replace(pp,"")}function As(e,t,n){if(t=pc(t),pc(e)!==t&&n)throw Error(l(425))}function Os(){}var xl=null,yl=null;function vl(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var wl=typeof setTimeout=="function"?setTimeout:void 0,hp=typeof clearTimeout=="function"?clearTimeout:void 0,hc=typeof Promise=="function"?Promise:void 0,mp=typeof queueMicrotask=="function"?queueMicrotask:typeof hc<"u"?function(e){return hc.resolve(null).then(e).catch(gp)}:wl;function gp(e){setTimeout(function(){throw e})}function Nl(e,t){var n=t,s=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(s===0){e.removeChild(a),Pr(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=a}while(n);Pr(t)}function xn(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==="$?")break;if(t==="/$")return null}}return e}function mc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var tr=Math.random().toString(36).slice(2),Mt="__reactFiber$"+tr,Ur="__reactProps$"+tr,qt="__reactContainer$"+tr,bl="__reactEvents$"+tr,xp="__reactListeners$"+tr,yp="__reactHandles$"+tr;function On(e){var t=e[Mt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[qt]||n[Mt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mc(e);e!==null;){if(n=e[Mt])return n;e=mc(e)}return t}e=n,n=e.parentNode}return null}function Hr(e){return e=e[Mt]||e[qt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function nr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(l(33))}function Is(e){return e[Ur]||null}var kl=[],rr=-1;function yn(e){return{current:e}}function je(e){0>rr||(e.current=kl[rr],kl[rr]=null,rr--)}function ke(e,t){rr++,kl[rr]=e.current,e.current=t}var vn={},Ye=yn(vn),rt=yn(!1),In=vn;function sr(e,t){var n=e.type.contextTypes;if(!n)return vn;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var a={},u;for(u in n)a[u]=t[u];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function st(e){return e=e.childContextTypes,e!=null}function Ms(){je(rt),je(Ye)}function gc(e,t,n){if(Ye.current!==vn)throw Error(l(168));ke(Ye,t),ke(rt,n)}function xc(e,t,n){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var a in s)if(!(a in t))throw Error(l(108,ve(e)||"Unknown",a));return V({},n,s)}function Ds(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||vn,In=Ye.current,ke(Ye,e),ke(rt,rt.current),!0}function yc(e,t,n){var s=e.stateNode;if(!s)throw Error(l(169));n?(e=xc(e,t,In),s.__reactInternalMemoizedMergedChildContext=e,je(rt),je(Ye),ke(Ye,e)):je(rt),ke(rt,n)}var Qt=null,Fs=!1,Sl=!1;function vc(e){Qt===null?Qt=[e]:Qt.push(e)}function vp(e){Fs=!0,vc(e)}function wn(){if(!Sl&&Qt!==null){Sl=!0;var e=0,t=Ne;try{var n=Qt;for(Ne=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}Qt=null,Fs=!1}catch(a){throw Qt!==null&&(Qt=Qt.slice(e+1)),Na(Ko,wn),a}finally{Ne=t,Sl=!1}}return null}var or=[],lr=0,Bs=null,zs=0,mt=[],gt=0,Mn=null,Yt=1,Gt="";function Dn(e,t){or[lr++]=zs,or[lr++]=Bs,Bs=e,zs=t}function wc(e,t,n){mt[gt++]=Yt,mt[gt++]=Gt,mt[gt++]=Mn,Mn=e;var s=Yt;e=Gt;var a=32-St(s)-1;s&=~(1<<a),n+=1;var u=32-St(t)+a;if(30<u){var f=a-a%5;u=(s&(1<<f)-1).toString(32),s>>=f,a-=f,Yt=1<<32-St(t)+a|n<<a|s,Gt=u+e}else Yt=1<<u|n<<a|s,Gt=e}function jl(e){e.return!==null&&(Dn(e,1),wc(e,1,0))}function Cl(e){for(;e===Bs;)Bs=or[--lr],or[lr]=null,zs=or[--lr],or[lr]=null;for(;e===Mn;)Mn=mt[--gt],mt[gt]=null,Gt=mt[--gt],mt[gt]=null,Yt=mt[--gt],mt[gt]=null}var ut=null,dt=null,_e=!1,Ct=null;function Nc(e,t){var n=wt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function bc(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ut=e,dt=xn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ut=e,dt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Mn!==null?{id:Yt,overflow:Gt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=wt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ut=e,dt=null,!0):!1;default:return!1}}function El(e){return(e.mode&1)!==0&&(e.flags&128)===0}function _l(e){if(_e){var t=dt;if(t){var n=t;if(!bc(e,t)){if(El(e))throw Error(l(418));t=xn(n.nextSibling);var s=ut;t&&bc(e,t)?Nc(s,n):(e.flags=e.flags&-4097|2,_e=!1,ut=e)}}else{if(El(e))throw Error(l(418));e.flags=e.flags&-4097|2,_e=!1,ut=e}}}function kc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ut=e}function $s(e){if(e!==ut)return!1;if(!_e)return kc(e),_e=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!vl(e.type,e.memoizedProps)),t&&(t=dt)){if(El(e))throw Sc(),Error(l(418));for(;t;)Nc(e,t),t=xn(t.nextSibling)}if(kc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){dt=xn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}dt=null}}else dt=ut?xn(e.stateNode.nextSibling):null;return!0}function Sc(){for(var e=dt;e;)e=xn(e.nextSibling)}function ir(){dt=ut=null,_e=!1}function Rl(e){Ct===null?Ct=[e]:Ct.push(e)}var wp=ee.ReactCurrentBatchConfig;function Wr(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(l(309));var s=n.stateNode}if(!s)throw Error(l(147,e));var a=s,u=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===u?t.ref:(t=function(f){var m=a.refs;f===null?delete m[u]:m[u]=f},t._stringRef=u,t)}if(typeof e!="string")throw Error(l(284));if(!n._owner)throw Error(l(290,e))}return e}function Us(e,t){throw e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function jc(e){var t=e._init;return t(e._payload)}function Cc(e){function t(S,w){if(e){var j=S.deletions;j===null?(S.deletions=[w],S.flags|=16):j.push(w)}}function n(S,w){if(!e)return null;for(;w!==null;)t(S,w),w=w.sibling;return null}function s(S,w){for(S=new Map;w!==null;)w.key!==null?S.set(w.key,w):S.set(w.index,w),w=w.sibling;return S}function a(S,w){return S=_n(S,w),S.index=0,S.sibling=null,S}function u(S,w,j){return S.index=j,e?(j=S.alternate,j!==null?(j=j.index,j<w?(S.flags|=2,w):j):(S.flags|=2,w)):(S.flags|=1048576,w)}function f(S){return e&&S.alternate===null&&(S.flags|=2),S}function m(S,w,j,D){return w===null||w.tag!==6?(w=wi(j,S.mode,D),w.return=S,w):(w=a(w,j),w.return=S,w)}function v(S,w,j,D){var J=j.type;return J===te?O(S,w,j.props.children,D,j.key):w!==null&&(w.elementType===J||typeof J=="object"&&J!==null&&J.$$typeof===Ce&&jc(J)===w.type)?(D=a(w,j.props),D.ref=Wr(S,w,j),D.return=S,D):(D=po(j.type,j.key,j.props,null,S.mode,D),D.ref=Wr(S,w,j),D.return=S,D)}function E(S,w,j,D){return w===null||w.tag!==4||w.stateNode.containerInfo!==j.containerInfo||w.stateNode.implementation!==j.implementation?(w=Ni(j,S.mode,D),w.return=S,w):(w=a(w,j.children||[]),w.return=S,w)}function O(S,w,j,D,J){return w===null||w.tag!==7?(w=Vn(j,S.mode,D,J),w.return=S,w):(w=a(w,j),w.return=S,w)}function M(S,w,j){if(typeof w=="string"&&w!==""||typeof w=="number")return w=wi(""+w,S.mode,j),w.return=S,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case R:return j=po(w.type,w.key,w.props,null,S.mode,j),j.ref=Wr(S,null,w),j.return=S,j;case Q:return w=Ni(w,S.mode,j),w.return=S,w;case Ce:var D=w._init;return M(S,D(w._payload),j)}if(kt(w)||Z(w))return w=Vn(w,S.mode,j,null),w.return=S,w;Us(S,w)}return null}function A(S,w,j,D){var J=w!==null?w.key:null;if(typeof j=="string"&&j!==""||typeof j=="number")return J!==null?null:m(S,w,""+j,D);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case R:return j.key===J?v(S,w,j,D):null;case Q:return j.key===J?E(S,w,j,D):null;case Ce:return J=j._init,A(S,w,J(j._payload),D)}if(kt(j)||Z(j))return J!==null?null:O(S,w,j,D,null);Us(S,j)}return null}function K(S,w,j,D,J){if(typeof D=="string"&&D!==""||typeof D=="number")return S=S.get(j)||null,m(w,S,""+D,J);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case R:return S=S.get(D.key===null?j:D.key)||null,v(w,S,D,J);case Q:return S=S.get(D.key===null?j:D.key)||null,E(w,S,D,J);case Ce:var ne=D._init;return K(S,w,j,ne(D._payload),J)}if(kt(D)||Z(D))return S=S.get(j)||null,O(w,S,D,J,null);Us(w,D)}return null}function G(S,w,j,D){for(var J=null,ne=null,re=w,se=w=0,We=null;re!==null&&se<j.length;se++){re.index>se?(We=re,re=null):We=re.sibling;var ye=A(S,re,j[se],D);if(ye===null){re===null&&(re=We);break}e&&re&&ye.alternate===null&&t(S,re),w=u(ye,w,se),ne===null?J=ye:ne.sibling=ye,ne=ye,re=We}if(se===j.length)return n(S,re),_e&&Dn(S,se),J;if(re===null){for(;se<j.length;se++)re=M(S,j[se],D),re!==null&&(w=u(re,w,se),ne===null?J=re:ne.sibling=re,ne=re);return _e&&Dn(S,se),J}for(re=s(S,re);se<j.length;se++)We=K(re,S,se,j[se],D),We!==null&&(e&&We.alternate!==null&&re.delete(We.key===null?se:We.key),w=u(We,w,se),ne===null?J=We:ne.sibling=We,ne=We);return e&&re.forEach(function(Rn){return t(S,Rn)}),_e&&Dn(S,se),J}function X(S,w,j,D){var J=Z(j);if(typeof J!="function")throw Error(l(150));if(j=J.call(j),j==null)throw Error(l(151));for(var ne=J=null,re=w,se=w=0,We=null,ye=j.next();re!==null&&!ye.done;se++,ye=j.next()){re.index>se?(We=re,re=null):We=re.sibling;var Rn=A(S,re,ye.value,D);if(Rn===null){re===null&&(re=We);break}e&&re&&Rn.alternate===null&&t(S,re),w=u(Rn,w,se),ne===null?J=Rn:ne.sibling=Rn,ne=Rn,re=We}if(ye.done)return n(S,re),_e&&Dn(S,se),J;if(re===null){for(;!ye.done;se++,ye=j.next())ye=M(S,ye.value,D),ye!==null&&(w=u(ye,w,se),ne===null?J=ye:ne.sibling=ye,ne=ye);return _e&&Dn(S,se),J}for(re=s(S,re);!ye.done;se++,ye=j.next())ye=K(re,S,se,ye.value,D),ye!==null&&(e&&ye.alternate!==null&&re.delete(ye.key===null?se:ye.key),w=u(ye,w,se),ne===null?J=ye:ne.sibling=ye,ne=ye);return e&&re.forEach(function(Zp){return t(S,Zp)}),_e&&Dn(S,se),J}function Me(S,w,j,D){if(typeof j=="object"&&j!==null&&j.type===te&&j.key===null&&(j=j.props.children),typeof j=="object"&&j!==null){switch(j.$$typeof){case R:e:{for(var J=j.key,ne=w;ne!==null;){if(ne.key===J){if(J=j.type,J===te){if(ne.tag===7){n(S,ne.sibling),w=a(ne,j.props.children),w.return=S,S=w;break e}}else if(ne.elementType===J||typeof J=="object"&&J!==null&&J.$$typeof===Ce&&jc(J)===ne.type){n(S,ne.sibling),w=a(ne,j.props),w.ref=Wr(S,ne,j),w.return=S,S=w;break e}n(S,ne);break}else t(S,ne);ne=ne.sibling}j.type===te?(w=Vn(j.props.children,S.mode,D,j.key),w.return=S,S=w):(D=po(j.type,j.key,j.props,null,S.mode,D),D.ref=Wr(S,w,j),D.return=S,S=D)}return f(S);case Q:e:{for(ne=j.key;w!==null;){if(w.key===ne)if(w.tag===4&&w.stateNode.containerInfo===j.containerInfo&&w.stateNode.implementation===j.implementation){n(S,w.sibling),w=a(w,j.children||[]),w.return=S,S=w;break e}else{n(S,w);break}else t(S,w);w=w.sibling}w=Ni(j,S.mode,D),w.return=S,S=w}return f(S);case Ce:return ne=j._init,Me(S,w,ne(j._payload),D)}if(kt(j))return G(S,w,j,D);if(Z(j))return X(S,w,j,D);Us(S,j)}return typeof j=="string"&&j!==""||typeof j=="number"?(j=""+j,w!==null&&w.tag===6?(n(S,w.sibling),w=a(w,j),w.return=S,S=w):(n(S,w),w=wi(j,S.mode,D),w.return=S,S=w),f(S)):n(S,w)}return Me}var ar=Cc(!0),Ec=Cc(!1),Hs=yn(null),Ws=null,cr=null,Tl=null;function Pl(){Tl=cr=Ws=null}function Ll(e){var t=Hs.current;je(Hs),e._currentValue=t}function Al(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function ur(e,t){Ws=e,Tl=cr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(ot=!0),e.firstContext=null)}function xt(e){var t=e._currentValue;if(Tl!==e)if(e={context:e,memoizedValue:t,next:null},cr===null){if(Ws===null)throw Error(l(308));cr=e,Ws.dependencies={lanes:0,firstContext:e}}else cr=cr.next=e;return t}var Fn=null;function Ol(e){Fn===null?Fn=[e]:Fn.push(e)}function _c(e,t,n,s){var a=t.interleaved;return a===null?(n.next=n,Ol(t)):(n.next=a.next,a.next=n),t.interleaved=n,Xt(e,s)}function Xt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Nn=!1;function Il(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Rc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Jt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function bn(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(ge&2)!==0){var a=s.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),s.pending=t,Xt(e,n)}return a=s.interleaved,a===null?(t.next=t,Ol(s)):(t.next=a.next,a.next=t),s.interleaved=t,Xt(e,n)}function Vs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Yo(e,n)}}function Tc(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var a=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var f={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};u===null?a=u=f:u=u.next=f,n=n.next}while(n!==null);u===null?a=u=t:u=u.next=t}else a=u=t;n={baseState:s.baseState,firstBaseUpdate:a,lastBaseUpdate:u,shared:s.shared,effects:s.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ks(e,t,n,s){var a=e.updateQueue;Nn=!1;var u=a.firstBaseUpdate,f=a.lastBaseUpdate,m=a.shared.pending;if(m!==null){a.shared.pending=null;var v=m,E=v.next;v.next=null,f===null?u=E:f.next=E,f=v;var O=e.alternate;O!==null&&(O=O.updateQueue,m=O.lastBaseUpdate,m!==f&&(m===null?O.firstBaseUpdate=E:m.next=E,O.lastBaseUpdate=v))}if(u!==null){var M=a.baseState;f=0,O=E=v=null,m=u;do{var A=m.lane,K=m.eventTime;if((s&A)===A){O!==null&&(O=O.next={eventTime:K,lane:0,tag:m.tag,payload:m.payload,callback:m.callback,next:null});e:{var G=e,X=m;switch(A=t,K=n,X.tag){case 1:if(G=X.payload,typeof G=="function"){M=G.call(K,M,A);break e}M=G;break e;case 3:G.flags=G.flags&-65537|128;case 0:if(G=X.payload,A=typeof G=="function"?G.call(K,M,A):G,A==null)break e;M=V({},M,A);break e;case 2:Nn=!0}}m.callback!==null&&m.lane!==0&&(e.flags|=64,A=a.effects,A===null?a.effects=[m]:A.push(m))}else K={eventTime:K,lane:A,tag:m.tag,payload:m.payload,callback:m.callback,next:null},O===null?(E=O=K,v=M):O=O.next=K,f|=A;if(m=m.next,m===null){if(m=a.shared.pending,m===null)break;A=m,m=A.next,A.next=null,a.lastBaseUpdate=A,a.shared.pending=null}}while(!0);if(O===null&&(v=M),a.baseState=v,a.firstBaseUpdate=E,a.lastBaseUpdate=O,t=a.shared.interleaved,t!==null){a=t;do f|=a.lane,a=a.next;while(a!==t)}else u===null&&(a.shared.lanes=0);$n|=f,e.lanes=f,e.memoizedState=M}}function Pc(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],a=s.callback;if(a!==null){if(s.callback=null,s=n,typeof a!="function")throw Error(l(191,a));a.call(s)}}}var Vr={},Dt=yn(Vr),Kr=yn(Vr),qr=yn(Vr);function Bn(e){if(e===Vr)throw Error(l(174));return e}function Ml(e,t){switch(ke(qr,t),ke(Kr,e),ke(Dt,Vr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Kt(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Kt(t,e)}je(Dt),ke(Dt,t)}function dr(){je(Dt),je(Kr),je(qr)}function Lc(e){Bn(qr.current);var t=Bn(Dt.current),n=Kt(t,e.type);t!==n&&(ke(Kr,e),ke(Dt,n))}function Dl(e){Kr.current===e&&(je(Dt),je(Kr))}var Te=yn(0);function qs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){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 Fl=[];function Bl(){for(var e=0;e<Fl.length;e++)Fl[e]._workInProgressVersionPrimary=null;Fl.length=0}var Qs=ee.ReactCurrentDispatcher,zl=ee.ReactCurrentBatchConfig,zn=0,Pe=null,ze=null,Ue=null,Ys=!1,Qr=!1,Yr=0,Np=0;function Ge(){throw Error(l(321))}function $l(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!jt(e[n],t[n]))return!1;return!0}function Ul(e,t,n,s,a,u){if(zn=u,Pe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Qs.current=e===null||e.memoizedState===null?jp:Cp,e=n(s,a),Qr){u=0;do{if(Qr=!1,Yr=0,25<=u)throw Error(l(301));u+=1,Ue=ze=null,t.updateQueue=null,Qs.current=Ep,e=n(s,a)}while(Qr)}if(Qs.current=Js,t=ze!==null&&ze.next!==null,zn=0,Ue=ze=Pe=null,Ys=!1,t)throw Error(l(300));return e}function Hl(){var e=Yr!==0;return Yr=0,e}function Ft(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ue===null?Pe.memoizedState=Ue=e:Ue=Ue.next=e,Ue}function yt(){if(ze===null){var e=Pe.alternate;e=e!==null?e.memoizedState:null}else e=ze.next;var t=Ue===null?Pe.memoizedState:Ue.next;if(t!==null)Ue=t,ze=e;else{if(e===null)throw Error(l(310));ze=e,e={memoizedState:ze.memoizedState,baseState:ze.baseState,baseQueue:ze.baseQueue,queue:ze.queue,next:null},Ue===null?Pe.memoizedState=Ue=e:Ue=Ue.next=e}return Ue}function Gr(e,t){return typeof t=="function"?t(e):t}function Wl(e){var t=yt(),n=t.queue;if(n===null)throw Error(l(311));n.lastRenderedReducer=e;var s=ze,a=s.baseQueue,u=n.pending;if(u!==null){if(a!==null){var f=a.next;a.next=u.next,u.next=f}s.baseQueue=a=u,n.pending=null}if(a!==null){u=a.next,s=s.baseState;var m=f=null,v=null,E=u;do{var O=E.lane;if((zn&O)===O)v!==null&&(v=v.next={lane:0,action:E.action,hasEagerState:E.hasEagerState,eagerState:E.eagerState,next:null}),s=E.hasEagerState?E.eagerState:e(s,E.action);else{var M={lane:O,action:E.action,hasEagerState:E.hasEagerState,eagerState:E.eagerState,next:null};v===null?(m=v=M,f=s):v=v.next=M,Pe.lanes|=O,$n|=O}E=E.next}while(E!==null&&E!==u);v===null?f=s:v.next=m,jt(s,t.memoizedState)||(ot=!0),t.memoizedState=s,t.baseState=f,t.baseQueue=v,n.lastRenderedState=s}if(e=n.interleaved,e!==null){a=e;do u=a.lane,Pe.lanes|=u,$n|=u,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Vl(e){var t=yt(),n=t.queue;if(n===null)throw Error(l(311));n.lastRenderedReducer=e;var s=n.dispatch,a=n.pending,u=t.memoizedState;if(a!==null){n.pending=null;var f=a=a.next;do u=e(u,f.action),f=f.next;while(f!==a);jt(u,t.memoizedState)||(ot=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,s]}function Ac(){}function Oc(e,t){var n=Pe,s=yt(),a=t(),u=!jt(s.memoizedState,a);if(u&&(s.memoizedState=a,ot=!0),s=s.queue,Kl(Dc.bind(null,n,s,e),[e]),s.getSnapshot!==t||u||Ue!==null&&Ue.memoizedState.tag&1){if(n.flags|=2048,Xr(9,Mc.bind(null,n,s,a,t),void 0,null),He===null)throw Error(l(349));(zn&30)!==0||Ic(n,t,a)}return a}function Ic(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Pe.updateQueue,t===null?(t={lastEffect:null,stores:null},Pe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Mc(e,t,n,s){t.value=n,t.getSnapshot=s,Fc(t)&&Bc(e)}function Dc(e,t,n){return n(function(){Fc(t)&&Bc(e)})}function Fc(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!jt(e,n)}catch{return!0}}function Bc(e){var t=Xt(e,1);t!==null&&Tt(t,e,1,-1)}function zc(e){var t=Ft();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Gr,lastRenderedState:e},t.queue=e,e=e.dispatch=Sp.bind(null,Pe,e),[t.memoizedState,e]}function Xr(e,t,n,s){return e={tag:e,create:t,destroy:n,deps:s,next:null},t=Pe.updateQueue,t===null?(t={lastEffect:null,stores:null},Pe.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e)),e}function $c(){return yt().memoizedState}function Gs(e,t,n,s){var a=Ft();Pe.flags|=e,a.memoizedState=Xr(1|t,n,void 0,s===void 0?null:s)}function Xs(e,t,n,s){var a=yt();s=s===void 0?null:s;var u=void 0;if(ze!==null){var f=ze.memoizedState;if(u=f.destroy,s!==null&&$l(s,f.deps)){a.memoizedState=Xr(t,n,u,s);return}}Pe.flags|=e,a.memoizedState=Xr(1|t,n,u,s)}function Uc(e,t){return Gs(8390656,8,e,t)}function Kl(e,t){return Xs(2048,8,e,t)}function Hc(e,t){return Xs(4,2,e,t)}function Wc(e,t){return Xs(4,4,e,t)}function Vc(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Kc(e,t,n){return n=n!=null?n.concat([e]):null,Xs(4,4,Vc.bind(null,t,e),n)}function ql(){}function qc(e,t){var n=yt();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&$l(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function Qc(e,t){var n=yt();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&$l(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function Yc(e,t,n){return(zn&21)===0?(e.baseState&&(e.baseState=!1,ot=!0),e.memoizedState=n):(jt(n,t)||(n=ja(),Pe.lanes|=n,$n|=n,e.baseState=!0),t)}function bp(e,t){var n=Ne;Ne=n!==0&&4>n?n:4,e(!0);var s=zl.transition;zl.transition={};try{e(!1),t()}finally{Ne=n,zl.transition=s}}function Gc(){return yt().memoizedState}function kp(e,t,n){var s=Cn(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},Xc(e))Jc(t,n);else if(n=_c(e,t,n,s),n!==null){var a=nt();Tt(n,e,s,a),Zc(n,t,s)}}function Sp(e,t,n){var s=Cn(e),a={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(Xc(e))Jc(t,a);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var f=t.lastRenderedState,m=u(f,n);if(a.hasEagerState=!0,a.eagerState=m,jt(m,f)){var v=t.interleaved;v===null?(a.next=a,Ol(t)):(a.next=v.next,v.next=a),t.interleaved=a;return}}catch{}finally{}n=_c(e,t,a,s),n!==null&&(a=nt(),Tt(n,e,s,a),Zc(n,t,s))}}function Xc(e){var t=e.alternate;return e===Pe||t!==null&&t===Pe}function Jc(e,t){Qr=Ys=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Zc(e,t,n){if((n&4194240)!==0){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Yo(e,n)}}var Js={readContext:xt,useCallback:Ge,useContext:Ge,useEffect:Ge,useImperativeHandle:Ge,useInsertionEffect:Ge,useLayoutEffect:Ge,useMemo:Ge,useReducer:Ge,useRef:Ge,useState:Ge,useDebugValue:Ge,useDeferredValue:Ge,useTransition:Ge,useMutableSource:Ge,useSyncExternalStore:Ge,useId:Ge,unstable_isNewReconciler:!1},jp={readContext:xt,useCallback:function(e,t){return Ft().memoizedState=[e,t===void 0?null:t],e},useContext:xt,useEffect:Uc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Gs(4194308,4,Vc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gs(4194308,4,e,t)},useInsertionEffect:function(e,t){return Gs(4,2,e,t)},useMemo:function(e,t){var n=Ft();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=Ft();return t=n!==void 0?n(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=kp.bind(null,Pe,e),[s.memoizedState,e]},useRef:function(e){var t=Ft();return e={current:e},t.memoizedState=e},useState:zc,useDebugValue:ql,useDeferredValue:function(e){return Ft().memoizedState=e},useTransition:function(){var e=zc(!1),t=e[0];return e=bp.bind(null,e[1]),Ft().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=Pe,a=Ft();if(_e){if(n===void 0)throw Error(l(407));n=n()}else{if(n=t(),He===null)throw Error(l(349));(zn&30)!==0||Ic(s,t,n)}a.memoizedState=n;var u={value:n,getSnapshot:t};return a.queue=u,Uc(Dc.bind(null,s,u,e),[e]),s.flags|=2048,Xr(9,Mc.bind(null,s,u,n,t),void 0,null),n},useId:function(){var e=Ft(),t=He.identifierPrefix;if(_e){var n=Gt,s=Yt;n=(s&~(1<<32-St(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=Yr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Np++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Cp={readContext:xt,useCallback:qc,useContext:xt,useEffect:Kl,useImperativeHandle:Kc,useInsertionEffect:Hc,useLayoutEffect:Wc,useMemo:Qc,useReducer:Wl,useRef:$c,useState:function(){return Wl(Gr)},useDebugValue:ql,useDeferredValue:function(e){var t=yt();return Yc(t,ze.memoizedState,e)},useTransition:function(){var e=Wl(Gr)[0],t=yt().memoizedState;return[e,t]},useMutableSource:Ac,useSyncExternalStore:Oc,useId:Gc,unstable_isNewReconciler:!1},Ep={readContext:xt,useCallback:qc,useContext:xt,useEffect:Kl,useImperativeHandle:Kc,useInsertionEffect:Hc,useLayoutEffect:Wc,useMemo:Qc,useReducer:Vl,useRef:$c,useState:function(){return Vl(Gr)},useDebugValue:ql,useDeferredValue:function(e){var t=yt();return ze===null?t.memoizedState=e:Yc(t,ze.memoizedState,e)},useTransition:function(){var e=Vl(Gr)[0],t=yt().memoizedState;return[e,t]},useMutableSource:Ac,useSyncExternalStore:Oc,useId:Gc,unstable_isNewReconciler:!1};function Et(e,t){if(e&&e.defaultProps){t=V({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ql(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:V({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Zs={isMounted:function(e){return(e=e._reactInternals)?An(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=nt(),a=Cn(e),u=Jt(s,a);u.payload=t,n!=null&&(u.callback=n),t=bn(e,u,a),t!==null&&(Tt(t,e,a,s),Vs(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=nt(),a=Cn(e),u=Jt(s,a);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=bn(e,u,a),t!==null&&(Tt(t,e,a,s),Vs(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=nt(),s=Cn(e),a=Jt(n,s);a.tag=2,t!=null&&(a.callback=t),t=bn(e,a,s),t!==null&&(Tt(t,e,s,n),Vs(t,e,s))}};function eu(e,t,n,s,a,u,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,u,f):t.prototype&&t.prototype.isPureReactComponent?!Dr(n,s)||!Dr(a,u):!0}function tu(e,t,n){var s=!1,a=vn,u=t.contextType;return typeof u=="object"&&u!==null?u=xt(u):(a=st(t)?In:Ye.current,s=t.contextTypes,u=(s=s!=null)?sr(e,a):vn),t=new t(n,u),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Zs,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=u),t}function nu(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&Zs.enqueueReplaceState(t,t.state,null)}function Yl(e,t,n,s){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},Il(e);var u=t.contextType;typeof u=="object"&&u!==null?a.context=xt(u):(u=st(t)?In:Ye.current,a.context=sr(e,u)),a.state=e.memoizedState,u=t.getDerivedStateFromProps,typeof u=="function"&&(Ql(e,t,u,n),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&Zs.enqueueReplaceState(a,a.state,null),Ks(e,n,a,s),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function fr(e,t){try{var n="",s=t;do n+=de(s),s=s.return;while(s);var a=n}catch(u){a=`
39
+ Error generating stack: `+u.message+`
40
+ `+u.stack}return{value:e,source:t,stack:a,digest:null}}function Gl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Xl(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var _p=typeof WeakMap=="function"?WeakMap:Map;function ru(e,t,n){n=Jt(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){lo||(lo=!0,fi=s),Xl(e,t)},n}function su(e,t,n){n=Jt(-1,n),n.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var a=t.value;n.payload=function(){return s(a)},n.callback=function(){Xl(e,t)}}var u=e.stateNode;return u!==null&&typeof u.componentDidCatch=="function"&&(n.callback=function(){Xl(e,t),typeof s!="function"&&(Sn===null?Sn=new Set([this]):Sn.add(this));var f=t.stack;this.componentDidCatch(t.value,{componentStack:f!==null?f:""})}),n}function ou(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new _p;var a=new Set;s.set(t,a)}else a=s.get(t),a===void 0&&(a=new Set,s.set(t,a));a.has(n)||(a.add(n),e=Up.bind(null,e,t,n),t.then(e,e))}function lu(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function iu(e,t,n,s,a){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Jt(-1,1),t.tag=2,bn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=a,e)}var Rp=ee.ReactCurrentOwner,ot=!1;function tt(e,t,n,s){t.child=e===null?Ec(t,null,n,s):ar(t,e.child,n,s)}function au(e,t,n,s,a){n=n.render;var u=t.ref;return ur(t,a),s=Ul(e,t,n,s,u,a),n=Hl(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Zt(e,t,a)):(_e&&n&&jl(t),t.flags|=1,tt(e,t,s,a),t.child)}function cu(e,t,n,s,a){if(e===null){var u=n.type;return typeof u=="function"&&!vi(u)&&u.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=u,uu(e,t,u,s,a)):(e=po(n.type,null,s,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,(e.lanes&a)===0){var f=u.memoizedProps;if(n=n.compare,n=n!==null?n:Dr,n(f,s)&&e.ref===t.ref)return Zt(e,t,a)}return t.flags|=1,e=_n(u,s),e.ref=t.ref,e.return=t,t.child=e}function uu(e,t,n,s,a){if(e!==null){var u=e.memoizedProps;if(Dr(u,s)&&e.ref===t.ref)if(ot=!1,t.pendingProps=s=u,(e.lanes&a)!==0)(e.flags&131072)!==0&&(ot=!0);else return t.lanes=e.lanes,Zt(e,t,a)}return Jl(e,t,n,s,a)}function du(e,t,n){var s=t.pendingProps,a=s.children,u=e!==null?e.memoizedState:null;if(s.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ke(hr,ft),ft|=n;else{if((n&1073741824)===0)return e=u!==null?u.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ke(hr,ft),ft|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=u!==null?u.baseLanes:n,ke(hr,ft),ft|=s}else u!==null?(s=u.baseLanes|n,t.memoizedState=null):s=n,ke(hr,ft),ft|=s;return tt(e,t,a,n),t.child}function fu(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Jl(e,t,n,s,a){var u=st(n)?In:Ye.current;return u=sr(t,u),ur(t,a),n=Ul(e,t,n,s,u,a),s=Hl(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Zt(e,t,a)):(_e&&s&&jl(t),t.flags|=1,tt(e,t,n,a),t.child)}function pu(e,t,n,s,a){if(st(n)){var u=!0;Ds(t)}else u=!1;if(ur(t,a),t.stateNode===null)to(e,t),tu(t,n,s),Yl(t,n,s,a),s=!0;else if(e===null){var f=t.stateNode,m=t.memoizedProps;f.props=m;var v=f.context,E=n.contextType;typeof E=="object"&&E!==null?E=xt(E):(E=st(n)?In:Ye.current,E=sr(t,E));var O=n.getDerivedStateFromProps,M=typeof O=="function"||typeof f.getSnapshotBeforeUpdate=="function";M||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(m!==s||v!==E)&&nu(t,f,s,E),Nn=!1;var A=t.memoizedState;f.state=A,Ks(t,s,f,a),v=t.memoizedState,m!==s||A!==v||rt.current||Nn?(typeof O=="function"&&(Ql(t,n,O,s),v=t.memoizedState),(m=Nn||eu(t,n,m,s,A,v,E))?(M||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=v),f.props=s,f.state=v,f.context=E,s=m):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{f=t.stateNode,Rc(e,t),m=t.memoizedProps,E=t.type===t.elementType?m:Et(t.type,m),f.props=E,M=t.pendingProps,A=f.context,v=n.contextType,typeof v=="object"&&v!==null?v=xt(v):(v=st(n)?In:Ye.current,v=sr(t,v));var K=n.getDerivedStateFromProps;(O=typeof K=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(m!==M||A!==v)&&nu(t,f,s,v),Nn=!1,A=t.memoizedState,f.state=A,Ks(t,s,f,a);var G=t.memoizedState;m!==M||A!==G||rt.current||Nn?(typeof K=="function"&&(Ql(t,n,K,s),G=t.memoizedState),(E=Nn||eu(t,n,E,s,A,G,v)||!1)?(O||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(s,G,v),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(s,G,v)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||m===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=G),f.props=s,f.state=G,f.context=v,s=E):(typeof f.componentDidUpdate!="function"||m===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||m===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),s=!1)}return Zl(e,t,n,s,u,a)}function Zl(e,t,n,s,a,u){fu(e,t);var f=(t.flags&128)!==0;if(!s&&!f)return a&&yc(t,n,!1),Zt(e,t,u);s=t.stateNode,Rp.current=t;var m=f&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&f?(t.child=ar(t,e.child,null,u),t.child=ar(t,null,m,u)):tt(e,t,m,u),t.memoizedState=s.state,a&&yc(t,n,!0),t.child}function hu(e){var t=e.stateNode;t.pendingContext?gc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&gc(e,t.context,!1),Ml(e,t.containerInfo)}function mu(e,t,n,s,a){return ir(),Rl(a),t.flags|=256,tt(e,t,n,s),t.child}var ei={dehydrated:null,treeContext:null,retryLane:0};function ti(e){return{baseLanes:e,cachePool:null,transitions:null}}function gu(e,t,n){var s=t.pendingProps,a=Te.current,u=!1,f=(t.flags&128)!==0,m;if((m=f)||(m=e!==null&&e.memoizedState===null?!1:(a&2)!==0),m?(u=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),ke(Te,a&1),e===null)return _l(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(f=s.children,e=s.fallback,u?(s=t.mode,u=t.child,f={mode:"hidden",children:f},(s&1)===0&&u!==null?(u.childLanes=0,u.pendingProps=f):u=ho(f,s,0,null),e=Vn(e,s,n,null),u.return=t,e.return=t,u.sibling=e,t.child=u,t.child.memoizedState=ti(n),t.memoizedState=ei,e):ni(t,f));if(a=e.memoizedState,a!==null&&(m=a.dehydrated,m!==null))return Tp(e,t,f,s,m,a,n);if(u){u=s.fallback,f=t.mode,a=e.child,m=a.sibling;var v={mode:"hidden",children:s.children};return(f&1)===0&&t.child!==a?(s=t.child,s.childLanes=0,s.pendingProps=v,t.deletions=null):(s=_n(a,v),s.subtreeFlags=a.subtreeFlags&14680064),m!==null?u=_n(m,u):(u=Vn(u,f,n,null),u.flags|=2),u.return=t,s.return=t,s.sibling=u,t.child=s,s=u,u=t.child,f=e.child.memoizedState,f=f===null?ti(n):{baseLanes:f.baseLanes|n,cachePool:null,transitions:f.transitions},u.memoizedState=f,u.childLanes=e.childLanes&~n,t.memoizedState=ei,s}return u=e.child,e=u.sibling,s=_n(u,{mode:"visible",children:s.children}),(t.mode&1)===0&&(s.lanes=n),s.return=t,s.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=s,t.memoizedState=null,s}function ni(e,t){return t=ho({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function eo(e,t,n,s){return s!==null&&Rl(s),ar(t,e.child,null,n),e=ni(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Tp(e,t,n,s,a,u,f){if(n)return t.flags&256?(t.flags&=-257,s=Gl(Error(l(422))),eo(e,t,f,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(u=s.fallback,a=t.mode,s=ho({mode:"visible",children:s.children},a,0,null),u=Vn(u,a,f,null),u.flags|=2,s.return=t,u.return=t,s.sibling=u,t.child=s,(t.mode&1)!==0&&ar(t,e.child,null,f),t.child.memoizedState=ti(f),t.memoizedState=ei,u);if((t.mode&1)===0)return eo(e,t,f,null);if(a.data==="$!"){if(s=a.nextSibling&&a.nextSibling.dataset,s)var m=s.dgst;return s=m,u=Error(l(419)),s=Gl(u,s,void 0),eo(e,t,f,s)}if(m=(f&e.childLanes)!==0,ot||m){if(s=He,s!==null){switch(f&-f){case 4:a=2;break;case 16:a=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(s.suspendedLanes|f))!==0?0:a,a!==0&&a!==u.retryLane&&(u.retryLane=a,Xt(e,a),Tt(s,e,a,-1))}return yi(),s=Gl(Error(l(421))),eo(e,t,f,s)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=Hp.bind(null,e),a._reactRetry=t,null):(e=u.treeContext,dt=xn(a.nextSibling),ut=t,_e=!0,Ct=null,e!==null&&(mt[gt++]=Yt,mt[gt++]=Gt,mt[gt++]=Mn,Yt=e.id,Gt=e.overflow,Mn=t),t=ni(t,s.children),t.flags|=4096,t)}function xu(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Al(e.return,t,n)}function ri(e,t,n,s,a){var u=e.memoizedState;u===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:a}:(u.isBackwards=t,u.rendering=null,u.renderingStartTime=0,u.last=s,u.tail=n,u.tailMode=a)}function yu(e,t,n){var s=t.pendingProps,a=s.revealOrder,u=s.tail;if(tt(e,t,s.children,n),s=Te.current,(s&2)!==0)s=s&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xu(e,n,t);else if(e.tag===19)xu(e,n,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}s&=1}if(ke(Te,s),(t.mode&1)===0)t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&qs(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),ri(t,!1,a,n,u);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&qs(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}ri(t,!0,n,null,u);break;case"together":ri(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function to(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Zt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),$n|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,n=_n(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=_n(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Pp(e,t,n){switch(t.tag){case 3:hu(t),ir();break;case 5:Lc(t);break;case 1:st(t.type)&&Ds(t);break;case 4:Ml(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,a=t.memoizedProps.value;ke(Hs,s._currentValue),s._currentValue=a;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(ke(Te,Te.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?gu(e,t,n):(ke(Te,Te.current&1),e=Zt(e,t,n),e!==null?e.sibling:null);ke(Te,Te.current&1);break;case 19:if(s=(n&t.childLanes)!==0,(e.flags&128)!==0){if(s)return yu(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),ke(Te,Te.current),s)break;return null;case 22:case 23:return t.lanes=0,du(e,t,n)}return Zt(e,t,n)}var vu,si,wu,Nu;vu=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},si=function(){},wu=function(e,t,n,s){var a=e.memoizedProps;if(a!==s){e=t.stateNode,Bn(Dt.current);var u=null;switch(n){case"input":a=et(e,a),s=et(e,s),u=[];break;case"select":a=V({},a,{value:void 0}),s=V({},s,{value:void 0}),u=[];break;case"textarea":a=Vt(e,a),s=Vt(e,s),u=[];break;default:typeof a.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=Os)}Fo(n,s);var f;n=null;for(E in a)if(!s.hasOwnProperty(E)&&a.hasOwnProperty(E)&&a[E]!=null)if(E==="style"){var m=a[E];for(f in m)m.hasOwnProperty(f)&&(n||(n={}),n[f]="")}else E!=="dangerouslySetInnerHTML"&&E!=="children"&&E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&E!=="autoFocus"&&(d.hasOwnProperty(E)?u||(u=[]):(u=u||[]).push(E,null));for(E in s){var v=s[E];if(m=a!=null?a[E]:void 0,s.hasOwnProperty(E)&&v!==m&&(v!=null||m!=null))if(E==="style")if(m){for(f in m)!m.hasOwnProperty(f)||v&&v.hasOwnProperty(f)||(n||(n={}),n[f]="");for(f in v)v.hasOwnProperty(f)&&m[f]!==v[f]&&(n||(n={}),n[f]=v[f])}else n||(u||(u=[]),u.push(E,n)),n=v;else E==="dangerouslySetInnerHTML"?(v=v?v.__html:void 0,m=m?m.__html:void 0,v!=null&&m!==v&&(u=u||[]).push(E,v)):E==="children"?typeof v!="string"&&typeof v!="number"||(u=u||[]).push(E,""+v):E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&(d.hasOwnProperty(E)?(v!=null&&E==="onScroll"&&Se("scroll",e),u||m===v||(u=[])):(u=u||[]).push(E,v))}n&&(u=u||[]).push("style",n);var E=u;(t.updateQueue=E)&&(t.flags|=4)}},Nu=function(e,t,n,s){n!==s&&(t.flags|=4)};function Jr(e,t){if(!_e)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Xe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,s|=a.subtreeFlags&14680064,s|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,s|=a.subtreeFlags,s|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function Lp(e,t,n){var s=t.pendingProps;switch(Cl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(t),null;case 1:return st(t.type)&&Ms(),Xe(t),null;case 3:return s=t.stateNode,dr(),je(rt),je(Ye),Bl(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&($s(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ct!==null&&(mi(Ct),Ct=null))),si(e,t),Xe(t),null;case 5:Dl(t);var a=Bn(qr.current);if(n=t.type,e!==null&&t.stateNode!=null)wu(e,t,n,s,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(l(166));return Xe(t),null}if(e=Bn(Dt.current),$s(t)){s=t.stateNode,n=t.type;var u=t.memoizedProps;switch(s[Mt]=t,s[Ur]=u,e=(t.mode&1)!==0,n){case"dialog":Se("cancel",s),Se("close",s);break;case"iframe":case"object":case"embed":Se("load",s);break;case"video":case"audio":for(a=0;a<Br.length;a++)Se(Br[a],s);break;case"source":Se("error",s);break;case"img":case"image":case"link":Se("error",s),Se("load",s);break;case"details":Se("toggle",s);break;case"input":Ee(s,u),Se("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!u.multiple},Se("invalid",s);break;case"textarea":sn(s,u),Se("invalid",s)}Fo(n,u),a=null;for(var f in u)if(u.hasOwnProperty(f)){var m=u[f];f==="children"?typeof m=="string"?s.textContent!==m&&(u.suppressHydrationWarning!==!0&&As(s.textContent,m,e),a=["children",m]):typeof m=="number"&&s.textContent!==""+m&&(u.suppressHydrationWarning!==!0&&As(s.textContent,m,e),a=["children",""+m]):d.hasOwnProperty(f)&&m!=null&&f==="onScroll"&&Se("scroll",s)}switch(n){case"input":q(s),rn(s,u,!0);break;case"textarea":q(s),ln(s);break;case"select":case"option":break;default:typeof u.onClick=="function"&&(s.onclick=Os)}s=a,t.updateQueue=s,s!==null&&(t.flags|=4)}else{f=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=an(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=f.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=f.createElement(n,{is:s.is}):(e=f.createElement(n),n==="select"&&(f=e,s.multiple?f.multiple=!0:s.size&&(f.size=s.size))):e=f.createElementNS(e,n),e[Mt]=t,e[Ur]=s,vu(e,t,!1,!1),t.stateNode=e;e:{switch(f=Bo(n,s),n){case"dialog":Se("cancel",e),Se("close",e),a=s;break;case"iframe":case"object":case"embed":Se("load",e),a=s;break;case"video":case"audio":for(a=0;a<Br.length;a++)Se(Br[a],e);a=s;break;case"source":Se("error",e),a=s;break;case"img":case"image":case"link":Se("error",e),Se("load",e),a=s;break;case"details":Se("toggle",e),a=s;break;case"input":Ee(e,s),a=et(e,s),Se("invalid",e);break;case"option":a=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},a=V({},s,{value:void 0}),Se("invalid",e);break;case"textarea":sn(e,s),a=Vt(e,s),Se("invalid",e);break;default:a=s}Fo(n,a),m=a;for(u in m)if(m.hasOwnProperty(u)){var v=m[u];u==="style"?ua(e,v):u==="dangerouslySetInnerHTML"?(v=v?v.__html:void 0,v!=null&&cn(e,v)):u==="children"?typeof v=="string"?(n!=="textarea"||v!=="")&&un(e,v):typeof v=="number"&&un(e,""+v):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(d.hasOwnProperty(u)?v!=null&&u==="onScroll"&&Se("scroll",e):v!=null&&$(e,u,v,f))}switch(n){case"input":q(e),rn(e,s,!1);break;case"textarea":q(e),ln(e);break;case"option":s.value!=null&&e.setAttribute("value",""+pe(s.value));break;case"select":e.multiple=!!s.multiple,u=s.value,u!=null?ht(e,!!s.multiple,u,!1):s.defaultValue!=null&&ht(e,!!s.multiple,s.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=Os)}switch(n){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Xe(t),null;case 6:if(e&&t.stateNode!=null)Nu(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(l(166));if(n=Bn(qr.current),Bn(Dt.current),$s(t)){if(s=t.stateNode,n=t.memoizedProps,s[Mt]=t,(u=s.nodeValue!==n)&&(e=ut,e!==null))switch(e.tag){case 3:As(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&As(s.nodeValue,n,(e.mode&1)!==0)}u&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[Mt]=t,t.stateNode=s}return Xe(t),null;case 13:if(je(Te),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(_e&&dt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Sc(),ir(),t.flags|=98560,u=!1;else if(u=$s(t),s!==null&&s.dehydrated!==null){if(e===null){if(!u)throw Error(l(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(l(317));u[Mt]=t}else ir(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Xe(t),u=!1}else Ct!==null&&(mi(Ct),Ct=null),u=!0;if(!u)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Te.current&1)!==0?$e===0&&($e=3):yi())),t.updateQueue!==null&&(t.flags|=4),Xe(t),null);case 4:return dr(),si(e,t),e===null&&zr(t.stateNode.containerInfo),Xe(t),null;case 10:return Ll(t.type._context),Xe(t),null;case 17:return st(t.type)&&Ms(),Xe(t),null;case 19:if(je(Te),u=t.memoizedState,u===null)return Xe(t),null;if(s=(t.flags&128)!==0,f=u.rendering,f===null)if(s)Jr(u,!1);else{if($e!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=qs(e),f!==null){for(t.flags|=128,Jr(u,!1),s=f.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=n,n=t.child;n!==null;)u=n,e=s,u.flags&=14680066,f=u.alternate,f===null?(u.childLanes=0,u.lanes=e,u.child=null,u.subtreeFlags=0,u.memoizedProps=null,u.memoizedState=null,u.updateQueue=null,u.dependencies=null,u.stateNode=null):(u.childLanes=f.childLanes,u.lanes=f.lanes,u.child=f.child,u.subtreeFlags=0,u.deletions=null,u.memoizedProps=f.memoizedProps,u.memoizedState=f.memoizedState,u.updateQueue=f.updateQueue,u.type=f.type,e=f.dependencies,u.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ke(Te,Te.current&1|2),t.child}e=e.sibling}u.tail!==null&&Ie()>mr&&(t.flags|=128,s=!0,Jr(u,!1),t.lanes=4194304)}else{if(!s)if(e=qs(f),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Jr(u,!0),u.tail===null&&u.tailMode==="hidden"&&!f.alternate&&!_e)return Xe(t),null}else 2*Ie()-u.renderingStartTime>mr&&n!==1073741824&&(t.flags|=128,s=!0,Jr(u,!1),t.lanes=4194304);u.isBackwards?(f.sibling=t.child,t.child=f):(n=u.last,n!==null?n.sibling=f:t.child=f,u.last=f)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=Ie(),t.sibling=null,n=Te.current,ke(Te,s?n&1|2:n&1),t):(Xe(t),null);case 22:case 23:return xi(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&(t.mode&1)!==0?(ft&1073741824)!==0&&(Xe(t),t.subtreeFlags&6&&(t.flags|=8192)):Xe(t),null;case 24:return null;case 25:return null}throw Error(l(156,t.tag))}function Ap(e,t){switch(Cl(t),t.tag){case 1:return st(t.type)&&Ms(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return dr(),je(rt),je(Ye),Bl(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Dl(t),null;case 13:if(je(Te),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));ir()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return je(Te),null;case 4:return dr(),null;case 10:return Ll(t.type._context),null;case 22:case 23:return xi(),null;case 24:return null;default:return null}}var no=!1,Je=!1,Op=typeof WeakSet=="function"?WeakSet:Set,Y=null;function pr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){Oe(e,t,s)}else n.current=null}function oi(e,t,n){try{n()}catch(s){Oe(e,t,s)}}var bu=!1;function Ip(e,t){if(xl=bs,e=ec(),cl(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var a=s.anchorOffset,u=s.focusNode;s=s.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var f=0,m=-1,v=-1,E=0,O=0,M=e,A=null;t:for(;;){for(var K;M!==n||a!==0&&M.nodeType!==3||(m=f+a),M!==u||s!==0&&M.nodeType!==3||(v=f+s),M.nodeType===3&&(f+=M.nodeValue.length),(K=M.firstChild)!==null;)A=M,M=K;for(;;){if(M===e)break t;if(A===n&&++E===a&&(m=f),A===u&&++O===s&&(v=f),(K=M.nextSibling)!==null)break;M=A,A=M.parentNode}M=K}n=m===-1||v===-1?null:{start:m,end:v}}else n=null}n=n||{start:0,end:0}}else n=null;for(yl={focusedElem:e,selectionRange:n},bs=!1,Y=t;Y!==null;)if(t=Y,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Y=e;else for(;Y!==null;){t=Y;try{var G=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(G!==null){var X=G.memoizedProps,Me=G.memoizedState,S=t.stateNode,w=S.getSnapshotBeforeUpdate(t.elementType===t.type?X:Et(t.type,X),Me);S.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var j=t.stateNode.containerInfo;j.nodeType===1?j.textContent="":j.nodeType===9&&j.documentElement&&j.removeChild(j.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(D){Oe(t,t.return,D)}if(e=t.sibling,e!==null){e.return=t.return,Y=e;break}Y=t.return}return G=bu,bu=!1,G}function Zr(e,t,n){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var a=s=s.next;do{if((a.tag&e)===e){var u=a.destroy;a.destroy=void 0,u!==void 0&&oi(t,n,u)}a=a.next}while(a!==s)}}function ro(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var s=n.create;n.destroy=s()}n=n.next}while(n!==t)}}function li(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function ku(e){var t=e.alternate;t!==null&&(e.alternate=null,ku(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Mt],delete t[Ur],delete t[bl],delete t[xp],delete t[yp])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Su(e){return e.tag===5||e.tag===3||e.tag===4}function ju(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Su(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.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 ii(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Os));else if(s!==4&&(e=e.child,e!==null))for(ii(e,t,n),e=e.sibling;e!==null;)ii(e,t,n),e=e.sibling}function ai(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(ai(e,t,n),e=e.sibling;e!==null;)ai(e,t,n),e=e.sibling}var qe=null,_t=!1;function kn(e,t,n){for(n=n.child;n!==null;)Cu(e,t,n),n=n.sibling}function Cu(e,t,n){if(It&&typeof It.onCommitFiberUnmount=="function")try{It.onCommitFiberUnmount(gs,n)}catch{}switch(n.tag){case 5:Je||pr(n,t);case 6:var s=qe,a=_t;qe=null,kn(e,t,n),qe=s,_t=a,qe!==null&&(_t?(e=qe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):qe.removeChild(n.stateNode));break;case 18:qe!==null&&(_t?(e=qe,n=n.stateNode,e.nodeType===8?Nl(e.parentNode,n):e.nodeType===1&&Nl(e,n),Pr(e)):Nl(qe,n.stateNode));break;case 4:s=qe,a=_t,qe=n.stateNode.containerInfo,_t=!0,kn(e,t,n),qe=s,_t=a;break;case 0:case 11:case 14:case 15:if(!Je&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){a=s=s.next;do{var u=a,f=u.destroy;u=u.tag,f!==void 0&&((u&2)!==0||(u&4)!==0)&&oi(n,t,f),a=a.next}while(a!==s)}kn(e,t,n);break;case 1:if(!Je&&(pr(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(m){Oe(n,t,m)}kn(e,t,n);break;case 21:kn(e,t,n);break;case 22:n.mode&1?(Je=(s=Je)||n.memoizedState!==null,kn(e,t,n),Je=s):kn(e,t,n);break;default:kn(e,t,n)}}function Eu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Op),t.forEach(function(s){var a=Wp.bind(null,e,s);n.has(s)||(n.add(s),s.then(a,a))})}}function Rt(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var a=n[s];try{var u=e,f=t,m=f;e:for(;m!==null;){switch(m.tag){case 5:qe=m.stateNode,_t=!1;break e;case 3:qe=m.stateNode.containerInfo,_t=!0;break e;case 4:qe=m.stateNode.containerInfo,_t=!0;break e}m=m.return}if(qe===null)throw Error(l(160));Cu(u,f,a),qe=null,_t=!1;var v=a.alternate;v!==null&&(v.return=null),a.return=null}catch(E){Oe(a,t,E)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)_u(t,e),t=t.sibling}function _u(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Rt(t,e),Bt(e),s&4){try{Zr(3,e,e.return),ro(3,e)}catch(X){Oe(e,e.return,X)}try{Zr(5,e,e.return)}catch(X){Oe(e,e.return,X)}}break;case 1:Rt(t,e),Bt(e),s&512&&n!==null&&pr(n,n.return);break;case 5:if(Rt(t,e),Bt(e),s&512&&n!==null&&pr(n,n.return),e.flags&32){var a=e.stateNode;try{un(a,"")}catch(X){Oe(e,e.return,X)}}if(s&4&&(a=e.stateNode,a!=null)){var u=e.memoizedProps,f=n!==null?n.memoizedProps:u,m=e.type,v=e.updateQueue;if(e.updateQueue=null,v!==null)try{m==="input"&&u.type==="radio"&&u.name!=null&&At(a,u),Bo(m,f);var E=Bo(m,u);for(f=0;f<v.length;f+=2){var O=v[f],M=v[f+1];O==="style"?ua(a,M):O==="dangerouslySetInnerHTML"?cn(a,M):O==="children"?un(a,M):$(a,O,M,E)}switch(m){case"input":pt(a,u);break;case"textarea":on(a,u);break;case"select":var A=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!u.multiple;var K=u.value;K!=null?ht(a,!!u.multiple,K,!1):A!==!!u.multiple&&(u.defaultValue!=null?ht(a,!!u.multiple,u.defaultValue,!0):ht(a,!!u.multiple,u.multiple?[]:"",!1))}a[Ur]=u}catch(X){Oe(e,e.return,X)}}break;case 6:if(Rt(t,e),Bt(e),s&4){if(e.stateNode===null)throw Error(l(162));a=e.stateNode,u=e.memoizedProps;try{a.nodeValue=u}catch(X){Oe(e,e.return,X)}}break;case 3:if(Rt(t,e),Bt(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{Pr(t.containerInfo)}catch(X){Oe(e,e.return,X)}break;case 4:Rt(t,e),Bt(e);break;case 13:Rt(t,e),Bt(e),a=e.child,a.flags&8192&&(u=a.memoizedState!==null,a.stateNode.isHidden=u,!u||a.alternate!==null&&a.alternate.memoizedState!==null||(di=Ie())),s&4&&Eu(e);break;case 22:if(O=n!==null&&n.memoizedState!==null,e.mode&1?(Je=(E=Je)||O,Rt(t,e),Je=E):Rt(t,e),Bt(e),s&8192){if(E=e.memoizedState!==null,(e.stateNode.isHidden=E)&&!O&&(e.mode&1)!==0)for(Y=e,O=e.child;O!==null;){for(M=Y=O;Y!==null;){switch(A=Y,K=A.child,A.tag){case 0:case 11:case 14:case 15:Zr(4,A,A.return);break;case 1:pr(A,A.return);var G=A.stateNode;if(typeof G.componentWillUnmount=="function"){s=A,n=A.return;try{t=s,G.props=t.memoizedProps,G.state=t.memoizedState,G.componentWillUnmount()}catch(X){Oe(s,n,X)}}break;case 5:pr(A,A.return);break;case 22:if(A.memoizedState!==null){Pu(M);continue}}K!==null?(K.return=A,Y=K):Pu(M)}O=O.sibling}e:for(O=null,M=e;;){if(M.tag===5){if(O===null){O=M;try{a=M.stateNode,E?(u=a.style,typeof u.setProperty=="function"?u.setProperty("display","none","important"):u.display="none"):(m=M.stateNode,v=M.memoizedProps.style,f=v!=null&&v.hasOwnProperty("display")?v.display:null,m.style.display=ca("display",f))}catch(X){Oe(e,e.return,X)}}}else if(M.tag===6){if(O===null)try{M.stateNode.nodeValue=E?"":M.memoizedProps}catch(X){Oe(e,e.return,X)}}else if((M.tag!==22&&M.tag!==23||M.memoizedState===null||M===e)&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===e)break e;for(;M.sibling===null;){if(M.return===null||M.return===e)break e;O===M&&(O=null),M=M.return}O===M&&(O=null),M.sibling.return=M.return,M=M.sibling}}break;case 19:Rt(t,e),Bt(e),s&4&&Eu(e);break;case 21:break;default:Rt(t,e),Bt(e)}}function Bt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Su(n)){var s=n;break e}n=n.return}throw Error(l(160))}switch(s.tag){case 5:var a=s.stateNode;s.flags&32&&(un(a,""),s.flags&=-33);var u=ju(e);ai(e,u,a);break;case 3:case 4:var f=s.stateNode.containerInfo,m=ju(e);ii(e,m,f);break;default:throw Error(l(161))}}catch(v){Oe(e,e.return,v)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mp(e,t,n){Y=e,Ru(e)}function Ru(e,t,n){for(var s=(e.mode&1)!==0;Y!==null;){var a=Y,u=a.child;if(a.tag===22&&s){var f=a.memoizedState!==null||no;if(!f){var m=a.alternate,v=m!==null&&m.memoizedState!==null||Je;m=no;var E=Je;if(no=f,(Je=v)&&!E)for(Y=a;Y!==null;)f=Y,v=f.child,f.tag===22&&f.memoizedState!==null?Lu(a):v!==null?(v.return=f,Y=v):Lu(a);for(;u!==null;)Y=u,Ru(u),u=u.sibling;Y=a,no=m,Je=E}Tu(e)}else(a.subtreeFlags&8772)!==0&&u!==null?(u.return=a,Y=u):Tu(e)}}function Tu(e){for(;Y!==null;){var t=Y;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Je||ro(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!Je)if(n===null)s.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Et(t.type,n.memoizedProps);s.componentDidUpdate(a,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var u=t.updateQueue;u!==null&&Pc(t,u,s);break;case 3:var f=t.updateQueue;if(f!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Pc(t,f,n)}break;case 5:var m=t.stateNode;if(n===null&&t.flags&4){n=m;var v=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":v.autoFocus&&n.focus();break;case"img":v.src&&(n.src=v.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var E=t.alternate;if(E!==null){var O=E.memoizedState;if(O!==null){var M=O.dehydrated;M!==null&&Pr(M)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(l(163))}Je||t.flags&512&&li(t)}catch(A){Oe(t,t.return,A)}}if(t===e){Y=null;break}if(n=t.sibling,n!==null){n.return=t.return,Y=n;break}Y=t.return}}function Pu(e){for(;Y!==null;){var t=Y;if(t===e){Y=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Y=n;break}Y=t.return}}function Lu(e){for(;Y!==null;){var t=Y;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ro(4,t)}catch(v){Oe(t,n,v)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var a=t.return;try{s.componentDidMount()}catch(v){Oe(t,a,v)}}var u=t.return;try{li(t)}catch(v){Oe(t,u,v)}break;case 5:var f=t.return;try{li(t)}catch(v){Oe(t,f,v)}}}catch(v){Oe(t,t.return,v)}if(t===e){Y=null;break}var m=t.sibling;if(m!==null){m.return=t.return,Y=m;break}Y=t.return}}var Dp=Math.ceil,so=ee.ReactCurrentDispatcher,ci=ee.ReactCurrentOwner,vt=ee.ReactCurrentBatchConfig,ge=0,He=null,Fe=null,Qe=0,ft=0,hr=yn(0),$e=0,es=null,$n=0,oo=0,ui=0,ts=null,lt=null,di=0,mr=1/0,en=null,lo=!1,fi=null,Sn=null,io=!1,jn=null,ao=0,ns=0,pi=null,co=-1,uo=0;function nt(){return(ge&6)!==0?Ie():co!==-1?co:co=Ie()}function Cn(e){return(e.mode&1)===0?1:(ge&2)!==0&&Qe!==0?Qe&-Qe:wp.transition!==null?(uo===0&&(uo=ja()),uo):(e=Ne,e!==0||(e=window.event,e=e===void 0?16:Oa(e.type)),e)}function Tt(e,t,n,s){if(50<ns)throw ns=0,pi=null,Error(l(185));Cr(e,n,s),((ge&2)===0||e!==He)&&(e===He&&((ge&2)===0&&(oo|=n),$e===4&&En(e,Qe)),it(e,s),n===1&&ge===0&&(t.mode&1)===0&&(mr=Ie()+500,Fs&&wn()))}function it(e,t){var n=e.callbackNode;wf(e,t);var s=vs(e,e===He?Qe:0);if(s===0)n!==null&&ba(n),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(n!=null&&ba(n),t===1)e.tag===0?vp(Ou.bind(null,e)):vc(Ou.bind(null,e)),mp(function(){(ge&6)===0&&wn()}),n=null;else{switch(Ca(s)){case 1:n=Ko;break;case 4:n=ka;break;case 16:n=ms;break;case 536870912:n=Sa;break;default:n=ms}n=Uu(n,Au.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Au(e,t){if(co=-1,uo=0,(ge&6)!==0)throw Error(l(327));var n=e.callbackNode;if(gr()&&e.callbackNode!==n)return null;var s=vs(e,e===He?Qe:0);if(s===0)return null;if((s&30)!==0||(s&e.expiredLanes)!==0||t)t=fo(e,s);else{t=s;var a=ge;ge|=2;var u=Mu();(He!==e||Qe!==t)&&(en=null,mr=Ie()+500,Hn(e,t));do try{zp();break}catch(m){Iu(e,m)}while(!0);Pl(),so.current=u,ge=a,Fe!==null?t=0:(He=null,Qe=0,t=$e)}if(t!==0){if(t===2&&(a=qo(e),a!==0&&(s=a,t=hi(e,a))),t===1)throw n=es,Hn(e,0),En(e,s),it(e,Ie()),n;if(t===6)En(e,s);else{if(a=e.current.alternate,(s&30)===0&&!Fp(a)&&(t=fo(e,s),t===2&&(u=qo(e),u!==0&&(s=u,t=hi(e,u))),t===1))throw n=es,Hn(e,0),En(e,s),it(e,Ie()),n;switch(e.finishedWork=a,e.finishedLanes=s,t){case 0:case 1:throw Error(l(345));case 2:Wn(e,lt,en);break;case 3:if(En(e,s),(s&130023424)===s&&(t=di+500-Ie(),10<t)){if(vs(e,0)!==0)break;if(a=e.suspendedLanes,(a&s)!==s){nt(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=wl(Wn.bind(null,e,lt,en),t);break}Wn(e,lt,en);break;case 4:if(En(e,s),(s&4194240)===s)break;for(t=e.eventTimes,a=-1;0<s;){var f=31-St(s);u=1<<f,f=t[f],f>a&&(a=f),s&=~u}if(s=a,s=Ie()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Dp(s/1960))-s,10<s){e.timeoutHandle=wl(Wn.bind(null,e,lt,en),s);break}Wn(e,lt,en);break;case 5:Wn(e,lt,en);break;default:throw Error(l(329))}}}return it(e,Ie()),e.callbackNode===n?Au.bind(null,e):null}function hi(e,t){var n=ts;return e.current.memoizedState.isDehydrated&&(Hn(e,t).flags|=256),e=fo(e,t),e!==2&&(t=lt,lt=n,t!==null&&mi(t)),e}function mi(e){lt===null?lt=e:lt.push.apply(lt,e)}function Fp(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var s=0;s<n.length;s++){var a=n[s],u=a.getSnapshot;a=a.value;try{if(!jt(u(),a))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 En(e,t){for(t&=~ui,t&=~oo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-St(t),s=1<<n;e[n]=-1,t&=~s}}function Ou(e){if((ge&6)!==0)throw Error(l(327));gr();var t=vs(e,0);if((t&1)===0)return it(e,Ie()),null;var n=fo(e,t);if(e.tag!==0&&n===2){var s=qo(e);s!==0&&(t=s,n=hi(e,s))}if(n===1)throw n=es,Hn(e,0),En(e,t),it(e,Ie()),n;if(n===6)throw Error(l(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Wn(e,lt,en),it(e,Ie()),null}function gi(e,t){var n=ge;ge|=1;try{return e(t)}finally{ge=n,ge===0&&(mr=Ie()+500,Fs&&wn())}}function Un(e){jn!==null&&jn.tag===0&&(ge&6)===0&&gr();var t=ge;ge|=1;var n=vt.transition,s=Ne;try{if(vt.transition=null,Ne=1,e)return e()}finally{Ne=s,vt.transition=n,ge=t,(ge&6)===0&&wn()}}function xi(){ft=hr.current,je(hr)}function Hn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,hp(n)),Fe!==null)for(n=Fe.return;n!==null;){var s=n;switch(Cl(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&Ms();break;case 3:dr(),je(rt),je(Ye),Bl();break;case 5:Dl(s);break;case 4:dr();break;case 13:je(Te);break;case 19:je(Te);break;case 10:Ll(s.type._context);break;case 22:case 23:xi()}n=n.return}if(He=e,Fe=e=_n(e.current,null),Qe=ft=t,$e=0,es=null,ui=oo=$n=0,lt=ts=null,Fn!==null){for(t=0;t<Fn.length;t++)if(n=Fn[t],s=n.interleaved,s!==null){n.interleaved=null;var a=s.next,u=n.pending;if(u!==null){var f=u.next;u.next=a,s.next=f}n.pending=s}Fn=null}return e}function Iu(e,t){do{var n=Fe;try{if(Pl(),Qs.current=Js,Ys){for(var s=Pe.memoizedState;s!==null;){var a=s.queue;a!==null&&(a.pending=null),s=s.next}Ys=!1}if(zn=0,Ue=ze=Pe=null,Qr=!1,Yr=0,ci.current=null,n===null||n.return===null){$e=1,es=t,Fe=null;break}e:{var u=e,f=n.return,m=n,v=t;if(t=Qe,m.flags|=32768,v!==null&&typeof v=="object"&&typeof v.then=="function"){var E=v,O=m,M=O.tag;if((O.mode&1)===0&&(M===0||M===11||M===15)){var A=O.alternate;A?(O.updateQueue=A.updateQueue,O.memoizedState=A.memoizedState,O.lanes=A.lanes):(O.updateQueue=null,O.memoizedState=null)}var K=lu(f);if(K!==null){K.flags&=-257,iu(K,f,m,u,t),K.mode&1&&ou(u,E,t),t=K,v=E;var G=t.updateQueue;if(G===null){var X=new Set;X.add(v),t.updateQueue=X}else G.add(v);break e}else{if((t&1)===0){ou(u,E,t),yi();break e}v=Error(l(426))}}else if(_e&&m.mode&1){var Me=lu(f);if(Me!==null){(Me.flags&65536)===0&&(Me.flags|=256),iu(Me,f,m,u,t),Rl(fr(v,m));break e}}u=v=fr(v,m),$e!==4&&($e=2),ts===null?ts=[u]:ts.push(u),u=f;do{switch(u.tag){case 3:u.flags|=65536,t&=-t,u.lanes|=t;var S=ru(u,v,t);Tc(u,S);break e;case 1:m=v;var w=u.type,j=u.stateNode;if((u.flags&128)===0&&(typeof w.getDerivedStateFromError=="function"||j!==null&&typeof j.componentDidCatch=="function"&&(Sn===null||!Sn.has(j)))){u.flags|=65536,t&=-t,u.lanes|=t;var D=su(u,m,t);Tc(u,D);break e}}u=u.return}while(u!==null)}Fu(n)}catch(J){t=J,Fe===n&&n!==null&&(Fe=n=n.return);continue}break}while(!0)}function Mu(){var e=so.current;return so.current=Js,e===null?Js:e}function yi(){($e===0||$e===3||$e===2)&&($e=4),He===null||($n&268435455)===0&&(oo&268435455)===0||En(He,Qe)}function fo(e,t){var n=ge;ge|=2;var s=Mu();(He!==e||Qe!==t)&&(en=null,Hn(e,t));do try{Bp();break}catch(a){Iu(e,a)}while(!0);if(Pl(),ge=n,so.current=s,Fe!==null)throw Error(l(261));return He=null,Qe=0,$e}function Bp(){for(;Fe!==null;)Du(Fe)}function zp(){for(;Fe!==null&&!df();)Du(Fe)}function Du(e){var t=$u(e.alternate,e,ft);e.memoizedProps=e.pendingProps,t===null?Fu(e):Fe=t,ci.current=null}function Fu(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=Lp(n,t,ft),n!==null){Fe=n;return}}else{if(n=Ap(n,t),n!==null){n.flags&=32767,Fe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{$e=6,Fe=null;return}}if(t=t.sibling,t!==null){Fe=t;return}Fe=t=e}while(t!==null);$e===0&&($e=5)}function Wn(e,t,n){var s=Ne,a=vt.transition;try{vt.transition=null,Ne=1,$p(e,t,n,s)}finally{vt.transition=a,Ne=s}return null}function $p(e,t,n,s){do gr();while(jn!==null);if((ge&6)!==0)throw Error(l(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(l(177));e.callbackNode=null,e.callbackPriority=0;var u=n.lanes|n.childLanes;if(Nf(e,u),e===He&&(Fe=He=null,Qe=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||io||(io=!0,Uu(ms,function(){return gr(),null})),u=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||u){u=vt.transition,vt.transition=null;var f=Ne;Ne=1;var m=ge;ge|=4,ci.current=null,Ip(e,n),_u(n,e),ip(yl),bs=!!xl,yl=xl=null,e.current=n,Mp(n),ff(),ge=m,Ne=f,vt.transition=u}else e.current=n;if(io&&(io=!1,jn=e,ao=a),u=e.pendingLanes,u===0&&(Sn=null),mf(n.stateNode),it(e,Ie()),t!==null)for(s=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],s(a.value,{componentStack:a.stack,digest:a.digest});if(lo)throw lo=!1,e=fi,fi=null,e;return(ao&1)!==0&&e.tag!==0&&gr(),u=e.pendingLanes,(u&1)!==0?e===pi?ns++:(ns=0,pi=e):ns=0,wn(),null}function gr(){if(jn!==null){var e=Ca(ao),t=vt.transition,n=Ne;try{if(vt.transition=null,Ne=16>e?16:e,jn===null)var s=!1;else{if(e=jn,jn=null,ao=0,(ge&6)!==0)throw Error(l(331));var a=ge;for(ge|=4,Y=e.current;Y!==null;){var u=Y,f=u.child;if((Y.flags&16)!==0){var m=u.deletions;if(m!==null){for(var v=0;v<m.length;v++){var E=m[v];for(Y=E;Y!==null;){var O=Y;switch(O.tag){case 0:case 11:case 15:Zr(8,O,u)}var M=O.child;if(M!==null)M.return=O,Y=M;else for(;Y!==null;){O=Y;var A=O.sibling,K=O.return;if(ku(O),O===E){Y=null;break}if(A!==null){A.return=K,Y=A;break}Y=K}}}var G=u.alternate;if(G!==null){var X=G.child;if(X!==null){G.child=null;do{var Me=X.sibling;X.sibling=null,X=Me}while(X!==null)}}Y=u}}if((u.subtreeFlags&2064)!==0&&f!==null)f.return=u,Y=f;else e:for(;Y!==null;){if(u=Y,(u.flags&2048)!==0)switch(u.tag){case 0:case 11:case 15:Zr(9,u,u.return)}var S=u.sibling;if(S!==null){S.return=u.return,Y=S;break e}Y=u.return}}var w=e.current;for(Y=w;Y!==null;){f=Y;var j=f.child;if((f.subtreeFlags&2064)!==0&&j!==null)j.return=f,Y=j;else e:for(f=w;Y!==null;){if(m=Y,(m.flags&2048)!==0)try{switch(m.tag){case 0:case 11:case 15:ro(9,m)}}catch(J){Oe(m,m.return,J)}if(m===f){Y=null;break e}var D=m.sibling;if(D!==null){D.return=m.return,Y=D;break e}Y=m.return}}if(ge=a,wn(),It&&typeof It.onPostCommitFiberRoot=="function")try{It.onPostCommitFiberRoot(gs,e)}catch{}s=!0}return s}finally{Ne=n,vt.transition=t}}return!1}function Bu(e,t,n){t=fr(n,t),t=ru(e,t,1),e=bn(e,t,1),t=nt(),e!==null&&(Cr(e,1,t),it(e,t))}function Oe(e,t,n){if(e.tag===3)Bu(e,e,n);else for(;t!==null;){if(t.tag===3){Bu(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Sn===null||!Sn.has(s))){e=fr(n,e),e=su(t,e,1),t=bn(t,e,1),e=nt(),t!==null&&(Cr(t,1,e),it(t,e));break}}t=t.return}}function Up(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),t=nt(),e.pingedLanes|=e.suspendedLanes&n,He===e&&(Qe&n)===n&&($e===4||$e===3&&(Qe&130023424)===Qe&&500>Ie()-di?Hn(e,0):ui|=n),it(e,t)}function zu(e,t){t===0&&((e.mode&1)===0?t=1:(t=ys,ys<<=1,(ys&130023424)===0&&(ys=4194304)));var n=nt();e=Xt(e,t),e!==null&&(Cr(e,t,n),it(e,n))}function Hp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),zu(e,n)}function Wp(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(l(314))}s!==null&&s.delete(t),zu(e,n)}var $u;$u=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||rt.current)ot=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return ot=!1,Pp(e,t,n);ot=(e.flags&131072)!==0}else ot=!1,_e&&(t.flags&1048576)!==0&&wc(t,zs,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;to(e,t),e=t.pendingProps;var a=sr(t,Ye.current);ur(t,n),a=Ul(null,t,s,e,a,n);var u=Hl();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,st(s)?(u=!0,Ds(t)):u=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Il(t),a.updater=Zs,t.stateNode=a,a._reactInternals=t,Yl(t,s,e,n),t=Zl(null,t,s,!0,u,n)):(t.tag=0,_e&&u&&jl(t),tt(null,t,a,n),t=t.child),t;case 16:s=t.elementType;e:{switch(to(e,t),e=t.pendingProps,a=s._init,s=a(s._payload),t.type=s,a=t.tag=Kp(s),e=Et(s,e),a){case 0:t=Jl(null,t,s,e,n);break e;case 1:t=pu(null,t,s,e,n);break e;case 11:t=au(null,t,s,e,n);break e;case 14:t=cu(null,t,s,Et(s.type,e),n);break e}throw Error(l(306,s,""))}return t;case 0:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:Et(s,a),Jl(e,t,s,a,n);case 1:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:Et(s,a),pu(e,t,s,a,n);case 3:e:{if(hu(t),e===null)throw Error(l(387));s=t.pendingProps,u=t.memoizedState,a=u.element,Rc(e,t),Ks(t,s,null,n);var f=t.memoizedState;if(s=f.element,u.isDehydrated)if(u={element:s,isDehydrated:!1,cache:f.cache,pendingSuspenseBoundaries:f.pendingSuspenseBoundaries,transitions:f.transitions},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){a=fr(Error(l(423)),t),t=mu(e,t,s,n,a);break e}else if(s!==a){a=fr(Error(l(424)),t),t=mu(e,t,s,n,a);break e}else for(dt=xn(t.stateNode.containerInfo.firstChild),ut=t,_e=!0,Ct=null,n=Ec(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ir(),s===a){t=Zt(e,t,n);break e}tt(e,t,s,n)}t=t.child}return t;case 5:return Lc(t),e===null&&_l(t),s=t.type,a=t.pendingProps,u=e!==null?e.memoizedProps:null,f=a.children,vl(s,a)?f=null:u!==null&&vl(s,u)&&(t.flags|=32),fu(e,t),tt(e,t,f,n),t.child;case 6:return e===null&&_l(t),null;case 13:return gu(e,t,n);case 4:return Ml(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=ar(t,null,s,n):tt(e,t,s,n),t.child;case 11:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:Et(s,a),au(e,t,s,a,n);case 7:return tt(e,t,t.pendingProps,n),t.child;case 8:return tt(e,t,t.pendingProps.children,n),t.child;case 12:return tt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(s=t.type._context,a=t.pendingProps,u=t.memoizedProps,f=a.value,ke(Hs,s._currentValue),s._currentValue=f,u!==null)if(jt(u.value,f)){if(u.children===a.children&&!rt.current){t=Zt(e,t,n);break e}}else for(u=t.child,u!==null&&(u.return=t);u!==null;){var m=u.dependencies;if(m!==null){f=u.child;for(var v=m.firstContext;v!==null;){if(v.context===s){if(u.tag===1){v=Jt(-1,n&-n),v.tag=2;var E=u.updateQueue;if(E!==null){E=E.shared;var O=E.pending;O===null?v.next=v:(v.next=O.next,O.next=v),E.pending=v}}u.lanes|=n,v=u.alternate,v!==null&&(v.lanes|=n),Al(u.return,n,t),m.lanes|=n;break}v=v.next}}else if(u.tag===10)f=u.type===t.type?null:u.child;else if(u.tag===18){if(f=u.return,f===null)throw Error(l(341));f.lanes|=n,m=f.alternate,m!==null&&(m.lanes|=n),Al(f,n,t),f=u.sibling}else f=u.child;if(f!==null)f.return=u;else for(f=u;f!==null;){if(f===t){f=null;break}if(u=f.sibling,u!==null){u.return=f.return,f=u;break}f=f.return}u=f}tt(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,s=t.pendingProps.children,ur(t,n),a=xt(a),s=s(a),t.flags|=1,tt(e,t,s,n),t.child;case 14:return s=t.type,a=Et(s,t.pendingProps),a=Et(s.type,a),cu(e,t,s,a,n);case 15:return uu(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,a=t.pendingProps,a=t.elementType===s?a:Et(s,a),to(e,t),t.tag=1,st(s)?(e=!0,Ds(t)):e=!1,ur(t,n),tu(t,s,a),Yl(t,s,a,n),Zl(null,t,s,!0,e,n);case 19:return yu(e,t,n);case 22:return du(e,t,n)}throw Error(l(156,t.tag))};function Uu(e,t){return Na(e,t)}function Vp(e,t,n,s){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wt(e,t,n,s){return new Vp(e,t,n,s)}function vi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Kp(e){if(typeof e=="function")return vi(e)?1:0;if(e!=null){if(e=e.$$typeof,e===le)return 11;if(e===Ke)return 14}return 2}function _n(e,t){var n=e.alternate;return n===null?(n=wt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function po(e,t,n,s,a,u){var f=2;if(s=e,typeof e=="function")vi(e)&&(f=1);else if(typeof e=="string")f=5;else e:switch(e){case te:return Vn(n.children,a,u,t);case me:f=8,a|=8;break;case Ae:return e=wt(12,n,t,a|2),e.elementType=Ae,e.lanes=u,e;case Ve:return e=wt(13,n,t,a),e.elementType=Ve,e.lanes=u,e;case De:return e=wt(19,n,t,a),e.elementType=De,e.lanes=u,e;case we:return ho(n,a,u,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Re:f=10;break e;case Ze:f=9;break e;case le:f=11;break e;case Ke:f=14;break e;case Ce:f=16,s=null;break e}throw Error(l(130,e==null?e:typeof e,""))}return t=wt(f,n,t,a),t.elementType=e,t.type=s,t.lanes=u,t}function Vn(e,t,n,s){return e=wt(7,e,s,t),e.lanes=n,e}function ho(e,t,n,s){return e=wt(22,e,s,t),e.elementType=we,e.lanes=n,e.stateNode={isHidden:!1},e}function wi(e,t,n){return e=wt(6,e,null,t),e.lanes=n,e}function Ni(e,t,n){return t=wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function qp(e,t,n,s,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Qo(0),this.expirationTimes=Qo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qo(0),this.identifierPrefix=s,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function bi(e,t,n,s,a,u,f,m,v){return e=new qp(e,t,n,m,v),t===1?(t=1,u===!0&&(t|=8)):t=0,u=wt(3,null,null,t),e.current=u,u.stateNode=e,u.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Il(u),e}function Qp(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Q,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}function Hu(e){if(!e)return vn;e=e._reactInternals;e:{if(An(e)!==e||e.tag!==1)throw Error(l(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(st(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(l(171))}if(e.tag===1){var n=e.type;if(st(n))return xc(e,n,t)}return t}function Wu(e,t,n,s,a,u,f,m,v){return e=bi(n,s,!0,e,a,u,f,m,v),e.context=Hu(null),n=e.current,s=nt(),a=Cn(n),u=Jt(s,a),u.callback=t??null,bn(n,u,a),e.current.lanes=a,Cr(e,a,s),it(e,s),e}function mo(e,t,n,s){var a=t.current,u=nt(),f=Cn(a);return n=Hu(n),t.context===null?t.context=n:t.pendingContext=n,t=Jt(u,f),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=bn(a,t,f),e!==null&&(Tt(e,a,f,u),Vs(e,a,f)),f}function go(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Vu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ki(e,t){Vu(e,t),(e=e.alternate)&&Vu(e,t)}function Yp(){return null}var Ku=typeof reportError=="function"?reportError:function(e){console.error(e)};function Si(e){this._internalRoot=e}xo.prototype.render=Si.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));mo(e,t,null,null)},xo.prototype.unmount=Si.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Un(function(){mo(null,e,null,null)}),t[qt]=null}};function xo(e){this._internalRoot=e}xo.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ra();e={blockedOn:null,target:e,priority:t};for(var n=0;n<hn.length&&t!==0&&t<hn[n].priority;n++);hn.splice(n,0,e),n===0&&La(e)}};function ji(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function yo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function qu(){}function Gp(e,t,n,s,a){if(a){if(typeof s=="function"){var u=s;s=function(){var E=go(f);u.call(E)}}var f=Wu(t,s,e,0,null,!1,!1,"",qu);return e._reactRootContainer=f,e[qt]=f.current,zr(e.nodeType===8?e.parentNode:e),Un(),f}for(;a=e.lastChild;)e.removeChild(a);if(typeof s=="function"){var m=s;s=function(){var E=go(v);m.call(E)}}var v=bi(e,0,!1,null,null,!1,!1,"",qu);return e._reactRootContainer=v,e[qt]=v.current,zr(e.nodeType===8?e.parentNode:e),Un(function(){mo(t,v,n,s)}),v}function vo(e,t,n,s,a){var u=n._reactRootContainer;if(u){var f=u;if(typeof a=="function"){var m=a;a=function(){var v=go(f);m.call(v)}}mo(t,f,e,a)}else f=Gp(n,t,e,a,s);return go(f)}Ea=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=jr(t.pendingLanes);n!==0&&(Yo(t,n|1),it(t,Ie()),(ge&6)===0&&(mr=Ie()+500,wn()))}break;case 13:Un(function(){var s=Xt(e,1);if(s!==null){var a=nt();Tt(s,e,1,a)}}),ki(e,1)}},Go=function(e){if(e.tag===13){var t=Xt(e,134217728);if(t!==null){var n=nt();Tt(t,e,134217728,n)}ki(e,134217728)}},_a=function(e){if(e.tag===13){var t=Cn(e),n=Xt(e,t);if(n!==null){var s=nt();Tt(n,e,t,s)}ki(e,t)}},Ra=function(){return Ne},Ta=function(e,t){var n=Ne;try{return Ne=e,t()}finally{Ne=n}},Uo=function(e,t,n){switch(t){case"input":if(pt(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var a=Is(s);if(!a)throw Error(l(90));ae(s),pt(s,a)}}}break;case"textarea":on(e,n);break;case"select":t=n.value,t!=null&&ht(e,!!n.multiple,t,!1)}},ha=gi,ma=Un;var Xp={usingClientEntryPoint:!1,Events:[Hr,nr,Is,fa,pa,gi]},rs={findFiberByHostInstance:On,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Jp={bundleType:rs.bundleType,version:rs.version,rendererPackageName:rs.rendererPackageName,rendererConfig:rs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ee.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=va(e),e===null?null:e.stateNode},findFiberByHostInstance:rs.findFiberByHostInstance||Yp,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wo.isDisabled&&wo.supportsFiber)try{gs=wo.inject(Jp),It=wo}catch{}}return at.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Xp,at.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ji(t))throw Error(l(200));return Qp(e,t,null,n)},at.createRoot=function(e,t){if(!ji(e))throw Error(l(299));var n=!1,s="",a=Ku;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=bi(e,1,!1,null,null,n,!1,s,a),e[qt]=t.current,zr(e.nodeType===8?e.parentNode:e),new Si(t)},at.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=va(t),e=e===null?null:e.stateNode,e},at.flushSync=function(e){return Un(e)},at.hydrate=function(e,t,n){if(!yo(t))throw Error(l(200));return vo(null,e,t,!0,n)},at.hydrateRoot=function(e,t,n){if(!ji(e))throw Error(l(405));var s=n!=null&&n.hydratedSources||null,a=!1,u="",f=Ku;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onRecoverableError!==void 0&&(f=n.onRecoverableError)),t=Wu(t,null,e,1,n??null,a,!1,u,f),e[qt]=t.current,zr(e),s)for(e=0;e<s.length;e++)n=s[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new xo(t)},at.render=function(e,t,n){if(!yo(t))throw Error(l(200));return vo(null,e,t,!1,n)},at.unmountComponentAtNode=function(e){if(!yo(e))throw Error(l(40));return e._reactRootContainer?(Un(function(){vo(null,null,e,!1,function(){e._reactRootContainer=null,e[qt]=null})}),!0):!1},at.unstable_batchedUpdates=gi,at.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!yo(n))throw Error(l(200));if(e==null||e._reactInternals===void 0)throw Error(l(38));return vo(e,t,n,!1,s)},at.version="18.3.1-next-f1338f8080-20240426",at}var td;function ih(){if(td)return _i.exports;td=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(o){console.error(o)}}return r(),_i.exports=lh(),_i.exports}var nd;function ah(){if(nd)return No;nd=1;var r=ih();return No.createRoot=r.createRoot,No.hydrateRoot=r.hydrateRoot,No}var ch=ah();const uh=bd(ch);/**
41
+ * react-router v7.13.0
42
+ *
43
+ * Copyright (c) Remix Software Inc.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ */var rd="popstate";function dh(r={}){function o(c,d){let{pathname:p,search:h,hash:x}=c.location;return zi("",{pathname:p,search:h,hash:x},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function l(c,d){return typeof d=="string"?d:cs(d)}return ph(o,l,null,r)}function Le(r,o){if(r===!1||r===null||typeof r>"u")throw new Error(o)}function $t(r,o){if(!r){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function fh(){return Math.random().toString(36).substring(2,10)}function sd(r,o){return{usr:r.state,key:r.key,idx:o}}function zi(r,o,l=null,c){return{pathname:typeof r=="string"?r:r.pathname,search:"",hash:"",...typeof o=="string"?yr(o):o,state:l,key:o&&o.key||c||fh()}}function cs({pathname:r="/",search:o="",hash:l=""}){return o&&o!=="?"&&(r+=o.charAt(0)==="?"?o:"?"+o),l&&l!=="#"&&(r+=l.charAt(0)==="#"?l:"#"+l),r}function yr(r){let o={};if(r){let l=r.indexOf("#");l>=0&&(o.hash=r.substring(l),r=r.substring(0,l));let c=r.indexOf("?");c>=0&&(o.search=r.substring(c),r=r.substring(0,c)),r&&(o.pathname=r)}return o}function ph(r,o,l,c={}){let{window:d=document.defaultView,v5Compat:p=!1}=c,h=d.history,x="POP",y=null,b=N();b==null&&(b=0,h.replaceState({...h.state,idx:b},""));function N(){return(h.state||{idx:null}).idx}function C(){x="POP";let T=N(),z=T==null?null:T-b;b=T,y&&y({action:x,location:_.location,delta:z})}function P(T,z){x="PUSH";let H=zi(_.location,T,z);b=N()+1;let $=sd(H,b),ee=_.createHref(H);try{h.pushState($,"",ee)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;d.location.assign(ee)}p&&y&&y({action:x,location:_.location,delta:1})}function I(T,z){x="REPLACE";let H=zi(_.location,T,z);b=N();let $=sd(H,b),ee=_.createHref(H);h.replaceState($,"",ee),p&&y&&y({action:x,location:_.location,delta:0})}function W(T){return hh(T)}let _={get action(){return x},get location(){return r(d,h)},listen(T){if(y)throw new Error("A history only accepts one active listener");return d.addEventListener(rd,C),y=T,()=>{d.removeEventListener(rd,C),y=null}},createHref(T){return o(d,T)},createURL:W,encodeLocation(T){let z=W(T);return{pathname:z.pathname,search:z.search,hash:z.hash}},push:P,replace:I,go(T){return h.go(T)}};return _}function hh(r,o=!1){let l="http://localhost";typeof window<"u"&&(l=window.location.origin!=="null"?window.location.origin:window.location.href),Le(l,"No window.location.(origin|href) available to create URL");let c=typeof r=="string"?r:cs(r);return c=c.replace(/ $/,"%20"),!o&&c.startsWith("//")&&(c=l+c),new URL(c,l)}function kd(r,o,l="/"){return mh(r,o,l,!1)}function mh(r,o,l,c){let d=typeof o=="string"?yr(o):o,p=nn(d.pathname||"/",l);if(p==null)return null;let h=Sd(r);gh(h);let x=null;for(let y=0;x==null&&y<h.length;++y){let b=Eh(p);x=jh(h[y],b,c)}return x}function Sd(r,o=[],l=[],c="",d=!1){let p=(h,x,y=d,b)=>{let N={relativePath:b===void 0?h.path||"":b,caseSensitive:h.caseSensitive===!0,childrenIndex:x,route:h};if(N.relativePath.startsWith("/")){if(!N.relativePath.startsWith(c)&&y)return;Le(N.relativePath.startsWith(c),`Absolute route path "${N.relativePath}" nested under path "${c}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),N.relativePath=N.relativePath.slice(c.length)}let C=tn([c,N.relativePath]),P=l.concat(N);h.children&&h.children.length>0&&(Le(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${C}".`),Sd(h.children,o,P,C,y)),!(h.path==null&&!h.index)&&o.push({path:C,score:kh(C,h.index),routesMeta:P})};return r.forEach((h,x)=>{var y;if(h.path===""||!((y=h.path)!=null&&y.includes("?")))p(h,x);else for(let b of jd(h.path))p(h,x,!0,b)}),o}function jd(r){let o=r.split("/");if(o.length===0)return[];let[l,...c]=o,d=l.endsWith("?"),p=l.replace(/\?$/,"");if(c.length===0)return d?[p,""]:[p];let h=jd(c.join("/")),x=[];return x.push(...h.map(y=>y===""?p:[p,y].join("/"))),d&&x.push(...h),x.map(y=>r.startsWith("/")&&y===""?"/":y)}function gh(r){r.sort((o,l)=>o.score!==l.score?l.score-o.score:Sh(o.routesMeta.map(c=>c.childrenIndex),l.routesMeta.map(c=>c.childrenIndex)))}var xh=/^:[\w-]+$/,yh=3,vh=2,wh=1,Nh=10,bh=-2,od=r=>r==="*";function kh(r,o){let l=r.split("/"),c=l.length;return l.some(od)&&(c+=bh),o&&(c+=vh),l.filter(d=>!od(d)).reduce((d,p)=>d+(xh.test(p)?yh:p===""?wh:Nh),c)}function Sh(r,o){return r.length===o.length&&r.slice(0,-1).every((c,d)=>c===o[d])?r[r.length-1]-o[o.length-1]:0}function jh(r,o,l=!1){let{routesMeta:c}=r,d={},p="/",h=[];for(let x=0;x<c.length;++x){let y=c[x],b=x===c.length-1,N=p==="/"?o:o.slice(p.length)||"/",C=Ao({path:y.relativePath,caseSensitive:y.caseSensitive,end:b},N),P=y.route;if(!C&&b&&l&&!c[c.length-1].route.index&&(C=Ao({path:y.relativePath,caseSensitive:y.caseSensitive,end:!1},N)),!C)return null;Object.assign(d,C.params),h.push({params:d,pathname:tn([p,C.pathname]),pathnameBase:Ph(tn([p,C.pathnameBase])),route:P}),C.pathnameBase!=="/"&&(p=tn([p,C.pathnameBase]))}return h}function Ao(r,o){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[l,c]=Ch(r.path,r.caseSensitive,r.end),d=o.match(l);if(!d)return null;let p=d[0],h=p.replace(/(.)\/+$/,"$1"),x=d.slice(1);return{params:c.reduce((b,{paramName:N,isOptional:C},P)=>{if(N==="*"){let W=x[P]||"";h=p.slice(0,p.length-W.length).replace(/(.)\/+$/,"$1")}const I=x[P];return C&&!I?b[N]=void 0:b[N]=(I||"").replace(/%2F/g,"/"),b},{}),pathname:p,pathnameBase:h,pattern:r}}function Ch(r,o=!1,l=!0){$t(r==="*"||!r.endsWith("*")||r.endsWith("/*"),`Route path "${r}" will be treated as if it were "${r.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${r.replace(/\*$/,"/*")}".`);let c=[],d="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,x,y)=>(c.push({paramName:x,isOptional:y!=null}),y?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return r.endsWith("*")?(c.push({paramName:"*"}),d+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?d+="\\/*$":r!==""&&r!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,o?void 0:"i"),c]}function Eh(r){try{return r.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){return $t(!1,`The URL path "${r}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${o}).`),r}}function nn(r,o){if(o==="/")return r;if(!r.toLowerCase().startsWith(o.toLowerCase()))return null;let l=o.endsWith("/")?o.length-1:o.length,c=r.charAt(l);return c&&c!=="/"?null:r.slice(l)||"/"}var _h=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Rh(r,o="/"){let{pathname:l,search:c="",hash:d=""}=typeof r=="string"?yr(r):r,p;return l?(l=l.replace(/\/\/+/g,"/"),l.startsWith("/")?p=ld(l.substring(1),"/"):p=ld(l,o)):p=o,{pathname:p,search:Lh(c),hash:Ah(d)}}function ld(r,o){let l=o.replace(/\/+$/,"").split("/");return r.split("/").forEach(d=>{d===".."?l.length>1&&l.pop():d!=="."&&l.push(d)}),l.length>1?l.join("/"):"/"}function Pi(r,o,l,c){return`Cannot include a '${r}' character in a manually specified \`to.${o}\` field [${JSON.stringify(c)}]. Please separate it out to the \`to.${l}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Th(r){return r.filter((o,l)=>l===0||o.route.path&&o.route.path.length>0)}function Cd(r){let o=Th(r);return o.map((l,c)=>c===o.length-1?l.pathname:l.pathnameBase)}function Ed(r,o,l,c=!1){let d;typeof r=="string"?d=yr(r):(d={...r},Le(!d.pathname||!d.pathname.includes("?"),Pi("?","pathname","search",d)),Le(!d.pathname||!d.pathname.includes("#"),Pi("#","pathname","hash",d)),Le(!d.search||!d.search.includes("#"),Pi("#","search","hash",d)));let p=r===""||d.pathname==="",h=p?"/":d.pathname,x;if(h==null)x=l;else{let C=o.length-1;if(!c&&h.startsWith("..")){let P=h.split("/");for(;P[0]==="..";)P.shift(),C-=1;d.pathname=P.join("/")}x=C>=0?o[C]:"/"}let y=Rh(d,x),b=h&&h!=="/"&&h.endsWith("/"),N=(p||h===".")&&l.endsWith("/");return!y.pathname.endsWith("/")&&(b||N)&&(y.pathname+="/"),y}var tn=r=>r.join("/").replace(/\/\/+/g,"/"),Ph=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),Lh=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,Ah=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r,Oh=class{constructor(r,o,l,c=!1){this.status=r,this.statusText=o||"",this.internal=c,l instanceof Error?(this.data=l.toString(),this.error=l):this.data=l}};function Ih(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}function Mh(r){return r.map(o=>o.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var _d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Rd(r,o){let l=r;if(typeof l!="string"||!_h.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let c=l,d=!1;if(_d)try{let p=new URL(window.location.href),h=l.startsWith("//")?new URL(p.protocol+l):new URL(l),x=nn(h.pathname,o);h.origin===p.origin&&x!=null?l=x+h.search+h.hash:d=!0}catch{$t(!1,`<Link to="${l}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:c,isExternal:d,to:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Td=["POST","PUT","PATCH","DELETE"];new Set(Td);var Dh=["GET",...Td];new Set(Dh);var vr=g.createContext(null);vr.displayName="DataRouter";var Oo=g.createContext(null);Oo.displayName="DataRouterState";var Fh=g.createContext(!1),Pd=g.createContext({isTransitioning:!1});Pd.displayName="ViewTransition";var Bh=g.createContext(new Map);Bh.displayName="Fetchers";var zh=g.createContext(null);zh.displayName="Await";var bt=g.createContext(null);bt.displayName="Navigation";var us=g.createContext(null);us.displayName="Location";var Ht=g.createContext({outlet:null,matches:[],isDataRoute:!1});Ht.displayName="Route";var Ji=g.createContext(null);Ji.displayName="RouteError";var Ld="REACT_ROUTER_ERROR",$h="REDIRECT",Uh="ROUTE_ERROR_RESPONSE";function Hh(r){if(r.startsWith(`${Ld}:${$h}:{`))try{let o=JSON.parse(r.slice(28));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string"&&typeof o.location=="string"&&typeof o.reloadDocument=="boolean"&&typeof o.replace=="boolean")return o}catch{}}function Wh(r){if(r.startsWith(`${Ld}:${Uh}:{`))try{let o=JSON.parse(r.slice(40));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string")return new Oh(o.status,o.statusText,o.data)}catch{}}function Vh(r,{relative:o}={}){Le(ds(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:c}=g.useContext(bt),{hash:d,pathname:p,search:h}=fs(r,{relative:o}),x=p;return l!=="/"&&(x=p==="/"?l:tn([l,p])),c.createHref({pathname:x,search:h,hash:d})}function ds(){return g.useContext(us)!=null}function Ln(){return Le(ds(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(us).location}var Ad="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Od(r){g.useContext(bt).static||g.useLayoutEffect(r)}function Kh(){let{isDataRoute:r}=g.useContext(Ht);return r?im():qh()}function qh(){Le(ds(),"useNavigate() may be used only in the context of a <Router> component.");let r=g.useContext(vr),{basename:o,navigator:l}=g.useContext(bt),{matches:c}=g.useContext(Ht),{pathname:d}=Ln(),p=JSON.stringify(Cd(c)),h=g.useRef(!1);return Od(()=>{h.current=!0}),g.useCallback((y,b={})=>{if($t(h.current,Ad),!h.current)return;if(typeof y=="number"){l.go(y);return}let N=Ed(y,JSON.parse(p),d,b.relative==="path");r==null&&o!=="/"&&(N.pathname=N.pathname==="/"?o:tn([o,N.pathname])),(b.replace?l.replace:l.push)(N,b.state,b)},[o,l,p,d,r])}var Qh=g.createContext(null);function Yh(r){let o=g.useContext(Ht).outlet;return g.useMemo(()=>o&&g.createElement(Qh.Provider,{value:r},o),[o,r])}function fs(r,{relative:o}={}){let{matches:l}=g.useContext(Ht),{pathname:c}=Ln(),d=JSON.stringify(Cd(l));return g.useMemo(()=>Ed(r,JSON.parse(d),c,o==="path"),[r,d,c,o])}function Gh(r,o){return Id(r,o)}function Id(r,o,l,c,d){var H;Le(ds(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:p}=g.useContext(bt),{matches:h}=g.useContext(Ht),x=h[h.length-1],y=x?x.params:{},b=x?x.pathname:"/",N=x?x.pathnameBase:"/",C=x&&x.route;{let $=C&&C.path||"";Dd(b,!C||$.endsWith("*")||$.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${b}" (under <Route path="${$}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
50
+
51
+ Please change the parent <Route path="${$}"> to <Route path="${$==="/"?"*":`${$}/*`}">.`)}let P=Ln(),I;if(o){let $=typeof o=="string"?yr(o):o;Le(N==="/"||((H=$.pathname)==null?void 0:H.startsWith(N)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${N}" but pathname "${$.pathname}" was given in the \`location\` prop.`),I=$}else I=P;let W=I.pathname||"/",_=W;if(N!=="/"){let $=N.replace(/^\//,"").split("/");_="/"+W.replace(/^\//,"").split("/").slice($.length).join("/")}let T=kd(r,{pathname:_});$t(C||T!=null,`No routes matched location "${I.pathname}${I.search}${I.hash}" `),$t(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${I.pathname}${I.search}${I.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let z=tm(T&&T.map($=>Object.assign({},$,{params:Object.assign({},y,$.params),pathname:tn([N,p.encodeLocation?p.encodeLocation($.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:$.pathname]),pathnameBase:$.pathnameBase==="/"?N:tn([N,p.encodeLocation?p.encodeLocation($.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:$.pathnameBase])})),h,l,c,d);return o&&z?g.createElement(us.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...I},navigationType:"POP"}},z):z}function Xh(){let r=lm(),o=Ih(r)?`${r.status} ${r.statusText}`:r instanceof Error?r.message:JSON.stringify(r),l=r instanceof Error?r.stack:null,c="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:c},p={padding:"2px 4px",backgroundColor:c},h=null;return console.error("Error handled by React Router default ErrorBoundary:",r),h=g.createElement(g.Fragment,null,g.createElement("p",null,"💿 Hey developer 👋"),g.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",g.createElement("code",{style:p},"ErrorBoundary")," or"," ",g.createElement("code",{style:p},"errorElement")," prop on your route.")),g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},o),l?g.createElement("pre",{style:d},l):null,h)}var Jh=g.createElement(Xh,null),Md=class extends g.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,o){return o.location!==r.location||o.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:o.error,location:o.location,revalidation:r.revalidation||o.revalidation}}componentDidCatch(r,o){this.props.onError?this.props.onError(r,o):console.error("React Router caught the following error during render",r)}render(){let r=this.state.error;if(this.context&&typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){const l=Wh(r.digest);l&&(r=l)}let o=r!==void 0?g.createElement(Ht.Provider,{value:this.props.routeContext},g.createElement(Ji.Provider,{value:r,children:this.props.component})):this.props.children;return this.context?g.createElement(Zh,{error:r},o):o}};Md.contextType=Fh;var Li=new WeakMap;function Zh({children:r,error:o}){let{basename:l}=g.useContext(bt);if(typeof o=="object"&&o&&"digest"in o&&typeof o.digest=="string"){let c=Hh(o.digest);if(c){let d=Li.get(o);if(d)throw d;let p=Rd(c.location,l);if(_d&&!Li.get(o))if(p.isExternal||c.reloadDocument)window.location.href=p.absoluteURL||p.to;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(p.to,{replace:c.replace}));throw Li.set(o,h),h}return g.createElement("meta",{httpEquiv:"refresh",content:`0;url=${p.absoluteURL||p.to}`})}}return r}function em({routeContext:r,match:o,children:l}){let c=g.useContext(vr);return c&&c.static&&c.staticContext&&(o.route.errorElement||o.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=o.route.id),g.createElement(Ht.Provider,{value:r},l)}function tm(r,o=[],l=null,c=null,d=null){if(r==null){if(!l)return null;if(l.errors)r=l.matches;else if(o.length===0&&!l.initialized&&l.matches.length>0)r=l.matches;else return null}let p=r,h=l==null?void 0:l.errors;if(h!=null){let N=p.findIndex(C=>C.route.id&&(h==null?void 0:h[C.route.id])!==void 0);Le(N>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(h).join(",")}`),p=p.slice(0,Math.min(p.length,N+1))}let x=!1,y=-1;if(l)for(let N=0;N<p.length;N++){let C=p[N];if((C.route.HydrateFallback||C.route.hydrateFallbackElement)&&(y=N),C.route.id){let{loaderData:P,errors:I}=l,W=C.route.loader&&!P.hasOwnProperty(C.route.id)&&(!I||I[C.route.id]===void 0);if(C.route.lazy||W){x=!0,y>=0?p=p.slice(0,y+1):p=[p[0]];break}}}let b=l&&c?(N,C)=>{var P,I;c(N,{location:l.location,params:((I=(P=l.matches)==null?void 0:P[0])==null?void 0:I.params)??{},unstable_pattern:Mh(l.matches),errorInfo:C})}:void 0;return p.reduceRight((N,C,P)=>{let I,W=!1,_=null,T=null;l&&(I=h&&C.route.id?h[C.route.id]:void 0,_=C.route.errorElement||Jh,x&&(y<0&&P===0?(Dd("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),W=!0,T=null):y===P&&(W=!0,T=C.route.hydrateFallbackElement||null)));let z=o.concat(p.slice(0,P+1)),H=()=>{let $;return I?$=_:W?$=T:C.route.Component?$=g.createElement(C.route.Component,null):C.route.element?$=C.route.element:$=N,g.createElement(em,{match:C,routeContext:{outlet:N,matches:z,isDataRoute:l!=null},children:$})};return l&&(C.route.ErrorBoundary||C.route.errorElement||P===0)?g.createElement(Md,{location:l.location,revalidation:l.revalidation,component:_,error:I,children:H(),routeContext:{outlet:null,matches:z,isDataRoute:!0},onError:b}):H()},null)}function Zi(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nm(r){let o=g.useContext(vr);return Le(o,Zi(r)),o}function rm(r){let o=g.useContext(Oo);return Le(o,Zi(r)),o}function sm(r){let o=g.useContext(Ht);return Le(o,Zi(r)),o}function ea(r){let o=sm(r),l=o.matches[o.matches.length-1];return Le(l.route.id,`${r} can only be used on routes that contain a unique "id"`),l.route.id}function om(){return ea("useRouteId")}function lm(){var c;let r=g.useContext(Ji),o=rm("useRouteError"),l=ea("useRouteError");return r!==void 0?r:(c=o.errors)==null?void 0:c[l]}function im(){let{router:r}=nm("useNavigate"),o=ea("useNavigate"),l=g.useRef(!1);return Od(()=>{l.current=!0}),g.useCallback(async(d,p={})=>{$t(l.current,Ad),l.current&&(typeof d=="number"?await r.navigate(d):await r.navigate(d,{fromRouteId:o,...p}))},[r,o])}var id={};function Dd(r,o,l){!o&&!id[r]&&(id[r]=!0,$t(!1,l))}g.memo(am);function am({routes:r,future:o,state:l,onError:c}){return Id(r,void 0,l,c,o)}function cm(r){return Yh(r.context)}function Pt(r){Le(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function um({basename:r="/",children:o=null,location:l,navigationType:c="POP",navigator:d,static:p=!1,unstable_useTransitions:h}){Le(!ds(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let x=r.replace(/^\/*/,"/"),y=g.useMemo(()=>({basename:x,navigator:d,static:p,unstable_useTransitions:h,future:{}}),[x,d,p,h]);typeof l=="string"&&(l=yr(l));let{pathname:b="/",search:N="",hash:C="",state:P=null,key:I="default"}=l,W=g.useMemo(()=>{let _=nn(b,x);return _==null?null:{location:{pathname:_,search:N,hash:C,state:P,key:I},navigationType:c}},[x,b,N,C,P,I,c]);return $t(W!=null,`<Router basename="${x}"> is not able to match the URL "${b}${N}${C}" because it does not start with the basename, so the <Router> won't render anything.`),W==null?null:g.createElement(bt.Provider,{value:y},g.createElement(us.Provider,{children:o,value:W}))}function dm({children:r,location:o}){return Gh($i(r),o)}function $i(r,o=[]){let l=[];return g.Children.forEach(r,(c,d)=>{if(!g.isValidElement(c))return;let p=[...o,d];if(c.type===g.Fragment){l.push.apply(l,$i(c.props.children,p));return}Le(c.type===Pt,`[${typeof c.type=="string"?c.type:c.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Le(!c.props.index||!c.props.children,"An index route cannot have child routes.");let h={id:c.props.id||p.join("-"),caseSensitive:c.props.caseSensitive,element:c.props.element,Component:c.props.Component,index:c.props.index,path:c.props.path,middleware:c.props.middleware,loader:c.props.loader,action:c.props.action,hydrateFallbackElement:c.props.hydrateFallbackElement,HydrateFallback:c.props.HydrateFallback,errorElement:c.props.errorElement,ErrorBoundary:c.props.ErrorBoundary,hasErrorBoundary:c.props.hasErrorBoundary===!0||c.props.ErrorBoundary!=null||c.props.errorElement!=null,shouldRevalidate:c.props.shouldRevalidate,handle:c.props.handle,lazy:c.props.lazy};c.props.children&&(h.children=$i(c.props.children,p)),l.push(h)}),l}var Eo="get",_o="application/x-www-form-urlencoded";function Io(r){return typeof HTMLElement<"u"&&r instanceof HTMLElement}function fm(r){return Io(r)&&r.tagName.toLowerCase()==="button"}function pm(r){return Io(r)&&r.tagName.toLowerCase()==="form"}function hm(r){return Io(r)&&r.tagName.toLowerCase()==="input"}function mm(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function gm(r,o){return r.button===0&&(!o||o==="_self")&&!mm(r)}var bo=null;function xm(){if(bo===null)try{new FormData(document.createElement("form"),0),bo=!1}catch{bo=!0}return bo}var ym=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ai(r){return r!=null&&!ym.has(r)?($t(!1,`"${r}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${_o}"`),null):r}function vm(r,o){let l,c,d,p,h;if(pm(r)){let x=r.getAttribute("action");c=x?nn(x,o):null,l=r.getAttribute("method")||Eo,d=Ai(r.getAttribute("enctype"))||_o,p=new FormData(r)}else if(fm(r)||hm(r)&&(r.type==="submit"||r.type==="image")){let x=r.form;if(x==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let y=r.getAttribute("formaction")||x.getAttribute("action");if(c=y?nn(y,o):null,l=r.getAttribute("formmethod")||x.getAttribute("method")||Eo,d=Ai(r.getAttribute("formenctype"))||Ai(x.getAttribute("enctype"))||_o,p=new FormData(x,r),!xm()){let{name:b,type:N,value:C}=r;if(N==="image"){let P=b?`${b}.`:"";p.append(`${P}x`,"0"),p.append(`${P}y`,"0")}else b&&p.append(b,C)}}else{if(Io(r))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=Eo,c=null,d=_o,h=r}return p&&d==="text/plain"&&(h=p,p=void 0),{action:c,method:l.toLowerCase(),encType:d,formData:p,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ta(r,o){if(r===!1||r===null||typeof r>"u")throw new Error(o)}function wm(r,o,l,c){let d=typeof r=="string"?new URL(r,typeof window>"u"?"server://singlefetch/":window.location.origin):r;return l?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${c}`:d.pathname=`${d.pathname}.${c}`:d.pathname==="/"?d.pathname=`_root.${c}`:o&&nn(d.pathname,o)==="/"?d.pathname=`${o.replace(/\/$/,"")}/_root.${c}`:d.pathname=`${d.pathname.replace(/\/$/,"")}.${c}`,d}async function Nm(r,o){if(r.id in o)return o[r.id];try{let l=await import(r.module);return o[r.id]=l,l}catch(l){return console.error(`Error loading route module \`${r.module}\`, reloading page...`),console.error(l),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function bm(r){return r==null?!1:r.href==null?r.rel==="preload"&&typeof r.imageSrcSet=="string"&&typeof r.imageSizes=="string":typeof r.rel=="string"&&typeof r.href=="string"}async function km(r,o,l){let c=await Promise.all(r.map(async d=>{let p=o.routes[d.route.id];if(p){let h=await Nm(p,l);return h.links?h.links():[]}return[]}));return Em(c.flat(1).filter(bm).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function ad(r,o,l,c,d,p){let h=(y,b)=>l[b]?y.route.id!==l[b].route.id:!0,x=(y,b)=>{var N;return l[b].pathname!==y.pathname||((N=l[b].route.path)==null?void 0:N.endsWith("*"))&&l[b].params["*"]!==y.params["*"]};return p==="assets"?o.filter((y,b)=>h(y,b)||x(y,b)):p==="data"?o.filter((y,b)=>{var C;let N=c.routes[y.route.id];if(!N||!N.hasLoader)return!1;if(h(y,b)||x(y,b))return!0;if(y.route.shouldRevalidate){let P=y.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:((C=l[0])==null?void 0:C.params)||{},nextUrl:new URL(r,window.origin),nextParams:y.params,defaultShouldRevalidate:!0});if(typeof P=="boolean")return P}return!0}):[]}function Sm(r,o,{includeHydrateFallback:l}={}){return jm(r.map(c=>{let d=o.routes[c.route.id];if(!d)return[];let p=[d.module];return d.clientActionModule&&(p=p.concat(d.clientActionModule)),d.clientLoaderModule&&(p=p.concat(d.clientLoaderModule)),l&&d.hydrateFallbackModule&&(p=p.concat(d.hydrateFallbackModule)),d.imports&&(p=p.concat(d.imports)),p}).flat(1))}function jm(r){return[...new Set(r)]}function Cm(r){let o={},l=Object.keys(r).sort();for(let c of l)o[c]=r[c];return o}function Em(r,o){let l=new Set;return new Set(o),r.reduce((c,d)=>{let p=JSON.stringify(Cm(d));return l.has(p)||(l.add(p),c.push({key:p,link:d})),c},[])}function Fd(){let r=g.useContext(vr);return ta(r,"You must render this element inside a <DataRouterContext.Provider> element"),r}function _m(){let r=g.useContext(Oo);return ta(r,"You must render this element inside a <DataRouterStateContext.Provider> element"),r}var na=g.createContext(void 0);na.displayName="FrameworkContext";function Bd(){let r=g.useContext(na);return ta(r,"You must render this element inside a <HydratedRouter> element"),r}function Rm(r,o){let l=g.useContext(na),[c,d]=g.useState(!1),[p,h]=g.useState(!1),{onFocus:x,onBlur:y,onMouseEnter:b,onMouseLeave:N,onTouchStart:C}=o,P=g.useRef(null);g.useEffect(()=>{if(r==="render"&&h(!0),r==="viewport"){let _=z=>{z.forEach(H=>{h(H.isIntersecting)})},T=new IntersectionObserver(_,{threshold:.5});return P.current&&T.observe(P.current),()=>{T.disconnect()}}},[r]),g.useEffect(()=>{if(c){let _=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(_)}}},[c]);let I=()=>{d(!0)},W=()=>{d(!1),h(!1)};return l?r!=="intent"?[p,P,{}]:[p,P,{onFocus:os(x,I),onBlur:os(y,W),onMouseEnter:os(b,I),onMouseLeave:os(N,W),onTouchStart:os(C,I)}]:[!1,P,{}]}function os(r,o){return l=>{r&&r(l),l.defaultPrevented||o(l)}}function Tm({page:r,...o}){let{router:l}=Fd(),c=g.useMemo(()=>kd(l.routes,r,l.basename),[l.routes,r,l.basename]);return c?g.createElement(Lm,{page:r,matches:c,...o}):null}function Pm(r){let{manifest:o,routeModules:l}=Bd(),[c,d]=g.useState([]);return g.useEffect(()=>{let p=!1;return km(r,o,l).then(h=>{p||d(h)}),()=>{p=!0}},[r,o,l]),c}function Lm({page:r,matches:o,...l}){let c=Ln(),{future:d,manifest:p,routeModules:h}=Bd(),{basename:x}=Fd(),{loaderData:y,matches:b}=_m(),N=g.useMemo(()=>ad(r,o,b,p,c,"data"),[r,o,b,p,c]),C=g.useMemo(()=>ad(r,o,b,p,c,"assets"),[r,o,b,p,c]),P=g.useMemo(()=>{if(r===c.pathname+c.search+c.hash)return[];let _=new Set,T=!1;if(o.forEach(H=>{var ee;let $=p.routes[H.route.id];!$||!$.hasLoader||(!N.some(R=>R.route.id===H.route.id)&&H.route.id in y&&((ee=h[H.route.id])!=null&&ee.shouldRevalidate)||$.hasClientLoader?T=!0:_.add(H.route.id))}),_.size===0)return[];let z=wm(r,x,d.unstable_trailingSlashAwareDataRequests,"data");return T&&_.size>0&&z.searchParams.set("_routes",o.filter(H=>_.has(H.route.id)).map(H=>H.route.id).join(",")),[z.pathname+z.search]},[x,d.unstable_trailingSlashAwareDataRequests,y,c,p,N,o,r,h]),I=g.useMemo(()=>Sm(C,p),[C,p]),W=Pm(C);return g.createElement(g.Fragment,null,P.map(_=>g.createElement("link",{key:_,rel:"prefetch",as:"fetch",href:_,...l})),I.map(_=>g.createElement("link",{key:_,rel:"modulepreload",href:_,...l})),W.map(({key:_,link:T})=>g.createElement("link",{key:_,nonce:l.nonce,...T,crossOrigin:T.crossOrigin??l.crossOrigin})))}function Am(...r){return o=>{r.forEach(l=>{typeof l=="function"?l(o):l!=null&&(l.current=o)})}}var Om=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Om&&(window.__reactRouterVersion="7.13.0")}catch{}function Im({basename:r,children:o,unstable_useTransitions:l,window:c}){let d=g.useRef();d.current==null&&(d.current=dh({window:c,v5Compat:!0}));let p=d.current,[h,x]=g.useState({action:p.action,location:p.location}),y=g.useCallback(b=>{l===!1?x(b):g.startTransition(()=>x(b))},[l]);return g.useLayoutEffect(()=>p.listen(y),[p,y]),g.createElement(um,{basename:r,children:o,location:h.location,navigationType:h.action,navigator:p,unstable_useTransitions:l})}var zd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ra=g.forwardRef(function({onClick:o,discover:l="render",prefetch:c="none",relative:d,reloadDocument:p,replace:h,state:x,target:y,to:b,preventScrollReset:N,viewTransition:C,unstable_defaultShouldRevalidate:P,...I},W){let{basename:_,unstable_useTransitions:T}=g.useContext(bt),z=typeof b=="string"&&zd.test(b),H=Rd(b,_);b=H.to;let $=Vh(b,{relative:d}),[ee,R,Q]=Rm(c,I),te=Fm(b,{replace:h,state:x,target:y,preventScrollReset:N,relative:d,viewTransition:C,unstable_defaultShouldRevalidate:P,unstable_useTransitions:T});function me(Re){o&&o(Re),Re.defaultPrevented||te(Re)}let Ae=g.createElement("a",{...I,...Q,href:H.absoluteURL||$,onClick:H.isExternal||p?o:me,ref:Am(W,R),target:y,"data-discover":!z&&l==="render"?"true":void 0});return ee&&!z?g.createElement(g.Fragment,null,Ae,g.createElement(Tm,{page:$})):Ae});ra.displayName="Link";var Ui=g.forwardRef(function({"aria-current":o="page",caseSensitive:l=!1,className:c="",end:d=!1,style:p,to:h,viewTransition:x,children:y,...b},N){let C=fs(h,{relative:b.relative}),P=Ln(),I=g.useContext(Oo),{navigator:W,basename:_}=g.useContext(bt),T=I!=null&&Hm(C)&&x===!0,z=W.encodeLocation?W.encodeLocation(C).pathname:C.pathname,H=P.pathname,$=I&&I.navigation&&I.navigation.location?I.navigation.location.pathname:null;l||(H=H.toLowerCase(),$=$?$.toLowerCase():null,z=z.toLowerCase()),$&&_&&($=nn($,_)||$);const ee=z!=="/"&&z.endsWith("/")?z.length-1:z.length;let R=H===z||!d&&H.startsWith(z)&&H.charAt(ee)==="/",Q=$!=null&&($===z||!d&&$.startsWith(z)&&$.charAt(z.length)==="/"),te={isActive:R,isPending:Q,isTransitioning:T},me=R?o:void 0,Ae;typeof c=="function"?Ae=c(te):Ae=[c,R?"active":null,Q?"pending":null,T?"transitioning":null].filter(Boolean).join(" ");let Re=typeof p=="function"?p(te):p;return g.createElement(ra,{...b,"aria-current":me,className:Ae,ref:N,style:Re,to:h,viewTransition:x},typeof y=="function"?y(te):y)});Ui.displayName="NavLink";var Mm=g.forwardRef(({discover:r="render",fetcherKey:o,navigate:l,reloadDocument:c,replace:d,state:p,method:h=Eo,action:x,onSubmit:y,relative:b,preventScrollReset:N,viewTransition:C,unstable_defaultShouldRevalidate:P,...I},W)=>{let{unstable_useTransitions:_}=g.useContext(bt),T=$m(),z=Um(x,{relative:b}),H=h.toLowerCase()==="get"?"get":"post",$=typeof x=="string"&&zd.test(x),ee=R=>{if(y&&y(R),R.defaultPrevented)return;R.preventDefault();let Q=R.nativeEvent.submitter,te=(Q==null?void 0:Q.getAttribute("formmethod"))||h,me=()=>T(Q||R.currentTarget,{fetcherKey:o,method:te,navigate:l,replace:d,state:p,relative:b,preventScrollReset:N,viewTransition:C,unstable_defaultShouldRevalidate:P});_&&l!==!1?g.startTransition(()=>me()):me()};return g.createElement("form",{ref:W,method:H,action:z,onSubmit:c?y:ee,...I,"data-discover":!$&&r==="render"?"true":void 0})});Mm.displayName="Form";function Dm(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $d(r){let o=g.useContext(vr);return Le(o,Dm(r)),o}function Fm(r,{target:o,replace:l,state:c,preventScrollReset:d,relative:p,viewTransition:h,unstable_defaultShouldRevalidate:x,unstable_useTransitions:y}={}){let b=Kh(),N=Ln(),C=fs(r,{relative:p});return g.useCallback(P=>{if(gm(P,o)){P.preventDefault();let I=l!==void 0?l:cs(N)===cs(C),W=()=>b(r,{replace:I,state:c,preventScrollReset:d,relative:p,viewTransition:h,unstable_defaultShouldRevalidate:x});y?g.startTransition(()=>W()):W()}},[N,b,C,l,c,o,r,d,p,h,x,y])}var Bm=0,zm=()=>`__${String(++Bm)}__`;function $m(){let{router:r}=$d("useSubmit"),{basename:o}=g.useContext(bt),l=om(),c=r.fetch,d=r.navigate;return g.useCallback(async(p,h={})=>{let{action:x,method:y,encType:b,formData:N,body:C}=vm(p,o);if(h.navigate===!1){let P=h.fetcherKey||zm();await c(P,l,h.action||x,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:N,body:C,formMethod:h.method||y,formEncType:h.encType||b,flushSync:h.flushSync})}else await d(h.action||x,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:N,body:C,formMethod:h.method||y,formEncType:h.encType||b,replace:h.replace,state:h.state,fromRouteId:l,flushSync:h.flushSync,viewTransition:h.viewTransition})},[c,d,o,l])}function Um(r,{relative:o}={}){let{basename:l}=g.useContext(bt),c=g.useContext(Ht);Le(c,"useFormAction must be used inside a RouteContext");let[d]=c.matches.slice(-1),p={...fs(r||".",{relative:o})},h=Ln();if(r==null){p.search=h.search;let x=new URLSearchParams(p.search),y=x.getAll("index");if(y.some(N=>N==="")){x.delete("index"),y.filter(C=>C).forEach(C=>x.append("index",C));let N=x.toString();p.search=N?`?${N}`:""}}return(!r||r===".")&&d.route.index&&(p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(p.pathname=p.pathname==="/"?l:tn([l,p.pathname])),cs(p)}function Hm(r,{relative:o}={}){let l=g.useContext(Pd);Le(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:c}=$d("useViewTransitionState"),d=fs(r,{relative:o});if(!l.isTransitioning)return!1;let p=nn(l.currentLocation.pathname,c)||l.currentLocation.pathname,h=nn(l.nextLocation.pathname,c)||l.nextLocation.pathname;return Ao(d.pathname,h)!=null||Ao(d.pathname,p)!=null}/**
52
+ * @license lucide-react v0.563.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */const Ud=(...r)=>r.filter((o,l,c)=>!!o&&o.trim()!==""&&c.indexOf(o)===l).join(" ").trim();/**
57
+ * @license lucide-react v0.563.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */const Wm=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
62
+ * @license lucide-react v0.563.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ */const Vm=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,l,c)=>c?c.toUpperCase():l.toLowerCase());/**
67
+ * @license lucide-react v0.563.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */const cd=r=>{const o=Vm(r);return o.charAt(0).toUpperCase()+o.slice(1)};/**
72
+ * @license lucide-react v0.563.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */var Km={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
77
+ * @license lucide-react v0.563.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const qm=r=>{for(const o in r)if(o.startsWith("aria-")||o==="role"||o==="title")return!0;return!1};/**
82
+ * @license lucide-react v0.563.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */const Qm=g.forwardRef(({color:r="currentColor",size:o=24,strokeWidth:l=2,absoluteStrokeWidth:c,className:d="",children:p,iconNode:h,...x},y)=>g.createElement("svg",{ref:y,...Km,width:o,height:o,stroke:r,strokeWidth:c?Number(l)*24/Number(o):l,className:Ud("lucide",d),...!p&&!qm(x)&&{"aria-hidden":"true"},...x},[...h.map(([b,N])=>g.createElement(b,N)),...Array.isArray(p)?p:[p]]));/**
87
+ * @license lucide-react v0.563.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */const be=(r,o)=>{const l=g.forwardRef(({className:c,...d},p)=>g.createElement(Qm,{ref:p,iconNode:o,className:Ud(`lucide-${Wm(cd(r))}`,`lucide-${r}`,c),...d}));return l.displayName=cd(r),l};/**
92
+ * @license lucide-react v0.563.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const Ym=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Gm=be("activity",Ym);/**
97
+ * @license lucide-react v0.563.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const Xm=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Jm=be("bot",Xm);/**
102
+ * @license lucide-react v0.563.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const Zm=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],Hi=be("box",Zm);/**
107
+ * @license lucide-react v0.563.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const e0=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],t0=be("chevron-down",e0);/**
112
+ * @license lucide-react v0.563.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const n0=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],r0=be("chevron-right",n0);/**
117
+ * @license lucide-react v0.563.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const s0=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],o0=be("circle-check-big",s0);/**
122
+ * @license lucide-react v0.563.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const l0=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],i0=be("circle-x",l0);/**
127
+ * @license lucide-react v0.563.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const a0=[["path",{d:"M11 20H2",key:"nlcfvz"}],["path",{d:"M11 4.562v16.157a1 1 0 0 0 1.242.97L19 20V5.562a2 2 0 0 0-1.515-1.94l-4-1A2 2 0 0 0 11 4.561z",key:"au4z13"}],["path",{d:"M11 4H8a2 2 0 0 0-2 2v14",key:"74r1mk"}],["path",{d:"M14 12h.01",key:"1jfl7z"}],["path",{d:"M22 20h-3",key:"vhrsz"}]],c0=be("door-open",a0);/**
132
+ * @license lucide-react v0.563.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const u0=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],d0=be("external-link",u0);/**
137
+ * @license lucide-react v0.563.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const f0=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],p0=be("eye",f0);/**
142
+ * @license lucide-react v0.563.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const h0=[["rect",{width:"8",height:"5",x:"14",y:"17",rx:"1",key:"19aais"}],["path",{d:"M10 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v2.5",key:"1w6v7t"}],["path",{d:"M20 17v-2a2 2 0 1 0-4 0v2",key:"pwaxnr"}]],m0=be("folder-lock",h0);/**
147
+ * @license lucide-react v0.563.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const g0=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],x0=be("globe",g0);/**
152
+ * @license lucide-react v0.563.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const y0=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],v0=be("key-round",y0);/**
157
+ * @license lucide-react v0.563.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const w0=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],N0=be("layout-dashboard",w0);/**
162
+ * @license lucide-react v0.563.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const b0=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],k0=be("lock",b0);/**
167
+ * @license lucide-react v0.563.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const S0=[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],j0=be("package-check",S0);/**
172
+ * @license lucide-react v0.563.0 - ISC
173
+ *
174
+ * This source code is licensed under the ISC license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const C0=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],E0=be("plug",C0);/**
177
+ * @license lucide-react v0.563.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const _0=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],R0=be("refresh-cw",_0);/**
182
+ * @license lucide-react v0.563.0 - ISC
183
+ *
184
+ * This source code is licensed under the ISC license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ */const T0=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 12h10",key:"b7w52i"}]],P0=be("scan-line",T0);/**
187
+ * @license lucide-react v0.563.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */const L0=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]],A0=be("scan-search",L0);/**
192
+ * @license lucide-react v0.563.0 - ISC
193
+ *
194
+ * This source code is licensed under the ISC license.
195
+ * See the LICENSE file in the root directory of this source tree.
196
+ */const O0=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],I0=be("settings",O0);/**
197
+ * @license lucide-react v0.563.0 - ISC
198
+ *
199
+ * This source code is licensed under the ISC license.
200
+ * See the LICENSE file in the root directory of this source tree.
201
+ */const M0=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],D0=be("shield-alert",M0);/**
202
+ * @license lucide-react v0.563.0 - ISC
203
+ *
204
+ * This source code is licensed under the ISC license.
205
+ * See the LICENSE file in the root directory of this source tree.
206
+ */const F0=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],B0=be("shield-check",F0);/**
207
+ * @license lucide-react v0.563.0 - ISC
208
+ *
209
+ * This source code is licensed under the ISC license.
210
+ * See the LICENSE file in the root directory of this source tree.
211
+ */const z0=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],$0=be("shield",z0);/**
212
+ * @license lucide-react v0.563.0 - ISC
213
+ *
214
+ * This source code is licensed under the ISC license.
215
+ * See the LICENSE file in the root directory of this source tree.
216
+ */const U0=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],H0=be("terminal",U0);/**
217
+ * @license lucide-react v0.563.0 - ISC
218
+ *
219
+ * This source code is licensed under the ISC license.
220
+ * See the LICENSE file in the root directory of this source tree.
221
+ */const W0=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Hd=be("triangle-alert",W0);/**
222
+ * @license lucide-react v0.563.0 - ISC
223
+ *
224
+ * This source code is licensed under the ISC license.
225
+ * See the LICENSE file in the root directory of this source tree.
226
+ */const V0=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],K0=be("user-check",V0),q0=[{to:"/",label:"Dashboard",icon:N0},{to:"/security",label:"Security Setup",icon:B0},{to:"/sessions",label:"Session Monitor",icon:Gm},{to:"/threats",label:"Threat Center",icon:Hd},{to:"/interception",label:"Command Interceptor",icon:D0},{to:"/skill-scanner",label:"Skill Scanner",icon:A0},{to:"/access",label:"Access Control",icon:k0},{to:"/openclaw",label:"OpenClaw Config",icon:Jm}];function Q0(){return i.jsxs("aside",{className:"flex h-screen w-64 flex-col bg-sidebar border-r border-gray-800",children:[i.jsxs("div",{className:"flex h-14 items-center gap-3 px-6 border-b border-gray-800",children:[i.jsx("img",{src:"/safeclaw_icon.png",alt:"SafeClaw",className:"h-8 w-8 object-contain"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:"text-xl font-bold",children:[i.jsx("span",{className:"text-white",children:"Safe"}),i.jsx("span",{className:"text-red-500",style:{textShadow:"0 0 8px rgba(239, 68, 68, 0.6), 0 0 20px rgba(239, 68, 68, 0.3)"},children:"Claw"})]}),i.jsx("span",{className:"text-xs text-gray-500",children:"v0.1.0"})]})]}),i.jsx("nav",{className:"flex-1 px-3 py-4 space-y-1",children:q0.map(r=>i.jsxs(Ui,{to:r.to,end:r.to==="/",className:({isActive:o})=>`flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium transition-colors ${o?"bg-primary/10 text-primary":"text-gray-400 hover:bg-gray-800 hover:text-gray-200"}`,children:[i.jsx(r.icon,{size:18}),r.label]},r.to))}),i.jsx("div",{className:"px-3 pb-4 border-t border-gray-800 pt-2",children:i.jsxs(Ui,{to:"/settings",className:({isActive:r})=>`flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium transition-colors ${r?"bg-primary/10 text-primary":"text-gray-400 hover:bg-gray-800 hover:text-gray-200"}`,children:[i.jsx(I0,{size:18}),"Settings"]})})]})}const Ut=Object.create(null);Ut.open="0";Ut.close="1";Ut.ping="2";Ut.pong="3";Ut.message="4";Ut.upgrade="5";Ut.noop="6";const Ro=Object.create(null);Object.keys(Ut).forEach(r=>{Ro[Ut[r]]=r});const Wi={type:"error",data:"parser error"},Wd=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Vd=typeof ArrayBuffer=="function",Kd=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,sa=({type:r,data:o},l,c)=>Wd&&o instanceof Blob?l?c(o):ud(o,c):Vd&&(o instanceof ArrayBuffer||Kd(o))?l?c(o):ud(new Blob([o]),c):c(Ut[r]+(o||"")),ud=(r,o)=>{const l=new FileReader;return l.onload=function(){const c=l.result.split(",")[1];o("b"+(c||""))},l.readAsDataURL(r)};function dd(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let Oi;function Y0(r,o){if(Wd&&r.data instanceof Blob)return r.data.arrayBuffer().then(dd).then(o);if(Vd&&(r.data instanceof ArrayBuffer||Kd(r.data)))return o(dd(r.data));sa(r,!1,l=>{Oi||(Oi=new TextEncoder),o(Oi.encode(l))})}const fd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",as=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<fd.length;r++)as[fd.charCodeAt(r)]=r;const G0=r=>{let o=r.length*.75,l=r.length,c,d=0,p,h,x,y;r[r.length-1]==="="&&(o--,r[r.length-2]==="="&&o--);const b=new ArrayBuffer(o),N=new Uint8Array(b);for(c=0;c<l;c+=4)p=as[r.charCodeAt(c)],h=as[r.charCodeAt(c+1)],x=as[r.charCodeAt(c+2)],y=as[r.charCodeAt(c+3)],N[d++]=p<<2|h>>4,N[d++]=(h&15)<<4|x>>2,N[d++]=(x&3)<<6|y&63;return b},X0=typeof ArrayBuffer=="function",oa=(r,o)=>{if(typeof r!="string")return{type:"message",data:qd(r,o)};const l=r.charAt(0);return l==="b"?{type:"message",data:J0(r.substring(1),o)}:Ro[l]?r.length>1?{type:Ro[l],data:r.substring(1)}:{type:Ro[l]}:Wi},J0=(r,o)=>{if(X0){const l=G0(r);return qd(l,o)}else return{base64:!0,data:r}},qd=(r,o)=>{switch(o){case"blob":return r instanceof Blob?r:new Blob([r]);case"arraybuffer":default:return r instanceof ArrayBuffer?r:r.buffer}},Qd="",Z0=(r,o)=>{const l=r.length,c=new Array(l);let d=0;r.forEach((p,h)=>{sa(p,!1,x=>{c[h]=x,++d===l&&o(c.join(Qd))})})},eg=(r,o)=>{const l=r.split(Qd),c=[];for(let d=0;d<l.length;d++){const p=oa(l[d],o);if(c.push(p),p.type==="error")break}return c};function tg(){return new TransformStream({transform(r,o){Y0(r,l=>{const c=l.length;let d;if(c<126)d=new Uint8Array(1),new DataView(d.buffer).setUint8(0,c);else if(c<65536){d=new Uint8Array(3);const p=new DataView(d.buffer);p.setUint8(0,126),p.setUint16(1,c)}else{d=new Uint8Array(9);const p=new DataView(d.buffer);p.setUint8(0,127),p.setBigUint64(1,BigInt(c))}r.data&&typeof r.data!="string"&&(d[0]|=128),o.enqueue(d),o.enqueue(l)})}})}let Ii;function ko(r){return r.reduce((o,l)=>o+l.length,0)}function So(r,o){if(r[0].length===o)return r.shift();const l=new Uint8Array(o);let c=0;for(let d=0;d<o;d++)l[d]=r[0][c++],c===r[0].length&&(r.shift(),c=0);return r.length&&c<r[0].length&&(r[0]=r[0].slice(c)),l}function ng(r,o){Ii||(Ii=new TextDecoder);const l=[];let c=0,d=-1,p=!1;return new TransformStream({transform(h,x){for(l.push(h);;){if(c===0){if(ko(l)<1)break;const y=So(l,1);p=(y[0]&128)===128,d=y[0]&127,d<126?c=3:d===126?c=1:c=2}else if(c===1){if(ko(l)<2)break;const y=So(l,2);d=new DataView(y.buffer,y.byteOffset,y.length).getUint16(0),c=3}else if(c===2){if(ko(l)<8)break;const y=So(l,8),b=new DataView(y.buffer,y.byteOffset,y.length),N=b.getUint32(0);if(N>Math.pow(2,21)-1){x.enqueue(Wi);break}d=N*Math.pow(2,32)+b.getUint32(4),c=3}else{if(ko(l)<d)break;const y=So(l,d);x.enqueue(oa(p?y:Ii.decode(y),o)),c=0}if(d===0||d>r){x.enqueue(Wi);break}}}})}const Yd=4;function Be(r){if(r)return rg(r)}function rg(r){for(var o in Be.prototype)r[o]=Be.prototype[o];return r}Be.prototype.on=Be.prototype.addEventListener=function(r,o){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(o),this};Be.prototype.once=function(r,o){function l(){this.off(r,l),o.apply(this,arguments)}return l.fn=o,this.on(r,l),this};Be.prototype.off=Be.prototype.removeListener=Be.prototype.removeAllListeners=Be.prototype.removeEventListener=function(r,o){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var l=this._callbacks["$"+r];if(!l)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var c,d=0;d<l.length;d++)if(c=l[d],c===o||c.fn===o){l.splice(d,1);break}return l.length===0&&delete this._callbacks["$"+r],this};Be.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var o=new Array(arguments.length-1),l=this._callbacks["$"+r],c=1;c<arguments.length;c++)o[c-1]=arguments[c];if(l){l=l.slice(0);for(var c=0,d=l.length;c<d;++c)l[c].apply(this,o)}return this};Be.prototype.emitReserved=Be.prototype.emit;Be.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};Be.prototype.hasListeners=function(r){return!!this.listeners(r).length};const Mo=typeof Promise=="function"&&typeof Promise.resolve=="function"?o=>Promise.resolve().then(o):(o,l)=>l(o,0),Nt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),sg="arraybuffer";function Gd(r,...o){return o.reduce((l,c)=>(r.hasOwnProperty(c)&&(l[c]=r[c]),l),{})}const og=Nt.setTimeout,lg=Nt.clearTimeout;function Do(r,o){o.useNativeTimers?(r.setTimeoutFn=og.bind(Nt),r.clearTimeoutFn=lg.bind(Nt)):(r.setTimeoutFn=Nt.setTimeout.bind(Nt),r.clearTimeoutFn=Nt.clearTimeout.bind(Nt))}const ig=1.33;function ag(r){return typeof r=="string"?cg(r):Math.ceil((r.byteLength||r.size)*ig)}function cg(r){let o=0,l=0;for(let c=0,d=r.length;c<d;c++)o=r.charCodeAt(c),o<128?l+=1:o<2048?l+=2:o<55296||o>=57344?l+=3:(c++,l+=4);return l}function Xd(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function ug(r){let o="";for(let l in r)r.hasOwnProperty(l)&&(o.length&&(o+="&"),o+=encodeURIComponent(l)+"="+encodeURIComponent(r[l]));return o}function dg(r){let o={},l=r.split("&");for(let c=0,d=l.length;c<d;c++){let p=l[c].split("=");o[decodeURIComponent(p[0])]=decodeURIComponent(p[1])}return o}class fg extends Error{constructor(o,l,c){super(o),this.description=l,this.context=c,this.type="TransportError"}}class la extends Be{constructor(o){super(),this.writable=!1,Do(this,o),this.opts=o,this.query=o.query,this.socket=o.socket,this.supportsBinary=!o.forceBase64}onError(o,l,c){return super.emitReserved("error",new fg(o,l,c)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(o){this.readyState==="open"&&this.write(o)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(o){const l=oa(o,this.socket.binaryType);this.onPacket(l)}onPacket(o){super.emitReserved("packet",o)}onClose(o){this.readyState="closed",super.emitReserved("close",o)}pause(o){}createUri(o,l={}){return o+"://"+this._hostname()+this._port()+this.opts.path+this._query(l)}_hostname(){const o=this.opts.hostname;return o.indexOf(":")===-1?o:"["+o+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(o){const l=ug(o);return l.length?"?"+l:""}}class pg extends la{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(o){this.readyState="pausing";const l=()=>{this.readyState="paused",o()};if(this._polling||!this.writable){let c=0;this._polling&&(c++,this.once("pollComplete",function(){--c||l()})),this.writable||(c++,this.once("drain",function(){--c||l()}))}else l()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(o){const l=c=>{if(this.readyState==="opening"&&c.type==="open"&&this.onOpen(),c.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(c)};eg(o,this.socket.binaryType).forEach(l),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const o=()=>{this.write([{type:"close"}])};this.readyState==="open"?o():this.once("open",o)}write(o){this.writable=!1,Z0(o,l=>{this.doWrite(l,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const o=this.opts.secure?"https":"http",l=this.query||{};return this.opts.timestampRequests!==!1&&(l[this.opts.timestampParam]=Xd()),!this.supportsBinary&&!l.sid&&(l.b64=1),this.createUri(o,l)}}let Jd=!1;try{Jd=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const hg=Jd;function mg(){}class gg extends pg{constructor(o){if(super(o),typeof location<"u"){const l=location.protocol==="https:";let c=location.port;c||(c=l?"443":"80"),this.xd=typeof location<"u"&&o.hostname!==location.hostname||c!==o.port}}doWrite(o,l){const c=this.request({method:"POST",data:o});c.on("success",l),c.on("error",(d,p)=>{this.onError("xhr post error",d,p)})}doPoll(){const o=this.request();o.on("data",this.onData.bind(this)),o.on("error",(l,c)=>{this.onError("xhr poll error",l,c)}),this.pollXhr=o}}class zt extends Be{constructor(o,l,c){super(),this.createRequest=o,Do(this,c),this._opts=c,this._method=c.method||"GET",this._uri=l,this._data=c.data!==void 0?c.data:null,this._create()}_create(){var o;const l=Gd(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");l.xdomain=!!this._opts.xd;const c=this._xhr=this.createRequest(l);try{c.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){c.setDisableHeaderCheck&&c.setDisableHeaderCheck(!0);for(let d in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(d)&&c.setRequestHeader(d,this._opts.extraHeaders[d])}}catch{}if(this._method==="POST")try{c.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{c.setRequestHeader("Accept","*/*")}catch{}(o=this._opts.cookieJar)===null||o===void 0||o.addCookies(c),"withCredentials"in c&&(c.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(c.timeout=this._opts.requestTimeout),c.onreadystatechange=()=>{var d;c.readyState===3&&((d=this._opts.cookieJar)===null||d===void 0||d.parseCookies(c.getResponseHeader("set-cookie"))),c.readyState===4&&(c.status===200||c.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof c.status=="number"?c.status:0)},0))},c.send(this._data)}catch(d){this.setTimeoutFn(()=>{this._onError(d)},0);return}typeof document<"u"&&(this._index=zt.requestsCount++,zt.requests[this._index]=this)}_onError(o){this.emitReserved("error",o,this._xhr),this._cleanup(!0)}_cleanup(o){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=mg,o)try{this._xhr.abort()}catch{}typeof document<"u"&&delete zt.requests[this._index],this._xhr=null}}_onLoad(){const o=this._xhr.responseText;o!==null&&(this.emitReserved("data",o),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}zt.requestsCount=0;zt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",pd);else if(typeof addEventListener=="function"){const r="onpagehide"in Nt?"pagehide":"unload";addEventListener(r,pd,!1)}}function pd(){for(let r in zt.requests)zt.requests.hasOwnProperty(r)&&zt.requests[r].abort()}const xg=(function(){const r=Zd({xdomain:!1});return r&&r.responseType!==null})();class yg extends gg{constructor(o){super(o);const l=o&&o.forceBase64;this.supportsBinary=xg&&!l}request(o={}){return Object.assign(o,{xd:this.xd},this.opts),new zt(Zd,this.uri(),o)}}function Zd(r){const o=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!o||hg))return new XMLHttpRequest}catch{}if(!o)try{return new Nt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const ef=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class vg extends la{get name(){return"websocket"}doOpen(){const o=this.uri(),l=this.opts.protocols,c=ef?{}:Gd(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(c.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(o,l,c)}catch(d){return this.emitReserved("error",d)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=o=>this.onClose({description:"websocket connection closed",context:o}),this.ws.onmessage=o=>this.onData(o.data),this.ws.onerror=o=>this.onError("websocket error",o)}write(o){this.writable=!1;for(let l=0;l<o.length;l++){const c=o[l],d=l===o.length-1;sa(c,this.supportsBinary,p=>{try{this.doWrite(c,p)}catch{}d&&Mo(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const o=this.opts.secure?"wss":"ws",l=this.query||{};return this.opts.timestampRequests&&(l[this.opts.timestampParam]=Xd()),this.supportsBinary||(l.b64=1),this.createUri(o,l)}}const Mi=Nt.WebSocket||Nt.MozWebSocket;class wg extends vg{createSocket(o,l,c){return ef?new Mi(o,l,c):l?new Mi(o,l):new Mi(o)}doWrite(o,l){this.ws.send(l)}}class Ng extends la{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(o){return this.emitReserved("error",o)}this._transport.closed.then(()=>{this.onClose()}).catch(o=>{this.onError("webtransport error",o)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(o=>{const l=ng(Number.MAX_SAFE_INTEGER,this.socket.binaryType),c=o.readable.pipeThrough(l).getReader(),d=tg();d.readable.pipeTo(o.writable),this._writer=d.writable.getWriter();const p=()=>{c.read().then(({done:x,value:y})=>{x||(this.onPacket(y),p())}).catch(x=>{})};p();const h={type:"open"};this.query.sid&&(h.data=`{"sid":"${this.query.sid}"}`),this._writer.write(h).then(()=>this.onOpen())})})}write(o){this.writable=!1;for(let l=0;l<o.length;l++){const c=o[l],d=l===o.length-1;this._writer.write(c).then(()=>{d&&Mo(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var o;(o=this._transport)===null||o===void 0||o.close()}}const bg={websocket:wg,webtransport:Ng,polling:yg},kg=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Sg=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Vi(r){if(r.length>8e3)throw"URI too long";const o=r,l=r.indexOf("["),c=r.indexOf("]");l!=-1&&c!=-1&&(r=r.substring(0,l)+r.substring(l,c).replace(/:/g,";")+r.substring(c,r.length));let d=kg.exec(r||""),p={},h=14;for(;h--;)p[Sg[h]]=d[h]||"";return l!=-1&&c!=-1&&(p.source=o,p.host=p.host.substring(1,p.host.length-1).replace(/;/g,":"),p.authority=p.authority.replace("[","").replace("]","").replace(/;/g,":"),p.ipv6uri=!0),p.pathNames=jg(p,p.path),p.queryKey=Cg(p,p.query),p}function jg(r,o){const l=/\/{2,9}/g,c=o.replace(l,"/").split("/");return(o.slice(0,1)=="/"||o.length===0)&&c.splice(0,1),o.slice(-1)=="/"&&c.splice(c.length-1,1),c}function Cg(r,o){const l={};return o.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(c,d,p){d&&(l[d]=p)}),l}const Ki=typeof addEventListener=="function"&&typeof removeEventListener=="function",To=[];Ki&&addEventListener("offline",()=>{To.forEach(r=>r())},!1);class Pn extends Be{constructor(o,l){if(super(),this.binaryType=sg,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,o&&typeof o=="object"&&(l=o,o=null),o){const c=Vi(o);l.hostname=c.host,l.secure=c.protocol==="https"||c.protocol==="wss",l.port=c.port,c.query&&(l.query=c.query)}else l.host&&(l.hostname=Vi(l.host).host);Do(this,l),this.secure=l.secure!=null?l.secure:typeof location<"u"&&location.protocol==="https:",l.hostname&&!l.port&&(l.port=this.secure?"443":"80"),this.hostname=l.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=l.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},l.transports.forEach(c=>{const d=c.prototype.name;this.transports.push(d),this._transportsByName[d]=c}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},l),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=dg(this.opts.query)),Ki&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},To.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(o){const l=Object.assign({},this.opts.query);l.EIO=Yd,l.transport=o,this.id&&(l.sid=this.id);const c=Object.assign({},this.opts,{query:l,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[o]);return new this._transportsByName[o](c)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const o=this.opts.rememberUpgrade&&Pn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const l=this.createTransport(o);l.open(),this.setTransport(l)}setTransport(o){this.transport&&this.transport.removeAllListeners(),this.transport=o,o.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",l=>this._onClose("transport close",l))}onOpen(){this.readyState="open",Pn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(o){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",o),this.emitReserved("heartbeat"),o.type){case"open":this.onHandshake(JSON.parse(o.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const l=new Error("server error");l.code=o.data,this._onError(l);break;case"message":this.emitReserved("data",o.data),this.emitReserved("message",o.data);break}}onHandshake(o){this.emitReserved("handshake",o),this.id=o.sid,this.transport.query.sid=o.sid,this._pingInterval=o.pingInterval,this._pingTimeout=o.pingTimeout,this._maxPayload=o.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const o=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+o,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},o),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const o=this._getWritablePackets();this.transport.send(o),this._prevBufferLen=o.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let l=1;for(let c=0;c<this.writeBuffer.length;c++){const d=this.writeBuffer[c].data;if(d&&(l+=ag(d)),c>0&&l>this._maxPayload)return this.writeBuffer.slice(0,c);l+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const o=Date.now()>this._pingTimeoutTime;return o&&(this._pingTimeoutTime=0,Mo(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),o}write(o,l,c){return this._sendPacket("message",o,l,c),this}send(o,l,c){return this._sendPacket("message",o,l,c),this}_sendPacket(o,l,c,d){if(typeof l=="function"&&(d=l,l=void 0),typeof c=="function"&&(d=c,c=null),this.readyState==="closing"||this.readyState==="closed")return;c=c||{},c.compress=c.compress!==!1;const p={type:o,data:l,options:c};this.emitReserved("packetCreate",p),this.writeBuffer.push(p),d&&this.once("flush",d),this.flush()}close(){const o=()=>{this._onClose("forced close"),this.transport.close()},l=()=>{this.off("upgrade",l),this.off("upgradeError",l),o()},c=()=>{this.once("upgrade",l),this.once("upgradeError",l)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?c():o()}):this.upgrading?c():o()),this}_onError(o){if(Pn.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",o),this._onClose("transport error",o)}_onClose(o,l){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Ki&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const c=To.indexOf(this._offlineEventListener);c!==-1&&To.splice(c,1)}this.readyState="closed",this.id=null,this.emitReserved("close",o,l),this.writeBuffer=[],this._prevBufferLen=0}}}Pn.protocol=Yd;class Eg extends Pn{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let o=0;o<this._upgrades.length;o++)this._probe(this._upgrades[o])}_probe(o){let l=this.createTransport(o),c=!1;Pn.priorWebsocketSuccess=!1;const d=()=>{c||(l.send([{type:"ping",data:"probe"}]),l.once("packet",C=>{if(!c)if(C.type==="pong"&&C.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",l),!l)return;Pn.priorWebsocketSuccess=l.name==="websocket",this.transport.pause(()=>{c||this.readyState!=="closed"&&(N(),this.setTransport(l),l.send([{type:"upgrade"}]),this.emitReserved("upgrade",l),l=null,this.upgrading=!1,this.flush())})}else{const P=new Error("probe error");P.transport=l.name,this.emitReserved("upgradeError",P)}}))};function p(){c||(c=!0,N(),l.close(),l=null)}const h=C=>{const P=new Error("probe error: "+C);P.transport=l.name,p(),this.emitReserved("upgradeError",P)};function x(){h("transport closed")}function y(){h("socket closed")}function b(C){l&&C.name!==l.name&&p()}const N=()=>{l.removeListener("open",d),l.removeListener("error",h),l.removeListener("close",x),this.off("close",y),this.off("upgrading",b)};l.once("open",d),l.once("error",h),l.once("close",x),this.once("close",y),this.once("upgrading",b),this._upgrades.indexOf("webtransport")!==-1&&o!=="webtransport"?this.setTimeoutFn(()=>{c||l.open()},200):l.open()}onHandshake(o){this._upgrades=this._filterUpgrades(o.upgrades),super.onHandshake(o)}_filterUpgrades(o){const l=[];for(let c=0;c<o.length;c++)~this.transports.indexOf(o[c])&&l.push(o[c]);return l}}let _g=class extends Eg{constructor(o,l={}){const c=typeof o=="object"?o:l;(!c.transports||c.transports&&typeof c.transports[0]=="string")&&(c.transports=(c.transports||["polling","websocket","webtransport"]).map(d=>bg[d]).filter(d=>!!d)),super(o,c)}};function Rg(r,o="",l){let c=r;l=l||typeof location<"u"&&location,r==null&&(r=l.protocol+"//"+l.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=l.protocol+r:r=l.host+r),/^(https?|wss?):\/\//.test(r)||(typeof l<"u"?r=l.protocol+"//"+r:r="https://"+r),c=Vi(r)),c.port||(/^(http|ws)$/.test(c.protocol)?c.port="80":/^(http|ws)s$/.test(c.protocol)&&(c.port="443")),c.path=c.path||"/";const p=c.host.indexOf(":")!==-1?"["+c.host+"]":c.host;return c.id=c.protocol+"://"+p+":"+c.port+o,c.href=c.protocol+"://"+p+(l&&l.port===c.port?"":":"+c.port),c}const Tg=typeof ArrayBuffer=="function",Pg=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,tf=Object.prototype.toString,Lg=typeof Blob=="function"||typeof Blob<"u"&&tf.call(Blob)==="[object BlobConstructor]",Ag=typeof File=="function"||typeof File<"u"&&tf.call(File)==="[object FileConstructor]";function ia(r){return Tg&&(r instanceof ArrayBuffer||Pg(r))||Lg&&r instanceof Blob||Ag&&r instanceof File}function Po(r,o){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let l=0,c=r.length;l<c;l++)if(Po(r[l]))return!0;return!1}if(ia(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return Po(r.toJSON(),!0);for(const l in r)if(Object.prototype.hasOwnProperty.call(r,l)&&Po(r[l]))return!0;return!1}function Og(r){const o=[],l=r.data,c=r;return c.data=qi(l,o),c.attachments=o.length,{packet:c,buffers:o}}function qi(r,o){if(!r)return r;if(ia(r)){const l={_placeholder:!0,num:o.length};return o.push(r),l}else if(Array.isArray(r)){const l=new Array(r.length);for(let c=0;c<r.length;c++)l[c]=qi(r[c],o);return l}else if(typeof r=="object"&&!(r instanceof Date)){const l={};for(const c in r)Object.prototype.hasOwnProperty.call(r,c)&&(l[c]=qi(r[c],o));return l}return r}function Ig(r,o){return r.data=Qi(r.data,o),delete r.attachments,r}function Qi(r,o){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<o.length)return o[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let l=0;l<r.length;l++)r[l]=Qi(r[l],o);else if(typeof r=="object")for(const l in r)Object.prototype.hasOwnProperty.call(r,l)&&(r[l]=Qi(r[l],o));return r}const Mg=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var he;(function(r){r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK"})(he||(he={}));class Dg{constructor(o){this.replacer=o}encode(o){return(o.type===he.EVENT||o.type===he.ACK)&&Po(o)?this.encodeAsBinary({type:o.type===he.EVENT?he.BINARY_EVENT:he.BINARY_ACK,nsp:o.nsp,data:o.data,id:o.id}):[this.encodeAsString(o)]}encodeAsString(o){let l=""+o.type;return(o.type===he.BINARY_EVENT||o.type===he.BINARY_ACK)&&(l+=o.attachments+"-"),o.nsp&&o.nsp!=="/"&&(l+=o.nsp+","),o.id!=null&&(l+=o.id),o.data!=null&&(l+=JSON.stringify(o.data,this.replacer)),l}encodeAsBinary(o){const l=Og(o),c=this.encodeAsString(l.packet),d=l.buffers;return d.unshift(c),d}}class aa extends Be{constructor(o){super(),this.reviver=o}add(o){let l;if(typeof o=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");l=this.decodeString(o);const c=l.type===he.BINARY_EVENT;c||l.type===he.BINARY_ACK?(l.type=c?he.EVENT:he.ACK,this.reconstructor=new Fg(l),l.attachments===0&&super.emitReserved("decoded",l)):super.emitReserved("decoded",l)}else if(ia(o)||o.base64)if(this.reconstructor)l=this.reconstructor.takeBinaryData(o),l&&(this.reconstructor=null,super.emitReserved("decoded",l));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+o)}decodeString(o){let l=0;const c={type:Number(o.charAt(0))};if(he[c.type]===void 0)throw new Error("unknown packet type "+c.type);if(c.type===he.BINARY_EVENT||c.type===he.BINARY_ACK){const p=l+1;for(;o.charAt(++l)!=="-"&&l!=o.length;);const h=o.substring(p,l);if(h!=Number(h)||o.charAt(l)!=="-")throw new Error("Illegal attachments");c.attachments=Number(h)}if(o.charAt(l+1)==="/"){const p=l+1;for(;++l&&!(o.charAt(l)===","||l===o.length););c.nsp=o.substring(p,l)}else c.nsp="/";const d=o.charAt(l+1);if(d!==""&&Number(d)==d){const p=l+1;for(;++l;){const h=o.charAt(l);if(h==null||Number(h)!=h){--l;break}if(l===o.length)break}c.id=Number(o.substring(p,l+1))}if(o.charAt(++l)){const p=this.tryParse(o.substr(l));if(aa.isPayloadValid(c.type,p))c.data=p;else throw new Error("invalid payload")}return c}tryParse(o){try{return JSON.parse(o,this.reviver)}catch{return!1}}static isPayloadValid(o,l){switch(o){case he.CONNECT:return hd(l);case he.DISCONNECT:return l===void 0;case he.CONNECT_ERROR:return typeof l=="string"||hd(l);case he.EVENT:case he.BINARY_EVENT:return Array.isArray(l)&&(typeof l[0]=="number"||typeof l[0]=="string"&&Mg.indexOf(l[0])===-1);case he.ACK:case he.BINARY_ACK:return Array.isArray(l)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Fg{constructor(o){this.packet=o,this.buffers=[],this.reconPack=o}takeBinaryData(o){if(this.buffers.push(o),this.buffers.length===this.reconPack.attachments){const l=Ig(this.reconPack,this.buffers);return this.finishedReconstruction(),l}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function hd(r){return Object.prototype.toString.call(r)==="[object Object]"}const Bg=Object.freeze(Object.defineProperty({__proto__:null,Decoder:aa,Encoder:Dg,get PacketType(){return he}},Symbol.toStringTag,{value:"Module"}));function Lt(r,o,l){return r.on(o,l),function(){r.off(o,l)}}const zg=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class nf extends Be{constructor(o,l,c){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=o,this.nsp=l,c&&c.auth&&(this.auth=c.auth),this._opts=Object.assign({},c),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const o=this.io;this.subs=[Lt(o,"open",this.onopen.bind(this)),Lt(o,"packet",this.onpacket.bind(this)),Lt(o,"error",this.onerror.bind(this)),Lt(o,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...o){return o.unshift("message"),this.emit.apply(this,o),this}emit(o,...l){var c,d,p;if(zg.hasOwnProperty(o))throw new Error('"'+o.toString()+'" is a reserved event name');if(l.unshift(o),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(l),this;const h={type:he.EVENT,data:l};if(h.options={},h.options.compress=this.flags.compress!==!1,typeof l[l.length-1]=="function"){const N=this.ids++,C=l.pop();this._registerAckCallback(N,C),h.id=N}const x=(d=(c=this.io.engine)===null||c===void 0?void 0:c.transport)===null||d===void 0?void 0:d.writable,y=this.connected&&!(!((p=this.io.engine)===null||p===void 0)&&p._hasPingExpired());return this.flags.volatile&&!x||(y?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={},this}_registerAckCallback(o,l){var c;const d=(c=this.flags.timeout)!==null&&c!==void 0?c:this._opts.ackTimeout;if(d===void 0){this.acks[o]=l;return}const p=this.io.setTimeoutFn(()=>{delete this.acks[o];for(let x=0;x<this.sendBuffer.length;x++)this.sendBuffer[x].id===o&&this.sendBuffer.splice(x,1);l.call(this,new Error("operation has timed out"))},d),h=(...x)=>{this.io.clearTimeoutFn(p),l.apply(this,x)};h.withError=!0,this.acks[o]=h}emitWithAck(o,...l){return new Promise((c,d)=>{const p=(h,x)=>h?d(h):c(x);p.withError=!0,l.push(p),this.emit(o,...l)})}_addToQueue(o){let l;typeof o[o.length-1]=="function"&&(l=o.pop());const c={id:this._queueSeq++,tryCount:0,pending:!1,args:o,flags:Object.assign({fromQueue:!0},this.flags)};o.push((d,...p)=>(this._queue[0],d!==null?c.tryCount>this._opts.retries&&(this._queue.shift(),l&&l(d)):(this._queue.shift(),l&&l(null,...p)),c.pending=!1,this._drainQueue())),this._queue.push(c),this._drainQueue()}_drainQueue(o=!1){if(!this.connected||this._queue.length===0)return;const l=this._queue[0];l.pending&&!o||(l.pending=!0,l.tryCount++,this.flags=l.flags,this.emit.apply(this,l.args))}packet(o){o.nsp=this.nsp,this.io._packet(o)}onopen(){typeof this.auth=="function"?this.auth(o=>{this._sendConnectPacket(o)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(o){this.packet({type:he.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},o):o})}onerror(o){this.connected||this.emitReserved("connect_error",o)}onclose(o,l){this.connected=!1,delete this.id,this.emitReserved("disconnect",o,l),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(o=>{if(!this.sendBuffer.some(c=>String(c.id)===o)){const c=this.acks[o];delete this.acks[o],c.withError&&c.call(this,new Error("socket has been disconnected"))}})}onpacket(o){if(o.nsp===this.nsp)switch(o.type){case he.CONNECT:o.data&&o.data.sid?this.onconnect(o.data.sid,o.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case he.EVENT:case he.BINARY_EVENT:this.onevent(o);break;case he.ACK:case he.BINARY_ACK:this.onack(o);break;case he.DISCONNECT:this.ondisconnect();break;case he.CONNECT_ERROR:this.destroy();const c=new Error(o.data.message);c.data=o.data.data,this.emitReserved("connect_error",c);break}}onevent(o){const l=o.data||[];o.id!=null&&l.push(this.ack(o.id)),this.connected?this.emitEvent(l):this.receiveBuffer.push(Object.freeze(l))}emitEvent(o){if(this._anyListeners&&this._anyListeners.length){const l=this._anyListeners.slice();for(const c of l)c.apply(this,o)}super.emit.apply(this,o),this._pid&&o.length&&typeof o[o.length-1]=="string"&&(this._lastOffset=o[o.length-1])}ack(o){const l=this;let c=!1;return function(...d){c||(c=!0,l.packet({type:he.ACK,id:o,data:d}))}}onack(o){const l=this.acks[o.id];typeof l=="function"&&(delete this.acks[o.id],l.withError&&o.data.unshift(null),l.apply(this,o.data))}onconnect(o,l){this.id=o,this.recovered=l&&this._pid===l,this._pid=l,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(o=>this.emitEvent(o)),this.receiveBuffer=[],this.sendBuffer.forEach(o=>{this.notifyOutgoingListeners(o),this.packet(o)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(o=>o()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:he.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(o){return this.flags.compress=o,this}get volatile(){return this.flags.volatile=!0,this}timeout(o){return this.flags.timeout=o,this}onAny(o){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(o),this}prependAny(o){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(o),this}offAny(o){if(!this._anyListeners)return this;if(o){const l=this._anyListeners;for(let c=0;c<l.length;c++)if(o===l[c])return l.splice(c,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(o){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(o),this}prependAnyOutgoing(o){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(o),this}offAnyOutgoing(o){if(!this._anyOutgoingListeners)return this;if(o){const l=this._anyOutgoingListeners;for(let c=0;c<l.length;c++)if(o===l[c])return l.splice(c,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(o){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const l=this._anyOutgoingListeners.slice();for(const c of l)c.apply(this,o.data)}}}function wr(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}wr.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var o=Math.random(),l=Math.floor(o*this.jitter*r);r=(Math.floor(o*10)&1)==0?r-l:r+l}return Math.min(r,this.max)|0};wr.prototype.reset=function(){this.attempts=0};wr.prototype.setMin=function(r){this.ms=r};wr.prototype.setMax=function(r){this.max=r};wr.prototype.setJitter=function(r){this.jitter=r};class Yi extends Be{constructor(o,l){var c;super(),this.nsps={},this.subs=[],o&&typeof o=="object"&&(l=o,o=void 0),l=l||{},l.path=l.path||"/socket.io",this.opts=l,Do(this,l),this.reconnection(l.reconnection!==!1),this.reconnectionAttempts(l.reconnectionAttempts||1/0),this.reconnectionDelay(l.reconnectionDelay||1e3),this.reconnectionDelayMax(l.reconnectionDelayMax||5e3),this.randomizationFactor((c=l.randomizationFactor)!==null&&c!==void 0?c:.5),this.backoff=new wr({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(l.timeout==null?2e4:l.timeout),this._readyState="closed",this.uri=o;const d=l.parser||Bg;this.encoder=new d.Encoder,this.decoder=new d.Decoder,this._autoConnect=l.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(o){return arguments.length?(this._reconnection=!!o,o||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(o){return o===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=o,this)}reconnectionDelay(o){var l;return o===void 0?this._reconnectionDelay:(this._reconnectionDelay=o,(l=this.backoff)===null||l===void 0||l.setMin(o),this)}randomizationFactor(o){var l;return o===void 0?this._randomizationFactor:(this._randomizationFactor=o,(l=this.backoff)===null||l===void 0||l.setJitter(o),this)}reconnectionDelayMax(o){var l;return o===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=o,(l=this.backoff)===null||l===void 0||l.setMax(o),this)}timeout(o){return arguments.length?(this._timeout=o,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(o){if(~this._readyState.indexOf("open"))return this;this.engine=new _g(this.uri,this.opts);const l=this.engine,c=this;this._readyState="opening",this.skipReconnect=!1;const d=Lt(l,"open",function(){c.onopen(),o&&o()}),p=x=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",x),o?o(x):this.maybeReconnectOnOpen()},h=Lt(l,"error",p);if(this._timeout!==!1){const x=this._timeout,y=this.setTimeoutFn(()=>{d(),p(new Error("timeout")),l.close()},x);this.opts.autoUnref&&y.unref(),this.subs.push(()=>{this.clearTimeoutFn(y)})}return this.subs.push(d),this.subs.push(h),this}connect(o){return this.open(o)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const o=this.engine;this.subs.push(Lt(o,"ping",this.onping.bind(this)),Lt(o,"data",this.ondata.bind(this)),Lt(o,"error",this.onerror.bind(this)),Lt(o,"close",this.onclose.bind(this)),Lt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(o){try{this.decoder.add(o)}catch(l){this.onclose("parse error",l)}}ondecoded(o){Mo(()=>{this.emitReserved("packet",o)},this.setTimeoutFn)}onerror(o){this.emitReserved("error",o)}socket(o,l){let c=this.nsps[o];return c?this._autoConnect&&!c.active&&c.connect():(c=new nf(this,o,l),this.nsps[o]=c),c}_destroy(o){const l=Object.keys(this.nsps);for(const c of l)if(this.nsps[c].active)return;this._close()}_packet(o){const l=this.encoder.encode(o);for(let c=0;c<l.length;c++)this.engine.write(l[c],o.options)}cleanup(){this.subs.forEach(o=>o()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(o,l){var c;this.cleanup(),(c=this.engine)===null||c===void 0||c.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",o,l),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const o=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const l=this.backoff.duration();this._reconnecting=!0;const c=this.setTimeoutFn(()=>{o.skipReconnect||(this.emitReserved("reconnect_attempt",o.backoff.attempts),!o.skipReconnect&&o.open(d=>{d?(o._reconnecting=!1,o.reconnect(),this.emitReserved("reconnect_error",d)):o.onreconnect()}))},l);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}}onreconnect(){const o=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",o)}}const ls={};function Lo(r,o){typeof r=="object"&&(o=r,r=void 0),o=o||{};const l=Rg(r,o.path||"/socket.io"),c=l.source,d=l.id,p=l.path,h=ls[d]&&p in ls[d].nsps,x=o.forceNew||o["force new connection"]||o.multiplex===!1||h;let y;return x?y=new Yi(c,o):(ls[d]||(ls[d]=new Yi(c,o)),y=ls[d]),l.query&&!o.query&&(o.query=l.queryKey),y.socket(l.path,o)}Object.assign(Lo,{Manager:Yi,Socket:nf,io:Lo,connect:Lo});const $g=window.location.origin,B=Lo($g,{autoConnect:!0,reconnection:!0,reconnectionDelay:1e3,reconnectionAttempts:10});function Ug(){const[r,o]=g.useState(null);g.useEffect(()=>(B.emit("safeclaw:getOpenclawMonitorStatus"),B.on("safeclaw:openclawMonitorStatus",o),()=>{B.off("safeclaw:openclawMonitorStatus",o)}),[]);const l=(r==null?void 0:r.connectionStatus)==="connected"?"bg-success":(r==null?void 0:r.connectionStatus)==="connecting"?"bg-warning animate-pulse":"bg-danger",c=(r==null?void 0:r.connectionStatus)==="connected"?"Connected":(r==null?void 0:r.connectionStatus)==="connecting"?"Connecting":(r==null?void 0:r.connectionStatus)==="not_configured"?"Not Configured":"Disconnected";return i.jsx("div",{className:"flex items-center gap-4 text-sm",children:i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:`h-2 w-2 rounded-full ${l}`}),i.jsxs("span",{className:"text-gray-500 text-xs",children:["OpenClaw: ",c]})]})})}function Hg(){return i.jsxs("div",{className:"flex h-screen bg-sidebar",children:[i.jsx(Q0,{}),i.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[i.jsxs("header",{className:"flex h-14 items-center border-b border-gray-800 px-6 border-t-2 border-t-primary",children:[i.jsx("h1",{className:"text-sm font-medium text-gray-300",children:"AI Agents Connected"}),i.jsx("div",{className:"ml-4",children:i.jsx(Ug,{})})]}),i.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:i.jsx(cm,{})})]})]})}const md={CRITICAL:"text-danger",HIGH:"text-warning",MEDIUM:"text-yellow-400",LOW:"text-blue-400",NONE:"text-success"},Wg={CRITICAL:"bg-danger",HIGH:"bg-warning",MEDIUM:"bg-yellow-400",LOW:"bg-blue-400"};function Vg(){var x,y;const[r,o]=g.useState(null),[l,c]=g.useState([]),d=g.useCallback(b=>{c(N=>N.some(C=>C.id===b.id)?N:[b,...N].slice(0,10))},[]),p=g.useCallback(b=>{o(N=>N&&{...N,execApprovalTotal:N.execApprovalTotal+1,execApprovalPending:N.execApprovalPending+1})},[]),h=g.useCallback(b=>{o(N=>N&&{...N,execApprovalPending:Math.max(0,N.execApprovalPending-1),execApprovalBlocked:b.decision==="deny"?N.execApprovalBlocked+1:N.execApprovalBlocked,execApprovalAllowed:b.decision==="allow-once"||b.decision==="allow-always"?N.execApprovalAllowed+1:N.execApprovalAllowed})},[]);return g.useEffect(()=>(B.emit("safeclaw:getStats"),B.emit("safeclaw:getOpenclawActivities",{limit:10}),B.on("safeclaw:stats",o),B.on("safeclaw:openclawActivity",d),B.on("safeclaw:execApprovalRequested",p),B.on("safeclaw:execApprovalResolved",h),()=>{B.off("safeclaw:stats",o),B.off("safeclaw:openclawActivity",d),B.off("safeclaw:execApprovalRequested",p),B.off("safeclaw:execApprovalResolved",h)}),[d,p,h]),i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Dashboard Overview"}),r?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4 mb-8",children:[i.jsx(xr,{label:"Total Commands",value:r.execApprovalTotal}),i.jsx(xr,{label:"Blocked",value:r.execApprovalBlocked,color:"text-danger"}),i.jsx(xr,{label:"Allowed",value:r.execApprovalAllowed,color:"text-success"}),i.jsx(xr,{label:"Pending",value:r.execApprovalPending,color:"text-warning"})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-8",children:[i.jsx(xr,{label:"Agent Activities",value:r.openclawActivities??0,color:"text-gray-100"}),i.jsx(xr,{label:"Active Agent Sessions",value:r.openclawActiveSessions??0,color:"text-gray-100"}),i.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900 p-6",children:[i.jsx("p",{className:"text-sm text-gray-400",children:"Threat Detection Rate"}),i.jsxs("p",{className:"text-3xl font-bold mt-1 text-gray-100",children:[((x=r.threatDetectionRate)==null?void 0:x.activitiesWithThreats)??0,i.jsxs("span",{className:"text-lg text-gray-500",children:[" ","/ ",((y=r.threatDetectionRate)==null?void 0:y.totalActivities)??0]})]}),i.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[r.threatDetectionRate&&r.threatDetectionRate.totalActivities>0?`${Math.round(r.threatDetectionRate.activitiesWithThreats/r.threatDetectionRate.totalActivities*100)}%`:"N/A"," ","of activities triggered findings"]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900 p-6",children:[i.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-4",children:"Threat Results"}),i.jsxs("div",{className:"space-y-3",children:[["CRITICAL","HIGH","MEDIUM","LOW"].map(b=>{var I,W;const N=((I=r.openclawThreatBreakdown)==null?void 0:I[b])??0,C=((W=r.resolvedThreatBreakdown)==null?void 0:W[b])??0,P=N>0?Math.round(C/N*100):0;return N===0?null:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-1",children:[i.jsx("span",{className:`text-xs font-medium ${md[b]}`,children:b}),i.jsxs("span",{className:"text-xs text-gray-500",children:[C," resolved out of ",N," (",P,"%)"]})]}),i.jsx("div",{className:"w-full h-1.5 bg-gray-800 rounded-full",children:i.jsx("div",{className:`h-1.5 rounded-full ${Wg[b]}`,style:{width:`${P}%`}})})]},b)}),["CRITICAL","HIGH","MEDIUM","LOW"].every(b=>{var N;return(((N=r.openclawThreatBreakdown)==null?void 0:N[b])??0)===0})&&i.jsx("p",{className:"text-xs text-gray-500",children:"No threats detected yet."})]})]}),i.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900 p-6",children:[i.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-4",children:"Recent Activity"}),l.length===0?i.jsx("p",{className:"text-sm text-gray-500",children:"No activities recorded yet. Activity will appear here as your AI agent runs."}):i.jsx("div",{className:"space-y-2 max-h-[280px] overflow-y-auto pr-2",children:l.map(b=>i.jsxs("div",{className:"flex items-center gap-3 py-2 border-b border-gray-800 last:border-0",children:[i.jsx("span",{className:`text-xs font-medium ${md[b.threatLevel]}`,children:b.threatLevel}),i.jsx("span",{className:"text-xs text-gray-500",children:b.activityType}),i.jsx("span",{className:"text-xs text-gray-300 flex-1 truncate",children:b.detail}),i.jsx("span",{className:"text-xs text-gray-600",children:new Date(b.timestamp).toLocaleTimeString()})]},b.id))})]})]})]}):i.jsx("p",{className:"text-gray-500",children:"Loading stats..."})]})}function xr({label:r,value:o,color:l="text-white"}){return i.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900 p-6",children:[i.jsx("p",{className:"text-sm text-gray-400",children:r}),i.jsx("p",{className:`text-3xl font-bold mt-1 ${l}`,children:o})]})}const Kg={"allow-once":"text-success","allow-always":"text-blue-400",deny:"text-danger"},qg={"allow-once":"ALLOWED","allow-always":"UNRESTRICTED",deny:"BLOCKED"};function Qg({entry:r,onDecision:o}){const[l,c]=g.useState(()=>{const d=new Date(r.expiresAt).getTime()-Date.now();return Math.max(0,Math.ceil(d/1e3))});return g.useEffect(()=>{const d=setInterval(()=>{const p=new Date(r.expiresAt).getTime()-Date.now(),h=Math.max(0,Math.ceil(p/1e3));c(h),h<=0&&clearInterval(d)},1e3);return()=>clearInterval(d)},[r.expiresAt]),i.jsx("div",{className:"rounded-xl border border-warning/30 bg-gray-900 p-4",children:i.jsxs("div",{className:"flex items-start justify-between gap-4",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("code",{className:"text-sm text-gray-200 break-all",children:r.command}),i.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[i.jsx("span",{className:"text-xs text-gray-500",children:r.cwd}),i.jsxs("span",{className:`text-xs font-medium ${l<=10?"text-danger":"text-warning"}`,children:[l,"s remaining"]})]})]}),i.jsxs("div",{className:"flex gap-2 shrink-0",children:[i.jsx("button",{type:"button",onClick:()=>o(r.id,"allow-once"),className:"px-3 py-1.5 text-xs font-medium rounded-lg bg-success/10 text-success hover:bg-success/20 transition-colors",children:"Allow Once"}),i.jsx("button",{type:"button",onClick:()=>o(r.id,"allow-always"),className:"px-3 py-1.5 text-xs font-medium rounded-lg bg-blue-500/10 text-blue-400 hover:bg-blue-500/20 transition-colors",children:"Unrestrict"}),i.jsx("button",{type:"button",onClick:()=>o(r.id,"deny"),className:"px-3 py-1.5 text-xs font-medium rounded-lg bg-danger/10 text-danger hover:bg-danger/20 transition-colors",children:"Deny"})]})]})})}function Yg(){const[r,o]=g.useState([]),[l,c]=g.useState([]),[d,p]=g.useState([]),[h,x]=g.useState(""),[y,b]=g.useState(!0),[N,C]=g.useState(null),P=g.useCallback(R=>{o(Q=>Q.some(te=>te.id===R.id)?Q:[R,...Q]),b(!1)},[]),I=g.useCallback(R=>{o(Q=>Q.filter(te=>te.id!==R.id)),c(Q=>Q.some(te=>te.id===R.id)?Q:[R,...Q])},[]),W=g.useCallback(R=>{c(R)},[]),_=g.useCallback(R=>{p(R.patterns.map(Q=>Q.pattern))},[]);g.useEffect(()=>{B.emit("safeclaw:getPendingApprovals"),B.emit("safeclaw:getApprovalHistory",{limit:50}),B.emit("safeclaw:getAllowlist"),B.emit("safeclaw:getOpenclawMonitorStatus"),B.on("safeclaw:execApprovalRequested",P),B.on("safeclaw:execApprovalResolved",I),B.on("safeclaw:approvalHistoryBatch",W),B.on("safeclaw:allowlistState",_),B.on("safeclaw:openclawMonitorStatus",C);const R=setTimeout(()=>b(!1),1e3);return()=>{B.off("safeclaw:execApprovalRequested",P),B.off("safeclaw:execApprovalResolved",I),B.off("safeclaw:approvalHistoryBatch",W),B.off("safeclaw:allowlistState",_),B.off("safeclaw:openclawMonitorStatus",C),clearTimeout(R)}},[P,I,W,_]),g.useEffect(()=>{const R=()=>{B.emit("safeclaw:getPendingApprovals"),B.emit("safeclaw:getAllowlist"),B.emit("safeclaw:getOpenclawMonitorStatus")};return B.on("connect",R),()=>{B.off("connect",R)}},[]);const T=(R,Q)=>{B.emit("safeclaw:execDecision",{approvalId:R,decision:Q})},z=()=>{const R=h.trim();R&&(B.emit("safeclaw:addAllowlistPattern",{pattern:R}),x(""))},H=R=>{B.emit("safeclaw:removeAllowlistPattern",{pattern:R})},$=(N==null?void 0:N.connectionStatus)==="connected",ee=(N==null?void 0:N.connectionStatus)==="connecting";return i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Command Interception"}),N&&!$&&i.jsx("div",{className:`rounded-xl border px-4 py-3 mb-6 ${ee?"border-yellow-700/50 bg-yellow-900/20":"border-red-700/50 bg-red-900/20"}`,children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:`h-2 w-2 rounded-full shrink-0 ${ee?"bg-yellow-400 animate-pulse":"bg-red-400"}`}),i.jsx("p",{className:`text-sm ${ee?"text-yellow-400":"text-red-400"}`,children:ee?"Connecting to OpenClaw gateway... Exec approvals cannot be processed until connected.":"OpenClaw gateway not connected. Exec approvals cannot be processed — commands will fall back to the askFallback policy (deny by default)."})]})}),i.jsxs("div",{className:"mb-8",children:[i.jsx("h3",{className:"text-lg font-semibold text-gray-300 mb-4",children:"Restricted Commands"}),i.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"Commands matching these patterns will require your approval before OpenClaw can execute them. Everything else runs automatically."}),i.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900 p-4",children:[i.jsxs("div",{className:"flex gap-2 mb-4",children:[i.jsx("input",{type:"text",value:h,onChange:R=>x(R.target.value),onKeyDown:R=>R.key==="Enter"&&z(),placeholder:"e.g. sudo *, rm -rf *, curl * | bash",className:"flex-1 rounded-lg bg-gray-800 border border-gray-700 px-3 py-2 text-sm text-gray-200 placeholder-gray-500 focus:outline-none focus:border-primary"}),i.jsx("button",{type:"button",onClick:z,className:"px-4 py-2 text-sm font-medium rounded-lg bg-primary/10 text-primary hover:bg-primary/20 transition-colors",children:"Add Rule"})]}),d.length===0?i.jsx("p",{className:"text-sm text-gray-500",children:"No restricted patterns. All commands will auto-execute without approval."}):i.jsx("div",{className:"flex flex-wrap gap-2",children:d.map(R=>i.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-lg bg-gray-800 px-3 py-1.5 text-sm text-gray-300",children:[i.jsx("code",{children:R}),i.jsx("button",{type:"button",onClick:()=>H(R),className:"text-gray-500 hover:text-danger transition-colors ml-1","aria-label":`Remove pattern ${R}`,children:"×"})]},R))})]})]}),r.length>0&&i.jsxs("div",{className:"mb-8",children:[i.jsxs("h3",{className:"text-lg font-semibold text-warning mb-4",children:["Pending Approval (",r.length,")"]}),i.jsx("div",{className:"space-y-3",children:r.map(R=>i.jsx(Qg,{entry:R,onDecision:T},R.id))})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-lg font-semibold text-gray-300 mb-4",children:"Command History"}),y?i.jsx("p",{className:"text-gray-500",children:"Loading..."}):l.length===0&&r.length===0?i.jsx("div",{className:"rounded-xl border border-gray-800 bg-gray-900 p-8",children:i.jsx("p",{className:"text-gray-400",children:"No commands intercepted yet. Add restricted command patterns above, then commands matching those patterns will appear here for your approval."})}):i.jsx("div",{className:"space-y-2",children:l.map(R=>i.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-3 flex items-center gap-4",children:[i.jsx("span",{className:`text-xs font-medium whitespace-nowrap ${Kg[R.decision??"deny"]??"text-gray-400"}`,children:R.decidedBy==="auto-deny"?"TIMED OUT":R.decidedBy==="access-control"?"BLOCKED (ACCESS)":qg[R.decision??"deny"]??"UNKNOWN"}),i.jsx("code",{className:"text-sm text-gray-300 flex-1 truncate",children:R.command}),i.jsx("span",{className:"text-xs text-gray-600 whitespace-nowrap",children:R.decidedBy==="auto-approve"||R.decidedBy==="auto-deny"?"auto":R.decidedBy==="access-control"?"policy":"user"}),i.jsx("span",{className:"text-xs text-gray-500 whitespace-nowrap",children:R.decidedAt?new Date(R.decidedAt).toLocaleTimeString():""})]},R.id))})]})]})}function Gg(r){const o=new Map;for(const c of r){const d=c.runId||`fallback-${c.id}`;o.has(d)||o.set(d,[]),o.get(d).push(c)}return Array.from(o.entries()).map(([c,d])=>{const p=d.sort((h,x)=>new Date(h.timestamp).getTime()-new Date(x.timestamp).getTime());return{primary:p[p.length-1],activities:p,runId:c}}).sort((c,d)=>new Date(d.primary.timestamp).getTime()-new Date(c.primary.timestamp).getTime())}const Xg=Gg;function Jg(r,o){const l={},c=o.toLowerCase();return(c.includes("file")||c.includes("read")||c.includes("write")||c.includes("edit"))&&(l.path=r.path??r.file_path??r.file),(c.includes("exec")||c.includes("shell")||c.includes("bash")||c.includes("command"))&&(l.command=r.command??r.cmd),(c.includes("browser")||c.includes("browse")||c.includes("web")||c.includes("fetch")||c.includes("http"))&&(l.url=r.url??r.uri),(c.includes("message")||c.includes("send")||c.includes("whatsapp")||c.includes("sms"))&&(l.recipient=r.to??r.recipient??r.target),l}function Zg(){return{toolName:"unknown",phase:"unknown",toolCallId:"",runId:"",args:{},meta:"",result:void 0,isError:!1,sensitiveFields:{}}}function Gi(r){try{const o=JSON.parse(r),l=(o==null?void 0:o.payload)??{},c=l.data??{},d=c.name??"unknown",p=c.phase??"unknown",h=c.args??{},x=c.toolCallId??"",y=l.runId??"",b=c.meta??"",N=c.result,C=c.isError??!1,P=Jg(h,d);return{toolName:d,phase:p,toolCallId:x,runId:y,args:h,meta:b,result:N,isError:C,sensitiveFields:P}}catch{return Zg()}}const ex={CRITICAL:"text-red-400",HIGH:"text-orange-400",MEDIUM:"text-yellow-400",LOW:"text-blue-400",NONE:"text-gray-400"},tx={CRITICAL:"bg-red-500",HIGH:"bg-orange-500",MEDIUM:"bg-yellow-400",LOW:"bg-blue-500",NONE:"bg-gray-500"},nx={file_read:"R",file_write:"W",shell_command:"$",web_browse:"@",tool_call:"T",message:"M",unknown:"?"};function rx({activity:r,phases:o,expanded:l,onToggle:c}){const d=g.useMemo(()=>Gi(r.rawPayload),[r.rawPayload]),p=o.length;return i.jsxs("button",{type:"button",onClick:c,className:"w-full text-left flex items-center gap-2 py-1.5 px-2 rounded hover:bg-gray-800/50 transition-colors cursor-pointer group",children:[i.jsx("span",{className:`text-gray-400 transition-transform ${l?"rotate-90":""}`,children:"▶"}),i.jsx("span",{className:`w-6 h-6 rounded flex items-center justify-center text-xs font-mono font-bold bg-gray-800 ${ex[r.threatLevel]}`,children:nx[r.activityType]}),i.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${tx[r.threatLevel]}`}),i.jsx("span",{className:"text-xs text-gray-500 shrink-0",children:"Interaction"}),i.jsxs("span",{className:"text-xs text-gray-300 flex-1 truncate font-mono flex items-center gap-1",children:[d.runId&&d.runId!==""&&i.jsxs("span",{className:"text-gray-500",children:["[",d.runId.slice(0,8),"]"]}),p>1&&i.jsxs("span",{className:"text-gray-600",children:["(",p," activities)"]}),i.jsx("span",{children:r.detail})]}),i.jsx("span",{className:"text-xs text-gray-600 shrink-0",children:new Date(r.timestamp).toLocaleTimeString()})]})}const sx={"TC-SEC":"🔑","TC-EXF":"📤","TC-INJ":"💉","TC-DES":"💥","TC-ESC":"⬆️","TC-SUP":"📦","TC-SFA":"📁","TC-SYS":"⚙️","TC-NET":"🌐","TC-MCP":"🔌"},gd={CRITICAL:"border-red-800 bg-red-900/20 text-red-400",HIGH:"border-orange-800 bg-orange-900/20 text-orange-400",MEDIUM:"border-yellow-800 bg-yellow-900/20 text-yellow-400",LOW:"border-blue-800 bg-blue-900/20 text-blue-400"};function ox(r){switch(r){case"CRITICAL":return"critical";case"HIGH":return"high";case"MEDIUM":return"medium";default:return"low"}}function lx(r){return{level:ox(r.severity),message:r.reason,color:gd[r.severity]??gd.LOW,icon:sx[r.categoryId]??"⚠️",categoryId:r.categoryId,owaspRef:r.owaspRef}}function ix(r,o){return r.threatFindings&&r.threatFindings.length>0?r.threatFindings.map(lx):mx(r,o)}const ax=/^(\/etc|\/usr\/bin|\/usr\/local\/bin|\/root|\/System|\/Library\/Launch)/,cx=/\.(env|pem|key|pass|secret|token|keychain|p12|pfx)$/i,ux=/\.(ssh|gnupg|aws|gcloud)\//,dx=/\bsudo\b/,fx=/(rm\s+-+[rfRF]|dd\s+(if|of)=|mkfs\.|format\s)/,px=/(chmod|chown|passwd|su\s|usermod|useradd)/,hx=/(curl|wget).*\|\s*(sh|bash|zsh)/;function mx(r,o){const l=[];if(r.activityType==="file_write"){const c=o.sensitiveFields.path;c&&ax.test(c)&&l.push({level:"critical",message:"Writing to system directory",color:"border-red-800 bg-red-900/20 text-red-400",icon:"🚨"})}if(r.activityType==="shell_command"){const c=o.sensitiveFields.command;c&&(dx.test(c)&&l.push({level:"critical",message:"Elevated privileges (sudo)",color:"border-red-800 bg-red-900/20 text-red-400",icon:"⚠️"}),fx.test(c)&&l.push({level:"critical",message:"Destructive operation (rm/dd/mkfs)",color:"border-red-800 bg-red-900/20 text-red-400",icon:"💥"}),px.test(c)&&l.push({level:"high",message:"Modifying permissions or users",color:"border-orange-800 bg-orange-900/20 text-orange-400",icon:"🔐"}),hx.test(c)&&l.push({level:"high",message:"Downloading and executing script",color:"border-orange-800 bg-orange-900/20 text-orange-400",icon:"⬇️"}))}if(r.activityType==="file_read"||r.activityType==="file_write"){const c=o.sensitiveFields.path;c&&(cx.test(c)&&l.push({level:"high",message:"Accessing credentials/secrets",color:"border-orange-800 bg-orange-900/20 text-orange-400",icon:"🔑"}),ux.test(c)&&l.push({level:"high",message:"Accessing sensitive config directory",color:"border-orange-800 bg-orange-900/20 text-orange-400",icon:"📁"}))}if(r.activityType==="web_browse"){const c=o.sensitiveFields.url;c&&/^https?:\/\/\d+\.\d+\.\d+\.\d+/.test(c)&&l.push({level:"medium",message:"Connection to IP address (not domain)",color:"border-yellow-800 bg-yellow-900/20 text-yellow-400",icon:"🌐"})}if(r.activityType==="message"&&l.push({level:"medium",message:"Sending external message",color:"border-yellow-800 bg-yellow-900/20 text-yellow-400",icon:"💬"}),r.secretsDetected&&r.secretsDetected.length>0){const c=r.secretsDetected.some(d=>["AWS_ACCESS_KEY","AWS_SECRET_KEY","OPENAI_API_KEY","GITHUB_TOKEN","GITLAB_TOKEN","PEM_PRIVATE_KEY","STRIPE_KEY","SENDGRID_KEY","TWILIO_KEY"].includes(d));l.push({level:c?"critical":"high",message:`Secrets detected: ${r.secretsDetected.join(", ")}`,color:c?"border-red-800 bg-red-900/20 text-red-400":"border-orange-800 bg-orange-900/20 text-orange-400",icon:"🔓"})}return l}function gx({activity:r,parsed:o}){const l=o.sensitiveFields.path||r.targetPath,c=l&&(/\.(env|pem|key|pass|secret|token)$/i.test(l)||/\.(ssh|gnupg|aws)\//i.test(l)||/^(\/etc|\/usr\/bin|\/root)/i.test(l)),d=o.result,p=r.contentPreview||d;return i.jsxs("div",{className:"space-y-3",children:[r.secretsDetected&&r.secretsDetected.length>0&&i.jsxs("div",{className:"p-3 bg-red-900/30 border border-red-700 rounded",children:[i.jsx("p",{className:"text-sm font-semibold text-red-300 mb-1",children:"Secrets Detected in Content"}),i.jsx("div",{className:"flex flex-wrap gap-1",children:r.secretsDetected.map((h,x)=>i.jsx("span",{className:"px-2 py-0.5 text-xs bg-red-800/50 text-red-200 rounded",children:h},x))})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Path:"}),i.jsx("code",{className:`text-sm block p-2 bg-gray-800 rounded break-all font-mono ${c?"text-red-300 border border-red-800/50":"text-green-300"}`,children:l||"unknown"})]}),p&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Content Preview:"}),i.jsx("pre",{className:"text-xs p-3 bg-gray-800 rounded max-h-96 overflow-y-auto text-gray-300 border border-gray-700 whitespace-pre-wrap break-words",children:p})]}),r.activityType==="file_write"&&r.readContentPreview&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Original Content (before edit):"}),i.jsx("pre",{className:"text-xs p-3 bg-gray-800 rounded max-h-96 overflow-y-auto text-gray-400 border border-gray-600 whitespace-pre-wrap break-words",children:r.readContentPreview})]}),r.activityType==="file_write"&&o.phase==="result"&&i.jsx("div",{className:`p-2 rounded text-xs border ${o.isError?"bg-red-900/20 border-red-800/50 text-red-400":"bg-green-900/20 border-green-800/50 text-green-400"}`,children:o.isError?"❌ File write failed":"✓ File written successfully"}),o.meta&&typeof o.meta=="object"&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Metadata:"}),i.jsx("pre",{className:"text-xs p-2 bg-gray-800 rounded overflow-auto text-gray-400",children:JSON.stringify(o.meta,null,2)})]}),o.isError&&i.jsx("div",{className:"p-2 bg-red-900/20 border border-red-800/50 rounded",children:i.jsx("p",{className:"text-xs text-red-400 font-medium",children:"⚠️ Error occurred during operation"})})]})}function xx({activity:r,parsed:o}){const l=o.sensitiveFields.command,c=l&&(/\bsudo\b/i.test(l)||/(rm\s+-+[rfRF]|dd\s+(if|of)=|mkfs\.|format\s)/i.test(l)),d=o.result,p=o.args.cwd,h=r.contentPreview||d;return i.jsxs("div",{className:"space-y-3",children:[r.secretsDetected&&r.secretsDetected.length>0&&i.jsxs("div",{className:"p-3 bg-red-900/30 border border-red-700 rounded",children:[i.jsx("p",{className:"text-sm font-semibold text-red-300 mb-1",children:"Secrets Detected in Output"}),i.jsx("div",{className:"flex flex-wrap gap-1",children:r.secretsDetected.map((x,y)=>i.jsx("span",{className:"px-2 py-0.5 text-xs bg-red-800/50 text-red-200 rounded",children:x},y))})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Command:"}),i.jsx("code",{className:`text-sm block p-3 bg-gray-800 rounded font-mono break-all ${c?"text-red-300 border border-red-800/50":"text-gray-200"}`,children:l||"unknown"})]}),p&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Working Directory:"}),i.jsx("code",{className:"text-xs block p-2 bg-gray-800 rounded text-gray-400 font-mono",children:p})]}),h&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Output:"}),i.jsx("pre",{className:"text-xs p-3 bg-gray-800 rounded max-h-96 overflow-y-auto text-gray-300 border border-gray-700 whitespace-pre-wrap break-words",children:h})]}),o.isError&&i.jsxs("div",{className:"p-2 bg-red-900/20 border border-red-800/50 rounded",children:[i.jsx("p",{className:"text-xs text-red-400 font-medium",children:"⚠️ Command execution failed"}),d&&i.jsx("pre",{className:"text-xs mt-2 text-red-300 whitespace-pre-wrap",children:d})]}),o.meta&&typeof o.meta=="string"&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Description:"}),i.jsx("p",{className:"text-xs text-gray-400",children:o.meta})]})]})}function yx({activity:r,parsed:o}){const l=o.sensitiveFields.url,c=o.args.action,d=o.result;return i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"URL:"}),i.jsx("code",{className:"text-sm block p-2 bg-gray-800 rounded break-all text-blue-300 font-mono",children:l||"unknown"})]}),c&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Action:"}),i.jsx("span",{className:"text-xs px-2 py-1 bg-gray-800 rounded text-gray-300",children:c})]}),Object.keys(o.args).length>0&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Arguments:"}),i.jsx("div",{className:"space-y-1",children:Object.entries(o.args).filter(([p])=>p!=="action"&&p!=="url").map(([p,h])=>i.jsxs("div",{className:"flex gap-2 text-xs",children:[i.jsxs("span",{className:"text-gray-500 font-mono",children:[p,":"]}),i.jsx("span",{className:"text-gray-300",children:String(h)})]},p))})]}),d&&o.phase==="result"&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Response:"}),i.jsx("pre",{className:"text-xs p-3 bg-gray-800 rounded max-h-96 overflow-y-auto text-gray-300 border border-gray-700 whitespace-pre-wrap break-words",children:d})]}),o.phase==="result"&&!o.isError&&i.jsx("div",{className:"p-2 bg-green-900/20 border border-green-800/50 rounded",children:i.jsx("p",{className:"text-xs text-green-400",children:"✓ Request completed successfully"})}),o.isError&&i.jsx("div",{className:"p-2 bg-red-900/20 border border-red-800/50 rounded",children:i.jsx("p",{className:"text-xs text-red-400 font-medium",children:"⚠️ Request failed"})})]})}function vx({activity:r,parsed:o}){const l=o.sensitiveFields.recipient,c=o.args.channel,d=o.args.provider,p=o.args.action,h=o.args.message||o.args.content||(typeof o.meta=="string"?o.meta:"");return i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Recipient:"}),i.jsx("p",{className:"text-sm text-gray-300 font-mono",children:l})]}),(c||d)&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Channel:"}),i.jsx("p",{className:"text-sm text-gray-300",children:c||d||"N/A"})]})]}),p&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Action:"}),i.jsx("span",{className:"text-xs px-2 py-1 bg-gray-800 rounded text-gray-300",children:p})]}),h&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Message:"}),i.jsx("div",{className:"p-3 bg-gray-800 rounded text-sm text-gray-300 border border-gray-700 max-h-96 overflow-y-auto whitespace-pre-wrap break-words",children:h})]}),o.phase==="result"&&i.jsx("div",{className:`p-2 rounded text-xs border ${o.isError?"bg-red-900/20 border-red-800/50 text-red-400":"bg-green-900/20 border-green-800/50 text-green-400"}`,children:o.isError?"❌ Message failed to send":"✓ Message delivered"}),o.meta&&typeof o.meta=="object"&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Additional Info:"}),i.jsx("pre",{className:"text-xs p-2 bg-gray-800 rounded overflow-auto text-gray-400",children:JSON.stringify(o.meta,null,2)})]})]})}function wx({activity:r,parsed:o}){const l=o.result;return i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Tool:"}),i.jsx("span",{className:"text-sm px-3 py-1.5 bg-gray-800 rounded text-gray-200 font-mono",children:o.toolName})]}),Object.keys(o.args).length>0&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Arguments:"}),i.jsx("div",{className:"space-y-1 p-2 bg-gray-800 rounded",children:Object.entries(o.args).map(([c,d])=>i.jsxs("div",{className:"flex gap-2 text-xs",children:[i.jsxs("span",{className:"text-gray-500 font-mono min-w-[100px]",children:[c,":"]}),i.jsx("span",{className:"text-gray-300 break-all",children:typeof d=="object"?JSON.stringify(d):String(d)})]},c))})]}),o.meta&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Description:"}),typeof o.meta=="string"?i.jsx("p",{className:"text-xs text-gray-400 p-2 bg-gray-800 rounded",children:o.meta}):i.jsx("pre",{className:"text-xs p-2 bg-gray-800 rounded overflow-auto text-gray-400",children:JSON.stringify(o.meta,null,2)})]}),l&&o.phase==="result"&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Result:"}),i.jsx("pre",{className:"text-xs p-3 bg-gray-800 rounded max-h-96 overflow-y-auto text-gray-300 border border-gray-700 whitespace-pre-wrap break-words",children:typeof l=="object"?JSON.stringify(l,null,2):l})]}),o.phase==="result"&&i.jsx("div",{className:`p-2 rounded text-xs border ${o.isError?"bg-red-900/20 border-red-800/50 text-red-400":"bg-green-900/20 border-green-800/50 text-green-400"}`,children:o.isError?"❌ Tool execution failed":"✓ Tool executed successfully"})]})}function Nx({activity:r,parsed:o}){return i.jsxs("div",{className:"space-y-3",children:[i.jsx("div",{className:"p-2 bg-yellow-900/20 border border-yellow-800/50 rounded",children:i.jsx("p",{className:"text-xs text-yellow-400 font-medium",children:"⚠️ Unknown activity type - displaying raw data"})}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Activity Type:"}),i.jsx("span",{className:"text-sm px-3 py-1.5 bg-gray-800 rounded text-gray-200",children:r.activityType})]}),o.toolName&&o.toolName!=="unknown"&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Tool Name:"}),i.jsx("span",{className:"text-sm px-3 py-1.5 bg-gray-800 rounded text-gray-200 font-mono",children:o.toolName})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Detail:"}),i.jsx("p",{className:"text-xs text-gray-300 p-2 bg-gray-800 rounded",children:r.detail})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Parsed Data:"}),i.jsx("pre",{className:"text-xs p-3 bg-gray-800 rounded max-h-96 overflow-y-auto text-gray-300 border border-gray-700",children:JSON.stringify(o,null,2)})]})]})}function bx({activity:r,parsed:o}){switch(r.activityType){case"file_read":case"file_write":return i.jsx(gx,{activity:r,parsed:o});case"shell_command":return i.jsx(xx,{activity:r,parsed:o});case"web_browse":return i.jsx(yx,{activity:r,parsed:o});case"message":return i.jsx(vx,{activity:r,parsed:o});case"tool_call":return i.jsx(wx,{activity:r,parsed:o});case"unknown":default:return i.jsx(Nx,{activity:r,parsed:o})}}function kx({phases:r}){const[o,l]=g.useState(!1),c=r[r.length-1],d=g.useMemo(()=>Gi(c.rawPayload),[c.rawPayload]),p=g.useMemo(()=>ix(c,d),[c,d]);return i.jsxs("div",{className:"ml-8 mt-2 mb-3 p-3 bg-gray-900/50 border border-gray-800 rounded space-y-3",children:[p.length>0&&i.jsxs("div",{className:"space-y-2",children:[i.jsxs("p",{className:"text-xs text-gray-500 font-medium",children:["Threat Findings (",p.length,")"]}),p.map((h,x)=>i.jsxs("div",{className:`flex items-start gap-2 p-2 rounded text-xs border ${h.color}`,children:[i.jsx("span",{className:"text-base shrink-0",children:h.icon}),i.jsx("div",{className:"flex flex-col gap-0.5 min-w-0",children:i.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[h.categoryId&&i.jsx("span",{className:"px-1.5 py-0.5 bg-gray-800 text-gray-300 rounded font-mono text-[10px] shrink-0",children:h.categoryId}),i.jsx("span",{className:"font-medium",children:h.message}),h.owaspRef&&i.jsxs("span",{className:"px-1 py-0.5 bg-gray-700/50 text-gray-400 rounded text-[10px] shrink-0",children:["OWASP ",h.owaspRef]})]})})]},x))]}),d.runId&&i.jsxs("div",{className:"p-2 bg-gray-800 rounded",children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Interaction Run ID:"}),i.jsx("code",{className:"text-xs text-gray-400 break-all font-mono",children:d.runId})]}),r.length>1&&i.jsxs("div",{className:"border border-gray-700 rounded p-2 bg-gray-800/50",children:[i.jsxs("p",{className:"text-xs text-gray-400 mb-2 font-medium",children:["Activity Timeline (",r.length," activities)"]}),i.jsx("div",{className:"space-y-1",children:r.map((h,x)=>{const y=Gi(h.rawPayload);return i.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-400",children:[i.jsxs("span",{className:"text-gray-600",children:[x+1,"."]}),i.jsx("span",{className:`px-1.5 py-0.5 rounded font-mono ${h.activityType==="file_read"?"bg-blue-900/30 text-blue-400":h.activityType==="file_write"?"bg-orange-900/30 text-orange-400":h.activityType==="shell_command"?"bg-red-900/30 text-red-400":h.activityType==="message"?"bg-purple-900/30 text-purple-400":h.activityType==="web_browse"?"bg-cyan-900/30 text-cyan-400":"bg-gray-700 text-gray-400"}`,children:h.toolName||h.activityType}),i.jsx("span",{className:"text-gray-500 truncate",title:h.detail,children:h.detail}),i.jsx("span",{className:"text-gray-600 shrink-0",children:new Date(h.timestamp).toLocaleTimeString()}),y.isError&&i.jsx("span",{className:"text-red-400 text-xs",children:"⚠ error"}),h.threatLevel!=="NONE"&&i.jsx("span",{className:`px-1 py-0.5 rounded text-[10px] font-medium shrink-0 ${h.threatLevel==="CRITICAL"?"bg-red-900/40 text-red-400":h.threatLevel==="HIGH"?"bg-orange-900/40 text-orange-400":h.threatLevel==="MEDIUM"?"bg-yellow-900/40 text-yellow-400":"bg-blue-900/40 text-blue-400"}`,children:h.threatLevel})]},h.id)})})]}),i.jsx(bx,{activity:c,parsed:d}),d.toolCallId&&i.jsxs("div",{className:"p-2 bg-gray-800 rounded",children:[i.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Tool Call ID:"}),i.jsx("code",{className:"text-xs text-gray-400 break-all font-mono",children:d.toolCallId})]}),i.jsxs("button",{type:"button",onClick:()=>l(!o),className:"text-xs text-gray-500 hover:text-gray-400 transition-colors underline",children:[o?"Hide":"Show"," raw data"]}),o&&i.jsx("pre",{className:"text-xs bg-gray-800 p-3 rounded overflow-auto max-h-60 text-gray-300 border border-gray-700",children:JSON.stringify(JSON.parse(c.rawPayload),null,2)})]})}const Sx={CRITICAL:"text-red-400",HIGH:"text-orange-400",MEDIUM:"text-yellow-400",LOW:"text-blue-400",NONE:"text-gray-400"};function jx(){const[r,o]=g.useState([]),[l,c]=g.useState([]),[d,p]=g.useState(null),[h,x]=g.useState(null),[y,b]=g.useState(!0);g.useEffect(()=>{B.emit("safeclaw:getOpenclawSessions"),B.emit("safeclaw:getOpenclawMonitorStatus");const I=z=>{o(H=>{const $=H.findIndex(ee=>ee.id===z.id);if($>=0){const ee=[...H];return ee[$]=z,ee}return[z,...H]}),b(!1)},W=z=>{c(H=>H.some($=>$.id===z.id)?H:[z,...H].slice(0,200))},_=z=>{p(z),b(!1)};B.on("safeclaw:openclawSessionUpdate",I),B.on("safeclaw:openclawActivity",W),B.on("safeclaw:openclawMonitorStatus",_);const T=setTimeout(()=>b(!1),2e3);return()=>{B.off("safeclaw:openclawSessionUpdate",I),B.off("safeclaw:openclawActivity",W),B.off("safeclaw:openclawMonitorStatus",_),clearTimeout(T)}},[]),g.useEffect(()=>{h&&(c([]),B.emit("safeclaw:getOpenclawActivities",{sessionId:h,limit:100}))},[h]);const N=()=>{B.emit("safeclaw:reconnectOpenclaw")},C=(d==null?void 0:d.connectionStatus)==="connected"?"bg-success":(d==null?void 0:d.connectionStatus)==="connecting"?"bg-warning animate-pulse":"bg-danger",P=(d==null?void 0:d.connectionStatus)==="connected"?"Connected":(d==null?void 0:d.connectionStatus)==="connecting"?"Connecting...":(d==null?void 0:d.connectionStatus)==="not_configured"?"Not Configured":"Disconnected";return i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Session Monitor"}),i.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900 p-4 mb-4 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:`h-2.5 w-2.5 rounded-full ${C}`}),i.jsxs("span",{className:"text-sm text-gray-300",children:["OpenClaw Gateway: ",P]}),(d==null?void 0:d.gatewayPort)&&i.jsxs("span",{className:"text-xs text-gray-500",children:["(port ",d.gatewayPort,")"]})]}),(d==null?void 0:d.connectionStatus)!=="connected"&&(d==null?void 0:d.connectionStatus)!=="not_configured"&&i.jsx("button",{type:"button",onClick:N,className:"rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-white hover:bg-primary/90 transition-colors cursor-pointer",children:"Reconnect"})]}),i.jsx(Cx,{sessions:r,activities:l,expandedSession:h,onToggleSession:I=>x(W=>W===I?null:I),loading:y})]})}function Cx({sessions:r,activities:o,expandedSession:l,onToggleSession:c,loading:d}){if(d)return i.jsx("p",{className:"text-gray-500",children:"Loading OpenClaw sessions..."});if(r.length===0)return i.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900 p-6 text-center",children:[i.jsx("p",{className:"text-gray-400",children:"No OpenClaw sessions recorded yet."}),i.jsx("p",{className:"text-gray-500 text-sm mt-1",children:"Sessions will appear here once OpenClaw agent activity is detected."})]});const p=r.filter(x=>x.status==="ACTIVE").sort((x,y)=>new Date(y.startedAt).getTime()-new Date(x.startedAt).getTime()),h=r.filter(x=>x.status==="ENDED").sort((x,y)=>new Date(y.startedAt).getTime()-new Date(x.startedAt).getTime());return i.jsxs("div",{className:"space-y-4",children:[p.length>0&&i.jsxs("div",{children:[i.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-2",children:"Active Sessions"}),i.jsx("div",{className:"space-y-2",children:p.map(x=>i.jsx(xd,{session:x,activities:l===x.id?o:[],expanded:l===x.id,onToggle:()=>c(x.id)},x.id))})]}),h.length>0&&i.jsxs("div",{children:[i.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-2",children:"Past Sessions"}),i.jsx("div",{className:"space-y-2",children:h.map(x=>i.jsx(xd,{session:x,activities:l===x.id?o:[],expanded:l===x.id,onToggle:()=>c(x.id)},x.id))})]})]})}function xd({session:r,activities:o,expanded:l,onToggle:c}){const d=r.status==="ACTIVE",p=(r.threatSummary.HIGH??0)+(r.threatSummary.CRITICAL??0),[h,x]=g.useState(null),y=g.useMemo(()=>Xg(o),[o]);return i.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900 overflow-hidden",children:[i.jsxs("button",{type:"button",onClick:c,className:"w-full p-4 flex items-center justify-between cursor-pointer hover:bg-gray-800/50 transition-colors",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:`h-2.5 w-2.5 rounded-full ${d?"bg-success animate-pulse":"bg-gray-600"}`}),i.jsxs("div",{className:"text-left",children:[i.jsx("span",{className:"text-sm font-mono text-gray-200",children:r.id.slice(0,12)}),r.model&&i.jsx("span",{className:"ml-2 text-xs text-gray-500",children:r.model})]})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[p>0&&i.jsxs("span",{className:"px-2 py-0.5 text-xs font-medium rounded-full bg-red-900/40 text-red-400 border border-red-800/50",children:[p," high risk"]}),i.jsxs("span",{className:"text-xs text-gray-500",children:[r.activityCount," activities"]}),i.jsx("span",{className:"text-xs text-gray-500",children:new Date(r.startedAt).toLocaleString()}),i.jsx("span",{className:`text-gray-400 transition-transform ${l?"rotate-180":""}`,children:"v"})]})]}),l&&i.jsxs("div",{className:"border-t border-gray-800 p-4",children:[i.jsx("div",{className:"flex gap-2 mb-3",children:["CRITICAL","HIGH","MEDIUM","LOW","NONE"].map(b=>{const N=r.threatSummary[b]??0;return N===0?null:i.jsxs("span",{className:`px-2 py-0.5 text-xs rounded-full ${Sx[b]} bg-gray-800`,children:[b,": ",N]},b)})}),o.length===0?i.jsx("p",{className:"text-xs text-gray-500",children:"Loading activities..."}):i.jsx("div",{className:"space-y-0 max-h-80 overflow-y-auto",children:y.map(b=>{const N=b.runId||`fallback-${b.primary.id}`;return i.jsxs("div",{children:[i.jsx(rx,{activity:b.primary,phases:b.activities,expanded:h===N,onToggle:()=>x(h===N?null:N)}),h===N&&i.jsx(kx,{phases:b.activities})]},N)})})]})]})}const Ex={"TC-SEC":{defaultAdvice:"Rotate exposed keys/tokens immediately. Check git history for accidental commits.",dynamicAdvice:r=>r?`Detected credential: ${r}`:null},"TC-EXF":{defaultAdvice:"Block the exfiltration target URL. Review data access patterns.",dynamicAdvice:r=>r?`Exfiltration target: ${r}`:null},"TC-INJ":{defaultAdvice:"Quarantine the content source. Do not act on injected instructions.",dynamicAdvice:r=>r?`Injection source: ${r}`:null},"TC-DES":{defaultAdvice:"Prevent execution. Verify the agent's intent before allowing destructive operations.",dynamicAdvice:r=>r?`Destructive command: ${r}`:null},"TC-ESC":{defaultAdvice:"Deny privilege escalation. Review why elevated permissions were requested.",dynamicAdvice:r=>r?`Escalation via: ${r}`:null},"TC-SUP":{defaultAdvice:"Verify package integrity. Check for known vulnerabilities before installing.",dynamicAdvice:r=>r?`Package involved: ${r}`:null},"TC-SFA":{defaultAdvice:"Restrict access to sensitive files. Consider using read-only permissions.",dynamicAdvice:r=>r?`Sensitive file: ${r}`:null},"TC-SYS":{defaultAdvice:"Block system modifications. Review changes before applying.",dynamicAdvice:r=>r?`System target: ${r}`:null},"TC-NET":{defaultAdvice:"Inspect network traffic. Block suspicious connections.",dynamicAdvice:r=>r?`Network target: ${r}`:null},"TC-MCP":{defaultAdvice:"Isolate the MCP tool. Verify tool responses are not poisoned.",dynamicAdvice:r=>r?`Affected tool: ${r}`:null}};function _x(r){const o=Ex[r.categoryId];return{defaultAdvice:o.defaultAdvice,contextAdvice:o.dynamicAdvice(r.evidence)}}const yd={CRITICAL:"text-red-400",HIGH:"text-orange-400",MEDIUM:"text-yellow-400",LOW:"text-blue-400",NONE:"text-green-400"},Rx={CRITICAL:"bg-red-900/20 border-red-800",HIGH:"bg-orange-900/20 border-orange-800",MEDIUM:"bg-yellow-900/20 border-yellow-800",LOW:"bg-blue-900/20 border-blue-800"},Tx={file_read:"R",file_write:"W",shell_command:"$",web_browse:"@",tool_call:"T",message:"M",unknown:"?"},Px=["ALL","CRITICAL","HIGH","MEDIUM","LOW"],Lx=["all","unresolved","resolved"],Ax={ALL:{active:"bg-gray-200 text-gray-900",inactive:"bg-gray-800 text-gray-400 hover:bg-gray-700"},CRITICAL:{active:"bg-red-500/20 text-red-400 ring-1 ring-red-500/40",inactive:"bg-gray-800 text-red-400/60 hover:bg-red-500/10"},HIGH:{active:"bg-orange-500/20 text-orange-400 ring-1 ring-orange-500/40",inactive:"bg-gray-800 text-orange-400/60 hover:bg-orange-500/10"},MEDIUM:{active:"bg-yellow-500/20 text-yellow-400 ring-1 ring-yellow-500/40",inactive:"bg-gray-800 text-yellow-400/60 hover:bg-yellow-500/10"},LOW:{active:"bg-blue-500/20 text-blue-400 ring-1 ring-blue-500/40",inactive:"bg-gray-800 text-blue-400/60 hover:bg-blue-500/10"}},Ox={all:{active:"bg-gray-200 text-gray-900",inactive:"bg-gray-800 text-gray-400 hover:bg-gray-700"},unresolved:{active:"bg-amber-500/20 text-amber-400 ring-1 ring-amber-500/40",inactive:"bg-gray-800 text-amber-400/60 hover:bg-amber-500/10"},resolved:{active:"bg-green-500/20 text-green-400 ring-1 ring-green-500/40",inactive:"bg-gray-800 text-green-400/60 hover:bg-green-500/10"}};function Ix(){const[r,o]=g.useState([]),[l,c]=g.useState("ALL"),[d,p]=g.useState("all"),[h,x]=g.useState(null),[y,b]=g.useState(!0),N=g.useCallback(async()=>{b(!0);try{const _=new URLSearchParams;l!=="ALL"&&_.set("severity",l),d!=="all"&&_.set("resolved",d==="resolved"?"true":"false"),_.set("limit","200");const T=await fetch(`/api/openclaw/threats?${_.toString()}`);if(T.ok){const z=await T.json();o(z)}}catch{}finally{b(!1)}},[l,d]);g.useEffect(()=>{N()},[N]),g.useEffect(()=>{const _=z=>{o(H=>H.map($=>$.id===z.id?z:$))},T=z=>{z.threatLevel!=="NONE"&&o(H=>H.some($=>$.id===z.id)?H:[z,...H])};return B.on("safeclaw:threatResolved",_),B.on("safeclaw:openclawActivity",T),()=>{B.off("safeclaw:threatResolved",_),B.off("safeclaw:openclawActivity",T)}},[]);const C=g.useMemo(()=>r.filter(_=>l==="ALL"||_.threatLevel===l).filter(_=>d==="resolved"?_.resolved:d==="unresolved"?!_.resolved:!0).sort((_,T)=>new Date(T.timestamp).getTime()-new Date(_.timestamp).getTime()),[r,l,d]),P=g.useCallback((_,T)=>{B.emit("safeclaw:resolveActivity",{activityId:_,resolved:!T})},[]),I=r.filter(_=>!_.resolved).length,W=r.filter(_=>_.resolved).length;return i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-6",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold",children:"Threat Center"}),i.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:[I," unresolved / ",r.length," total threats"]})]}),i.jsxs("div",{className:"flex items-center gap-5",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-xs text-gray-500",children:"Severity:"}),i.jsx("div",{className:"flex gap-1",children:Px.map(_=>{const T=l===_,z=Ax[_];return i.jsx("button",{onClick:()=>c(_),className:`px-2.5 py-1 text-xs font-medium rounded-lg transition-colors cursor-pointer ${T?z.active:z.inactive}`,children:_},_)})})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-xs text-gray-500",children:"Status:"}),i.jsx("div",{className:"flex gap-1",children:Lx.map(_=>{const T=d===_,z=Ox[_];return i.jsx("button",{onClick:()=>p(_),className:`px-2.5 py-1 text-xs font-medium rounded-lg transition-colors cursor-pointer ${T?z.active:z.inactive}`,children:_.charAt(0).toUpperCase()+_.slice(1)},_)})})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-6",children:[i.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-3 text-center",children:[i.jsx("p",{className:"text-2xl font-bold text-red-400",children:r.filter(_=>_.threatLevel==="CRITICAL").length}),i.jsx("p",{className:"text-xs text-gray-500",children:"Critical"})]}),i.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-3 text-center",children:[i.jsx("p",{className:"text-2xl font-bold text-orange-400",children:r.filter(_=>_.threatLevel==="HIGH").length}),i.jsx("p",{className:"text-xs text-gray-500",children:"High"})]}),i.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-3 text-center",children:[i.jsx("p",{className:"text-2xl font-bold text-yellow-400",children:r.filter(_=>_.threatLevel==="MEDIUM").length}),i.jsx("p",{className:"text-xs text-gray-500",children:"Medium"})]}),i.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-3 text-center",children:[i.jsx("p",{className:"text-2xl font-bold text-green-400",children:W}),i.jsx("p",{className:"text-xs text-gray-500",children:"Resolved"})]})]}),y?i.jsx("p",{className:"text-sm text-gray-500",children:"Loading threats..."}):C.length===0?i.jsx("div",{className:"rounded-xl border border-gray-800 bg-gray-900 p-8 text-center",children:i.jsx("p",{className:"text-gray-500",children:"No threats found matching current filters."})}):i.jsx("div",{className:"space-y-3",children:C.map(_=>i.jsx(Mx,{threat:_,expanded:h===_.id,onToggle:()=>x(T=>T===_.id?null:_.id),onToggleResolve:P},_.id))})]})}function Mx({threat:r,expanded:o,onToggle:l,onToggleResolve:c}){var d;return i.jsxs("div",{className:`rounded-xl border bg-gray-900 overflow-hidden ${r.resolved?"border-gray-800 opacity-60":"border-gray-700"}`,children:[i.jsxs("div",{className:"p-4 flex items-center gap-3 cursor-pointer hover:bg-gray-800/50 transition-colors",onClick:l,children:[i.jsx("span",{className:`text-gray-500 text-xs transition-transform ${o?"rotate-90":""}`,children:"▶"}),i.jsx("span",{className:"flex-shrink-0 w-7 h-7 rounded bg-gray-800 flex items-center justify-center text-xs font-mono text-gray-400",children:Tx[r.activityType]??"?"}),i.jsx("span",{className:`text-xs font-medium px-1.5 py-0.5 rounded ${yd[r.threatLevel]}`,children:r.threatLevel}),i.jsx("div",{className:"flex gap-1",children:(d=r.threatFindings)==null?void 0:d.map((p,h)=>i.jsx("span",{className:"px-1.5 py-0.5 bg-gray-800 text-gray-400 rounded font-mono text-[10px]",children:p.categoryId},h))}),i.jsx("span",{className:"text-xs text-gray-300 flex-1 truncate",children:r.detail}),i.jsx("span",{className:"text-xs text-gray-600 flex-shrink-0",children:new Date(r.timestamp).toLocaleString()}),i.jsx("button",{onClick:p=>{p.stopPropagation(),c(r.id,r.resolved)},className:`px-3 py-1 text-xs rounded-lg font-medium transition-colors cursor-pointer flex-shrink-0 ${r.resolved?"bg-green-500/20 text-green-400 ring-1 ring-green-500/40 hover:bg-green-500/30":"bg-amber-500/20 text-amber-400 ring-1 ring-amber-500/40 hover:bg-amber-500/30"}`,children:r.resolved?"Resolved":"Unresolved"})]}),o&&i.jsxs("div",{className:"border-t border-gray-800 p-4 space-y-3",children:[r.secretsDetected&&r.secretsDetected.length>0&&i.jsxs("div",{className:"rounded border border-red-900/50 bg-red-950/20 p-3",children:[i.jsx("p",{className:"text-[10px] uppercase tracking-wider text-red-400 font-medium mb-2",children:"Identified Secrets"}),i.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:r.secretsDetected.map((p,h)=>i.jsx("span",{className:"px-2 py-0.5 bg-red-900/30 text-red-300 rounded text-xs font-mono",children:p},h))})]}),r.contentPreview&&i.jsxs("div",{className:"rounded border border-gray-700 bg-gray-800/50 p-3",children:[i.jsx("p",{className:"text-[10px] uppercase tracking-wider text-gray-500 font-medium mb-2",children:"Detected Content"}),i.jsx("pre",{className:"text-xs text-gray-300 font-mono whitespace-pre-wrap break-all max-h-40 overflow-y-auto",children:r.contentPreview})]}),r.runId&&i.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[i.jsx("span",{className:"text-gray-500",children:"Interaction ID:"}),i.jsx("code",{className:"bg-gray-800 text-gray-400 px-1.5 py-0.5 rounded font-mono",children:r.runId})]}),r.threatFindings&&r.threatFindings.length>0?r.threatFindings.map((p,h)=>{const x=_x(p);return i.jsxs("div",{className:`p-3 rounded border ${Rx[p.severity]??"bg-gray-800 border-gray-700"}`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx("span",{className:"font-mono text-xs bg-gray-800 px-1.5 py-0.5 rounded text-gray-300",children:p.categoryId}),i.jsx("span",{className:"text-xs font-medium text-gray-300",children:p.categoryName}),i.jsx("span",{className:`text-xs font-medium ${yd[p.severity]}`,children:p.severity}),p.owaspRef&&i.jsx("span",{className:"text-[10px] text-gray-500 bg-gray-800 px-1 rounded",children:p.owaspRef})]}),i.jsx("p",{className:"text-xs text-gray-300 mb-1",children:p.reason}),p.evidence&&i.jsxs("p",{className:"text-xs text-gray-500 mb-2",children:[i.jsx("span",{className:"text-gray-600",children:"Evidence:"})," ",i.jsx("code",{className:"bg-gray-800 px-1 rounded",children:p.evidence})]}),i.jsxs("div",{className:"bg-gray-800/50 rounded p-2.5 mt-2 border border-gray-700/50",children:[i.jsx("p",{className:"text-[10px] uppercase tracking-wider text-gray-500 font-medium mb-1",children:"Recommended Action"}),i.jsx("p",{className:"text-xs text-gray-300",children:x.defaultAdvice}),x.contextAdvice&&i.jsx("p",{className:"text-xs text-gray-500 mt-1",children:x.contextAdvice})]})]},h)}):i.jsx("p",{className:"text-xs text-gray-500",children:"No detailed findings available."}),i.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-500 pt-2 border-t border-gray-800",children:[i.jsxs("span",{children:["Type: ",i.jsx("span",{className:"text-gray-400",children:r.activityType})]}),r.toolName&&i.jsxs("span",{children:["Tool:"," ",i.jsx("span",{className:"text-gray-400 font-mono",children:r.toolName})]}),r.targetPath&&i.jsxs("span",{children:["Path:"," ",i.jsx("span",{className:"text-gray-400 font-mono",children:r.targetPath})]})]}),r.resolved&&r.resolvedAt&&i.jsxs("p",{className:"text-xs text-gray-600",children:["Resolved at: ",new Date(r.resolvedAt).toLocaleString()]})]})]})}const vd={filesystem:{title:"File System Access",description:"Controls read, write, edit, and apply_patch tools. Modifies the group:fs entry in OpenClaw's tool deny list."},mcp_servers:{title:"MCP Servers (Plugins)",description:"Master toggle for all OpenClaw plugins. Expand below to manage individual servers."},network:{title:"Network Access",description:"Controls web_search, web_fetch tools and the browser. Modifies group:web deny list and browser.enabled."},system_commands:{title:"System Commands",description:"Controls exec, bash, and process tools. Modifies the group:runtime entry in OpenClaw's tool deny list."}},Dx=["mcp_servers","network","system_commands"];function Fx(){const[r,o]=g.useState(null),[l,c]=g.useState(null),[d,p]=g.useState(null),[h,x]=g.useState(!0),[y,b]=g.useState(null),[N,C]=g.useState(""),[P,I]=g.useState("rw"),[W,_]=g.useState("off"),[T,z]=g.useState([]),[H,$]=g.useState(""),[ee,R]=g.useState(!1),[Q,te]=g.useState(""),[me,Ae]=g.useState(""),[Re,Ze]=g.useState("ro"),[le,Ve]=g.useState(null),[De,Ke]=g.useState(""),[Ce,we]=g.useState(""),[U,Z]=g.useState(!1),V=Ln(),k=g.useRef(null),L=g.useRef(null);g.useEffect(()=>{B.emit("safeclaw:getAccessControlState"),B.emit("safeclaw:getOpenclawConfig"),B.emit("safeclaw:getSrtStatus");const F=ce=>{o(ce),c(null),p(null)},q=ce=>{var et,Ee,At,pt,rn,Wt,kt,ht,Vt,sn,on,ln,an,Kt,Ot,cn;ce&&(b(ce),C(((Ee=(et=ce.agents)==null?void 0:et.defaults)==null?void 0:Ee.workspace)??""),I(((rn=(pt=(At=ce.agents)==null?void 0:At.defaults)==null?void 0:pt.sandbox)==null?void 0:rn.workspaceAccess)??"rw"),_(((ht=(kt=(Wt=ce.agents)==null?void 0:Wt.defaults)==null?void 0:kt.sandbox)==null?void 0:ht.mode)??"off"),z(((ln=(on=(sn=(Vt=ce.agents)==null?void 0:Vt.defaults)==null?void 0:sn.sandbox)==null?void 0:on.docker)==null?void 0:ln.binds)??[]),$(((cn=(Ot=(Kt=(an=ce.agents)==null?void 0:an.defaults)==null?void 0:Kt.sandbox)==null?void 0:Ot.docker)==null?void 0:cn.network)??""))},ae=ce=>{Ve(ce)};return B.on("safeclaw:accessControlState",F),B.on("safeclaw:openclawConfig",q),B.on("safeclaw:srtStatus",ae),()=>{B.off("safeclaw:accessControlState",F),B.off("safeclaw:openclawConfig",q),B.off("safeclaw:srtStatus",ae)}},[]),g.useEffect(()=>{V.hash==="#sandbox"&&k.current&&k.current.scrollIntoView({behavior:"smooth",block:"start"}),V.hash==="#egress"&&L.current&&L.current.scrollIntoView({behavior:"smooth",block:"start"})},[V.hash,r,y,le]);const oe=(F,q)=>{c(F),B.emit("safeclaw:toggleAccess",{category:F,enabled:!q})},ie=(F,q)=>{p(F),B.emit("safeclaw:toggleMcpServer",{serverName:F,enabled:!q})},de=()=>{R(!0);const F=W,q={agents:{defaults:{workspace:N||null,sandbox:{mode:F,workspaceAccess:P,docker:F!=="off"?{binds:T.length>0?T:null,network:H||null}:null}}}};B.emit("safeclaw:updateOpenclawConfig",q),setTimeout(()=>R(!1),600)},fe=()=>{if(!Q.trim())return;const F=me.trim()||Q.trim(),q=`${Q.trim()}:${F}:${Re}`;z(ae=>[...ae,q]),te(""),Ae(""),Ze("ro")},ve=F=>{z(q=>q.filter((ae,ce)=>ce!==F))};if(!r)return i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Access Control"}),i.jsx("p",{className:"text-gray-500",children:"Loading access control state..."})]});if(!r.openclawConfigAvailable)return i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Access Control"}),i.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900 p-6",children:[i.jsxs("p",{className:"text-gray-400",children:["OpenClaw config not found at"," ",i.jsx("code",{className:"text-gray-300",children:"~/.openclaw/openclaw.json"}),"."]}),i.jsx("p",{className:"text-gray-500 mt-2 text-sm",children:"Install and configure OpenClaw first, then return here to manage access controls."})]})]});const pe=new Map;for(const F of r.toggles)pe.set(F.category,F);const xe=W==="all"||W==="non-main";return i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Access Control"}),i.jsxs("p",{className:"text-sm text-gray-500 mb-6",children:["Control what OpenClaw can access. Changes are written directly to"," ",i.jsx("code",{className:"text-gray-400",children:"~/.openclaw/openclaw.json"}),"."]}),i.jsxs("div",{className:"space-y-4",children:[y&&i.jsx("div",{id:"sandbox",ref:k,children:i.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900 p-6",children:[i.jsx("div",{className:"flex items-center justify-between mb-1",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h3",{className:"text-sm font-medium text-gray-200",children:"Sandbox & Workspace Isolation"}),xe?i.jsxs("span",{className:"flex items-center gap-1.5 px-2 py-0.5 text-xs font-medium rounded-full bg-green-900/50 text-green-400 border border-green-700/50",children:[i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400"}),"ACTIVE"]}):i.jsxs("span",{className:"flex items-center gap-1.5 px-2 py-0.5 text-xs font-medium rounded-full bg-yellow-900/50 text-yellow-400 border border-yellow-700/50",children:[i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-yellow-400"}),"RECOMMENDED"]})]})}),i.jsx("p",{className:"text-sm text-gray-500 mb-2",children:"Anthropic's #1 security recommendation. Runs agents in a Docker container with restricted filesystem and network access."}),i.jsxs("p",{className:"text-xs text-gray-600 mb-4",children:["Sandbox controls what the agent can access inside its container. Command approval is configured separately in"," ",i.jsx("a",{href:"/interception",className:"text-primary hover:underline",children:"Command Interception"}),"."]}),i.jsxs("div",{className:"space-y-3",children:[(()=>{const F=pe.get("filesystem"),q=vd.filesystem;if(!F||!q)return null;const ae=F.enabled,ce=l==="filesystem";return i.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-gray-800 bg-gray-800/30 px-4 py-3",children:[i.jsxs("div",{className:"flex-1 mr-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm font-medium text-gray-200",children:q.title}),!ae&&i.jsx("span",{className:"px-2 py-0.5 text-xs font-medium rounded-full bg-red-900/50 text-red-400 border border-red-700/50",children:"RESTRICTED"})]}),i.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:q.description})]}),i.jsx("button",{type:"button",onClick:()=>oe("filesystem",ae),disabled:ce,className:`w-11 h-6 rounded-full flex items-center px-0.5 transition-colors cursor-pointer disabled:opacity-50 ${ae?"bg-success":"bg-gray-700"}`,children:i.jsx("div",{className:`w-5 h-5 rounded-full bg-white transition-transform ${ae?"translate-x-5":"translate-x-0"}`})})]})})(),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm text-gray-400 block mb-1",children:"Workspace Path"}),i.jsx("p",{className:"text-xs text-gray-600 mb-2",children:"The directory OpenClaw agents work in. This sets the agent's working directory, but does not restrict access to other paths unless sandbox mode is enabled."}),i.jsx("input",{type:"text",value:N,onChange:F=>C(F.target.value),placeholder:"e.g. ~/Desktop or ~/.openclaw/workspace",className:"w-full rounded-lg bg-gray-800 border border-gray-700 text-gray-200 px-3 py-2 text-sm focus:outline-none focus:border-primary"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm text-gray-400 block mb-1",children:"Workspace Access Level"}),i.jsxs("p",{className:"text-xs text-gray-600 mb-2",children:["Controls how sandboxed agents access the workspace.",!xe&&i.jsxs("span",{className:"text-yellow-500",children:[" ","Only takes effect when sandbox mode is enabled below."]})]}),i.jsxs("select",{value:P,onChange:F=>I(F.target.value),className:"w-full rounded-lg bg-gray-800 border border-gray-700 text-gray-200 px-3 py-2 text-sm focus:outline-none focus:border-primary",children:[i.jsx("option",{value:"rw",children:"Read-Write — full access to workspace"}),i.jsx("option",{value:"ro",children:"Read-Only — can read but not modify files"}),i.jsx("option",{value:"none",children:"None — no access to host workspace"})]})]}),i.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-800",children:[i.jsx("h4",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider mb-3",children:"Docker Sandbox"}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm text-gray-400 block mb-1",children:"Sandbox Mode"}),i.jsx("p",{className:"text-xs text-gray-600 mb-2",children:"Runs OpenClaw agents inside a Docker container. Requires Docker to be installed and running."}),i.jsxs("select",{value:W,onChange:F=>_(F.target.value),className:"w-full rounded-lg bg-gray-800 border border-gray-700 text-gray-200 px-3 py-2 text-sm focus:outline-none focus:border-primary",children:[i.jsx("option",{value:"off",children:"Off — no sandboxing, agent runs as your user"}),i.jsx("option",{value:"non-main",children:"Non-Main — sandbox sub-agents only"}),i.jsx("option",{value:"all",children:"All — sandbox all agents including main"})]})]})]}),!xe&&i.jsx("div",{className:"rounded-lg bg-yellow-900/30 border border-yellow-700/50 px-4 py-2",children:i.jsxs("p",{className:"text-xs text-yellow-400",children:["Sandbox mode is ",i.jsx("strong",{children:W}),". Without Docker sandboxing, the agent runs as your user and can access any file on your system. The workspace path sets a default directory but does not enforce boundaries."]})}),xe&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"rounded-lg bg-green-900/30 border border-green-700/50 px-4 py-2",children:i.jsxs("p",{className:"text-xs text-green-400",children:["Sandbox mode is ",i.jsx("strong",{children:W}),". The agent runs in a Docker container and can only access the workspace directory (at the level set above) plus any explicitly bound mount paths below."]})}),i.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-800",children:[i.jsx("h4",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider mb-1",children:"Bind Mounts"}),i.jsx("p",{className:"text-xs text-gray-600 mb-3",children:"Host directories to mount into the Docker container. These are the only paths (besides the workspace) the agent can access."}),T.length>0&&i.jsx("div",{className:"space-y-2 mb-3",children:T.map((F,q)=>{const ae=F.split(":"),ce=ae[0]??F,et=ae[1]??ce,Ee=ae[2]??"rw";return i.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-gray-800/50 border border-gray-700/50 px-3 py-2",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("span",{className:"text-xs text-gray-300 font-mono truncate block",children:ce}),i.jsxs("span",{className:"text-xs text-gray-600",children:["→ ",et]})]}),i.jsx("span",{className:`px-2 py-0.5 text-xs font-medium rounded-full ${Ee==="ro"?"bg-blue-900/50 text-blue-400 border border-blue-700/50":"bg-orange-900/50 text-orange-400 border border-orange-700/50"}`,children:Ee}),i.jsx("button",{type:"button",onClick:()=>ve(q),className:"text-gray-500 hover:text-red-400 transition-colors cursor-pointer text-sm",title:"Remove mount",children:"✕"})]},q)})}),i.jsxs("div",{className:"rounded-lg bg-gray-800/30 border border-gray-700/50 p-3",children:[i.jsxs("div",{className:"grid grid-cols-[1fr_1fr_auto] gap-2 items-end",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-xs text-gray-500 block mb-1",children:"Host Path"}),i.jsx("input",{type:"text",value:Q,onChange:F=>te(F.target.value),placeholder:"/home/user/projects",className:"w-full rounded-lg bg-gray-800 border border-gray-700 text-gray-200 px-3 py-1.5 text-sm focus:outline-none focus:border-primary"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-xs text-gray-500 block mb-1",children:"Container Path (optional)"}),i.jsx("input",{type:"text",value:me,onChange:F=>Ae(F.target.value),placeholder:"Same as host path",className:"w-full rounded-lg bg-gray-800 border border-gray-700 text-gray-200 px-3 py-1.5 text-sm focus:outline-none focus:border-primary"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-xs text-gray-500 block mb-1",children:"Mode"}),i.jsxs("select",{value:Re,onChange:F=>Ze(F.target.value),className:"rounded-lg bg-gray-800 border border-gray-700 text-gray-200 px-3 py-1.5 text-sm focus:outline-none focus:border-primary",children:[i.jsx("option",{value:"ro",children:"ro"}),i.jsx("option",{value:"rw",children:"rw"})]})]})]}),i.jsx("div",{className:"flex justify-end mt-2",children:i.jsx("button",{type:"button",onClick:fe,disabled:!Q.trim(),className:"rounded-lg bg-gray-700 px-3 py-1 text-xs font-medium text-gray-200 hover:bg-gray-600 transition-colors disabled:opacity-50 cursor-pointer",children:"+ Add Mount"})})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm text-gray-400 block mb-1",children:"Docker Network"}),i.jsx("p",{className:"text-xs text-gray-600 mb-2",children:'Controls network access inside the sandbox. Set to "none" to completely block outbound network access from the container.'}),i.jsxs("select",{value:H,onChange:F=>$(F.target.value),className:"w-full rounded-lg bg-gray-800 border border-gray-700 text-gray-200 px-3 py-2 text-sm focus:outline-none focus:border-primary",children:[i.jsx("option",{value:"",children:"Default — standard Docker networking"}),i.jsx("option",{value:"none",children:"None — no network access (fully isolated)"}),i.jsx("option",{value:"host",children:"Host — share host network stack"})]})]})]}),i.jsx("div",{className:"flex justify-end",children:i.jsx("button",{type:"button",onClick:de,disabled:ee,className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors disabled:opacity-50 cursor-pointer",children:ee?"Saving...":"Save"})})]})]})}),le&&i.jsx("div",{id:"egress",ref:L,children:i.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900 p-6",children:[i.jsxs("div",{className:"flex items-center justify-between mb-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h3",{className:"text-sm font-medium text-gray-200",children:"Egress Proxy & Domain Filtering"}),le.installed?i.jsxs("span",{className:"flex items-center gap-1.5 px-2 py-0.5 text-xs font-medium rounded-full bg-blue-900/50 text-blue-400 border border-blue-700/50",children:["srt ",le.version??""]}):i.jsx("span",{className:"flex items-center gap-1.5 px-2 py-0.5 text-xs font-medium rounded-full bg-gray-800 text-gray-500 border border-gray-700/50",children:"not installed"}),le.enabled&&le.installed&&i.jsxs("span",{className:"flex items-center gap-1.5 px-2 py-0.5 text-xs font-medium rounded-full bg-green-900/50 text-green-400 border border-green-700/50",children:[i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400"}),"ACTIVE"]})]}),i.jsx("button",{type:"button",onClick:()=>B.emit("safeclaw:toggleSrt",{enabled:!le.enabled}),disabled:!le.installed,className:`w-11 h-6 rounded-full flex items-center px-0.5 transition-colors cursor-pointer disabled:opacity-50 ${le.enabled?"bg-success":"bg-gray-700"}`,children:i.jsx("div",{className:`w-5 h-5 rounded-full bg-white transition-transform ${le.enabled?"translate-x-5":"translate-x-0"}`})})]}),i.jsx("p",{className:"text-sm text-gray-500 mb-2",children:"Uses Anthropic's Sandbox Runtime (srt) to enforce network domain allowlists without Docker. All network access is denied by default; only allowed domains are reachable."}),!le.installed&&i.jsxs("div",{className:"rounded-lg bg-yellow-900/30 border border-yellow-700/50 px-4 py-3 mt-3",children:[i.jsx("p",{className:"text-xs text-yellow-400 mb-2",children:"Install the Sandbox Runtime CLI to enable egress filtering:"}),i.jsx("code",{className:"block text-xs text-yellow-300 bg-gray-800 rounded px-3 py-2 font-mono",children:"npm install -g @anthropic-ai/sandbox-runtime"})]}),le.installed&&le.enabled&&le.settings&&i.jsxs("div",{className:"mt-4 space-y-4",children:[i.jsxs("div",{className:"rounded-lg bg-gray-800/50 border border-gray-700/50 px-4 py-3",children:[i.jsx("p",{className:"text-xs text-gray-400 mb-1",children:"Launch your agent with srt to enforce domain filtering:"}),i.jsx("code",{className:"block text-xs text-green-400 bg-gray-800 rounded px-3 py-2 font-mono",children:"srt openclaw start"})]}),i.jsxs("div",{children:[i.jsxs("h4",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider mb-2",children:["Allowed Domains (",le.settings.network.allowedDomains.length,")"]}),i.jsx("p",{className:"text-xs text-gray-600 mb-2",children:"Only these domains are reachable when srt is active. Supports wildcards (e.g. *.github.com)."}),le.settings.network.allowedDomains.length>0&&i.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:le.settings.network.allowedDomains.map(F=>i.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-lg bg-green-900/30 text-green-400 border border-green-700/50",children:[i.jsx("span",{className:"font-mono",children:F}),i.jsx("button",{type:"button",onClick:()=>B.emit("safeclaw:updateSrtDomains",{list:"allow",action:"remove",domain:F}),className:"text-green-600 hover:text-red-400 transition-colors cursor-pointer",children:"✕"})]},F))}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"text",value:De,onChange:F=>Ke(F.target.value),onKeyDown:F=>{F.key==="Enter"&&De.trim()&&(B.emit("safeclaw:updateSrtDomains",{list:"allow",action:"add",domain:De.trim()}),Ke(""))},placeholder:"e.g. api.github.com or *.npmjs.org",className:"flex-1 rounded-lg bg-gray-800 border border-gray-700 text-gray-200 px-3 py-1.5 text-sm focus:outline-none focus:border-primary"}),i.jsx("button",{type:"button",onClick:()=>{De.trim()&&(B.emit("safeclaw:updateSrtDomains",{list:"allow",action:"add",domain:De.trim()}),Ke(""))},disabled:!De.trim(),className:"rounded-lg bg-gray-700 px-3 py-1.5 text-xs font-medium text-gray-200 hover:bg-gray-600 transition-colors disabled:opacity-50 cursor-pointer",children:"+ Add"})]})]}),i.jsxs("div",{children:[i.jsxs("h4",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider mb-2",children:["Denied Domains (",le.settings.network.deniedDomains.length,")"]}),i.jsx("p",{className:"text-xs text-gray-600 mb-2",children:"Explicitly blocked domains. Useful for blocking known-bad destinations."}),le.settings.network.deniedDomains.length>0&&i.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:le.settings.network.deniedDomains.map(F=>i.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-lg bg-red-900/30 text-red-400 border border-red-700/50",children:[i.jsx("span",{className:"font-mono",children:F}),i.jsx("button",{type:"button",onClick:()=>B.emit("safeclaw:updateSrtDomains",{list:"deny",action:"remove",domain:F}),className:"text-red-600 hover:text-red-300 transition-colors cursor-pointer",children:"✕"})]},F))}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"text",value:Ce,onChange:F=>we(F.target.value),onKeyDown:F=>{F.key==="Enter"&&Ce.trim()&&(B.emit("safeclaw:updateSrtDomains",{list:"deny",action:"add",domain:Ce.trim()}),we(""))},placeholder:"e.g. pastebin.com or *.evil.com",className:"flex-1 rounded-lg bg-gray-800 border border-gray-700 text-gray-200 px-3 py-1.5 text-sm focus:outline-none focus:border-primary"}),i.jsx("button",{type:"button",onClick:()=>{Ce.trim()&&(B.emit("safeclaw:updateSrtDomains",{list:"deny",action:"add",domain:Ce.trim()}),we(""))},disabled:!Ce.trim(),className:"rounded-lg bg-gray-700 px-3 py-1.5 text-xs font-medium text-gray-200 hover:bg-gray-600 transition-colors disabled:opacity-50 cursor-pointer",children:"+ Add"})]})]}),i.jsxs("div",{className:"pt-3 border-t border-gray-800",children:[i.jsxs("button",{type:"button",onClick:()=>Z(!U),className:"flex items-center gap-2 text-xs font-medium text-gray-400 uppercase tracking-wider cursor-pointer hover:text-gray-300",children:[i.jsx("span",{className:`inline-block transition-transform ${U?"rotate-90":""}`,children:"▶"}),"Filesystem Restrictions"]}),U&&i.jsxs("div",{className:"mt-3 space-y-3",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-xs text-gray-500 block mb-1",children:"Deny Read Paths"}),i.jsx("p",{className:"text-xs text-gray-600 mb-1",children:"Paths the agent cannot read (e.g. ~/.ssh, ~/.aws)."}),i.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-1",children:[le.settings.filesystem.denyRead.map(F=>i.jsx("span",{className:"text-xs font-mono px-2 py-0.5 rounded bg-gray-800 text-gray-400 border border-gray-700",children:F},F)),le.settings.filesystem.denyRead.length===0&&i.jsx("span",{className:"text-xs text-gray-600",children:"No deny-read paths configured"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-xs text-gray-500 block mb-1",children:"Allow Write Paths"}),i.jsx("p",{className:"text-xs text-gray-600 mb-1",children:"Paths the agent is allowed to write to."}),i.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-1",children:[le.settings.filesystem.allowWrite.map(F=>i.jsx("span",{className:"text-xs font-mono px-2 py-0.5 rounded bg-gray-800 text-gray-400 border border-gray-700",children:F},F)),le.settings.filesystem.allowWrite.length===0&&i.jsx("span",{className:"text-xs text-gray-600",children:"No allow-write paths configured"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-xs text-gray-500 block mb-1",children:"Deny Write Paths"}),i.jsx("p",{className:"text-xs text-gray-600 mb-1",children:"Paths the agent cannot write to."}),i.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-1",children:[le.settings.filesystem.denyWrite.map(F=>i.jsx("span",{className:"text-xs font-mono px-2 py-0.5 rounded bg-gray-800 text-gray-400 border border-gray-700",children:F},F)),le.settings.filesystem.denyWrite.length===0&&i.jsx("span",{className:"text-xs text-gray-600",children:"No deny-write paths configured"})]})]}),i.jsxs("p",{className:"text-xs text-gray-600",children:["Edit ",i.jsx("code",{className:"text-gray-500",children:le.settingsPath})," directly for advanced filesystem configuration."]})]})]})]}),le.installed&&!le.enabled&&i.jsxs("p",{className:"text-xs text-gray-600 mt-3",children:["Enable srt above to configure domain filtering rules. Settings are stored in ",i.jsx("code",{className:"text-gray-500",children:le.settingsPath}),"."]})]})}),Dx.map(F=>{const q=pe.get(F);if(!q)return null;const ae=vd[F];if(!ae)return null;const ce=q.enabled,et=l===F;return i.jsx("div",{children:i.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900 p-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex-1 mr-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h3",{className:"text-sm font-medium text-gray-200",children:ae.title}),!ce&&i.jsx("span",{className:"px-2 py-0.5 text-xs font-medium rounded-full bg-red-900/50 text-red-400 border border-red-700/50",children:"RESTRICTED"})]}),i.jsx("p",{className:"text-sm text-gray-500 mt-1",children:ae.description})]}),i.jsx("button",{type:"button",onClick:()=>oe(F,ce),disabled:et,className:`w-11 h-6 rounded-full flex items-center px-0.5 transition-colors cursor-pointer disabled:opacity-50 ${ce?"bg-success":"bg-gray-700"}`,children:i.jsx("div",{className:`w-5 h-5 rounded-full bg-white transition-transform ${ce?"translate-x-5":"translate-x-0"}`})})]}),F==="mcp_servers"&&r.mcpServers.length>0&&i.jsxs("div",{className:"mt-5 pt-5 border-t border-gray-800",children:[i.jsxs("button",{type:"button",onClick:()=>x(!h),className:"flex items-center gap-2 text-xs font-medium text-gray-400 uppercase tracking-wider mb-3 cursor-pointer hover:text-gray-300",children:[i.jsx("span",{className:`inline-block transition-transform ${h?"rotate-90":""}`,children:"▶"}),"Individual Servers (",r.mcpServers.length,")"]}),h&&i.jsx("div",{className:"space-y-2",children:r.mcpServers.map(Ee=>{const At=d===Ee.name,pt=!ce;return i.jsxs("div",{className:`flex items-center justify-between py-2 px-3 rounded-lg border border-gray-800 ${pt?"opacity-50":"bg-gray-800/30"}`,children:[i.jsxs("div",{className:"flex-1 min-w-0 mr-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-sm text-gray-200 truncate",children:Ee.name}),!Ee.pluginEnabled&&i.jsx("span",{className:"px-1.5 py-0.5 text-xs rounded bg-gray-700 text-gray-400",children:"plugin disabled"}),Ee.toolsDenyBlocked&&i.jsx("span",{className:"px-1.5 py-0.5 text-xs rounded bg-red-900/50 text-red-400",children:"tools blocked"})]}),i.jsx("p",{className:"text-xs text-gray-600 mt-0.5",children:Ee.effectivelyEnabled?"Server active, tools accessible":Ee.toolsDenyBlocked?`Blocked via tools.deny (mcp__${Ee.name})`:"Plugin connection disabled"})]}),i.jsx("button",{type:"button",onClick:()=>ie(Ee.name,Ee.effectivelyEnabled),disabled:At||pt,className:`w-11 h-6 rounded-full flex items-center px-0.5 transition-colors cursor-pointer disabled:opacity-50 ${Ee.effectivelyEnabled?"bg-success":"bg-gray-700"}`,children:i.jsx("div",{className:`w-5 h-5 rounded-full bg-white transition-transform ${Ee.effectivelyEnabled?"translate-x-5":"translate-x-0"}`})})]},Ee.name)})})]}),F==="mcp_servers"&&r.mcpServers.length===0&&i.jsx("div",{className:"mt-5 pt-5 border-t border-gray-800",children:i.jsx("p",{className:"text-sm text-gray-500",children:"No MCP servers configured in OpenClaw."})})]})},F)})]})]})}const wd=["anthropic/claude-4.5-sonnet","anthropic/claude-4-opus","openai/gpt-5","openai/gpt-4.5"],Di=["anthropic/claude-haiku-4-5","anthropic/claude-haiku-3-5"];function Bx(){var Ce,we,U,Z,V,k,L,oe,ie,de,fe,ve,pe,xe,F;const[r,o]=g.useState(null),[l,c]=g.useState(!1),[d,p]=g.useState(!1),[h,x]=g.useState(""),[y,b]=g.useState(""),[N,C]=g.useState(""),[P,I]=g.useState(""),[W,_]=g.useState(""),[T,z]=g.useState(""),[H,$]=g.useState("loopback"),[ee,R]=g.useState(!1),[Q,te]=g.useState({});g.useEffect(()=>{B.emit("safeclaw:getOpenclawConfig");const q=ae=>{var ce,et,Ee,At,pt,rn,Wt,kt,ht,Vt,sn,on,ln,an,Kt,Ot,cn,un;if(!ae){c(!0);return}o(ae),x(((et=(ce=ae.gateway)==null?void 0:ce.trustedProxies)==null?void 0:et.join(", "))??""),b(((pt=(At=(Ee=ae.agents)==null?void 0:Ee.defaults)==null?void 0:At.model)==null?void 0:pt.primary)??""),C(((Wt=(rn=ae.channels)==null?void 0:rn.whatsapp)==null?void 0:Wt.dmPolicy)??""),I(((Vt=(ht=(kt=ae.channels)==null?void 0:kt.whatsapp)==null?void 0:ht.allowFrom)==null?void 0:Vt.join(", "))??""),_(String(((on=(sn=ae.agents)==null?void 0:sn.defaults)==null?void 0:on.maxConcurrent)??"")),z(String(((Kt=(an=(ln=ae.agents)==null?void 0:ln.defaults)==null?void 0:an.subagents)==null?void 0:Kt.maxConcurrent)??"")),$(((Ot=ae.gateway)==null?void 0:Ot.bind)??"loopback"),R(((un=(cn=ae.channels)==null?void 0:cn.whatsapp)==null?void 0:un.selfChatMode)??!1),te({})};return B.on("safeclaw:openclawConfig",q),()=>{B.off("safeclaw:openclawConfig",q)}},[]);const me=q=>{p(!0),B.emit("safeclaw:updateOpenclawConfig",q),setTimeout(()=>p(!1),600)},Ae=()=>{const q=h.split(",").map(ae=>ae.trim()).filter(Boolean);me({gateway:{trustedProxies:q.length>0?q:void 0}})},Re=()=>{me({agents:{defaults:{model:{primary:y}}}})},Ze=()=>{me({agents:{defaults:{maxConcurrent:W?Number(W):void 0,subagents:T?{maxConcurrent:Number(T)}:void 0}}})},le=()=>{me({gateway:{bind:H}})},Ve=(q,ae)=>{const ce=!ae;te(et=>({...et,[q]:ce})),me({plugins:{entries:{[q]:{enabled:ce}}}})},De=()=>{const q=P.split(",").map(ae=>ae.trim()).filter(Boolean);me({channels:{whatsapp:{dmPolicy:N,allowFrom:q.length>0?q:void 0,selfChatMode:ee}}})};if(l)return i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold mb-6",children:"OpenClaw Configuration"}),i.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900 p-6",children:[i.jsxs("p",{className:"text-gray-400",children:["OpenClaw config not found at ",i.jsx("code",{children:"~/.openclaw/openclaw.json"}),"."]}),i.jsx("p",{className:"text-gray-500 mt-2 text-sm",children:"Install and configure OpenClaw first, then return here to manage its settings through SafeClaw."})]})]});if(!r)return i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold mb-6",children:"OpenClaw Configuration"}),i.jsx("p",{className:"text-gray-500",children:"Loading OpenClaw configuration..."})]});const Ke=Di.includes(y);return i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold mb-2",children:"OpenClaw Configuration"}),i.jsxs("p",{className:"text-sm text-gray-500 mb-6",children:["Manage the settings of your OpenClaw instance directly from SafeClaw. Changes are written to ",i.jsx("code",{children:"~/.openclaw/openclaw.json"}),"."]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs(Tn,{title:"Agent Model",badge:Ke?"WARN":void 0,children:[i.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"The primary model used by OpenClaw agents. Weaker models are more susceptible to prompt injection."}),Ke&&i.jsx("div",{className:"rounded-lg bg-yellow-900/30 border border-yellow-700/50 px-4 py-2 mb-3",children:i.jsx("p",{className:"text-sm text-yellow-400",children:"Current model is below recommended tier. Consider upgrading to a top-tier model."})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs("select",{value:y,onChange:q=>b(q.target.value),className:"flex-1 rounded-lg bg-gray-800 border border-gray-700 text-gray-200 px-3 py-2 text-sm focus:outline-none focus:border-primary",children:[i.jsx("optgroup",{label:"Recommended",children:wd.map(q=>i.jsx("option",{value:q,children:q},q))}),i.jsx("optgroup",{label:"Not Recommended",children:Di.map(q=>i.jsxs("option",{value:q,children:[q," (weak)"]},q))}),!wd.includes(y)&&!Di.includes(y)&&i.jsx("option",{value:y,children:y})]}),i.jsx(is,{onClick:Re,saving:d})]})]}),i.jsxs(Tn,{title:"Gateway Trusted Proxies",badge:(we=(Ce=r.gateway)==null?void 0:Ce.trustedProxies)!=null&&we.length?void 0:"WARN",children:[i.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"If you expose the Control UI through a reverse proxy, configure trusted proxies so local-client checks cannot be spoofed. Comma separated IPs."}),!((Z=(U=r.gateway)==null?void 0:U.trustedProxies)!=null&&Z.length)&&i.jsx("div",{className:"rounded-lg bg-yellow-900/30 border border-yellow-700/50 px-4 py-2 mb-3",children:i.jsx("p",{className:"text-sm text-yellow-400",children:"No trusted proxies configured. Set your proxy IPs or keep the Control UI local-only."})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"text",value:h,onChange:q=>x(q.target.value),placeholder:"e.g. 10.0.0.1, 192.168.1.1",className:"flex-1 rounded-lg bg-gray-800 border border-gray-700 text-gray-200 px-3 py-2 text-sm focus:outline-none focus:border-primary"}),i.jsx(is,{onClick:Ae,saving:d})]})]}),i.jsxs(Tn,{title:"Agent Concurrency",children:[i.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"Limit the number of concurrent agents and subagents running."}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("label",{className:"text-sm text-gray-400 w-40",children:"Max agents"}),i.jsx("input",{type:"number",value:W,onChange:q=>_(q.target.value),min:1,max:32,className:"w-24 rounded-lg bg-gray-800 border border-gray-700 text-gray-200 px-3 py-2 text-sm focus:outline-none focus:border-primary"})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("label",{className:"text-sm text-gray-400 w-40",children:"Max subagents"}),i.jsx("input",{type:"number",value:T,onChange:q=>z(q.target.value),min:1,max:64,className:"w-24 rounded-lg bg-gray-800 border border-gray-700 text-gray-200 px-3 py-2 text-sm focus:outline-none focus:border-primary"})]}),i.jsx("div",{className:"flex justify-end mt-2",children:i.jsx(is,{onClick:Ze,saving:d})})]})]}),i.jsxs(Tn,{title:"WhatsApp Channel",children:[i.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"Control who can message the OpenClaw agent via WhatsApp."}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("label",{className:"text-sm text-gray-400 w-40",children:"DM Policy"}),i.jsxs("select",{value:N,onChange:q=>C(q.target.value),className:"flex-1 rounded-lg bg-gray-800 border border-gray-700 text-gray-200 px-3 py-2 text-sm focus:outline-none focus:border-primary",children:[i.jsx("option",{value:"allowlist",children:"Allowlist only"}),i.jsx("option",{value:"open",children:"Open (anyone can message)"}),i.jsx("option",{value:"disabled",children:"Disabled"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-sm text-gray-400 block mb-1",children:"Allowed phone numbers (comma separated)"}),i.jsx("input",{type:"text",value:P,onChange:q=>I(q.target.value),placeholder:"e.g. +491234567890, +1555123456",className:"w-full rounded-lg bg-gray-800 border border-gray-700 text-gray-200 px-3 py-2 text-sm focus:outline-none focus:border-primary"})]}),i.jsxs("div",{className:"flex items-center justify-between py-2",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-sm text-gray-400",children:"Self Chat Mode"}),i.jsx("p",{className:"text-xs text-gray-600 mt-0.5",children:"Allow the agent to receive messages from yourself"})]}),i.jsx("button",{type:"button",onClick:()=>R(!ee),className:`w-11 h-6 rounded-full flex items-center px-0.5 transition-colors cursor-pointer ${ee?"bg-success":"bg-gray-700"}`,children:i.jsx("div",{className:`w-5 h-5 rounded-full bg-white transition-transform ${ee?"translate-x-5":"translate-x-0"}`})})]}),i.jsx("div",{className:"flex justify-end",children:i.jsx(is,{onClick:De,saving:d})})]})]}),i.jsxs(Tn,{title:"Gateway Bind Address",badge:H!=="loopback"?"DANGER":void 0,children:[i.jsxs("p",{className:"text-sm text-gray-500 mb-3",children:["Controls which network interface the OpenClaw gateway listens on. Binding to ",i.jsx("code",{children:"0.0.0.0"})," exposes the gateway to your entire network."]}),H!=="loopback"&&i.jsx("div",{className:"rounded-lg bg-red-900/30 border border-red-700/50 px-4 py-2 mb-3",children:i.jsxs("p",{className:"text-sm text-red-400",children:["The gateway is bound to ",i.jsx("code",{children:H}),', which exposes it beyond localhost. Unless you need remote access, set this to "loopback" for security.']})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs("select",{value:H,onChange:q=>$(q.target.value),className:"flex-1 rounded-lg bg-gray-800 border border-gray-700 text-gray-200 px-3 py-2 text-sm focus:outline-none focus:border-primary",children:[i.jsx("option",{value:"loopback",children:"loopback (recommended)"}),i.jsx("option",{value:"0.0.0.0",children:"0.0.0.0 (all interfaces)"}),H!=="loopback"&&H!=="0.0.0.0"&&i.jsxs("option",{value:H,children:[H," (custom)"]})]}),i.jsx(is,{onClick:le,saving:d})]})]}),i.jsx(Tn,{title:"Gateway",children:i.jsxs("div",{className:"space-y-2",children:[i.jsx(Kn,{label:"Mode",value:((V=r.gateway)==null?void 0:V.mode)??"—"}),i.jsx(Kn,{label:"Port",value:String(((k=r.gateway)==null?void 0:k.port)??"—")}),i.jsx(Kn,{label:"Auth mode",value:((oe=(L=r.gateway)==null?void 0:L.auth)==null?void 0:oe.mode)??"—"}),i.jsx(Kn,{label:"Tailscale",value:((de=(ie=r.gateway)==null?void 0:ie.tailscale)==null?void 0:de.mode)??"off"})]})}),i.jsxs(Tn,{title:"Plugins",children:[i.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"Enable or disable individual OpenClaw plugins. Use Access Control for a master toggle that disables all plugins at once."}),i.jsx("div",{className:"space-y-2",children:(fe=r.plugins)!=null&&fe.entries&&Object.keys(r.plugins.entries).length>0?Object.entries(r.plugins.entries).map(([q,ae])=>{const ce=Q[q]??ae.enabled??!1;return i.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-800 last:border-0",children:[i.jsx("span",{className:"text-sm text-gray-200",children:q}),i.jsx("button",{type:"button",onClick:()=>Ve(q,ce),className:`w-11 h-6 rounded-full flex items-center px-0.5 transition-colors cursor-pointer ${ce?"bg-success":"bg-gray-700"}`,children:i.jsx("div",{className:`w-5 h-5 rounded-full bg-white transition-transform ${ce?"translate-x-5":"translate-x-0"}`})})]},q)}):i.jsx("p",{className:"text-sm text-gray-500",children:"No plugins configured."})})]}),i.jsx(Tn,{title:"Instance Info",children:i.jsxs("div",{className:"space-y-2",children:[i.jsx(Kn,{label:"Last version",value:((ve=r.meta)==null?void 0:ve.lastTouchedVersion)??"—"}),i.jsx(Kn,{label:"Last updated",value:((pe=r.meta)==null?void 0:pe.lastTouchedAt)??"—"}),i.jsx(Kn,{label:"Workspace",value:((F=(xe=r.agents)==null?void 0:xe.defaults)==null?void 0:F.workspace)??"—"})]})})]})]})}function Tn({title:r,badge:o,children:l}){const c=o==="DANGER"?"bg-red-900/50 text-red-400 border border-red-700/50":"bg-yellow-900/50 text-yellow-400 border border-yellow-700/50";return i.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900 p-6",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[i.jsx("h3",{className:"text-sm font-medium text-gray-200",children:r}),o&&i.jsx("span",{className:`px-2 py-0.5 text-xs font-medium rounded-full ${c}`,children:o})]}),l]})}function is({onClick:r,saving:o}){return i.jsx("button",{type:"button",onClick:r,disabled:o,className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-white hover:bg-primary/90 transition-colors disabled:opacity-50 cursor-pointer",children:o?"Saving...":"Save"})}function Kn({label:r,value:o}){return i.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-800 last:border-0",children:[i.jsx("span",{className:"text-sm text-gray-400",children:r}),i.jsx("span",{className:"text-sm text-gray-200",children:o})]})}const Fi=1024,Bi=65535;function zx(){const[r,o]=g.useState(null),[l,c]=g.useState(""),[d,p]=g.useState(null),[h,x]=g.useState(!1);g.useEffect(()=>{B.emit("safeclaw:getSettings");const I=W=>{o(W),c(String(W.port))};return B.on("safeclaw:settingsData",I),()=>{B.off("safeclaw:settingsData",I)}},[]);const y=()=>{r&&B.emit("safeclaw:updateSettings",{autoOpenBrowser:!r.autoOpenBrowser})},b=I=>{c(I),x(!1),p(null)},N=()=>{if(!r)return;const I=Number(l);if(!Number.isInteger(I)||I<Fi||I>Bi){p(`Port must be an integer between ${Fi} and ${Bi}`);return}p(null),B.emit("safeclaw:updateSettings",{port:I}),x(!0)},C=I=>{I.key==="Enter"&&N()},P=r?Number(l)!==r.port:!1;return i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Settings"}),r?i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900 p-6",children:[i.jsx("h3",{className:"text-sm font-medium text-gray-200 mb-4",children:"General"}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-800",children:[i.jsx("span",{className:"text-sm text-gray-400",children:"Port"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"number",min:Fi,max:Bi,value:l,onChange:I=>b(I.target.value),onKeyDown:C,className:"w-24 rounded-md border border-gray-700 bg-gray-800 px-2.5 py-1 text-sm text-gray-200 text-right focus:border-primary focus:outline-none [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"}),P&&!h&&i.jsx("button",{type:"button",onClick:N,className:"rounded-md bg-primary px-2.5 py-1 text-xs font-medium text-white hover:bg-primary/80 transition-colors cursor-pointer",children:"Save"})]})]}),d&&i.jsx("p",{className:"text-xs text-danger -mt-2",children:d}),h&&i.jsx("p",{className:"text-xs text-warning -mt-2",children:"Port updated. Restart SafeClaw for changes to take effect."}),i.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-800",children:[i.jsx("span",{className:"text-sm text-gray-400",children:"Auto-open browser"}),i.jsx("button",{type:"button",onClick:y,className:`w-11 h-6 rounded-full flex items-center px-0.5 transition-colors cursor-pointer ${r.autoOpenBrowser?"bg-success":"bg-gray-700"}`,children:i.jsx("div",{className:`w-5 h-5 rounded-full bg-white transition-transform ${r.autoOpenBrowser?"translate-x-5":"translate-x-0"}`})})]}),i.jsx(jo,{label:"Data directory",value:"~/.safeclaw/"})]})]}),i.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900 p-6",children:[i.jsx("h3",{className:"text-sm font-medium text-gray-200 mb-4",children:"Account"}),i.jsxs("div",{className:"space-y-3",children:[i.jsx(jo,{label:"Plan",value:r.premium?"Premium":"Free"}),i.jsx(jo,{label:"Version",value:r.version}),i.jsx(jo,{label:"User ID",value:r.userId??"Not set"})]})]})]}):i.jsx("p",{className:"text-gray-500",children:"Loading settings..."})]})}function jo({label:r,value:o}){return i.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-800 last:border-0",children:[i.jsx("span",{className:"text-sm text-gray-400",children:r}),i.jsx("span",{className:"text-sm text-gray-200",children:o})]})}const $x={"SK-HID":{name:"Hidden Content",shortName:"Hidden",color:"text-red-400"},"SK-INJ":{name:"Prompt Injection",shortName:"Injection",color:"text-red-400"},"SK-EXE":{name:"Shell Execution",shortName:"Exec",color:"text-red-400"},"SK-EXF":{name:"Data Exfiltration",shortName:"Exfil",color:"text-orange-400"},"SK-SEC":{name:"Embedded Secrets",shortName:"Secrets",color:"text-red-400"},"SK-SFA":{name:"Sensitive File Refs",shortName:"Files",color:"text-orange-400"},"SK-MEM":{name:"Memory/Config Poisoning",shortName:"Memory",color:"text-red-400"},"SK-SUP":{name:"Supply Chain Risk",shortName:"Supply",color:"text-orange-400"},"SK-B64":{name:"Encoded Payloads",shortName:"Encoded",color:"text-orange-400"},"SK-IMG":{name:"Image Exfiltration",shortName:"Image",color:"text-red-400"},"SK-SYS":{name:"System Prompt Extraction",shortName:"SysPrompt",color:"text-orange-400"},"SK-ARG":{name:"Argument Injection",shortName:"ArgInj",color:"text-red-400"},"SK-XTL":{name:"Cross-Tool Chaining",shortName:"XTool",color:"text-orange-400"},"SK-PRM":{name:"Excessive Permissions",shortName:"Perms",color:"text-orange-400"},"SK-STR":{name:"Suspicious Structure",shortName:"Structure",color:"text-yellow-400"}},Nd={CRITICAL:"text-red-400",HIGH:"text-orange-400",MEDIUM:"text-yellow-400",LOW:"text-blue-400",NONE:"text-green-400"},Ux={CRITICAL:"bg-red-900/20 border-red-800",HIGH:"bg-orange-900/20 border-orange-800",MEDIUM:"bg-yellow-900/20 border-yellow-800",LOW:"bg-blue-900/20 border-blue-800"},Co={CRITICAL:{bg:"bg-red-950/40",border:"border-red-800",text:"text-red-400",label:"CRITICAL — Do not use this skill"},HIGH:{bg:"bg-orange-950/40",border:"border-orange-800",text:"text-orange-400",label:"HIGH — Significant risk detected"},MEDIUM:{bg:"bg-yellow-950/40",border:"border-yellow-800",text:"text-yellow-400",label:"MEDIUM — Review recommended"},LOW:{bg:"bg-blue-950/40",border:"border-blue-800",text:"text-blue-400",label:"LOW — Minor concerns"},NONE:{bg:"bg-green-950/40",border:"border-green-800",text:"text-green-400",label:"CLEAN — No threats detected"}},Hx=["ALL","CRITICAL","HIGH","MEDIUM","LOW"],Wx={ALL:{active:"bg-gray-200 text-gray-900",inactive:"bg-gray-800 text-gray-400 hover:bg-gray-700"},CRITICAL:{active:"bg-red-500/20 text-red-400 ring-1 ring-red-500/40",inactive:"bg-gray-800 text-red-400/60 hover:bg-red-500/10"},HIGH:{active:"bg-orange-500/20 text-orange-400 ring-1 ring-orange-500/40",inactive:"bg-gray-800 text-orange-400/60 hover:bg-orange-500/10"},MEDIUM:{active:"bg-yellow-500/20 text-yellow-400 ring-1 ring-yellow-500/40",inactive:"bg-gray-800 text-yellow-400/60 hover:bg-yellow-500/10"},LOW:{active:"bg-blue-500/20 text-blue-400 ring-1 ring-blue-500/40",inactive:"bg-gray-800 text-blue-400/60 hover:bg-blue-500/10"}};function Vx(){const[r,o]=g.useState(""),[l,c]=g.useState(null),[d,p]=g.useState(!1),[h,x]=g.useState(null),[y,b]=g.useState("ALL"),[N,C]=g.useState(null),[P,I]=g.useState(!1),W=g.useRef(null),_=g.useCallback(async()=>{if(r.trim()){p(!0),x(null),c(null),C(null);try{const R=await fetch("/api/skill-scanner/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:r})});if(!R.ok){const te=await R.json().catch(()=>({}));x(te.error??`Scan failed (HTTP ${R.status})`);return}const Q=await R.json();c(Q)}catch{x("Failed to connect to scanner. Is the backend running?")}finally{p(!1)}}},[r]),T=g.useCallback(R=>{var me;const Q=(me=R.target.files)==null?void 0:me[0];if(!Q)return;const te=new FileReader;te.onload=Ae=>{var Ze;const Re=(Ze=Ae.target)==null?void 0:Ze.result;typeof Re=="string"&&(o(Re),c(null),x(null))},te.readAsText(Q),R.target.value=""},[]),z=g.useCallback(()=>{o(""),c(null),x(null),C(null)},[]),H=g.useCallback(async()=>{if(r.trim()){I(!0),x(null);try{const R=await fetch("/api/skill-scanner/clean",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:r})});if(!R.ok){const te=await R.json().catch(()=>({}));x(te.error??`Clean failed (HTTP ${R.status})`);return}const Q=await R.json();o(Q.cleanedContent),c(null),C(null),setTimeout(async()=>{try{const te=await fetch("/api/skill-scanner/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:Q.cleanedContent})});if(te.ok){const me=await te.json();c(me)}}catch{}},0)}catch{x("Failed to connect to scanner. Is the backend running?")}finally{I(!1)}}},[r]),$=g.useCallback(()=>{const R=new Blob([r],{type:"text/markdown"}),Q=URL.createObjectURL(R),te=document.createElement("a");te.href=Q,te.download="cleaned-skill.md",te.click(),URL.revokeObjectURL(Q)},[r]),ee=g.useMemo(()=>l?y==="ALL"?l.findings:l.findings.filter(R=>R.severity===y):[],[l,y]);return i.jsxs("div",{children:[i.jsxs("div",{className:"mb-6",children:[i.jsx("h2",{className:"text-2xl font-bold",children:"Skill Scanner"}),i.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Paste or upload a markdown skill definition for instant security analysis"})]}),i.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900 p-4 mb-6",children:[i.jsx("textarea",{value:r,onChange:R=>o(R.target.value),placeholder:"Paste skill markdown content here...",rows:12,className:"w-full bg-gray-950 border border-gray-800 rounded-lg p-3 text-sm text-gray-200 font-mono placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-primary/50 resize-y"}),i.jsxs("div",{className:"flex items-center justify-between mt-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{ref:W,type:"file",accept:".md,.txt,.markdown",onChange:T,className:"hidden"}),i.jsx("button",{onClick:()=>{var R;return(R=W.current)==null?void 0:R.click()},className:"px-3 py-1.5 text-xs font-medium rounded-lg bg-primary text-white hover:bg-primary/90 transition-colors cursor-pointer",children:"Upload .md"}),i.jsx("button",{onClick:z,disabled:!r,className:"px-3 py-1.5 text-xs font-medium rounded-lg bg-primary text-white hover:bg-primary/90 transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",children:"Clear"}),r&&i.jsxs("span",{className:"text-xs text-gray-600",children:[r.length.toLocaleString()," chars"]})]}),i.jsx("button",{onClick:_,disabled:!r.trim()||d,className:"px-4 py-2 text-sm font-medium rounded-lg bg-primary text-white hover:bg-primary/90 transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",children:d?"Scanning...":"Scan for Threats"})]})]}),h&&i.jsx("div",{className:"rounded-xl border border-red-800 bg-red-950/30 p-4 mb-6",children:i.jsx("p",{className:"text-sm text-red-400",children:h})}),l&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:`rounded-xl border p-4 mb-6 ${Co[l.overallSeverity].bg} ${Co[l.overallSeverity].border}`,children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"flex items-center gap-3",children:i.jsx("span",{className:`text-lg font-bold ${Co[l.overallSeverity].text}`,children:Co[l.overallSeverity].label})}),i.jsxs("div",{className:"flex items-center gap-3",children:[l.overallSeverity!=="NONE"&&i.jsx("button",{onClick:H,disabled:P,className:"px-4 py-2 text-sm font-semibold rounded-lg bg-primary text-white hover:bg-primary/90 transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",children:P?"Cleaning...":"Clean Skill"}),i.jsx("button",{onClick:$,className:"px-4 py-2 text-sm font-semibold rounded-lg bg-gray-700 text-white hover:bg-gray-600 transition-colors cursor-pointer",children:"Download .md"}),i.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-500 ml-1",children:[i.jsxs("span",{children:[l.contentLength.toLocaleString()," chars"]}),i.jsxs("span",{children:[l.scanDurationMs,"ms"]})]})]})]})}),i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-6",children:[i.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-3 text-center",children:[i.jsx("p",{className:"text-2xl font-bold text-red-400",children:l.summary.critical}),i.jsx("p",{className:"text-xs text-gray-500",children:"Critical"})]}),i.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-3 text-center",children:[i.jsx("p",{className:"text-2xl font-bold text-orange-400",children:l.summary.high}),i.jsx("p",{className:"text-xs text-gray-500",children:"High"})]}),i.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-3 text-center",children:[i.jsx("p",{className:"text-2xl font-bold text-yellow-400",children:l.summary.medium}),i.jsx("p",{className:"text-xs text-gray-500",children:"Medium"})]}),i.jsxs("div",{className:"rounded-lg border border-gray-800 bg-gray-900 p-3 text-center",children:[i.jsx("p",{className:"text-2xl font-bold text-blue-400",children:l.summary.low}),i.jsx("p",{className:"text-xs text-gray-500",children:"Low"})]})]}),l.findings.length>0&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[i.jsx("span",{className:"text-xs text-gray-500",children:"Filter:"}),i.jsx("div",{className:"flex gap-1",children:Hx.map(R=>{const Q=y===R,te=Wx[R];return i.jsx("button",{onClick:()=>b(R),className:`px-2.5 py-1 text-xs font-medium rounded-lg transition-colors cursor-pointer ${Q?te.active:te.inactive}`,children:R},R)})}),i.jsxs("span",{className:"text-xs text-gray-600 ml-2",children:[ee.length," finding",ee.length!==1?"s":""]})]}),i.jsx("div",{className:"space-y-3",children:ee.map((R,Q)=>i.jsx(Kx,{finding:R,index:Q,expanded:N===Q,onToggle:()=>C(te=>te===Q?null:Q)},Q))})]})]})]})}function Kx({finding:r,index:o,expanded:l,onToggle:c}){const d=$x[r.categoryId];return i.jsxs("div",{className:`rounded-xl border bg-gray-900 overflow-hidden ${Ux[r.severity]?"border-gray-700":"border-gray-800"}`,children:[i.jsxs("div",{className:"p-4 flex items-center gap-3 cursor-pointer hover:bg-gray-800/50 transition-colors",onClick:c,children:[i.jsx("span",{className:`text-gray-500 text-xs transition-transform ${l?"rotate-90":""}`,children:"▶"}),i.jsx("span",{className:"px-1.5 py-0.5 bg-gray-800 text-gray-300 rounded font-mono text-[10px]",children:r.categoryId}),i.jsx("span",{className:`text-xs font-medium px-1.5 py-0.5 rounded ${Nd[r.severity]}`,children:r.severity}),i.jsx("span",{className:"text-xs text-gray-300 flex-1 truncate",children:r.reason}),r.lineNumber!=null&&i.jsxs("span",{className:"text-xs text-gray-600 flex-shrink-0",children:["L",r.lineNumber]}),r.owaspRef&&i.jsx("span",{className:"text-[10px] text-gray-500 bg-gray-800 px-1.5 py-0.5 rounded flex-shrink-0",children:r.owaspRef})]}),l&&i.jsxs("div",{className:"border-t border-gray-800 p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-xs bg-gray-800 px-1.5 py-0.5 rounded text-gray-300",children:r.categoryId}),i.jsx("span",{className:"text-xs font-medium text-gray-300",children:(d==null?void 0:d.name)??r.categoryName}),i.jsx("span",{className:`text-xs font-medium ${Nd[r.severity]}`,children:r.severity}),r.owaspRef&&i.jsxs("span",{className:"text-[10px] text-gray-500 bg-gray-800 px-1 rounded",children:["OWASP ",r.owaspRef]})]}),i.jsx("p",{className:"text-xs text-gray-300",children:r.reason}),r.evidence&&i.jsxs("div",{className:"rounded border border-gray-700 bg-gray-800/50 p-3",children:[i.jsx("p",{className:"text-[10px] uppercase tracking-wider text-gray-500 font-medium mb-2",children:"Evidence"}),i.jsx("pre",{className:"text-xs text-gray-300 font-mono whitespace-pre-wrap break-all max-h-32 overflow-y-auto",children:r.evidence})]}),r.lineNumber!=null&&i.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[i.jsx("span",{className:"text-gray-500",children:"Line:"}),i.jsx("code",{className:"bg-gray-800 text-gray-400 px-1.5 py-0.5 rounded font-mono",children:r.lineNumber})]}),r.remediation&&i.jsxs("div",{className:"bg-gray-800/50 rounded p-2.5 border border-gray-700/50",children:[i.jsx("p",{className:"text-[10px] uppercase tracking-wider text-gray-500 font-medium mb-1",children:"Recommended Action"}),i.jsx("p",{className:"text-xs text-gray-300",children:r.remediation})]})]})]})}const qx={sandbox:{name:"Sandbox Isolation",description:"Run the agent in an isolated environment with filesystem and network boundaries",icon:"Box",actionPath:"/access#sandbox",actionLabel:"Configure in Access Control",owaspRefs:["ASI05"],guidance:"Anthropic recommends dual-boundary isolation: an inner sandbox (container) restricting OS access, and an outer boundary limiting network egress. Set sandbox mode to 'all' with read-only workspace access for maximum protection."},filesystem:{name:"Filesystem Access",description:"Control which files and directories the agent can read and write",icon:"FolderLock",actionPath:"/access",actionLabel:"Configure in Access Control",owaspRefs:["ASI03"],guidance:"Restrict filesystem access to the project workspace only. Use read-only workspace mode when the agent doesn't need to write files. Disable the filesystem tool group entirely for analysis-only sessions."},network:{name:"Network & Egress Control",description:"Prevent unauthorized data exfiltration and outbound connections",icon:"Globe",actionPath:"/access",actionLabel:"Configure in Access Control",owaspRefs:["ASI01"],guidance:"Disable network access when not required. Use Docker network isolation to prevent the agent from making arbitrary connections. Browser access adds additional attack surface — disable unless needed."},exec:{name:"Command Execution Controls",description:"Restrict which shell commands the agent can execute on the host system",icon:"Terminal",actionPath:"/interception",actionLabel:"Configure in Command Interception",owaspRefs:["ASI02","ASI05"],guidance:"Use 'deny' or 'allowlist' exec security mode. Add critical patterns (sudo, rm -rf, chmod, curl|bash) to the blocklist. The exec approval system intercepts matching commands for human review before execution."},mcp:{name:"MCP Server Security",description:"Control which MCP servers and tools the agent can access",icon:"Plug",actionPath:"/access",actionLabel:"Configure in Access Control",owaspRefs:["ASI04","ASI07"],guidance:"Review each MCP server individually — only enable servers you trust. Use tools.deny entries to block specific MCP tools. MCP tool poisoning (injecting malicious instructions via tool responses) is a known attack vector."},"egress-proxy":{name:"Egress Proxy & Domain Filtering",description:"Control outbound traffic through Sandbox Runtime (srt) domain filtering or proxy environment variables",icon:"Shield",actionPath:"/access#egress",actionLabel:"Configure in Access Control",owaspRefs:["ASI01"],guidance:"Anthropic recommends using Sandbox Runtime (srt) to enforce network domain allowlists. Enable srt in Access Control and add allowed domains — all other network access is denied by default. Alternatively, set HTTP_PROXY/HTTPS_PROXY environment variables. Launch your agent with `srt openclaw start` to enforce filtering."},gateway:{name:"Gateway & Inbound Security",description:"Secure inbound access to the agent gateway with authentication and binding controls",icon:"DoorOpen",actionPath:"/openclaw",actionLabel:"Configure in OpenClaw",owaspRefs:["ASI03","ASI07"],guidance:"The OpenClaw gateway accepts WebSocket connections and external channel triggers. Ensure device identity is configured for Ed25519 authentication, gateway is bound to localhost (not 0.0.0.0), and external channels like WhatsApp restrict which senders can trigger agent actions."},secrets:{name:"Secret & Credential Protection",description:"Detect and prevent credential exposure in agent activities",icon:"KeyRound",actionPath:"/threats",actionLabel:"Review in Threat Center",owaspRefs:["ASI03"],guidance:"The built-in secret scanner detects 15+ credential types (AWS keys, API tokens, PEM keys, database URLs). Resolve flagged threats promptly to prevent credential leakage. Never expose .env files or credential stores to the agent."},"supply-chain":{name:"Supply Chain Protection",description:"Prevent compromised packages, malicious MCP servers, and untrusted tool installations",icon:"PackageCheck",actionPath:"/interception",actionLabel:"Configure in Command Interception",owaspRefs:["ASI04"],guidance:"AI agent CLI tools are active targets for supply chain attacks. Add restricted patterns for package manager commands (npm install, pip install, curl|bash). Use 'deny' or 'allowlist' exec security mode. Review MCP servers individually — the first malicious MCP server was discovered on npm in 2025."},"input-output":{name:"Input/Output Validation",description:"Detect prompt injection, MCP tool poisoning, and adversarial content in agent inputs and outputs",icon:"ScanLine",actionPath:"/threats",actionLabel:"Review in Threat Center",owaspRefs:["ASI01","ASI06"],guidance:"The agent processes untrusted content from files, web pages, and MCP tool responses — any can contain adversarial instructions. The built-in threat classifier detects prompt injection (TC-INJ) and MCP tool poisoning (TC-MCP). Resolve flagged threats promptly. Use the Skill Scanner to audit MCP server definitions before enabling them."},monitoring:{name:"Threat Monitoring",description:"Active connection to OpenClaw for real-time activity monitoring and threat detection",icon:"Eye",actionPath:"/sessions",actionLabel:"View in Session Monitor",owaspRefs:["ASI10"],guidance:"Keep the OpenClaw connection active for real-time monitoring. Every agent invocation should be treated as high-risk. Regularly review and resolve detected threats to maintain visibility."},"human-in-loop":{name:"Human-in-the-Loop Controls",description:"Ensure critical operations require human approval before execution",icon:"UserCheck",actionPath:"/interception",actionLabel:"Configure in Command Interception",owaspRefs:["ASI09"],guidance:"The exec approval system intercepts commands matching restricted patterns. Add patterns for dangerous operations. Monitor the timeout rate — if approvals frequently time out, consider adjusting your workflow or timeout settings."}},Qx={Box:Hi,FolderLock:m0,Globe:x0,Shield:$0,Terminal:H0,Plug:E0,DoorOpen:c0,KeyRound:v0,PackageCheck:j0,ScanLine:P0,Eye:p0,UserCheck:K0},Yx={configured:"bg-emerald-500",partial:"bg-yellow-500",unconfigured:"bg-red-500",error:"bg-gray-500"},Gx={configured:"Configured",partial:"Partial",unconfigured:"Not Configured",error:"Error"},Xx={configured:"bg-emerald-500/40",partial:"bg-yellow-500/40",unconfigured:"bg-red-500/30",error:"bg-gray-500/30"};function Jx(r){return r>=80?"text-emerald-400":r>=50?"text-yellow-400":"text-red-400"}function Zx(r){return r>=80?"stroke-emerald-400":r>=50?"stroke-yellow-400":"stroke-red-400"}function ey(r){return r>=80?"bg-emerald-500/10 border-emerald-500/20":r>=50?"bg-yellow-500/10 border-yellow-500/20":"bg-red-500/10 border-red-500/20"}function ty({score:r}){const l=2*Math.PI*54,c=l-r/100*l;return i.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[i.jsxs("svg",{width:"140",height:"140",className:"-rotate-90",children:[i.jsx("circle",{cx:"70",cy:"70",r:54,fill:"none",stroke:"currentColor",strokeWidth:"8",className:"text-gray-800"}),i.jsx("circle",{cx:"70",cy:"70",r:54,fill:"none",strokeWidth:"8",strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:c,className:`${Zx(r)} transition-all duration-700`})]}),i.jsxs("div",{className:"absolute flex flex-col items-center",children:[i.jsx("span",{className:`text-3xl font-bold ${Jx(r)}`,children:r}),i.jsx("span",{className:"text-xs text-gray-500",children:"/ 100"})]})]})}function ny({check:r}){const o=r.passed?o0:r.severity==="critical"?i0:Hd,l=r.passed?"text-emerald-400":r.severity==="critical"?"text-red-400":"text-yellow-400";return i.jsxs("div",{className:"flex items-start gap-3 py-2",children:[i.jsx(o,{size:16,className:`mt-0.5 flex-shrink-0 ${l}`}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("p",{className:"text-sm text-gray-200",children:r.label}),i.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:r.detail})]})]})}function ry({layer:r,index:o,isLast:l}){const[c,d]=g.useState(!1),p=qx[r.id],h=p&&Qx[p.icon]||Hi,x=c?t0:r0;return i.jsxs("div",{className:"relative",children:[!l&&i.jsx("div",{className:`absolute left-[23px] top-full w-0.5 h-6 ${Xx[r.status]}`}),i.jsx("button",{onClick:()=>d(!c),className:"w-full text-left rounded-xl border border-gray-800 bg-gray-900 hover:border-gray-700 transition-colors",children:i.jsxs("div",{className:"flex items-center gap-4 px-5 py-4",children:[i.jsx("div",{className:"relative flex-shrink-0",children:i.jsx("div",{className:`w-3 h-3 rounded-full ${Yx[r.status]}`})}),i.jsx("div",{className:"flex-shrink-0 text-gray-400",children:i.jsx(h,{size:20})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:"text-sm font-medium text-gray-200",children:[o+1,". ",(p==null?void 0:p.name)??r.name]}),i.jsx("span",{className:"text-xs text-gray-600",children:Gx[r.status]})]}),p&&i.jsx("p",{className:"text-xs text-gray-500 mt-0.5 truncate",children:p.description})]}),i.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[i.jsxs("span",{className:"text-xs text-gray-500",children:[r.passedCount,"/",r.totalCount," checks"]}),p&&i.jsxs(ra,{to:p.actionPath,onClick:y=>y.stopPropagation(),className:"text-xs text-primary hover:text-primary/80 flex items-center gap-1",children:["Configure",i.jsx(d0,{size:10})]}),i.jsx(x,{size:16,className:"text-gray-500"})]})]})}),c&&i.jsxs("div",{className:"rounded-b-xl border border-t-0 border-gray-800 bg-gray-900/50 px-5 pb-4 -mt-3 pt-1",children:[i.jsx("div",{className:"divide-y divide-gray-800/50",children:r.checks.map(y=>i.jsx(ny,{check:y},y.id))}),p&&i.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-800/50",children:[i.jsx("p",{className:"text-xs text-gray-500 leading-relaxed",children:p.guidance}),p.owaspRefs.length>0&&i.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[i.jsx("span",{className:"text-xs text-gray-600",children:"OWASP:"}),p.owaspRefs.map(y=>i.jsx("span",{className:"text-xs bg-gray-800 text-gray-400 px-1.5 py-0.5 rounded",children:y},y))]})]})]})]})}function sy(){const[r,o]=g.useState(null),[l,c]=g.useState(!0),[d,p]=g.useState(null),h=g.useRef(null),x=g.useCallback(async()=>{try{const b=await fetch("/api/security-posture");if(!b.ok)throw new Error(`HTTP ${b.status}`);const N=await b.json();o(N),p(null)}catch(b){p(b instanceof Error?b.message:"Failed to load")}finally{c(!1)}},[]),y=g.useCallback(()=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{x()},500)},[x]);return g.useEffect(()=>(x(),B.on("safeclaw:accessControlState",y),B.on("safeclaw:openclawConfig",y),B.on("safeclaw:openclawMonitorStatus",y),B.on("safeclaw:threatResolved",y),()=>{B.off("safeclaw:accessControlState",y),B.off("safeclaw:openclawConfig",y),B.off("safeclaw:openclawMonitorStatus",y),B.off("safeclaw:threatResolved",y),h.current&&clearTimeout(h.current)}),[x,y]),l?i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Security Workflow"}),i.jsx("p",{className:"text-gray-500",children:"Analyzing security posture..."})]}):d||!r?i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Security Workflow"}),i.jsxs("p",{className:"text-red-400",children:["Failed to load security posture",d?`: ${d}`:""]})]}):i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-6",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold",children:"Security Workflow"}),i.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"12-layer security pipeline — checks run against your live configuration"})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("span",{className:"text-xs text-gray-600",children:["Last scan: ",new Date(r.checkedAt).toLocaleTimeString()]}),i.jsxs("button",{onClick:()=>{c(!0),x()},className:"flex items-center gap-1.5 text-xs text-gray-400 hover:text-gray-200 bg-gray-800 hover:bg-gray-700 rounded-lg px-3 py-1.5 transition-colors",children:[i.jsx(R0,{size:12}),"Re-scan"]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4 mb-8",children:[i.jsxs("div",{className:`rounded-xl border p-6 flex flex-col items-center justify-center ${ey(r.overallScore)}`,children:[i.jsx(ty,{score:r.overallScore}),i.jsx("p",{className:"text-sm text-gray-400 mt-2",children:"Security Score"})]}),i.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900 p-6 flex flex-col justify-center",children:[i.jsx("p",{className:"text-sm text-gray-400",children:"Configured"}),i.jsx("p",{className:"text-3xl font-bold mt-1 text-emerald-400",children:r.configuredLayers}),i.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["of ",r.totalLayers," layers"]})]}),i.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900 p-6 flex flex-col justify-center",children:[i.jsx("p",{className:"text-sm text-gray-400",children:"Partial"}),i.jsx("p",{className:"text-3xl font-bold mt-1 text-yellow-400",children:r.partialLayers}),i.jsx("p",{className:"text-xs text-gray-600 mt-1",children:"need attention"})]}),i.jsxs("div",{className:"rounded-xl border border-gray-800 bg-gray-900 p-6 flex flex-col justify-center",children:[i.jsx("p",{className:"text-sm text-gray-400",children:"Not Configured"}),i.jsx("p",{className:"text-3xl font-bold mt-1 text-red-400",children:r.unconfiguredLayers}),i.jsx("p",{className:"text-xs text-gray-600 mt-1",children:"require setup"})]})]}),i.jsxs("div",{className:"space-y-6",children:[i.jsx("h3",{className:"text-sm font-medium text-gray-400",children:"Security Pipeline"}),i.jsx("div",{className:"space-y-6",children:r.layers.map((b,N)=>i.jsx(ry,{layer:b,index:N,isLast:N===r.layers.length-1},b.id))})]})]})}function oy(){return i.jsx(Im,{children:i.jsx(dm,{children:i.jsxs(Pt,{element:i.jsx(Hg,{}),children:[i.jsx(Pt,{index:!0,element:i.jsx(Vg,{})}),i.jsx(Pt,{path:"security",element:i.jsx(sy,{})}),i.jsx(Pt,{path:"interception",element:i.jsx(Yg,{})}),i.jsx(Pt,{path:"sessions",element:i.jsx(jx,{})}),i.jsx(Pt,{path:"threats",element:i.jsx(Ix,{})}),i.jsx(Pt,{path:"skill-scanner",element:i.jsx(Vx,{})}),i.jsx(Pt,{path:"access",element:i.jsx(Fx,{})}),i.jsx(Pt,{path:"openclaw",element:i.jsx(Bx,{})}),i.jsx(Pt,{path:"settings",element:i.jsx(zx,{})})]})})})}uh.createRoot(document.getElementById("root")).render(i.jsx(rh.StrictMode,{children:i.jsx(oy,{})}));