@opentrust/dashboard 7.3.18 → 7.3.21

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,378 @@
1
+ function Kw(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function Wc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dp={exports:{}},Yl={},fp={exports:{}},se={};/**
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 Vo=Symbol.for("react.element"),Xw=Symbol.for("react.portal"),Qw=Symbol.for("react.fragment"),qw=Symbol.for("react.strict_mode"),Zw=Symbol.for("react.profiler"),Jw=Symbol.for("react.provider"),e1=Symbol.for("react.context"),t1=Symbol.for("react.forward_ref"),n1=Symbol.for("react.suspense"),r1=Symbol.for("react.memo"),s1=Symbol.for("react.lazy"),Tf=Symbol.iterator;function o1(e){return e===null||typeof e!="object"?null:(e=Tf&&e[Tf]||e["@@iterator"],typeof e=="function"?e:null)}var hp={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},mp=Object.assign,pp={};function ws(e,t,n){this.props=e,this.context=t,this.refs=pp,this.updater=n||hp}ws.prototype.isReactComponent={};ws.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};ws.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function gp(){}gp.prototype=ws.prototype;function Yc(e,t,n){this.props=e,this.context=t,this.refs=pp,this.updater=n||hp}var Gc=Yc.prototype=new gp;Gc.constructor=Yc;mp(Gc,ws.prototype);Gc.isPureReactComponent=!0;var Lf=Array.isArray,xp=Object.prototype.hasOwnProperty,Kc={current:null},yp={key:!0,ref:!0,__self:!0,__source:!0};function vp(e,t,n){var r,s={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)xp.call(t,r)&&!yp.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];s.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)s[r]===void 0&&(s[r]=l[r]);return{$$typeof:Vo,type:e,key:o,ref:i,props:s,_owner:Kc.current}}function i1(e,t){return{$$typeof:Vo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Xc(e){return typeof e=="object"&&e!==null&&e.$$typeof===Vo}function l1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Af=/\/+/g;function La(e,t){return typeof e=="object"&&e!==null&&e.key!=null?l1(""+e.key):t.toString(36)}function $i(e,t,n,r,s){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(o){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case Vo:case Xw:i=!0}}if(i)return i=e,s=s(i),e=r===""?"."+La(i,0):r,Lf(s)?(n="",e!=null&&(n=e.replace(Af,"$&/")+"/"),$i(s,t,n,"",function(c){return c})):s!=null&&(Xc(s)&&(s=i1(s,n+(!s.key||i&&i.key===s.key?"":(""+s.key).replace(Af,"$&/")+"/")+e)),t.push(s)),1;if(i=0,r=r===""?".":r+":",Lf(e))for(var l=0;l<e.length;l++){o=e[l];var u=r+La(o,l);i+=$i(o,t,n,u,s)}else if(u=o1(e),typeof u=="function")for(e=u.call(e),l=0;!(o=e.next()).done;)o=o.value,u=r+La(o,l++),i+=$i(o,t,n,u,s);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function si(e,t,n){if(e==null)return e;var r=[],s=0;return $i(e,r,"","",function(o){return t.call(n,o,s++)}),r}function a1(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Qe={current:null},Oi={transition:null},u1={ReactCurrentDispatcher:Qe,ReactCurrentBatchConfig:Oi,ReactCurrentOwner:Kc};se.Children={map:si,forEach:function(e,t,n){si(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return si(e,function(){t++}),t},toArray:function(e){return si(e,function(t){return t})||[]},only:function(e){if(!Xc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};se.Component=ws;se.Fragment=Qw;se.Profiler=Zw;se.PureComponent=Yc;se.StrictMode=qw;se.Suspense=n1;se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=u1;se.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=mp({},e.props),s=e.key,o=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,i=Kc.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)xp.call(t,u)&&!yp.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){l=Array(u);for(var c=0;c<u;c++)l[c]=arguments[c+2];r.children=l}return{$$typeof:Vo,type:e.type,key:s,ref:o,props:r,_owner:i}};se.createContext=function(e){return e={$$typeof:e1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Jw,_context:e},e.Consumer=e};se.createElement=vp;se.createFactory=function(e){var t=vp.bind(null,e);return t.type=e,t};se.createRef=function(){return{current:null}};se.forwardRef=function(e){return{$$typeof:t1,render:e}};se.isValidElement=Xc;se.lazy=function(e){return{$$typeof:s1,_payload:{_status:-1,_result:e},_init:a1}};se.memo=function(e,t){return{$$typeof:r1,type:e,compare:t===void 0?null:t}};se.startTransition=function(e){var t=Oi.transition;Oi.transition={};try{e()}finally{Oi.transition=t}};se.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};se.useCallback=function(e,t){return Qe.current.useCallback(e,t)};se.useContext=function(e){return Qe.current.useContext(e)};se.useDebugValue=function(){};se.useDeferredValue=function(e){return Qe.current.useDeferredValue(e)};se.useEffect=function(e,t){return Qe.current.useEffect(e,t)};se.useId=function(){return Qe.current.useId()};se.useImperativeHandle=function(e,t,n){return Qe.current.useImperativeHandle(e,t,n)};se.useInsertionEffect=function(e,t){return Qe.current.useInsertionEffect(e,t)};se.useLayoutEffect=function(e,t){return Qe.current.useLayoutEffect(e,t)};se.useMemo=function(e,t){return Qe.current.useMemo(e,t)};se.useReducer=function(e,t,n){return Qe.current.useReducer(e,t,n)};se.useRef=function(e){return Qe.current.useRef(e)};se.useState=function(e){return Qe.current.useState(e)};se.useSyncExternalStore=function(e,t,n){return Qe.current.useSyncExternalStore(e,t,n)};se.useTransition=function(){return Qe.current.useTransition()};se.version="18.3.0";fp.exports=se;var p=fp.exports;const Ut=Wc(p),c1=Kw({__proto__:null,default:Ut},[p]);/**
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 d1=p,f1=Symbol.for("react.element"),h1=Symbol.for("react.fragment"),m1=Object.prototype.hasOwnProperty,p1=d1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,g1={key:!0,ref:!0,__self:!0,__source:!0};function wp(e,t,n){var r,s={},o=null,i=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)m1.call(t,r)&&!g1.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:f1,type:e,key:o,ref:i,props:s,_owner:p1.current}}Yl.Fragment=h1;Yl.jsx=wp;Yl.jsxs=wp;dp.exports=Yl;var a=dp.exports,Eu={},Np={exports:{}},ft={},Sp={exports:{}},bp={};/**
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
+ */(function(e){function t(C,P){var L=C.length;C.push(P);e:for(;0<L;){var O=L-1>>>1,$=C[O];if(0<s($,P))C[O]=P,C[L]=$,L=O;else break e}}function n(C){return C.length===0?null:C[0]}function r(C){if(C.length===0)return null;var P=C[0],L=C.pop();if(L!==P){C[0]=L;e:for(var O=0,$=C.length,U=$>>>1;O<U;){var B=2*(O+1)-1,Y=C[B],G=B+1,K=C[G];if(0>s(Y,L))G<$&&0>s(K,Y)?(C[O]=K,C[G]=L,O=G):(C[O]=Y,C[B]=L,O=B);else if(G<$&&0>s(K,L))C[O]=K,C[G]=L,O=G;else break e}}return P}function s(C,P){var L=C.sortIndex-P.sortIndex;return L!==0?L:C.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var u=[],c=[],h=1,d=null,f=3,x=!1,y=!1,w=!1,S=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(C){for(var P=n(c);P!==null;){if(P.callback===null)r(c);else if(P.startTime<=C)r(c),P.sortIndex=P.expirationTime,t(u,P);else break;P=n(c)}}function N(C){if(w=!1,g(C),!y)if(n(u)!==null)y=!0,M(b);else{var P=n(c);P!==null&&z(N,P.startTime-C)}}function b(C,P){y=!1,w&&(w=!1,m(_),_=-1),x=!0;var L=f;try{for(g(P),d=n(u);d!==null&&(!(d.expirationTime>P)||C&&!T());){var O=d.callback;if(typeof O=="function"){d.callback=null,f=d.priorityLevel;var $=O(d.expirationTime<=P);P=e.unstable_now(),typeof $=="function"?d.callback=$:d===n(u)&&r(u),g(P)}else r(u);d=n(u)}if(d!==null)var U=!0;else{var B=n(c);B!==null&&z(N,B.startTime-P),U=!1}return U}finally{d=null,f=L,x=!1}}var k=!1,j=null,_=-1,I=5,D=-1;function T(){return!(e.unstable_now()-D<I)}function R(){if(j!==null){var C=e.unstable_now();D=C;var P=!0;try{P=j(!0,C)}finally{P?F():(k=!1,j=null)}}else k=!1}var F;if(typeof v=="function")F=function(){v(R)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,A=E.port2;E.port1.onmessage=R,F=function(){A.postMessage(null)}}else F=function(){S(R,0)};function M(C){j=C,k||(k=!0,F())}function z(C,P){_=S(function(){C(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(C){C.callback=null},e.unstable_continueExecution=function(){y||x||(y=!0,M(b))},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(C){switch(f){case 1:case 2:case 3:var P=3;break;default:P=f}var L=f;f=P;try{return C()}finally{f=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(C,P){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var L=f;f=C;try{return P()}finally{f=L}},e.unstable_scheduleCallback=function(C,P,L){var O=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?O+L:O):L=O,C){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=L+$,C={id:h++,callback:P,priorityLevel:C,startTime:L,expirationTime:$,sortIndex:-1},L>O?(C.sortIndex=L,t(c,C),n(u)===null&&C===n(c)&&(w?(m(_),_=-1):w=!0,z(N,L-O))):(C.sortIndex=$,t(u,C),y||x||(y=!0,M(b))),C},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(C){var P=f;return function(){var L=f;f=P;try{return C.apply(this,arguments)}finally{f=L}}}})(bp);Sp.exports=bp;var x1=Sp.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 y1=p,ct=x1;function H(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 kp=new Set,mo={};function br(e,t){rs(e,t),rs(e+"Capture",t)}function rs(e,t){for(mo[e]=t,e=0;e<t.length;e++)kp.add(t[e])}var hn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_u=Object.prototype.hasOwnProperty,v1=/^[: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]*$/,zf={},Df={};function w1(e){return _u.call(Df,e)?!0:_u.call(zf,e)?!1:v1.test(e)?Df[e]=!0:(zf[e]=!0,!1)}function N1(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function S1(e,t,n,r){if(t===null||typeof t>"u"||N1(e,t,n,r))return!0;if(r)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 qe(e,t,n,r,s,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var He={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){He[e]=new qe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];He[t]=new qe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){He[e]=new qe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){He[e]=new qe(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){He[e]=new qe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){He[e]=new qe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){He[e]=new qe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){He[e]=new qe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){He[e]=new qe(e,5,!1,e.toLowerCase(),null,!1,!1)});var Qc=/[\-:]([a-z])/g;function qc(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(Qc,qc);He[t]=new qe(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(Qc,qc);He[t]=new qe(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(Qc,qc);He[t]=new qe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){He[e]=new qe(e,1,!1,e.toLowerCase(),null,!1,!1)});He.xlinkHref=new qe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){He[e]=new qe(e,1,!1,e.toLowerCase(),null,!0,!0)});function Zc(e,t,n,r){var s=He.hasOwnProperty(t)?He[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(S1(t,n,s,r)&&(n=null),r||s===null?w1(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var yn=y1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,oi=Symbol.for("react.element"),Lr=Symbol.for("react.portal"),Ar=Symbol.for("react.fragment"),Jc=Symbol.for("react.strict_mode"),Pu=Symbol.for("react.profiler"),jp=Symbol.for("react.provider"),Cp=Symbol.for("react.context"),ed=Symbol.for("react.forward_ref"),Mu=Symbol.for("react.suspense"),Iu=Symbol.for("react.suspense_list"),td=Symbol.for("react.memo"),En=Symbol.for("react.lazy"),Ep=Symbol.for("react.offscreen"),$f=Symbol.iterator;function As(e){return e===null||typeof e!="object"?null:(e=$f&&e[$f]||e["@@iterator"],typeof e=="function"?e:null)}var ke=Object.assign,Aa;function Xs(e){if(Aa===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Aa=t&&t[1]||""}return`
34
+ `+Aa+e}var za=!1;function Da(e,t){if(!e||za)return"";za=!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(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var s=c.stack.split(`
35
+ `),o=r.stack.split(`
36
+ `),i=s.length-1,l=o.length-1;1<=i&&0<=l&&s[i]!==o[l];)l--;for(;1<=i&&0<=l;i--,l--)if(s[i]!==o[l]){if(i!==1||l!==1)do if(i--,l--,0>l||s[i]!==o[l]){var u=`
37
+ `+s[i].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=i&&0<=l);break}}}finally{za=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Xs(e):""}function b1(e){switch(e.tag){case 5:return Xs(e.type);case 16:return Xs("Lazy");case 13:return Xs("Suspense");case 19:return Xs("SuspenseList");case 0:case 2:case 15:return e=Da(e.type,!1),e;case 11:return e=Da(e.type.render,!1),e;case 1:return e=Da(e.type,!0),e;default:return""}}function Ru(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 Ar:return"Fragment";case Lr:return"Portal";case Pu:return"Profiler";case Jc:return"StrictMode";case Mu:return"Suspense";case Iu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Cp:return(e.displayName||"Context")+".Consumer";case jp:return(e._context.displayName||"Context")+".Provider";case ed:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case td:return t=e.displayName||null,t!==null?t:Ru(e.type)||"Memo";case En:t=e._payload,e=e._init;try{return Ru(e(t))}catch{}}return null}function k1(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 Ru(t);case 8:return t===Jc?"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 Bn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _p(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function j1(e){var t=_p(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ii(e){e._valueTracker||(e._valueTracker=j1(e))}function Pp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=_p(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function il(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 Tu(e,t){var n=t.checked;return ke({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Of(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Bn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Mp(e,t){t=t.checked,t!=null&&Zc(e,"checked",t,!1)}function Lu(e,t){Mp(e,t);var n=Bn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Au(e,t.type,n):t.hasOwnProperty("defaultValue")&&Au(e,t.type,Bn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ff(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="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 Au(e,t,n){(t!=="number"||il(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Qs=Array.isArray;function Kr(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Bn(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function zu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return ke({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Hf(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(H(92));if(Qs(n)){if(1<n.length)throw Error(H(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Bn(n)}}function Ip(e,t){var n=Bn(t.value),r=Bn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Vf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Rp(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 Du(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Rp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var li,Tp=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(li=li||document.createElement("div"),li.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=li.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function po(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var to={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},C1=["Webkit","ms","Moz","O"];Object.keys(to).forEach(function(e){C1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),to[t]=to[e]})});function Lp(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||to.hasOwnProperty(e)&&to[e]?(""+t).trim():t+"px"}function Ap(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=Lp(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var E1=ke({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 $u(e,t){if(t){if(E1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function Ou(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 Fu=null;function nd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Hu=null,Xr=null,Qr=null;function Bf(e){if(e=Wo(e)){if(typeof Hu!="function")throw Error(H(280));var t=e.stateNode;t&&(t=ql(t),Hu(e.stateNode,e.type,t))}}function zp(e){Xr?Qr?Qr.push(e):Qr=[e]:Xr=e}function Dp(){if(Xr){var e=Xr,t=Qr;if(Qr=Xr=null,Bf(e),t)for(e=0;e<t.length;e++)Bf(t[e])}}function $p(e,t){return e(t)}function Op(){}var $a=!1;function Fp(e,t,n){if($a)return e(t,n);$a=!0;try{return $p(e,t,n)}finally{$a=!1,(Xr!==null||Qr!==null)&&(Op(),Dp())}}function go(e,t){var n=e.stateNode;if(n===null)return null;var r=ql(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(H(231,t,typeof n));return n}var Vu=!1;if(hn)try{var zs={};Object.defineProperty(zs,"passive",{get:function(){Vu=!0}}),window.addEventListener("test",zs,zs),window.removeEventListener("test",zs,zs)}catch{Vu=!1}function _1(e,t,n,r,s,o,i,l,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(h){this.onError(h)}}var no=!1,ll=null,al=!1,Bu=null,P1={onError:function(e){no=!0,ll=e}};function M1(e,t,n,r,s,o,i,l,u){no=!1,ll=null,_1.apply(P1,arguments)}function I1(e,t,n,r,s,o,i,l,u){if(M1.apply(this,arguments),no){if(no){var c=ll;no=!1,ll=null}else throw Error(H(198));al||(al=!0,Bu=c)}}function kr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Hp(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 Uf(e){if(kr(e)!==e)throw Error(H(188))}function R1(e){var t=e.alternate;if(!t){if(t=kr(e),t===null)throw Error(H(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var o=s.alternate;if(o===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===n)return Uf(s),e;if(o===r)return Uf(s),t;o=o.sibling}throw Error(H(188))}if(n.return!==r.return)n=s,r=o;else{for(var i=!1,l=s.child;l;){if(l===n){i=!0,n=s,r=o;break}if(l===r){i=!0,r=s,n=o;break}l=l.sibling}if(!i){for(l=o.child;l;){if(l===n){i=!0,n=o,r=s;break}if(l===r){i=!0,r=o,n=s;break}l=l.sibling}if(!i)throw Error(H(189))}}if(n.alternate!==r)throw Error(H(190))}if(n.tag!==3)throw Error(H(188));return n.stateNode.current===n?e:t}function Vp(e){return e=R1(e),e!==null?Bp(e):null}function Bp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Bp(e);if(t!==null)return t;e=e.sibling}return null}var Up=ct.unstable_scheduleCallback,Wf=ct.unstable_cancelCallback,T1=ct.unstable_shouldYield,L1=ct.unstable_requestPaint,Ce=ct.unstable_now,A1=ct.unstable_getCurrentPriorityLevel,rd=ct.unstable_ImmediatePriority,Wp=ct.unstable_UserBlockingPriority,ul=ct.unstable_NormalPriority,z1=ct.unstable_LowPriority,Yp=ct.unstable_IdlePriority,Gl=null,Kt=null;function D1(e){if(Kt&&typeof Kt.onCommitFiberRoot=="function")try{Kt.onCommitFiberRoot(Gl,e,void 0,(e.current.flags&128)===128)}catch{}}var Tt=Math.clz32?Math.clz32:F1,$1=Math.log,O1=Math.LN2;function F1(e){return e>>>=0,e===0?32:31-($1(e)/O1|0)|0}var ai=64,ui=4194304;function qs(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 cl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var l=i&~s;l!==0?r=qs(l):(o&=i,o!==0&&(r=qs(o)))}else i=n&~s,i!==0?r=qs(i):o!==0&&(r=qs(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Tt(t),s=1<<n,r|=e[n],t&=~s;return r}function H1(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 V1(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-Tt(o),l=1<<i,u=s[i];u===-1?(!(l&n)||l&r)&&(s[i]=H1(l,t)):u<=t&&(e.expiredLanes|=l),o&=~l}}function Uu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Gp(){var e=ai;return ai<<=1,!(ai&4194240)&&(ai=64),e}function Oa(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Bo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Tt(t),e[t]=n}function B1(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 r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-Tt(n),o=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~o}}function sd(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Tt(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var ce=0;function Kp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Xp,od,Qp,qp,Zp,Wu=!1,ci=[],Ln=null,An=null,zn=null,xo=new Map,yo=new Map,Pn=[],U1="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 Yf(e,t){switch(e){case"focusin":case"focusout":Ln=null;break;case"dragenter":case"dragleave":An=null;break;case"mouseover":case"mouseout":zn=null;break;case"pointerover":case"pointerout":xo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":yo.delete(t.pointerId)}}function Ds(e,t,n,r,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[s]},t!==null&&(t=Wo(t),t!==null&&od(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function W1(e,t,n,r,s){switch(t){case"focusin":return Ln=Ds(Ln,e,t,n,r,s),!0;case"dragenter":return An=Ds(An,e,t,n,r,s),!0;case"mouseover":return zn=Ds(zn,e,t,n,r,s),!0;case"pointerover":var o=s.pointerId;return xo.set(o,Ds(xo.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,yo.set(o,Ds(yo.get(o)||null,e,t,n,r,s)),!0}return!1}function Jp(e){var t=nr(e.target);if(t!==null){var n=kr(t);if(n!==null){if(t=n.tag,t===13){if(t=Hp(n),t!==null){e.blockedOn=t,Zp(e.priority,function(){Qp(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 Fi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Yu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Fu=r,n.target.dispatchEvent(r),Fu=null}else return t=Wo(n),t!==null&&od(t),e.blockedOn=n,!1;t.shift()}return!0}function Gf(e,t,n){Fi(e)&&n.delete(t)}function Y1(){Wu=!1,Ln!==null&&Fi(Ln)&&(Ln=null),An!==null&&Fi(An)&&(An=null),zn!==null&&Fi(zn)&&(zn=null),xo.forEach(Gf),yo.forEach(Gf)}function $s(e,t){e.blockedOn===t&&(e.blockedOn=null,Wu||(Wu=!0,ct.unstable_scheduleCallback(ct.unstable_NormalPriority,Y1)))}function vo(e){function t(s){return $s(s,e)}if(0<ci.length){$s(ci[0],e);for(var n=1;n<ci.length;n++){var r=ci[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Ln!==null&&$s(Ln,e),An!==null&&$s(An,e),zn!==null&&$s(zn,e),xo.forEach(t),yo.forEach(t),n=0;n<Pn.length;n++)r=Pn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Pn.length&&(n=Pn[0],n.blockedOn===null);)Jp(n),n.blockedOn===null&&Pn.shift()}var qr=yn.ReactCurrentBatchConfig,dl=!0;function G1(e,t,n,r){var s=ce,o=qr.transition;qr.transition=null;try{ce=1,id(e,t,n,r)}finally{ce=s,qr.transition=o}}function K1(e,t,n,r){var s=ce,o=qr.transition;qr.transition=null;try{ce=4,id(e,t,n,r)}finally{ce=s,qr.transition=o}}function id(e,t,n,r){if(dl){var s=Yu(e,t,n,r);if(s===null)Xa(e,t,r,fl,n),Yf(e,r);else if(W1(s,e,t,n,r))r.stopPropagation();else if(Yf(e,r),t&4&&-1<U1.indexOf(e)){for(;s!==null;){var o=Wo(s);if(o!==null&&Xp(o),o=Yu(e,t,n,r),o===null&&Xa(e,t,r,fl,n),o===s)break;s=o}s!==null&&r.stopPropagation()}else Xa(e,t,r,null,n)}}var fl=null;function Yu(e,t,n,r){if(fl=null,e=nd(r),e=nr(e),e!==null)if(t=kr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Hp(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 fl=e,null}function eg(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(A1()){case rd:return 1;case Wp:return 4;case ul:case z1:return 16;case Yp:return 536870912;default:return 16}default:return 16}}var Rn=null,ld=null,Hi=null;function tg(){if(Hi)return Hi;var e,t=ld,n=t.length,r,s="value"in Rn?Rn.value:Rn.textContent,o=s.length;for(e=0;e<n&&t[e]===s[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===s[o-r];r++);return Hi=s.slice(e,1<r?1-r:void 0)}function Vi(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 di(){return!0}function Kf(){return!1}function ht(e){function t(n,r,s,o,i){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?di:Kf,this.isPropagationStopped=Kf,this}return ke(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=di)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=di)},persist:function(){},isPersistent:di}),t}var Ns={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ad=ht(Ns),Uo=ke({},Ns,{view:0,detail:0}),X1=ht(Uo),Fa,Ha,Os,Kl=ke({},Uo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ud,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!==Os&&(Os&&e.type==="mousemove"?(Fa=e.screenX-Os.screenX,Ha=e.screenY-Os.screenY):Ha=Fa=0,Os=e),Fa)},movementY:function(e){return"movementY"in e?e.movementY:Ha}}),Xf=ht(Kl),Q1=ke({},Kl,{dataTransfer:0}),q1=ht(Q1),Z1=ke({},Uo,{relatedTarget:0}),Va=ht(Z1),J1=ke({},Ns,{animationName:0,elapsedTime:0,pseudoElement:0}),eN=ht(J1),tN=ke({},Ns,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),nN=ht(tN),rN=ke({},Ns,{data:0}),Qf=ht(rN),sN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oN={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"},iN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lN(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=iN[e])?!!t[e]:!1}function ud(){return lN}var aN=ke({},Uo,{key:function(e){if(e.key){var t=sN[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Vi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?oN[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ud,charCode:function(e){return e.type==="keypress"?Vi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Vi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),uN=ht(aN),cN=ke({},Kl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qf=ht(cN),dN=ke({},Uo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ud}),fN=ht(dN),hN=ke({},Ns,{propertyName:0,elapsedTime:0,pseudoElement:0}),mN=ht(hN),pN=ke({},Kl,{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}),gN=ht(pN),xN=[9,13,27,32],cd=hn&&"CompositionEvent"in window,ro=null;hn&&"documentMode"in document&&(ro=document.documentMode);var yN=hn&&"TextEvent"in window&&!ro,ng=hn&&(!cd||ro&&8<ro&&11>=ro),Zf=" ",Jf=!1;function rg(e,t){switch(e){case"keyup":return xN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zr=!1;function vN(e,t){switch(e){case"compositionend":return sg(t);case"keypress":return t.which!==32?null:(Jf=!0,Zf);case"textInput":return e=t.data,e===Zf&&Jf?null:e;default:return null}}function wN(e,t){if(zr)return e==="compositionend"||!cd&&rg(e,t)?(e=tg(),Hi=ld=Rn=null,zr=!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 ng&&t.locale!=="ko"?null:t.data;default:return null}}var NN={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 eh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!NN[e.type]:t==="textarea"}function og(e,t,n,r){zp(r),t=hl(t,"onChange"),0<t.length&&(n=new ad("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var so=null,wo=null;function SN(e){gg(e,0)}function Xl(e){var t=Or(e);if(Pp(t))return e}function bN(e,t){if(e==="change")return t}var ig=!1;if(hn){var Ba;if(hn){var Ua="oninput"in document;if(!Ua){var th=document.createElement("div");th.setAttribute("oninput","return;"),Ua=typeof th.oninput=="function"}Ba=Ua}else Ba=!1;ig=Ba&&(!document.documentMode||9<document.documentMode)}function nh(){so&&(so.detachEvent("onpropertychange",lg),wo=so=null)}function lg(e){if(e.propertyName==="value"&&Xl(wo)){var t=[];og(t,wo,e,nd(e)),Fp(SN,t)}}function kN(e,t,n){e==="focusin"?(nh(),so=t,wo=n,so.attachEvent("onpropertychange",lg)):e==="focusout"&&nh()}function jN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xl(wo)}function CN(e,t){if(e==="click")return Xl(t)}function EN(e,t){if(e==="input"||e==="change")return Xl(t)}function _N(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var At=typeof Object.is=="function"?Object.is:_N;function No(e,t){if(At(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!_u.call(t,s)||!At(e[s],t[s]))return!1}return!0}function rh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function sh(e,t){var n=rh(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=rh(n)}}function ag(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ag(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ug(){for(var e=window,t=il();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=il(e.document)}return t}function dd(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 PN(e){var t=ug(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ag(n.ownerDocument.documentElement,n)){if(r!==null&&dd(n)){if(t=r.start,e=r.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 s=n.textContent.length,o=Math.min(r.start,s);r=r.end===void 0?o:Math.min(r.end,s),!e.extend&&o>r&&(s=r,r=o,o=s),s=sh(n,o);var i=sh(n,r);s&&i&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.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 MN=hn&&"documentMode"in document&&11>=document.documentMode,Dr=null,Gu=null,oo=null,Ku=!1;function oh(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ku||Dr==null||Dr!==il(r)||(r=Dr,"selectionStart"in r&&dd(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),oo&&No(oo,r)||(oo=r,r=hl(Gu,"onSelect"),0<r.length&&(t=new ad("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Dr)))}function fi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var $r={animationend:fi("Animation","AnimationEnd"),animationiteration:fi("Animation","AnimationIteration"),animationstart:fi("Animation","AnimationStart"),transitionend:fi("Transition","TransitionEnd")},Wa={},cg={};hn&&(cg=document.createElement("div").style,"AnimationEvent"in window||(delete $r.animationend.animation,delete $r.animationiteration.animation,delete $r.animationstart.animation),"TransitionEvent"in window||delete $r.transitionend.transition);function Ql(e){if(Wa[e])return Wa[e];if(!$r[e])return e;var t=$r[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in cg)return Wa[e]=t[n];return e}var dg=Ql("animationend"),fg=Ql("animationiteration"),hg=Ql("animationstart"),mg=Ql("transitionend"),pg=new Map,ih="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 Xn(e,t){pg.set(e,t),br(t,[e])}for(var Ya=0;Ya<ih.length;Ya++){var Ga=ih[Ya],IN=Ga.toLowerCase(),RN=Ga[0].toUpperCase()+Ga.slice(1);Xn(IN,"on"+RN)}Xn(dg,"onAnimationEnd");Xn(fg,"onAnimationIteration");Xn(hg,"onAnimationStart");Xn("dblclick","onDoubleClick");Xn("focusin","onFocus");Xn("focusout","onBlur");Xn(mg,"onTransitionEnd");rs("onMouseEnter",["mouseout","mouseover"]);rs("onMouseLeave",["mouseout","mouseover"]);rs("onPointerEnter",["pointerout","pointerover"]);rs("onPointerLeave",["pointerout","pointerover"]);br("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));br("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));br("onBeforeInput",["compositionend","keypress","textInput","paste"]);br("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));br("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));br("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zs="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(" "),TN=new Set("cancel close invalid load scroll toggle".split(" ").concat(Zs));function lh(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,I1(r,t,void 0,e),e.currentTarget=null}function gg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var i=r.length-1;0<=i;i--){var l=r[i],u=l.instance,c=l.currentTarget;if(l=l.listener,u!==o&&s.isPropagationStopped())break e;lh(s,l,c),o=u}else for(i=0;i<r.length;i++){if(l=r[i],u=l.instance,c=l.currentTarget,l=l.listener,u!==o&&s.isPropagationStopped())break e;lh(s,l,c),o=u}}}if(al)throw e=Bu,al=!1,Bu=null,e}function pe(e,t){var n=t[Ju];n===void 0&&(n=t[Ju]=new Set);var r=e+"__bubble";n.has(r)||(xg(t,e,2,!1),n.add(r))}function Ka(e,t,n){var r=0;t&&(r|=4),xg(n,e,r,t)}var hi="_reactListening"+Math.random().toString(36).slice(2);function So(e){if(!e[hi]){e[hi]=!0,kp.forEach(function(n){n!=="selectionchange"&&(TN.has(n)||Ka(n,!1,e),Ka(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[hi]||(t[hi]=!0,Ka("selectionchange",!1,t))}}function xg(e,t,n,r){switch(eg(t)){case 1:var s=G1;break;case 4:s=K1;break;default:s=id}n=s.bind(null,t,n,e),s=void 0,!Vu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Xa(e,t,n,r,s){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var l=r.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(i===4)for(i=r.return;i!==null;){var u=i.tag;if((u===3||u===4)&&(u=i.stateNode.containerInfo,u===s||u.nodeType===8&&u.parentNode===s))return;i=i.return}for(;l!==null;){if(i=nr(l),i===null)return;if(u=i.tag,u===5||u===6){r=o=i;continue e}l=l.parentNode}}r=r.return}Fp(function(){var c=o,h=nd(n),d=[];e:{var f=pg.get(e);if(f!==void 0){var x=ad,y=e;switch(e){case"keypress":if(Vi(n)===0)break e;case"keydown":case"keyup":x=uN;break;case"focusin":y="focus",x=Va;break;case"focusout":y="blur",x=Va;break;case"beforeblur":case"afterblur":x=Va;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":x=Xf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=q1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=fN;break;case dg:case fg:case hg:x=eN;break;case mg:x=mN;break;case"scroll":x=X1;break;case"wheel":x=gN;break;case"copy":case"cut":case"paste":x=nN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=qf}var w=(t&4)!==0,S=!w&&e==="scroll",m=w?f!==null?f+"Capture":null:f;w=[];for(var v=c,g;v!==null;){g=v;var N=g.stateNode;if(g.tag===5&&N!==null&&(g=N,m!==null&&(N=go(v,m),N!=null&&w.push(bo(v,N,g)))),S)break;v=v.return}0<w.length&&(f=new x(f,y,null,n,h),d.push({event:f,listeners:w}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",f&&n!==Fu&&(y=n.relatedTarget||n.fromElement)&&(nr(y)||y[mn]))break e;if((x||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,x?(y=n.relatedTarget||n.toElement,x=c,y=y?nr(y):null,y!==null&&(S=kr(y),y!==S||y.tag!==5&&y.tag!==6)&&(y=null)):(x=null,y=c),x!==y)){if(w=Xf,N="onMouseLeave",m="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(w=qf,N="onPointerLeave",m="onPointerEnter",v="pointer"),S=x==null?f:Or(x),g=y==null?f:Or(y),f=new w(N,v+"leave",x,n,h),f.target=S,f.relatedTarget=g,N=null,nr(h)===c&&(w=new w(m,v+"enter",y,n,h),w.target=g,w.relatedTarget=S,N=w),S=N,x&&y)t:{for(w=x,m=y,v=0,g=w;g;g=Pr(g))v++;for(g=0,N=m;N;N=Pr(N))g++;for(;0<v-g;)w=Pr(w),v--;for(;0<g-v;)m=Pr(m),g--;for(;v--;){if(w===m||m!==null&&w===m.alternate)break t;w=Pr(w),m=Pr(m)}w=null}else w=null;x!==null&&ah(d,f,x,w,!1),y!==null&&S!==null&&ah(d,S,y,w,!0)}}e:{if(f=c?Or(c):window,x=f.nodeName&&f.nodeName.toLowerCase(),x==="select"||x==="input"&&f.type==="file")var b=bN;else if(eh(f))if(ig)b=EN;else{b=jN;var k=kN}else(x=f.nodeName)&&x.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(b=CN);if(b&&(b=b(e,c))){og(d,b,n,h);break e}k&&k(e,f,c),e==="focusout"&&(k=f._wrapperState)&&k.controlled&&f.type==="number"&&Au(f,"number",f.value)}switch(k=c?Or(c):window,e){case"focusin":(eh(k)||k.contentEditable==="true")&&(Dr=k,Gu=c,oo=null);break;case"focusout":oo=Gu=Dr=null;break;case"mousedown":Ku=!0;break;case"contextmenu":case"mouseup":case"dragend":Ku=!1,oh(d,n,h);break;case"selectionchange":if(MN)break;case"keydown":case"keyup":oh(d,n,h)}var j;if(cd)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else zr?rg(e,n)&&(_="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(_="onCompositionStart");_&&(ng&&n.locale!=="ko"&&(zr||_!=="onCompositionStart"?_==="onCompositionEnd"&&zr&&(j=tg()):(Rn=h,ld="value"in Rn?Rn.value:Rn.textContent,zr=!0)),k=hl(c,_),0<k.length&&(_=new Qf(_,e,null,n,h),d.push({event:_,listeners:k}),j?_.data=j:(j=sg(n),j!==null&&(_.data=j)))),(j=yN?vN(e,n):wN(e,n))&&(c=hl(c,"onBeforeInput"),0<c.length&&(h=new Qf("onBeforeInput","beforeinput",null,n,h),d.push({event:h,listeners:c}),h.data=j))}gg(d,t)})}function bo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function hl(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=go(e,n),o!=null&&r.unshift(bo(e,o,s)),o=go(e,t),o!=null&&r.push(bo(e,o,s))),e=e.return}return r}function Pr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ah(e,t,n,r,s){for(var o=t._reactName,i=[];n!==null&&n!==r;){var l=n,u=l.alternate,c=l.stateNode;if(u!==null&&u===r)break;l.tag===5&&c!==null&&(l=c,s?(u=go(n,o),u!=null&&i.unshift(bo(n,u,l))):s||(u=go(n,o),u!=null&&i.push(bo(n,u,l)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var LN=/\r\n?/g,AN=/\u0000|\uFFFD/g;function uh(e){return(typeof e=="string"?e:""+e).replace(LN,`
38
+ `).replace(AN,"")}function mi(e,t,n){if(t=uh(t),uh(e)!==t&&n)throw Error(H(425))}function ml(){}var Xu=null,Qu=null;function qu(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 Zu=typeof setTimeout=="function"?setTimeout:void 0,zN=typeof clearTimeout=="function"?clearTimeout:void 0,ch=typeof Promise=="function"?Promise:void 0,DN=typeof queueMicrotask=="function"?queueMicrotask:typeof ch<"u"?function(e){return ch.resolve(null).then(e).catch($N)}:Zu;function $N(e){setTimeout(function(){throw e})}function Qa(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),vo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);vo(t)}function Dn(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 dh(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 Ss=Math.random().toString(36).slice(2),Yt="__reactFiber$"+Ss,ko="__reactProps$"+Ss,mn="__reactContainer$"+Ss,Ju="__reactEvents$"+Ss,ON="__reactListeners$"+Ss,FN="__reactHandles$"+Ss;function nr(e){var t=e[Yt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[mn]||n[Yt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=dh(e);e!==null;){if(n=e[Yt])return n;e=dh(e)}return t}e=n,n=e.parentNode}return null}function Wo(e){return e=e[Yt]||e[mn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Or(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function ql(e){return e[ko]||null}var ec=[],Fr=-1;function Qn(e){return{current:e}}function ge(e){0>Fr||(e.current=ec[Fr],ec[Fr]=null,Fr--)}function fe(e,t){Fr++,ec[Fr]=e.current,e.current=t}var Un={},Ge=Qn(Un),nt=Qn(!1),fr=Un;function ss(e,t){var n=e.type.contextTypes;if(!n)return Un;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in n)s[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function rt(e){return e=e.childContextTypes,e!=null}function pl(){ge(nt),ge(Ge)}function fh(e,t,n){if(Ge.current!==Un)throw Error(H(168));fe(Ge,t),fe(nt,n)}function yg(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(H(108,k1(e)||"Unknown",s));return ke({},n,r)}function gl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Un,fr=Ge.current,fe(Ge,e),fe(nt,nt.current),!0}function hh(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=yg(e,t,fr),r.__reactInternalMemoizedMergedChildContext=e,ge(nt),ge(Ge),fe(Ge,e)):ge(nt),fe(nt,n)}var ln=null,Zl=!1,qa=!1;function vg(e){ln===null?ln=[e]:ln.push(e)}function HN(e){Zl=!0,vg(e)}function qn(){if(!qa&&ln!==null){qa=!0;var e=0,t=ce;try{var n=ln;for(ce=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ln=null,Zl=!1}catch(s){throw ln!==null&&(ln=ln.slice(e+1)),Up(rd,qn),s}finally{ce=t,qa=!1}}return null}var Hr=[],Vr=0,xl=null,yl=0,mt=[],pt=0,hr=null,an=1,un="";function Jn(e,t){Hr[Vr++]=yl,Hr[Vr++]=xl,xl=e,yl=t}function wg(e,t,n){mt[pt++]=an,mt[pt++]=un,mt[pt++]=hr,hr=e;var r=an;e=un;var s=32-Tt(r)-1;r&=~(1<<s),n+=1;var o=32-Tt(t)+s;if(30<o){var i=s-s%5;o=(r&(1<<i)-1).toString(32),r>>=i,s-=i,an=1<<32-Tt(t)+s|n<<s|r,un=o+e}else an=1<<o|n<<s|r,un=e}function fd(e){e.return!==null&&(Jn(e,1),wg(e,1,0))}function hd(e){for(;e===xl;)xl=Hr[--Vr],Hr[Vr]=null,yl=Hr[--Vr],Hr[Vr]=null;for(;e===hr;)hr=mt[--pt],mt[pt]=null,un=mt[--pt],mt[pt]=null,an=mt[--pt],mt[pt]=null}var ut=null,at=null,xe=!1,Pt=null;function Ng(e,t){var n=yt(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 mh(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,at=Dn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ut=e,at=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=hr!==null?{id:an,overflow:un}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=yt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ut=e,at=null,!0):!1;default:return!1}}function tc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function nc(e){if(xe){var t=at;if(t){var n=t;if(!mh(e,t)){if(tc(e))throw Error(H(418));t=Dn(n.nextSibling);var r=ut;t&&mh(e,t)?Ng(r,n):(e.flags=e.flags&-4097|2,xe=!1,ut=e)}}else{if(tc(e))throw Error(H(418));e.flags=e.flags&-4097|2,xe=!1,ut=e}}}function ph(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ut=e}function pi(e){if(e!==ut)return!1;if(!xe)return ph(e),xe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!qu(e.type,e.memoizedProps)),t&&(t=at)){if(tc(e))throw Sg(),Error(H(418));for(;t;)Ng(e,t),t=Dn(t.nextSibling)}if(ph(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){at=Dn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}at=null}}else at=ut?Dn(e.stateNode.nextSibling):null;return!0}function Sg(){for(var e=at;e;)e=Dn(e.nextSibling)}function os(){at=ut=null,xe=!1}function md(e){Pt===null?Pt=[e]:Pt.push(e)}var VN=yn.ReactCurrentBatchConfig;function Fs(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(H(309));var r=n.stateNode}if(!r)throw Error(H(147,e));var s=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(i){var l=s.refs;i===null?delete l[o]:l[o]=i},t._stringRef=o,t)}if(typeof e!="string")throw Error(H(284));if(!n._owner)throw Error(H(290,e))}return e}function gi(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function gh(e){var t=e._init;return t(e._payload)}function bg(e){function t(m,v){if(e){var g=m.deletions;g===null?(m.deletions=[v],m.flags|=16):g.push(v)}}function n(m,v){if(!e)return null;for(;v!==null;)t(m,v),v=v.sibling;return null}function r(m,v){for(m=new Map;v!==null;)v.key!==null?m.set(v.key,v):m.set(v.index,v),v=v.sibling;return m}function s(m,v){return m=Hn(m,v),m.index=0,m.sibling=null,m}function o(m,v,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<v?(m.flags|=2,v):g):(m.flags|=2,v)):(m.flags|=1048576,v)}function i(m){return e&&m.alternate===null&&(m.flags|=2),m}function l(m,v,g,N){return v===null||v.tag!==6?(v=su(g,m.mode,N),v.return=m,v):(v=s(v,g),v.return=m,v)}function u(m,v,g,N){var b=g.type;return b===Ar?h(m,v,g.props.children,N,g.key):v!==null&&(v.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===En&&gh(b)===v.type)?(N=s(v,g.props),N.ref=Fs(m,v,g),N.return=m,N):(N=Xi(g.type,g.key,g.props,null,m.mode,N),N.ref=Fs(m,v,g),N.return=m,N)}function c(m,v,g,N){return v===null||v.tag!==4||v.stateNode.containerInfo!==g.containerInfo||v.stateNode.implementation!==g.implementation?(v=ou(g,m.mode,N),v.return=m,v):(v=s(v,g.children||[]),v.return=m,v)}function h(m,v,g,N,b){return v===null||v.tag!==7?(v=ar(g,m.mode,N,b),v.return=m,v):(v=s(v,g),v.return=m,v)}function d(m,v,g){if(typeof v=="string"&&v!==""||typeof v=="number")return v=su(""+v,m.mode,g),v.return=m,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case oi:return g=Xi(v.type,v.key,v.props,null,m.mode,g),g.ref=Fs(m,null,v),g.return=m,g;case Lr:return v=ou(v,m.mode,g),v.return=m,v;case En:var N=v._init;return d(m,N(v._payload),g)}if(Qs(v)||As(v))return v=ar(v,m.mode,g,null),v.return=m,v;gi(m,v)}return null}function f(m,v,g,N){var b=v!==null?v.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return b!==null?null:l(m,v,""+g,N);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case oi:return g.key===b?u(m,v,g,N):null;case Lr:return g.key===b?c(m,v,g,N):null;case En:return b=g._init,f(m,v,b(g._payload),N)}if(Qs(g)||As(g))return b!==null?null:h(m,v,g,N,null);gi(m,g)}return null}function x(m,v,g,N,b){if(typeof N=="string"&&N!==""||typeof N=="number")return m=m.get(g)||null,l(v,m,""+N,b);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case oi:return m=m.get(N.key===null?g:N.key)||null,u(v,m,N,b);case Lr:return m=m.get(N.key===null?g:N.key)||null,c(v,m,N,b);case En:var k=N._init;return x(m,v,g,k(N._payload),b)}if(Qs(N)||As(N))return m=m.get(g)||null,h(v,m,N,b,null);gi(v,N)}return null}function y(m,v,g,N){for(var b=null,k=null,j=v,_=v=0,I=null;j!==null&&_<g.length;_++){j.index>_?(I=j,j=null):I=j.sibling;var D=f(m,j,g[_],N);if(D===null){j===null&&(j=I);break}e&&j&&D.alternate===null&&t(m,j),v=o(D,v,_),k===null?b=D:k.sibling=D,k=D,j=I}if(_===g.length)return n(m,j),xe&&Jn(m,_),b;if(j===null){for(;_<g.length;_++)j=d(m,g[_],N),j!==null&&(v=o(j,v,_),k===null?b=j:k.sibling=j,k=j);return xe&&Jn(m,_),b}for(j=r(m,j);_<g.length;_++)I=x(j,m,_,g[_],N),I!==null&&(e&&I.alternate!==null&&j.delete(I.key===null?_:I.key),v=o(I,v,_),k===null?b=I:k.sibling=I,k=I);return e&&j.forEach(function(T){return t(m,T)}),xe&&Jn(m,_),b}function w(m,v,g,N){var b=As(g);if(typeof b!="function")throw Error(H(150));if(g=b.call(g),g==null)throw Error(H(151));for(var k=b=null,j=v,_=v=0,I=null,D=g.next();j!==null&&!D.done;_++,D=g.next()){j.index>_?(I=j,j=null):I=j.sibling;var T=f(m,j,D.value,N);if(T===null){j===null&&(j=I);break}e&&j&&T.alternate===null&&t(m,j),v=o(T,v,_),k===null?b=T:k.sibling=T,k=T,j=I}if(D.done)return n(m,j),xe&&Jn(m,_),b;if(j===null){for(;!D.done;_++,D=g.next())D=d(m,D.value,N),D!==null&&(v=o(D,v,_),k===null?b=D:k.sibling=D,k=D);return xe&&Jn(m,_),b}for(j=r(m,j);!D.done;_++,D=g.next())D=x(j,m,_,D.value,N),D!==null&&(e&&D.alternate!==null&&j.delete(D.key===null?_:D.key),v=o(D,v,_),k===null?b=D:k.sibling=D,k=D);return e&&j.forEach(function(R){return t(m,R)}),xe&&Jn(m,_),b}function S(m,v,g,N){if(typeof g=="object"&&g!==null&&g.type===Ar&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case oi:e:{for(var b=g.key,k=v;k!==null;){if(k.key===b){if(b=g.type,b===Ar){if(k.tag===7){n(m,k.sibling),v=s(k,g.props.children),v.return=m,m=v;break e}}else if(k.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===En&&gh(b)===k.type){n(m,k.sibling),v=s(k,g.props),v.ref=Fs(m,k,g),v.return=m,m=v;break e}n(m,k);break}else t(m,k);k=k.sibling}g.type===Ar?(v=ar(g.props.children,m.mode,N,g.key),v.return=m,m=v):(N=Xi(g.type,g.key,g.props,null,m.mode,N),N.ref=Fs(m,v,g),N.return=m,m=N)}return i(m);case Lr:e:{for(k=g.key;v!==null;){if(v.key===k)if(v.tag===4&&v.stateNode.containerInfo===g.containerInfo&&v.stateNode.implementation===g.implementation){n(m,v.sibling),v=s(v,g.children||[]),v.return=m,m=v;break e}else{n(m,v);break}else t(m,v);v=v.sibling}v=ou(g,m.mode,N),v.return=m,m=v}return i(m);case En:return k=g._init,S(m,v,k(g._payload),N)}if(Qs(g))return y(m,v,g,N);if(As(g))return w(m,v,g,N);gi(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,v!==null&&v.tag===6?(n(m,v.sibling),v=s(v,g),v.return=m,m=v):(n(m,v),v=su(g,m.mode,N),v.return=m,m=v),i(m)):n(m,v)}return S}var is=bg(!0),kg=bg(!1),vl=Qn(null),wl=null,Br=null,pd=null;function gd(){pd=Br=wl=null}function xd(e){var t=vl.current;ge(vl),e._currentValue=t}function rc(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Zr(e,t){wl=e,pd=Br=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(et=!0),e.firstContext=null)}function Nt(e){var t=e._currentValue;if(pd!==e)if(e={context:e,memoizedValue:t,next:null},Br===null){if(wl===null)throw Error(H(308));Br=e,wl.dependencies={lanes:0,firstContext:e}}else Br=Br.next=e;return t}var rr=null;function yd(e){rr===null?rr=[e]:rr.push(e)}function jg(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,yd(t)):(n.next=s.next,s.next=n),t.interleaved=n,pn(e,r)}function pn(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 _n=!1;function vd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Cg(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 dn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function $n(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ie&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,pn(e,n)}return s=r.interleaved,s===null?(t.next=t,yd(r)):(t.next=s.next,s.next=t),r.interleaved=t,pn(e,n)}function Bi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,sd(e,n)}}function xh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?s=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?s=o=t:o=o.next=t}else s=o=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Nl(e,t,n,r){var s=e.updateQueue;_n=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var u=l,c=u.next;u.next=null,i===null?o=c:i.next=c,i=u;var h=e.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==i&&(l===null?h.firstBaseUpdate=c:l.next=c,h.lastBaseUpdate=u))}if(o!==null){var d=s.baseState;i=0,h=c=u=null,l=o;do{var f=l.lane,x=l.eventTime;if((r&f)===f){h!==null&&(h=h.next={eventTime:x,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,w=l;switch(f=t,x=n,w.tag){case 1:if(y=w.payload,typeof y=="function"){d=y.call(x,d,f);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=w.payload,f=typeof y=="function"?y.call(x,d,f):y,f==null)break e;d=ke({},d,f);break e;case 2:_n=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[l]:f.push(l))}else x={eventTime:x,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(c=h=x,u=d):h=h.next=x,i|=f;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;f=l,l=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(h===null&&(u=d),s.baseState=u,s.firstBaseUpdate=c,s.lastBaseUpdate=h,t=s.shared.interleaved,t!==null){s=t;do i|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);pr|=i,e.lanes=i,e.memoizedState=d}}function yh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(H(191,s));s.call(r)}}}var Yo={},Xt=Qn(Yo),jo=Qn(Yo),Co=Qn(Yo);function sr(e){if(e===Yo)throw Error(H(174));return e}function wd(e,t){switch(fe(Co,t),fe(jo,e),fe(Xt,Yo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Du(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Du(t,e)}ge(Xt),fe(Xt,t)}function ls(){ge(Xt),ge(jo),ge(Co)}function Eg(e){sr(Co.current);var t=sr(Xt.current),n=Du(t,e.type);t!==n&&(fe(jo,e),fe(Xt,n))}function Nd(e){jo.current===e&&(ge(Xt),ge(jo))}var Ne=Qn(0);function Sl(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)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 Za=[];function Sd(){for(var e=0;e<Za.length;e++)Za[e]._workInProgressVersionPrimary=null;Za.length=0}var Ui=yn.ReactCurrentDispatcher,Ja=yn.ReactCurrentBatchConfig,mr=0,Se=null,Ie=null,Le=null,bl=!1,io=!1,Eo=0,BN=0;function Be(){throw Error(H(321))}function bd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!At(e[n],t[n]))return!1;return!0}function kd(e,t,n,r,s,o){if(mr=o,Se=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ui.current=e===null||e.memoizedState===null?GN:KN,e=n(r,s),io){o=0;do{if(io=!1,Eo=0,25<=o)throw Error(H(301));o+=1,Le=Ie=null,t.updateQueue=null,Ui.current=XN,e=n(r,s)}while(io)}if(Ui.current=kl,t=Ie!==null&&Ie.next!==null,mr=0,Le=Ie=Se=null,bl=!1,t)throw Error(H(300));return e}function jd(){var e=Eo!==0;return Eo=0,e}function Bt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Le===null?Se.memoizedState=Le=e:Le=Le.next=e,Le}function St(){if(Ie===null){var e=Se.alternate;e=e!==null?e.memoizedState:null}else e=Ie.next;var t=Le===null?Se.memoizedState:Le.next;if(t!==null)Le=t,Ie=e;else{if(e===null)throw Error(H(310));Ie=e,e={memoizedState:Ie.memoizedState,baseState:Ie.baseState,baseQueue:Ie.baseQueue,queue:Ie.queue,next:null},Le===null?Se.memoizedState=Le=e:Le=Le.next=e}return Le}function _o(e,t){return typeof t=="function"?t(e):t}function eu(e){var t=St(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=Ie,s=r.baseQueue,o=n.pending;if(o!==null){if(s!==null){var i=s.next;s.next=o.next,o.next=i}r.baseQueue=s=o,n.pending=null}if(s!==null){o=s.next,r=r.baseState;var l=i=null,u=null,c=o;do{var h=c.lane;if((mr&h)===h)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:h,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(l=u=d,i=r):u=u.next=d,Se.lanes|=h,pr|=h}c=c.next}while(c!==null&&c!==o);u===null?i=r:u.next=l,At(r,t.memoizedState)||(et=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do o=s.lane,Se.lanes|=o,pr|=o,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function tu(e){var t=St(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,o=t.memoizedState;if(s!==null){n.pending=null;var i=s=s.next;do o=e(o,i.action),i=i.next;while(i!==s);At(o,t.memoizedState)||(et=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function _g(){}function Pg(e,t){var n=Se,r=St(),s=t(),o=!At(r.memoizedState,s);if(o&&(r.memoizedState=s,et=!0),r=r.queue,Cd(Rg.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Le!==null&&Le.memoizedState.tag&1){if(n.flags|=2048,Po(9,Ig.bind(null,n,r,s,t),void 0,null),Ae===null)throw Error(H(349));mr&30||Mg(n,t,s)}return s}function Mg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Se.updateQueue,t===null?(t={lastEffect:null,stores:null},Se.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ig(e,t,n,r){t.value=n,t.getSnapshot=r,Tg(t)&&Lg(e)}function Rg(e,t,n){return n(function(){Tg(t)&&Lg(e)})}function Tg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!At(e,n)}catch{return!0}}function Lg(e){var t=pn(e,1);t!==null&&Lt(t,e,1,-1)}function vh(e){var t=Bt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:_o,lastRenderedState:e},t.queue=e,e=e.dispatch=YN.bind(null,Se,e),[t.memoizedState,e]}function Po(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Se.updateQueue,t===null?(t={lastEffect:null,stores:null},Se.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Ag(){return St().memoizedState}function Wi(e,t,n,r){var s=Bt();Se.flags|=e,s.memoizedState=Po(1|t,n,void 0,r===void 0?null:r)}function Jl(e,t,n,r){var s=St();r=r===void 0?null:r;var o=void 0;if(Ie!==null){var i=Ie.memoizedState;if(o=i.destroy,r!==null&&bd(r,i.deps)){s.memoizedState=Po(t,n,o,r);return}}Se.flags|=e,s.memoizedState=Po(1|t,n,o,r)}function wh(e,t){return Wi(8390656,8,e,t)}function Cd(e,t){return Jl(2048,8,e,t)}function zg(e,t){return Jl(4,2,e,t)}function Dg(e,t){return Jl(4,4,e,t)}function $g(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 Og(e,t,n){return n=n!=null?n.concat([e]):null,Jl(4,4,$g.bind(null,t,e),n)}function Ed(){}function Fg(e,t){var n=St();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&bd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Hg(e,t){var n=St();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&bd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Vg(e,t,n){return mr&21?(At(n,t)||(n=Gp(),Se.lanes|=n,pr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,et=!0),e.memoizedState=n)}function UN(e,t){var n=ce;ce=n!==0&&4>n?n:4,e(!0);var r=Ja.transition;Ja.transition={};try{e(!1),t()}finally{ce=n,Ja.transition=r}}function Bg(){return St().memoizedState}function WN(e,t,n){var r=Fn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ug(e))Wg(t,n);else if(n=jg(e,t,n,r),n!==null){var s=Xe();Lt(n,e,r,s),Yg(n,t,r)}}function YN(e,t,n){var r=Fn(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ug(e))Wg(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,l=o(i,n);if(s.hasEagerState=!0,s.eagerState=l,At(l,i)){var u=t.interleaved;u===null?(s.next=s,yd(t)):(s.next=u.next,u.next=s),t.interleaved=s;return}}catch{}finally{}n=jg(e,t,s,r),n!==null&&(s=Xe(),Lt(n,e,r,s),Yg(n,t,r))}}function Ug(e){var t=e.alternate;return e===Se||t!==null&&t===Se}function Wg(e,t){io=bl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Yg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,sd(e,n)}}var kl={readContext:Nt,useCallback:Be,useContext:Be,useEffect:Be,useImperativeHandle:Be,useInsertionEffect:Be,useLayoutEffect:Be,useMemo:Be,useReducer:Be,useRef:Be,useState:Be,useDebugValue:Be,useDeferredValue:Be,useTransition:Be,useMutableSource:Be,useSyncExternalStore:Be,useId:Be,unstable_isNewReconciler:!1},GN={readContext:Nt,useCallback:function(e,t){return Bt().memoizedState=[e,t===void 0?null:t],e},useContext:Nt,useEffect:wh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Wi(4194308,4,$g.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Wi(4194308,4,e,t)},useInsertionEffect:function(e,t){return Wi(4,2,e,t)},useMemo:function(e,t){var n=Bt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Bt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=WN.bind(null,Se,e),[r.memoizedState,e]},useRef:function(e){var t=Bt();return e={current:e},t.memoizedState=e},useState:vh,useDebugValue:Ed,useDeferredValue:function(e){return Bt().memoizedState=e},useTransition:function(){var e=vh(!1),t=e[0];return e=UN.bind(null,e[1]),Bt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Se,s=Bt();if(xe){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),Ae===null)throw Error(H(349));mr&30||Mg(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,wh(Rg.bind(null,r,o,e),[e]),r.flags|=2048,Po(9,Ig.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Bt(),t=Ae.identifierPrefix;if(xe){var n=un,r=an;n=(r&~(1<<32-Tt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Eo++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=BN++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},KN={readContext:Nt,useCallback:Fg,useContext:Nt,useEffect:Cd,useImperativeHandle:Og,useInsertionEffect:zg,useLayoutEffect:Dg,useMemo:Hg,useReducer:eu,useRef:Ag,useState:function(){return eu(_o)},useDebugValue:Ed,useDeferredValue:function(e){var t=St();return Vg(t,Ie.memoizedState,e)},useTransition:function(){var e=eu(_o)[0],t=St().memoizedState;return[e,t]},useMutableSource:_g,useSyncExternalStore:Pg,useId:Bg,unstable_isNewReconciler:!1},XN={readContext:Nt,useCallback:Fg,useContext:Nt,useEffect:Cd,useImperativeHandle:Og,useInsertionEffect:zg,useLayoutEffect:Dg,useMemo:Hg,useReducer:tu,useRef:Ag,useState:function(){return tu(_o)},useDebugValue:Ed,useDeferredValue:function(e){var t=St();return Ie===null?t.memoizedState=e:Vg(t,Ie.memoizedState,e)},useTransition:function(){var e=tu(_o)[0],t=St().memoizedState;return[e,t]},useMutableSource:_g,useSyncExternalStore:Pg,useId:Bg,unstable_isNewReconciler:!1};function Ct(e,t){if(e&&e.defaultProps){t=ke({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function sc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ke({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ea={isMounted:function(e){return(e=e._reactInternals)?kr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Xe(),s=Fn(e),o=dn(r,s);o.payload=t,n!=null&&(o.callback=n),t=$n(e,o,s),t!==null&&(Lt(t,e,s,r),Bi(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Xe(),s=Fn(e),o=dn(r,s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=$n(e,o,s),t!==null&&(Lt(t,e,s,r),Bi(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Xe(),r=Fn(e),s=dn(n,r);s.tag=2,t!=null&&(s.callback=t),t=$n(e,s,r),t!==null&&(Lt(t,e,r,n),Bi(t,e,r))}};function Nh(e,t,n,r,s,o,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,i):t.prototype&&t.prototype.isPureReactComponent?!No(n,r)||!No(s,o):!0}function Gg(e,t,n){var r=!1,s=Un,o=t.contextType;return typeof o=="object"&&o!==null?o=Nt(o):(s=rt(t)?fr:Ge.current,r=t.contextTypes,o=(r=r!=null)?ss(e,s):Un),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ea,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function Sh(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ea.enqueueReplaceState(t,t.state,null)}function oc(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},vd(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=Nt(o):(o=rt(t)?fr:Ge.current,s.context=ss(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(sc(e,t,o,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&ea.enqueueReplaceState(s,s.state,null),Nl(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function as(e,t){try{var n="",r=t;do n+=b1(r),r=r.return;while(r);var s=n}catch(o){s=`
39
+ Error generating stack: `+o.message+`
40
+ `+o.stack}return{value:e,source:t,stack:s,digest:null}}function nu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ic(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var QN=typeof WeakMap=="function"?WeakMap:Map;function Kg(e,t,n){n=dn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Cl||(Cl=!0,gc=r),ic(e,t)},n}function Xg(e,t,n){n=dn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){ic(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){ic(e,t),typeof r!="function"&&(On===null?On=new Set([this]):On.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function bh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new QN;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=c2.bind(null,e,t,n),t.then(e,e))}function kh(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 jh(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=dn(-1,1),t.tag=2,$n(n,t,1))),n.lanes|=1),e)}var qN=yn.ReactCurrentOwner,et=!1;function Ke(e,t,n,r){t.child=e===null?kg(t,null,n,r):is(t,e.child,n,r)}function Ch(e,t,n,r,s){n=n.render;var o=t.ref;return Zr(t,s),r=kd(e,t,n,r,o,s),n=jd(),e!==null&&!et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,gn(e,t,s)):(xe&&n&&fd(t),t.flags|=1,Ke(e,t,r,s),t.child)}function Eh(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!Ad(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,Qg(e,t,o,r,s)):(e=Xi(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var i=o.memoizedProps;if(n=n.compare,n=n!==null?n:No,n(i,r)&&e.ref===t.ref)return gn(e,t,s)}return t.flags|=1,e=Hn(o,r),e.ref=t.ref,e.return=t,t.child=e}function Qg(e,t,n,r,s){if(e!==null){var o=e.memoizedProps;if(No(o,r)&&e.ref===t.ref)if(et=!1,t.pendingProps=r=o,(e.lanes&s)!==0)e.flags&131072&&(et=!0);else return t.lanes=e.lanes,gn(e,t,s)}return lc(e,t,n,r,s)}function qg(e,t,n){var r=t.pendingProps,s=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},fe(Wr,it),it|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,fe(Wr,it),it|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,fe(Wr,it),it|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,fe(Wr,it),it|=r;return Ke(e,t,s,n),t.child}function Zg(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function lc(e,t,n,r,s){var o=rt(n)?fr:Ge.current;return o=ss(t,o),Zr(t,s),n=kd(e,t,n,r,o,s),r=jd(),e!==null&&!et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,gn(e,t,s)):(xe&&r&&fd(t),t.flags|=1,Ke(e,t,n,s),t.child)}function _h(e,t,n,r,s){if(rt(n)){var o=!0;gl(t)}else o=!1;if(Zr(t,s),t.stateNode===null)Yi(e,t),Gg(t,n,r),oc(t,n,r,s),r=!0;else if(e===null){var i=t.stateNode,l=t.memoizedProps;i.props=l;var u=i.context,c=n.contextType;typeof c=="object"&&c!==null?c=Nt(c):(c=rt(n)?fr:Ge.current,c=ss(t,c));var h=n.getDerivedStateFromProps,d=typeof h=="function"||typeof i.getSnapshotBeforeUpdate=="function";d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==r||u!==c)&&Sh(t,i,r,c),_n=!1;var f=t.memoizedState;i.state=f,Nl(t,r,i,s),u=t.memoizedState,l!==r||f!==u||nt.current||_n?(typeof h=="function"&&(sc(t,n,h,r),u=t.memoizedState),(l=_n||Nh(t,n,l,r,f,u,c))?(d||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),i.props=r,i.state=u,i.context=c,r=l):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Cg(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:Ct(t.type,l),i.props=c,d=t.pendingProps,f=i.context,u=n.contextType,typeof u=="object"&&u!==null?u=Nt(u):(u=rt(n)?fr:Ge.current,u=ss(t,u));var x=n.getDerivedStateFromProps;(h=typeof x=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==d||f!==u)&&Sh(t,i,r,u),_n=!1,f=t.memoizedState,i.state=f,Nl(t,r,i,s);var y=t.memoizedState;l!==d||f!==y||nt.current||_n?(typeof x=="function"&&(sc(t,n,x,r),y=t.memoizedState),(c=_n||Nh(t,n,c,r,f,y,u)||!1)?(h||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,y,u),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,y,u)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),i.props=r,i.state=y,i.context=u,r=c):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return ac(e,t,n,r,o,s)}function ac(e,t,n,r,s,o){Zg(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return s&&hh(t,n,!1),gn(e,t,o);r=t.stateNode,qN.current=t;var l=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=is(t,e.child,null,o),t.child=is(t,null,l,o)):Ke(e,t,l,o),t.memoizedState=r.state,s&&hh(t,n,!0),t.child}function Jg(e){var t=e.stateNode;t.pendingContext?fh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&fh(e,t.context,!1),wd(e,t.containerInfo)}function Ph(e,t,n,r,s){return os(),md(s),t.flags|=256,Ke(e,t,n,r),t.child}var uc={dehydrated:null,treeContext:null,retryLane:0};function cc(e){return{baseLanes:e,cachePool:null,transitions:null}}function ex(e,t,n){var r=t.pendingProps,s=Ne.current,o=!1,i=(t.flags&128)!==0,l;if((l=i)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),fe(Ne,s&1),e===null)return nc(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,o?(r=t.mode,o=t.child,i={mode:"hidden",children:i},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=i):o=ra(i,r,0,null),e=ar(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=cc(n),t.memoizedState=uc,e):_d(t,i));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return ZN(e,t,i,r,l,s,n);if(o){o=r.fallback,i=t.mode,s=e.child,l=s.sibling;var u={mode:"hidden",children:r.children};return!(i&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=Hn(s,u),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?o=Hn(l,o):(o=ar(o,i,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,i=e.child.memoizedState,i=i===null?cc(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~n,t.memoizedState=uc,r}return o=e.child,e=o.sibling,r=Hn(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function _d(e,t){return t=ra({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function xi(e,t,n,r){return r!==null&&md(r),is(t,e.child,null,n),e=_d(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ZN(e,t,n,r,s,o,i){if(n)return t.flags&256?(t.flags&=-257,r=nu(Error(H(422))),xi(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,s=t.mode,r=ra({mode:"visible",children:r.children},s,0,null),o=ar(o,s,i,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&is(t,e.child,null,i),t.child.memoizedState=cc(i),t.memoizedState=uc,o);if(!(t.mode&1))return xi(e,t,i,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(H(419)),r=nu(o,r,void 0),xi(e,t,i,r)}if(l=(i&e.childLanes)!==0,et||l){if(r=Ae,r!==null){switch(i&-i){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|i)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,pn(e,s),Lt(r,e,s,-1))}return Ld(),r=nu(Error(H(421))),xi(e,t,i,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=d2.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,at=Dn(s.nextSibling),ut=t,xe=!0,Pt=null,e!==null&&(mt[pt++]=an,mt[pt++]=un,mt[pt++]=hr,an=e.id,un=e.overflow,hr=t),t=_d(t,r.children),t.flags|=4096,t)}function Mh(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),rc(e.return,t,n)}function ru(e,t,n,r,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=s)}function tx(e,t,n){var r=t.pendingProps,s=r.revealOrder,o=r.tail;if(Ke(e,t,r.children,n),r=Ne.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Mh(e,n,t);else if(e.tag===19)Mh(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}r&=1}if(fe(Ne,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Sl(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),ru(t,!1,s,n,o);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Sl(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}ru(t,!0,n,null,o);break;case"together":ru(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Yi(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function gn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),pr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,n=Hn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Hn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function JN(e,t,n){switch(t.tag){case 3:Jg(t),os();break;case 5:Eg(t);break;case 1:rt(t.type)&&gl(t);break;case 4:wd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;fe(vl,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(fe(Ne,Ne.current&1),t.flags|=128,null):n&t.child.childLanes?ex(e,t,n):(fe(Ne,Ne.current&1),e=gn(e,t,n),e!==null?e.sibling:null);fe(Ne,Ne.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return tx(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),fe(Ne,Ne.current),r)break;return null;case 22:case 23:return t.lanes=0,qg(e,t,n)}return gn(e,t,n)}var nx,dc,rx,sx;nx=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}};dc=function(){};rx=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,sr(Xt.current);var o=null;switch(n){case"input":s=Tu(e,s),r=Tu(e,r),o=[];break;case"select":s=ke({},s,{value:void 0}),r=ke({},r,{value:void 0}),o=[];break;case"textarea":s=zu(e,s),r=zu(e,r),o=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ml)}$u(n,r);var i;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var l=s[c];for(i in l)l.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(mo.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var u=r[c];if(l=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&u!==l&&(u!=null||l!=null))if(c==="style")if(l){for(i in l)!l.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in u)u.hasOwnProperty(i)&&l[i]!==u[i]&&(n||(n={}),n[i]=u[i])}else n||(o||(o=[]),o.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(o=o||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(o=o||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(mo.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&pe("scroll",e),o||l===u||(o=[])):(o=o||[]).push(c,u))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};sx=function(e,t,n,r){n!==r&&(t.flags|=4)};function Hs(e,t){if(!xe)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 r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ue(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function e2(e,t,n){var r=t.pendingProps;switch(hd(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ue(t),null;case 1:return rt(t.type)&&pl(),Ue(t),null;case 3:return r=t.stateNode,ls(),ge(nt),ge(Ge),Sd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(pi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Pt!==null&&(vc(Pt),Pt=null))),dc(e,t),Ue(t),null;case 5:Nd(t);var s=sr(Co.current);if(n=t.type,e!==null&&t.stateNode!=null)rx(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(H(166));return Ue(t),null}if(e=sr(Xt.current),pi(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Yt]=t,r[ko]=o,e=(t.mode&1)!==0,n){case"dialog":pe("cancel",r),pe("close",r);break;case"iframe":case"object":case"embed":pe("load",r);break;case"video":case"audio":for(s=0;s<Zs.length;s++)pe(Zs[s],r);break;case"source":pe("error",r);break;case"img":case"image":case"link":pe("error",r),pe("load",r);break;case"details":pe("toggle",r);break;case"input":Of(r,o),pe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},pe("invalid",r);break;case"textarea":Hf(r,o),pe("invalid",r)}$u(n,o),s=null;for(var i in o)if(o.hasOwnProperty(i)){var l=o[i];i==="children"?typeof l=="string"?r.textContent!==l&&(o.suppressHydrationWarning!==!0&&mi(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&mi(r.textContent,l,e),s=["children",""+l]):mo.hasOwnProperty(i)&&l!=null&&i==="onScroll"&&pe("scroll",r)}switch(n){case"input":ii(r),Ff(r,o,!0);break;case"textarea":ii(r),Vf(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=ml)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Rp(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Yt]=t,e[ko]=r,nx(e,t,!1,!1),t.stateNode=e;e:{switch(i=Ou(n,r),n){case"dialog":pe("cancel",e),pe("close",e),s=r;break;case"iframe":case"object":case"embed":pe("load",e),s=r;break;case"video":case"audio":for(s=0;s<Zs.length;s++)pe(Zs[s],e);s=r;break;case"source":pe("error",e),s=r;break;case"img":case"image":case"link":pe("error",e),pe("load",e),s=r;break;case"details":pe("toggle",e),s=r;break;case"input":Of(e,r),s=Tu(e,r),pe("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=ke({},r,{value:void 0}),pe("invalid",e);break;case"textarea":Hf(e,r),s=zu(e,r),pe("invalid",e);break;default:s=r}$u(n,s),l=s;for(o in l)if(l.hasOwnProperty(o)){var u=l[o];o==="style"?Ap(e,u):o==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Tp(e,u)):o==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&po(e,u):typeof u=="number"&&po(e,""+u):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(mo.hasOwnProperty(o)?u!=null&&o==="onScroll"&&pe("scroll",e):u!=null&&Zc(e,o,u,i))}switch(n){case"input":ii(e),Ff(e,r,!1);break;case"textarea":ii(e),Vf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Bn(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Kr(e,!!r.multiple,o,!1):r.defaultValue!=null&&Kr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=ml)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ue(t),null;case 6:if(e&&t.stateNode!=null)sx(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(H(166));if(n=sr(Co.current),sr(Xt.current),pi(t)){if(r=t.stateNode,n=t.memoizedProps,r[Yt]=t,(o=r.nodeValue!==n)&&(e=ut,e!==null))switch(e.tag){case 3:mi(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&mi(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Yt]=t,t.stateNode=r}return Ue(t),null;case 13:if(ge(Ne),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(xe&&at!==null&&t.mode&1&&!(t.flags&128))Sg(),os(),t.flags|=98560,o=!1;else if(o=pi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(H(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(H(317));o[Yt]=t}else os(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ue(t),o=!1}else Pt!==null&&(vc(Pt),Pt=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ne.current&1?Re===0&&(Re=3):Ld())),t.updateQueue!==null&&(t.flags|=4),Ue(t),null);case 4:return ls(),dc(e,t),e===null&&So(t.stateNode.containerInfo),Ue(t),null;case 10:return xd(t.type._context),Ue(t),null;case 17:return rt(t.type)&&pl(),Ue(t),null;case 19:if(ge(Ne),o=t.memoizedState,o===null)return Ue(t),null;if(r=(t.flags&128)!==0,i=o.rendering,i===null)if(r)Hs(o,!1);else{if(Re!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=Sl(e),i!==null){for(t.flags|=128,Hs(o,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,i=o.alternate,i===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,e=i.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return fe(Ne,Ne.current&1|2),t.child}e=e.sibling}o.tail!==null&&Ce()>us&&(t.flags|=128,r=!0,Hs(o,!1),t.lanes=4194304)}else{if(!r)if(e=Sl(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Hs(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!xe)return Ue(t),null}else 2*Ce()-o.renderingStartTime>us&&n!==1073741824&&(t.flags|=128,r=!0,Hs(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ce(),t.sibling=null,n=Ne.current,fe(Ne,r?n&1|2:n&1),t):(Ue(t),null);case 22:case 23:return Td(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?it&1073741824&&(Ue(t),t.subtreeFlags&6&&(t.flags|=8192)):Ue(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function t2(e,t){switch(hd(t),t.tag){case 1:return rt(t.type)&&pl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ls(),ge(nt),ge(Ge),Sd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Nd(t),null;case 13:if(ge(Ne),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));os()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ge(Ne),null;case 4:return ls(),null;case 10:return xd(t.type._context),null;case 22:case 23:return Td(),null;case 24:return null;default:return null}}var yi=!1,Ye=!1,n2=typeof WeakSet=="function"?WeakSet:Set,W=null;function Ur(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){je(e,t,r)}else n.current=null}function fc(e,t,n){try{n()}catch(r){je(e,t,r)}}var Ih=!1;function r2(e,t){if(Xu=dl,e=ug(),dd(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,l=-1,u=-1,c=0,h=0,d=e,f=null;t:for(;;){for(var x;d!==n||s!==0&&d.nodeType!==3||(l=i+s),d!==o||r!==0&&d.nodeType!==3||(u=i+r),d.nodeType===3&&(i+=d.nodeValue.length),(x=d.firstChild)!==null;)f=d,d=x;for(;;){if(d===e)break t;if(f===n&&++c===s&&(l=i),f===o&&++h===r&&(u=i),(x=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=x}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Qu={focusedElem:e,selectionRange:n},dl=!1,W=t;W!==null;)if(t=W,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,W=e;else for(;W!==null;){t=W;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var w=y.memoizedProps,S=y.memoizedState,m=t.stateNode,v=m.getSnapshotBeforeUpdate(t.elementType===t.type?w:Ct(t.type,w),S);m.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(N){je(t,t.return,N)}if(e=t.sibling,e!==null){e.return=t.return,W=e;break}W=t.return}return y=Ih,Ih=!1,y}function lo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&fc(t,n,o)}s=s.next}while(s!==r)}}function ta(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 r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function hc(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 ox(e){var t=e.alternate;t!==null&&(e.alternate=null,ox(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Yt],delete t[ko],delete t[Ju],delete t[ON],delete t[FN])),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 ix(e){return e.tag===5||e.tag===3||e.tag===4}function Rh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ix(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 mc(e,t,n){var r=e.tag;if(r===5||r===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=ml));else if(r!==4&&(e=e.child,e!==null))for(mc(e,t,n),e=e.sibling;e!==null;)mc(e,t,n),e=e.sibling}function pc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(pc(e,t,n),e=e.sibling;e!==null;)pc(e,t,n),e=e.sibling}var ze=null,Et=!1;function Nn(e,t,n){for(n=n.child;n!==null;)lx(e,t,n),n=n.sibling}function lx(e,t,n){if(Kt&&typeof Kt.onCommitFiberUnmount=="function")try{Kt.onCommitFiberUnmount(Gl,n)}catch{}switch(n.tag){case 5:Ye||Ur(n,t);case 6:var r=ze,s=Et;ze=null,Nn(e,t,n),ze=r,Et=s,ze!==null&&(Et?(e=ze,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ze.removeChild(n.stateNode));break;case 18:ze!==null&&(Et?(e=ze,n=n.stateNode,e.nodeType===8?Qa(e.parentNode,n):e.nodeType===1&&Qa(e,n),vo(e)):Qa(ze,n.stateNode));break;case 4:r=ze,s=Et,ze=n.stateNode.containerInfo,Et=!0,Nn(e,t,n),ze=r,Et=s;break;case 0:case 11:case 14:case 15:if(!Ye&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var o=s,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&fc(n,t,i),s=s.next}while(s!==r)}Nn(e,t,n);break;case 1:if(!Ye&&(Ur(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){je(n,t,l)}Nn(e,t,n);break;case 21:Nn(e,t,n);break;case 22:n.mode&1?(Ye=(r=Ye)||n.memoizedState!==null,Nn(e,t,n),Ye=r):Nn(e,t,n);break;default:Nn(e,t,n)}}function Th(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new n2),t.forEach(function(r){var s=f2.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function jt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var o=e,i=t,l=i;e:for(;l!==null;){switch(l.tag){case 5:ze=l.stateNode,Et=!1;break e;case 3:ze=l.stateNode.containerInfo,Et=!0;break e;case 4:ze=l.stateNode.containerInfo,Et=!0;break e}l=l.return}if(ze===null)throw Error(H(160));lx(o,i,s),ze=null,Et=!1;var u=s.alternate;u!==null&&(u.return=null),s.return=null}catch(c){je(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ax(t,e),t=t.sibling}function ax(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(jt(t,e),Vt(e),r&4){try{lo(3,e,e.return),ta(3,e)}catch(w){je(e,e.return,w)}try{lo(5,e,e.return)}catch(w){je(e,e.return,w)}}break;case 1:jt(t,e),Vt(e),r&512&&n!==null&&Ur(n,n.return);break;case 5:if(jt(t,e),Vt(e),r&512&&n!==null&&Ur(n,n.return),e.flags&32){var s=e.stateNode;try{po(s,"")}catch(w){je(e,e.return,w)}}if(r&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,i=n!==null?n.memoizedProps:o,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&o.type==="radio"&&o.name!=null&&Mp(s,o),Ou(l,i);var c=Ou(l,o);for(i=0;i<u.length;i+=2){var h=u[i],d=u[i+1];h==="style"?Ap(s,d):h==="dangerouslySetInnerHTML"?Tp(s,d):h==="children"?po(s,d):Zc(s,h,d,c)}switch(l){case"input":Lu(s,o);break;case"textarea":Ip(s,o);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var x=o.value;x!=null?Kr(s,!!o.multiple,x,!1):f!==!!o.multiple&&(o.defaultValue!=null?Kr(s,!!o.multiple,o.defaultValue,!0):Kr(s,!!o.multiple,o.multiple?[]:"",!1))}s[ko]=o}catch(w){je(e,e.return,w)}}break;case 6:if(jt(t,e),Vt(e),r&4){if(e.stateNode===null)throw Error(H(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(w){je(e,e.return,w)}}break;case 3:if(jt(t,e),Vt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{vo(t.containerInfo)}catch(w){je(e,e.return,w)}break;case 4:jt(t,e),Vt(e);break;case 13:jt(t,e),Vt(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(Id=Ce())),r&4&&Th(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(Ye=(c=Ye)||h,jt(t,e),Ye=c):jt(t,e),Vt(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!h&&e.mode&1)for(W=e,h=e.child;h!==null;){for(d=W=h;W!==null;){switch(f=W,x=f.child,f.tag){case 0:case 11:case 14:case 15:lo(4,f,f.return);break;case 1:Ur(f,f.return);var y=f.stateNode;if(typeof y.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(w){je(r,n,w)}}break;case 5:Ur(f,f.return);break;case 22:if(f.memoizedState!==null){Ah(d);continue}}x!==null?(x.return=f,W=x):Ah(d)}h=h.sibling}e:for(h=null,d=e;;){if(d.tag===5){if(h===null){h=d;try{s=d.stateNode,c?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=d.stateNode,u=d.memoizedProps.style,i=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=Lp("display",i))}catch(w){je(e,e.return,w)}}}else if(d.tag===6){if(h===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(w){je(e,e.return,w)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;h===d&&(h=null),d=d.return}h===d&&(h=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:jt(t,e),Vt(e),r&4&&Th(e);break;case 21:break;default:jt(t,e),Vt(e)}}function Vt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(ix(n)){var r=n;break e}n=n.return}throw Error(H(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(po(s,""),r.flags&=-33);var o=Rh(e);pc(e,o,s);break;case 3:case 4:var i=r.stateNode.containerInfo,l=Rh(e);mc(e,l,i);break;default:throw Error(H(161))}}catch(u){je(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function s2(e,t,n){W=e,ux(e)}function ux(e,t,n){for(var r=(e.mode&1)!==0;W!==null;){var s=W,o=s.child;if(s.tag===22&&r){var i=s.memoizedState!==null||yi;if(!i){var l=s.alternate,u=l!==null&&l.memoizedState!==null||Ye;l=yi;var c=Ye;if(yi=i,(Ye=u)&&!c)for(W=s;W!==null;)i=W,u=i.child,i.tag===22&&i.memoizedState!==null?zh(s):u!==null?(u.return=i,W=u):zh(s);for(;o!==null;)W=o,ux(o),o=o.sibling;W=s,yi=l,Ye=c}Lh(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,W=o):Lh(e)}}function Lh(e){for(;W!==null;){var t=W;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ye||ta(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ye)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:Ct(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&yh(t,o,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}yh(t,i,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var h=c.memoizedState;if(h!==null){var d=h.dehydrated;d!==null&&vo(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}Ye||t.flags&512&&hc(t)}catch(f){je(t,t.return,f)}}if(t===e){W=null;break}if(n=t.sibling,n!==null){n.return=t.return,W=n;break}W=t.return}}function Ah(e){for(;W!==null;){var t=W;if(t===e){W=null;break}var n=t.sibling;if(n!==null){n.return=t.return,W=n;break}W=t.return}}function zh(e){for(;W!==null;){var t=W;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ta(4,t)}catch(u){je(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(u){je(t,s,u)}}var o=t.return;try{hc(t)}catch(u){je(t,o,u)}break;case 5:var i=t.return;try{hc(t)}catch(u){je(t,i,u)}}}catch(u){je(t,t.return,u)}if(t===e){W=null;break}var l=t.sibling;if(l!==null){l.return=t.return,W=l;break}W=t.return}}var o2=Math.ceil,jl=yn.ReactCurrentDispatcher,Pd=yn.ReactCurrentOwner,vt=yn.ReactCurrentBatchConfig,ie=0,Ae=null,Pe=null,Oe=0,it=0,Wr=Qn(0),Re=0,Mo=null,pr=0,na=0,Md=0,ao=null,Je=null,Id=0,us=1/0,on=null,Cl=!1,gc=null,On=null,vi=!1,Tn=null,El=0,uo=0,xc=null,Gi=-1,Ki=0;function Xe(){return ie&6?Ce():Gi!==-1?Gi:Gi=Ce()}function Fn(e){return e.mode&1?ie&2&&Oe!==0?Oe&-Oe:VN.transition!==null?(Ki===0&&(Ki=Gp()),Ki):(e=ce,e!==0||(e=window.event,e=e===void 0?16:eg(e.type)),e):1}function Lt(e,t,n,r){if(50<uo)throw uo=0,xc=null,Error(H(185));Bo(e,n,r),(!(ie&2)||e!==Ae)&&(e===Ae&&(!(ie&2)&&(na|=n),Re===4&&Mn(e,Oe)),st(e,r),n===1&&ie===0&&!(t.mode&1)&&(us=Ce()+500,Zl&&qn()))}function st(e,t){var n=e.callbackNode;V1(e,t);var r=cl(e,e===Ae?Oe:0);if(r===0)n!==null&&Wf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Wf(n),t===1)e.tag===0?HN(Dh.bind(null,e)):vg(Dh.bind(null,e)),DN(function(){!(ie&6)&&qn()}),n=null;else{switch(Kp(r)){case 1:n=rd;break;case 4:n=Wp;break;case 16:n=ul;break;case 536870912:n=Yp;break;default:n=ul}n=xx(n,cx.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function cx(e,t){if(Gi=-1,Ki=0,ie&6)throw Error(H(327));var n=e.callbackNode;if(Jr()&&e.callbackNode!==n)return null;var r=cl(e,e===Ae?Oe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=_l(e,r);else{t=r;var s=ie;ie|=2;var o=fx();(Ae!==e||Oe!==t)&&(on=null,us=Ce()+500,lr(e,t));do try{a2();break}catch(l){dx(e,l)}while(!0);gd(),jl.current=o,ie=s,Pe!==null?t=0:(Ae=null,Oe=0,t=Re)}if(t!==0){if(t===2&&(s=Uu(e),s!==0&&(r=s,t=yc(e,s))),t===1)throw n=Mo,lr(e,0),Mn(e,r),st(e,Ce()),n;if(t===6)Mn(e,r);else{if(s=e.current.alternate,!(r&30)&&!i2(s)&&(t=_l(e,r),t===2&&(o=Uu(e),o!==0&&(r=o,t=yc(e,o))),t===1))throw n=Mo,lr(e,0),Mn(e,r),st(e,Ce()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(H(345));case 2:er(e,Je,on);break;case 3:if(Mn(e,r),(r&130023424)===r&&(t=Id+500-Ce(),10<t)){if(cl(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){Xe(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Zu(er.bind(null,e,Je,on),t);break}er(e,Je,on);break;case 4:if(Mn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var i=31-Tt(r);o=1<<i,i=t[i],i>s&&(s=i),r&=~o}if(r=s,r=Ce()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*o2(r/1960))-r,10<r){e.timeoutHandle=Zu(er.bind(null,e,Je,on),r);break}er(e,Je,on);break;case 5:er(e,Je,on);break;default:throw Error(H(329))}}}return st(e,Ce()),e.callbackNode===n?cx.bind(null,e):null}function yc(e,t){var n=ao;return e.current.memoizedState.isDehydrated&&(lr(e,t).flags|=256),e=_l(e,t),e!==2&&(t=Je,Je=n,t!==null&&vc(t)),e}function vc(e){Je===null?Je=e:Je.push.apply(Je,e)}function i2(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],o=s.getSnapshot;s=s.value;try{if(!At(o(),s))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 Mn(e,t){for(t&=~Md,t&=~na,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Tt(t),r=1<<n;e[n]=-1,t&=~r}}function Dh(e){if(ie&6)throw Error(H(327));Jr();var t=cl(e,0);if(!(t&1))return st(e,Ce()),null;var n=_l(e,t);if(e.tag!==0&&n===2){var r=Uu(e);r!==0&&(t=r,n=yc(e,r))}if(n===1)throw n=Mo,lr(e,0),Mn(e,t),st(e,Ce()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,er(e,Je,on),st(e,Ce()),null}function Rd(e,t){var n=ie;ie|=1;try{return e(t)}finally{ie=n,ie===0&&(us=Ce()+500,Zl&&qn())}}function gr(e){Tn!==null&&Tn.tag===0&&!(ie&6)&&Jr();var t=ie;ie|=1;var n=vt.transition,r=ce;try{if(vt.transition=null,ce=1,e)return e()}finally{ce=r,vt.transition=n,ie=t,!(ie&6)&&qn()}}function Td(){it=Wr.current,ge(Wr)}function lr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,zN(n)),Pe!==null)for(n=Pe.return;n!==null;){var r=n;switch(hd(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&pl();break;case 3:ls(),ge(nt),ge(Ge),Sd();break;case 5:Nd(r);break;case 4:ls();break;case 13:ge(Ne);break;case 19:ge(Ne);break;case 10:xd(r.type._context);break;case 22:case 23:Td()}n=n.return}if(Ae=e,Pe=e=Hn(e.current,null),Oe=it=t,Re=0,Mo=null,Md=na=pr=0,Je=ao=null,rr!==null){for(t=0;t<rr.length;t++)if(n=rr[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,o=n.pending;if(o!==null){var i=o.next;o.next=s,r.next=i}n.pending=r}rr=null}return e}function dx(e,t){do{var n=Pe;try{if(gd(),Ui.current=kl,bl){for(var r=Se.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}bl=!1}if(mr=0,Le=Ie=Se=null,io=!1,Eo=0,Pd.current=null,n===null||n.return===null){Re=1,Mo=t,Pe=null;break}e:{var o=e,i=n.return,l=n,u=t;if(t=Oe,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,h=l,d=h.tag;if(!(h.mode&1)&&(d===0||d===11||d===15)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var x=kh(i);if(x!==null){x.flags&=-257,jh(x,i,l,o,t),x.mode&1&&bh(o,c,t),t=x,u=c;var y=t.updateQueue;if(y===null){var w=new Set;w.add(u),t.updateQueue=w}else y.add(u);break e}else{if(!(t&1)){bh(o,c,t),Ld();break e}u=Error(H(426))}}else if(xe&&l.mode&1){var S=kh(i);if(S!==null){!(S.flags&65536)&&(S.flags|=256),jh(S,i,l,o,t),md(as(u,l));break e}}o=u=as(u,l),Re!==4&&(Re=2),ao===null?ao=[o]:ao.push(o),o=i;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var m=Kg(o,u,t);xh(o,m);break e;case 1:l=u;var v=o.type,g=o.stateNode;if(!(o.flags&128)&&(typeof v.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(On===null||!On.has(g)))){o.flags|=65536,t&=-t,o.lanes|=t;var N=Xg(o,l,t);xh(o,N);break e}}o=o.return}while(o!==null)}mx(n)}catch(b){t=b,Pe===n&&n!==null&&(Pe=n=n.return);continue}break}while(!0)}function fx(){var e=jl.current;return jl.current=kl,e===null?kl:e}function Ld(){(Re===0||Re===3||Re===2)&&(Re=4),Ae===null||!(pr&268435455)&&!(na&268435455)||Mn(Ae,Oe)}function _l(e,t){var n=ie;ie|=2;var r=fx();(Ae!==e||Oe!==t)&&(on=null,lr(e,t));do try{l2();break}catch(s){dx(e,s)}while(!0);if(gd(),ie=n,jl.current=r,Pe!==null)throw Error(H(261));return Ae=null,Oe=0,Re}function l2(){for(;Pe!==null;)hx(Pe)}function a2(){for(;Pe!==null&&!T1();)hx(Pe)}function hx(e){var t=gx(e.alternate,e,it);e.memoizedProps=e.pendingProps,t===null?mx(e):Pe=t,Pd.current=null}function mx(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=t2(n,t),n!==null){n.flags&=32767,Pe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Re=6,Pe=null;return}}else if(n=e2(n,t,it),n!==null){Pe=n;return}if(t=t.sibling,t!==null){Pe=t;return}Pe=t=e}while(t!==null);Re===0&&(Re=5)}function er(e,t,n){var r=ce,s=vt.transition;try{vt.transition=null,ce=1,u2(e,t,n,r)}finally{vt.transition=s,ce=r}return null}function u2(e,t,n,r){do Jr();while(Tn!==null);if(ie&6)throw Error(H(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(H(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(B1(e,o),e===Ae&&(Pe=Ae=null,Oe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||vi||(vi=!0,xx(ul,function(){return Jr(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=vt.transition,vt.transition=null;var i=ce;ce=1;var l=ie;ie|=4,Pd.current=null,r2(e,n),ax(n,e),PN(Qu),dl=!!Xu,Qu=Xu=null,e.current=n,s2(n),L1(),ie=l,ce=i,vt.transition=o}else e.current=n;if(vi&&(vi=!1,Tn=e,El=s),o=e.pendingLanes,o===0&&(On=null),D1(n.stateNode),st(e,Ce()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(Cl)throw Cl=!1,e=gc,gc=null,e;return El&1&&e.tag!==0&&Jr(),o=e.pendingLanes,o&1?e===xc?uo++:(uo=0,xc=e):uo=0,qn(),null}function Jr(){if(Tn!==null){var e=Kp(El),t=vt.transition,n=ce;try{if(vt.transition=null,ce=16>e?16:e,Tn===null)var r=!1;else{if(e=Tn,Tn=null,El=0,ie&6)throw Error(H(331));var s=ie;for(ie|=4,W=e.current;W!==null;){var o=W,i=o.child;if(W.flags&16){var l=o.deletions;if(l!==null){for(var u=0;u<l.length;u++){var c=l[u];for(W=c;W!==null;){var h=W;switch(h.tag){case 0:case 11:case 15:lo(8,h,o)}var d=h.child;if(d!==null)d.return=h,W=d;else for(;W!==null;){h=W;var f=h.sibling,x=h.return;if(ox(h),h===c){W=null;break}if(f!==null){f.return=x,W=f;break}W=x}}}var y=o.alternate;if(y!==null){var w=y.child;if(w!==null){y.child=null;do{var S=w.sibling;w.sibling=null,w=S}while(w!==null)}}W=o}}if(o.subtreeFlags&2064&&i!==null)i.return=o,W=i;else e:for(;W!==null;){if(o=W,o.flags&2048)switch(o.tag){case 0:case 11:case 15:lo(9,o,o.return)}var m=o.sibling;if(m!==null){m.return=o.return,W=m;break e}W=o.return}}var v=e.current;for(W=v;W!==null;){i=W;var g=i.child;if(i.subtreeFlags&2064&&g!==null)g.return=i,W=g;else e:for(i=v;W!==null;){if(l=W,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:ta(9,l)}}catch(b){je(l,l.return,b)}if(l===i){W=null;break e}var N=l.sibling;if(N!==null){N.return=l.return,W=N;break e}W=l.return}}if(ie=s,qn(),Kt&&typeof Kt.onPostCommitFiberRoot=="function")try{Kt.onPostCommitFiberRoot(Gl,e)}catch{}r=!0}return r}finally{ce=n,vt.transition=t}}return!1}function $h(e,t,n){t=as(n,t),t=Kg(e,t,1),e=$n(e,t,1),t=Xe(),e!==null&&(Bo(e,1,t),st(e,t))}function je(e,t,n){if(e.tag===3)$h(e,e,n);else for(;t!==null;){if(t.tag===3){$h(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(On===null||!On.has(r))){e=as(n,e),e=Xg(t,e,1),t=$n(t,e,1),e=Xe(),t!==null&&(Bo(t,1,e),st(t,e));break}}t=t.return}}function c2(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Xe(),e.pingedLanes|=e.suspendedLanes&n,Ae===e&&(Oe&n)===n&&(Re===4||Re===3&&(Oe&130023424)===Oe&&500>Ce()-Id?lr(e,0):Md|=n),st(e,t)}function px(e,t){t===0&&(e.mode&1?(t=ui,ui<<=1,!(ui&130023424)&&(ui=4194304)):t=1);var n=Xe();e=pn(e,t),e!==null&&(Bo(e,t,n),st(e,n))}function d2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),px(e,n)}function f2(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(H(314))}r!==null&&r.delete(t),px(e,n)}var gx;gx=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||nt.current)et=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return et=!1,JN(e,t,n);et=!!(e.flags&131072)}else et=!1,xe&&t.flags&1048576&&wg(t,yl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Yi(e,t),e=t.pendingProps;var s=ss(t,Ge.current);Zr(t,n),s=kd(null,t,r,e,s,n);var o=jd();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,rt(r)?(o=!0,gl(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,vd(t),s.updater=ea,t.stateNode=s,s._reactInternals=t,oc(t,r,e,n),t=ac(null,t,r,!0,o,n)):(t.tag=0,xe&&o&&fd(t),Ke(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Yi(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=m2(r),e=Ct(r,e),s){case 0:t=lc(null,t,r,e,n);break e;case 1:t=_h(null,t,r,e,n);break e;case 11:t=Ch(null,t,r,e,n);break e;case 14:t=Eh(null,t,r,Ct(r.type,e),n);break e}throw Error(H(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ct(r,s),lc(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ct(r,s),_h(e,t,r,s,n);case 3:e:{if(Jg(t),e===null)throw Error(H(387));r=t.pendingProps,o=t.memoizedState,s=o.element,Cg(e,t),Nl(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=as(Error(H(423)),t),t=Ph(e,t,r,n,s);break e}else if(r!==s){s=as(Error(H(424)),t),t=Ph(e,t,r,n,s);break e}else for(at=Dn(t.stateNode.containerInfo.firstChild),ut=t,xe=!0,Pt=null,n=kg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(os(),r===s){t=gn(e,t,n);break e}Ke(e,t,r,n)}t=t.child}return t;case 5:return Eg(t),e===null&&nc(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,qu(r,s)?i=null:o!==null&&qu(r,o)&&(t.flags|=32),Zg(e,t),Ke(e,t,i,n),t.child;case 6:return e===null&&nc(t),null;case 13:return ex(e,t,n);case 4:return wd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=is(t,null,r,n):Ke(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ct(r,s),Ch(e,t,r,s,n);case 7:return Ke(e,t,t.pendingProps,n),t.child;case 8:return Ke(e,t,t.pendingProps.children,n),t.child;case 12:return Ke(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,o=t.memoizedProps,i=s.value,fe(vl,r._currentValue),r._currentValue=i,o!==null)if(At(o.value,i)){if(o.children===s.children&&!nt.current){t=gn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){i=o.child;for(var u=l.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=dn(-1,n&-n),u.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var h=c.pending;h===null?u.next=u:(u.next=h.next,h.next=u),c.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),rc(o.return,n,t),l.lanes|=n;break}u=u.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(H(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),rc(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}Ke(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Zr(t,n),s=Nt(s),r=r(s),t.flags|=1,Ke(e,t,r,n),t.child;case 14:return r=t.type,s=Ct(r,t.pendingProps),s=Ct(r.type,s),Eh(e,t,r,s,n);case 15:return Qg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ct(r,s),Yi(e,t),t.tag=1,rt(r)?(e=!0,gl(t)):e=!1,Zr(t,n),Gg(t,r,s),oc(t,r,s,n),ac(null,t,r,!0,e,n);case 19:return tx(e,t,n);case 22:return qg(e,t,n)}throw Error(H(156,t.tag))};function xx(e,t){return Up(e,t)}function h2(e,t,n,r){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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yt(e,t,n,r){return new h2(e,t,n,r)}function Ad(e){return e=e.prototype,!(!e||!e.isReactComponent)}function m2(e){if(typeof e=="function")return Ad(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ed)return 11;if(e===td)return 14}return 2}function Hn(e,t){var n=e.alternate;return n===null?(n=yt(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 Xi(e,t,n,r,s,o){var i=2;if(r=e,typeof e=="function")Ad(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Ar:return ar(n.children,s,o,t);case Jc:i=8,s|=8;break;case Pu:return e=yt(12,n,t,s|2),e.elementType=Pu,e.lanes=o,e;case Mu:return e=yt(13,n,t,s),e.elementType=Mu,e.lanes=o,e;case Iu:return e=yt(19,n,t,s),e.elementType=Iu,e.lanes=o,e;case Ep:return ra(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case jp:i=10;break e;case Cp:i=9;break e;case ed:i=11;break e;case td:i=14;break e;case En:i=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=yt(i,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function ar(e,t,n,r){return e=yt(7,e,r,t),e.lanes=n,e}function ra(e,t,n,r){return e=yt(22,e,r,t),e.elementType=Ep,e.lanes=n,e.stateNode={isHidden:!1},e}function su(e,t,n){return e=yt(6,e,null,t),e.lanes=n,e}function ou(e,t,n){return t=yt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function p2(e,t,n,r,s){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=Oa(0),this.expirationTimes=Oa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oa(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function zd(e,t,n,r,s,o,i,l,u){return e=new p2(e,t,n,l,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=yt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},vd(o),e}function g2(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Lr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function yx(e){if(!e)return Un;e=e._reactInternals;e:{if(kr(e)!==e||e.tag!==1)throw Error(H(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(rt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(H(171))}if(e.tag===1){var n=e.type;if(rt(n))return yg(e,n,t)}return t}function vx(e,t,n,r,s,o,i,l,u){return e=zd(n,r,!0,e,s,o,i,l,u),e.context=yx(null),n=e.current,r=Xe(),s=Fn(n),o=dn(r,s),o.callback=t??null,$n(n,o,s),e.current.lanes=s,Bo(e,s,r),st(e,r),e}function sa(e,t,n,r){var s=t.current,o=Xe(),i=Fn(s);return n=yx(n),t.context===null?t.context=n:t.pendingContext=n,t=dn(o,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=$n(s,t,i),e!==null&&(Lt(e,s,i,o),Bi(e,s,i)),i}function Pl(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 Oh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Dd(e,t){Oh(e,t),(e=e.alternate)&&Oh(e,t)}function x2(){return null}var wx=typeof reportError=="function"?reportError:function(e){console.error(e)};function $d(e){this._internalRoot=e}oa.prototype.render=$d.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));sa(e,t,null,null)};oa.prototype.unmount=$d.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gr(function(){sa(null,e,null,null)}),t[mn]=null}};function oa(e){this._internalRoot=e}oa.prototype.unstable_scheduleHydration=function(e){if(e){var t=qp();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Pn.length&&t!==0&&t<Pn[n].priority;n++);Pn.splice(n,0,e),n===0&&Jp(e)}};function Od(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ia(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Fh(){}function y2(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var c=Pl(i);o.call(c)}}var i=vx(t,r,e,0,null,!1,!1,"",Fh);return e._reactRootContainer=i,e[mn]=i.current,So(e.nodeType===8?e.parentNode:e),gr(),i}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var c=Pl(u);l.call(c)}}var u=zd(e,0,!1,null,null,!1,!1,"",Fh);return e._reactRootContainer=u,e[mn]=u.current,So(e.nodeType===8?e.parentNode:e),gr(function(){sa(t,u,n,r)}),u}function la(e,t,n,r,s){var o=n._reactRootContainer;if(o){var i=o;if(typeof s=="function"){var l=s;s=function(){var u=Pl(i);l.call(u)}}sa(t,i,e,s)}else i=y2(n,t,e,s,r);return Pl(i)}Xp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=qs(t.pendingLanes);n!==0&&(sd(t,n|1),st(t,Ce()),!(ie&6)&&(us=Ce()+500,qn()))}break;case 13:gr(function(){var r=pn(e,1);if(r!==null){var s=Xe();Lt(r,e,1,s)}}),Dd(e,1)}};od=function(e){if(e.tag===13){var t=pn(e,134217728);if(t!==null){var n=Xe();Lt(t,e,134217728,n)}Dd(e,134217728)}};Qp=function(e){if(e.tag===13){var t=Fn(e),n=pn(e,t);if(n!==null){var r=Xe();Lt(n,e,t,r)}Dd(e,t)}};qp=function(){return ce};Zp=function(e,t){var n=ce;try{return ce=e,t()}finally{ce=n}};Hu=function(e,t,n){switch(t){case"input":if(Lu(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 r=n[t];if(r!==e&&r.form===e.form){var s=ql(r);if(!s)throw Error(H(90));Pp(r),Lu(r,s)}}}break;case"textarea":Ip(e,n);break;case"select":t=n.value,t!=null&&Kr(e,!!n.multiple,t,!1)}};$p=Rd;Op=gr;var v2={usingClientEntryPoint:!1,Events:[Wo,Or,ql,zp,Dp,Rd]},Vs={findFiberByHostInstance:nr,bundleType:0,version:"18.3.0",rendererPackageName:"react-dom"},w2={bundleType:Vs.bundleType,version:Vs.version,rendererPackageName:Vs.rendererPackageName,rendererConfig:Vs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:yn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Vp(e),e===null?null:e.stateNode},findFiberByHostInstance:Vs.findFiberByHostInstance||x2,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.0-next-8a015b68cc-20240425"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wi.isDisabled&&wi.supportsFiber)try{Gl=wi.inject(w2),Kt=wi}catch{}}ft.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=v2;ft.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Od(t))throw Error(H(200));return g2(e,t,null,n)};ft.createRoot=function(e,t){if(!Od(e))throw Error(H(299));var n=!1,r="",s=wx;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=zd(e,1,!1,null,null,n,!1,r,s),e[mn]=t.current,So(e.nodeType===8?e.parentNode:e),new $d(t)};ft.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(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=Vp(t),e=e===null?null:e.stateNode,e};ft.flushSync=function(e){return gr(e)};ft.hydrate=function(e,t,n){if(!ia(t))throw Error(H(200));return la(null,e,t,!0,n)};ft.hydrateRoot=function(e,t,n){if(!Od(e))throw Error(H(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",i=wx;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=vx(t,null,e,1,n??null,s,!1,o,i),e[mn]=t.current,So(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new oa(t)};ft.render=function(e,t,n){if(!ia(t))throw Error(H(200));return la(null,e,t,!1,n)};ft.unmountComponentAtNode=function(e){if(!ia(e))throw Error(H(40));return e._reactRootContainer?(gr(function(){la(null,null,e,!1,function(){e._reactRootContainer=null,e[mn]=null})}),!0):!1};ft.unstable_batchedUpdates=Rd;ft.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ia(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return la(e,t,n,!1,r)};ft.version="18.3.0-next-8a015b68cc-20240425";function Nx(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Nx)}catch(e){console.error(e)}}Nx(),Np.exports=ft;var aa=Np.exports;const N2=Wc(aa);var Hh=aa;Eu.createRoot=Hh.createRoot,Eu.hydrateRoot=Hh.hydrateRoot;/**
41
+ * react-router v7.1.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 Vh="popstate";function S2(e={}){function t(r,s){let{pathname:o,search:i,hash:l}=r.location;return wc("",{pathname:o,search:i,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Io(s)}return k2(t,n,null,e)}function ye(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function bt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function b2(){return Math.random().toString(36).substring(2,10)}function Bh(e,t){return{usr:e.state,key:e.key,idx:t}}function wc(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?bs(t):t,state:n,key:t&&t.key||r||b2()}}function Io({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function bs(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function k2(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:o=!1}=r,i=s.history,l="POP",u=null,c=h();c==null&&(c=0,i.replaceState({...i.state,idx:c},""));function h(){return(i.state||{idx:null}).idx}function d(){l="POP";let S=h(),m=S==null?null:S-c;c=S,u&&u({action:l,location:w.location,delta:m})}function f(S,m){l="PUSH";let v=wc(w.location,S,m);c=h()+1;let g=Bh(v,c),N=w.createHref(v);try{i.pushState(g,"",N)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;s.location.assign(N)}o&&u&&u({action:l,location:w.location,delta:1})}function x(S,m){l="REPLACE";let v=wc(w.location,S,m);c=h();let g=Bh(v,c),N=w.createHref(v);i.replaceState(g,"",N),o&&u&&u({action:l,location:w.location,delta:0})}function y(S){let m=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof S=="string"?S:Io(S);return v=v.replace(/ $/,"%20"),ye(m,`No window.location.(origin|href) available to create URL for href: ${v}`),new URL(v,m)}let w={get action(){return l},get location(){return e(s,i)},listen(S){if(u)throw new Error("A history only accepts one active listener");return s.addEventListener(Vh,d),u=S,()=>{s.removeEventListener(Vh,d),u=null}},createHref(S){return t(s,S)},createURL:y,encodeLocation(S){let m=y(S);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:f,replace:x,go(S){return i.go(S)}};return w}function Sx(e,t,n="/"){return j2(e,t,n,!1)}function j2(e,t,n,r){let s=typeof t=="string"?bs(t):t,o=Wn(s.pathname||"/",n);if(o==null)return null;let i=bx(e);C2(i);let l=null;for(let u=0;l==null&&u<i.length;++u){let c=D2(o);l=A2(i[u],c,r)}return l}function bx(e,t=[],n=[],r=""){let s=(o,i,l)=>{let u={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};u.relativePath.startsWith("/")&&(ye(u.relativePath.startsWith(r),`Absolute route path "${u.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),u.relativePath=u.relativePath.slice(r.length));let c=fn([r,u.relativePath]),h=n.concat(u);o.children&&o.children.length>0&&(ye(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),bx(o.children,t,h,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:T2(c,o.index),routesMeta:h})};return e.forEach((o,i)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))s(o,i);else for(let u of kx(o.path))s(o,i,u)}),t}function kx(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let i=kx(r.join("/")),l=[];return l.push(...i.map(u=>u===""?o:[o,u].join("/"))),s&&l.push(...i),l.map(u=>e.startsWith("/")&&u===""?"/":u)}function C2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:L2(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var E2=/^:[\w-]+$/,_2=3,P2=2,M2=1,I2=10,R2=-2,Uh=e=>e==="*";function T2(e,t){let n=e.split("/"),r=n.length;return n.some(Uh)&&(r+=R2),t&&(r+=P2),n.filter(s=>!Uh(s)).reduce((s,o)=>s+(E2.test(o)?_2:o===""?M2:I2),r)}function L2(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function A2(e,t,n=!1){let{routesMeta:r}=e,s={},o="/",i=[];for(let l=0;l<r.length;++l){let u=r[l],c=l===r.length-1,h=o==="/"?t:t.slice(o.length)||"/",d=Ml({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},h),f=u.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Ml({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},h)),!d)return null;Object.assign(s,d.params),i.push({params:s,pathname:fn([o,d.pathname]),pathnameBase:H2(fn([o,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(o=fn([o,d.pathnameBase]))}return i}function Ml(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=z2(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],i=o.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:r.reduce((c,{paramName:h,isOptional:d},f)=>{if(h==="*"){let y=l[f]||"";i=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const x=l[f];return d&&!x?c[h]=void 0:c[h]=(x||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:i,pattern:e}}function z2(e,t=!1,n=!0){bt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,u)=>(r.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function D2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return bt(!1,`The URL path "${e}" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Wn(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function $2(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?bs(e):e;return{pathname:n?n.startsWith("/")?n:O2(n,t):t,search:V2(r),hash:B2(s)}}function O2(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function iu(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function F2(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Fd(e){let t=F2(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Hd(e,t,n,r=!1){let s;typeof e=="string"?s=bs(e):(s={...e},ye(!s.pathname||!s.pathname.includes("?"),iu("?","pathname","search",s)),ye(!s.pathname||!s.pathname.includes("#"),iu("#","pathname","hash",s)),ye(!s.search||!s.search.includes("#"),iu("#","search","hash",s)));let o=e===""||s.pathname==="",i=o?"/":s.pathname,l;if(i==null)l=n;else{let d=t.length-1;if(!r&&i.startsWith("..")){let f=i.split("/");for(;f[0]==="..";)f.shift(),d-=1;s.pathname=f.join("/")}l=d>=0?t[d]:"/"}let u=$2(s,l),c=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||h)&&(u.pathname+="/"),u}var fn=e=>e.join("/").replace(/\/\/+/g,"/"),H2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),V2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,B2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function U2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var jx=["POST","PUT","PATCH","DELETE"];new Set(jx);var W2=["GET",...jx];new Set(W2);var ks=p.createContext(null);ks.displayName="DataRouter";var ua=p.createContext(null);ua.displayName="DataRouterState";var Cx=p.createContext({isTransitioning:!1});Cx.displayName="ViewTransition";var Y2=p.createContext(new Map);Y2.displayName="Fetchers";var G2=p.createContext(null);G2.displayName="Await";var Ot=p.createContext(null);Ot.displayName="Navigation";var Go=p.createContext(null);Go.displayName="Location";var kt=p.createContext({outlet:null,matches:[],isDataRoute:!1});kt.displayName="Route";var Vd=p.createContext(null);Vd.displayName="RouteError";function K2(e,{relative:t}={}){ye(js(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=p.useContext(Ot),{hash:s,pathname:o,search:i}=Ko(e,{relative:t}),l=o;return n!=="/"&&(l=o==="/"?n:fn([n,o])),r.createHref({pathname:l,search:i,hash:s})}function js(){return p.useContext(Go)!=null}function en(){return ye(js(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(Go).location}var Ex="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function _x(e){p.useContext(Ot).static||p.useLayoutEffect(e)}function ca(){let{isDataRoute:e}=p.useContext(kt);return e?cS():X2()}function X2(){ye(js(),"useNavigate() may be used only in the context of a <Router> component.");let e=p.useContext(ks),{basename:t,navigator:n}=p.useContext(Ot),{matches:r}=p.useContext(kt),{pathname:s}=en(),o=JSON.stringify(Fd(r)),i=p.useRef(!1);return _x(()=>{i.current=!0}),p.useCallback((u,c={})=>{if(bt(i.current,Ex),!i.current)return;if(typeof u=="number"){n.go(u);return}let h=Hd(u,JSON.parse(o),s,c.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:fn([t,h.pathname])),(c.replace?n.replace:n.push)(h,c.state,c)},[t,n,o,s,e])}var Q2=p.createContext(null);function q2(e){let t=p.useContext(kt).outlet;return t&&p.createElement(Q2.Provider,{value:e},t)}function Z2(){let{matches:e}=p.useContext(kt),t=e[e.length-1];return t?t.params:{}}function Ko(e,{relative:t}={}){let{matches:n}=p.useContext(kt),{pathname:r}=en(),s=JSON.stringify(Fd(n));return p.useMemo(()=>Hd(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function J2(e,t){return Px(e,t)}function Px(e,t,n,r){var m;ye(js(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=p.useContext(Ot),{matches:o}=p.useContext(kt),i=o[o.length-1],l=i?i.params:{},u=i?i.pathname:"/",c=i?i.pathnameBase:"/",h=i&&i.route;{let v=h&&h.path||"";Mx(u,!h||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${v}">) 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="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let d=en(),f;if(t){let v=typeof t=="string"?bs(t):t;ye(c==="/"||((m=v.pathname)==null?void 0:m.startsWith(c)),`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 "${c}" but pathname "${v.pathname}" was given in the \`location\` prop.`),f=v}else f=d;let x=f.pathname||"/",y=x;if(c!=="/"){let v=c.replace(/^\//,"").split("/");y="/"+x.replace(/^\//,"").split("/").slice(v.length).join("/")}let w=Sx(e,{pathname:y});bt(h||w!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),bt(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.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 S=sS(w&&w.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:fn([c,s.encodeLocation?s.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:fn([c,s.encodeLocation?s.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),o,n,r);return t&&S?p.createElement(Go.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:"POP"}},S):S}function eS(){let e=uS(),t=U2(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=p.createElement(p.Fragment,null,p.createElement("p",null,"💿 Hey developer 👋"),p.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",p.createElement("code",{style:o},"ErrorBoundary")," or"," ",p.createElement("code",{style:o},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:s},n):null,i)}var tS=p.createElement(eS,null),nS=class extends p.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?p.createElement(kt.Provider,{value:this.props.routeContext},p.createElement(Vd.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function rS({routeContext:e,match:t,children:n}){let r=p.useContext(ks);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),p.createElement(kt.Provider,{value:e},n)}function sS(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,o=n==null?void 0:n.errors;if(o!=null){let u=s.findIndex(c=>c.route.id&&(o==null?void 0:o[c.route.id])!==void 0);ye(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),s=s.slice(0,Math.min(s.length,u+1))}let i=!1,l=-1;if(n)for(let u=0;u<s.length;u++){let c=s[u];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(l=u),c.route.id){let{loaderData:h,errors:d}=n,f=c.route.loader&&!h.hasOwnProperty(c.route.id)&&(!d||d[c.route.id]===void 0);if(c.route.lazy||f){i=!0,l>=0?s=s.slice(0,l+1):s=[s[0]];break}}}return s.reduceRight((u,c,h)=>{let d,f=!1,x=null,y=null;n&&(d=o&&c.route.id?o[c.route.id]:void 0,x=c.route.errorElement||tS,i&&(l<0&&h===0?(Mx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,y=null):l===h&&(f=!0,y=c.route.hydrateFallbackElement||null)));let w=t.concat(s.slice(0,h+1)),S=()=>{let m;return d?m=x:f?m=y:c.route.Component?m=p.createElement(c.route.Component,null):c.route.element?m=c.route.element:m=u,p.createElement(rS,{match:c,routeContext:{outlet:u,matches:w,isDataRoute:n!=null},children:m})};return n&&(c.route.ErrorBoundary||c.route.errorElement||h===0)?p.createElement(nS,{location:n.location,revalidation:n.revalidation,component:x,error:d,children:S(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):S()},null)}function Bd(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function oS(e){let t=p.useContext(ks);return ye(t,Bd(e)),t}function iS(e){let t=p.useContext(ua);return ye(t,Bd(e)),t}function lS(e){let t=p.useContext(kt);return ye(t,Bd(e)),t}function Ud(e){let t=lS(e),n=t.matches[t.matches.length-1];return ye(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function aS(){return Ud("useRouteId")}function uS(){var r;let e=p.useContext(Vd),t=iS("useRouteError"),n=Ud("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function cS(){let{router:e}=oS("useNavigate"),t=Ud("useNavigate"),n=p.useRef(!1);return _x(()=>{n.current=!0}),p.useCallback(async(s,o={})=>{bt(n.current,Ex),n.current&&(typeof s=="number"?e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var Wh={};function Mx(e,t,n){!t&&!Wh[e]&&(Wh[e]=!0,bt(!1,n))}p.memo(dS);function dS({routes:e,future:t,state:n}){return Px(e,void 0,n,t)}function Nc({to:e,replace:t,state:n,relative:r}){ye(js(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=p.useContext(Ot);bt(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=p.useContext(kt),{pathname:i}=en(),l=ca(),u=Hd(e,Fd(o),i,r==="path"),c=JSON.stringify(u);return p.useEffect(()=>{l(JSON.parse(c),{replace:t,state:n,relative:r})},[l,c,r,t,n]),null}function fS(e){return q2(e.context)}function We(e){ye(!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 hS({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:o=!1}){ye(!js(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),l=p.useMemo(()=>({basename:i,navigator:s,static:o,future:{}}),[i,s,o]);typeof n=="string"&&(n=bs(n));let{pathname:u="/",search:c="",hash:h="",state:d=null,key:f="default"}=n,x=p.useMemo(()=>{let y=Wn(u,i);return y==null?null:{location:{pathname:y,search:c,hash:h,state:d,key:f},navigationType:r}},[i,u,c,h,d,f,r]);return bt(x!=null,`<Router basename="${i}"> is not able to match the URL "${u}${c}${h}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:p.createElement(Ot.Provider,{value:l},p.createElement(Go.Provider,{children:t,value:x}))}function mS({children:e,location:t}){return J2(Sc(e),t)}function Sc(e,t=[]){let n=[];return p.Children.forEach(e,(r,s)=>{if(!p.isValidElement(r))return;let o=[...t,s];if(r.type===p.Fragment){n.push.apply(n,Sc(r.props.children,o));return}ye(r.type===We,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ye(!r.props.index||!r.props.children,"An index route cannot have child routes.");let i={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=Sc(r.props.children,o)),n.push(i)}),n}var Qi="get",qi="application/x-www-form-urlencoded";function da(e){return e!=null&&typeof e.tagName=="string"}function pS(e){return da(e)&&e.tagName.toLowerCase()==="button"}function gS(e){return da(e)&&e.tagName.toLowerCase()==="form"}function xS(e){return da(e)&&e.tagName.toLowerCase()==="input"}function yS(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function vS(e,t){return e.button===0&&(!t||t==="_self")&&!yS(e)}function bc(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function wS(e,t){let n=bc(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}var Ni=null;function NS(){if(Ni===null)try{new FormData(document.createElement("form"),0),Ni=!1}catch{Ni=!0}return Ni}var SS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function lu(e){return e!=null&&!SS.has(e)?(bt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${qi}"`),null):e}function bS(e,t){let n,r,s,o,i;if(gS(e)){let l=e.getAttribute("action");r=l?Wn(l,t):null,n=e.getAttribute("method")||Qi,s=lu(e.getAttribute("enctype"))||qi,o=new FormData(e)}else if(pS(e)||xS(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||l.getAttribute("action");if(r=u?Wn(u,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||Qi,s=lu(e.getAttribute("formenctype"))||lu(l.getAttribute("enctype"))||qi,o=new FormData(l,e),!NS()){let{name:c,type:h,value:d}=e;if(h==="image"){let f=c?`${c}.`:"";o.append(`${f}x`,"0"),o.append(`${f}y`,"0")}else c&&o.append(c,d)}}else{if(da(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Qi,r=null,s=qi,i=e}return o&&s==="text/plain"&&(i=o,o=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:o,body:i}}function Wd(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function kS(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function jS(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function CS(e,t,n){let r=await Promise.all(e.map(async s=>{let o=t.routes[s.route.id];if(o){let i=await kS(o,n);return i.links?i.links():[]}return[]}));return MS(r.flat(1).filter(jS).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Yh(e,t,n,r,s,o){let i=(u,c)=>n[c]?u.route.id!==n[c].route.id:!0,l=(u,c)=>{var h;return n[c].pathname!==u.pathname||((h=n[c].route.path)==null?void 0:h.endsWith("*"))&&n[c].params["*"]!==u.params["*"]};return o==="assets"?t.filter((u,c)=>i(u,c)||l(u,c)):o==="data"?t.filter((u,c)=>{var d;let h=r.routes[u.route.id];if(!h||!h.hasLoader)return!1;if(i(u,c)||l(u,c))return!0;if(u.route.shouldRevalidate){let f=u.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((d=n[0])==null?void 0:d.params)||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function ES(e,t){return _S(e.map(n=>{let r=t.routes[n.route.id];if(!r)return[];let s=[r.module];return r.imports&&(s=s.concat(r.imports)),s}).flat(1))}function _S(e){return[...new Set(e)]}function PS(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function MS(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let o=JSON.stringify(PS(s));return n.has(o)||(n.add(o),r.push({key:o,link:s})),r},[])}function IS(e){let t=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return t.pathname==="/"?t.pathname="_root.data":t.pathname=`${t.pathname.replace(/\/$/,"")}.data`,t}function RS(){let e=p.useContext(ks);return Wd(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function TS(){let e=p.useContext(ua);return Wd(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Yd=p.createContext(void 0);Yd.displayName="FrameworkContext";function Ix(){let e=p.useContext(Yd);return Wd(e,"You must render this element inside a <HydratedRouter> element"),e}function LS(e,t){let n=p.useContext(Yd),[r,s]=p.useState(!1),[o,i]=p.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:c,onMouseLeave:h,onTouchStart:d}=t,f=p.useRef(null);p.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let w=m=>{m.forEach(v=>{i(v.isIntersecting)})},S=new IntersectionObserver(w,{threshold:.5});return f.current&&S.observe(f.current),()=>{S.disconnect()}}},[e]),p.useEffect(()=>{if(r){let w=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(w)}}},[r]);let x=()=>{s(!0)},y=()=>{s(!1),i(!1)};return n?e!=="intent"?[o,f,{}]:[o,f,{onFocus:Bs(l,x),onBlur:Bs(u,y),onMouseEnter:Bs(c,x),onMouseLeave:Bs(h,y),onTouchStart:Bs(d,x)}]:[!1,f,{}]}function Bs(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function AS({page:e,...t}){let{router:n}=RS(),r=p.useMemo(()=>Sx(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?p.createElement(DS,{page:e,matches:r,...t}):null}function zS(e){let{manifest:t,routeModules:n}=Ix(),[r,s]=p.useState([]);return p.useEffect(()=>{let o=!1;return CS(e,t,n).then(i=>{o||s(i)}),()=>{o=!0}},[e,t,n]),r}function DS({page:e,matches:t,...n}){let r=en(),{manifest:s,routeModules:o}=Ix(),{loaderData:i,matches:l}=TS(),u=p.useMemo(()=>Yh(e,t,l,s,r,"data"),[e,t,l,s,r]),c=p.useMemo(()=>Yh(e,t,l,s,r,"assets"),[e,t,l,s,r]),h=p.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let x=new Set,y=!1;if(t.forEach(S=>{var v;let m=s.routes[S.route.id];!m||!m.hasLoader||(!u.some(g=>g.route.id===S.route.id)&&S.route.id in i&&((v=o[S.route.id])!=null&&v.shouldRevalidate)||m.hasClientLoader?y=!0:x.add(S.route.id))}),x.size===0)return[];let w=IS(e);return y&&x.size>0&&w.searchParams.set("_routes",t.filter(S=>x.has(S.route.id)).map(S=>S.route.id).join(",")),[w.pathname+w.search]},[i,r,s,u,t,e,o]),d=p.useMemo(()=>ES(c,s),[c,s]),f=zS(c);return p.createElement(p.Fragment,null,h.map(x=>p.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...n})),d.map(x=>p.createElement("link",{key:x,rel:"modulepreload",href:x,...n})),f.map(({key:x,link:y})=>p.createElement("link",{key:x,...y})))}function $S(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Rx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Rx&&(window.__reactRouterVersion="7.1.0")}catch{}function OS({basename:e,children:t,window:n}){let r=p.useRef();r.current==null&&(r.current=S2({window:n,v5Compat:!0}));let s=r.current,[o,i]=p.useState({action:s.action,location:s.location}),l=p.useCallback(u=>{p.startTransition(()=>i(u))},[i]);return p.useLayoutEffect(()=>s.listen(l),[s,l]),p.createElement(hS,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s})}var Tx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cs=p.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:o,replace:i,state:l,target:u,to:c,preventScrollReset:h,viewTransition:d,...f},x){let{basename:y}=p.useContext(Ot),w=typeof c=="string"&&Tx.test(c),S,m=!1;if(typeof c=="string"&&w&&(S=c,Rx))try{let I=new URL(window.location.href),D=c.startsWith("//")?new URL(I.protocol+c):new URL(c),T=Wn(D.pathname,y);D.origin===I.origin&&T!=null?c=T+D.search+D.hash:m=!0}catch{bt(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let v=K2(c,{relative:s}),[g,N,b]=LS(r,f),k=VS(c,{replace:i,state:l,target:u,preventScrollReset:h,relative:s,viewTransition:d});function j(I){t&&t(I),I.defaultPrevented||k(I)}let _=p.createElement("a",{...f,...b,href:S||v,onClick:m||o?t:j,ref:$S(x,N),target:u,"data-discover":!w&&n==="render"?"true":void 0});return g&&!w?p.createElement(p.Fragment,null,_,p.createElement(AS,{page:v})):_});cs.displayName="Link";var Lx=p.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:o,to:i,viewTransition:l,children:u,...c},h){let d=Ko(i,{relative:c.relative}),f=en(),x=p.useContext(ua),{navigator:y,basename:w}=p.useContext(Ot),S=x!=null&&KS(d)&&l===!0,m=y.encodeLocation?y.encodeLocation(d).pathname:d.pathname,v=f.pathname,g=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(v=v.toLowerCase(),g=g?g.toLowerCase():null,m=m.toLowerCase()),g&&w&&(g=Wn(g,w)||g);const N=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let b=v===m||!s&&v.startsWith(m)&&v.charAt(N)==="/",k=g!=null&&(g===m||!s&&g.startsWith(m)&&g.charAt(m.length)==="/"),j={isActive:b,isPending:k,isTransitioning:S},_=b?t:void 0,I;typeof r=="function"?I=r(j):I=[r,b?"active":null,k?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let D=typeof o=="function"?o(j):o;return p.createElement(cs,{...c,"aria-current":_,className:I,ref:h,style:D,to:i,viewTransition:l},typeof u=="function"?u(j):u)});Lx.displayName="NavLink";var FS=p.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:o,method:i=Qi,action:l,onSubmit:u,relative:c,preventScrollReset:h,viewTransition:d,...f},x)=>{let y=YS(),w=GS(l,{relative:c}),S=i.toLowerCase()==="get"?"get":"post",m=typeof l=="string"&&Tx.test(l),v=g=>{if(u&&u(g),g.defaultPrevented)return;g.preventDefault();let N=g.nativeEvent.submitter,b=(N==null?void 0:N.getAttribute("formmethod"))||i;y(N||g.currentTarget,{fetcherKey:t,method:b,navigate:n,replace:s,state:o,relative:c,preventScrollReset:h,viewTransition:d})};return p.createElement("form",{ref:x,method:S,action:w,onSubmit:r?u:v,...f,"data-discover":!m&&e==="render"?"true":void 0})});FS.displayName="Form";function HS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ax(e){let t=p.useContext(ks);return ye(t,HS(e)),t}function VS(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:o,viewTransition:i}={}){let l=ca(),u=en(),c=Ko(e,{relative:o});return p.useCallback(h=>{if(vS(h,t)){h.preventDefault();let d=n!==void 0?n:Io(u)===Io(c);l(e,{replace:d,state:r,preventScrollReset:s,relative:o,viewTransition:i})}},[u,l,c,n,r,t,e,s,o,i])}function BS(e){bt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=p.useRef(bc(e)),n=p.useRef(!1),r=en(),s=p.useMemo(()=>wS(r.search,n.current?null:t.current),[r.search]),o=ca(),i=p.useCallback((l,u)=>{const c=bc(typeof l=="function"?l(s):l);n.current=!0,o("?"+c,u)},[o,s]);return[s,i]}var US=0,WS=()=>`__${String(++US)}__`;function YS(){let{router:e}=Ax("useSubmit"),{basename:t}=p.useContext(Ot),n=aS();return p.useCallback(async(r,s={})=>{let{action:o,method:i,encType:l,formData:u,body:c}=bS(r,t);if(s.navigate===!1){let h=s.fetcherKey||WS();await e.fetch(h,n,s.action||o,{preventScrollReset:s.preventScrollReset,formData:u,body:c,formMethod:s.method||i,formEncType:s.encType||l,flushSync:s.flushSync})}else await e.navigate(s.action||o,{preventScrollReset:s.preventScrollReset,formData:u,body:c,formMethod:s.method||i,formEncType:s.encType||l,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[e,t,n])}function GS(e,{relative:t}={}){let{basename:n}=p.useContext(Ot),r=p.useContext(kt);ye(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),o={...Ko(e||".",{relative:t})},i=en();if(e==null){o.search=i.search;let l=new URLSearchParams(o.search),u=l.getAll("index");if(u.some(h=>h==="")){l.delete("index"),u.filter(d=>d).forEach(d=>l.append("index",d));let h=l.toString();o.search=h?`?${h}`:""}}return(!e||e===".")&&s.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:fn([n,o.pathname])),Io(o)}function KS(e,t={}){let n=p.useContext(Cx);ye(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Ax("useViewTransitionState"),s=Ko(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=Wn(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Wn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ml(s.pathname,i)!=null||Ml(s.pathname,o)!=null}new TextEncoder;const zx=p.createContext(null);function XS({children:e}){const[t,n]=p.useState(()=>localStorage.getItem("opentrust_theme")||"dark"),r=s=>{n(s),localStorage.setItem("opentrust_theme",s)};return p.useEffect(()=>{const s=document.documentElement;if(s.classList.remove("light","dark"),t==="system"){const o=window.matchMedia("(prefers-color-scheme: dark)").matches;s.classList.add(o?"dark":"light")}else s.classList.add(t)},[t]),a.jsx(zx.Provider,{value:{theme:t,setTheme:r},children:e})}function QS(){const e=p.useContext(zx);if(!e)throw new Error("useTheme must be within ThemeProvider");return e}const qS={email:"dev@localhost",apiKey:"sk-og-dev"},Dx=p.createContext(null);function ZS({children:e}){const[t,n]=p.useState(()=>{const l=localStorage.getItem("opentrust_user");return l?JSON.parse(l):null}),[r,s]=p.useState(!localStorage.getItem("opentrust_user"));p.useEffect(()=>{if(t){s(!1);return}let l=!1;return(async()=>{try{const u=await fetch("/api/auth/config");if(!u.ok)return;const c=await u.json();!l&&c.devMode&&n(qS)}catch{}finally{l||s(!1)}})(),()=>{l=!0}},[t]);const o=p.useCallback(async(l,u)=>{const c=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:l,apiKey:u})});if(!c.ok)throw new Error("Login failed");const h=await c.json();if(!h.success)throw new Error(h.error??"Login failed");const d={email:l,apiKey:u};n(d),localStorage.setItem("opentrust_user",JSON.stringify(d))},[]),i=p.useCallback(()=>{n(null),localStorage.removeItem("opentrust_user")},[]);return a.jsx(Dx.Provider,{value:{user:t,isAuthenticated:!!t,isLoading:r,login:o,logout:i},children:e})}function Gd(){const e=p.useContext(Dx);if(!e)throw new Error("useAuth must be within AuthProvider");return e}function $x(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=$x(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function JS(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=$x(e))&&(r&&(r+=" "),r+=t);return r}const Kd="-";function eb(e){const t=nb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function s(i){const l=i.split(Kd);return l[0]===""&&l.length!==1&&l.shift(),Ox(l,t)||tb(i)}function o(i,l){const u=n[i]||[];return l&&r[i]?[...u,...r[i]]:u}return{getClassGroupId:s,getConflictingClassGroupIds:o}}function Ox(e,t){var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Ox(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(Kd);return(i=t.validators.find(({validator:l})=>l(o)))==null?void 0:i.classGroupId}const Gh=/^\[(.+)\]$/;function tb(e){if(Gh.test(e)){const t=Gh.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function nb(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return sb(Object.entries(e.classGroups),n).forEach(([o,i])=>{kc(i,r,o,t)}),r}function kc(e,t,n,r){e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:Kh(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(rb(s)){kc(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,i])=>{kc(i,Kh(t,o),n,r)})})}function Kh(e,t){let n=e;return t.split(Kd).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function rb(e){return e.isThemeGetter}function sb(e,t){return t?e.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([i,l])=>[t+i,l])):o);return[n,s]}):e}function ob(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function s(o,i){n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)}return{get(o){let i=n.get(o);if(i!==void 0)return i;if((i=r.get(o))!==void 0)return s(o,i),i},set(o,i){n.has(o)?n.set(o,i):s(o,i)}}}const Fx="!";function ib(e){const t=e.separator,n=t.length===1,r=t[0],s=t.length;return function(i){const l=[];let u=0,c=0,h;for(let w=0;w<i.length;w++){let S=i[w];if(u===0){if(S===r&&(n||i.slice(w,w+s)===t)){l.push(i.slice(c,w)),c=w+s;continue}if(S==="/"){h=w;continue}}S==="["?u++:S==="]"&&u--}const d=l.length===0?i:i.substring(c),f=d.startsWith(Fx),x=f?d.substring(1):d,y=h&&h>c?h-c:void 0;return{modifiers:l,hasImportantModifier:f,baseClassName:x,maybePostfixModifierPosition:y}}}function lb(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function ab(e){return{cache:ob(e.cacheSize),splitModifiers:ib(e),...eb(e)}}const ub=/\s+/;function cb(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=new Set;return e.trim().split(ub).map(i=>{const{modifiers:l,hasImportantModifier:u,baseClassName:c,maybePostfixModifierPosition:h}=n(i);let d=r(h?c.substring(0,h):c),f=!!h;if(!d){if(!h)return{isTailwindClass:!1,originalClassName:i};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:i};f=!1}const x=lb(l).join(":");return{isTailwindClass:!0,modifierId:u?x+Fx:x,classGroupId:d,originalClassName:i,hasPostfixModifier:f}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:l,classGroupId:u,hasPostfixModifier:c}=i,h=l+u;return o.has(h)?!1:(o.add(h),s(u,c).forEach(d=>o.add(l+d)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function db(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Hx(t))&&(r&&(r+=" "),r+=n);return r}function Hx(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Hx(e[r]))&&(n&&(n+=" "),n+=t);return n}function fb(e,...t){let n,r,s,o=i;function i(u){const c=t.reduce((h,d)=>d(h),e());return n=ab(c),r=n.cache.get,s=n.cache.set,o=l,l(u)}function l(u){const c=r(u);if(c)return c;const h=cb(u,n);return s(u,h),h}return function(){return o(db.apply(null,arguments))}}function me(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const Vx=/^\[(?:([a-z-]+):)?(.+)\]$/i,hb=/^\d+\/\d+$/,mb=new Set(["px","full","screen"]),pb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gb=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,xb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,yb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function rn(e){return or(e)||mb.has(e)||hb.test(e)}function Sn(e){return Cs(e,"length",Eb)}function or(e){return!!e&&!Number.isNaN(Number(e))}function Si(e){return Cs(e,"number",or)}function Us(e){return!!e&&Number.isInteger(Number(e))}function wb(e){return e.endsWith("%")&&or(e.slice(0,-1))}function ne(e){return Vx.test(e)}function bn(e){return pb.test(e)}const Nb=new Set(["length","size","percentage"]);function Sb(e){return Cs(e,Nb,Bx)}function bb(e){return Cs(e,"position",Bx)}const kb=new Set(["image","url"]);function jb(e){return Cs(e,kb,Pb)}function Cb(e){return Cs(e,"",_b)}function Ws(){return!0}function Cs(e,t,n){const r=Vx.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function Eb(e){return gb.test(e)&&!xb.test(e)}function Bx(){return!1}function _b(e){return yb.test(e)}function Pb(e){return vb.test(e)}function Mb(){const e=me("colors"),t=me("spacing"),n=me("blur"),r=me("brightness"),s=me("borderColor"),o=me("borderRadius"),i=me("borderSpacing"),l=me("borderWidth"),u=me("contrast"),c=me("grayscale"),h=me("hueRotate"),d=me("invert"),f=me("gap"),x=me("gradientColorStops"),y=me("gradientColorStopPositions"),w=me("inset"),S=me("margin"),m=me("opacity"),v=me("padding"),g=me("saturate"),N=me("scale"),b=me("sepia"),k=me("skew"),j=me("space"),_=me("translate"),I=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto",ne,t],R=()=>[ne,t],F=()=>["",rn,Sn],E=()=>["auto",or,ne],A=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],C=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",ne],L=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>[or,Si],$=()=>[or,ne];return{cacheSize:500,separator:":",theme:{colors:[Ws],spacing:[rn,Sn],blur:["none","",bn,ne],brightness:O(),borderColor:[e],borderRadius:["none","","full",bn,ne],borderSpacing:R(),borderWidth:F(),contrast:O(),grayscale:P(),hueRotate:$(),invert:P(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[wb,Sn],inset:T(),margin:T(),opacity:O(),padding:R(),saturate:O(),scale:O(),sepia:P(),skew:$(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",ne]}],container:["container"],columns:[{columns:[bn]}],"break-after":[{"break-after":L()}],"break-before":[{"break-before":L()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...A(),ne]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Us,ne]}],basis:[{basis:T()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ne]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",Us,ne]}],"grid-cols":[{"grid-cols":[Ws]}],"col-start-end":[{col:["auto",{span:["full",Us,ne]},ne]}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":[Ws]}],"row-start-end":[{row:["auto",{span:[Us,ne]},ne]}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ne]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ne]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...C()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...C(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...C(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[S]}],mx:[{mx:[S]}],my:[{my:[S]}],ms:[{ms:[S]}],me:[{me:[S]}],mt:[{mt:[S]}],mr:[{mr:[S]}],mb:[{mb:[S]}],ml:[{ml:[S]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ne,t]}],"min-w":[{"min-w":[ne,t,"min","max","fit"]}],"max-w":[{"max-w":[ne,t,"none","full","min","max","fit","prose",{screen:[bn]},bn]}],h:[{h:[ne,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ne,t,"auto","min","max","fit"]}],"font-size":[{text:["base",bn,Sn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Si]}],"font-family":[{font:[Ws]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ne]}],"line-clamp":[{"line-clamp":["none",or,Si]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",rn,ne]}],"list-image":[{"list-image":["none",ne]}],"list-style-type":[{list:["none","disc","decimal",ne]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",rn,Sn]}],"underline-offset":[{"underline-offset":["auto",rn,ne]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...A(),bb]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Sb]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},jb]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...M(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:M()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...M()]}],"outline-offset":[{"outline-offset":[rn,ne]}],"outline-w":[{outline:[rn,Sn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[rn,Sn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",bn,Cb]}],"shadow-color":[{shadow:[Ws]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",bn,ne]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[d]}],saturate:[{saturate:[g]}],sepia:[{sepia:[b]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[g]}],"backdrop-sepia":[{"backdrop-sepia":[b]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ne]}],duration:[{duration:$()}],ease:[{ease:["linear","in","out","in-out",ne]}],delay:[{delay:$()}],animate:[{animate:["none","spin","ping","pulse","bounce",ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[Us,ne]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ne]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ne]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ne]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[rn,Sn,Si]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const Ib=fb(Mb);function _e(...e){return Ib(JS(e))}/**
52
+ * @license lucide-react v0.400.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 Rb=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ux=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
57
+ * @license lucide-react v0.400.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
+ */var Tb={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"};/**
62
+ * @license lucide-react v0.400.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 Lb=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...l},u)=>p.createElement("svg",{ref:u,...Tb,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ux("lucide",s),...l},[...i.map(([c,h])=>p.createElement(c,h)),...Array.isArray(o)?o:[o]]));/**
67
+ * @license lucide-react v0.400.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 ee=(e,t)=>{const n=p.forwardRef(({className:r,...s},o)=>p.createElement(Lb,{ref:o,iconNode:t,className:Ux(`lucide-${Rb(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
72
+ * @license lucide-react v0.400.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
+ */const Ab=ee("Activity",[["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"}]]);/**
77
+ * @license lucide-react v0.400.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 zb=ee("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
82
+ * @license lucide-react v0.400.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 Db=ee("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
87
+ * @license lucide-react v0.400.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 $b=ee("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
92
+ * @license lucide-react v0.400.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 fa=ee("Bot",[["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"}]]);/**
97
+ * @license lucide-react v0.400.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 ha=ee("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
102
+ * @license lucide-react v0.400.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 Xd=ee("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
107
+ * @license lucide-react v0.400.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 Ob=ee("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
112
+ * @license lucide-react v0.400.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 Wx=ee("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
117
+ * @license lucide-react v0.400.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 Yx=ee("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
122
+ * @license lucide-react v0.400.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 xr=ee("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
127
+ * @license lucide-react v0.400.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 zt=ee("CircleX",[["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"}]]);/**
132
+ * @license lucide-react v0.400.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 Fb=ee("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
137
+ * @license lucide-react v0.400.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 Hb=ee("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
142
+ * @license lucide-react v0.400.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 Vb=ee("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
147
+ * @license lucide-react v0.400.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 Yn=ee("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
152
+ * @license lucide-react v0.400.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 Bb=ee("ExternalLink",[["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"}]]);/**
157
+ * @license lucide-react v0.400.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 Es=ee("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
162
+ * @license lucide-react v0.400.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 Gx=ee("Fingerprint",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]);/**
167
+ * @license lucide-react v0.400.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 Kx=ee("Globe",[["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"}]]);/**
172
+ * @license lucide-react v0.400.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 Ub=ee("KeyRound",[["path",{d:"M2 18v3c0 .6.4 1 1 1h4v-3h3v-3h2l1.4-1.4a6.5 6.5 0 1 0-4-4Z",key:"167ctg"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
177
+ * @license lucide-react v0.400.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 Wb=ee("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
182
+ * @license lucide-react v0.400.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 Dt=ee("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
187
+ * @license lucide-react v0.400.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 Yb=ee("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
192
+ * @license lucide-react v0.400.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 Xx=ee("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
197
+ * @license lucide-react v0.400.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 Gb=ee("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
202
+ * @license lucide-react v0.400.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 Kb=ee("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/**
207
+ * @license lucide-react v0.400.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 ur=ee("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["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"}]]);/**
212
+ * @license lucide-react v0.400.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 Xb=ee("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
217
+ * @license lucide-react v0.400.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 Il=ee("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
222
+ * @license lucide-react v0.400.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 Zi=ee("Puzzle",[["path",{d:"M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.501 2.501 0 1 0-3.214 3.214c.446.166.855.497.925.968a.979.979 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.705.707 2.402 2.402 0 0 1-1.704-.706l-1.568-1.568a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.02.968a2.5 2.5 0 1 1-3.237-3.237c.464-.18.894-.527.967-1.02a1.026 1.026 0 0 0-.289-.877l-1.568-1.568A2.402 2.402 0 0 1 1.998 12c0-.617.236-1.234.706-1.704L4.23 8.77c.24-.24.581-.353.917-.303.515.077.877.528 1.073 1.01a2.5 2.5 0 1 0 3.259-3.259c-.482-.196-.933-.558-1.01-1.073-.05-.336.062-.676.303-.917l1.525-1.525A2.402 2.402 0 0 1 12 1.998c.617 0 1.234.236 1.704.706l1.568 1.568c.23.23.556.338.877.29.493-.074.84-.504 1.02-.968a2.5 2.5 0 1 1 3.237 3.237c-.464.18-.894.527-.967 1.02Z",key:"i0oyt7"}]]);/**
227
+ * @license lucide-react v0.400.0 - ISC
228
+ *
229
+ * This source code is licensed under the ISC license.
230
+ * See the LICENSE file in the root directory of this source tree.
231
+ */const Gn=ee("RefreshCw",[["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"}]]);/**
232
+ * @license lucide-react v0.400.0 - ISC
233
+ *
234
+ * This source code is licensed under the ISC license.
235
+ * See the LICENSE file in the root directory of this source tree.
236
+ */const jc=ee("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
237
+ * @license lucide-react v0.400.0 - ISC
238
+ *
239
+ * This source code is licensed under the ISC license.
240
+ * See the LICENSE file in the root directory of this source tree.
241
+ */const Qb=ee("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
242
+ * @license lucide-react v0.400.0 - ISC
243
+ *
244
+ * This source code is licensed under the ISC license.
245
+ * See the LICENSE file in the root directory of this source tree.
246
+ */const qb=ee("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
247
+ * @license lucide-react v0.400.0 - ISC
248
+ *
249
+ * This source code is licensed under the ISC license.
250
+ * See the LICENSE file in the root directory of this source tree.
251
+ */const Qx=ee("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
252
+ * @license lucide-react v0.400.0 - ISC
253
+ *
254
+ * This source code is licensed under the ISC license.
255
+ * See the LICENSE file in the root directory of this source tree.
256
+ */const Qd=ee("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
257
+ * @license lucide-react v0.400.0 - ISC
258
+ *
259
+ * This source code is licensed under the ISC license.
260
+ * See the LICENSE file in the root directory of this source tree.
261
+ */const qt=ee("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
262
+ * @license lucide-react v0.400.0 - ISC
263
+ *
264
+ * This source code is licensed under the ISC license.
265
+ * See the LICENSE file in the root directory of this source tree.
266
+ */const Zb=ee("Shield",[["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"}]]);/**
267
+ * @license lucide-react v0.400.0 - ISC
268
+ *
269
+ * This source code is licensed under the ISC license.
270
+ * See the LICENSE file in the root directory of this source tree.
271
+ */const Cc=ee("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
272
+ * @license lucide-react v0.400.0 - ISC
273
+ *
274
+ * This source code is licensed under the ISC license.
275
+ * See the LICENSE file in the root directory of this source tree.
276
+ */const Jb=ee("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
277
+ * @license lucide-react v0.400.0 - ISC
278
+ *
279
+ * This source code is licensed under the ISC license.
280
+ * See the LICENSE file in the root directory of this source tree.
281
+ */const Ro=ee("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
282
+ * @license lucide-react v0.400.0 - ISC
283
+ *
284
+ * This source code is licensed under the ISC license.
285
+ * See the LICENSE file in the root directory of this source tree.
286
+ */const $t=ee("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
287
+ * @license lucide-react v0.400.0 - ISC
288
+ *
289
+ * This source code is licensed under the ISC license.
290
+ * See the LICENSE file in the root directory of this source tree.
291
+ */const qx=ee("TriangleAlert",[["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"}]]);/**
292
+ * @license lucide-react v0.400.0 - ISC
293
+ *
294
+ * This source code is licensed under the ISC license.
295
+ * See the LICENSE file in the root directory of this source tree.
296
+ */const Zx=ee("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
297
+ * @license lucide-react v0.400.0 - ISC
298
+ *
299
+ * This source code is licensed under the ISC license.
300
+ * See the LICENSE file in the root directory of this source tree.
301
+ */const ek=ee("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),tk=[{label:"Discovery",items:[{to:"/inventory/agents",label:"Agents",icon:fa},{to:"/inventory/identities",label:"Identities",icon:Gx},{to:"/inventory/permissions",label:"Permissions",icon:Ub}]},{label:"Secure",items:[{to:"/secure/risk",label:"Risk",icon:qx},{to:"/secure/graph",label:"Graph",icon:Kb}]},{label:"Operations",items:[{to:"/ops/skills",label:"Skills",icon:Zx},{to:"/ops/plugins",label:"Plugins",icon:Zi}]},{label:"System",items:[{to:"/system/hosts",label:"Hosts",icon:Xx},{to:"/system/logs",label:"Logs",icon:qb},{to:"/system/settings",label:"Settings",icon:qt}]}];function nk(){const e=en(),[t,n]=p.useState("");return p.useEffect(()=>{fetch("/health").then(r=>r.json()).then(r=>n(r.version??"")).catch(()=>{})},[]),a.jsxs("aside",{className:"flex w-56 flex-col border-r border-border bg-card",children:[a.jsxs("div",{className:"flex h-14 items-center gap-2 border-b border-border px-4",children:[a.jsx("img",{src:"/dashboard/logo-512.png",alt:"OpenTrust",className:"h-6 w-6 dark:brightness-[1.8] dark:contrast-125"}),a.jsx("span",{className:"text-sm font-semibold tracking-tight text-foreground",children:"OpenTrust"})]}),a.jsx("nav",{className:"flex-1 space-y-6 px-3 py-4",children:tk.map(r=>a.jsxs("div",{children:[a.jsx("p",{className:"mb-2 px-2 text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:r.label}),a.jsx("div",{className:"space-y-0.5",children:r.items.map(s=>a.jsxs(Lx,{to:s.to,className:_e("flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm transition-colors",e.pathname.startsWith(s.to)?"bg-accent text-accent-foreground font-medium":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:[a.jsx(s.icon,{className:"h-4 w-4 shrink-0"}),s.label]},s.to))})]},r.label))}),a.jsx("div",{className:"border-t border-border px-4 py-3",children:a.jsx("p",{className:"text-[11px] text-muted-foreground",children:t?`v${t}`:""})})]})}function rk(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Jx(...e){return t=>e.forEach(n=>rk(n,t))}function Zt(...e){return p.useCallback(Jx(...e),e)}var ds=p.forwardRef((e,t)=>{const{children:n,...r}=e,s=p.Children.toArray(n),o=s.find(ok);if(o){const i=o.props.children,l=s.map(u=>u===o?p.Children.count(i)>1?p.Children.only(null):p.isValidElement(i)?i.props.children:null:u);return a.jsx(Ec,{...r,ref:t,children:p.isValidElement(i)?p.cloneElement(i,void 0,l):null})}return a.jsx(Ec,{...r,ref:t,children:n})});ds.displayName="Slot";var Ec=p.forwardRef((e,t)=>{const{children:n,...r}=e;if(p.isValidElement(n)){const s=lk(n);return p.cloneElement(n,{...ik(r,n.props),ref:t?Jx(t,s):s})}return p.Children.count(n)>1?p.Children.only(null):null});Ec.displayName="SlotClone";var sk=({children:e})=>a.jsx(a.Fragment,{children:e});function ok(e){return p.isValidElement(e)&&e.type===sk}function ik(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...l)=>{o(...l),s(...l)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function lk(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ey(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=ey(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function ak(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=ey(e))&&(r&&(r+=" "),r+=t);return r}const Xh=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Qh=ak,uk=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Qh(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(c=>{const h=n==null?void 0:n[c],d=o==null?void 0:o[c];if(h===null)return null;const f=Xh(h)||Xh(d);return s[c][f]}),l=n&&Object.entries(n).reduce((c,h)=>{let[d,f]=h;return f===void 0||(c[d]=f),c},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,h)=>{let{class:d,className:f,...x}=h;return Object.entries(x).every(y=>{let[w,S]=y;return Array.isArray(S)?S.includes({...o,...l}[w]):{...o,...l}[w]===S})?[...c,d,f]:c},[]);return Qh(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},ck=uk("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-border bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),J=p.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},o)=>{const i=r?ds:"button";return a.jsx(i,{className:_e(ck({variant:t,size:n,className:e})),ref:o,...s})});J.displayName="Button";function dk(){const{user:e,logout:t}=Gd(),{theme:n,setTheme:r}=QS();return a.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-border bg-card px-6",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"h-2 w-2 rounded-full bg-success"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[(e==null?void 0:e.email)&&a.jsx("span",{className:"text-xs text-muted-foreground",children:e.email}),a.jsx(J,{variant:"ghost",size:"icon",onClick:()=>r(n==="dark"?"light":"dark"),className:"h-8 w-8",children:n==="dark"?a.jsx(Jb,{className:"h-4 w-4"}):a.jsx(Gb,{className:"h-4 w-4"})}),a.jsx(J,{variant:"ghost",size:"icon",onClick:t,className:"h-8 w-8",children:a.jsx(Yb,{className:"h-4 w-4"})})]})]})}function fk(){return a.jsxs("div",{className:"flex h-screen overflow-hidden bg-background",children:[a.jsx(nk,{}),a.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[a.jsx(dk,{}),a.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:a.jsx(fS,{})})]})]})}const ot=p.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:_e("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors","file:border-0 file:bg-transparent file:text-sm file:font-medium","placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));ot.displayName="Input";function hk(){const[e]=BS(),[t,n]=p.useState(e.get("email")??""),[r,s]=p.useState(e.get("key")??""),[o,i]=p.useState(""),[l,u]=p.useState(!1),{login:c,isAuthenticated:h,isLoading:d}=Gd(),f=ca();if(p.useEffect(()=>{h&&f("/inventory/agents",{replace:!0})},[h,f]),d)return a.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:a.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading..."})});const x=async y=>{y.preventDefault(),i(""),u(!0);try{await c(t,r),f("/inventory/agents",{replace:!0})}catch(w){i(w instanceof Error?w.message:"Login failed")}finally{u(!1)}};return a.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:a.jsxs("div",{className:"w-full max-w-sm space-y-8 px-4",children:[a.jsxs("div",{className:"flex flex-col items-center gap-3",children:[a.jsx("img",{src:"/dashboard/logo-512.png",alt:"OpenTrust",className:"h-12 w-12 dark:brightness-[1.8] dark:contrast-125"}),a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"text-lg font-semibold tracking-tight text-foreground",children:"OpenTrust"}),a.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Sign in to your dashboard"})]})]}),a.jsxs("form",{onSubmit:x,className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-sm font-medium text-foreground",children:"Email"}),a.jsx(ot,{type:"email",placeholder:"you@example.com",value:t,onChange:y=>n(y.target.value),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-sm font-medium text-foreground",children:"API Key"}),a.jsx(ot,{type:"password",placeholder:"sk-og-...",value:r,onChange:y=>s(y.target.value),required:!0})]}),o&&a.jsx("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:o}),a.jsx(J,{type:"submit",className:"w-full",disabled:l,children:l?"Signing in...":"Sign in"})]}),a.jsx("p",{className:"text-center text-xs text-muted-foreground",children:"API Key is generated when registering an agent with the Core API."})]})})}const mk="/api";async function de(e,t){const n=localStorage.getItem("opentrust_user"),r=n?JSON.parse(n).apiKey:null,s=await fetch(`${mk}${e}`,{...t,headers:{"Content-Type":"application/json",...r&&{Authorization:`Bearer ${r}`},...t==null?void 0:t.headers}});if(!s.ok)throw new Error(`API ${s.status}: ${await s.text()}`);return s.json()}const ue={agents:{list:()=>de("/agents"),get:e=>de(`/agents/${e}`),create:e=>de("/agents",{method:"POST",body:JSON.stringify(e)}),update:(e,t)=>de(`/agents/${e}`,{method:"PUT",body:JSON.stringify(t)}),delete:e=>de(`/agents/${e}`,{method:"DELETE"})},discovery:{agents:()=>de("/discovery/agents"),profile:e=>de(`/discovery/agents/${e}/profile`)},observations:{recent:(e=50)=>de(`/observations?limit=${e}`),permissions:()=>de("/observations/permissions"),anomalies:()=>de("/observations/anomalies"),summary:()=>de("/observations/summary"),agentPermissions:e=>de(`/observations/agents/${e}/permissions`)},commands:{list:e=>de(`/commands?agentId=${e}`),create:e=>de("/commands",{method:"POST",body:JSON.stringify(e)})},system:{services:()=>de("/system/services"),logs:(e,t=200)=>de(`/system/logs/${e}?lines=${t}`),clearLog:e=>de(`/system/logs/${e}`,{method:"DELETE"})},hosts:{list:()=>de("/hosts"),get:e=>de(`/hosts/${e}`),remove:e=>de(`/hosts/${e}`,{method:"DELETE"}),sendCommand:e=>de("/hosts/commands",{method:"POST",body:JSON.stringify(e)}),commands:(e,t=50)=>de(`/hosts/commands?hostId=${e}&limit=${t}`)},detect:e=>de("/detect",{method:"POST",body:JSON.stringify(e)}),usage:{summary:(e=30)=>de(`/usage/summary?days=${e}`),daily:(e=30)=>de(`/usage/daily?days=${e}`)},settings:{get:()=>de("/settings"),update:e=>de("/settings",{method:"PUT",body:JSON.stringify(e)})}};function be({className:e,variant:t="default",...n}){return a.jsx("div",{className:_e("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{"border-transparent bg-primary text-primary-foreground shadow":t==="default","border-transparent bg-secondary text-secondary-foreground":t==="secondary","border-transparent bg-destructive text-destructive-foreground shadow":t==="destructive","text-foreground":t==="outline","border-transparent bg-success/15 text-success":t==="success","border-transparent bg-warning/15 text-warning":t==="warning"},e),...n})}function pk(){const[e,t]=p.useState([]),[n,r]=p.useState(""),[s,o]=p.useState(!0),i=async()=>{o(!0);try{const c=await ue.discovery.agents();t(c.data??[])}catch{}o(!1)};p.useEffect(()=>{i()},[]);const l=e.filter(c=>{var h;return!n||((h=c.name)==null?void 0:h.toLowerCase().includes(n.toLowerCase()))}),u=c=>c==="active"?"success":c==="inactive"?"secondary":"warning";return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Agents"}),a.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," agent",e.length!==1?"s":""," discovered"]})]}),a.jsxs(J,{variant:"outline",size:"sm",onClick:i,children:[a.jsx(Gn,{className:"h-3.5 w-3.5"}),"Scan"]})]}),a.jsxs("div",{className:"relative max-w-sm",children:[a.jsx(Qx,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),a.jsx(ot,{placeholder:"Search agents...",className:"pl-9",value:n,onChange:c=>r(c.target.value)})]}),s?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):l.length===0?a.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border",children:[a.jsx(fa,{className:"h-8 w-8 text-muted-foreground/50"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents found"})]}):a.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:l.map(c=>{var h;return a.jsxs(cs,{to:`/inventory/agents/${c.id}`,className:"group flex flex-col gap-3 rounded-lg border border-border bg-card p-4 transition-colors hover:border-muted-foreground/30",children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("span",{className:"text-xl",children:c.emoji||"🤖"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-foreground group-hover:text-foreground",children:c.name}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:[c.provider||"unknown",c.model?` · ${c.model}`:""]})]})]}),a.jsx(be,{variant:u(c.status??"inactive"),className:"text-[10px]",children:c.status??"inactive"})]}),((h=c.skills)==null?void 0:h.length)>0&&a.jsxs("div",{className:"flex flex-wrap gap-1",children:[c.skills.slice(0,4).map(d=>a.jsx("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:typeof d=="string"?d:d.name},d.name??d)),c.skills.length>4&&a.jsxs("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:["+",c.skills.length-4]})]})]},c.id)})})]})}const Ee=p.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:_e("rounded-lg border border-border bg-card text-card-foreground shadow-sm",e),...t}));Ee.displayName="Card";const De=p.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:_e("flex flex-col space-y-1.5 p-6",e),...t}));De.displayName="CardHeader";const $e=p.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:_e("font-semibold leading-none tracking-tight",e),...t}));$e.displayName="CardTitle";const gk=p.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:_e("text-sm text-muted-foreground",e),...t}));gk.displayName="CardDescription";const Te=p.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:_e("p-6 pt-0",e),...t}));Te.displayName="CardContent";const xk=["Profile","Tasks","Identities","Permissions"];function yk(){const{id:e}=Z2(),[t,n]=p.useState(null),[r,s]=p.useState([]),[o,i]=p.useState("Profile"),[l,u]=p.useState(!0);return p.useEffect(()=>{e&&(u(!0),(async()=>{const c=await ue.discovery.profile(e).catch(()=>null),h=(c==null?void 0:c.data)??null;n(h);const d=(h==null?void 0:h.registeredAgentId)??e,f=await ue.observations.agentPermissions(d).catch(()=>({data:[]}));s((f==null?void 0:f.data)??[]),u(!1)})())},[e]),l?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):t?a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(cs,{to:"/inventory/agents",className:"rounded-md p-1.5 hover:bg-accent",children:a.jsx(Db,{className:"h-4 w-4"})}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-2xl",children:t.emoji||"🤖"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-lg font-semibold",children:t.name||e}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.provider||"unknown",t.model?` / ${t.model}`:""]})]})]})]}),a.jsx("div",{className:"flex gap-1 border-b border-border",children:xk.map(c=>a.jsx("button",{onClick:()=>i(c),className:_e("border-b-2 px-4 py-2 text-sm font-medium transition-colors",o===c?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:c},c))}),o==="Profile"&&a.jsx(vk,{profile:t}),o==="Tasks"&&a.jsx(wk,{profile:t}),o==="Identities"&&a.jsx(Nk,{profile:t}),o==="Permissions"&&a.jsx(Sk,{permissions:r})]}):a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Agent not found"})}function vk({profile:e}){const t=e.skills??[];return a.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[a.jsxs(Ee,{children:[a.jsx(De,{children:a.jsx($e,{className:"text-sm",children:"Info"})}),a.jsxs(Te,{className:"space-y-2 text-sm",children:[a.jsx(Ys,{label:"Owner",value:e.ownerName||"—"}),a.jsx(Ys,{label:"Creature",value:e.creature||"—"}),a.jsx(Ys,{label:"Vibe",value:e.vibe||"—"}),a.jsx(Ys,{label:"Sessions",value:String(e.sessionCount??0)}),a.jsx(Ys,{label:"Last Active",value:e.lastActive??"never"})]})]}),a.jsxs(Ee,{children:[a.jsx(De,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs($e,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Zx,{className:"h-4 w-4"})," Skills (",t.length,")"]}),a.jsx(cs,{to:"/ops/skills",children:a.jsxs(J,{size:"sm",variant:"ghost",className:"h-7 text-xs text-muted-foreground",children:["Manage ",a.jsx(Bb,{className:"ml-1 h-3 w-3"})]})})]})}),a.jsx(Te,{children:t.length===0?a.jsxs("div",{className:"flex flex-col items-center gap-2 py-4",children:[a.jsx(ur,{className:"h-8 w-8 text-muted-foreground/30"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No skills installed"}),a.jsx(cs,{to:"/ops/skills",children:a.jsx(J,{size:"sm",variant:"ghost",className:"h-7 text-xs",children:"Go to Operations to install skills"})})]}):a.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(n=>a.jsxs(be,{variant:"secondary",className:"text-xs font-normal",children:[a.jsx(ur,{className:"mr-1 h-3 w-3"})," ",n.name]},n.name))})})]}),a.jsxs(Ee,{children:[a.jsx(De,{children:a.jsx($e,{className:"text-sm",children:"Plugins"})}),a.jsx(Te,{children:(e.plugins??[]).length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins"}):a.jsx("div",{className:"space-y-1.5",children:(e.plugins??[]).map(n=>a.jsxs("div",{className:"flex items-center justify-between text-sm",children:[a.jsx("span",{children:n.name}),a.jsx(be,{variant:n.enabled?"success":"secondary",className:"text-[10px]",children:n.enabled?"on":"off"})]},n.name))})})]}),a.jsxs(Ee,{children:[a.jsx(De,{children:a.jsx($e,{className:"text-sm",children:"Connected Systems"})}),a.jsx(Te,{children:(e.connectedSystems??[]).length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"None"}):a.jsx("div",{className:"flex flex-wrap gap-1.5",children:(e.connectedSystems??[]).map(n=>a.jsx(be,{variant:"outline",className:"text-xs",children:n},n))})})]})]})}function wk({profile:e}){const t=e.cronJobs??[];return a.jsxs(Ee,{children:[a.jsx(De,{children:a.jsxs($e,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Hb,{className:"h-4 w-4"})," Scheduled Tasks (",t.length,")"]})}),a.jsx(Te,{children:t.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No scheduled tasks"}):a.jsx("div",{className:"space-y-2",children:t.map((n,r)=>a.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:n.schedule}),a.jsx("span",{className:"ml-2",children:n.task??n.id})]}),a.jsx(be,{variant:n.enabled!==!1?"success":"secondary",className:"text-[10px]",children:n.enabled!==!1?"active":"paused"})]},r))})})]})}function Nk({profile:e}){const t=e.workspaceFiles??{},n=[{label:"SOUL.md",content:t.soul},{label:"IDENTITY.md",content:t.identity},{label:"USER.md",content:t.user}].filter(r=>r.content);return a.jsx("div",{className:"space-y-4",children:n.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No identity files found"}):n.map(r=>a.jsxs(Ee,{children:[a.jsx(De,{children:a.jsxs($e,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Es,{className:"h-4 w-4"})," ",r.label]})}),a.jsx(Te,{children:a.jsx("pre",{className:"max-h-60 overflow-auto whitespace-pre-wrap rounded-md bg-muted p-3 font-mono text-xs text-muted-foreground",children:r.content})})]},r.label))})}function Sk({permissions:e}){return e.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"No observed permissions"}):a.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Tool"}),a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Access"}),a.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"Calls"}),a.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"Errors"})]})}),a.jsx("tbody",{children:e.map(t=>a.jsxs("tr",{className:"border-b border-border last:border-0",children:[a.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:t.toolName}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(be,{variant:"outline",className:"text-[10px]",children:t.category??"—"})}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(be,{variant:t.accessPattern==="write"?"warning":t.accessPattern==="admin"?"destructive":"secondary",className:"text-[10px]",children:t.accessPattern??"read"})}),a.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs",children:t.callCount}),a.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs text-destructive",children:t.errorCount||"—"})]},t.id))})]})})}function Ys({label:e,value:t}){return a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-muted-foreground",children:e}),a.jsx("span",{className:"font-medium",children:t})]})}function bk(){const[e,t]=p.useState([]),[n,r]=p.useState(!0),[s,o]=p.useState(new Set);p.useEffect(()=>{ue.discovery.agents().then(u=>{t(u.data??[]),r(!1)}).catch(()=>r(!1))},[]);const i=[{category:"Agents",items:e.map(u=>({id:u.id,name:u.name,emoji:u.emoji,provider:u.provider,status:u.status}))},{category:"Owners",items:[...new Set(e.map(u=>u.ownerName).filter(Boolean))].map(u=>({id:u,name:u,type:"owner"}))},{category:"Connected Systems",items:[...new Set(e.flatMap(u=>u.connectedSystems??[]))].map(u=>({id:u,name:u,type:"system"}))}],l=u=>{o(c=>{const h=new Set(c);return h.has(u)?h.delete(u):h.add(u),h})};return n?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Identities"}),a.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Agents, owners, and connected systems"})]}),a.jsx("div",{className:"space-y-3",children:i.map(u=>a.jsxs(Ee,{children:[a.jsxs("button",{onClick:()=>l(u.category),className:"flex w-full items-center justify-between p-4 text-left",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Gx,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("span",{className:"text-sm font-medium",children:u.category}),a.jsx(be,{variant:"secondary",className:"text-[10px]",children:u.items.length})]}),s.has(u.category)?a.jsx(ha,{className:"h-4 w-4 text-muted-foreground"}):a.jsx(Xd,{className:"h-4 w-4 text-muted-foreground"})]}),s.has(u.category)&&a.jsx(Te,{className:"border-t border-border pt-3",children:u.items.length===0?a.jsx("p",{className:"text-sm text-muted-foreground",children:"None"}):a.jsx("div",{className:"space-y-1.5",children:u.items.map(c=>a.jsxs("div",{className:"flex items-center justify-between rounded-md px-3 py-2 text-sm hover:bg-muted/50",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[c.emoji&&a.jsx("span",{className:"text-base",children:c.emoji}),a.jsx("span",{children:c.name})]}),c.status&&a.jsx(be,{variant:c.status==="active"?"success":"secondary",className:"text-[10px]",children:c.status}),c.type&&a.jsx(be,{variant:"outline",className:"text-[10px]",children:c.type})]},c.id))})})]},u.category))})]})}function kk(){const[e,t]=p.useState([]),[n,r]=p.useState(""),[s,o]=p.useState("callCount"),[i,l]=p.useState(!1),[u,c]=p.useState(!0);p.useEffect(()=>{ue.observations.permissions().then(f=>{t(f.data??[]),c(!1)}).catch(()=>c(!1))},[]);const h=p.useMemo(()=>{let f=e;if(n){const x=n.toLowerCase();f=f.filter(y=>{var w,S;return((w=y.toolName)==null?void 0:w.toLowerCase().includes(x))||((S=y.category)==null?void 0:S.toLowerCase().includes(x))})}return[...f].sort((x,y)=>{const w=x[s]??0,S=y[s]??0;return typeof w=="string"?i?w.localeCompare(S):S.localeCompare(w):i?w-S:S-w})},[e,n,s,i]),d=f=>{s===f?l(!i):(o(f),l(!1))};return u?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Permissions"}),a.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," observed tool permission",e.length!==1?"s":""]})]}),a.jsxs("div",{className:"relative max-w-sm",children:[a.jsx(Qx,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),a.jsx(ot,{placeholder:"Filter by tool or category...",className:"pl-9",value:n,onChange:f=>r(f.target.value)})]}),a.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[a.jsx(au,{label:"Tool",sortKey:"toolName",current:s,asc:i,onSort:d}),a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Access"}),a.jsx(au,{label:"Calls",sortKey:"callCount",current:s,asc:i,onSort:d,align:"right"}),a.jsx(au,{label:"Errors",sortKey:"errorCount",current:s,asc:i,onSort:d,align:"right"})]})}),a.jsx("tbody",{children:h.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:5,className:"px-4 py-8 text-center text-muted-foreground",children:"No permissions"})}):h.map(f=>a.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-muted/30",children:[a.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:f.toolName}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(be,{variant:"outline",className:"text-[10px]",children:f.category??"—"})}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(be,{variant:f.accessPattern==="write"?"warning":f.accessPattern==="admin"?"destructive":"secondary",className:"text-[10px]",children:f.accessPattern??"read"})}),a.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs",children:f.callCount}),a.jsx("td",{className:"px-4 py-2.5 text-right font-mono text-xs text-destructive",children:f.errorCount||"—"})]},f.id))})]})})]})}function au({label:e,sortKey:t,current:n,asc:r,onSort:s,align:o="left"}){return a.jsx("th",{className:`cursor-pointer px-4 py-2.5 font-medium text-muted-foreground hover:text-foreground ${o==="right"?"text-right":"text-left"}`,onClick:()=>s(t),children:a.jsxs("span",{className:"inline-flex items-center gap-1",children:[e,n===t&&a.jsx($b,{className:"h-3 w-3"})]})})}function jk(){const[e,t]=p.useState([]),[n,r]=p.useState(!0);p.useEffect(()=>{ue.observations.anomalies().then(i=>{t(i.data??[]),r(!1)}).catch(()=>r(!1))},[]);const s=i=>i.blocked||i.errorCount>3?"high":i.callCount===1||i.errorCount>0?"medium":"low",o=i=>i==="high"?"destructive":i==="medium"?"warning":"secondary";return n?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Risk Overview"}),a.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[e.length," anomal",e.length!==1?"ies":"y"," detected"]})]}),e.length===0?a.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border",children:[a.jsx(qx,{className:"h-8 w-8 text-muted-foreground/50"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No anomalies detected"})]}):a.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-border bg-muted/50",children:[a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Tool"}),a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Agent"}),a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Risk"}),a.jsx("th",{className:"px-4 py-2.5 text-left font-medium text-muted-foreground",children:"Category"}),a.jsx("th",{className:"px-4 py-2.5 text-right font-medium text-muted-foreground",children:"First Seen"})]})}),a.jsx("tbody",{children:e.map(i=>{var u;const l=s(i);return a.jsxs("tr",{className:"border-b border-border last:border-0 hover:bg-muted/30",children:[a.jsx("td",{className:"px-4 py-2.5 font-mono text-xs",children:i.toolName}),a.jsx("td",{className:"px-4 py-2.5 text-xs text-muted-foreground",children:((u=i.agentId)==null?void 0:u.slice(0,8))??"—"}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(be,{variant:o(l),className:"text-[10px]",children:l})}),a.jsx("td",{className:"px-4 py-2.5",children:a.jsx(be,{variant:"outline",className:"text-[10px]",children:i.category??"—"})}),a.jsx("td",{className:"px-4 py-2.5 text-right text-xs text-muted-foreground",children:i.firstSeen?new Date(i.firstSeen).toLocaleDateString():"—"})]},i.id)})})]})})]})}function Me(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Me(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Ck={value:()=>{}};function ma(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ji(n)}function Ji(e){this._=e}function Ek(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ji.prototype=ma.prototype={constructor:Ji,on:function(e,t){var n=this._,r=Ek(e+"",n),s,o=-1,i=r.length;if(arguments.length<2){for(;++o<i;)if((s=(e=r[o]).type)&&(s=_k(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<i;)if(s=(e=r[o]).type)n[s]=qh(n[s],e.name,t);else if(t==null)for(s in n)n[s]=qh(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ji(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,o;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,s=o.length;r<s;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,o=r.length;s<o;++s)r[s].value.apply(t,n)}};function _k(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function qh(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=Ck,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var _c="http://www.w3.org/1999/xhtml";const Zh={svg:"http://www.w3.org/2000/svg",xhtml:_c,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function pa(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Zh.hasOwnProperty(t)?{space:Zh[t],local:e}:e}function Pk(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===_c&&t.documentElement.namespaceURI===_c?t.createElement(e):t.createElementNS(n,e)}}function Mk(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ty(e){var t=pa(e);return(t.local?Mk:Pk)(t)}function Ik(){}function qd(e){return e==null?Ik:function(){return this.querySelector(e)}}function Rk(e){typeof e!="function"&&(e=qd(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],i=o.length,l=r[s]=new Array(i),u,c,h=0;h<i;++h)(u=o[h])&&(c=e.call(u,u.__data__,h,o))&&("__data__"in u&&(c.__data__=u.__data__),l[h]=c);return new dt(r,this._parents)}function Tk(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Lk(){return[]}function ny(e){return e==null?Lk:function(){return this.querySelectorAll(e)}}function Ak(e){return function(){return Tk(e.apply(this,arguments))}}function zk(e){typeof e=="function"?e=Ak(e):e=ny(e);for(var t=this._groups,n=t.length,r=[],s=[],o=0;o<n;++o)for(var i=t[o],l=i.length,u,c=0;c<l;++c)(u=i[c])&&(r.push(e.call(u,u.__data__,c,i)),s.push(u));return new dt(r,s)}function ry(e){return function(){return this.matches(e)}}function sy(e){return function(t){return t.matches(e)}}var Dk=Array.prototype.find;function $k(e){return function(){return Dk.call(this.children,e)}}function Ok(){return this.firstElementChild}function Fk(e){return this.select(e==null?Ok:$k(typeof e=="function"?e:sy(e)))}var Hk=Array.prototype.filter;function Vk(){return Array.from(this.children)}function Bk(e){return function(){return Hk.call(this.children,e)}}function Uk(e){return this.selectAll(e==null?Vk:Bk(typeof e=="function"?e:sy(e)))}function Wk(e){typeof e!="function"&&(e=ry(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],i=o.length,l=r[s]=[],u,c=0;c<i;++c)(u=o[c])&&e.call(u,u.__data__,c,o)&&l.push(u);return new dt(r,this._parents)}function oy(e){return new Array(e.length)}function Yk(){return new dt(this._enter||this._groups.map(oy),this._parents)}function Rl(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Rl.prototype={constructor:Rl,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Gk(e){return function(){return e}}function Kk(e,t,n,r,s,o){for(var i=0,l,u=t.length,c=o.length;i<c;++i)(l=t[i])?(l.__data__=o[i],r[i]=l):n[i]=new Rl(e,o[i]);for(;i<u;++i)(l=t[i])&&(s[i]=l)}function Xk(e,t,n,r,s,o,i){var l,u,c=new Map,h=t.length,d=o.length,f=new Array(h),x;for(l=0;l<h;++l)(u=t[l])&&(f[l]=x=i.call(u,u.__data__,l,t)+"",c.has(x)?s[l]=u:c.set(x,u));for(l=0;l<d;++l)x=i.call(e,o[l],l,o)+"",(u=c.get(x))?(r[l]=u,u.__data__=o[l],c.delete(x)):n[l]=new Rl(e,o[l]);for(l=0;l<h;++l)(u=t[l])&&c.get(f[l])===u&&(s[l]=u)}function Qk(e){return e.__data__}function qk(e,t){if(!arguments.length)return Array.from(this,Qk);var n=t?Xk:Kk,r=this._parents,s=this._groups;typeof e!="function"&&(e=Gk(e));for(var o=s.length,i=new Array(o),l=new Array(o),u=new Array(o),c=0;c<o;++c){var h=r[c],d=s[c],f=d.length,x=Zk(e.call(h,h&&h.__data__,c,r)),y=x.length,w=l[c]=new Array(y),S=i[c]=new Array(y),m=u[c]=new Array(f);n(h,d,w,S,m,x,t);for(var v=0,g=0,N,b;v<y;++v)if(N=w[v]){for(v>=g&&(g=v+1);!(b=S[g])&&++g<y;);N._next=b||null}}return i=new dt(i,r),i._enter=l,i._exit=u,i}function Zk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Jk(){return new dt(this._exit||this._groups.map(oy),this._parents)}function ej(e,t,n){var r=this.enter(),s=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?o.remove():n(o),r&&s?r.merge(s).order():s}function tj(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,o=r.length,i=Math.min(s,o),l=new Array(s),u=0;u<i;++u)for(var c=n[u],h=r[u],d=c.length,f=l[u]=new Array(d),x,y=0;y<d;++y)(x=c[y]||h[y])&&(f[y]=x);for(;u<s;++u)l[u]=n[u];return new dt(l,this._parents)}function nj(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],s=r.length-1,o=r[s],i;--s>=0;)(i=r[s])&&(o&&i.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(i,o),o=i);return this}function rj(e){e||(e=sj);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,s=new Array(r),o=0;o<r;++o){for(var i=n[o],l=i.length,u=s[o]=new Array(l),c,h=0;h<l;++h)(c=i[h])&&(u[h]=c);u.sort(t)}return new dt(s,this._parents).order()}function sj(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function oj(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ij(){return Array.from(this)}function lj(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length;s<o;++s){var i=r[s];if(i)return i}return null}function aj(){let e=0;for(const t of this)++e;return e}function uj(){return!this.node()}function cj(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],o=0,i=s.length,l;o<i;++o)(l=s[o])&&e.call(l,l.__data__,o,s);return this}function dj(e){return function(){this.removeAttribute(e)}}function fj(e){return function(){this.removeAttributeNS(e.space,e.local)}}function hj(e,t){return function(){this.setAttribute(e,t)}}function mj(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function pj(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function gj(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function xj(e,t){var n=pa(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?fj:dj:typeof t=="function"?n.local?gj:pj:n.local?mj:hj)(n,t))}function iy(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function yj(e){return function(){this.style.removeProperty(e)}}function vj(e,t,n){return function(){this.style.setProperty(e,t,n)}}function wj(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Nj(e,t,n){return arguments.length>1?this.each((t==null?yj:typeof t=="function"?wj:vj)(e,t,n??"")):fs(this.node(),e)}function fs(e,t){return e.style.getPropertyValue(t)||iy(e).getComputedStyle(e,null).getPropertyValue(t)}function Sj(e){return function(){delete this[e]}}function bj(e,t){return function(){this[e]=t}}function kj(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function jj(e,t){return arguments.length>1?this.each((t==null?Sj:typeof t=="function"?kj:bj)(e,t)):this.node()[e]}function ly(e){return e.trim().split(/^|\s+/)}function Zd(e){return e.classList||new ay(e)}function ay(e){this._node=e,this._names=ly(e.getAttribute("class")||"")}ay.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function uy(e,t){for(var n=Zd(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function cy(e,t){for(var n=Zd(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function Cj(e){return function(){uy(this,e)}}function Ej(e){return function(){cy(this,e)}}function _j(e,t){return function(){(t.apply(this,arguments)?uy:cy)(this,e)}}function Pj(e,t){var n=ly(e+"");if(arguments.length<2){for(var r=Zd(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?_j:t?Cj:Ej)(n,t))}function Mj(){this.textContent=""}function Ij(e){return function(){this.textContent=e}}function Rj(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Tj(e){return arguments.length?this.each(e==null?Mj:(typeof e=="function"?Rj:Ij)(e)):this.node().textContent}function Lj(){this.innerHTML=""}function Aj(e){return function(){this.innerHTML=e}}function zj(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Dj(e){return arguments.length?this.each(e==null?Lj:(typeof e=="function"?zj:Aj)(e)):this.node().innerHTML}function $j(){this.nextSibling&&this.parentNode.appendChild(this)}function Oj(){return this.each($j)}function Fj(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Hj(){return this.each(Fj)}function Vj(e){var t=typeof e=="function"?e:ty(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Bj(){return null}function Uj(e,t){var n=typeof e=="function"?e:ty(e),r=t==null?Bj:typeof t=="function"?t:qd(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Wj(){var e=this.parentNode;e&&e.removeChild(this)}function Yj(){return this.each(Wj)}function Gj(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Kj(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Xj(e){return this.select(e?Kj:Gj)}function Qj(e){return arguments.length?this.property("__data__",e):this.node().__data__}function qj(e){return function(t){e.call(this,t,this.__data__)}}function Zj(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Jj(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,o;n<s;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function eC(e,t,n){return function(){var r=this.__on,s,o=qj(t);if(r){for(var i=0,l=r.length;i<l;++i)if((s=r[i]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=n),s.value=t;return}}this.addEventListener(e.type,o,n),s={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(s):this.__on=[s]}}function tC(e,t,n){var r=Zj(e+""),s,o=r.length,i;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,c=l.length,h;u<c;++u)for(s=0,h=l[u];s<o;++s)if((i=r[s]).type===h.type&&i.name===h.name)return h.value}return}for(l=t?eC:Jj,s=0;s<o;++s)this.each(l(r[s],t,n));return this}function dy(e,t,n){var r=iy(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,n):(s=r.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function nC(e,t){return function(){return dy(this,e,t)}}function rC(e,t){return function(){return dy(this,e,t.apply(this,arguments))}}function sC(e,t){return this.each((typeof t=="function"?rC:nC)(e,t))}function*oC(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length,i;s<o;++s)(i=r[s])&&(yield i)}var fy=[null];function dt(e,t){this._groups=e,this._parents=t}function Xo(){return new dt([[document.documentElement]],fy)}function iC(){return this}dt.prototype=Xo.prototype={constructor:dt,select:Rk,selectAll:zk,selectChild:Fk,selectChildren:Uk,filter:Wk,data:qk,enter:Yk,exit:Jk,join:ej,merge:tj,selection:iC,order:nj,sort:rj,call:oj,nodes:ij,node:lj,size:aj,empty:uj,each:cj,attr:xj,style:Nj,property:jj,classed:Pj,text:Tj,html:Dj,raise:Oj,lower:Hj,append:Vj,insert:Uj,remove:Yj,clone:Xj,datum:Qj,on:tC,dispatch:sC,[Symbol.iterator]:oC};function lt(e){return typeof e=="string"?new dt([[document.querySelector(e)]],[document.documentElement]):new dt([[e]],fy)}function lC(e){let t;for(;t=e.sourceEvent;)e=t;return e}function _t(e,t){if(e=lC(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const aC={passive:!1},To={capture:!0,passive:!1};function uu(e){e.stopImmediatePropagation()}function es(e){e.preventDefault(),e.stopImmediatePropagation()}function hy(e){var t=e.document.documentElement,n=lt(e).on("dragstart.drag",es,To);"onselectstart"in t?n.on("selectstart.drag",es,To):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function my(e,t){var n=e.document.documentElement,r=lt(e).on("dragstart.drag",null);t&&(r.on("click.drag",es,To),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const bi=e=>()=>e;function Pc(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:o,x:i,y:l,dx:u,dy:c,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:h}})}Pc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function uC(e){return!e.ctrlKey&&!e.button}function cC(){return this.parentNode}function dC(e,t){return t??{x:e.x,y:e.y}}function fC(){return navigator.maxTouchPoints||"ontouchstart"in this}function py(){var e=uC,t=cC,n=dC,r=fC,s={},o=ma("start","drag","end"),i=0,l,u,c,h,d=0;function f(N){N.on("mousedown.drag",x).filter(r).on("touchstart.drag",S).on("touchmove.drag",m,aC).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(N,b){if(!(h||!e.call(this,N,b))){var k=g(this,t.call(this,N,b),N,b,"mouse");k&&(lt(N.view).on("mousemove.drag",y,To).on("mouseup.drag",w,To),hy(N.view),uu(N),c=!1,l=N.clientX,u=N.clientY,k("start",N))}}function y(N){if(es(N),!c){var b=N.clientX-l,k=N.clientY-u;c=b*b+k*k>d}s.mouse("drag",N)}function w(N){lt(N.view).on("mousemove.drag mouseup.drag",null),my(N.view,c),es(N),s.mouse("end",N)}function S(N,b){if(e.call(this,N,b)){var k=N.changedTouches,j=t.call(this,N,b),_=k.length,I,D;for(I=0;I<_;++I)(D=g(this,j,N,b,k[I].identifier,k[I]))&&(uu(N),D("start",N,k[I]))}}function m(N){var b=N.changedTouches,k=b.length,j,_;for(j=0;j<k;++j)(_=s[b[j].identifier])&&(es(N),_("drag",N,b[j]))}function v(N){var b=N.changedTouches,k=b.length,j,_;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),j=0;j<k;++j)(_=s[b[j].identifier])&&(uu(N),_("end",N,b[j]))}function g(N,b,k,j,_,I){var D=o.copy(),T=_t(I||k,b),R,F,E;if((E=n.call(N,new Pc("beforestart",{sourceEvent:k,target:f,identifier:_,active:i,x:T[0],y:T[1],dx:0,dy:0,dispatch:D}),j))!=null)return R=E.x-T[0]||0,F=E.y-T[1]||0,function A(M,z,C){var P=T,L;switch(M){case"start":s[_]=A,L=i++;break;case"end":delete s[_],--i;case"drag":T=_t(C||z,b),L=i;break}D.call(M,N,new Pc(M,{sourceEvent:z,subject:E,target:f,identifier:_,active:L,x:T[0]+R,y:T[1]+F,dx:T[0]-P[0],dy:T[1]-P[1],dispatch:D}),j)}}return f.filter=function(N){return arguments.length?(e=typeof N=="function"?N:bi(!!N),f):e},f.container=function(N){return arguments.length?(t=typeof N=="function"?N:bi(N),f):t},f.subject=function(N){return arguments.length?(n=typeof N=="function"?N:bi(N),f):n},f.touchable=function(N){return arguments.length?(r=typeof N=="function"?N:bi(!!N),f):r},f.on=function(){var N=o.on.apply(o,arguments);return N===o?f:N},f.clickDistance=function(N){return arguments.length?(d=(N=+N)*N,f):Math.sqrt(d)},f}function Jd(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function gy(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Qo(){}var Lo=.7,Tl=1/Lo,ts="\\s*([+-]?\\d+)\\s*",Ao="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",hC=/^#([0-9a-f]{3,8})$/,mC=new RegExp(`^rgb\\(${ts},${ts},${ts}\\)$`),pC=new RegExp(`^rgb\\(${Qt},${Qt},${Qt}\\)$`),gC=new RegExp(`^rgba\\(${ts},${ts},${ts},${Ao}\\)$`),xC=new RegExp(`^rgba\\(${Qt},${Qt},${Qt},${Ao}\\)$`),yC=new RegExp(`^hsl\\(${Ao},${Qt},${Qt}\\)$`),vC=new RegExp(`^hsla\\(${Ao},${Qt},${Qt},${Ao}\\)$`),Jh={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Jd(Qo,yr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:em,formatHex:em,formatHex8:wC,formatHsl:NC,formatRgb:tm,toString:tm});function em(){return this.rgb().formatHex()}function wC(){return this.rgb().formatHex8()}function NC(){return xy(this).formatHsl()}function tm(){return this.rgb().formatRgb()}function yr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=hC.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?nm(t):n===3?new tt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ki(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ki(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=mC.exec(e))?new tt(t[1],t[2],t[3],1):(t=pC.exec(e))?new tt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=gC.exec(e))?ki(t[1],t[2],t[3],t[4]):(t=xC.exec(e))?ki(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=yC.exec(e))?om(t[1],t[2]/100,t[3]/100,1):(t=vC.exec(e))?om(t[1],t[2]/100,t[3]/100,t[4]):Jh.hasOwnProperty(e)?nm(Jh[e]):e==="transparent"?new tt(NaN,NaN,NaN,0):null}function nm(e){return new tt(e>>16&255,e>>8&255,e&255,1)}function ki(e,t,n,r){return r<=0&&(e=t=n=NaN),new tt(e,t,n,r)}function SC(e){return e instanceof Qo||(e=yr(e)),e?(e=e.rgb(),new tt(e.r,e.g,e.b,e.opacity)):new tt}function Mc(e,t,n,r){return arguments.length===1?SC(e):new tt(e,t,n,r??1)}function tt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Jd(tt,Mc,gy(Qo,{brighter(e){return e=e==null?Tl:Math.pow(Tl,e),new tt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Lo:Math.pow(Lo,e),new tt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new tt(cr(this.r),cr(this.g),cr(this.b),Ll(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rm,formatHex:rm,formatHex8:bC,formatRgb:sm,toString:sm}));function rm(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}`}function bC(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}${ir((isNaN(this.opacity)?1:this.opacity)*255)}`}function sm(){const e=Ll(this.opacity);return`${e===1?"rgb(":"rgba("}${cr(this.r)}, ${cr(this.g)}, ${cr(this.b)}${e===1?")":`, ${e})`}`}function Ll(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function cr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ir(e){return e=cr(e),(e<16?"0":"")+e.toString(16)}function om(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Mt(e,t,n,r)}function xy(e){if(e instanceof Mt)return new Mt(e.h,e.s,e.l,e.opacity);if(e instanceof Qo||(e=yr(e)),!e)return new Mt;if(e instanceof Mt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),o=Math.max(t,n,r),i=NaN,l=o-s,u=(o+s)/2;return l?(t===o?i=(n-r)/l+(n<r)*6:n===o?i=(r-t)/l+2:i=(t-n)/l+4,l/=u<.5?o+s:2-o-s,i*=60):l=u>0&&u<1?0:i,new Mt(i,l,u,e.opacity)}function kC(e,t,n,r){return arguments.length===1?xy(e):new Mt(e,t,n,r??1)}function Mt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Jd(Mt,kC,gy(Qo,{brighter(e){return e=e==null?Tl:Math.pow(Tl,e),new Mt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Lo:Math.pow(Lo,e),new Mt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new tt(cu(e>=240?e-240:e+120,s,r),cu(e,s,r),cu(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Mt(im(this.h),ji(this.s),ji(this.l),Ll(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ll(this.opacity);return`${e===1?"hsl(":"hsla("}${im(this.h)}, ${ji(this.s)*100}%, ${ji(this.l)*100}%${e===1?")":`, ${e})`}`}}));function im(e){return e=(e||0)%360,e<0?e+360:e}function ji(e){return Math.max(0,Math.min(1,e||0))}function cu(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const ef=e=>()=>e;function jC(e,t){return function(n){return e+n*t}}function CC(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function EC(e){return(e=+e)==1?yy:function(t,n){return n-t?CC(t,n,e):ef(isNaN(t)?n:t)}}function yy(e,t){var n=t-e;return n?jC(e,n):ef(isNaN(e)?t:e)}const Al=function e(t){var n=EC(t);function r(s,o){var i=n((s=Mc(s)).r,(o=Mc(o)).r),l=n(s.g,o.g),u=n(s.b,o.b),c=yy(s.opacity,o.opacity);return function(h){return s.r=i(h),s.g=l(h),s.b=u(h),s.opacity=c(h),s+""}}return r.gamma=e,r}(1);function _C(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(o){for(s=0;s<n;++s)r[s]=e[s]*(1-o)+t[s]*o;return r}}function PC(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function MC(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),o=new Array(n),i;for(i=0;i<r;++i)s[i]=co(e[i],t[i]);for(;i<n;++i)o[i]=t[i];return function(l){for(i=0;i<r;++i)o[i]=s[i](l);return o}}function IC(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Wt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function RC(e,t){var n={},r={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=co(e[s],t[s]):r[s]=t[s];return function(o){for(s in n)r[s]=n[s](o);return r}}var Ic=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,du=new RegExp(Ic.source,"g");function TC(e){return function(){return e}}function LC(e){return function(t){return e(t)+""}}function vy(e,t){var n=Ic.lastIndex=du.lastIndex=0,r,s,o,i=-1,l=[],u=[];for(e=e+"",t=t+"";(r=Ic.exec(e))&&(s=du.exec(t));)(o=s.index)>n&&(o=t.slice(n,o),l[i]?l[i]+=o:l[++i]=o),(r=r[0])===(s=s[0])?l[i]?l[i]+=s:l[++i]=s:(l[++i]=null,u.push({i,x:Wt(r,s)})),n=du.lastIndex;return n<t.length&&(o=t.slice(n),l[i]?l[i]+=o:l[++i]=o),l.length<2?u[0]?LC(u[0].x):TC(t):(t=u.length,function(c){for(var h=0,d;h<t;++h)l[(d=u[h]).i]=d.x(c);return l.join("")})}function co(e,t){var n=typeof t,r;return t==null||n==="boolean"?ef(t):(n==="number"?Wt:n==="string"?(r=yr(t))?(t=r,Al):vy:t instanceof yr?Al:t instanceof Date?IC:PC(t)?_C:Array.isArray(t)?MC:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?RC:Wt)(e,t)}var lm=180/Math.PI,Rc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function wy(e,t,n,r,s,o){var i,l,u;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,u/=l),e*r<t*n&&(e=-e,t=-t,u=-u,i=-i),{translateX:s,translateY:o,rotate:Math.atan2(t,e)*lm,skewX:Math.atan(u)*lm,scaleX:i,scaleY:l}}var Ci;function AC(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Rc:wy(t.a,t.b,t.c,t.d,t.e,t.f)}function zC(e){return e==null||(Ci||(Ci=document.createElementNS("http://www.w3.org/2000/svg","g")),Ci.setAttribute("transform",e),!(e=Ci.transform.baseVal.consolidate()))?Rc:(e=e.matrix,wy(e.a,e.b,e.c,e.d,e.e,e.f))}function Ny(e,t,n,r){function s(c){return c.length?c.pop()+" ":""}function o(c,h,d,f,x,y){if(c!==d||h!==f){var w=x.push("translate(",null,t,null,n);y.push({i:w-4,x:Wt(c,d)},{i:w-2,x:Wt(h,f)})}else(d||f)&&x.push("translate("+d+t+f+n)}function i(c,h,d,f){c!==h?(c-h>180?h+=360:h-c>180&&(c+=360),f.push({i:d.push(s(d)+"rotate(",null,r)-2,x:Wt(c,h)})):h&&d.push(s(d)+"rotate("+h+r)}function l(c,h,d,f){c!==h?f.push({i:d.push(s(d)+"skewX(",null,r)-2,x:Wt(c,h)}):h&&d.push(s(d)+"skewX("+h+r)}function u(c,h,d,f,x,y){if(c!==d||h!==f){var w=x.push(s(x)+"scale(",null,",",null,")");y.push({i:w-4,x:Wt(c,d)},{i:w-2,x:Wt(h,f)})}else(d!==1||f!==1)&&x.push(s(x)+"scale("+d+","+f+")")}return function(c,h){var d=[],f=[];return c=e(c),h=e(h),o(c.translateX,c.translateY,h.translateX,h.translateY,d,f),i(c.rotate,h.rotate,d,f),l(c.skewX,h.skewX,d,f),u(c.scaleX,c.scaleY,h.scaleX,h.scaleY,d,f),c=h=null,function(x){for(var y=-1,w=f.length,S;++y<w;)d[(S=f[y]).i]=S.x(x);return d.join("")}}}var DC=Ny(AC,"px, ","px)","deg)"),$C=Ny(zC,", ",")",")"),OC=1e-12;function am(e){return((e=Math.exp(e))+1/e)/2}function FC(e){return((e=Math.exp(e))-1/e)/2}function HC(e){return((e=Math.exp(2*e))-1)/(e+1)}const el=function e(t,n,r){function s(o,i){var l=o[0],u=o[1],c=o[2],h=i[0],d=i[1],f=i[2],x=h-l,y=d-u,w=x*x+y*y,S,m;if(w<OC)m=Math.log(f/c)/t,S=function(j){return[l+j*x,u+j*y,c*Math.exp(t*j*m)]};else{var v=Math.sqrt(w),g=(f*f-c*c+r*w)/(2*c*n*v),N=(f*f-c*c-r*w)/(2*f*n*v),b=Math.log(Math.sqrt(g*g+1)-g),k=Math.log(Math.sqrt(N*N+1)-N);m=(k-b)/t,S=function(j){var _=j*m,I=am(b),D=c/(n*v)*(I*HC(t*_+b)-FC(b));return[l+D*x,u+D*y,c*I/am(t*_+b)]}}return S.duration=m*1e3*t/Math.SQRT2,S}return s.rho=function(o){var i=Math.max(.001,+o),l=i*i,u=l*l;return e(i,l,u)},s}(Math.SQRT2,2,4);var hs=0,Js=0,Gs=0,Sy=1e3,zl,eo,Dl=0,vr=0,ga=0,zo=typeof performance=="object"&&performance.now?performance:Date,by=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function tf(){return vr||(by(VC),vr=zo.now()+ga)}function VC(){vr=0}function $l(){this._call=this._time=this._next=null}$l.prototype=ky.prototype={constructor:$l,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?tf():+n)+(t==null?0:+t),!this._next&&eo!==this&&(eo?eo._next=this:zl=this,eo=this),this._call=e,this._time=n,Tc()},stop:function(){this._call&&(this._call=null,this._time=1/0,Tc())}};function ky(e,t,n){var r=new $l;return r.restart(e,t,n),r}function BC(){tf(),++hs;for(var e=zl,t;e;)(t=vr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--hs}function um(){vr=(Dl=zo.now())+ga,hs=Js=0;try{BC()}finally{hs=0,WC(),vr=0}}function UC(){var e=zo.now(),t=e-Dl;t>Sy&&(ga-=t,Dl=e)}function WC(){for(var e,t=zl,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:zl=n);eo=e,Tc(r)}function Tc(e){if(!hs){Js&&(Js=clearTimeout(Js));var t=e-vr;t>24?(e<1/0&&(Js=setTimeout(um,e-zo.now()-ga)),Gs&&(Gs=clearInterval(Gs))):(Gs||(Dl=zo.now(),Gs=setInterval(UC,Sy)),hs=1,by(um))}}function cm(e,t,n){var r=new $l;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var YC=ma("start","end","cancel","interrupt"),GC=[],jy=0,dm=1,Lc=2,tl=3,fm=4,Ac=5,nl=6;function xa(e,t,n,r,s,o){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;KC(e,n,{name:t,index:r,group:s,on:YC,tween:GC,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:jy})}function nf(e,t){var n=Ft(e,t);if(n.state>jy)throw new Error("too late; already scheduled");return n}function tn(e,t){var n=Ft(e,t);if(n.state>tl)throw new Error("too late; already running");return n}function Ft(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function KC(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=ky(o,0,n.time);function o(c){n.state=dm,n.timer.restart(i,n.delay,n.time),n.delay<=c&&i(c-n.delay)}function i(c){var h,d,f,x;if(n.state!==dm)return u();for(h in r)if(x=r[h],x.name===n.name){if(x.state===tl)return cm(i);x.state===fm?(x.state=nl,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete r[h]):+h<t&&(x.state=nl,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete r[h])}if(cm(function(){n.state===tl&&(n.state=fm,n.timer.restart(l,n.delay,n.time),l(c))}),n.state=Lc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Lc){for(n.state=tl,s=new Array(f=n.tween.length),h=0,d=-1;h<f;++h)(x=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(s[++d]=x);s.length=d+1}}function l(c){for(var h=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(u),n.state=Ac,1),d=-1,f=s.length;++d<f;)s[d].call(e,h);n.state===Ac&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=nl,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function rl(e,t){var n=e.__transition,r,s,o=!0,i;if(n){t=t==null?null:t+"";for(i in n){if((r=n[i]).name!==t){o=!1;continue}s=r.state>Lc&&r.state<Ac,r.state=nl,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[i]}o&&delete e.__transition}}function XC(e){return this.each(function(){rl(this,e)})}function QC(e,t){var n,r;return function(){var s=tn(this,e),o=s.tween;if(o!==n){r=n=o;for(var i=0,l=r.length;i<l;++i)if(r[i].name===t){r=r.slice(),r.splice(i,1);break}}s.tween=r}}function qC(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var o=tn(this,e),i=o.tween;if(i!==r){s=(r=i).slice();for(var l={name:t,value:n},u=0,c=s.length;u<c;++u)if(s[u].name===t){s[u]=l;break}u===c&&s.push(l)}o.tween=s}}function ZC(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ft(this.node(),n).tween,s=0,o=r.length,i;s<o;++s)if((i=r[s]).name===e)return i.value;return null}return this.each((t==null?QC:qC)(n,e,t))}function rf(e,t,n){var r=e._id;return e.each(function(){var s=tn(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return Ft(s,r).value[t]}}function Cy(e,t){var n;return(typeof t=="number"?Wt:t instanceof yr?Al:(n=yr(t))?(t=n,Al):vy)(e,t)}function JC(e){return function(){this.removeAttribute(e)}}function eE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function tE(e,t,n){var r,s=n+"",o;return function(){var i=this.getAttribute(e);return i===s?null:i===r?o:o=t(r=i,n)}}function nE(e,t,n){var r,s=n+"",o;return function(){var i=this.getAttributeNS(e.space,e.local);return i===s?null:i===r?o:o=t(r=i,n)}}function rE(e,t,n){var r,s,o;return function(){var i,l=n(this),u;return l==null?void this.removeAttribute(e):(i=this.getAttribute(e),u=l+"",i===u?null:i===r&&u===s?o:(s=u,o=t(r=i,l)))}}function sE(e,t,n){var r,s,o;return function(){var i,l=n(this),u;return l==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),u=l+"",i===u?null:i===r&&u===s?o:(s=u,o=t(r=i,l)))}}function oE(e,t){var n=pa(e),r=n==="transform"?$C:Cy;return this.attrTween(e,typeof t=="function"?(n.local?sE:rE)(n,r,rf(this,"attr."+e,t)):t==null?(n.local?eE:JC)(n):(n.local?nE:tE)(n,r,t))}function iE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function lE(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function aE(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&lE(e,o)),n}return s._value=t,s}function uE(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&iE(e,o)),n}return s._value=t,s}function cE(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=pa(e);return this.tween(n,(r.local?aE:uE)(r,t))}function dE(e,t){return function(){nf(this,e).delay=+t.apply(this,arguments)}}function fE(e,t){return t=+t,function(){nf(this,e).delay=t}}function hE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?dE:fE)(t,e)):Ft(this.node(),t).delay}function mE(e,t){return function(){tn(this,e).duration=+t.apply(this,arguments)}}function pE(e,t){return t=+t,function(){tn(this,e).duration=t}}function gE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?mE:pE)(t,e)):Ft(this.node(),t).duration}function xE(e,t){if(typeof t!="function")throw new Error;return function(){tn(this,e).ease=t}}function yE(e){var t=this._id;return arguments.length?this.each(xE(t,e)):Ft(this.node(),t).ease}function vE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;tn(this,e).ease=n}}function wE(e){if(typeof e!="function")throw new Error;return this.each(vE(this._id,e))}function NE(e){typeof e!="function"&&(e=ry(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],i=o.length,l=r[s]=[],u,c=0;c<i;++c)(u=o[c])&&e.call(u,u.__data__,c,o)&&l.push(u);return new xn(r,this._parents,this._name,this._id)}function SE(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,o=Math.min(r,s),i=new Array(r),l=0;l<o;++l)for(var u=t[l],c=n[l],h=u.length,d=i[l]=new Array(h),f,x=0;x<h;++x)(f=u[x]||c[x])&&(d[x]=f);for(;l<r;++l)i[l]=t[l];return new xn(i,this._parents,this._name,this._id)}function bE(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function kE(e,t,n){var r,s,o=bE(t)?nf:tn;return function(){var i=o(this,e),l=i.on;l!==r&&(s=(r=l).copy()).on(t,n),i.on=s}}function jE(e,t){var n=this._id;return arguments.length<2?Ft(this.node(),n).on.on(e):this.each(kE(n,e,t))}function CE(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function EE(){return this.on("end.remove",CE(this._id))}function _E(e){var t=this._name,n=this._id;typeof e!="function"&&(e=qd(e));for(var r=this._groups,s=r.length,o=new Array(s),i=0;i<s;++i)for(var l=r[i],u=l.length,c=o[i]=new Array(u),h,d,f=0;f<u;++f)(h=l[f])&&(d=e.call(h,h.__data__,f,l))&&("__data__"in h&&(d.__data__=h.__data__),c[f]=d,xa(c[f],t,n,f,c,Ft(h,n)));return new xn(o,this._parents,t,n)}function PE(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ny(e));for(var r=this._groups,s=r.length,o=[],i=[],l=0;l<s;++l)for(var u=r[l],c=u.length,h,d=0;d<c;++d)if(h=u[d]){for(var f=e.call(h,h.__data__,d,u),x,y=Ft(h,n),w=0,S=f.length;w<S;++w)(x=f[w])&&xa(x,t,n,w,f,y);o.push(f),i.push(h)}return new xn(o,i,t,n)}var ME=Xo.prototype.constructor;function IE(){return new ME(this._groups,this._parents)}function RE(e,t){var n,r,s;return function(){var o=fs(this,e),i=(this.style.removeProperty(e),fs(this,e));return o===i?null:o===n&&i===r?s:s=t(n=o,r=i)}}function Ey(e){return function(){this.style.removeProperty(e)}}function TE(e,t,n){var r,s=n+"",o;return function(){var i=fs(this,e);return i===s?null:i===r?o:o=t(r=i,n)}}function LE(e,t,n){var r,s,o;return function(){var i=fs(this,e),l=n(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(e),fs(this,e))),i===u?null:i===r&&u===s?o:(s=u,o=t(r=i,l))}}function AE(e,t){var n,r,s,o="style."+t,i="end."+o,l;return function(){var u=tn(this,e),c=u.on,h=u.value[o]==null?l||(l=Ey(t)):void 0;(c!==n||s!==h)&&(r=(n=c).copy()).on(i,s=h),u.on=r}}function zE(e,t,n){var r=(e+="")=="transform"?DC:Cy;return t==null?this.styleTween(e,RE(e,r)).on("end.style."+e,Ey(e)):typeof t=="function"?this.styleTween(e,LE(e,r,rf(this,"style."+e,t))).each(AE(this._id,e)):this.styleTween(e,TE(e,r,t),n).on("end.style."+e,null)}function DE(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function $E(e,t,n){var r,s;function o(){var i=t.apply(this,arguments);return i!==s&&(r=(s=i)&&DE(e,i,n)),r}return o._value=t,o}function OE(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,$E(e,t,n??""))}function FE(e){return function(){this.textContent=e}}function HE(e){return function(){var t=e(this);this.textContent=t??""}}function VE(e){return this.tween("text",typeof e=="function"?HE(rf(this,"text",e)):FE(e==null?"":e+""))}function BE(e){return function(t){this.textContent=e.call(this,t)}}function UE(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&BE(s)),t}return r._value=e,r}function WE(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,UE(e))}function YE(){for(var e=this._name,t=this._id,n=_y(),r=this._groups,s=r.length,o=0;o<s;++o)for(var i=r[o],l=i.length,u,c=0;c<l;++c)if(u=i[c]){var h=Ft(u,t);xa(u,e,n,c,i,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new xn(r,this._parents,e,n)}function GE(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(o,i){var l={value:i},u={value:function(){--s===0&&o()}};n.each(function(){var c=tn(this,r),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(u)),c.on=t}),s===0&&o()})}var KE=0;function xn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function _y(){return++KE}var sn=Xo.prototype;xn.prototype={constructor:xn,select:_E,selectAll:PE,selectChild:sn.selectChild,selectChildren:sn.selectChildren,filter:NE,merge:SE,selection:IE,transition:YE,call:sn.call,nodes:sn.nodes,node:sn.node,size:sn.size,empty:sn.empty,each:sn.each,on:jE,attr:oE,attrTween:cE,style:zE,styleTween:OE,text:VE,textTween:WE,remove:EE,tween:ZC,delay:hE,duration:gE,ease:yE,easeVarying:wE,end:GE,[Symbol.iterator]:sn[Symbol.iterator]};function XE(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var QE={time:null,delay:0,duration:250,ease:XE};function qE(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function ZE(e){var t,n;e instanceof xn?(t=e._id,e=e._name):(t=_y(),(n=QE).time=tf(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,o=0;o<s;++o)for(var i=r[o],l=i.length,u,c=0;c<l;++c)(u=i[c])&&xa(u,e,t,c,i,n||qE(u,t));return new xn(r,this._parents,e,t)}Xo.prototype.interrupt=XC;Xo.prototype.transition=ZE;const Ei=e=>()=>e;function JE(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function cn(e,t,n){this.k=e,this.x=t,this.y=n}cn.prototype={constructor:cn,scale:function(e){return e===1?this:new cn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new cn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ya=new cn(1,0,0);Py.prototype=cn.prototype;function Py(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ya;return e.__zoom}function fu(e){e.stopImmediatePropagation()}function Ks(e){e.preventDefault(),e.stopImmediatePropagation()}function e_(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function t_(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function hm(){return this.__zoom||ya}function n_(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function r_(){return navigator.maxTouchPoints||"ontouchstart"in this}function s_(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i))}function My(){var e=e_,t=t_,n=s_,r=n_,s=r_,o=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,u=el,c=ma("start","zoom","end"),h,d,f,x=500,y=150,w=0,S=10;function m(E){E.property("__zoom",hm).on("wheel.zoom",_,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",D).filter(s).on("touchstart.zoom",T).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(E,A,M,z){var C=E.selection?E.selection():E;C.property("__zoom",hm),E!==C?b(E,A,M,z):C.interrupt().each(function(){k(this,arguments).event(z).start().zoom(null,typeof A=="function"?A.apply(this,arguments):A).end()})},m.scaleBy=function(E,A,M,z){m.scaleTo(E,function(){var C=this.__zoom.k,P=typeof A=="function"?A.apply(this,arguments):A;return C*P},M,z)},m.scaleTo=function(E,A,M,z){m.transform(E,function(){var C=t.apply(this,arguments),P=this.__zoom,L=M==null?N(C):typeof M=="function"?M.apply(this,arguments):M,O=P.invert(L),$=typeof A=="function"?A.apply(this,arguments):A;return n(g(v(P,$),L,O),C,i)},M,z)},m.translateBy=function(E,A,M,z){m.transform(E,function(){return n(this.__zoom.translate(typeof A=="function"?A.apply(this,arguments):A,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),i)},null,z)},m.translateTo=function(E,A,M,z,C){m.transform(E,function(){var P=t.apply(this,arguments),L=this.__zoom,O=z==null?N(P):typeof z=="function"?z.apply(this,arguments):z;return n(ya.translate(O[0],O[1]).scale(L.k).translate(typeof A=="function"?-A.apply(this,arguments):-A,typeof M=="function"?-M.apply(this,arguments):-M),P,i)},z,C)};function v(E,A){return A=Math.max(o[0],Math.min(o[1],A)),A===E.k?E:new cn(A,E.x,E.y)}function g(E,A,M){var z=A[0]-M[0]*E.k,C=A[1]-M[1]*E.k;return z===E.x&&C===E.y?E:new cn(E.k,z,C)}function N(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function b(E,A,M,z){E.on("start.zoom",function(){k(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(z).end()}).tween("zoom",function(){var C=this,P=arguments,L=k(C,P).event(z),O=t.apply(C,P),$=M==null?N(O):typeof M=="function"?M.apply(C,P):M,U=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),B=C.__zoom,Y=typeof A=="function"?A.apply(C,P):A,G=u(B.invert($).concat(U/B.k),Y.invert($).concat(U/Y.k));return function(K){if(K===1)K=Y;else{var V=G(K),Q=U/V[2];K=new cn(Q,$[0]-V[0]*Q,$[1]-V[1]*Q)}L.zoom(null,K)}})}function k(E,A,M){return!M&&E.__zooming||new j(E,A)}function j(E,A){this.that=E,this.args=A,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,A),this.taps=0}j.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,A){return this.mouse&&E!=="mouse"&&(this.mouse[1]=A.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=A.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=A.invert(this.touch1[0])),this.that.__zoom=A,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var A=lt(this.that).datum();c.call(E,this.that,new JE(E,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:c}),A)}};function _(E,...A){if(!e.apply(this,arguments))return;var M=k(this,A).event(E),z=this.__zoom,C=Math.max(o[0],Math.min(o[1],z.k*Math.pow(2,r.apply(this,arguments)))),P=_t(E);if(M.wheel)(M.mouse[0][0]!==P[0]||M.mouse[0][1]!==P[1])&&(M.mouse[1]=z.invert(M.mouse[0]=P)),clearTimeout(M.wheel);else{if(z.k===C)return;M.mouse=[P,z.invert(P)],rl(this),M.start()}Ks(E),M.wheel=setTimeout(L,y),M.zoom("mouse",n(g(v(z,C),M.mouse[0],M.mouse[1]),M.extent,i));function L(){M.wheel=null,M.end()}}function I(E,...A){if(f||!e.apply(this,arguments))return;var M=E.currentTarget,z=k(this,A,!0).event(E),C=lt(E.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",U,!0),P=_t(E,M),L=E.clientX,O=E.clientY;hy(E.view),fu(E),z.mouse=[P,this.__zoom.invert(P)],rl(this),z.start();function $(B){if(Ks(B),!z.moved){var Y=B.clientX-L,G=B.clientY-O;z.moved=Y*Y+G*G>w}z.event(B).zoom("mouse",n(g(z.that.__zoom,z.mouse[0]=_t(B,M),z.mouse[1]),z.extent,i))}function U(B){C.on("mousemove.zoom mouseup.zoom",null),my(B.view,z.moved),Ks(B),z.event(B).end()}}function D(E,...A){if(e.apply(this,arguments)){var M=this.__zoom,z=_t(E.changedTouches?E.changedTouches[0]:E,this),C=M.invert(z),P=M.k*(E.shiftKey?.5:2),L=n(g(v(M,P),z,C),t.apply(this,A),i);Ks(E),l>0?lt(this).transition().duration(l).call(b,L,z,E):lt(this).call(m.transform,L,z,E)}}function T(E,...A){if(e.apply(this,arguments)){var M=E.touches,z=M.length,C=k(this,A,E.changedTouches.length===z).event(E),P,L,O,$;for(fu(E),L=0;L<z;++L)O=M[L],$=_t(O,this),$=[$,this.__zoom.invert($),O.identifier],C.touch0?!C.touch1&&C.touch0[2]!==$[2]&&(C.touch1=$,C.taps=0):(C.touch0=$,P=!0,C.taps=1+!!h);h&&(h=clearTimeout(h)),P&&(C.taps<2&&(d=$[0],h=setTimeout(function(){h=null},x)),rl(this),C.start())}}function R(E,...A){if(this.__zooming){var M=k(this,A).event(E),z=E.changedTouches,C=z.length,P,L,O,$;for(Ks(E),P=0;P<C;++P)L=z[P],O=_t(L,this),M.touch0&&M.touch0[2]===L.identifier?M.touch0[0]=O:M.touch1&&M.touch1[2]===L.identifier&&(M.touch1[0]=O);if(L=M.that.__zoom,M.touch1){var U=M.touch0[0],B=M.touch0[1],Y=M.touch1[0],G=M.touch1[1],K=(K=Y[0]-U[0])*K+(K=Y[1]-U[1])*K,V=(V=G[0]-B[0])*V+(V=G[1]-B[1])*V;L=v(L,Math.sqrt(K/V)),O=[(U[0]+Y[0])/2,(U[1]+Y[1])/2],$=[(B[0]+G[0])/2,(B[1]+G[1])/2]}else if(M.touch0)O=M.touch0[0],$=M.touch0[1];else return;M.zoom("touch",n(g(L,O,$),M.extent,i))}}function F(E,...A){if(this.__zooming){var M=k(this,A).event(E),z=E.changedTouches,C=z.length,P,L;for(fu(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},x),P=0;P<C;++P)L=z[P],M.touch0&&M.touch0[2]===L.identifier?delete M.touch0:M.touch1&&M.touch1[2]===L.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(L=_t(L,this),Math.hypot(d[0]-L[0],d[1]-L[1])<S)){var O=lt(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return m.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:Ei(+E),m):r},m.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Ei(!!E),m):e},m.touchable=function(E){return arguments.length?(s=typeof E=="function"?E:Ei(!!E),m):s},m.extent=function(E){return arguments.length?(t=typeof E=="function"?E:Ei([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),m):t},m.scaleExtent=function(E){return arguments.length?(o[0]=+E[0],o[1]=+E[1],m):[o[0],o[1]]},m.translateExtent=function(E){return arguments.length?(i[0][0]=+E[0][0],i[1][0]=+E[1][0],i[0][1]=+E[0][1],i[1][1]=+E[1][1],m):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},m.constrain=function(E){return arguments.length?(n=E,m):n},m.duration=function(E){return arguments.length?(l=+E,m):l},m.interpolate=function(E){return arguments.length?(u=E,m):u},m.on=function(){var E=c.on.apply(c,arguments);return E===c?m:E},m.clickDistance=function(E){return arguments.length?(w=(E=+E)*E,m):Math.sqrt(w)},m.tapDistance=function(E){return arguments.length?(S=+E,m):S},m}const Jt={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Do=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Iy=["Enter"," ","Escape"],Ry={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var ms;(function(e){e.Strict="strict",e.Loose="loose"})(ms||(ms={}));var dr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(dr||(dr={}));var $o;(function(e){e.Partial="partial",e.Full="full"})($o||($o={}));const Ty={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var In;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(In||(In={}));var Ol;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ol||(Ol={}));var X;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(X||(X={}));const mm={[X.Left]:X.Right,[X.Right]:X.Left,[X.Top]:X.Bottom,[X.Bottom]:X.Top};function Ly(e){return e===null?null:e?"valid":"invalid"}const Ay=e=>"id"in e&&"source"in e&&"target"in e,o_=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),sf=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),qo=(e,t=[0,0])=>{const{width:n,height:r}=vn(e),s=e.origin??t,o=n*s[0],i=r*s[1];return{x:e.position.x-o,y:e.position.y-i}},i_=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const o=typeof s=="string";let i=!t.nodeLookup&&!o?s:void 0;t.nodeLookup&&(i=o?t.nodeLookup.get(s):sf(s)?s:t.nodeLookup.get(s.id));const l=i?Fl(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return va(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return wa(n)},Zo=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(t.filter===void 0||t.filter(s))&&(n=va(n,Fl(s)),r=!0)}),r?wa(n):{x:0,y:0,width:0,height:0}},of=(e,t,[n,r,s]=[0,0,1],o=!1,i=!1)=>{const l={...ei(t,[n,r,s]),width:t.width/s,height:t.height/s},u=[];for(const c of e.values()){const{measured:h,selectable:d=!0,hidden:f=!1}=c;if(i&&!d||f)continue;const x=h.width??c.width??c.initialWidth??null,y=h.height??c.height??c.initialHeight??null,w=Oo(l,gs(c)),S=(x??0)*(y??0),m=o&&w>0;(!c.internals.handleBounds||m||w>=S||c.dragging)&&u.push(c)}return u},l_=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function a_(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function u_({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:o},i){if(e.size===0)return Promise.resolve(!0);const l=a_(e,i),u=Zo(l),c=lf(u,t,n,(i==null?void 0:i.minZoom)??s,(i==null?void 0:i.maxZoom)??o,(i==null?void 0:i.padding)??.1);return await r.setViewport(c,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)}function zy({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:o}){const i=n.get(e),l=i.parentId?n.get(i.parentId):void 0,{x:u,y:c}=l?l.internals.positionAbsolute:{x:0,y:0},h=i.origin??r;let d=i.extent||s;if(i.extent==="parent"&&!i.expandParent)if(!l)o==null||o("005",Jt.error005());else{const x=l.measured.width,y=l.measured.height;x&&y&&(d=[[u,c],[u+x,c+y]])}else l&&xs(i.extent)&&(d=[[i.extent[0][0]+u,i.extent[0][1]+c],[i.extent[1][0]+u,i.extent[1][1]+c]]);const f=xs(d)?wr(t,d,i.measured):t;return(i.measured.width===void 0||i.measured.height===void 0)&&(o==null||o("015",Jt.error015())),{position:{x:f.x-u+(i.measured.width??0)*h[0],y:f.y-c+(i.measured.height??0)*h[1]},positionAbsolute:f}}async function c_({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const o=new Set(e.map(f=>f.id)),i=[];for(const f of n){if(f.deletable===!1)continue;const x=o.has(f.id),y=!x&&f.parentId&&i.find(w=>w.id===f.parentId);(x||y)&&i.push(f)}const l=new Set(t.map(f=>f.id)),u=r.filter(f=>f.deletable!==!1),h=l_(i,u);for(const f of u)l.has(f.id)&&!h.find(y=>y.id===f.id)&&h.push(f);if(!s)return{edges:h,nodes:i};const d=await s({nodes:i,edges:h});return typeof d=="boolean"?d?{edges:h,nodes:i}:{edges:[],nodes:[]}:d}const ps=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),wr=(e={x:0,y:0},t,n)=>({x:ps(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:ps(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Dy(e,t,n){const{width:r,height:s}=vn(n),{x:o,y:i}=n.internals.positionAbsolute;return wr(e,[[o,i],[o+r,i+s]],t)}const pm=(e,t,n)=>e<t?ps(Math.abs(e-t),1,t)/t:e>n?-ps(Math.abs(e-n),1,t)/t:0,$y=(e,t,n=15,r=40)=>{const s=pm(e.x,r,t.width-r)*n,o=pm(e.y,r,t.height-r)*n;return[s,o]},va=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),zc=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),wa=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),gs=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=sf(e)?e.internals.positionAbsolute:qo(e,t);return{x:n,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},Fl=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=sf(e)?e.internals.positionAbsolute:qo(e,t);return{x:n,y:r,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},Oy=(e,t)=>wa(va(zc(e),zc(t))),Oo=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},gm=e=>It(e.width)&&It(e.height)&&It(e.x)&&It(e.y),It=e=>!isNaN(e)&&isFinite(e),d_=(e,t)=>{},Jo=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ei=({x:e,y:t},[n,r,s],o=!1,i=[1,1])=>{const l={x:(e-n)/s,y:(t-r)/s};return o?Jo(l,i):l},Hl=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function Mr(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function f_(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Mr(e,n),s=Mr(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Mr(e.top??e.y??0,n),s=Mr(e.bottom??e.y??0,n),o=Mr(e.left??e.x??0,t),i=Mr(e.right??e.x??0,t);return{top:r,right:i,bottom:s,left:o,x:o+i,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function h_(e,t,n,r,s,o){const{x:i,y:l}=Hl(e,[t,n,r]),{x:u,y:c}=Hl({x:e.x+e.width,y:e.y+e.height},[t,n,r]),h=s-u,d=o-c;return{left:Math.floor(i),top:Math.floor(l),right:Math.floor(h),bottom:Math.floor(d)}}const lf=(e,t,n,r,s,o)=>{const i=f_(o,t,n),l=(t-i.x)/e.width,u=(n-i.y)/e.height,c=Math.min(l,u),h=ps(c,r,s),d=e.x+e.width/2,f=e.y+e.height/2,x=t/2-d*h,y=n/2-f*h,w=h_(e,x,y,h,t,n),S={left:Math.min(w.left-i.left,0),top:Math.min(w.top-i.top,0),right:Math.min(w.right-i.right,0),bottom:Math.min(w.bottom-i.bottom,0)};return{x:x-S.left+S.right,y:y-S.top+S.bottom,zoom:h}},Fo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function xs(e){return e!=null&&e!=="parent"}function vn(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Fy(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function Hy(e,t={width:0,height:0},n,r,s){const o={...e},i=r.get(n);if(i){const l=i.origin||s;o.x+=i.internals.positionAbsolute.x-(t.width??0)*l[0],o.y+=i.internals.positionAbsolute.y-(t.height??0)*l[1]}return o}function xm(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function m_(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function p_(e){return{...Ry,...e||{}}}function fo(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:o,y:i}=Rt(e),l=ei({x:o-((s==null?void 0:s.left)??0),y:i-((s==null?void 0:s.top)??0)},r),{x:u,y:c}=n?Jo(l,t):l;return{xSnapped:u,ySnapped:c,...l}}const af=e=>({width:e.offsetWidth,height:e.offsetHeight}),Vy=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},g_=["INPUT","SELECT","TEXTAREA"];function By(e){var r,s;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:g_.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Uy=e=>"clientX"in e,Rt=(e,t)=>{var o,i;const n=Uy(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,s=n?e.clientY:(i=e.touches)==null?void 0:i[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},ym=(e,t,n,r,s)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(i=>{const l=i.getBoundingClientRect();return{id:i.getAttribute("data-handleid"),type:e,nodeId:s,position:i.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...af(i)}})};function Wy({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:o,targetControlX:i,targetControlY:l}){const u=e*.125+s*.375+i*.375+n*.125,c=t*.125+o*.375+l*.375+r*.125,h=Math.abs(u-e),d=Math.abs(c-t);return[u,c,h,d]}function _i(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function vm({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case X.Left:return[t-_i(t-r,o),n];case X.Right:return[t+_i(r-t,o),n];case X.Top:return[t,n-_i(n-s,o)];case X.Bottom:return[t,n+_i(s-n,o)]}}function Yy({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:s,targetPosition:o=X.Top,curvature:i=.25}){const[l,u]=vm({pos:n,x1:e,y1:t,x2:r,y2:s,c:i}),[c,h]=vm({pos:o,x1:r,y1:s,x2:e,y2:t,c:i}),[d,f,x,y]=Wy({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:l,sourceControlY:u,targetControlX:c,targetControlY:h});return[`M${e},${t} C${l},${u} ${c},${h} ${r},${s}`,d,f,x,y]}function Gy({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,o=n<e?n+s:n-s,i=Math.abs(r-t)/2,l=r<t?r+i:r-i;return[o,l,s,i]}function x_({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:s=!1,zIndexMode:o="basic"}){if(o==="manual")return r;const i=s&&n?r+1e3:r,l=Math.max(e.parentId||s&&e.selected?e.internals.z:0,t.parentId||s&&t.selected?t.internals.z:0);return i+l}function y_({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const o=va(Fl(e),Fl(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const i={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:r/s[2]};return Oo(i,wa(o))>0}const v_=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,w_=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),N_=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||v_;let s;return Ay(e)?s={...e}:s={...e,id:r(e)},w_(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function Ky({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,i,l]=Gy({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,i,l]}const wm={[X.Left]:{x:-1,y:0},[X.Right]:{x:1,y:0},[X.Top]:{x:0,y:-1},[X.Bottom]:{x:0,y:1}},S_=({source:e,sourcePosition:t=X.Bottom,target:n})=>t===X.Left||t===X.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Nm=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function b_({source:e,sourcePosition:t=X.Bottom,target:n,targetPosition:r=X.Top,center:s,offset:o,stepPosition:i}){const l=wm[t],u=wm[r],c={x:e.x+l.x*o,y:e.y+l.y*o},h={x:n.x+u.x*o,y:n.y+u.y*o},d=S_({source:c,sourcePosition:t,target:h}),f=d.x!==0?"x":"y",x=d[f];let y=[],w,S;const m={x:0,y:0},v={x:0,y:0},[,,g,N]=Gy({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[f]*u[f]===-1){f==="x"?(w=s.x??c.x+(h.x-c.x)*i,S=s.y??(c.y+h.y)/2):(w=s.x??(c.x+h.x)/2,S=s.y??c.y+(h.y-c.y)*i);const k=[{x:w,y:c.y},{x:w,y:h.y}],j=[{x:c.x,y:S},{x:h.x,y:S}];l[f]===x?y=f==="x"?k:j:y=f==="x"?j:k}else{const k=[{x:c.x,y:h.y}],j=[{x:h.x,y:c.y}];if(f==="x"?y=l.x===x?j:k:y=l.y===x?k:j,t===r){const R=Math.abs(e[f]-n[f]);if(R<=o){const F=Math.min(o-1,o-R);l[f]===x?m[f]=(c[f]>e[f]?-1:1)*F:v[f]=(h[f]>n[f]?-1:1)*F}}if(t!==r){const R=f==="x"?"y":"x",F=l[f]===u[R],E=c[R]>h[R],A=c[R]<h[R];(l[f]===1&&(!F&&E||F&&A)||l[f]!==1&&(!F&&A||F&&E))&&(y=f==="x"?k:j)}const _={x:c.x+m.x,y:c.y+m.y},I={x:h.x+v.x,y:h.y+v.y},D=Math.max(Math.abs(_.x-y[0].x),Math.abs(I.x-y[0].x)),T=Math.max(Math.abs(_.y-y[0].y),Math.abs(I.y-y[0].y));D>=T?(w=(_.x+I.x)/2,S=y[0].y):(w=y[0].x,S=(_.y+I.y)/2)}return[[e,{x:c.x+m.x,y:c.y+m.y},...y,{x:h.x+v.x,y:h.y+v.y},n],w,S,g,N]}function k_(e,t,n,r){const s=Math.min(Nm(e,t)/2,Nm(t,n)/2,r),{x:o,y:i}=t;if(e.x===o&&o===n.x||e.y===i&&i===n.y)return`L${o} ${i}`;if(e.y===i){const c=e.x<n.x?-1:1,h=e.y<n.y?1:-1;return`L ${o+s*c},${i}Q ${o},${i} ${o},${i+s*h}`}const l=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${o},${i+s*u}Q ${o},${i} ${o+s*l},${i}`}function Dc({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:s,targetPosition:o=X.Top,borderRadius:i=5,centerX:l,centerY:u,offset:c=20,stepPosition:h=.5}){const[d,f,x,y,w]=b_({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:o,center:{x:l,y:u},offset:c,stepPosition:h});return[d.reduce((m,v,g)=>{let N="";return g>0&&g<d.length-1?N=k_(d[g-1],v,d[g+1],i):N=`${g===0?"M":"L"}${v.x} ${v.y}`,m+=N,m},""),f,x,y,w]}function Sm(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function j_(e){var d;const{sourceNode:t,targetNode:n}=e;if(!Sm(t)||!Sm(n))return null;const r=t.internals.handleBounds||bm(t.handles),s=n.internals.handleBounds||bm(n.handles),o=km((r==null?void 0:r.source)??[],e.sourceHandle),i=km(e.connectionMode===ms.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!o||!i)return(d=e.onError)==null||d.call(e,"008",Jt.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(o==null?void 0:o.position)||X.Bottom,u=(i==null?void 0:i.position)||X.Top,c=Nr(t,o,l),h=Nr(n,i,u);return{sourceX:c.x,sourceY:c.y,targetX:h.x,targetY:h.y,sourcePosition:l,targetPosition:u}}function bm(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Nr(e,t,n=X.Left,r=!1){const s=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:i,height:l}=t??vn(e);if(r)return{x:s+i/2,y:o+l/2};switch((t==null?void 0:t.position)??n){case X.Top:return{x:s+i/2,y:o};case X.Right:return{x:s+i,y:o+l/2};case X.Bottom:return{x:s+i/2,y:o+l};case X.Left:return{x:s,y:o+l/2}}}function km(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function $c(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function C_(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const o=new Set;return e.reduce((i,l)=>([l.markerStart||r,l.markerEnd||s].forEach(u=>{if(u&&typeof u=="object"){const c=$c(u,t);o.has(c)||(i.push({id:c,color:u.color||n,...u}),o.add(c))}}),i),[]).sort((i,l)=>i.id.localeCompare(l.id))}const Xy=1e3,E_=10,uf={nodeOrigin:[0,0],nodeExtent:Do,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},__={...uf,checkEquality:!0};function cf(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function P_(e,t,n){const r=cf(uf,n);for(const s of e.values())if(s.parentId)ff(s,e,t,r);else{const o=qo(s,r.nodeOrigin),i=xs(s.extent)?s.extent:r.nodeExtent,l=wr(o,i,vn(s));s.internals.positionAbsolute=l}}function M_(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const s of e.handles){const o={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?n.push(o):s.type==="target"&&r.push(o)}return{source:n,target:r}}function df(e){return e==="manual"}function Oc(e,t,n,r={}){var c,h;const s=cf(__,r),o={i:0},i=new Map(t),l=s!=null&&s.elevateNodesOnSelect&&!df(s.zIndexMode)?Xy:0;let u=e.length>0;t.clear(),n.clear();for(const d of e){let f=i.get(d.id);if(s.checkEquality&&d===(f==null?void 0:f.internals.userNode))t.set(d.id,f);else{const x=qo(d,s.nodeOrigin),y=xs(d.extent)?d.extent:s.nodeExtent,w=wr(x,y,vn(d));f={...s.defaults,...d,measured:{width:(c=d.measured)==null?void 0:c.width,height:(h=d.measured)==null?void 0:h.height},internals:{positionAbsolute:w,handleBounds:M_(d,f),z:Qy(d,l,s.zIndexMode),userNode:d}},t.set(d.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(u=!1),d.parentId&&ff(f,t,n,r,o)}return u}function I_(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function ff(e,t,n,r,s){const{elevateNodesOnSelect:o,nodeOrigin:i,nodeExtent:l,zIndexMode:u}=cf(uf,r),c=e.parentId,h=t.get(c);if(!h){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}I_(e,n),s&&!h.parentId&&h.internals.rootParentIndex===void 0&&u==="auto"&&(h.internals.rootParentIndex=++s.i,h.internals.z=h.internals.z+s.i*E_),s&&h.internals.rootParentIndex!==void 0&&(s.i=h.internals.rootParentIndex);const d=o&&!df(u)?Xy:0,{x:f,y:x,z:y}=R_(e,h,i,l,d,u),{positionAbsolute:w}=e.internals,S=f!==w.x||x!==w.y;(S||y!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:S?{x:f,y:x}:w,z:y}})}function Qy(e,t,n){const r=It(e.zIndex)?e.zIndex:0;return df(n)?r:r+(e.selected?t:0)}function R_(e,t,n,r,s,o){const{x:i,y:l}=t.internals.positionAbsolute,u=vn(e),c=qo(e,n),h=xs(e.extent)?wr(c,e.extent,u):c;let d=wr({x:i+h.x,y:l+h.y},r,u);e.extent==="parent"&&(d=Dy(d,u,t));const f=Qy(e,s,o),x=t.internals.z??0;return{x:d.x,y:d.y,z:x>=f?x+1:f}}function hf(e,t,n,r=[0,0]){var i;const s=[],o=new Map;for(const l of e){const u=t.get(l.parentId);if(!u)continue;const c=((i=o.get(l.parentId))==null?void 0:i.expandedRect)??gs(u),h=Oy(c,l.rect);o.set(l.parentId,{expandedRect:h,parent:u})}return o.size>0&&o.forEach(({expandedRect:l,parent:u},c)=>{var g;const h=u.internals.positionAbsolute,d=vn(u),f=u.origin??r,x=l.x<h.x?Math.round(Math.abs(h.x-l.x)):0,y=l.y<h.y?Math.round(Math.abs(h.y-l.y)):0,w=Math.max(d.width,Math.round(l.width)),S=Math.max(d.height,Math.round(l.height)),m=(w-d.width)*f[0],v=(S-d.height)*f[1];(x>0||y>0||m||v)&&(s.push({id:c,type:"position",position:{x:u.position.x-x+m,y:u.position.y-y+v}}),(g=n.get(c))==null||g.forEach(N=>{e.some(b=>b.id===N.id)||s.push({id:N.id,type:"position",position:{x:N.position.x+x,y:N.position.y+y}})})),(d.width<l.width||d.height<l.height||x||y)&&s.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:w+(x?f[0]*x-m:0),height:S+(y?f[1]*y-v:0)}})}),s}function T_(e,t,n,r,s,o,i){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let u=!1;if(!l)return{changes:[],updatedInternals:u};const c=[],h=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(h.transform),f=[];for(const x of e.values()){const y=t.get(x.id);if(!y)continue;if(y.hidden){t.set(y.id,{...y,internals:{...y.internals,handleBounds:void 0}}),u=!0;continue}const w=af(x.nodeElement),S=y.measured.width!==w.width||y.measured.height!==w.height;if(!!(w.width&&w.height&&(S||!y.internals.handleBounds||x.force))){const v=x.nodeElement.getBoundingClientRect(),g=xs(y.extent)?y.extent:o;let{positionAbsolute:N}=y.internals;y.parentId&&y.extent==="parent"?N=Dy(N,w,t.get(y.parentId)):g&&(N=wr(N,g,w));const b={...y,measured:w,internals:{...y.internals,positionAbsolute:N,handleBounds:{source:ym("source",x.nodeElement,v,d,y.id),target:ym("target",x.nodeElement,v,d,y.id)}}};t.set(y.id,b),y.parentId&&ff(b,t,n,{nodeOrigin:s,zIndexMode:i}),u=!0,S&&(c.push({id:y.id,type:"dimensions",dimensions:w}),y.expandParent&&y.parentId&&f.push({id:y.id,parentId:y.parentId,rect:gs(b,s)}))}}if(f.length>0){const x=hf(f,t,n,s);c.push(...x)}return{changes:c,updatedInternals:u}}async function L_({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const i=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,o]],r),l=!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2]);return Promise.resolve(l)}function jm(e,t,n,r,s,o){let i=s;const l=r.get(i)||new Map;r.set(i,l.set(n,t)),i=`${s}-${e}`;const u=r.get(i)||new Map;if(r.set(i,u.set(n,t)),o){i=`${s}-${e}-${o}`;const c=r.get(i)||new Map;r.set(i,c.set(n,t))}}function qy(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:o,sourceHandle:i=null,targetHandle:l=null}=r,u={edgeId:r.id,source:s,target:o,sourceHandle:i,targetHandle:l},c=`${s}-${i}--${o}-${l}`,h=`${o}-${l}--${s}-${i}`;jm("source",u,h,e,s,i),jm("target",u,c,e,o,l),t.set(r.id,r)}}function Zy(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Zy(n,t):!1}function Cm(e,t,n){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function A_(e,t,n,r){const s=new Map;for(const[o,i]of e)if((i.selected||i.id===r)&&(!i.parentId||!Zy(i,e))&&(i.draggable||t&&typeof i.draggable>"u")){const l=e.get(o);l&&s.set(o,{id:o,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return s}function hu({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var i,l,u;const s=[];for(const[c,h]of t){const d=(i=n.get(c))==null?void 0:i.internals.userNode;d&&s.push({...d,position:h.position,dragging:r})}if(!e)return[s[0],s];const o=(l=n.get(e))==null?void 0:l.internals.userNode;return[o?{...o,position:((u=t.get(e))==null?void 0:u.position)||o.position,dragging:r}:s[0],s]}function z_({dragItems:e,snapGrid:t,x:n,y:r}){const s=e.values().next().value;if(!s)return null;const o={x:n-s.distance.x,y:r-s.distance.y},i=Jo(o,t);return{x:i.x-o.x,y:i.y-o.y}}function D_({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let o={x:null,y:null},i=0,l=new Map,u=!1,c={x:0,y:0},h=null,d=!1,f=null,x=!1,y=!1,w=null;function S({noDragClassName:v,handleSelector:g,domNode:N,isSelectable:b,nodeId:k,nodeClickDistance:j=0}){f=lt(N);function _({x:R,y:F}){const{nodeLookup:E,nodeExtent:A,snapGrid:M,snapToGrid:z,nodeOrigin:C,onNodeDrag:P,onSelectionDrag:L,onError:O,updateNodePositions:$}=t();o={x:R,y:F};let U=!1;const B=l.size>1,Y=B&&A?zc(Zo(l)):null,G=B&&z?z_({dragItems:l,snapGrid:M,x:R,y:F}):null;for(const[K,V]of l){if(!E.has(K))continue;let Q={x:R-V.distance.x,y:F-V.distance.y};z&&(Q=G?{x:Math.round(Q.x+G.x),y:Math.round(Q.y+G.y)}:Jo(Q,M));let re=null;if(B&&A&&!V.extent&&Y){const{positionAbsolute:q}=V.internals,ae=q.x-Y.x+A[0][0],he=q.x+V.measured.width-Y.x2+A[1][0],le=q.y-Y.y+A[0][1],Ve=q.y+V.measured.height-Y.y2+A[1][1];re=[[ae,le],[he,Ve]]}const{position:te,positionAbsolute:Z}=zy({nodeId:K,nextPosition:Q,nodeLookup:E,nodeExtent:re||A,nodeOrigin:C,onError:O});U=U||V.position.x!==te.x||V.position.y!==te.y,V.position=te,V.internals.positionAbsolute=Z}if(y=y||U,!!U&&($(l,!0),w&&(r||P||!k&&L))){const[K,V]=hu({nodeId:k,dragItems:l,nodeLookup:E});r==null||r(w,l,K,V),P==null||P(w,K,V),k||L==null||L(w,V)}}async function I(){if(!h)return;const{transform:R,panBy:F,autoPanSpeed:E,autoPanOnNodeDrag:A}=t();if(!A){u=!1,cancelAnimationFrame(i);return}const[M,z]=$y(c,h,E);(M!==0||z!==0)&&(o.x=(o.x??0)-M/R[2],o.y=(o.y??0)-z/R[2],await F({x:M,y:z})&&_(o)),i=requestAnimationFrame(I)}function D(R){var B;const{nodeLookup:F,multiSelectionActive:E,nodesDraggable:A,transform:M,snapGrid:z,snapToGrid:C,selectNodesOnDrag:P,onNodeDragStart:L,onSelectionDragStart:O,unselectNodesAndEdges:$}=t();d=!0,(!P||!b)&&!E&&k&&((B=F.get(k))!=null&&B.selected||$()),b&&P&&k&&(e==null||e(k));const U=fo(R.sourceEvent,{transform:M,snapGrid:z,snapToGrid:C,containerBounds:h});if(o=U,l=A_(F,A,U,k),l.size>0&&(n||L||!k&&O)){const[Y,G]=hu({nodeId:k,dragItems:l,nodeLookup:F});n==null||n(R.sourceEvent,l,Y,G),L==null||L(R.sourceEvent,Y,G),k||O==null||O(R.sourceEvent,G)}}const T=py().clickDistance(j).on("start",R=>{const{domNode:F,nodeDragThreshold:E,transform:A,snapGrid:M,snapToGrid:z}=t();h=(F==null?void 0:F.getBoundingClientRect())||null,x=!1,y=!1,w=R.sourceEvent,E===0&&D(R),o=fo(R.sourceEvent,{transform:A,snapGrid:M,snapToGrid:z,containerBounds:h}),c=Rt(R.sourceEvent,h)}).on("drag",R=>{const{autoPanOnNodeDrag:F,transform:E,snapGrid:A,snapToGrid:M,nodeDragThreshold:z,nodeLookup:C}=t(),P=fo(R.sourceEvent,{transform:E,snapGrid:A,snapToGrid:M,containerBounds:h});if(w=R.sourceEvent,(R.sourceEvent.type==="touchmove"&&R.sourceEvent.touches.length>1||k&&!C.has(k))&&(x=!0),!x){if(!u&&F&&d&&(u=!0,I()),!d){const L=Rt(R.sourceEvent,h),O=L.x-c.x,$=L.y-c.y;Math.sqrt(O*O+$*$)>z&&D(R)}(o.x!==P.xSnapped||o.y!==P.ySnapped)&&l&&d&&(c=Rt(R.sourceEvent,h),_(P))}}).on("end",R=>{if(!(!d||x)&&(u=!1,d=!1,cancelAnimationFrame(i),l.size>0)){const{nodeLookup:F,updateNodePositions:E,onNodeDragStop:A,onSelectionDragStop:M}=t();if(y&&(E(l,!1),y=!1),s||A||!k&&M){const[z,C]=hu({nodeId:k,dragItems:l,nodeLookup:F,dragging:!1});s==null||s(R.sourceEvent,l,z,C),A==null||A(R.sourceEvent,z,C),k||M==null||M(R.sourceEvent,C)}}}).filter(R=>{const F=R.target;return!R.button&&(!v||!Cm(F,`.${v}`,N))&&(!g||Cm(F,g,N))});f.call(T)}function m(){f==null||f.on(".drag",null)}return{update:S,destroy:m}}function $_(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())Oo(s,gs(o))>0&&r.push(o);return r}const O_=250;function F_(e,t,n,r){var l,u;let s=[],o=1/0;const i=$_(e,n,t+O_);for(const c of i){const h=[...((l=c.internals.handleBounds)==null?void 0:l.source)??[],...((u=c.internals.handleBounds)==null?void 0:u.target)??[]];for(const d of h){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:f,y:x}=Nr(c,d,d.position,!0),y=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(x-e.y,2));y>t||(y<o?(s=[{...d,x:f,y:x}],o=y):y===o&&s.push({...d,x:f,y:x}))}}if(!s.length)return null;if(s.length>1){const c=r.type==="source"?"target":"source";return s.find(h=>h.type===c)??s[0]}return s[0]}function Jy(e,t,n,r,s,o=!1){var c,h,d;const i=r.get(e);if(!i)return null;const l=s==="strict"?(c=i.internals.handleBounds)==null?void 0:c[t]:[...((h=i.internals.handleBounds)==null?void 0:h.source)??[],...((d=i.internals.handleBounds)==null?void 0:d.target)??[]],u=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return u&&o?{...u,...Nr(i,u,u.position,!0)}:u}function e0(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function H_(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const t0=()=>!0;function V_(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:o,isTarget:i,domNode:l,nodeLookup:u,lib:c,autoPanOnConnect:h,flowId:d,panBy:f,cancelConnection:x,onConnectStart:y,onConnect:w,onConnectEnd:S,isValidConnection:m=t0,onReconnectEnd:v,updateConnection:g,getTransform:N,getFromHandle:b,autoPanSpeed:k,dragThreshold:j=1,handleDomNode:_}){const I=Vy(e.target);let D=0,T;const{x:R,y:F}=Rt(e),E=e0(o,_),A=l==null?void 0:l.getBoundingClientRect();let M=!1;if(!A||!E)return;const z=Jy(s,E,r,u,t);if(!z)return;let C=Rt(e,A),P=!1,L=null,O=!1,$=null;function U(){if(!h||!A)return;const[te,Z]=$y(C,A,k);f({x:te,y:Z}),D=requestAnimationFrame(U)}const B={...z,nodeId:s,type:E,position:z.position},Y=u.get(s);let K={inProgress:!0,isValid:null,from:Nr(Y,B,X.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:Y,to:C,toHandle:null,toPosition:mm[B.position],toNode:null,pointer:C};function V(){M=!0,g(K),y==null||y(e,{nodeId:s,handleId:r,handleType:E})}j===0&&V();function Q(te){if(!M){const{x:Ve,y:wn}=Rt(te),nn=Ve-R,Zn=wn-F;if(!(nn*nn+Zn*Zn>j*j))return;V()}if(!b()||!B){re(te);return}const Z=N();C=Rt(te,A),T=F_(ei(C,Z,!1,[1,1]),n,u,B),P||(U(),P=!0);const q=n0(te,{handle:T,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:i?"target":"source",isValidConnection:m,doc:I,lib:c,flowId:d,nodeLookup:u});$=q.handleDomNode,L=q.connection,O=H_(!!T,q.isValid);const ae=u.get(s),he=ae?Nr(ae,B,X.Left,!0):K.from,le={...K,from:he,isValid:O,to:q.toHandle&&O?Hl({x:q.toHandle.x,y:q.toHandle.y},Z):C,toHandle:q.toHandle,toPosition:O&&q.toHandle?q.toHandle.position:mm[B.position],toNode:q.toHandle?u.get(q.toHandle.nodeId):null,pointer:C};g(le),K=le}function re(te){if(!("touches"in te&&te.touches.length>0)){if(M){(T||$)&&L&&O&&(w==null||w(L));const{inProgress:Z,...q}=K,ae={...q,toPosition:K.toHandle?K.toPosition:null};S==null||S(te,ae),o&&(v==null||v(te,ae))}x(),cancelAnimationFrame(D),P=!1,O=!1,L=null,$=null,I.removeEventListener("mousemove",Q),I.removeEventListener("mouseup",re),I.removeEventListener("touchmove",Q),I.removeEventListener("touchend",re)}}I.addEventListener("mousemove",Q),I.addEventListener("mouseup",re),I.addEventListener("touchmove",Q),I.addEventListener("touchend",re)}function n0(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:o,doc:i,lib:l,flowId:u,isValidConnection:c=t0,nodeLookup:h}){const d=o==="target",f=t?i.querySelector(`.${l}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x,y}=Rt(e),w=i.elementFromPoint(x,y),S=w!=null&&w.classList.contains(`${l}-flow__handle`)?w:f,m={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const v=e0(void 0,S),g=S.getAttribute("data-nodeid"),N=S.getAttribute("data-handleid"),b=S.classList.contains("connectable"),k=S.classList.contains("connectableend");if(!g||!v)return m;const j={source:d?g:r,sourceHandle:d?N:s,target:d?r:g,targetHandle:d?s:N};m.connection=j;const I=b&&k&&(n===ms.Strict?d&&v==="source"||!d&&v==="target":g!==r||N!==s);m.isValid=I&&c(j),m.toHandle=Jy(g,v,N,h,n,!0)}return m}const Fc={onPointerDown:V_,isValid:n0};function B_({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=lt(e);function o({translateExtent:l,width:u,height:c,zoomStep:h=1,pannable:d=!0,zoomable:f=!0,inversePan:x=!1}){const y=g=>{if(g.sourceEvent.type!=="wheel"||!t)return;const N=n(),b=g.sourceEvent.ctrlKey&&Fo()?10:1,k=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*h,j=N[2]*Math.pow(2,k*b);t.scaleTo(j)};let w=[0,0];const S=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(w=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},m=g=>{const N=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;const b=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],k=[b[0]-w[0],b[1]-w[1]];w=b;const j=r()*Math.max(N[2],Math.log(N[2]))*(x?-1:1),_={x:N[0]-k[0]*j,y:N[1]-k[1]*j},I=[[0,0],[u,c]];t.setViewportConstrained({x:_.x,y:_.y,zoom:N[2]},I,l)},v=My().on("start",S).on("zoom",d?m:null).on("zoom.wheel",f?y:null);s.call(v,{})}function i(){s.on("zoom",null)}return{update:o,destroy:i,pointer:_t}}const Na=e=>({x:e.x,y:e.y,zoom:e.k}),mu=({x:e,y:t,zoom:n})=>ya.translate(e,t).scale(n),Yr=(e,t)=>e.target.closest(`.${t}`),r0=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),U_=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,pu=(e,t=0,n=U_,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},s0=e=>{const t=e.ctrlKey&&Fo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function W_({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:i,onPanZoomStart:l,onPanZoom:u,onPanZoomEnd:c}){return h=>{if(Yr(h,t))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(h.ctrlKey&&i){const S=_t(h),m=s0(h),v=d*Math.pow(2,m);r.scaleTo(n,v,S,h);return}const f=h.deltaMode===1?20:1;let x=s===dr.Vertical?0:h.deltaX*f,y=s===dr.Horizontal?0:h.deltaY*f;!Fo()&&h.shiftKey&&s!==dr.Vertical&&(x=h.deltaY*f,y=0),r.translateBy(n,-(x/d)*o,-(y/d)*o,{internal:!0});const w=Na(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(h,w),e.panScrollTimeout=setTimeout(()=>{c==null||c(h,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(h,w))}}function Y_({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const o=r.type==="wheel",i=!t&&o&&!r.ctrlKey,l=Yr(r,e);if(r.ctrlKey&&o&&l&&r.preventDefault(),i||l)return null;r.preventDefault(),n.call(this,r,s)}}function G_({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,i,l;if((o=r.sourceEvent)!=null&&o.internal)return;const s=Na(r.transform);e.mouseButton=((i=r.sourceEvent)==null?void 0:i.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function K_({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return o=>{var i,l;e.usedRightMouseButton=!!(n&&r0(t,e.mouseButton??0)),(i=o.sourceEvent)!=null&&i.sync||r([o.transform.x,o.transform.y,o.transform.k]),s&&!((l=o.sourceEvent)!=null&&l.internal)&&(s==null||s(o.sourceEvent,Na(o.transform)))}}function X_({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:o}){return i=>{var l;if(!((l=i.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,o&&r0(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&o(i.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const u=Na(i.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(i.sourceEvent,u)},n?150:0)}}}function Q_({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:i,noWheelClassName:l,noPanClassName:u,lib:c,connectionInProgress:h}){return d=>{var S;const f=e||t,x=n&&d.ctrlKey,y=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Yr(d,`${c}-flow__node`)||Yr(d,`${c}-flow__edge`)))return!0;if(!r&&!f&&!s&&!o&&!n||i||h&&!y||Yr(d,l)&&y||Yr(d,u)&&(!y||s&&y&&!e)||!n&&d.ctrlKey&&y)return!1;if(!n&&d.type==="touchstart"&&((S=d.touches)==null?void 0:S.length)>1)return d.preventDefault(),!1;if(!f&&!s&&!x&&y||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||y)&&w}}function q_({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:o,onPanZoomStart:i,onPanZoomEnd:l,onDraggingChange:u}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),d=My().scaleExtent([t,n]).translateExtent(r),f=lt(e).call(d);v({x:s.x,y:s.y,zoom:ps(s.zoom,t,n)},[[0,0],[h.width,h.height]],r);const x=f.on("wheel.zoom"),y=f.on("dblclick.zoom");d.wheelDelta(s0);function w(T,R){return f?new Promise(F=>{d==null||d.interpolate((R==null?void 0:R.interpolate)==="linear"?co:el).transform(pu(f,R==null?void 0:R.duration,R==null?void 0:R.ease,()=>F(!0)),T)}):Promise.resolve(!1)}function S({noWheelClassName:T,noPanClassName:R,onPaneContextMenu:F,userSelectionActive:E,panOnScroll:A,panOnDrag:M,panOnScrollMode:z,panOnScrollSpeed:C,preventScrolling:P,zoomOnPinch:L,zoomOnScroll:O,zoomOnDoubleClick:$,zoomActivationKeyPressed:U,lib:B,onTransformChange:Y,connectionInProgress:G,paneClickDistance:K,selectionOnDrag:V}){E&&!c.isZoomingOrPanning&&m();const Q=A&&!U&&!E;d.clickDistance(V?1/0:!It(K)||K<0?0:K);const re=Q?W_({zoomPanValues:c,noWheelClassName:T,d3Selection:f,d3Zoom:d,panOnScrollMode:z,panOnScrollSpeed:C,zoomOnPinch:L,onPanZoomStart:i,onPanZoom:o,onPanZoomEnd:l}):Y_({noWheelClassName:T,preventScrolling:P,d3ZoomHandler:x});if(f.on("wheel.zoom",re,{passive:!1}),!E){const Z=G_({zoomPanValues:c,onDraggingChange:u,onPanZoomStart:i});d.on("start",Z);const q=K_({zoomPanValues:c,panOnDrag:M,onPaneContextMenu:!!F,onPanZoom:o,onTransformChange:Y});d.on("zoom",q);const ae=X_({zoomPanValues:c,panOnDrag:M,panOnScroll:A,onPaneContextMenu:F,onPanZoomEnd:l,onDraggingChange:u});d.on("end",ae)}const te=Q_({zoomActivationKeyPressed:U,panOnDrag:M,zoomOnScroll:O,panOnScroll:A,zoomOnDoubleClick:$,zoomOnPinch:L,userSelectionActive:E,noPanClassName:R,noWheelClassName:T,lib:B,connectionInProgress:G});d.filter(te),$?f.on("dblclick.zoom",y):f.on("dblclick.zoom",null)}function m(){d.on("zoom",null)}async function v(T,R,F){const E=mu(T),A=d==null?void 0:d.constrain()(E,R,F);return A&&await w(A),new Promise(M=>M(A))}async function g(T,R){const F=mu(T);return await w(F,R),new Promise(E=>E(F))}function N(T){if(f){const R=mu(T),F=f.property("__zoom");(F.k!==T.zoom||F.x!==T.x||F.y!==T.y)&&(d==null||d.transform(f,R,null,{sync:!0}))}}function b(){const T=f?Py(f.node()):{x:0,y:0,k:1};return{x:T.x,y:T.y,zoom:T.k}}function k(T,R){return f?new Promise(F=>{d==null||d.interpolate((R==null?void 0:R.interpolate)==="linear"?co:el).scaleTo(pu(f,R==null?void 0:R.duration,R==null?void 0:R.ease,()=>F(!0)),T)}):Promise.resolve(!1)}function j(T,R){return f?new Promise(F=>{d==null||d.interpolate((R==null?void 0:R.interpolate)==="linear"?co:el).scaleBy(pu(f,R==null?void 0:R.duration,R==null?void 0:R.ease,()=>F(!0)),T)}):Promise.resolve(!1)}function _(T){d==null||d.scaleExtent(T)}function I(T){d==null||d.translateExtent(T)}function D(T){const R=!It(T)||T<0?0:T;d==null||d.clickDistance(R)}return{update:S,destroy:m,setViewport:g,setViewportConstrained:v,getViewport:b,scaleTo:k,scaleBy:j,setScaleExtent:_,setTranslateExtent:I,syncViewport:N,setClickDistance:D}}var ys;(function(e){e.Line="line",e.Handle="handle"})(ys||(ys={}));function Z_({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:o}){const i=e-t,l=n-r,u=[i>0?1:i<0?-1:0,l>0?1:l<0?-1:0];return i&&s&&(u[0]=u[0]*-1),l&&o&&(u[1]=u[1]*-1),u}function Em(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:s}}function kn(e,t){return Math.max(0,t-e)}function jn(e,t){return Math.max(0,e-t)}function Pi(e,t,n){return Math.max(0,t-e,e-n)}function _m(e,t){return e?!t:t}function J_(e,t,n,r,s,o,i,l){let{affectsX:u,affectsY:c}=t;const{isHorizontal:h,isVertical:d}=t,f=h&&d,{xSnapped:x,ySnapped:y}=n,{minWidth:w,maxWidth:S,minHeight:m,maxHeight:v}=r,{x:g,y:N,width:b,height:k,aspectRatio:j}=e;let _=Math.floor(h?x-e.pointerX:0),I=Math.floor(d?y-e.pointerY:0);const D=b+(u?-_:_),T=k+(c?-I:I),R=-o[0]*b,F=-o[1]*k;let E=Pi(D,w,S),A=Pi(T,m,v);if(i){let C=0,P=0;u&&_<0?C=kn(g+_+R,i[0][0]):!u&&_>0&&(C=jn(g+D+R,i[1][0])),c&&I<0?P=kn(N+I+F,i[0][1]):!c&&I>0&&(P=jn(N+T+F,i[1][1])),E=Math.max(E,C),A=Math.max(A,P)}if(l){let C=0,P=0;u&&_>0?C=jn(g+_,l[0][0]):!u&&_<0&&(C=kn(g+D,l[1][0])),c&&I>0?P=jn(N+I,l[0][1]):!c&&I<0&&(P=kn(N+T,l[1][1])),E=Math.max(E,C),A=Math.max(A,P)}if(s){if(h){const C=Pi(D/j,m,v)*j;if(E=Math.max(E,C),i){let P=0;!u&&!c||u&&!c&&f?P=jn(N+F+D/j,i[1][1])*j:P=kn(N+F+(u?_:-_)/j,i[0][1])*j,E=Math.max(E,P)}if(l){let P=0;!u&&!c||u&&!c&&f?P=kn(N+D/j,l[1][1])*j:P=jn(N+(u?_:-_)/j,l[0][1])*j,E=Math.max(E,P)}}if(d){const C=Pi(T*j,w,S)/j;if(A=Math.max(A,C),i){let P=0;!u&&!c||c&&!u&&f?P=jn(g+T*j+R,i[1][0])/j:P=kn(g+(c?I:-I)*j+R,i[0][0])/j,A=Math.max(A,P)}if(l){let P=0;!u&&!c||c&&!u&&f?P=kn(g+T*j,l[1][0])/j:P=jn(g+(c?I:-I)*j,l[0][0])/j,A=Math.max(A,P)}}}I=I+(I<0?A:-A),_=_+(_<0?E:-E),s&&(f?D>T*j?I=(_m(u,c)?-_:_)/j:_=(_m(u,c)?-I:I)*j:h?(I=_/j,c=u):(_=I*j,u=c));const M=u?g+_:g,z=c?N+I:N;return{width:b+(u?-_:_),height:k+(c?-I:I),x:o[0]*_*(u?-1:1)+M,y:o[1]*I*(c?-1:1)+z}}const o0={width:0,height:0,x:0,y:0},e3={...o0,pointerX:0,pointerY:0,aspectRatio:1};function t3(e){return[[0,0],[e.measured.width,e.measured.height]]}function n3(e,t,n){const r=t.position.x+e.position.x,s=t.position.y+e.position.y,o=e.measured.width??0,i=e.measured.height??0,l=n[0]*o,u=n[1]*i;return[[r-l,s-u],[r+o-l,s+i-u]]}function r3({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const o=lt(e);let i={controlDirection:Em("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:c,boundaries:h,keepAspectRatio:d,resizeDirection:f,onResizeStart:x,onResize:y,onResizeEnd:w,shouldResize:S}){let m={...o0},v={...e3};i={boundaries:h,resizeDirection:f,keepAspectRatio:d,controlDirection:Em(c)};let g,N=null,b=[],k,j,_,I=!1;const D=py().on("start",T=>{const{nodeLookup:R,transform:F,snapGrid:E,snapToGrid:A,nodeOrigin:M,paneDomNode:z}=n();if(g=R.get(t),!g)return;N=(z==null?void 0:z.getBoundingClientRect())??null;const{xSnapped:C,ySnapped:P}=fo(T.sourceEvent,{transform:F,snapGrid:E,snapToGrid:A,containerBounds:N});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},v={...m,pointerX:C,pointerY:P,aspectRatio:m.width/m.height},k=void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(k=R.get(g.parentId),j=k&&g.extent==="parent"?t3(k):void 0),b=[],_=void 0;for(const[L,O]of R)if(O.parentId===t&&(b.push({id:L,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const $=n3(O,g,O.origin??M);_?_=[[Math.min($[0][0],_[0][0]),Math.min($[0][1],_[0][1])],[Math.max($[1][0],_[1][0]),Math.max($[1][1],_[1][1])]]:_=$}x==null||x(T,{...m})}).on("drag",T=>{const{transform:R,snapGrid:F,snapToGrid:E,nodeOrigin:A}=n(),M=fo(T.sourceEvent,{transform:R,snapGrid:F,snapToGrid:E,containerBounds:N}),z=[];if(!g)return;const{x:C,y:P,width:L,height:O}=m,$={},U=g.origin??A,{width:B,height:Y,x:G,y:K}=J_(v,i.controlDirection,M,i.boundaries,i.keepAspectRatio,U,j,_),V=B!==L,Q=Y!==O,re=G!==C&&V,te=K!==P&&Q;if(!re&&!te&&!V&&!Q)return;if((re||te||U[0]===1||U[1]===1)&&($.x=re?G:m.x,$.y=te?K:m.y,m.x=$.x,m.y=$.y,b.length>0)){const he=G-C,le=K-P;for(const Ve of b)Ve.position={x:Ve.position.x-he+U[0]*(B-L),y:Ve.position.y-le+U[1]*(Y-O)},z.push(Ve)}if((V||Q)&&($.width=V&&(!i.resizeDirection||i.resizeDirection==="horizontal")?B:m.width,$.height=Q&&(!i.resizeDirection||i.resizeDirection==="vertical")?Y:m.height,m.width=$.width,m.height=$.height),k&&g.expandParent){const he=U[0]*($.width??0);$.x&&$.x<he&&(m.x=he,v.x=v.x-($.x-he));const le=U[1]*($.height??0);$.y&&$.y<le&&(m.y=le,v.y=v.y-($.y-le))}const Z=Z_({width:m.width,prevWidth:L,height:m.height,prevHeight:O,affectsX:i.controlDirection.affectsX,affectsY:i.controlDirection.affectsY}),q={...m,direction:Z};(S==null?void 0:S(T,q))!==!1&&(I=!0,y==null||y(T,q),r($,z))}).on("end",T=>{I&&(w==null||w(T,{...m}),s==null||s({...m}),I=!1)});o.call(D)}function u(){o.on(".drag",null)}return{update:l,destroy:u}}var i0={exports:{}},l0={},a0={exports:{}},u0={};/**
302
+ * @license React
303
+ * use-sync-external-store-shim.production.js
304
+ *
305
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
306
+ *
307
+ * This source code is licensed under the MIT license found in the
308
+ * LICENSE file in the root directory of this source tree.
309
+ */var vs=p;function s3(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var o3=typeof Object.is=="function"?Object.is:s3,i3=vs.useState,l3=vs.useEffect,a3=vs.useLayoutEffect,u3=vs.useDebugValue;function c3(e,t){var n=t(),r=i3({inst:{value:n,getSnapshot:t}}),s=r[0].inst,o=r[1];return a3(function(){s.value=n,s.getSnapshot=t,gu(s)&&o({inst:s})},[e,n,t]),l3(function(){return gu(s)&&o({inst:s}),e(function(){gu(s)&&o({inst:s})})},[e]),u3(n),n}function gu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o3(e,n)}catch{return!0}}function d3(e,t){return t()}var f3=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d3:c3;u0.useSyncExternalStore=vs.useSyncExternalStore!==void 0?vs.useSyncExternalStore:f3;a0.exports=u0;var h3=a0.exports;/**
310
+ * @license React
311
+ * use-sync-external-store-shim/with-selector.production.js
312
+ *
313
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
314
+ *
315
+ * This source code is licensed under the MIT license found in the
316
+ * LICENSE file in the root directory of this source tree.
317
+ */var Sa=p,m3=h3;function p3(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var g3=typeof Object.is=="function"?Object.is:p3,x3=m3.useSyncExternalStore,y3=Sa.useRef,v3=Sa.useEffect,w3=Sa.useMemo,N3=Sa.useDebugValue;l0.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var o=y3(null);if(o.current===null){var i={hasValue:!1,value:null};o.current=i}else i=o.current;o=w3(function(){function u(x){if(!c){if(c=!0,h=x,x=r(x),s!==void 0&&i.hasValue){var y=i.value;if(s(y,x))return d=y}return d=x}if(y=d,g3(h,x))return y;var w=r(x);return s!==void 0&&s(y,w)?(h=x,y):(h=x,d=w)}var c=!1,h,d,f=n===void 0?null:n;return[function(){return u(t())},f===null?void 0:function(){return u(f())}]},[t,n,r,s]);var l=x3(e,o[0],o[1]);return v3(function(){i.hasValue=!0,i.value=l},[l]),N3(l),l};i0.exports=l0;var S3=i0.exports;const b3=Wc(S3),k3={},Pm=e=>{let t;const n=new Set,r=(h,d)=>{const f=typeof h=="function"?h(t):h;if(!Object.is(f,t)){const x=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(y=>y(t,x))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>c,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(k3?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,s,u);return u},j3=e=>e?Pm(e):Pm,{useDebugValue:C3}=Ut,{useSyncExternalStoreWithSelector:E3}=b3,_3=e=>e;function c0(e,t=_3,n){const r=E3(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return C3(r),r}const Mm=(e,t)=>{const n=j3(e),r=(s,o=t)=>c0(n,s,o);return Object.assign(r,n),r},P3=(e,t)=>e?Mm(e,t):Mm;function ve(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const ba=p.createContext(null),M3=ba.Provider,d0=Jt.error001();function oe(e,t){const n=p.useContext(ba);if(n===null)throw new Error(d0);return c0(n,e,t)}function we(){const e=p.useContext(ba);if(e===null)throw new Error(d0);return p.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Im={display:"none"},I3={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},f0="react-flow__node-desc",h0="react-flow__edge-desc",R3="react-flow__aria-live",T3=e=>e.ariaLiveMessage,L3=e=>e.ariaLabelConfig;function A3({rfId:e}){const t=oe(T3);return a.jsx("div",{id:`${R3}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:I3,children:t})}function z3({rfId:e,disableKeyboardA11y:t}){const n=oe(L3);return a.jsxs(a.Fragment,{children:[a.jsx("div",{id:`${f0}-${e}`,style:Im,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),a.jsx("div",{id:`${h0}-${e}`,style:Im,children:n["edge.a11yDescription.default"]}),!t&&a.jsx(A3,{rfId:e})]})}const ka=p.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},o)=>{const i=`${e}`.split("-");return a.jsx("div",{className:Me(["react-flow__panel",n,...i]),style:r,ref:o,...s,children:t})});ka.displayName="Panel";function D3({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:a.jsx(ka,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:a.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const $3=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Mi=e=>e.id;function O3(e,t){return ve(e.selectedNodes.map(Mi),t.selectedNodes.map(Mi))&&ve(e.selectedEdges.map(Mi),t.selectedEdges.map(Mi))}function F3({onSelectionChange:e}){const t=we(),{selectedNodes:n,selectedEdges:r}=oe($3,O3);return p.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(o=>o(s))},[n,r,e]),null}const H3=e=>!!e.onSelectionChangeHandlers;function V3({onSelectionChange:e}){const t=oe(H3);return e||t?a.jsx(F3,{onSelectionChange:e}):null}const m0=[0,0],B3={x:0,y:0,zoom:1},U3=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Rm=[...U3,"rfId"],W3=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Tm={translateExtent:Do,nodeOrigin:m0,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Y3(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:i,reset:l,setDefaultNodesAndEdges:u}=oe(W3,ve),c=we();p.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{h.current=Tm,l()}),[]);const h=p.useRef(Tm);return p.useEffect(()=>{for(const d of Rm){const f=e[d],x=h.current[d];f!==x&&(typeof e[d]>"u"||(d==="nodes"?t(f):d==="edges"?n(f):d==="minZoom"?r(f):d==="maxZoom"?s(f):d==="translateExtent"?o(f):d==="nodeExtent"?i(f):d==="ariaLabelConfig"?c.setState({ariaLabelConfig:p_(f)}):d==="fitView"?c.setState({fitViewQueued:f}):d==="fitViewOptions"?c.setState({fitViewOptions:f}):c.setState({[d]:f})))}h.current=e},Rm.map(d=>e[d])),null}function Lm(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function G3(e){var r;const[t,n]=p.useState(e==="system"?null:e);return p.useEffect(()=>{if(e!=="system"){n(e);return}const s=Lm(),o=()=>n(s!=null&&s.matches?"dark":"light");return o(),s==null||s.addEventListener("change",o),()=>{s==null||s.removeEventListener("change",o)}},[e]),t!==null?t:(r=Lm())!=null&&r.matches?"dark":"light"}const Am=typeof document<"u"?document:null;function Ho(e=null,t={target:Am,actInsideInputWithModifier:!0}){const[n,r]=p.useState(!1),s=p.useRef(!1),o=p.useRef(new Set([])),[i,l]=p.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
318
+ `).replace(`
319
+
320
+ `,`
321
+ +`).split(`
322
+ `)),h=c.reduce((d,f)=>d.concat(...f),[]);return[c,h]}return[[],[]]},[e]);return p.useEffect(()=>{const u=(t==null?void 0:t.target)??Am,c=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=x=>{var S,m;if(s.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!s.current||s.current&&!c)&&By(x))return!1;const w=Dm(x.code,l);if(o.current.add(x[w]),zm(i,o.current,!1)){const v=((m=(S=x.composedPath)==null?void 0:S.call(x))==null?void 0:m[0])||x.target,g=(v==null?void 0:v.nodeName)==="BUTTON"||(v==null?void 0:v.nodeName)==="A";t.preventDefault!==!1&&(s.current||!g)&&x.preventDefault(),r(!0)}},d=x=>{const y=Dm(x.code,l);zm(i,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(x[y]),x.key==="Meta"&&o.current.clear(),s.current=!1},f=()=>{o.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",h),u==null||u.addEventListener("keyup",d),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{u==null||u.removeEventListener("keydown",h),u==null||u.removeEventListener("keyup",d),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function zm(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function Dm(e,t){return t.includes(e)?"code":"key"}const K3=()=>{const e=we();return p.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,o],panZoom:i}=e.getState();return i?(await i.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??o},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:o,maxZoom:i,panZoom:l}=e.getState(),u=lf(t,r,s,o,i,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(u,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:s,snapToGrid:o,domNode:i}=e.getState();if(!i)return t;const{x:l,y:u}=i.getBoundingClientRect(),c={x:t.x-l,y:t.y-u},h=n.snapGrid??s,d=n.snapToGrid??o;return ei(c,r,d,h)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:o}=r.getBoundingClientRect(),i=Hl(t,n);return{x:i.x+s,y:i.y+o}}}),[])};function p0(e,t){const n=[],r=new Map,s=[];for(const o of e)if(o.type==="add"){s.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const i=r.get(o.id);i?i.push(o):r.set(o.id,[o])}for(const o of t){const i=r.get(o.id);if(!i){n.push(o);continue}if(i[0].type==="remove")continue;if(i[0].type==="replace"){n.push({...i[0].item});continue}const l={...o};for(const u of i)X3(u,l);n.push(l)}return s.length&&s.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function X3(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function Q3(e,t){return p0(e,t)}function q3(e,t){return p0(e,t)}function tr(e,t){return{id:e,type:"select",selected:t}}function Gr(e,t=new Set,n=!1){const r=[];for(const[s,o]of e){const i=t.has(s);!(o.selected===void 0&&!i)&&o.selected!==i&&(n&&(o.selected=i),r.push(tr(o.id,i)))}return r}function $m({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,i]of e.entries()){const l=t.get(i.id),u=((s=l==null?void 0:l.internals)==null?void 0:s.userNode)??l;u!==void 0&&u!==i&&n.push({id:i.id,item:i,type:"replace"}),u===void 0&&n.push({item:i,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function Om(e){return{id:e.id,type:"remove"}}const Fm=e=>o_(e),Z3=e=>Ay(e);function g0(e){return p.forwardRef(e)}const J3=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Hm(e){const[t,n]=p.useState(BigInt(0)),[r]=p.useState(()=>e4(()=>n(s=>s+BigInt(1))));return J3(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function e4(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const x0=p.createContext(null);function t4({children:e}){const t=we(),n=p.useCallback(l=>{const{nodes:u=[],setNodes:c,hasDefaultNodes:h,onNodesChange:d,nodeLookup:f,fitViewQueued:x,onNodesChangeMiddlewareMap:y}=t.getState();let w=u;for(const m of l)w=typeof m=="function"?m(w):m;let S=$m({items:w,lookup:f});for(const m of y.values())S=m(S);h&&c(w),S.length>0?d==null||d(S):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:m,nodes:v,setNodes:g}=t.getState();m&&g(v)})},[]),r=Hm(n),s=p.useCallback(l=>{const{edges:u=[],setEdges:c,hasDefaultEdges:h,onEdgesChange:d,edgeLookup:f}=t.getState();let x=u;for(const y of l)x=typeof y=="function"?y(x):y;h?c(x):d&&d($m({items:x,lookup:f}))},[]),o=Hm(s),i=p.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return a.jsx(x0.Provider,{value:i,children:e})}function n4(){const e=p.useContext(x0);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const r4=e=>!!e.panZoom;function mf(){const e=K3(),t=we(),n=n4(),r=oe(r4),s=p.useMemo(()=>{const o=d=>t.getState().nodeLookup.get(d),i=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},u=d=>{var m,v;const{nodeLookup:f,nodeOrigin:x}=t.getState(),y=Fm(d)?d:f.get(d.id),w=y.parentId?Hy(y.position,y.measured,y.parentId,f,x):y.position,S={...y,position:w,width:((m=y.measured)==null?void 0:m.width)??y.width,height:((v=y.measured)==null?void 0:v.height)??y.height};return gs(S)},c=(d,f,x={replace:!1})=>{i(y=>y.map(w=>{if(w.id===d){const S=typeof f=="function"?f(w):f;return x.replace&&Fm(S)?S:{...w,...S}}return w}))},h=(d,f,x={replace:!1})=>{l(y=>y.map(w=>{if(w.id===d){const S=typeof f=="function"?f(w):f;return x.replace&&Z3(S)?S:{...w,...S}}return w}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var f;return(f=o(d))==null?void 0:f.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(f=>({...f}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:i,setEdges:l,addNodes:d=>{const f=Array.isArray(d)?d:[d];n.nodeQueue.push(x=>[...x,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(x=>[...x,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:x}=t.getState(),[y,w,S]=x;return{nodes:d.map(m=>({...m})),edges:f.map(m=>({...m})),viewport:{x:y,y:w,zoom:S}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:x,edges:y,onNodesDelete:w,onEdgesDelete:S,triggerNodeChanges:m,triggerEdgeChanges:v,onDelete:g,onBeforeDelete:N}=t.getState(),{nodes:b,edges:k}=await c_({nodesToRemove:d,edgesToRemove:f,nodes:x,edges:y,onBeforeDelete:N}),j=k.length>0,_=b.length>0;if(j){const I=k.map(Om);S==null||S(k),v(I)}if(_){const I=b.map(Om);w==null||w(b),m(I)}return(_||j)&&(g==null||g({nodes:b,edges:k})),{deletedNodes:b,deletedEdges:k}},getIntersectingNodes:(d,f=!0,x)=>{const y=gm(d),w=y?d:u(d),S=x!==void 0;return w?(x||t.getState().nodes).filter(m=>{const v=t.getState().nodeLookup.get(m.id);if(v&&!y&&(m.id===d.id||!v.internals.positionAbsolute))return!1;const g=gs(S?m:v),N=Oo(g,w);return f&&N>0||N>=g.width*g.height||N>=w.width*w.height}):[]},isNodeIntersecting:(d,f,x=!0)=>{const w=gm(d)?d:u(d);if(!w)return!1;const S=Oo(w,f);return x&&S>0||S>=f.width*f.height||S>=w.width*w.height},updateNode:c,updateNodeData:(d,f,x={replace:!1})=>{c(d,y=>{const w=typeof f=="function"?f(y):f;return x.replace?{...y,data:w}:{...y,data:{...y.data,...w}}},x)},updateEdge:h,updateEdgeData:(d,f,x={replace:!1})=>{h(d,y=>{const w=typeof f=="function"?f(y):f;return x.replace?{...y,data:w}:{...y,data:{...y.data,...w}}},x)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:x}=t.getState();return i_(d,{nodeLookup:f,nodeOrigin:x})},getHandleConnections:({type:d,id:f,nodeId:x})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${x}-${d}${f?`-${f}`:""}`))==null?void 0:y.values())??[])},getNodeConnections:({type:d,handleId:f,nodeId:x})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${x}${d?f?`-${d}-${f}`:`-${d}`:""}`))==null?void 0:y.values())??[])},fitView:async d=>{const f=t.getState().fitViewResolver??m_();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:f}),n.nodeQueue.push(x=>[...x]),f.promise}}},[]);return p.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const Vm=e=>e.selected,s4=typeof window<"u"?window:void 0;function o4({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=we(),{deleteElements:r}=mf(),s=Ho(e,{actInsideInputWithModifier:!1}),o=Ho(t,{target:s4});p.useEffect(()=>{if(s){const{edges:i,nodes:l}=n.getState();r({nodes:l.filter(Vm),edges:i.filter(Vm)}),n.setState({nodesSelectionActive:!1})}},[s]),p.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function i4(e){const t=we();p.useEffect(()=>{const n=()=>{var s,o,i,l;if(!e.current||!(((o=(s=e.current).checkVisibility)==null?void 0:o.call(s))??!0))return!1;const r=af(e.current);(r.height===0||r.width===0)&&((l=(i=t.getState()).onError)==null||l.call(i,"004",Jt.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const ja={position:"absolute",width:"100%",height:"100%",top:0,left:0},l4=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function a4({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=dr.Free,zoomOnDoubleClick:i=!0,panOnDrag:l=!0,defaultViewport:u,translateExtent:c,minZoom:h,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:x=!0,children:y,noWheelClassName:w,noPanClassName:S,onViewportChange:m,isControlledViewport:v,paneClickDistance:g,selectionOnDrag:N}){const b=we(),k=p.useRef(null),{userSelectionActive:j,lib:_,connectionInProgress:I}=oe(l4,ve),D=Ho(f),T=p.useRef();i4(k);const R=p.useCallback(F=>{m==null||m({x:F[0],y:F[1],zoom:F[2]}),v||b.setState({transform:F})},[m,v]);return p.useEffect(()=>{if(k.current){T.current=q_({domNode:k.current,minZoom:h,maxZoom:d,translateExtent:c,viewport:u,onDraggingChange:M=>b.setState({paneDragging:M}),onPanZoomStart:(M,z)=>{const{onViewportChangeStart:C,onMoveStart:P}=b.getState();P==null||P(M,z),C==null||C(z)},onPanZoom:(M,z)=>{const{onViewportChange:C,onMove:P}=b.getState();P==null||P(M,z),C==null||C(z)},onPanZoomEnd:(M,z)=>{const{onViewportChangeEnd:C,onMoveEnd:P}=b.getState();P==null||P(M,z),C==null||C(z)}});const{x:F,y:E,zoom:A}=T.current.getViewport();return b.setState({panZoom:T.current,transform:[F,E,A],domNode:k.current.closest(".react-flow")}),()=>{var M;(M=T.current)==null||M.destroy()}}},[]),p.useEffect(()=>{var F;(F=T.current)==null||F.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:i,panOnDrag:l,zoomActivationKeyPressed:D,preventScrolling:x,noPanClassName:S,userSelectionActive:j,noWheelClassName:w,lib:_,onTransformChange:R,connectionInProgress:I,selectionOnDrag:N,paneClickDistance:g})},[e,t,n,r,s,o,i,l,D,x,S,j,w,_,R,I,N,g]),a.jsx("div",{className:"react-flow__renderer",ref:k,style:ja,children:y})}const u4=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function c4(){const{userSelectionActive:e,userSelectionRect:t}=oe(u4,ve);return e&&t?a.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const xu=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},d4=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function f4({isSelecting:e,selectionKeyPressed:t,selectionMode:n=$o.Full,panOnDrag:r,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:i,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:c,onPaneScroll:h,onPaneMouseEnter:d,onPaneMouseMove:f,onPaneMouseLeave:x,children:y}){const w=we(),{userSelectionActive:S,elementsSelectable:m,dragging:v,connectionInProgress:g}=oe(d4,ve),N=m&&(e||S),b=p.useRef(null),k=p.useRef(),j=p.useRef(new Set),_=p.useRef(new Set),I=p.useRef(!1),D=C=>{if(I.current||g){I.current=!1;return}u==null||u(C),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},T=C=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){C.preventDefault();return}c==null||c(C)},R=h?C=>h(C):void 0,F=C=>{I.current&&(C.stopPropagation(),I.current=!1)},E=C=>{var Y,G;const{domNode:P}=w.getState();if(k.current=P==null?void 0:P.getBoundingClientRect(),!k.current)return;const L=C.target===b.current;if(!L&&!!C.target.closest(".nokey")||!e||!(o&&L||t)||C.button!==0||!C.isPrimary)return;(G=(Y=C.target)==null?void 0:Y.setPointerCapture)==null||G.call(Y,C.pointerId),I.current=!1;const{x:U,y:B}=Rt(C.nativeEvent,k.current);w.setState({userSelectionRect:{width:0,height:0,startX:U,startY:B,x:U,y:B}}),L||(C.stopPropagation(),C.preventDefault())},A=C=>{const{userSelectionRect:P,transform:L,nodeLookup:O,edgeLookup:$,connectionLookup:U,triggerNodeChanges:B,triggerEdgeChanges:Y,defaultEdgeOptions:G,resetSelectedElements:K}=w.getState();if(!k.current||!P)return;const{x:V,y:Q}=Rt(C.nativeEvent,k.current),{startX:re,startY:te}=P;if(!I.current){const le=t?0:s;if(Math.hypot(V-re,Q-te)<=le)return;K(),i==null||i(C)}I.current=!0;const Z={startX:re,startY:te,x:V<re?V:re,y:Q<te?Q:te,width:Math.abs(V-re),height:Math.abs(Q-te)},q=j.current,ae=_.current;j.current=new Set(of(O,Z,L,n===$o.Partial,!0).map(le=>le.id)),_.current=new Set;const he=(G==null?void 0:G.selectable)??!0;for(const le of j.current){const Ve=U.get(le);if(Ve)for(const{edgeId:wn}of Ve.values()){const nn=$.get(wn);nn&&(nn.selectable??he)&&_.current.add(wn)}}if(!xm(q,j.current)){const le=Gr(O,j.current,!0);B(le)}if(!xm(ae,_.current)){const le=Gr($,_.current);Y(le)}w.setState({userSelectionRect:Z,userSelectionActive:!0,nodesSelectionActive:!1})},M=C=>{var P,L;C.button===0&&((L=(P=C.target)==null?void 0:P.releasePointerCapture)==null||L.call(P,C.pointerId),!S&&C.target===b.current&&w.getState().userSelectionRect&&(D==null||D(C)),w.setState({userSelectionActive:!1,userSelectionRect:null}),I.current&&(l==null||l(C),w.setState({nodesSelectionActive:j.current.size>0})))},z=r===!0||Array.isArray(r)&&r.includes(0);return a.jsxs("div",{className:Me(["react-flow__pane",{draggable:z,dragging:v,selection:e}]),onClick:N?void 0:xu(D,b),onContextMenu:xu(T,b),onWheel:xu(R,b),onPointerEnter:N?void 0:d,onPointerMove:N?A:f,onPointerUp:N?M:void 0,onPointerDownCapture:N?E:void 0,onClickCapture:N?F:void 0,onPointerLeave:x,ref:b,style:ja,children:[y,a.jsx(c4,{})]})}function Hc({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:i,nodeLookup:l,onError:u}=t.getState(),c=l.get(e);if(!c){u==null||u("012",Jt.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(o({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):s([e])}function y0({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:o,nodeClickDistance:i}){const l=we(),[u,c]=p.useState(!1),h=p.useRef();return p.useEffect(()=>{h.current=D_({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{Hc({id:d,store:l,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),p.useEffect(()=>{var d,f;if(t)(d=h.current)==null||d.destroy();else if(e.current)return(f=h.current)==null||f.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:s,nodeClickDistance:i}),()=>{var x;(x=h.current)==null||x.destroy()}},[n,r,t,o,e,s]),u}const h4=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function v0(){const e=we();return p.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:o,nodesDraggable:i,onError:l,updateNodePositions:u,nodeLookup:c,nodeOrigin:h}=e.getState(),d=new Map,f=h4(i),x=s?o[0]:5,y=s?o[1]:5,w=n.direction.x*x*n.factor,S=n.direction.y*y*n.factor;for(const[,m]of c){if(!f(m))continue;let v={x:m.internals.positionAbsolute.x+w,y:m.internals.positionAbsolute.y+S};s&&(v=Jo(v,o));const{position:g,positionAbsolute:N}=zy({nodeId:m.id,nextPosition:v,nodeLookup:c,nodeExtent:r,nodeOrigin:h,onError:l});m.position=g,m.internals.positionAbsolute=N,d.set(m.id,m)}u(d)},[])}const pf=p.createContext(null),m4=pf.Provider;pf.Consumer;const w0=()=>p.useContext(pf),p4=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),g4=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:o,connection:i}=r,{fromHandle:l,toHandle:u,isValid:c}=i,h=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:h,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:o===ms.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!s,valid:h&&c}};function x4({type:e="source",position:t=X.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:i,onConnect:l,children:u,className:c,onMouseDown:h,onTouchStart:d,...f},x){var A,M;const y=i||null,w=e==="target",S=we(),m=w0(),{connectOnClick:v,noPanClassName:g,rfId:N}=oe(p4,ve),{connectingFrom:b,connectingTo:k,clickConnecting:j,isPossibleEndHandle:_,connectionInProcess:I,clickConnectionInProcess:D,valid:T}=oe(g4(m,y,e),ve);m||(M=(A=S.getState()).onError)==null||M.call(A,"010",Jt.error010());const R=z=>{const{defaultEdgeOptions:C,onConnect:P,hasDefaultEdges:L}=S.getState(),O={...C,...z};if(L){const{edges:$,setEdges:U}=S.getState();U(N_(O,$))}P==null||P(O),l==null||l(O)},F=z=>{if(!m)return;const C=Uy(z.nativeEvent);if(s&&(C&&z.button===0||!C)){const P=S.getState();Fc.onPointerDown(z.nativeEvent,{handleDomNode:z.currentTarget,autoPanOnConnect:P.autoPanOnConnect,connectionMode:P.connectionMode,connectionRadius:P.connectionRadius,domNode:P.domNode,nodeLookup:P.nodeLookup,lib:P.lib,isTarget:w,handleId:y,nodeId:m,flowId:P.rfId,panBy:P.panBy,cancelConnection:P.cancelConnection,onConnectStart:P.onConnectStart,onConnectEnd:P.onConnectEnd,updateConnection:P.updateConnection,onConnect:R,isValidConnection:n||P.isValidConnection,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:P.autoPanSpeed,dragThreshold:P.connectionDragThreshold})}C?h==null||h(z):d==null||d(z)},E=z=>{const{onClickConnectStart:C,onClickConnectEnd:P,connectionClickStartHandle:L,connectionMode:O,isValidConnection:$,lib:U,rfId:B,nodeLookup:Y,connection:G}=S.getState();if(!m||!L&&!s)return;if(!L){C==null||C(z.nativeEvent,{nodeId:m,handleId:y,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:m,type:e,id:y}});return}const K=Vy(z.target),V=n||$,{connection:Q,isValid:re}=Fc.isValid(z.nativeEvent,{handle:{nodeId:m,id:y,type:e},connectionMode:O,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:V,flowId:B,doc:K,lib:U,nodeLookup:Y});re&&Q&&R(Q);const te=structuredClone(G);delete te.inProgress,te.toPosition=te.toHandle?te.toHandle.position:null,P==null||P(z,te),S.setState({connectionClickStartHandle:null})};return a.jsx("div",{"data-handleid":y,"data-nodeid":m,"data-handlepos":t,"data-id":`${N}-${m}-${y}-${e}`,className:Me(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,c,{source:!w,target:w,connectable:r,connectablestart:s,connectableend:o,clickconnecting:j,connectingfrom:b,connectingto:k,valid:T,connectionindicator:r&&(!I||_)&&(I||D?o:s)}]),onMouseDown:F,onTouchStart:F,onClick:v?E:void 0,ref:x,...f,children:u})}const Vl=p.memo(g0(x4));function y4({data:e,isConnectable:t,sourcePosition:n=X.Bottom}){return a.jsxs(a.Fragment,{children:[e==null?void 0:e.label,a.jsx(Vl,{type:"source",position:n,isConnectable:t})]})}function v4({data:e,isConnectable:t,targetPosition:n=X.Top,sourcePosition:r=X.Bottom}){return a.jsxs(a.Fragment,{children:[a.jsx(Vl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,a.jsx(Vl,{type:"source",position:r,isConnectable:t})]})}function w4(){return null}function N4({data:e,isConnectable:t,targetPosition:n=X.Top}){return a.jsxs(a.Fragment,{children:[a.jsx(Vl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Bl={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Bm={input:y4,default:v4,output:N4,group:w4};function S4(e){var t,n,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const b4=e=>{const{width:t,height:n,x:r,y:s}=Zo(e.nodeLookup,{filter:o=>!!o.selected});return{width:It(t)?t:null,height:It(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function k4({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=we(),{width:s,height:o,transformString:i,userSelectionActive:l}=oe(b4,ve),u=v0(),c=p.useRef(null);if(p.useEffect(()=>{var f;n||(f=c.current)==null||f.focus({preventScroll:!0})},[n]),y0({nodeRef:c}),l||!s||!o)return null;const h=e?f=>{const x=r.getState().nodes.filter(y=>y.selected);e(f,x)}:void 0,d=f=>{Object.prototype.hasOwnProperty.call(Bl,f.key)&&(f.preventDefault(),u({direction:Bl[f.key],factor:f.shiftKey?4:1}))};return a.jsx("div",{className:Me(["react-flow__nodesselection","react-flow__container",t]),style:{transform:i},children:a.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:s,height:o}})})}const Um=typeof window<"u"?window:void 0,j4=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function N0({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,paneClickDistance:l,deleteKeyCode:u,selectionKeyCode:c,selectionOnDrag:h,selectionMode:d,onSelectionStart:f,onSelectionEnd:x,multiSelectionKeyCode:y,panActivationKeyCode:w,zoomActivationKeyCode:S,elementsSelectable:m,zoomOnScroll:v,zoomOnPinch:g,panOnScroll:N,panOnScrollSpeed:b,panOnScrollMode:k,zoomOnDoubleClick:j,panOnDrag:_,defaultViewport:I,translateExtent:D,minZoom:T,maxZoom:R,preventScrolling:F,onSelectionContextMenu:E,noWheelClassName:A,noPanClassName:M,disableKeyboardA11y:z,onViewportChange:C,isControlledViewport:P}){const{nodesSelectionActive:L,userSelectionActive:O}=oe(j4,ve),$=Ho(c,{target:Um}),U=Ho(w,{target:Um}),B=U||_,Y=U||N,G=h&&B!==!0,K=$||O||G;return o4({deleteKeyCode:u,multiSelectionKeyCode:y}),a.jsx(a4,{onPaneContextMenu:o,elementsSelectable:m,zoomOnScroll:v,zoomOnPinch:g,panOnScroll:Y,panOnScrollSpeed:b,panOnScrollMode:k,zoomOnDoubleClick:j,panOnDrag:!$&&B,defaultViewport:I,translateExtent:D,minZoom:T,maxZoom:R,zoomActivationKeyCode:S,preventScrolling:F,noWheelClassName:A,noPanClassName:M,onViewportChange:C,isControlledViewport:P,paneClickDistance:l,selectionOnDrag:G,children:a.jsxs(f4,{onSelectionStart:f,onSelectionEnd:x,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:i,panOnDrag:B,isSelecting:!!K,selectionMode:d,selectionKeyPressed:$,paneClickDistance:l,selectionOnDrag:G,children:[e,L&&a.jsx(k4,{onSelectionContextMenu:E,noPanClassName:M,disableKeyboardA11y:z})]})})}N0.displayName="FlowRenderer";const C4=p.memo(N0),E4=e=>t=>e?of(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function _4(e){return oe(p.useCallback(E4(e),[e]),ve)}const P4=e=>e.updateNodeInternals;function M4(){const e=oe(P4),[t]=p.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const o=s.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:s.target,force:!0})}),e(r)}));return p.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function I4({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=we(),o=p.useRef(null),i=p.useRef(null),l=p.useRef(e.sourcePosition),u=p.useRef(e.targetPosition),c=p.useRef(t),h=n&&!!e.internals.handleBounds;return p.useEffect(()=>{o.current&&!e.hidden&&(!h||i.current!==o.current)&&(i.current&&(r==null||r.unobserve(i.current)),r==null||r.observe(o.current),i.current=o.current)},[h,e.hidden]),p.useEffect(()=>()=>{i.current&&(r==null||r.unobserve(i.current),i.current=null)},[]),p.useEffect(()=>{if(o.current){const d=c.current!==t,f=l.current!==e.sourcePosition,x=u.current!==e.targetPosition;(d||f||x)&&(c.current=t,l.current=e.sourcePosition,u.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function R4({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:o,onDoubleClick:i,nodesDraggable:l,elementsSelectable:u,nodesConnectable:c,nodesFocusable:h,resizeObserver:d,noDragClassName:f,noPanClassName:x,disableKeyboardA11y:y,rfId:w,nodeTypes:S,nodeClickDistance:m,onError:v}){const{node:g,internals:N,isParent:b}=oe(V=>{const Q=V.nodeLookup.get(e),re=V.parentLookup.has(e);return{node:Q,internals:Q.internals,isParent:re}},ve);let k=g.type||"default",j=(S==null?void 0:S[k])||Bm[k];j===void 0&&(v==null||v("003",Jt.error003(k)),k="default",j=(S==null?void 0:S.default)||Bm.default);const _=!!(g.draggable||l&&typeof g.draggable>"u"),I=!!(g.selectable||u&&typeof g.selectable>"u"),D=!!(g.connectable||c&&typeof g.connectable>"u"),T=!!(g.focusable||h&&typeof g.focusable>"u"),R=we(),F=Fy(g),E=I4({node:g,nodeType:k,hasDimensions:F,resizeObserver:d}),A=y0({nodeRef:E,disabled:g.hidden||!_,noDragClassName:f,handleSelector:g.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:m}),M=v0();if(g.hidden)return null;const z=vn(g),C=S4(g),P=I||_||t||n||r||s,L=n?V=>n(V,{...N.userNode}):void 0,O=r?V=>r(V,{...N.userNode}):void 0,$=s?V=>s(V,{...N.userNode}):void 0,U=o?V=>o(V,{...N.userNode}):void 0,B=i?V=>i(V,{...N.userNode}):void 0,Y=V=>{const{selectNodesOnDrag:Q,nodeDragThreshold:re}=R.getState();I&&(!Q||!_||re>0)&&Hc({id:e,store:R,nodeRef:E}),t&&t(V,{...N.userNode})},G=V=>{if(!(By(V.nativeEvent)||y)){if(Iy.includes(V.key)&&I){const Q=V.key==="Escape";Hc({id:e,store:R,unselect:Q,nodeRef:E})}else if(_&&g.selected&&Object.prototype.hasOwnProperty.call(Bl,V.key)){V.preventDefault();const{ariaLabelConfig:Q}=R.getState();R.setState({ariaLiveMessage:Q["node.a11yDescription.ariaLiveMessage"]({direction:V.key.replace("Arrow","").toLowerCase(),x:~~N.positionAbsolute.x,y:~~N.positionAbsolute.y})}),M({direction:Bl[V.key],factor:V.shiftKey?4:1})}}},K=()=>{var ae;if(y||!((ae=E.current)!=null&&ae.matches(":focus-visible")))return;const{transform:V,width:Q,height:re,autoPanOnNodeFocus:te,setCenter:Z}=R.getState();if(!te)return;of(new Map([[e,g]]),{x:0,y:0,width:Q,height:re},V,!0).length>0||Z(g.position.x+z.width/2,g.position.y+z.height/2,{zoom:V[2]})};return a.jsx("div",{className:Me(["react-flow__node",`react-flow__node-${k}`,{[x]:_},g.className,{selected:g.selected,selectable:I,parent:b,draggable:_,dragging:A}]),ref:E,style:{zIndex:N.z,transform:`translate(${N.positionAbsolute.x}px,${N.positionAbsolute.y}px)`,pointerEvents:P?"all":"none",visibility:F?"visible":"hidden",...g.style,...C},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:O,onMouseLeave:$,onContextMenu:U,onClick:Y,onDoubleClick:B,onKeyDown:T?G:void 0,tabIndex:T?0:void 0,onFocus:T?K:void 0,role:g.ariaRole??(T?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${f0}-${w}`,"aria-label":g.ariaLabel,...g.domAttributes,children:a.jsx(m4,{value:e,children:a.jsx(j,{id:e,data:g.data,type:k,positionAbsoluteX:N.positionAbsolute.x,positionAbsoluteY:N.positionAbsolute.y,selected:g.selected??!1,selectable:I,draggable:_,deletable:g.deletable??!0,isConnectable:D,sourcePosition:g.sourcePosition,targetPosition:g.targetPosition,dragging:A,dragHandle:g.dragHandle,zIndex:N.z,parentId:g.parentId,...z})})})}var T4=p.memo(R4);const L4=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function S0(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:o}=oe(L4,ve),i=_4(e.onlyRenderVisibleElements),l=M4();return a.jsx("div",{className:"react-flow__nodes",style:ja,children:i.map(u=>a.jsx(T4,{id:u,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:o},u))})}S0.displayName="NodeRenderer";const A4=p.memo(S0);function z4(e){return oe(p.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const r=[];if(n.width&&n.height)for(const s of n.edges){const o=n.nodeLookup.get(s.source),i=n.nodeLookup.get(s.target);o&&i&&y_({sourceNode:o,targetNode:i,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),ve)}const D4=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return a.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},$4=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return a.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Wm={[Ol.Arrow]:D4,[Ol.ArrowClosed]:$4};function O4(e){const t=we();return p.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(Wm,e)?Wm[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",Jt.error009(e)),null)},[e])}const F4=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:i,orient:l="auto-start-reverse"})=>{const u=O4(t);return u?a.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:l,refX:"0",refY:"0",children:a.jsx(u,{color:n,strokeWidth:i})}):null},b0=({defaultColor:e,rfId:t})=>{const n=oe(o=>o.edges),r=oe(o=>o.defaultEdgeOptions),s=p.useMemo(()=>C_(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return s.length?a.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:a.jsx("defs",{children:s.map(o=>a.jsx(F4,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};b0.displayName="MarkerDefinitions";var H4=p.memo(b0);function k0({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:i=[2,4],labelBgBorderRadius:l=2,children:u,className:c,...h}){const[d,f]=p.useState({x:1,y:0,width:0,height:0}),x=Me(["react-flow__edge-textwrapper",c]),y=p.useRef(null);return p.useEffect(()=>{if(y.current){const w=y.current.getBBox();f({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?a.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:x,visibility:d.width?"visible":"hidden",...h,children:[s&&a.jsx("rect",{width:d.width+2*i[0],x:-i[0],y:-i[1],height:d.height+2*i[1],className:"react-flow__edge-textbg",style:o,rx:l,ry:l}),a.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:y,style:r,children:n}),u]}):null}k0.displayName="EdgeText";const V4=p.memo(k0);function Ca({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:u,interactionWidth:c=20,...h}){return a.jsxs(a.Fragment,{children:[a.jsx("path",{...h,d:e,fill:"none",className:Me(["react-flow__edge-path",h.className])}),c?a.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,r&&It(t)&&It(n)?a.jsx(V4,{x:t,y:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:i,labelBgPadding:l,labelBgBorderRadius:u}):null]})}function Ym({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===X.Left||e===X.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function j0({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:s,targetPosition:o=X.Top}){const[i,l]=Ym({pos:n,x1:e,y1:t,x2:r,y2:s}),[u,c]=Ym({pos:o,x1:r,y1:s,x2:e,y2:t}),[h,d,f,x]=Wy({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:i,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${e},${t} C${i},${l} ${u},${c} ${r},${s}`,h,d,f,x]}function C0(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i,targetPosition:l,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:S,interactionWidth:m})=>{const[v,g,N]=j0({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l}),b=e.isInternal?void 0:t;return a.jsx(Ca,{id:b,path:v,labelX:g,labelY:N,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:S,interactionWidth:m})})}const B4=C0({isInternal:!1}),E0=C0({isInternal:!0});B4.displayName="SimpleBezierEdge";E0.displayName="SimpleBezierEdgeInternal";function _0(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,sourcePosition:x=X.Bottom,targetPosition:y=X.Top,markerEnd:w,markerStart:S,pathOptions:m,interactionWidth:v})=>{const[g,N,b]=Dc({sourceX:n,sourceY:r,sourcePosition:x,targetX:s,targetY:o,targetPosition:y,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset,stepPosition:m==null?void 0:m.stepPosition}),k=e.isInternal?void 0:t;return a.jsx(Ca,{id:k,path:g,labelX:N,labelY:b,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:w,markerStart:S,interactionWidth:v})})}const P0=_0({isInternal:!1}),M0=_0({isInternal:!0});P0.displayName="SmoothStepEdge";M0.displayName="SmoothStepEdgeInternal";function I0(e){return p.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return a.jsx(P0,{...n,id:r,pathOptions:p.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const U4=I0({isInternal:!1}),R0=I0({isInternal:!0});U4.displayName="StepEdge";R0.displayName="StepEdgeInternal";function T0(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:x,markerStart:y,interactionWidth:w})=>{const[S,m,v]=Ky({sourceX:n,sourceY:r,targetX:s,targetY:o}),g=e.isInternal?void 0:t;return a.jsx(Ca,{id:g,path:S,labelX:m,labelY:v,label:i,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:d,style:f,markerEnd:x,markerStart:y,interactionWidth:w})})}const W4=T0({isInternal:!1}),L0=T0({isInternal:!0});W4.displayName="StraightEdge";L0.displayName="StraightEdgeInternal";function A0(e){return p.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:i=X.Bottom,targetPosition:l=X.Top,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:S,pathOptions:m,interactionWidth:v})=>{const[g,N,b]=Yy({sourceX:n,sourceY:r,sourcePosition:i,targetX:s,targetY:o,targetPosition:l,curvature:m==null?void 0:m.curvature}),k=e.isInternal?void 0:t;return a.jsx(Ca,{id:k,path:g,labelX:N,labelY:b,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:x,style:y,markerEnd:w,markerStart:S,interactionWidth:v})})}const Y4=A0({isInternal:!1}),z0=A0({isInternal:!0});Y4.displayName="BezierEdge";z0.displayName="BezierEdgeInternal";const Gm={default:z0,straight:L0,step:R0,smoothstep:M0,simplebezier:E0},Km={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},G4=(e,t,n)=>n===X.Left?e-t:n===X.Right?e+t:e,K4=(e,t,n)=>n===X.Top?e-t:n===X.Bottom?e+t:e,Xm="react-flow__edgeupdater";function Qm({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:o,onMouseOut:i,type:l}){return a.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:i,className:Me([Xm,`${Xm}-${l}`]),cx:G4(t,r,e),cy:K4(n,r,e),r,stroke:"transparent",fill:"transparent"})}function X4({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:o,targetY:i,sourcePosition:l,targetPosition:u,onReconnect:c,onReconnectStart:h,onReconnectEnd:d,setReconnecting:f,setUpdateHover:x}){const y=we(),w=(N,b)=>{if(N.button!==0)return;const{autoPanOnConnect:k,domNode:j,isValidConnection:_,connectionMode:I,connectionRadius:D,lib:T,onConnectStart:R,onConnectEnd:F,cancelConnection:E,nodeLookup:A,rfId:M,panBy:z,updateConnection:C}=y.getState(),P=b.type==="target",L=(U,B)=>{f(!1),d==null||d(U,n,b.type,B)},O=U=>c==null?void 0:c(n,U),$=(U,B)=>{f(!0),h==null||h(N,n,b.type),R==null||R(U,B)};Fc.onPointerDown(N.nativeEvent,{autoPanOnConnect:k,connectionMode:I,connectionRadius:D,domNode:j,handleId:b.id,nodeId:b.nodeId,nodeLookup:A,isTarget:P,edgeUpdaterType:b.type,lib:T,flowId:M,cancelConnection:E,panBy:z,isValidConnection:_,onConnect:O,onConnectStart:$,onConnectEnd:F,onReconnectEnd:L,updateConnection:C,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,dragThreshold:y.getState().connectionDragThreshold,handleDomNode:N.currentTarget})},S=N=>w(N,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=N=>w(N,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>x(!0),g=()=>x(!1);return a.jsxs(a.Fragment,{children:[(e===!0||e==="source")&&a.jsx(Qm,{position:l,centerX:r,centerY:s,radius:t,onMouseDown:S,onMouseEnter:v,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&a.jsx(Qm,{position:u,centerX:o,centerY:i,radius:t,onMouseDown:m,onMouseEnter:v,onMouseOut:g,type:"target"})]})}function Q4({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:o,onContextMenu:i,onMouseEnter:l,onMouseMove:u,onMouseLeave:c,reconnectRadius:h,onReconnect:d,onReconnectStart:f,onReconnectEnd:x,rfId:y,edgeTypes:w,noPanClassName:S,onError:m,disableKeyboardA11y:v}){let g=oe(Z=>Z.edgeLookup.get(e));const N=oe(Z=>Z.defaultEdgeOptions);g=N?{...N,...g}:g;let b=g.type||"default",k=(w==null?void 0:w[b])||Gm[b];k===void 0&&(m==null||m("011",Jt.error011(b)),b="default",k=(w==null?void 0:w.default)||Gm.default);const j=!!(g.focusable||t&&typeof g.focusable>"u"),_=typeof d<"u"&&(g.reconnectable||n&&typeof g.reconnectable>"u"),I=!!(g.selectable||r&&typeof g.selectable>"u"),D=p.useRef(null),[T,R]=p.useState(!1),[F,E]=p.useState(!1),A=we(),{zIndex:M,sourceX:z,sourceY:C,targetX:P,targetY:L,sourcePosition:O,targetPosition:$}=oe(p.useCallback(Z=>{const q=Z.nodeLookup.get(g.source),ae=Z.nodeLookup.get(g.target);if(!q||!ae)return{zIndex:g.zIndex,...Km};const he=j_({id:e,sourceNode:q,targetNode:ae,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:Z.connectionMode,onError:m});return{zIndex:x_({selected:g.selected,zIndex:g.zIndex,sourceNode:q,targetNode:ae,elevateOnSelect:Z.elevateEdgesOnSelect,zIndexMode:Z.zIndexMode}),...he||Km}},[g.source,g.target,g.sourceHandle,g.targetHandle,g.selected,g.zIndex]),ve),U=p.useMemo(()=>g.markerStart?`url('#${$c(g.markerStart,y)}')`:void 0,[g.markerStart,y]),B=p.useMemo(()=>g.markerEnd?`url('#${$c(g.markerEnd,y)}')`:void 0,[g.markerEnd,y]);if(g.hidden||z===null||C===null||P===null||L===null)return null;const Y=Z=>{var le;const{addSelectedEdges:q,unselectNodesAndEdges:ae,multiSelectionActive:he}=A.getState();I&&(A.setState({nodesSelectionActive:!1}),g.selected&&he?(ae({nodes:[],edges:[g]}),(le=D.current)==null||le.blur()):q([e])),s&&s(Z,g)},G=o?Z=>{o(Z,{...g})}:void 0,K=i?Z=>{i(Z,{...g})}:void 0,V=l?Z=>{l(Z,{...g})}:void 0,Q=u?Z=>{u(Z,{...g})}:void 0,re=c?Z=>{c(Z,{...g})}:void 0,te=Z=>{var q;if(!v&&Iy.includes(Z.key)&&I){const{unselectNodesAndEdges:ae,addSelectedEdges:he}=A.getState();Z.key==="Escape"?((q=D.current)==null||q.blur(),ae({edges:[g]})):he([e])}};return a.jsx("svg",{style:{zIndex:M},children:a.jsxs("g",{className:Me(["react-flow__edge",`react-flow__edge-${b}`,g.className,S,{selected:g.selected,animated:g.animated,inactive:!I&&!s,updating:T,selectable:I}]),onClick:Y,onDoubleClick:G,onContextMenu:K,onMouseEnter:V,onMouseMove:Q,onMouseLeave:re,onKeyDown:j?te:void 0,tabIndex:j?0:void 0,role:g.ariaRole??(j?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":g.ariaLabel===null?void 0:g.ariaLabel||`Edge from ${g.source} to ${g.target}`,"aria-describedby":j?`${h0}-${y}`:void 0,ref:D,...g.domAttributes,children:[!F&&a.jsx(k,{id:e,source:g.source,target:g.target,type:g.type,selected:g.selected,animated:g.animated,selectable:I,deletable:g.deletable??!0,label:g.label,labelStyle:g.labelStyle,labelShowBg:g.labelShowBg,labelBgStyle:g.labelBgStyle,labelBgPadding:g.labelBgPadding,labelBgBorderRadius:g.labelBgBorderRadius,sourceX:z,sourceY:C,targetX:P,targetY:L,sourcePosition:O,targetPosition:$,data:g.data,style:g.style,sourceHandleId:g.sourceHandle,targetHandleId:g.targetHandle,markerStart:U,markerEnd:B,pathOptions:"pathOptions"in g?g.pathOptions:void 0,interactionWidth:g.interactionWidth}),_&&a.jsx(X4,{edge:g,isReconnectable:_,reconnectRadius:h,onReconnect:d,onReconnectStart:f,onReconnectEnd:x,sourceX:z,sourceY:C,targetX:P,targetY:L,sourcePosition:O,targetPosition:$,setUpdateHover:R,setReconnecting:E})]})})}var q4=p.memo(Q4);const Z4=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function D0({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:o,onEdgeContextMenu:i,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:h,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:x,onReconnectEnd:y,disableKeyboardA11y:w}){const{edgesFocusable:S,edgesReconnectable:m,elementsSelectable:v,onError:g}=oe(Z4,ve),N=z4(t);return a.jsxs("div",{className:"react-flow__edges",children:[a.jsx(H4,{defaultColor:e,rfId:n}),N.map(b=>a.jsx(q4,{id:b,edgesFocusable:S,edgesReconnectable:m,elementsSelectable:v,noPanClassName:s,onReconnect:o,onContextMenu:i,onMouseEnter:l,onMouseMove:u,onMouseLeave:c,onClick:h,reconnectRadius:d,onDoubleClick:f,onReconnectStart:x,onReconnectEnd:y,rfId:n,onError:g,edgeTypes:r,disableKeyboardA11y:w},b))]})}D0.displayName="EdgeRenderer";const J4=p.memo(D0),eP=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function tP({children:e}){const t=oe(eP);return a.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function nP(e){const t=mf(),n=p.useRef(!1);p.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const rP=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function sP(e){const t=oe(rP),n=we();return p.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function oP(e){return e.connection.inProgress?{...e.connection,to:ei(e.connection.to,e.transform)}:{...e.connection}}function iP(e){return oP}function lP(e){const t=iP();return oe(t,ve)}const aP=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function uP({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:o,height:i,isValid:l,inProgress:u}=oe(aP,ve);return!(o&&s&&u)?null:a.jsx("svg",{style:e,width:o,height:i,className:"react-flow__connectionline react-flow__container",children:a.jsx("g",{className:Me(["react-flow__connection",Ly(l)]),children:a.jsx($0,{style:t,type:n,CustomComponent:r,isValid:l})})})}const $0=({style:e,type:t=In.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:o,fromNode:i,fromHandle:l,fromPosition:u,to:c,toNode:h,toHandle:d,toPosition:f,pointer:x}=lP();if(!s)return;if(n)return a.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:i,fromHandle:l,fromX:o.x,fromY:o.y,toX:c.x,toY:c.y,fromPosition:u,toPosition:f,connectionStatus:Ly(r),toNode:h,toHandle:d,pointer:x});let y="";const w={sourceX:o.x,sourceY:o.y,sourcePosition:u,targetX:c.x,targetY:c.y,targetPosition:f};switch(t){case In.Bezier:[y]=Yy(w);break;case In.SimpleBezier:[y]=j0(w);break;case In.Step:[y]=Dc({...w,borderRadius:0});break;case In.SmoothStep:[y]=Dc(w);break;default:[y]=Ky(w)}return a.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:e})};$0.displayName="ConnectionLine";const cP={};function qm(e=cP){p.useRef(e),we(),p.useEffect(()=>{},[e])}function dP(){we(),p.useRef(!1),p.useEffect(()=>{},[])}function O0({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:h,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:x,connectionLineType:y,connectionLineStyle:w,connectionLineComponent:S,connectionLineContainerStyle:m,selectionKeyCode:v,selectionOnDrag:g,selectionMode:N,multiSelectionKeyCode:b,panActivationKeyCode:k,zoomActivationKeyCode:j,deleteKeyCode:_,onlyRenderVisibleElements:I,elementsSelectable:D,defaultViewport:T,translateExtent:R,minZoom:F,maxZoom:E,preventScrolling:A,defaultMarkerColor:M,zoomOnScroll:z,zoomOnPinch:C,panOnScroll:P,panOnScrollSpeed:L,panOnScrollMode:O,zoomOnDoubleClick:$,panOnDrag:U,onPaneClick:B,onPaneMouseEnter:Y,onPaneMouseMove:G,onPaneMouseLeave:K,onPaneScroll:V,onPaneContextMenu:Q,paneClickDistance:re,nodeClickDistance:te,onEdgeContextMenu:Z,onEdgeMouseEnter:q,onEdgeMouseMove:ae,onEdgeMouseLeave:he,reconnectRadius:le,onReconnect:Ve,onReconnectStart:wn,onReconnectEnd:nn,noDragClassName:Zn,noWheelClassName:Is,noPanClassName:Rs,disableKeyboardA11y:Ts,nodeExtent:Ia,rfId:ni,viewport:_r,onViewportChange:Ls}){return qm(e),qm(t),dP(),nP(n),sP(_r),a.jsx(C4,{onPaneClick:B,onPaneMouseEnter:Y,onPaneMouseMove:G,onPaneMouseLeave:K,onPaneContextMenu:Q,onPaneScroll:V,paneClickDistance:re,deleteKeyCode:_,selectionKeyCode:v,selectionOnDrag:g,selectionMode:N,onSelectionStart:f,onSelectionEnd:x,multiSelectionKeyCode:b,panActivationKeyCode:k,zoomActivationKeyCode:j,elementsSelectable:D,zoomOnScroll:z,zoomOnPinch:C,zoomOnDoubleClick:$,panOnScroll:P,panOnScrollSpeed:L,panOnScrollMode:O,panOnDrag:U,defaultViewport:T,translateExtent:R,minZoom:F,maxZoom:E,onSelectionContextMenu:d,preventScrolling:A,noDragClassName:Zn,noWheelClassName:Is,noPanClassName:Rs,disableKeyboardA11y:Ts,onViewportChange:Ls,isControlledViewport:!!_r,children:a.jsxs(tP,{children:[a.jsx(J4,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:i,onReconnect:Ve,onReconnectStart:wn,onReconnectEnd:nn,onlyRenderVisibleElements:I,onEdgeContextMenu:Z,onEdgeMouseEnter:q,onEdgeMouseMove:ae,onEdgeMouseLeave:he,reconnectRadius:le,defaultMarkerColor:M,noPanClassName:Rs,disableKeyboardA11y:Ts,rfId:ni}),a.jsx(uP,{style:w,type:y,component:S,containerStyle:m}),a.jsx("div",{className:"react-flow__edgelabel-renderer"}),a.jsx(A4,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:h,nodeClickDistance:te,onlyRenderVisibleElements:I,noPanClassName:Rs,noDragClassName:Zn,disableKeyboardA11y:Ts,nodeExtent:Ia,rfId:ni}),a.jsx("div",{className:"react-flow__viewport-portal"})]})})}O0.displayName="GraphView";const fP=p.memo(O0),Zm=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,fitViewOptions:l,minZoom:u=.5,maxZoom:c=2,nodeOrigin:h,nodeExtent:d,zIndexMode:f="basic"}={})=>{const x=new Map,y=new Map,w=new Map,S=new Map,m=r??t??[],v=n??e??[],g=h??[0,0],N=d??Do;qy(w,S,m);const b=Oc(v,x,y,{nodeOrigin:g,nodeExtent:N,zIndexMode:f});let k=[0,0,1];if(i&&s&&o){const j=Zo(x,{filter:T=>!!((T.width||T.initialWidth)&&(T.height||T.initialHeight))}),{x:_,y:I,zoom:D}=lf(j,s,o,u,c,(l==null?void 0:l.padding)??.1);k=[_,I,D]}return{rfId:"1",width:s??0,height:o??0,transform:k,nodes:v,nodesInitialized:b,nodeLookup:x,parentLookup:y,edges:m,edgeLookup:S,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:c,translateExtent:Do,nodeExtent:N,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ms.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:g,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:i??!1,fitViewOptions:l,fitViewResolver:null,connection:{...Ty},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:d_,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Ry,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},hP=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:i,fitViewOptions:l,minZoom:u,maxZoom:c,nodeOrigin:h,nodeExtent:d,zIndexMode:f})=>P3((x,y)=>{async function w(){const{nodeLookup:S,panZoom:m,fitViewOptions:v,fitViewResolver:g,width:N,height:b,minZoom:k,maxZoom:j}=y();m&&(await u_({nodes:S,width:N,height:b,panZoom:m,minZoom:k,maxZoom:j},v),g==null||g.resolve(!0),x({fitViewResolver:null}))}return{...Zm({nodes:e,edges:t,width:s,height:o,fitView:i,fitViewOptions:l,minZoom:u,maxZoom:c,nodeOrigin:h,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:S=>{const{nodeLookup:m,parentLookup:v,nodeOrigin:g,elevateNodesOnSelect:N,fitViewQueued:b,zIndexMode:k}=y(),j=Oc(S,m,v,{nodeOrigin:g,nodeExtent:d,elevateNodesOnSelect:N,checkEquality:!0,zIndexMode:k});b&&j?(w(),x({nodes:S,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0})):x({nodes:S,nodesInitialized:j})},setEdges:S=>{const{connectionLookup:m,edgeLookup:v}=y();qy(m,v,S),x({edges:S})},setDefaultNodesAndEdges:(S,m)=>{if(S){const{setNodes:v}=y();v(S),x({hasDefaultNodes:!0})}if(m){const{setEdges:v}=y();v(m),x({hasDefaultEdges:!0})}},updateNodeInternals:S=>{const{triggerNodeChanges:m,nodeLookup:v,parentLookup:g,domNode:N,nodeOrigin:b,nodeExtent:k,debug:j,fitViewQueued:_,zIndexMode:I}=y(),{changes:D,updatedInternals:T}=T_(S,v,g,N,b,k,I);T&&(P_(v,g,{nodeOrigin:b,nodeExtent:k,zIndexMode:I}),_?(w(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),(D==null?void 0:D.length)>0&&(j&&console.log("React Flow: trigger node changes",D),m==null||m(D)))},updateNodePositions:(S,m=!1)=>{const v=[];let g=[];const{nodeLookup:N,triggerNodeChanges:b,connection:k,updateConnection:j,onNodesChangeMiddlewareMap:_}=y();for(const[I,D]of S){const T=N.get(I),R=!!(T!=null&&T.expandParent&&(T!=null&&T.parentId)&&(D!=null&&D.position)),F={id:I,type:"position",position:R?{x:Math.max(0,D.position.x),y:Math.max(0,D.position.y)}:D.position,dragging:m};if(T&&k.inProgress&&k.fromNode.id===T.id){const E=Nr(T,k.fromHandle,X.Left,!0);j({...k,from:E})}R&&T.parentId&&v.push({id:I,parentId:T.parentId,rect:{...D.internals.positionAbsolute,width:D.measured.width??0,height:D.measured.height??0}}),g.push(F)}if(v.length>0){const{parentLookup:I,nodeOrigin:D}=y(),T=hf(v,N,I,D);g.push(...T)}for(const I of _.values())g=I(g);b(g)},triggerNodeChanges:S=>{const{onNodesChange:m,setNodes:v,nodes:g,hasDefaultNodes:N,debug:b}=y();if(S!=null&&S.length){if(N){const k=Q3(S,g);v(k)}b&&console.log("React Flow: trigger node changes",S),m==null||m(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:m,setEdges:v,edges:g,hasDefaultEdges:N,debug:b}=y();if(S!=null&&S.length){if(N){const k=q3(S,g);v(k)}b&&console.log("React Flow: trigger edge changes",S),m==null||m(S)}},addSelectedNodes:S=>{const{multiSelectionActive:m,edgeLookup:v,nodeLookup:g,triggerNodeChanges:N,triggerEdgeChanges:b}=y();if(m){const k=S.map(j=>tr(j,!0));N(k);return}N(Gr(g,new Set([...S]),!0)),b(Gr(v))},addSelectedEdges:S=>{const{multiSelectionActive:m,edgeLookup:v,nodeLookup:g,triggerNodeChanges:N,triggerEdgeChanges:b}=y();if(m){const k=S.map(j=>tr(j,!0));b(k);return}b(Gr(v,new Set([...S]))),N(Gr(g,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:m}={})=>{const{edges:v,nodes:g,nodeLookup:N,triggerNodeChanges:b,triggerEdgeChanges:k}=y(),j=S||g,_=m||v,I=j.map(T=>{const R=N.get(T.id);return R&&(R.selected=!1),tr(T.id,!1)}),D=_.map(T=>tr(T.id,!1));b(I),k(D)},setMinZoom:S=>{const{panZoom:m,maxZoom:v}=y();m==null||m.setScaleExtent([S,v]),x({minZoom:S})},setMaxZoom:S=>{const{panZoom:m,minZoom:v}=y();m==null||m.setScaleExtent([v,S]),x({maxZoom:S})},setTranslateExtent:S=>{var m;(m=y().panZoom)==null||m.setTranslateExtent(S),x({translateExtent:S})},resetSelectedElements:()=>{const{edges:S,nodes:m,triggerNodeChanges:v,triggerEdgeChanges:g,elementsSelectable:N}=y();if(!N)return;const b=m.reduce((j,_)=>_.selected?[...j,tr(_.id,!1)]:j,[]),k=S.reduce((j,_)=>_.selected?[...j,tr(_.id,!1)]:j,[]);v(b),g(k)},setNodeExtent:S=>{const{nodes:m,nodeLookup:v,parentLookup:g,nodeOrigin:N,elevateNodesOnSelect:b,nodeExtent:k,zIndexMode:j}=y();S[0][0]===k[0][0]&&S[0][1]===k[0][1]&&S[1][0]===k[1][0]&&S[1][1]===k[1][1]||(Oc(m,v,g,{nodeOrigin:N,nodeExtent:S,elevateNodesOnSelect:b,checkEquality:!1,zIndexMode:j}),x({nodeExtent:S}))},panBy:S=>{const{transform:m,width:v,height:g,panZoom:N,translateExtent:b}=y();return L_({delta:S,panZoom:N,transform:m,translateExtent:b,width:v,height:g})},setCenter:async(S,m,v)=>{const{width:g,height:N,maxZoom:b,panZoom:k}=y();if(!k)return Promise.resolve(!1);const j=typeof(v==null?void 0:v.zoom)<"u"?v.zoom:b;return await k.setViewport({x:g/2-S*j,y:N/2-m*j,zoom:j},{duration:v==null?void 0:v.duration,ease:v==null?void 0:v.ease,interpolate:v==null?void 0:v.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{x({connection:{...Ty}})},updateConnection:S=>{x({connection:S})},reset:()=>x({...Zm()})}},Object.is);function mP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:o,initialMinZoom:i,initialMaxZoom:l,initialFitViewOptions:u,fitView:c,nodeOrigin:h,nodeExtent:d,zIndexMode:f,children:x}){const[y]=p.useState(()=>hP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:c,minZoom:i,maxZoom:l,fitViewOptions:u,nodeOrigin:h,nodeExtent:d,zIndexMode:f}));return a.jsx(M3,{value:y,children:a.jsx(t4,{children:x})})}function pP({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:o,height:i,fitView:l,fitViewOptions:u,minZoom:c,maxZoom:h,nodeOrigin:d,nodeExtent:f,zIndexMode:x}){return p.useContext(ba)?a.jsx(a.Fragment,{children:e}):a.jsx(mP,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:i,fitView:l,initialFitViewOptions:u,initialMinZoom:c,initialMaxZoom:h,nodeOrigin:d,nodeExtent:f,zIndexMode:x,children:e})}const gP={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function xP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:o,edgeTypes:i,onNodeClick:l,onEdgeClick:u,onInit:c,onMove:h,onMoveStart:d,onMoveEnd:f,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:m,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:N,onNodeContextMenu:b,onNodeDoubleClick:k,onNodeDragStart:j,onNodeDrag:_,onNodeDragStop:I,onNodesDelete:D,onEdgesDelete:T,onDelete:R,onSelectionChange:F,onSelectionDragStart:E,onSelectionDrag:A,onSelectionDragStop:M,onSelectionContextMenu:z,onSelectionStart:C,onSelectionEnd:P,onBeforeDelete:L,connectionMode:O,connectionLineType:$=In.Bezier,connectionLineStyle:U,connectionLineComponent:B,connectionLineContainerStyle:Y,deleteKeyCode:G="Backspace",selectionKeyCode:K="Shift",selectionOnDrag:V=!1,selectionMode:Q=$o.Full,panActivationKeyCode:re="Space",multiSelectionKeyCode:te=Fo()?"Meta":"Control",zoomActivationKeyCode:Z=Fo()?"Meta":"Control",snapToGrid:q,snapGrid:ae,onlyRenderVisibleElements:he=!1,selectNodesOnDrag:le,nodesDraggable:Ve,autoPanOnNodeFocus:wn,nodesConnectable:nn,nodesFocusable:Zn,nodeOrigin:Is=m0,edgesFocusable:Rs,edgesReconnectable:Ts,elementsSelectable:Ia=!0,defaultViewport:ni=B3,minZoom:_r=.5,maxZoom:Ls=2,translateExtent:jf=Do,preventScrolling:Wv=!0,nodeExtent:Ra,defaultMarkerColor:Yv="#b1b1b7",zoomOnScroll:Gv=!0,zoomOnPinch:Kv=!0,panOnScroll:Xv=!1,panOnScrollSpeed:Qv=.5,panOnScrollMode:qv=dr.Free,zoomOnDoubleClick:Zv=!0,panOnDrag:Jv=!0,onPaneClick:ew,onPaneMouseEnter:tw,onPaneMouseMove:nw,onPaneMouseLeave:rw,onPaneScroll:sw,onPaneContextMenu:ow,paneClickDistance:iw=1,nodeClickDistance:lw=0,children:aw,onReconnect:uw,onReconnectStart:cw,onReconnectEnd:dw,onEdgeContextMenu:fw,onEdgeDoubleClick:hw,onEdgeMouseEnter:mw,onEdgeMouseMove:pw,onEdgeMouseLeave:gw,reconnectRadius:xw=10,onNodesChange:yw,onEdgesChange:vw,noDragClassName:ww="nodrag",noWheelClassName:Nw="nowheel",noPanClassName:Cf="nopan",fitView:Ef,fitViewOptions:_f,connectOnClick:Sw,attributionPosition:bw,proOptions:kw,defaultEdgeOptions:jw,elevateNodesOnSelect:Cw=!0,elevateEdgesOnSelect:Ew=!1,disableKeyboardA11y:Pf=!1,autoPanOnConnect:_w,autoPanOnNodeDrag:Pw,autoPanSpeed:Mw,connectionRadius:Iw,isValidConnection:Rw,onError:Tw,style:Lw,id:Mf,nodeDragThreshold:Aw,connectionDragThreshold:zw,viewport:Dw,onViewportChange:$w,width:Ow,height:Fw,colorMode:Hw="light",debug:Vw,onScroll:ri,ariaLabelConfig:Bw,zIndexMode:If="basic",...Uw},Ww){const Ta=Mf||"1",Yw=G3(Hw),Gw=p.useCallback(Rf=>{Rf.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ri==null||ri(Rf)},[ri]);return a.jsx("div",{"data-testid":"rf__wrapper",...Uw,onScroll:Gw,style:{...Lw,...gP},ref:Ww,className:Me(["react-flow",s,Yw]),id:Mf,role:"application",children:a.jsxs(pP,{nodes:e,edges:t,width:Ow,height:Fw,fitView:Ef,fitViewOptions:_f,minZoom:_r,maxZoom:Ls,nodeOrigin:Is,nodeExtent:Ra,zIndexMode:If,children:[a.jsx(fP,{onInit:c,onNodeClick:l,onEdgeClick:u,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:N,onNodeContextMenu:b,onNodeDoubleClick:k,nodeTypes:o,edgeTypes:i,connectionLineType:$,connectionLineStyle:U,connectionLineComponent:B,connectionLineContainerStyle:Y,selectionKeyCode:K,selectionOnDrag:V,selectionMode:Q,deleteKeyCode:G,multiSelectionKeyCode:te,panActivationKeyCode:re,zoomActivationKeyCode:Z,onlyRenderVisibleElements:he,defaultViewport:ni,translateExtent:jf,minZoom:_r,maxZoom:Ls,preventScrolling:Wv,zoomOnScroll:Gv,zoomOnPinch:Kv,zoomOnDoubleClick:Zv,panOnScroll:Xv,panOnScrollSpeed:Qv,panOnScrollMode:qv,panOnDrag:Jv,onPaneClick:ew,onPaneMouseEnter:tw,onPaneMouseMove:nw,onPaneMouseLeave:rw,onPaneScroll:sw,onPaneContextMenu:ow,paneClickDistance:iw,nodeClickDistance:lw,onSelectionContextMenu:z,onSelectionStart:C,onSelectionEnd:P,onReconnect:uw,onReconnectStart:cw,onReconnectEnd:dw,onEdgeContextMenu:fw,onEdgeDoubleClick:hw,onEdgeMouseEnter:mw,onEdgeMouseMove:pw,onEdgeMouseLeave:gw,reconnectRadius:xw,defaultMarkerColor:Yv,noDragClassName:ww,noWheelClassName:Nw,noPanClassName:Cf,rfId:Ta,disableKeyboardA11y:Pf,nodeExtent:Ra,viewport:Dw,onViewportChange:$w}),a.jsx(Y3,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:m,nodesDraggable:Ve,autoPanOnNodeFocus:wn,nodesConnectable:nn,nodesFocusable:Zn,edgesFocusable:Rs,edgesReconnectable:Ts,elementsSelectable:Ia,elevateNodesOnSelect:Cw,elevateEdgesOnSelect:Ew,minZoom:_r,maxZoom:Ls,nodeExtent:Ra,onNodesChange:yw,onEdgesChange:vw,snapToGrid:q,snapGrid:ae,connectionMode:O,translateExtent:jf,connectOnClick:Sw,defaultEdgeOptions:jw,fitView:Ef,fitViewOptions:_f,onNodesDelete:D,onEdgesDelete:T,onDelete:R,onNodeDragStart:j,onNodeDrag:_,onNodeDragStop:I,onSelectionDrag:A,onSelectionDragStart:E,onSelectionDragStop:M,onMove:h,onMoveStart:d,onMoveEnd:f,noPanClassName:Cf,nodeOrigin:Is,rfId:Ta,autoPanOnConnect:_w,autoPanOnNodeDrag:Pw,autoPanSpeed:Mw,onError:Tw,connectionRadius:Iw,isValidConnection:Rw,selectNodesOnDrag:le,nodeDragThreshold:Aw,connectionDragThreshold:zw,onBeforeDelete:L,debug:Vw,ariaLabelConfig:Bw,zIndexMode:If}),a.jsx(V3,{onSelectionChange:F}),aw,a.jsx(D3,{proOptions:kw,position:bw}),a.jsx(z3,{rfId:Ta,disableKeyboardA11y:Pf})]})})}var yP=g0(xP);function vP({dimensions:e,lineWidth:t,variant:n,className:r}){return a.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Me(["react-flow__background-pattern",n,r])})}function wP({radius:e,className:t}){return a.jsx("circle",{cx:e,cy:e,r:e,className:Me(["react-flow__background-pattern","dots",t])})}var Vn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Vn||(Vn={}));const NP={[Vn.Dots]:1,[Vn.Lines]:1,[Vn.Cross]:6},SP=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function F0({id:e,variant:t=Vn.Dots,gap:n=20,size:r,lineWidth:s=1,offset:o=0,color:i,bgColor:l,style:u,className:c,patternClassName:h}){const d=p.useRef(null),{transform:f,patternId:x}=oe(SP,ve),y=r||NP[t],w=t===Vn.Dots,S=t===Vn.Cross,m=Array.isArray(n)?n:[n,n],v=[m[0]*f[2]||1,m[1]*f[2]||1],g=y*f[2],N=Array.isArray(o)?o:[o,o],b=S?[g,g]:v,k=[N[0]*f[2]||1+b[0]/2,N[1]*f[2]||1+b[1]/2],j=`${x}${e||""}`;return a.jsxs("svg",{className:Me(["react-flow__background",c]),style:{...u,...ja,"--xy-background-color-props":l,"--xy-background-pattern-color-props":i},ref:d,"data-testid":"rf__background",children:[a.jsx("pattern",{id:j,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:w?a.jsx(wP,{radius:g/2,className:h}):a.jsx(vP,{dimensions:b,lineWidth:s,variant:t,className:h})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${j})`})]})}F0.displayName="Background";const bP=p.memo(F0);function kP(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:a.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function jP(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:a.jsx("path",{d:"M0 0h32v4.2H0z"})})}function CP(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:a.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function EP(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function _P(){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:a.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Ii({children:e,className:t,...n}){return a.jsx("button",{type:"button",className:Me(["react-flow__controls-button",t]),...n,children:e})}const PP=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function H0({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:i,onFitView:l,onInteractiveChange:u,className:c,children:h,position:d="bottom-left",orientation:f="vertical","aria-label":x}){const y=we(),{isInteractive:w,minZoomReached:S,maxZoomReached:m,ariaLabelConfig:v}=oe(PP,ve),{zoomIn:g,zoomOut:N,fitView:b}=mf(),k=()=>{g(),o==null||o()},j=()=>{N(),i==null||i()},_=()=>{b(s),l==null||l()},I=()=>{y.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),u==null||u(!w)},D=f==="horizontal"?"horizontal":"vertical";return a.jsxs(ka,{className:Me(["react-flow__controls",D,c]),position:d,style:e,"data-testid":"rf__controls","aria-label":x??v["controls.ariaLabel"],children:[t&&a.jsxs(a.Fragment,{children:[a.jsx(Ii,{onClick:k,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:m,children:a.jsx(kP,{})}),a.jsx(Ii,{onClick:j,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:S,children:a.jsx(jP,{})})]}),n&&a.jsx(Ii,{className:"react-flow__controls-fitview",onClick:_,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:a.jsx(CP,{})}),r&&a.jsx(Ii,{className:"react-flow__controls-interactive",onClick:I,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:w?a.jsx(_P,{}):a.jsx(EP,{})}),h]})}H0.displayName="Controls";const MP=p.memo(H0);function IP({id:e,x:t,y:n,width:r,height:s,style:o,color:i,strokeColor:l,strokeWidth:u,className:c,borderRadius:h,shapeRendering:d,selected:f,onClick:x}){const{background:y,backgroundColor:w}=o||{},S=i||y||w;return a.jsx("rect",{className:Me(["react-flow__minimap-node",{selected:f},c]),x:t,y:n,rx:h,ry:h,width:r,height:s,style:{fill:S,stroke:l,strokeWidth:u},shapeRendering:d,onClick:x?m=>x(m,e):void 0})}const RP=p.memo(IP),TP=e=>e.nodes.map(t=>t.id),yu=e=>e instanceof Function?e:()=>e;function LP({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:o=RP,onClick:i}){const l=oe(TP,ve),u=yu(t),c=yu(e),h=yu(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(f=>a.jsx(zP,{id:f,nodeColorFunc:u,nodeStrokeColorFunc:c,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:o,onClick:i,shapeRendering:d},f))})}function AP({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:i,NodeComponent:l,onClick:u}){const{node:c,x:h,y:d,width:f,height:x}=oe(y=>{const{internals:w}=y.nodeLookup.get(e),S=w.userNode,{x:m,y:v}=w.positionAbsolute,{width:g,height:N}=vn(S);return{node:S,x:m,y:v,width:g,height:N}},ve);return!c||c.hidden||!Fy(c)?null:a.jsx(l,{x:h,y:d,width:f,height:x,style:c.style,selected:!!c.selected,className:r(c),color:t(c),borderRadius:s,strokeColor:n(c),strokeWidth:o,shapeRendering:i,onClick:u,id:c.id})}const zP=p.memo(AP);var DP=p.memo(LP);const $P=200,OP=150,FP=e=>!e.hidden,HP=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Oy(Zo(e.nodeLookup,{filter:FP}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},VP="react-flow__minimap-desc";function V0({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:i,nodeComponent:l,bgColor:u,maskColor:c,maskStrokeColor:h,maskStrokeWidth:d,position:f="bottom-right",onClick:x,onNodeClick:y,pannable:w=!1,zoomable:S=!1,ariaLabel:m,inversePan:v,zoomStep:g=1,offsetScale:N=5}){const b=we(),k=p.useRef(null),{boundingRect:j,viewBB:_,rfId:I,panZoom:D,translateExtent:T,flowWidth:R,flowHeight:F,ariaLabelConfig:E}=oe(HP,ve),A=(e==null?void 0:e.width)??$P,M=(e==null?void 0:e.height)??OP,z=j.width/A,C=j.height/M,P=Math.max(z,C),L=P*A,O=P*M,$=N*P,U=j.x-(L-j.width)/2-$,B=j.y-(O-j.height)/2-$,Y=L+$*2,G=O+$*2,K=`${VP}-${I}`,V=p.useRef(0),Q=p.useRef();V.current=P,p.useEffect(()=>{if(k.current&&D)return Q.current=B_({domNode:k.current,panZoom:D,getTransform:()=>b.getState().transform,getViewScale:()=>V.current}),()=>{var q;(q=Q.current)==null||q.destroy()}},[D]),p.useEffect(()=>{var q;(q=Q.current)==null||q.update({translateExtent:T,width:R,height:F,inversePan:v,pannable:w,zoomStep:g,zoomable:S})},[w,S,v,g,T,R,F]);const re=x?q=>{var le;const[ae,he]=((le=Q.current)==null?void 0:le.pointer(q))||[0,0];x(q,{x:ae,y:he})}:void 0,te=y?p.useCallback((q,ae)=>{const he=b.getState().nodeLookup.get(ae).internals.userNode;y(q,he)},[]):void 0,Z=m??E["minimap.ariaLabel"];return a.jsx(ka,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*P:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof i=="number"?i:void 0},className:Me(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:A,height:M,viewBox:`${U} ${B} ${Y} ${G}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":K,ref:k,onClick:re,children:[Z&&a.jsx("title",{id:K,children:Z}),a.jsx(DP,{onClick:te,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:i,nodeComponent:l}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-$},${B-$}h${Y+$*2}v${G+$*2}h${-Y-$*2}z
323
+ M${_.x},${_.y}h${_.width}v${_.height}h${-_.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}V0.displayName="MiniMap";p.memo(V0);const BP=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,UP={[ys.Line]:"right",[ys.Handle]:"bottom-right"};function WP({nodeId:e,position:t,variant:n=ys.Handle,className:r,style:s=void 0,children:o,color:i,minWidth:l=10,minHeight:u=10,maxWidth:c=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:x=!0,shouldResize:y,onResizeStart:w,onResize:S,onResizeEnd:m}){const v=w0(),g=typeof e=="string"?e:v,N=we(),b=p.useRef(null),k=n===ys.Handle,j=oe(p.useCallback(BP(k&&x),[k,x]),ve),_=p.useRef(null),I=t??UP[n];p.useEffect(()=>{if(!(!b.current||!g))return _.current||(_.current=r3({domNode:b.current,nodeId:g,getStoreItems:()=>{const{nodeLookup:T,transform:R,snapGrid:F,snapToGrid:E,nodeOrigin:A,domNode:M}=N.getState();return{nodeLookup:T,transform:R,snapGrid:F,snapToGrid:E,nodeOrigin:A,paneDomNode:M}},onChange:(T,R)=>{const{triggerNodeChanges:F,nodeLookup:E,parentLookup:A,nodeOrigin:M}=N.getState(),z=[],C={x:T.x,y:T.y},P=E.get(g);if(P&&P.expandParent&&P.parentId){const L=P.origin??M,O=T.width??P.measured.width??0,$=T.height??P.measured.height??0,U={id:P.id,parentId:P.parentId,rect:{width:O,height:$,...Hy({x:T.x??P.position.x,y:T.y??P.position.y},{width:O,height:$},P.parentId,E,L)}},B=hf([U],E,A,M);z.push(...B),C.x=T.x?Math.max(L[0]*O,T.x):void 0,C.y=T.y?Math.max(L[1]*$,T.y):void 0}if(C.x!==void 0&&C.y!==void 0){const L={id:g,type:"position",position:{...C}};z.push(L)}if(T.width!==void 0&&T.height!==void 0){const O={id:g,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:T.width,height:T.height}};z.push(O)}for(const L of R){const O={...L,type:"position"};z.push(O)}F(z)},onEnd:({width:T,height:R})=>{const F={id:g,type:"dimensions",resizing:!1,dimensions:{width:T,height:R}};N.getState().triggerNodeChanges([F])}})),_.current.update({controlPosition:I,boundaries:{minWidth:l,minHeight:u,maxWidth:c,maxHeight:h},keepAspectRatio:d,resizeDirection:f,onResizeStart:w,onResize:S,onResizeEnd:m,shouldResize:y}),()=>{var T;(T=_.current)==null||T.destroy()}},[I,l,u,c,h,d,w,S,m,y]);const D=I.split("-");return a.jsx("div",{className:Me(["react-flow__resize-control","nodrag",...D,n,r]),ref:b,style:{...s,scale:j,...i&&{[k?"backgroundColor":"borderColor"]:i}},children:o})}p.memo(WP);function YP(){const[e,t]=p.useState(()=>document.documentElement.classList.contains("dark"));return p.useEffect(()=>{const n=new MutationObserver(()=>t(document.documentElement.classList.contains("dark")));return n.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>n.disconnect()},[]),e}function GP(){const[e,t]=p.useState([]),[n,r]=p.useState([]),[s,o]=p.useState(!0),i=YP();p.useEffect(()=>{Promise.all([ue.discovery.agents(),ue.observations.permissions()]).then(([c,h])=>{t(c.data??[]),r(h.data??[]),o(!1)}).catch(()=>o(!1))},[]);const{nodes:l,edges:u}=p.useMemo(()=>{const c=[],h=[],d=new Set,f=new Map,x=i?{background:"#18181b",color:"#fafafa",border:"1px solid #3f3f46"}:{background:"#ffffff",color:"#09090b",border:"1px solid #e4e4e7"},y=i?{background:"#09090b",color:"#a1a1aa",border:"1px solid #3f3f46"}:{background:"#f4f4f5",color:"#52525b",border:"1px solid #d4d4d8"},w=i?"#52525b":"#a1a1aa",S=i?"#27272a":"#e4e4e7";return e.forEach((m,v)=>{const g=`agent-${m.id}`;m.registeredAgentId&&f.set(m.registeredAgentId,g),f.set(m.id,g),c.push({id:g,position:{x:100,y:v*120},data:{label:`${m.emoji||"🤖"} ${m.name}`},style:{...x,borderRadius:"8px",padding:"8px 16px",fontSize:"13px"}})}),n.forEach(m=>{const v=`tool-${m.toolName}`;d.has(m.toolName)||(d.add(m.toolName),c.push({id:v,position:{x:400,y:d.size*80},data:{label:`🔧 ${m.toolName}`},style:{...y,borderRadius:"8px",padding:"6px 12px",fontSize:"12px"}}));const g=f.get(m.agentId)??`agent-${m.agentId}`;h.push({id:`e-${m.agentId}-${m.toolName}`,source:g,target:v,animated:m.accessPattern==="write",style:{stroke:m.accessPattern==="write"?"#eab308":w}})}),{nodes:c,edges:h,bgColor:S}},[e,n,i]);return s?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Identity Graph"}),a.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Agent-to-tool relationship visualization"})]}),a.jsx("div",{className:"h-[600px] rounded-lg border border-border bg-card",children:a.jsxs(yP,{nodes:l,edges:u,fitView:!0,proOptions:{hideAttribution:!0},children:[a.jsx(bP,{color:i?"#27272a":"#e4e4e7",gap:20}),a.jsx(MP,{})]})})]})}const gf=p.forwardRef(({className:e,...t},n)=>a.jsx("textarea",{className:_e("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));gf.displayName="Textarea";const wt=p.forwardRef(({className:e,...t},n)=>a.jsx("label",{ref:n,className:_e("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));wt.displayName="Label";function Fe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function KP(e,t){const n=p.createContext(t);function r(o){const{children:i,...l}=o,u=p.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:u,children:i})}function s(o){const i=p.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,s]}function Ea(e,t=[]){let n=[];function r(o,i){const l=p.createContext(i),u=n.length;n=[...n,i];function c(d){const{scope:f,children:x,...y}=d,w=(f==null?void 0:f[e][u])||l,S=p.useMemo(()=>y,Object.values(y));return a.jsx(w.Provider,{value:S,children:x})}function h(d,f){const x=(f==null?void 0:f[e][u])||l,y=p.useContext(x);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,h]}const s=()=>{const o=n.map(i=>p.createContext(i));return function(l){const u=(l==null?void 0:l[e])||o;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return s.scopeName=e,[r,XP(s,...t)]}function XP(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((l,{useScope:u,scopeName:c})=>{const d=u(o)[`__scope${c}`];return{...l,...d}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function QP(e){const t=e+"CollectionProvider",[n,r]=Ea(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=x=>{const{scope:y,children:w}=x,S=Ut.useRef(null),m=Ut.useRef(new Map).current;return a.jsx(s,{scope:y,itemMap:m,collectionRef:S,children:w})};i.displayName=t;const l=e+"CollectionSlot",u=Ut.forwardRef((x,y)=>{const{scope:w,children:S}=x,m=o(l,w),v=Zt(y,m.collectionRef);return a.jsx(ds,{ref:v,children:S})});u.displayName=l;const c=e+"CollectionItemSlot",h="data-radix-collection-item",d=Ut.forwardRef((x,y)=>{const{scope:w,children:S,...m}=x,v=Ut.useRef(null),g=Zt(y,v),N=o(c,w);return Ut.useEffect(()=>(N.itemMap.set(v,{ref:v,...m}),()=>void N.itemMap.delete(v))),a.jsx(ds,{[h]:"",ref:g,children:S})});d.displayName=c;function f(x){const y=o(e+"CollectionConsumer",x);return Ut.useCallback(()=>{const S=y.collectionRef.current;if(!S)return[];const m=Array.from(S.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((N,b)=>m.indexOf(N.ref.current)-m.indexOf(b.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:u,ItemSlot:d},f,r]}var Ul=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},qP=c1.useId||(()=>{}),ZP=0;function ho(e){const[t,n]=p.useState(qP());return Ul(()=>{n(r=>r??String(ZP++))},[e]),t?`radix-${t}`:""}var JP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ze=JP.reduce((e,t)=>{const n=p.forwardRef((r,s)=>{const{asChild:o,...i}=r,l=o?ds:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(l,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function e5(e,t){e&&aa.flushSync(()=>e.dispatchEvent(t))}function Kn(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function xf({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=t5({defaultProp:t,onChange:n}),o=e!==void 0,i=o?e:r,l=Kn(n),u=p.useCallback(c=>{if(o){const d=typeof c=="function"?c(e):c;d!==e&&l(d)}else s(c)},[o,e,s,l]);return[i,u]}function t5({defaultProp:e,onChange:t}){const n=p.useState(e),[r]=n,s=p.useRef(r),o=Kn(t);return p.useEffect(()=>{s.current!==r&&(o(r),s.current=r)},[r,s,o]),n}var n5=p.createContext(void 0);function B0(e){const t=p.useContext(n5);return e||t||"ltr"}var vu="rovingFocusGroup.onEntryFocus",r5={bubbles:!1,cancelable:!0},_a="RovingFocusGroup",[Vc,U0,s5]=QP(_a),[o5,W0]=Ea(_a,[s5]),[i5,l5]=o5(_a),Y0=p.forwardRef((e,t)=>a.jsx(Vc.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Vc.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(a5,{...e,ref:t})})}));Y0.displayName=_a;var a5=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:h=!1,...d}=e,f=p.useRef(null),x=Zt(t,f),y=B0(o),[w=null,S]=xf({prop:i,defaultProp:l,onChange:u}),[m,v]=p.useState(!1),g=Kn(c),N=U0(n),b=p.useRef(!1),[k,j]=p.useState(0);return p.useEffect(()=>{const _=f.current;if(_)return _.addEventListener(vu,g),()=>_.removeEventListener(vu,g)},[g]),a.jsx(i5,{scope:n,orientation:r,dir:y,loop:s,currentTabStopId:w,onItemFocus:p.useCallback(_=>S(_),[S]),onItemShiftTab:p.useCallback(()=>v(!0),[]),onFocusableItemAdd:p.useCallback(()=>j(_=>_+1),[]),onFocusableItemRemove:p.useCallback(()=>j(_=>_-1),[]),children:a.jsx(Ze.div,{tabIndex:m||k===0?-1:0,"data-orientation":r,...d,ref:x,style:{outline:"none",...e.style},onMouseDown:Fe(e.onMouseDown,()=>{b.current=!0}),onFocus:Fe(e.onFocus,_=>{const I=!b.current;if(_.target===_.currentTarget&&I&&!m){const D=new CustomEvent(vu,r5);if(_.currentTarget.dispatchEvent(D),!D.defaultPrevented){const T=N().filter(M=>M.focusable),R=T.find(M=>M.active),F=T.find(M=>M.id===w),A=[R,F,...T].filter(Boolean).map(M=>M.ref.current);X0(A,h)}}b.current=!1}),onBlur:Fe(e.onBlur,()=>v(!1))})})}),G0="RovingFocusGroupItem",K0=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,...i}=e,l=ho(),u=o||l,c=l5(G0,n),h=c.currentTabStopId===u,d=U0(n),{onFocusableItemAdd:f,onFocusableItemRemove:x}=c;return p.useEffect(()=>{if(r)return f(),()=>x()},[r,f,x]),a.jsx(Vc.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:a.jsx(Ze.span,{tabIndex:h?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:Fe(e.onMouseDown,y=>{r?c.onItemFocus(u):y.preventDefault()}),onFocus:Fe(e.onFocus,()=>c.onItemFocus(u)),onKeyDown:Fe(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){c.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const w=d5(y,c.orientation,c.dir);if(w!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let m=d().filter(v=>v.focusable).map(v=>v.ref.current);if(w==="last")m.reverse();else if(w==="prev"||w==="next"){w==="prev"&&m.reverse();const v=m.indexOf(y.currentTarget);m=c.loop?f5(m,v+1):m.slice(v+1)}setTimeout(()=>X0(m))}})})})});K0.displayName=G0;var u5={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function c5(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function d5(e,t,n){const r=c5(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return u5[r]}function X0(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function f5(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var h5=Y0,m5=K0;function p5(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var ti=e=>{const{present:t,children:n}=e,r=g5(t),s=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),o=Zt(r.ref,x5(s));return typeof n=="function"||r.isPresent?p.cloneElement(s,{ref:o}):null};ti.displayName="Presence";function g5(e){const[t,n]=p.useState(),r=p.useRef({}),s=p.useRef(e),o=p.useRef("none"),i=e?"mounted":"unmounted",[l,u]=p5(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const c=Ri(r.current);o.current=l==="mounted"?c:"none"},[l]),Ul(()=>{const c=r.current,h=s.current;if(h!==e){const f=o.current,x=Ri(c);e?u("MOUNT"):x==="none"||(c==null?void 0:c.display)==="none"?u("UNMOUNT"):u(h&&f!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,u]),Ul(()=>{if(t){const c=d=>{const x=Ri(r.current).includes(d.animationName);d.target===t&&x&&aa.flushSync(()=>u("ANIMATION_END"))},h=d=>{d.target===t&&(o.current=Ri(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:p.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Ri(e){return(e==null?void 0:e.animationName)||"none"}function x5(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var yf="Tabs",[y5]=Ea(yf,[W0]),Q0=W0(),[v5,vf]=y5(yf),q0=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:o,orientation:i="horizontal",dir:l,activationMode:u="automatic",...c}=e,h=B0(l),[d,f]=xf({prop:r,onChange:s,defaultProp:o});return a.jsx(v5,{scope:n,baseId:ho(),value:d,onValueChange:f,orientation:i,dir:h,activationMode:u,children:a.jsx(Ze.div,{dir:h,"data-orientation":i,...c,ref:t})})});q0.displayName=yf;var Z0="TabsList",J0=p.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,o=vf(Z0,n),i=Q0(n);return a.jsx(h5,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:r,children:a.jsx(Ze.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});J0.displayName=Z0;var ev="TabsTrigger",tv=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...o}=e,i=vf(ev,n),l=Q0(n),u=sv(i.baseId,r),c=ov(i.baseId,r),h=r===i.value;return a.jsx(m5,{asChild:!0,...l,focusable:!s,active:h,children:a.jsx(Ze.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":c,"data-state":h?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:u,...o,ref:t,onMouseDown:Fe(e.onMouseDown,d=>{!s&&d.button===0&&d.ctrlKey===!1?i.onValueChange(r):d.preventDefault()}),onKeyDown:Fe(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&i.onValueChange(r)}),onFocus:Fe(e.onFocus,()=>{const d=i.activationMode!=="manual";!h&&!s&&d&&i.onValueChange(r)})})})});tv.displayName=ev;var nv="TabsContent",rv=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:o,...i}=e,l=vf(nv,n),u=sv(l.baseId,r),c=ov(l.baseId,r),h=r===l.value,d=p.useRef(h);return p.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),a.jsx(ti,{present:s||h,children:({present:f})=>a.jsx(Ze.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!f,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:f&&o})})});rv.displayName=nv;function sv(e,t){return`${e}-trigger-${t}`}function ov(e,t){return`${e}-content-${t}`}var w5=q0,iv=J0,lv=tv,av=rv;const wf=w5,Pa=p.forwardRef(({className:e,...t},n)=>a.jsx(iv,{ref:n,className:_e("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Pa.displayName=iv.displayName;const gt=p.forwardRef(({className:e,...t},n)=>a.jsx(lv,{ref:n,className:_e("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));gt.displayName=lv.displayName;const xt=p.forwardRef(({className:e,...t},n)=>a.jsx(av,{ref:n,className:_e("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));xt.displayName=av.displayName;function N5(e,t=globalThis==null?void 0:globalThis.document){const n=Kn(e);p.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var S5="DismissableLayer",Bc="dismissableLayer.update",b5="dismissableLayer.pointerDownOutside",k5="dismissableLayer.focusOutside",Jm,uv=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cv=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:l,...u}=e,c=p.useContext(uv),[h,d]=p.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=p.useState({}),y=Zt(t,j=>d(j)),w=Array.from(c.layers),[S]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),m=w.indexOf(S),v=h?w.indexOf(h):-1,g=c.layersWithOutsidePointerEventsDisabled.size>0,N=v>=m,b=E5(j=>{const _=j.target,I=[...c.branches].some(D=>D.contains(_));!N||I||(s==null||s(j),i==null||i(j),j.defaultPrevented||l==null||l())},f),k=_5(j=>{const _=j.target;[...c.branches].some(D=>D.contains(_))||(o==null||o(j),i==null||i(j),j.defaultPrevented||l==null||l())},f);return N5(j=>{v===c.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&l&&(j.preventDefault(),l()))},f),p.useEffect(()=>{if(h)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Jm=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(h)),c.layers.add(h),ep(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Jm)}},[h,f,n,c]),p.useEffect(()=>()=>{h&&(c.layers.delete(h),c.layersWithOutsidePointerEventsDisabled.delete(h),ep())},[h,c]),p.useEffect(()=>{const j=()=>x({});return document.addEventListener(Bc,j),()=>document.removeEventListener(Bc,j)},[]),a.jsx(Ze.div,{...u,ref:y,style:{pointerEvents:g?N?"auto":"none":void 0,...e.style},onFocusCapture:Fe(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Fe(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Fe(e.onPointerDownCapture,b.onPointerDownCapture)})});cv.displayName=S5;var j5="DismissableLayerBranch",C5=p.forwardRef((e,t)=>{const n=p.useContext(uv),r=p.useRef(null),s=Zt(t,r);return p.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),a.jsx(Ze.div,{...e,ref:s})});C5.displayName=j5;function E5(e,t=globalThis==null?void 0:globalThis.document){const n=Kn(e),r=p.useRef(!1),s=p.useRef(()=>{});return p.useEffect(()=>{const o=l=>{if(l.target&&!r.current){let u=function(){dv(b5,n,c,{discrete:!0})};const c={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=u,t.addEventListener("click",s.current,{once:!0})):u()}else t.removeEventListener("click",s.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function _5(e,t=globalThis==null?void 0:globalThis.document){const n=Kn(e),r=p.useRef(!1);return p.useEffect(()=>{const s=o=>{o.target&&!r.current&&dv(k5,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ep(){const e=new CustomEvent(Bc);document.dispatchEvent(e)}function dv(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?e5(s,o):s.dispatchEvent(o)}var wu="focusScope.autoFocusOnMount",Nu="focusScope.autoFocusOnUnmount",tp={bubbles:!1,cancelable:!0},P5="FocusScope",fv=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[l,u]=p.useState(null),c=Kn(s),h=Kn(o),d=p.useRef(null),f=Zt(t,w=>u(w)),x=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let w=function(g){if(x.paused||!l)return;const N=g.target;l.contains(N)?d.current=N:Cn(d.current,{select:!0})},S=function(g){if(x.paused||!l)return;const N=g.relatedTarget;N!==null&&(l.contains(N)||Cn(d.current,{select:!0}))},m=function(g){if(document.activeElement===document.body)for(const b of g)b.removedNodes.length>0&&Cn(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",S);const v=new MutationObserver(m);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",S),v.disconnect()}}},[r,l,x.paused]),p.useEffect(()=>{if(l){rp.add(x);const w=document.activeElement;if(!l.contains(w)){const m=new CustomEvent(wu,tp);l.addEventListener(wu,c),l.dispatchEvent(m),m.defaultPrevented||(M5(A5(hv(l)),{select:!0}),document.activeElement===w&&Cn(l))}return()=>{l.removeEventListener(wu,c),setTimeout(()=>{const m=new CustomEvent(Nu,tp);l.addEventListener(Nu,h),l.dispatchEvent(m),m.defaultPrevented||Cn(w??document.body,{select:!0}),l.removeEventListener(Nu,h),rp.remove(x)},0)}}},[l,c,h,x]);const y=p.useCallback(w=>{if(!n&&!r||x.paused)return;const S=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,m=document.activeElement;if(S&&m){const v=w.currentTarget,[g,N]=I5(v);g&&N?!w.shiftKey&&m===N?(w.preventDefault(),n&&Cn(g,{select:!0})):w.shiftKey&&m===g&&(w.preventDefault(),n&&Cn(N,{select:!0})):m===v&&w.preventDefault()}},[n,r,x.paused]);return a.jsx(Ze.div,{tabIndex:-1,...i,ref:f,onKeyDown:y})});fv.displayName=P5;function M5(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Cn(r,{select:t}),document.activeElement!==n)return}function I5(e){const t=hv(e),n=np(t,e),r=np(t.reverse(),e);return[n,r]}function hv(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function np(e,t){for(const n of e)if(!R5(n,{upTo:t}))return n}function R5(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function T5(e){return e instanceof HTMLInputElement&&"select"in e}function Cn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&T5(e)&&t&&e.select()}}var rp=L5();function L5(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=sp(e,t),e.unshift(t)},remove(t){var n;e=sp(e,t),(n=e[0])==null||n.resume()}}}function sp(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function A5(e){return e.filter(t=>t.tagName!=="A")}var z5="Portal",mv=p.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,o]=p.useState(!1);Ul(()=>o(!0),[]);const i=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return i?N2.createPortal(a.jsx(Ze.div,{...r,ref:t}),i):null});mv.displayName=z5;var Su=0;function D5(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??op()),document.body.insertAdjacentElement("beforeend",e[1]??op()),Su++,()=>{Su===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Su--}},[])}function op(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Gt=function(){return Gt=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Gt.apply(this,arguments)};function pv(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function $5(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var sl="right-scroll-bar-position",ol="width-before-scroll-bar",O5="with-scroll-bars-hidden",F5="--removed-body-scroll-bar-size";function bu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function H5(e,t){var n=p.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var V5=typeof window<"u"?p.useLayoutEffect:p.useEffect,ip=new WeakMap;function B5(e,t){var n=H5(null,function(r){return e.forEach(function(s){return bu(s,r)})});return V5(function(){var r=ip.get(n);if(r){var s=new Set(r),o=new Set(e),i=n.current;s.forEach(function(l){o.has(l)||bu(l,null)}),o.forEach(function(l){s.has(l)||bu(l,i)})}ip.set(n,e)},[e]),n}function U5(e){return e}function W5(e,t){t===void 0&&(t=U5);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var i=t(o,r);return n.push(i),function(){n=n.filter(function(l){return l!==i})}},assignSyncMedium:function(o){for(r=!0;n.length;){var i=n;n=[],i.forEach(o)}n={push:function(l){return o(l)},filter:function(){return n}}},assignMedium:function(o){r=!0;var i=[];if(n.length){var l=n;n=[],l.forEach(o),i=n}var u=function(){var h=i;i=[],h.forEach(o)},c=function(){return Promise.resolve().then(u)};c(),n={push:function(h){i.push(h),c()},filter:function(h){return i=i.filter(h),n}}}};return s}function Y5(e){e===void 0&&(e={});var t=W5(null);return t.options=Gt({async:!0,ssr:!1},e),t}var gv=function(e){var t=e.sideCar,n=pv(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,Gt({},n))};gv.isSideCarExport=!0;function G5(e,t){return e.useMedium(t),gv}var xv=Y5(),ku=function(){},Ma=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:ku,onWheelCapture:ku,onTouchMoveCapture:ku}),s=r[0],o=r[1],i=e.forwardProps,l=e.children,u=e.className,c=e.removeScrollBar,h=e.enabled,d=e.shards,f=e.sideCar,x=e.noIsolation,y=e.inert,w=e.allowPinchZoom,S=e.as,m=S===void 0?"div":S,v=e.gapMode,g=pv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=f,b=B5([n,t]),k=Gt(Gt({},g),s);return p.createElement(p.Fragment,null,h&&p.createElement(N,{sideCar:xv,removeScrollBar:c,shards:d,noIsolation:x,inert:y,setCallbacks:o,allowPinchZoom:!!w,lockRef:n,gapMode:v}),i?p.cloneElement(p.Children.only(l),Gt(Gt({},k),{ref:b})):p.createElement(m,Gt({},k,{className:u,ref:b}),l))});Ma.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ma.classNames={fullWidth:ol,zeroRight:sl};var K5=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function X5(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=K5();return t&&e.setAttribute("nonce",t),e}function Q5(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function q5(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Z5=function(){var e=0,t=null;return{add:function(n){e==0&&(t=X5())&&(Q5(t,n),q5(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},J5=function(){var e=Z5();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},yv=function(){var e=J5(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},eM={left:0,top:0,right:0,gap:0},ju=function(e){return parseInt(e||"",10)||0},tM=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[ju(n),ju(r),ju(s)]},nM=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return eM;var t=tM(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},rM=yv(),ns="data-scroll-locked",sM=function(e,t,n,r){var s=e.left,o=e.top,i=e.right,l=e.gap;return n===void 0&&(n="margin"),`
324
+ .`.concat(O5,` {
325
+ overflow: hidden `).concat(r,`;
326
+ padding-right: `).concat(l,"px ").concat(r,`;
327
+ }
328
+ body[`).concat(ns,`] {
329
+ overflow: hidden `).concat(r,`;
330
+ overscroll-behavior: contain;
331
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
332
+ padding-left: `.concat(s,`px;
333
+ padding-top: `).concat(o,`px;
334
+ padding-right: `).concat(i,`px;
335
+ margin-left:0;
336
+ margin-top:0;
337
+ margin-right: `).concat(l,"px ").concat(r,`;
338
+ `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
339
+ }
340
+
341
+ .`).concat(sl,` {
342
+ right: `).concat(l,"px ").concat(r,`;
343
+ }
344
+
345
+ .`).concat(ol,` {
346
+ margin-right: `).concat(l,"px ").concat(r,`;
347
+ }
348
+
349
+ .`).concat(sl," .").concat(sl,` {
350
+ right: 0 `).concat(r,`;
351
+ }
352
+
353
+ .`).concat(ol," .").concat(ol,` {
354
+ margin-right: 0 `).concat(r,`;
355
+ }
356
+
357
+ body[`).concat(ns,`] {
358
+ `).concat(F5,": ").concat(l,`px;
359
+ }
360
+ `)},lp=function(){var e=parseInt(document.body.getAttribute(ns)||"0",10);return isFinite(e)?e:0},oM=function(){p.useEffect(function(){return document.body.setAttribute(ns,(lp()+1).toString()),function(){var e=lp()-1;e<=0?document.body.removeAttribute(ns):document.body.setAttribute(ns,e.toString())}},[])},iM=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;oM();var o=p.useMemo(function(){return nM(s)},[s]);return p.createElement(rM,{styles:sM(o,!t,s,n?"":"!important")})},Uc=!1;if(typeof window<"u")try{var Ti=Object.defineProperty({},"passive",{get:function(){return Uc=!0,!0}});window.addEventListener("test",Ti,Ti),window.removeEventListener("test",Ti,Ti)}catch{Uc=!1}var Ir=Uc?{passive:!1}:!1,lM=function(e){return e.tagName==="TEXTAREA"},vv=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!lM(e)&&n[t]==="visible")},aM=function(e){return vv(e,"overflowY")},uM=function(e){return vv(e,"overflowX")},ap=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=wv(e,r);if(s){var o=Nv(e,r),i=o[1],l=o[2];if(i>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},cM=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},dM=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},wv=function(e,t){return e==="v"?aM(t):uM(t)},Nv=function(e,t){return e==="v"?cM(t):dM(t)},fM=function(e,t){return e==="h"&&t==="rtl"?-1:1},hM=function(e,t,n,r,s){var o=fM(e,window.getComputedStyle(t).direction),i=o*r,l=n.target,u=t.contains(l),c=!1,h=i>0,d=0,f=0;do{var x=Nv(e,l),y=x[0],w=x[1],S=x[2],m=w-S-o*y;(y||m)&&wv(e,l)&&(d+=m,f+=y),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return(h&&Math.abs(d)<1||!h&&Math.abs(f)<1)&&(c=!0),c},Li=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},up=function(e){return[e.deltaX,e.deltaY]},cp=function(e){return e&&"current"in e?e.current:e},mM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},pM=function(e){return`
361
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
362
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
363
+ `)},gM=0,Rr=[];function xM(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),s=p.useState(gM++)[0],o=p.useState(yv)[0],i=p.useRef(e);p.useEffect(function(){i.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=$5([e.lockRef.current],(e.shards||[]).map(cp),!0).filter(Boolean);return w.forEach(function(S){return S.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=p.useCallback(function(w,S){if("touches"in w&&w.touches.length===2)return!i.current.allowPinchZoom;var m=Li(w),v=n.current,g="deltaX"in w?w.deltaX:v[0]-m[0],N="deltaY"in w?w.deltaY:v[1]-m[1],b,k=w.target,j=Math.abs(g)>Math.abs(N)?"h":"v";if("touches"in w&&j==="h"&&k.type==="range")return!1;var _=ap(j,k);if(!_)return!0;if(_?b=j:(b=j==="v"?"h":"v",_=ap(j,k)),!_)return!1;if(!r.current&&"changedTouches"in w&&(g||N)&&(r.current=b),!b)return!0;var I=r.current||b;return hM(I,S,w,I==="h"?g:N)},[]),u=p.useCallback(function(w){var S=w;if(!(!Rr.length||Rr[Rr.length-1]!==o)){var m="deltaY"in S?up(S):Li(S),v=t.current.filter(function(b){return b.name===S.type&&(b.target===S.target||S.target===b.shadowParent)&&mM(b.delta,m)})[0];if(v&&v.should){S.cancelable&&S.preventDefault();return}if(!v){var g=(i.current.shards||[]).map(cp).filter(Boolean).filter(function(b){return b.contains(S.target)}),N=g.length>0?l(S,g[0]):!i.current.noIsolation;N&&S.cancelable&&S.preventDefault()}}},[]),c=p.useCallback(function(w,S,m,v){var g={name:w,delta:S,target:m,should:v,shadowParent:yM(m)};t.current.push(g),setTimeout(function(){t.current=t.current.filter(function(N){return N!==g})},1)},[]),h=p.useCallback(function(w){n.current=Li(w),r.current=void 0},[]),d=p.useCallback(function(w){c(w.type,up(w),w.target,l(w,e.lockRef.current))},[]),f=p.useCallback(function(w){c(w.type,Li(w),w.target,l(w,e.lockRef.current))},[]);p.useEffect(function(){return Rr.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",u,Ir),document.addEventListener("touchmove",u,Ir),document.addEventListener("touchstart",h,Ir),function(){Rr=Rr.filter(function(w){return w!==o}),document.removeEventListener("wheel",u,Ir),document.removeEventListener("touchmove",u,Ir),document.removeEventListener("touchstart",h,Ir)}},[]);var x=e.removeScrollBar,y=e.inert;return p.createElement(p.Fragment,null,y?p.createElement(o,{styles:pM(s)}):null,x?p.createElement(iM,{gapMode:e.gapMode}):null)}function yM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const vM=G5(xv,xM);var Sv=p.forwardRef(function(e,t){return p.createElement(Ma,Gt({},e,{ref:t,sideCar:vM}))});Sv.classNames=Ma.classNames;var wM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Tr=new WeakMap,Ai=new WeakMap,zi={},Cu=0,bv=function(e){return e&&(e.host||bv(e.parentNode))},NM=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=bv(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},SM=function(e,t,n,r){var s=NM(t,Array.isArray(e)?e:[e]);zi[n]||(zi[n]=new WeakMap);var o=zi[n],i=[],l=new Set,u=new Set(s),c=function(d){!d||l.has(d)||(l.add(d),c(d.parentNode))};s.forEach(c);var h=function(d){!d||u.has(d)||Array.prototype.forEach.call(d.children,function(f){if(l.has(f))h(f);else try{var x=f.getAttribute(r),y=x!==null&&x!=="false",w=(Tr.get(f)||0)+1,S=(o.get(f)||0)+1;Tr.set(f,w),o.set(f,S),i.push(f),w===1&&y&&Ai.set(f,!0),S===1&&f.setAttribute(n,"true"),y||f.setAttribute(r,"true")}catch(m){console.error("aria-hidden: cannot operate on ",f,m)}})};return h(t),l.clear(),Cu++,function(){i.forEach(function(d){var f=Tr.get(d)-1,x=o.get(d)-1;Tr.set(d,f),o.set(d,x),f||(Ai.has(d)||d.removeAttribute(r),Ai.delete(d)),x||d.removeAttribute(n)}),Cu--,Cu||(Tr=new WeakMap,Tr=new WeakMap,Ai=new WeakMap,zi={})}},bM=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=wM(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),SM(r,s,n,"aria-hidden")):function(){return null}},Nf="Dialog",[kv]=Ea(Nf),[kM,Ht]=kv(Nf),jv=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,l=p.useRef(null),u=p.useRef(null),[c=!1,h]=xf({prop:r,defaultProp:s,onChange:o});return a.jsx(kM,{scope:t,triggerRef:l,contentRef:u,contentId:ho(),titleId:ho(),descriptionId:ho(),open:c,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(d=>!d),[h]),modal:i,children:n})};jv.displayName=Nf;var Cv="DialogTrigger",jM=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ht(Cv,n),o=Zt(t,s.triggerRef);return a.jsx(Ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":kf(s.open),...r,ref:o,onClick:Fe(e.onClick,s.onOpenToggle)})});jM.displayName=Cv;var Sf="DialogPortal",[CM,Ev]=kv(Sf,{forceMount:void 0}),_v=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Ht(Sf,t);return a.jsx(CM,{scope:t,forceMount:n,children:p.Children.map(r,i=>a.jsx(ti,{present:n||o.open,children:a.jsx(mv,{asChild:!0,container:s,children:i})}))})};_v.displayName=Sf;var Wl="DialogOverlay",Pv=p.forwardRef((e,t)=>{const n=Ev(Wl,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Ht(Wl,e.__scopeDialog);return o.modal?a.jsx(ti,{present:r||o.open,children:a.jsx(EM,{...s,ref:t})}):null});Pv.displayName=Wl;var EM=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ht(Wl,n);return a.jsx(Sv,{as:ds,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(Ze.div,{"data-state":kf(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Sr="DialogContent",Mv=p.forwardRef((e,t)=>{const n=Ev(Sr,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Ht(Sr,e.__scopeDialog);return a.jsx(ti,{present:r||o.open,children:o.modal?a.jsx(_M,{...s,ref:t}):a.jsx(PM,{...s,ref:t})})});Mv.displayName=Sr;var _M=p.forwardRef((e,t)=>{const n=Ht(Sr,e.__scopeDialog),r=p.useRef(null),s=Zt(t,n.contentRef,r);return p.useEffect(()=>{const o=r.current;if(o)return bM(o)},[]),a.jsx(Iv,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Fe(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:Fe(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&o.preventDefault()}),onFocusOutside:Fe(e.onFocusOutside,o=>o.preventDefault())})}),PM=p.forwardRef((e,t)=>{const n=Ht(Sr,e.__scopeDialog),r=p.useRef(!1),s=p.useRef(!1);return a.jsx(Iv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,l;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var u,c;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),Iv=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,l=Ht(Sr,n),u=p.useRef(null),c=Zt(t,u);return D5(),a.jsxs(a.Fragment,{children:[a.jsx(fv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:a.jsx(cv,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":kf(l.open),...i,ref:c,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(MM,{titleId:l.titleId}),a.jsx(RM,{contentRef:u,descriptionId:l.descriptionId})]})]})}),bf="DialogTitle",Rv=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ht(bf,n);return a.jsx(Ze.h2,{id:s.titleId,...r,ref:t})});Rv.displayName=bf;var Tv="DialogDescription",Lv=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ht(Tv,n);return a.jsx(Ze.p,{id:s.descriptionId,...r,ref:t})});Lv.displayName=Tv;var Av="DialogClose",zv=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ht(Av,n);return a.jsx(Ze.button,{type:"button",...r,ref:t,onClick:Fe(e.onClick,()=>s.onOpenChange(!1))})});zv.displayName=Av;function kf(e){return e?"open":"closed"}var Dv="DialogTitleWarning",[xI,$v]=KP(Dv,{contentName:Sr,titleName:bf,docsSlug:"dialog"}),MM=({titleId:e})=>{const t=$v(Dv),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
364
+
365
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
366
+
367
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},IM="DialogDescriptionWarning",RM=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${$v(IM).contentName}}.`;return p.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},TM=jv,LM=_v,Ov=Pv,Fv=Mv,Hv=Rv,Vv=Lv,AM=zv;const _s=TM,zM=LM,Bv=p.forwardRef(({className:e,...t},n)=>a.jsx(Ov,{ref:n,className:_e("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Bv.displayName=Ov.displayName;const jr=p.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(zM,{children:[a.jsx(Bv,{}),a.jsxs(Fv,{ref:r,className:_e("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,a.jsxs(AM,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(ek,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));jr.displayName=Fv.displayName;const Ps=({className:e,...t})=>a.jsx("div",{className:_e("flex flex-col space-y-1.5 text-center sm:text-left",e),...t}),Ms=({className:e,...t})=>a.jsx("div",{className:_e("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t}),Cr=p.forwardRef(({className:e,...t},n)=>a.jsx(Hv,{ref:n,className:_e("text-lg font-semibold leading-none tracking-tight",e),...t}));Cr.displayName=Hv.displayName;const Er=p.forwardRef(({className:e,...t},n)=>a.jsx(Vv,{ref:n,className:_e("text-sm text-muted-foreground",e),...t}));Er.displayName=Vv.displayName;function DM({message:e,type:t,onClose:n}){return p.useEffect(()=>{const r=setTimeout(n,4e3);return()=>clearTimeout(r)},[n]),a.jsxs("div",{className:`fixed bottom-6 right-6 z-[100] flex items-center gap-2 rounded-lg border px-4 py-3 shadow-lg transition-all animate-in slide-in-from-bottom-4 ${t==="success"?"border-emerald-500/30 bg-emerald-50 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200":"border-destructive/30 bg-red-50 text-red-800 dark:bg-red-950 dark:text-red-200"}`,children:[t==="success"?a.jsx(xr,{className:"h-4 w-4"}):a.jsx(zt,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:e}),a.jsx("button",{onClick:n,className:"ml-2 text-current/50 hover:text-current",children:"×"})]})}function $M(){const[e,t]=p.useState([]),[n,r]=p.useState(""),[s,o]=p.useState(!0),[i,l]=p.useState("skills"),[u,c]=p.useState(null),h=p.useRef(null),d=p.useCallback((y,w="success")=>{c({message:y,type:w})},[]),f=p.useCallback(()=>{d("Command sent to agent"),l("commands"),setTimeout(()=>{var y;return(y=h.current)==null?void 0:y.call(h)},300)},[d]),x=p.useCallback(y=>{const w=y instanceof Error?y.message:"Failed to send command";d(w,"error")},[d]);return p.useEffect(()=>{ue.discovery.agents().then(y=>{const w=y.data??[];t(w),w.length>0&&!n&&r(w[0].registeredAgentId??w[0].id)}).catch(()=>{}).finally(()=>o(!1))},[]),s?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading agents..."}):e.length===0?a.jsxs("div",{className:"space-y-6",children:[a.jsx("h1",{className:"text-lg font-semibold",children:"Operations"}),a.jsxs("div",{className:"flex h-60 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[a.jsx(fa,{className:"h-10 w-10 text-muted-foreground/30"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents discovered yet"}),a.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Connect an agent with the Guards plugin to get started"})]})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"text-lg font-semibold",children:"Operations"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs text-muted-foreground",children:"Agent:"}),a.jsx("select",{className:"h-8 rounded-md border border-input bg-background px-2 text-sm focus:outline-none focus:ring-1 focus:ring-ring",value:n,onChange:y=>r(y.target.value),children:e.map(y=>a.jsxs("option",{value:y.registeredAgentId??y.id,children:[y.emoji?`${y.emoji} `:"",y.name]},y.registeredAgentId??y.id))})]})]}),n&&a.jsxs(wf,{value:i,onValueChange:l,className:"w-full",children:[a.jsxs(Pa,{children:[a.jsxs(gt,{value:"skills",children:[a.jsx(ur,{className:"mr-1.5 h-3.5 w-3.5"})," Skills"]}),a.jsxs(gt,{value:"commands",children:[a.jsx(Ro,{className:"mr-1.5 h-3.5 w-3.5"})," Commands"]}),a.jsxs(gt,{value:"config",children:[a.jsx(qt,{className:"mr-1.5 h-3.5 w-3.5"})," Config"]})]}),a.jsx(xt,{value:"skills",children:a.jsx(OM,{agentId:n,agents:e,onCommandSent:f,onCommandError:x})}),a.jsx(xt,{value:"commands",children:a.jsx(FM,{agentId:n,refreshRef:h})}),a.jsx(xt,{value:"config",children:a.jsx(HM,{agentId:n,onCommandSent:f,onCommandError:x})})]}),u&&a.jsx(DM,{message:u.message,type:u.type,onClose:()=>c(null)})]})}function OM({agentId:e,agents:t,onCommandSent:n,onCommandError:r}){const s=t.find(h=>(h.registeredAgentId??h.id)===e),o=(s==null?void 0:s.skills)??[],[i,l]=p.useState(!1),[u,c]=p.useState(null);return a.jsxs("div",{className:"space-y-4 pt-4",children:[a.jsx("div",{className:"flex gap-2",children:a.jsxs(J,{size:"sm",onClick:()=>l(!0),children:[a.jsx(Yn,{className:"mr-1.5 h-3.5 w-3.5"})," Install Skill"]})}),a.jsxs(Ee,{children:[a.jsx(De,{children:a.jsxs($e,{className:"flex items-center gap-2 text-sm",children:[a.jsx(ur,{className:"h-4 w-4"})," Installed Skills (",o.length,")"]})}),a.jsx(Te,{children:o.length===0?a.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[a.jsx(ur,{className:"h-10 w-10 text-muted-foreground/20"}),a.jsxs("div",{className:"text-center",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"No skills installed"}),a.jsxs("p",{className:"mt-1 text-xs text-muted-foreground/70",children:["Install skills from ",a.jsx("a",{href:"https://clawhub.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"ClawHub"})," or provide custom skill content"]})]}),a.jsx(J,{size:"sm",variant:"outline",onClick:()=>l(!0),children:"Install your first skill"})]}):a.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:o.map(h=>a.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border p-3 transition-colors hover:bg-muted/30",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-muted",children:a.jsx(ur,{className:"h-4 w-4 text-muted-foreground"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:h.name}),h.description&&a.jsx("p",{className:"text-[11px] text-muted-foreground line-clamp-1",children:h.description})]})]}),a.jsx(J,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>c(h.name),children:a.jsx($t,{className:"h-3.5 w-3.5"})})]},h.name))})})]}),a.jsxs(Ee,{children:[a.jsx(De,{children:a.jsx($e,{className:"text-sm",children:"How Skills Work"})}),a.jsxs(Te,{className:"text-xs text-muted-foreground space-y-2",children:[a.jsxs("p",{children:["Skills are ",a.jsx("a",{href:"https://agentskills.io",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"AgentSkills"}),"-compatible folders containing a ",a.jsx("code",{className:"rounded bg-muted px-1",children:"SKILL.md"})," with YAML frontmatter and instructions."]}),a.jsx("p",{children:"Skills are loaded from three locations (highest to lowest precedence):"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-0.5 pl-2",children:[a.jsxs("li",{children:[a.jsx("code",{className:"rounded bg-muted px-1",children:"<workspace>/skills"})," — per-agent workspace skills"]}),a.jsxs("li",{children:[a.jsx("code",{className:"rounded bg-muted px-1",children:"~/.openclaw/workspace/skills"})," — shared managed skills"]}),a.jsx("li",{children:"Bundled skills — shipped with the OpenClaw install"})]}),a.jsxs("p",{children:["Browse and discover skills at ",a.jsx("a",{href:"https://clawhub.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"clawhub.com"}),". Registry installs use ",a.jsx("code",{className:"rounded bg-muted px-1",children:"clawhub install <slug>"}),"."]})]})]}),a.jsx(VM,{open:i,onOpenChange:l,agentId:e,onSuccess:n,onError:r}),a.jsx(BM,{open:u!==null,onOpenChange:h=>{h||c(null)},agentId:e,initialName:u??"",onSuccess:n,onError:r})]})}function FM({agentId:e,refreshRef:t}){const[n,r]=p.useState([]),[s,o]=p.useState(!0),[i,l]=p.useState(null),u=p.useCallback(()=>{ue.commands.list(e).then(f=>r(f.data??[])).catch(()=>{}).finally(()=>o(!1))},[e]);p.useEffect(()=>(t&&(t.current=u),()=>{t&&(t.current=null)}),[u,t]),p.useEffect(()=>{u()},[u]),p.useEffect(()=>{if(!n.some(y=>y.status==="pending"||y.status==="running"))return;const x=setInterval(u,5e3);return()=>clearInterval(x)},[n,u]);const c=f=>f==="completed"?a.jsx(xr,{className:"h-3.5 w-3.5 text-emerald-500"}):f==="failed"?a.jsx(zt,{className:"h-3.5 w-3.5 text-destructive"}):f==="running"?a.jsx(Dt,{className:"h-3.5 w-3.5 animate-spin text-amber-500"}):a.jsx(Wx,{className:"h-3.5 w-3.5 text-muted-foreground"}),h=f=>f==="completed"?"success":f==="failed"?"destructive":f==="running"?"warning":"secondary",d=f=>({install_skill:{icon:a.jsx(Yn,{className:"h-3 w-3"}),label:"Install Skill"},install_custom_skill:{icon:a.jsx(Es,{className:"h-3 w-3"}),label:"Custom Skill"},uninstall_skill:{icon:a.jsx($t,{className:"h-3 w-3"}),label:"Uninstall Skill"},install_plugin:{icon:a.jsx(Yn,{className:"h-3 w-3"}),label:"Install Plugin"},uninstall_plugin:{icon:a.jsx($t,{className:"h-3 w-3"}),label:"Uninstall Plugin"},update_config:{icon:a.jsx(qt,{className:"h-3 w-3"}),label:"Update Config"}})[f]??{icon:a.jsx(Ro,{className:"h-3 w-3"}),label:f};return s?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):a.jsxs("div",{className:"space-y-4 pt-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Command history for this agent"}),a.jsxs(J,{size:"sm",variant:"ghost",onClick:u,children:[a.jsx(Gn,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]}),n.length===0?a.jsxs("div",{className:"flex h-40 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[a.jsx(Ro,{className:"h-8 w-8 text-muted-foreground/30"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No commands sent yet"})]}):a.jsx("div",{className:"space-y-2",children:n.map(f=>{var S,m,v;const x=d(f.type),y=i===f.id,w=f.result||f.type==="install_custom_skill"&&((S=f.payload)==null?void 0:S.content);return a.jsxs("div",{className:"rounded-lg border border-border transition-colors hover:bg-muted/20",children:[a.jsxs("div",{className:"flex cursor-pointer items-center gap-3 px-4 py-3",onClick:()=>w&&l(y?null:f.id),children:[c(f.status),a.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[x.icon," ",a.jsx("span",{children:x.label})]}),a.jsxs("span",{className:"text-xs text-muted-foreground",children:[((m=f.payload)==null?void 0:m.skillName)&&`"${f.payload.skillName}"`,f.type==="update_config"&&f.payload&&!f.payload.skillName&&Object.keys(f.payload).join(", ")]}),a.jsx("div",{className:"flex-1"}),a.jsx(be,{variant:h(f.status),className:"text-[10px]",children:f.status}),a.jsx("span",{className:"text-[11px] text-muted-foreground",children:WM(f.createdAt)}),w&&(y?a.jsx(ha,{className:"h-3.5 w-3.5 text-muted-foreground"}):a.jsx(Xd,{className:"h-3.5 w-3.5 text-muted-foreground"}))]}),y&&w&&a.jsxs("div",{className:"border-t border-border bg-muted/30 px-4 py-3 text-xs",children:[f.result&&a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"font-medium text-muted-foreground",children:"Result"}),a.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap rounded-md bg-background p-2.5 font-mono text-[11px] text-muted-foreground",children:typeof f.result=="string"?f.result:JSON.stringify(f.result,null,2)})]}),f.type==="install_custom_skill"&&((v=f.payload)==null?void 0:v.content)&&a.jsxs("div",{className:"mt-2 space-y-1",children:[a.jsx("p",{className:"font-medium text-muted-foreground",children:"Skill Content"}),a.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap rounded-md bg-background p-2.5 font-mono text-[11px] text-muted-foreground",children:f.payload.content})]})]})]},f.id)})})]})}function HM({agentId:e,onCommandSent:t,onCommandError:n}){const[r,s]=p.useState(!1);return a.jsxs("div",{className:"space-y-4 pt-4",children:[a.jsxs(Ee,{children:[a.jsx(De,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs($e,{className:"flex items-center gap-2 text-sm",children:[a.jsx(qt,{className:"h-4 w-4"})," Guards Configuration"]}),a.jsxs(J,{size:"sm",variant:"outline",onClick:()=>s(!0),children:[a.jsx(qt,{className:"mr-1.5 h-3.5 w-3.5"})," Update Config"]})]})}),a.jsxs(Te,{className:"text-xs text-muted-foreground space-y-3",children:[a.jsxs("p",{children:["Send configuration updates to the Guards plugin running on this agent. Changes are merged with the existing config in ",a.jsx("code",{className:"rounded bg-muted px-1",children:"~/.openclaw/openclaw.json"}),"."]}),a.jsxs("div",{className:"rounded-md bg-muted p-3 space-y-1.5",children:[a.jsx("p",{className:"font-medium text-foreground text-xs",children:"Available settings:"}),a.jsxs("div",{className:"grid gap-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"blockOnRisk"}),a.jsx("span",{children:"Block tool calls when risk is detected"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"logLevel"}),a.jsx("span",{children:"Logging verbosity (debug, info, warn, error)"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"timeoutMs"}),a.jsx("span",{children:"Request timeout in milliseconds"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 text-[11px]",children:"enabled"}),a.jsx("span",{children:"Enable/disable the Guards plugin"})]})]})]})]})]}),a.jsx(UM,{open:r,onOpenChange:s,agentId:e,onSuccess:t,onError:n})]})}function VM({open:e,onOpenChange:t,agentId:n,onSuccess:r,onError:s}){const[o,i]=p.useState("registry"),[l,u]=p.useState(""),[c,h]=p.useState(""),[d,f]=p.useState(!1),[x,y]=p.useState(""),w=()=>{u(""),h(""),i("registry"),y("")},S=async()=>{if(!(o==="registry"&&!l.trim())&&!(o==="custom"&&(!l.trim()||!c.trim()))){f(!0),y("");try{o==="registry"?await ue.commands.create({agentId:n,type:"install_skill",payload:{skillName:l.trim()}}):await ue.commands.create({agentId:n,type:"install_custom_skill",payload:{skillName:l.trim(),content:c}}),w(),t(!1),r==null||r()}catch(m){const v=m instanceof Error?m.message:"Failed to send command";y(v),s==null||s(m)}finally{f(!1)}}};return a.jsx(_s,{open:e,onOpenChange:m=>{m||w(),t(m)},children:a.jsxs(jr,{className:"sm:max-w-[560px]",children:[a.jsxs(Ps,{children:[a.jsxs(Cr,{className:"flex items-center gap-2",children:[a.jsx(Yn,{className:"h-4 w-4"})," Install Skill"]}),a.jsxs(Er,{children:["Install from ",a.jsx("a",{href:"https://clawhub.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"ClawHub"})," registry or provide custom SKILL.md content."]})]}),a.jsxs(wf,{value:o,onValueChange:m=>{i(m),y("")},children:[a.jsxs(Pa,{className:"w-full",children:[a.jsxs(gt,{value:"registry",className:"flex-1",children:[a.jsx(ur,{className:"mr-1.5 h-3.5 w-3.5"})," ClawHub Registry"]}),a.jsxs(gt,{value:"custom",className:"flex-1",children:[a.jsx(Es,{className:"mr-1.5 h-3.5 w-3.5"})," Custom SKILL.md"]})]}),a.jsx(xt,{value:"registry",className:"space-y-4 pt-2",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx(wt,{htmlFor:"reg-skill-name",children:"Skill Slug"}),a.jsx(ot,{id:"reg-skill-name",placeholder:"e.g. web-search, code-review, self-improving-agent...",value:l,onChange:m=>{u(m.target.value),y("")},onKeyDown:m=>m.key==="Enter"&&S()}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Executes ",a.jsx("code",{className:"rounded bg-muted px-1",children:"clawhub install <slug>"})," on the agent. Browse available skills at ",a.jsx("a",{href:"https://clawhub.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"clawhub.com"}),"."]})]})}),a.jsxs(xt,{value:"custom",className:"space-y-4 pt-2",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(wt,{htmlFor:"custom-skill-name",children:"Skill Name"}),a.jsx(ot,{id:"custom-skill-name",placeholder:"my-custom-skill",value:l,onChange:m=>{u(m.target.value),y("")}})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(wt,{htmlFor:"custom-skill-content",children:"SKILL.md Content"}),a.jsx(gf,{id:"custom-skill-content",placeholder:`---
368
+ name: my-custom-skill
369
+ description: My custom skill
370
+ ---
371
+
372
+ Instructions for the agent...
373
+
374
+ Use {baseDir} to reference the skill folder path.`,value:c,onChange:m=>{h(m.target.value),y("")},className:"min-h-[200px] font-mono text-xs"}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["The content will be saved as ",a.jsx("code",{className:"rounded bg-muted px-1",children:"~/.openclaw/workspace/skills/<name>/SKILL.md"}),". Use YAML frontmatter with ",a.jsx("code",{className:"rounded bg-muted px-1",children:"name"})," and ",a.jsx("code",{className:"rounded bg-muted px-1",children:"description"})," fields."]})]})]})]}),x&&a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:[a.jsx(zt,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:x})]}),a.jsxs(Ms,{children:[a.jsx(J,{variant:"outline",onClick:()=>{w(),t(!1)},children:"Cancel"}),a.jsxs(J,{onClick:S,disabled:d||!l.trim()||o==="custom"&&!c.trim(),children:[d?a.jsx(Dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(Yn,{className:"mr-1.5 h-3.5 w-3.5"}),"Install"]})]})]})})}function BM({open:e,onOpenChange:t,agentId:n,initialName:r,onSuccess:s,onError:o}){const[i,l]=p.useState(r??""),[u,c]=p.useState(!1),[h,d]=p.useState("");p.useEffect(()=>{r&&l(r)},[r]);const f=async()=>{if(i.trim()){c(!0),d("");try{await ue.commands.create({agentId:n,type:"uninstall_skill",payload:{skillName:i.trim()}}),l(""),t(!1),s==null||s()}catch(x){const y=x instanceof Error?x.message:"Failed to send command";d(y),o==null||o(x)}finally{c(!1)}}};return a.jsx(_s,{open:e,onOpenChange:t,children:a.jsxs(jr,{className:"sm:max-w-[400px]",children:[a.jsxs(Ps,{children:[a.jsxs(Cr,{className:"flex items-center gap-2",children:[a.jsx($t,{className:"h-4 w-4"})," Uninstall Skill"]}),a.jsx(Er,{children:"This will send a command to remove the skill from the agent."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(wt,{htmlFor:"uninstall-name",children:"Skill Name"}),a.jsx(ot,{id:"uninstall-name",placeholder:"Skill name to uninstall...",value:i,onChange:x=>{l(x.target.value),d("")},onKeyDown:x=>x.key==="Enter"&&f()})]}),h&&a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:[a.jsx(zt,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:h})]}),a.jsxs(Ms,{children:[a.jsx(J,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),a.jsxs(J,{variant:"destructive",onClick:f,disabled:u||!i.trim(),children:[u?a.jsx(Dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx($t,{className:"mr-1.5 h-3.5 w-3.5"}),"Uninstall"]})]})]})})}function UM({open:e,onOpenChange:t,agentId:n,onSuccess:r,onError:s}){const[o,i]=p.useState(`{
375
+ "blockOnRisk": false
376
+ }`),[l,u]=p.useState(""),[c,h]=p.useState(!1),d=async()=>{u("");let f;try{f=JSON.parse(o)}catch{u("Invalid JSON");return}if(typeof f!="object"||f===null||Array.isArray(f)){u("Must be a JSON object");return}h(!0);try{await ue.commands.create({agentId:n,type:"update_config",payload:f}),t(!1),r==null||r()}catch(x){const y=x instanceof Error?x.message:"Failed to send command";u(y),s==null||s(x)}finally{h(!1)}};return a.jsx(_s,{open:e,onOpenChange:t,children:a.jsxs(jr,{className:"sm:max-w-[460px]",children:[a.jsxs(Ps,{children:[a.jsxs(Cr,{className:"flex items-center gap-2",children:[a.jsx(qt,{className:"h-4 w-4"})," Update Guards Config"]}),a.jsx(Er,{children:"Values will be merged into the existing Guards plugin configuration."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(wt,{htmlFor:"config-json",children:"Config JSON"}),a.jsx(gf,{id:"config-json",value:o,onChange:f=>{i(f.target.value),u("")},className:"min-h-[120px] font-mono text-xs"}),l&&a.jsx("p",{className:"text-xs text-destructive",children:l})]}),a.jsxs(Ms,{children:[a.jsx(J,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),a.jsxs(J,{onClick:d,disabled:c,children:[c?a.jsx(Dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(qt,{className:"mr-1.5 h-3.5 w-3.5"}),"Update"]})]})]})})}function WM(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/1e3);if(n<60)return"just now";const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function YM(){const[e,t]=p.useState([]),[n,r]=p.useState(""),[s,o]=p.useState(!0),[i,l]=p.useState(null),u=p.useCallback((d,f="success")=>{l({msg:d,type:f}),setTimeout(()=>l(null),4e3)},[]);if(p.useEffect(()=>{ue.discovery.agents().then(d=>{const f=d.data??[];t(f),f.length>0&&!n&&r(f[0].registeredAgentId??f[0].id)}).catch(()=>{}).finally(()=>o(!1))},[]),s)return a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading agents..."});if(e.length===0)return a.jsxs("div",{className:"space-y-6",children:[a.jsx("h1",{className:"text-lg font-semibold",children:"Plugins"}),a.jsxs("div",{className:"flex h-60 flex-col items-center justify-center gap-3 rounded-lg border border-dashed border-border",children:[a.jsx(fa,{className:"h-10 w-10 text-muted-foreground/30"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents discovered yet"}),a.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Connect an agent with the Guards plugin to get started"})]})]});const c=e.find(d=>(d.registeredAgentId??d.id)===n),h=(c==null?void 0:c.plugins)??[];return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-lg font-semibold",children:"Plugins"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage OpenClaw plugins on remote agents"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs text-muted-foreground",children:"Agent:"}),a.jsx("select",{className:"h-8 rounded-md border border-input bg-background px-2 text-sm focus:outline-none focus:ring-1 focus:ring-ring",value:n,onChange:d=>r(d.target.value),children:e.map(d=>a.jsxs("option",{value:d.registeredAgentId??d.id,children:[d.emoji?`${d.emoji} `:"",d.name]},d.registeredAgentId??d.id))})]})]}),n&&a.jsxs(a.Fragment,{children:[a.jsx(GM,{agentId:n,showToast:u}),a.jsx(KM,{plugins:h,agentId:n,showToast:u}),a.jsx(XM,{agentId:n}),a.jsx(QM,{})]}),i&&a.jsxs("div",{className:`fixed bottom-6 right-6 z-[100] flex items-center gap-2 rounded-lg border px-4 py-3 shadow-lg animate-in slide-in-from-bottom-4 ${i.type==="success"?"border-emerald-500/30 bg-emerald-50 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200":"border-destructive/30 bg-red-50 text-red-800 dark:bg-red-950 dark:text-red-200"}`,children:[i.type==="success"?a.jsx(xr,{className:"h-4 w-4"}):a.jsx(zt,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:i.msg}),a.jsx("button",{onClick:()=>l(null),className:"ml-2 text-current/50 hover:text-current",children:"×"})]})]})}function GM({agentId:e,showToast:t}){const[n,r]=p.useState(!1),[s,o]=p.useState(!1);return a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(J,{size:"sm",onClick:()=>r(!0),children:[a.jsx(Yn,{className:"mr-1.5 h-3.5 w-3.5"})," Install Plugin"]}),a.jsxs(J,{size:"sm",variant:"outline",onClick:()=>o(!0),children:[a.jsx($t,{className:"mr-1.5 h-3.5 w-3.5"})," Uninstall Plugin"]}),a.jsx(qM,{open:n,onOpenChange:r,agentId:e,showToast:t}),a.jsx(Uv,{open:s,onOpenChange:o,agentId:e,showToast:t})]})}function KM({plugins:e,agentId:t,showToast:n}){const[r,s]=p.useState(null);return a.jsxs(a.Fragment,{children:[a.jsxs(Ee,{children:[a.jsx(De,{children:a.jsxs($e,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Zi,{className:"h-4 w-4"})," Installed Plugins (",e.length,")"]})}),a.jsx(Te,{children:e.length===0?a.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[a.jsx(Zi,{className:"h-10 w-10 text-muted-foreground/20"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins detected"}),a.jsx("p",{className:"text-xs text-muted-foreground/70",children:"Plugin information is reported by the Guards agent"})]}):a.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:e.map(o=>a.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border p-3 transition-colors hover:bg-muted/30",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-muted",children:a.jsx(Zi,{className:"h-4 w-4 text-muted-foreground"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium",children:o.name}),a.jsx(be,{variant:o.enabled?"default":"secondary",className:"text-[10px]",children:o.enabled?"Enabled":"Disabled"})]})]}),a.jsx(J,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>s(o.name),children:a.jsx($t,{className:"h-3.5 w-3.5"})})]},o.name))})})]}),a.jsx(Uv,{open:r!==null,onOpenChange:o=>{o||s(null)},agentId:t,showToast:n,initialId:r??""})]})}function XM({agentId:e}){const[t,n]=p.useState([]),[r,s]=p.useState(!0),[o,i]=p.useState(null),l=p.useCallback(()=>{ue.commands.list(e).then(c=>{const h=(c.data??[]).filter(d=>d.type==="install_plugin"||d.type==="uninstall_plugin");n(h)}).catch(()=>{}).finally(()=>s(!1))},[e]);p.useEffect(()=>{l()},[l]),p.useEffect(()=>{if(!t.some(d=>d.status==="pending"||d.status==="running"))return;const h=setInterval(l,5e3);return()=>clearInterval(h)},[t,l]);const u=c=>c==="completed"?a.jsx(xr,{className:"h-3.5 w-3.5 text-emerald-500"}):c==="failed"?a.jsx(zt,{className:"h-3.5 w-3.5 text-destructive"}):c==="running"?a.jsx(Dt,{className:"h-3.5 w-3.5 animate-spin text-amber-500"}):a.jsx(Wx,{className:"h-3.5 w-3.5 text-muted-foreground"});return r||t.length===0?null:a.jsxs(Ee,{children:[a.jsx(De,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs($e,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Ro,{className:"h-4 w-4"})," Plugin Command History"]}),a.jsxs(J,{size:"sm",variant:"ghost",onClick:l,children:[a.jsx(Gn,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]})}),a.jsx(Te,{className:"space-y-2",children:t.map(c=>{var x,y;const h=o===c.id,d=c.type==="install_plugin"?"Install Plugin":"Uninstall Plugin",f=((x=c.payload)==null?void 0:x.spec)||((y=c.payload)==null?void 0:y.pluginId)||"";return a.jsxs("div",{className:"rounded-lg border border-border transition-colors hover:bg-muted/20",children:[a.jsxs("div",{className:"flex cursor-pointer items-center gap-3 px-4 py-3",onClick:()=>c.result&&i(h?null:c.id),children:[u(c.status),a.jsx("span",{className:"text-xs font-medium",children:d}),f&&a.jsxs("span",{className:"text-xs text-muted-foreground",children:['"',f,'"']}),a.jsx("div",{className:"flex-1"}),a.jsx(be,{variant:c.status==="completed"?"default":c.status==="failed"?"destructive":"secondary",className:"text-[10px]",children:c.status}),a.jsx("span",{className:"text-[11px] text-muted-foreground",children:ZM(c.createdAt)}),c.result&&(h?a.jsx(ha,{className:"h-3.5 w-3.5 text-muted-foreground"}):a.jsx(Xd,{className:"h-3.5 w-3.5 text-muted-foreground"}))]}),h&&c.result&&a.jsx("div",{className:"border-t border-border bg-muted/30 px-4 py-3",children:a.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap rounded-md bg-background p-2.5 font-mono text-[11px] text-muted-foreground",children:typeof c.result=="string"?c.result:JSON.stringify(c.result,null,2)})})]},c.id)})})]})}function QM(){return a.jsxs(Ee,{children:[a.jsx(De,{children:a.jsx($e,{className:"text-sm",children:"How Plugins Work"})}),a.jsxs(Te,{className:"text-xs text-muted-foreground space-y-2",children:[a.jsx("p",{children:"OpenClaw plugins extend agent capabilities. They can be installed from npm or local paths."}),a.jsx("p",{children:"Common plugin specs:"}),a.jsxs("ul",{className:"list-inside list-disc space-y-0.5 pl-2",children:[a.jsxs("li",{children:[a.jsx("code",{className:"rounded bg-muted px-1",children:"@openclaw/voice-call"})," — Voice calling plugin"]}),a.jsxs("li",{children:[a.jsx("code",{className:"rounded bg-muted px-1",children:"@opentrust/guards"})," — Security guard plugin"]}),a.jsxs("li",{children:[a.jsx("code",{className:"rounded bg-muted px-1",children:"/path/to/plugin"})," — Local plugin path"]})]}),a.jsxs("p",{children:["Commands are executed via ",a.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins install/uninstall"})," on the agent. See ",a.jsx("a",{href:"https://docs.openclaw.ai/cli/plugins",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"OpenClaw Plugins docs"}),"."]})]})]})}function qM({open:e,onOpenChange:t,agentId:n,showToast:r}){const[s,o]=p.useState(""),[i,l]=p.useState(!1),[u,c]=p.useState(""),h=()=>{o(""),c("")},d=async()=>{if(s.trim()){l(!0),c("");try{await ue.commands.create({agentId:n,type:"install_plugin",payload:{spec:s.trim()}}),h(),t(!1),r("Plugin install command sent","success")}catch(f){const x=f instanceof Error?f.message:"Failed to send command";c(x)}finally{l(!1)}}};return a.jsx(_s,{open:e,onOpenChange:f=>{f||h(),t(f)},children:a.jsxs(jr,{className:"sm:max-w-[480px]",children:[a.jsxs(Ps,{children:[a.jsxs(Cr,{className:"flex items-center gap-2",children:[a.jsx(Yn,{className:"h-4 w-4"})," Install Plugin"]}),a.jsx(Er,{children:"Install an OpenClaw plugin via npm package name or local path."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(wt,{htmlFor:"plugin-spec",children:"Plugin Spec"}),a.jsx(ot,{id:"plugin-spec",placeholder:"e.g. @openclaw/voice-call, @opentrust/guards, /path/to/plugin",value:s,onChange:f=>{o(f.target.value),c("")},onKeyDown:f=>f.key==="Enter"&&d()}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Executes ",a.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins install <spec>"})," on the agent."]})]}),u&&a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:[a.jsx(zt,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:u})]}),a.jsxs(Ms,{children:[a.jsx(J,{variant:"outline",onClick:()=>{h(),t(!1)},children:"Cancel"}),a.jsxs(J,{onClick:d,disabled:i||!s.trim(),children:[i?a.jsx(Dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(Yn,{className:"mr-1.5 h-3.5 w-3.5"}),"Install"]})]})]})})}function Uv({open:e,onOpenChange:t,agentId:n,showToast:r,initialId:s}){const[o,i]=p.useState(s??""),[l,u]=p.useState(!1),[c,h]=p.useState("");p.useEffect(()=>{s&&i(s)},[s]);const d=async()=>{if(o.trim()){u(!0),h("");try{await ue.commands.create({agentId:n,type:"uninstall_plugin",payload:{pluginId:o.trim()}}),i(""),t(!1),r("Plugin uninstall command sent","success")}catch(f){const x=f instanceof Error?f.message:"Failed to send command";h(x)}finally{u(!1)}}};return a.jsx(_s,{open:e,onOpenChange:t,children:a.jsxs(jr,{className:"sm:max-w-[400px]",children:[a.jsxs(Ps,{children:[a.jsxs(Cr,{className:"flex items-center gap-2",children:[a.jsx($t,{className:"h-4 w-4"})," Uninstall Plugin"]}),a.jsx(Er,{children:"Remove an OpenClaw plugin from the agent."})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(wt,{htmlFor:"plugin-id",children:"Plugin ID"}),a.jsx(ot,{id:"plugin-id",placeholder:"e.g. voice-call, opentrust-guard",value:o,onChange:f=>{i(f.target.value),h("")},onKeyDown:f=>f.key==="Enter"&&d()}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Executes ",a.jsx("code",{className:"rounded bg-muted px-1",children:"openclaw plugins uninstall <id> --force"})," on the agent."]})]}),c&&a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:[a.jsx(zt,{className:"h-3.5 w-3.5 shrink-0"}),a.jsx("span",{children:c})]}),a.jsxs(Ms,{children:[a.jsx(J,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),a.jsxs(J,{variant:"destructive",onClick:d,disabled:l||!o.trim(),children:[l?a.jsx(Dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx($t,{className:"mr-1.5 h-3.5 w-3.5"}),"Uninstall"]})]})]})})}function ZM(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/1e3);if(n<60)return"just now";const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function JM(e){if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return`${(e/Math.pow(t,r)).toFixed(1)} ${n[r]}`}function eI(){const[e,t]=p.useState([]),[n,r]=p.useState(!0),[s,o]=p.useState("dashboard"),i=p.useCallback(()=>{ue.system.services().then(l=>t(l.data??[])).catch(()=>{}).finally(()=>r(!1))},[]);return p.useEffect(()=>{i()},[i]),p.useEffect(()=>{const l=setInterval(i,1e4);return()=>clearInterval(l)},[i]),n?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h1",{className:"text-lg font-semibold",children:"System"}),a.jsxs(J,{size:"sm",variant:"ghost",onClick:i,children:[a.jsx(Gn,{className:"mr-1.5 h-3.5 w-3.5"})," Refresh"]})]}),a.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:e.map(l=>a.jsx(Ee,{className:`cursor-pointer transition-all ${s===l.key?"ring-2 ring-primary shadow-sm":"hover:bg-muted/30"}`,onClick:()=>o(l.key),children:a.jsxs(Te,{className:"flex items-center gap-3 p-4",children:[a.jsx("div",{className:`flex h-10 w-10 items-center justify-center rounded-lg ${l.healthy?"bg-emerald-100 dark:bg-emerald-950":l.running?"bg-amber-100 dark:bg-amber-950":"bg-muted"}`,children:a.jsx(Qd,{className:`h-5 w-5 ${l.healthy?"text-emerald-600 dark:text-emerald-400":l.running?"text-amber-600 dark:text-amber-400":"text-muted-foreground"}`})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("p",{className:"text-sm font-medium",children:l.name}),a.jsx(Fb,{className:`h-2 w-2 fill-current ${l.healthy?"text-emerald-500":l.running?"text-amber-500":"text-muted-foreground/40"}`})]}),a.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[a.jsxs("span",{children:[":",l.port]}),l.pid&&a.jsxs("span",{children:["PID ",l.pid]}),l.logSize>0&&a.jsx("span",{children:JM(l.logSize)})]})]}),a.jsx(be,{variant:l.healthy?"default":l.running?"secondary":"outline",className:`text-[10px] ${l.healthy?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/20":""}`,children:l.healthy?"Healthy":l.running?"Running":"Stopped"})]})},l.key))}),s&&a.jsx(tI,{service:s})]})}function tI({service:e}){const[t,n]=p.useState([]),[r,s]=p.useState(0),[o,i]=p.useState(""),[l,u]=p.useState(!0),[c,h]=p.useState(!0),[d,f]=p.useState(!0),[x,y]=p.useState(200),w=p.useRef(null),S=p.useRef(null),m=p.useCallback(b=>{const k=b??x;ue.system.logs(e,k).then(j=>{n(j.data.lines),s(j.data.total),i(j.data.lastModified)}).catch(()=>{}).finally(()=>u(!1))},[e,x]);p.useEffect(()=>{u(!0),n([]),m()},[e]),p.useEffect(()=>{m()},[x]),p.useEffect(()=>{c&&w.current&&(w.current.scrollTop=w.current.scrollHeight)},[t,c]),p.useEffect(()=>(d?S.current=setInterval(()=>m(),3e3):S.current&&(clearInterval(S.current),S.current=null),()=>{S.current&&clearInterval(S.current)}),[d,m]);const v=async()=>{try{await ue.system.clearLog(e),n([]),s(0)}catch{}},g=()=>{y(b=>Math.min(b+500,2e3))},N=e.charAt(0).toUpperCase()+e.slice(1);return a.jsxs(Ee,{children:[a.jsx(De,{className:"pb-3",children:a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsxs($e,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Es,{className:"h-4 w-4"})," ",N," Logs",a.jsxs(be,{variant:"outline",className:"text-[10px] font-normal",children:[r.toLocaleString()," lines"]}),o&&a.jsxs("span",{className:"text-[11px] font-normal text-muted-foreground",children:["Updated ",new Date(o).toLocaleTimeString()]})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[r>x&&a.jsx(J,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:g,children:"Load more"}),a.jsxs(J,{size:"sm",variant:d?"default":"outline",className:"h-7 text-xs",onClick:()=>{f(!d),h(!d)},children:[d?a.jsx(Xb,{className:"mr-1 h-3 w-3"}):a.jsx(Il,{className:"mr-1 h-3 w-3"}),d?"Pause":"Tail"]}),a.jsxs(J,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>{var b;h(!0),(b=w.current)==null||b.scrollTo({top:w.current.scrollHeight,behavior:"smooth"})},children:[a.jsx(zb,{className:"mr-1 h-3 w-3"})," Bottom"]}),a.jsxs(J,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>m(),children:[a.jsx(Gn,{className:"mr-1 h-3 w-3"})," Refresh"]}),a.jsxs(J,{size:"sm",variant:"ghost",className:"h-7 text-xs text-destructive hover:text-destructive",onClick:v,children:[a.jsx($t,{className:"mr-1 h-3 w-3"})," Clear"]})]})]})}),a.jsx(Te,{className:"p-0",children:l?a.jsx("div",{className:"flex h-60 items-center justify-center",children:a.jsx(Dt,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):t.length===0?a.jsxs("div",{className:"flex h-60 flex-col items-center justify-center gap-2",children:[a.jsx(Ab,{className:"h-8 w-8 text-muted-foreground/20"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"No log output"})]}):a.jsx("div",{ref:w,className:"h-[calc(100vh-420px)] min-h-[300px] overflow-auto border-t border-border bg-zinc-950 dark:bg-zinc-950",onScroll:()=>{if(!w.current)return;const{scrollTop:b,scrollHeight:k,clientHeight:j}=w.current,_=k-b-j<40;h(_)},children:a.jsx("pre",{className:"p-4 text-xs leading-5 font-mono text-zinc-300",children:t.map((b,k)=>a.jsx(nI,{line:b,lineNum:r-t.length+k+1},k))})})})]})}function nI({line:e,lineNum:t}){const n=rI(e);return a.jsxs("div",{className:"group flex hover:bg-white/5",children:[a.jsx("span",{className:"mr-3 inline-block w-10 select-none text-right text-zinc-600 group-hover:text-zinc-500",children:t}),a.jsx("span",{className:n,children:e}),`
377
+ `]})}function rI(e){const t=e.toLowerCase();return t.includes("error")||t.includes("err ")||t.includes("fatal")?"text-red-400":t.includes("warn")||t.includes("warning")?"text-amber-400":t.includes("debug")||t.includes("dbg ")?"text-zinc-500":/\b(get|post|put|delete|patch)\b/i.test(e)?"text-sky-400":t.includes("info")||t.includes("listening")||t.includes("started")||t.includes("running")?"text-emerald-400":"text-zinc-300"}const sI=[{key:"og_core_url",label:"Core API URL",icon:Qd,placeholder:"http://localhost:53666",description:"OpenTrust Core service endpoint"},{key:"og_core_key",label:"Core API Key",icon:Wb,placeholder:"sk-og-***",description:"API key for Core authentication (masked for security)",sensitive:!0},{key:"gateway_url",label:"Gateway URL",icon:Kx,placeholder:"http://localhost:8900",description:"AI Gateway proxy endpoint"},{key:"dashboard_mode",label:"Dashboard Mode",icon:Zb,placeholder:"selfhosted",description:"Deployment mode: selfhosted or embedded"},{key:"database_url",label:"Database URL",icon:Vb,placeholder:"file:./data/dashboard.db",description:"Database connection string",sensitive:!0}];function oI(){const[e,t]=p.useState({}),[n,r]=p.useState({}),[s,o]=p.useState(!0),[i,l]=p.useState(!1),[u,c]=p.useState(null),[h,d]=p.useState(null),[f,x]=p.useState(!1),y=()=>{o(!0),ue.settings.get().then(N=>{const b=N.data??{};t(b),r(b)}).catch(()=>{}).finally(()=>o(!1))};p.useEffect(()=>{y()},[]);const w=()=>Object.keys(e).some(N=>e[N]!==n[N]),S=async()=>{l(!0);try{const N={};for(const[b,k]of Object.entries(e))k!==n[b]&&(N[b]=k);Object.keys(N).length>0&&(await ue.settings.update(N),r({...e}),v("Settings saved","success"))}catch(N){v(N instanceof Error?N.message:"Failed to save","error")}finally{l(!1)}},m=async()=>{x(!0),d(null);try{const b=await(await fetch("/api/settings/test-connection",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${JSON.parse(localStorage.getItem("opentrust_user")||"{}").apiKey||""}`}})).json();b.success&&d(b.data)}catch{d({connected:!1,message:"Request failed"})}finally{x(!1)}},v=(N,b)=>{c({msg:N,type:b}),setTimeout(()=>c(null),3e3)},g=(N,b)=>{t(k=>({...k,[N]:b}))};return s?a.jsx("div",{className:"flex h-40 items-center justify-center text-sm text-muted-foreground",children:"Loading settings..."}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-lg font-semibold",children:"Settings"}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure OpenTrust system settings"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(J,{size:"sm",variant:"ghost",onClick:y,children:[a.jsx(Gn,{className:"mr-1.5 h-3.5 w-3.5"})," Reload"]}),a.jsxs(J,{size:"sm",onClick:S,disabled:i||!w(),children:[i?a.jsx(Dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(Qb,{className:"mr-1.5 h-3.5 w-3.5"}),"Save Changes"]})]})]}),a.jsxs(Ee,{children:[a.jsx(De,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs($e,{className:"flex items-center gap-2 text-sm",children:[a.jsx(Qd,{className:"h-4 w-4"})," Service Connection"]}),a.jsxs(J,{size:"sm",variant:"outline",onClick:m,disabled:f,children:[f?a.jsx(Dt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):a.jsx(Gn,{className:"mr-1.5 h-3.5 w-3.5"}),"Test Connection"]})]})}),a.jsx(Te,{children:h?a.jsxs("div",{className:`flex items-center gap-2 rounded-md border px-3 py-2 text-sm ${h.connected?"border-emerald-500/30 bg-emerald-50 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200":"border-destructive/30 bg-red-50 text-red-800 dark:bg-red-950 dark:text-red-200"}`,children:[h.connected?a.jsx(xr,{className:"h-4 w-4"}):a.jsx(zt,{className:"h-4 w-4"}),a.jsx("span",{children:h.message}),h.url&&a.jsx(be,{variant:"outline",className:"ml-auto text-[10px]",children:h.url})]}):a.jsx("p",{className:"text-xs text-muted-foreground",children:'Click "Test Connection" to verify Core service connectivity'})})]}),a.jsxs(Ee,{children:[a.jsx(De,{children:a.jsxs($e,{className:"flex items-center gap-2 text-sm",children:[a.jsx(qt,{className:"h-4 w-4"})," Configuration"]})}),a.jsx(Te,{className:"space-y-5",children:sI.map(N=>{const b=N.icon,k=e[N.key]!==n[N.key];return a.jsxs("div",{className:"space-y-1.5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(b,{className:"h-3.5 w-3.5 text-muted-foreground"}),a.jsx(wt,{htmlFor:N.key,className:"text-sm font-medium",children:N.label}),k&&a.jsx(be,{variant:"secondary",className:"text-[10px]",children:"Modified"})]}),a.jsx(ot,{id:N.key,value:e[N.key]??"",onChange:j=>g(N.key,j.target.value),placeholder:N.placeholder,className:"font-mono text-sm"}),a.jsx("p",{className:"text-[11px] text-muted-foreground",children:N.description})]},N.key)})})]}),a.jsxs(Ee,{children:[a.jsx(De,{children:a.jsx($e,{className:"text-sm",children:"Environment"})}),a.jsx(Te,{children:a.jsxs("div",{className:"grid gap-3 text-xs sm:grid-cols-2",children:[a.jsx(Di,{label:"Dashboard Mode",value:e.dashboard_mode||"selfhosted"}),a.jsx(Di,{label:"Core URL",value:e.og_core_url||"http://localhost:53666"}),a.jsx(Di,{label:"Gateway URL",value:e.gateway_url||"http://localhost:8900"}),a.jsx(Di,{label:"Database",value:e.database_url?"Custom":"SQLite (default)"})]})})]}),u&&a.jsxs("div",{className:`fixed bottom-6 right-6 z-[100] flex items-center gap-2 rounded-lg border px-4 py-3 shadow-lg animate-in slide-in-from-bottom-4 ${u.type==="success"?"border-emerald-500/30 bg-emerald-50 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200":"border-destructive/30 bg-red-50 text-red-800 dark:bg-red-950 dark:text-red-200"}`,children:[u.type==="success"?a.jsx(xr,{className:"h-4 w-4"}):a.jsx(zt,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:u.msg})]})]})}function Di({label:e,value:t}){return a.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2",children:[a.jsx("span",{className:"text-muted-foreground",children:e}),a.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 text-[11px]",children:t})]})}function iI(){const[e,t]=p.useState([]),[n,r]=p.useState(!0),[s,o]=p.useState(null),[i,l]=p.useState(null),u=p.useCallback(async()=>{try{const d=await ue.hosts.list();t(d.data)}catch{}finally{r(!1)}},[]);p.useEffect(()=>{u();const d=setInterval(u,15e3);return()=>clearInterval(d)},[u]),p.useEffect(()=>{if(!i)return;const d=setTimeout(()=>l(null),4e3);return()=>clearTimeout(d)},[i]);const c=(d,f)=>l({msg:d,type:f}),h=async d=>{try{await ue.hosts.remove(d),t(f=>f.filter(x=>x.id!==d)),c("Host removed","success")}catch{c("Failed to remove host","error")}};return n?a.jsx("div",{className:"flex items-center justify-center py-24",children:a.jsx(Dt,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):a.jsxs("div",{className:"space-y-6 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Hosts"}),a.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage machines running OpenTrust CLI"})]}),a.jsxs(J,{variant:"outline",size:"sm",onClick:u,children:[a.jsx(Gn,{className:"h-4 w-4 mr-1"})," Refresh"]})]}),e.length===0?a.jsxs(Ee,{className:"p-8 text-center",children:[a.jsx(Xx,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),a.jsx("h3",{className:"text-lg font-medium mb-2",children:"No hosts connected"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4 max-w-md mx-auto",children:"Use the CLI to connect a host to this Dashboard:"}),a.jsx("code",{className:"block bg-muted rounded px-3 py-2 text-xs font-mono max-w-lg mx-auto",children:"opentrust connect --dashboard-url http://this-host:53667 --api-key sk-og-xxx"})]}):a.jsx("div",{className:"space-y-3",children:e.map(d=>a.jsx("div",{children:a.jsx(lI,{host:d,expanded:s===d.id,onToggle:()=>o(s===d.id?null:d.id),onRemove:()=>h(d.id),showToast:c})},d.id))}),i&&a.jsxs("div",{className:`fixed bottom-6 right-6 z-50 flex items-center gap-2 rounded-lg px-4 py-3 text-sm shadow-lg ${i.type==="success"?"bg-green-600 text-white":"bg-red-600 text-white"}`,children:[i.type==="success"?a.jsx(xr,{className:"h-4 w-4"}):a.jsx(zt,{className:"h-4 w-4"}),i.msg]})]})}function lI({host:e,expanded:t,onToggle:n,onRemove:r,showToast:s}){const o=e.status==="online",i=e.services??{},l=Object.values(i).filter(c=>c.running).length,u=Object.keys(i).length;return e.metadata,a.jsxs(Ee,{className:"overflow-hidden",children:[a.jsxs("button",{onClick:n,className:"w-full flex items-center gap-4 p-4 hover:bg-accent/30 transition-colors text-left",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[a.jsx("div",{className:`h-2.5 w-2.5 rounded-full shrink-0 ${o?"bg-green-500":"bg-gray-400"}`}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-medium truncate",children:e.hostname}),a.jsx(be,{variant:o?"default":"secondary",className:"text-[10px] px-1.5",children:o?"online":"offline"})]}),a.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground mt-0.5",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Kx,{className:"h-3 w-3"})," ",e.ip]}),a.jsxs("span",{children:[e.os," / ",e.arch]}),a.jsxs("span",{children:["CLI v",e.cliVersion]}),a.jsxs("span",{children:[l,"/",u," services"]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex gap-1",children:Object.entries(i).map(([c,h])=>a.jsx("span",{title:`${h.name}: ${h.running?h.healthy?"healthy":"running":"stopped"}`,className:`inline-block h-4 w-4 rounded text-[8px] font-bold flex items-center justify-center ${h.running?h.healthy?"bg-green-500/20 text-green-700 dark:text-green-400":"bg-yellow-500/20 text-yellow-700 dark:text-yellow-400":"bg-gray-500/20 text-gray-500"}`,children:c[0].toUpperCase()},c))}),t?a.jsx(Ob,{className:"h-4 w-4 text-muted-foreground"}):a.jsx(ha,{className:"h-4 w-4 text-muted-foreground"})]})]}),t&&a.jsx("div",{className:"border-t border-border",children:a.jsx(aI,{host:e,onRemove:r,showToast:s})})]})}function aI({host:e,onRemove:t,showToast:n}){const[r,s]=p.useState("services");return a.jsxs(wf,{value:r,onValueChange:s,className:"w-full",children:[a.jsxs(Pa,{className:"w-full justify-start rounded-none border-b bg-transparent px-4 pt-2",children:[a.jsx(gt,{value:"services",children:"Services"}),a.jsx(gt,{value:"logs",children:"Logs"}),a.jsx(gt,{value:"upgrade",children:"Upgrade"}),a.jsx(gt,{value:"config",children:"Config"}),a.jsx(gt,{value:"commands",children:"Commands"}),a.jsx(gt,{value:"info",children:"Info"})]}),a.jsxs("div",{className:"p-4",children:[a.jsx(xt,{value:"services",className:"mt-0",children:a.jsx(uI,{host:e,showToast:n})}),a.jsx(xt,{value:"logs",className:"mt-0",children:a.jsx(cI,{host:e,showToast:n})}),a.jsx(xt,{value:"upgrade",className:"mt-0",children:a.jsx(dI,{host:e,showToast:n})}),a.jsx(xt,{value:"config",className:"mt-0",children:a.jsx(fI,{host:e,showToast:n})}),a.jsx(xt,{value:"commands",className:"mt-0",children:a.jsx(hI,{hostId:e.id})}),a.jsx(xt,{value:"info",className:"mt-0",children:a.jsx(mI,{host:e,onRemove:t})})]})]})}function uI({host:e,showToast:t}){const n=e.services??{},[r,s]=p.useState(null),o=async(i,l)=>{s(`${i}-${l}`);try{await ue.hosts.sendCommand({hostId:e.id,type:i,payload:{service:l}}),t(`${i.replace("_"," ")} "${l}" sent`,"success")}catch{t(`Failed to send ${i}`,"error")}finally{s(null)}};return a.jsxs("div",{className:"space-y-2",children:[Object.entries(n).map(([i,l])=>a.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-4 py-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:`h-2 w-2 rounded-full ${l.running?l.healthy?"bg-green-500":"bg-yellow-500":"bg-gray-400"}`}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-sm",children:l.name}),a.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:[":",l.port]}),l.pid&&a.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["PID ",l.pid]})]})]}),a.jsx("div",{className:"flex items-center gap-1",children:l.running?a.jsxs(a.Fragment,{children:[a.jsxs(J,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("restart_service",i),children:[a.jsx(jc,{className:"h-3 w-3 mr-1"})," Restart"]}),a.jsxs(J,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("stop_service",i),children:[a.jsx(Cc,{className:"h-3 w-3 mr-1"})," Stop"]})]}):a.jsxs(J,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("start_service",i),children:[a.jsx(Il,{className:"h-3 w-3 mr-1"})," Start"]})})]},i)),a.jsxs("div",{className:"flex gap-2 pt-2",children:[a.jsxs(J,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("start_service","all"),children:[a.jsx(Il,{className:"h-3 w-3 mr-1"})," Start All"]}),a.jsxs(J,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("stop_service","all"),children:[a.jsx(Cc,{className:"h-3 w-3 mr-1"})," Stop All"]}),a.jsxs(J,{variant:"outline",size:"sm",disabled:r!==null,onClick:()=>o("restart_service","all"),children:[a.jsx(jc,{className:"h-3 w-3 mr-1"})," Restart All"]})]})]})}function cI({host:e,showToast:t}){const n=Object.keys(e.services??{}),[r,s]=p.useState(n[0]??"core"),[o,i]=p.useState(null),[l,u]=p.useState(!1),c=async()=>{u(!0);try{await ue.hosts.sendCommand({hostId:e.id,type:"fetch_logs",payload:{service:r,lines:200}}),t("Log fetch command sent. Check Commands tab for result.","success")}catch{t("Failed to send fetch_logs command","error")}finally{u(!1)}};return a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(wt,{children:"Service:"}),a.jsx("select",{className:"rounded border border-border bg-background px-2 py-1 text-sm",value:r,onChange:h=>s(h.target.value),children:n.map(h=>a.jsx("option",{value:h,children:h},h))}),a.jsxs(J,{variant:"outline",size:"sm",onClick:c,disabled:l,children:[a.jsx(Es,{className:"h-3 w-3 mr-1"})," Fetch Logs"]})]}),a.jsx("p",{className:"text-xs text-muted-foreground",children:'The fetch_logs command is sent to the host CLI daemon. View the result in the "Commands" tab once completed.'})]})}function dI({host:e,showToast:t}){const[n,r]=p.useState(""),[s,o]=p.useState(!1),i=async()=>{o(!0);try{await ue.hosts.sendCommand({hostId:e.id,type:"upgrade",payload:n?{version:n}:{}}),t("Upgrade command sent","success")}catch{t("Failed to send upgrade command","error")}finally{o(!1)}};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[a.jsxs("span",{children:["Current CLI version: ",a.jsxs("strong",{children:["v",e.cliVersion]})]}),a.jsxs("span",{children:["Project mode: ",a.jsx(be,{variant:"secondary",children:e.projectMode})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ot,{placeholder:"Target version (empty = latest)",value:n,onChange:l=>r(l.target.value),className:"max-w-xs"}),a.jsxs(J,{onClick:i,disabled:s,children:[a.jsx(Yx,{className:"h-4 w-4 mr-1"})," Upgrade"]})]}),a.jsxs("p",{className:"text-xs text-muted-foreground",children:["Runs ",a.jsx("code",{children:"npm install -g @opentrust/cli@version"})," and upgrades project packages on the remote host."]})]})}function fI({host:e,showToast:t}){const[n,r]=p.useState(""),[s,o]=p.useState(""),[i,l]=p.useState(!1),u=async()=>{if(n){l(!0);try{await ue.hosts.sendCommand({hostId:e.id,type:"update_env",payload:{key:n,value:s}}),t(`ENV update sent: ${n}`,"success"),r(""),o("")}catch{t("Failed to send config update","error")}finally{l(!1)}}};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("p",{className:"text-sm text-muted-foreground",children:["Update environment variables in the remote host's ",a.jsx("code",{children:".env"})," file."]}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 max-w-lg",children:[a.jsxs("div",{children:[a.jsx(wt,{className:"text-xs",children:"Key"}),a.jsx(ot,{placeholder:"e.g. CORE_API_KEY",value:n,onChange:c=>r(c.target.value)})]}),a.jsxs("div",{children:[a.jsx(wt,{className:"text-xs",children:"Value"}),a.jsx(ot,{placeholder:"Value",value:s,onChange:c=>o(c.target.value)})]})]}),a.jsxs(J,{size:"sm",onClick:u,disabled:i||!n,children:[a.jsx(qt,{className:"h-3 w-3 mr-1"})," Update .env"]})]})}function hI({hostId:e}){const[t,n]=p.useState([]),[r,s]=p.useState(!0),o=p.useCallback(async()=>{try{const u=await ue.hosts.commands(e);n(u.data)}catch{}s(!1)},[e]);p.useEffect(()=>{o();const u=setInterval(o,8e3);return()=>clearInterval(u)},[o]);const i=u=>{const c={pending:"bg-yellow-500/20 text-yellow-700 dark:text-yellow-400",running:"bg-blue-500/20 text-blue-700 dark:text-blue-400",completed:"bg-green-500/20 text-green-700 dark:text-green-400",failed:"bg-red-500/20 text-red-700 dark:text-red-400"};return a.jsx("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium ${c[u]??"bg-gray-500/20 text-gray-500"}`,children:u})},l=u=>({start_service:a.jsx(Il,{className:"h-3 w-3"}),stop_service:a.jsx(Cc,{className:"h-3 w-3"}),restart_service:a.jsx(jc,{className:"h-3 w-3"}),upgrade:a.jsx(Yx,{className:"h-3 w-3"}),fetch_logs:a.jsx(Es,{className:"h-3 w-3"}),update_env:a.jsx(qt,{className:"h-3 w-3"})})[u]??a.jsx(Ro,{className:"h-3 w-3"});return r?a.jsx("div",{className:"text-sm text-muted-foreground py-4",children:"Loading..."}):t.length===0?a.jsx("div",{className:"text-sm text-muted-foreground py-4",children:"No commands yet."}):a.jsx("div",{className:"space-y-2 max-h-[400px] overflow-y-auto",children:t.map(u=>a.jsxs("div",{className:"rounded border border-border p-3 text-sm",children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[l(u.type),a.jsx("span",{className:"font-medium",children:u.type.replace(/_/g," ")}),i(u.status)]}),a.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(u.createdAt).toLocaleString()})]}),u.payload&&a.jsx("pre",{className:"text-xs bg-muted rounded px-2 py-1 mt-1 overflow-x-auto",children:JSON.stringify(u.payload,null,2)}),u.result&&a.jsx("pre",{className:`text-xs rounded px-2 py-1 mt-1 overflow-x-auto ${u.status==="failed"?"bg-red-500/10":"bg-green-500/10"}`,children:JSON.stringify(u.result,null,2)})]},u.id))})}function mI({host:e,onRemove:t}){const n=e.metadata??{},[r,s]=p.useState(!1),o=[{label:"Host ID",value:e.id},{label:"Hostname",value:e.hostname},{label:"OS",value:`${e.os} (${e.arch})`},{label:"IP",value:e.ip},{label:"CLI Version",value:e.cliVersion},{label:"Project Mode",value:e.projectMode},{label:"Project Root",value:e.projectRoot},{label:"CPU",value:`${n.cpuModel} (${n.cpuCount} cores)`},{label:"Memory",value:`${n.freeMemMB} MB free / ${n.totalMemMB} MB total`},{label:"Node.js",value:String(n.nodeVersion??"")},{label:"Uptime",value:n.uptime?`${Math.round(Number(n.uptime)/3600)} hours`:""},{label:"Last Seen",value:new Date(e.lastSeenAt).toLocaleString()},{label:"Connected Since",value:new Date(e.createdAt).toLocaleString()}];return a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2",children:o.filter(i=>i.value).map(i=>a.jsxs("div",{className:"flex gap-2 text-sm py-1",children:[a.jsxs("span",{className:"text-muted-foreground min-w-[120px]",children:[i.label,":"]}),a.jsx("span",{className:"font-mono text-xs break-all",children:i.value})]},i.label))}),a.jsx("div",{className:"border-t border-border pt-4",children:a.jsxs(J,{variant:"destructive",size:"sm",onClick:()=>s(!0),children:[a.jsx($t,{className:"h-3 w-3 mr-1"})," Remove Host"]})}),a.jsx(_s,{open:r,onOpenChange:s,children:a.jsxs(jr,{children:[a.jsxs(Ps,{children:[a.jsx(Cr,{children:"Remove Host"}),a.jsxs(Er,{children:["Remove ",a.jsx("strong",{children:e.hostname})," from the Dashboard? The host will need to run"," ",a.jsx("code",{children:"opentrust connect"})," again to re-register."]})]}),a.jsxs(Ms,{children:[a.jsx(J,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),a.jsx(J,{variant:"destructive",onClick:()=>{s(!1),t()},children:"Remove"})]})]})})]})}function pI({children:e}){const{isAuthenticated:t,isLoading:n}=Gd();return n?a.jsx("div",{className:"flex min-h-screen items-center justify-center",children:a.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading..."})}):t?a.jsx(a.Fragment,{children:e}):a.jsx(Nc,{to:"/login",replace:!0})}function gI(){return a.jsxs(mS,{children:[a.jsx(We,{path:"/login",element:a.jsx(hk,{})}),a.jsxs(We,{element:a.jsx(pI,{children:a.jsx(fk,{})}),children:[a.jsx(We,{index:!0,element:a.jsx(Nc,{to:"/inventory/agents",replace:!0})}),a.jsx(We,{path:"/inventory/agents",element:a.jsx(pk,{})}),a.jsx(We,{path:"/inventory/agents/:id",element:a.jsx(yk,{})}),a.jsx(We,{path:"/inventory/identities",element:a.jsx(bk,{})}),a.jsx(We,{path:"/inventory/permissions",element:a.jsx(kk,{})}),a.jsx(We,{path:"/secure/risk",element:a.jsx(jk,{})}),a.jsx(We,{path:"/secure/graph",element:a.jsx(GP,{})}),a.jsx(We,{path:"/ops/skills",element:a.jsx($M,{})}),a.jsx(We,{path:"/ops/plugins",element:a.jsx(YM,{})}),a.jsx(We,{path:"/system/hosts",element:a.jsx(iI,{})}),a.jsx(We,{path:"/system/logs",element:a.jsx(eI,{})}),a.jsx(We,{path:"/system/settings",element:a.jsx(oI,{})})]}),a.jsx(We,{path:"*",element:a.jsx(Nc,{to:"/inventory/agents",replace:!0})})]})}Eu.createRoot(document.getElementById("root")).render(a.jsx(Ut.StrictMode,{children:a.jsx(OS,{basename:"/dashboard",children:a.jsx(XS,{children:a.jsx(ZS,{children:a.jsx(gI,{})})})})}));
378
+ //# sourceMappingURL=index-a6XIM1PE.js.map